You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Close audit-writers blind-spot + lock in growth_media id patterns (#85)
Two small follow-ups to the recent schema-gap audit (#84):
- F7: scripts/audit_writers.py's writer-detection heuristic only caught
yaml.dump / yaml.safe_dump / path.write_text(yaml.dump(...)) patterns.
scripts/clean_metals_inplace.py mutates 149 community YAMLs via
regex/line-edit substitutions + path.write_text(string), bypassing
the detector entirely. Broaden the heuristic: a file that references
the kb/communities path literal AND round-trips the same path
variable through .read_text() and .write_text(...) is also a
community-YAML writer. clean_metals_inplace.py is the only script
that matches this pattern today; it now surfaces in the audit TSV
(correctly flagged validates_before_write=no,
appends_curation_history=no — slated for conversion as separate
work).
- Fix#5: GrowthMedia.culturemech_id and
GrowthMediaComponent.media_ingredient_mech_id had no pattern
declared, while the sibling RelatedMedia.culturemech_id /
RelatedIngredient.mediaingredientmech_id slots do. Live data
already conforms to the standard ^CultureMech:\d{6}$ /
^MediaIngredientMech:\d{6}$ format — just lock it in to catch
future drift at write time. Schema regenerated via `just gen-python`;
`validate_strict.py` still reports 0 ERROR rows across 265 files.
This PR does NOT convert clean_metals_inplace.py itself — that's a
separate, more invasive change (regex surgery → load/dump roundtrip
across 149 files). The audit-blind-spot fix above ensures the next
audit cycle surfaces it.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments