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
refactor(pipeline): source law model from regelrecht-law-model in pipeline and harvester
Advies 11: the two remaining consumers that kept a partial mirror of the
canonical law-YAML model now source it from the leaf crate
regelrecht-law-model, so the executable model has a single definition.
pipeline:
- Replace the untyped serde_yaml_ng::Value treewalk in count_article_stats
(map.get("articles") / contains_key("machine_readable")) with a typed parse
into ArticleBasedLaw. The read/count side is now type-checked against the
single source of truth instead of stringly-typed field access.
- The surgical write path is intentionally left untouched: production
enrichment is performed by an external LLM subprocess that edits the file
directly, so there is no Rust-side model write to unify.
- Behavior change: a structurally-invalid law now surfaces as a parse error in
the count rather than being silently undercounted — desirable, since this
only runs on real harvested/enriched corpus files. Test fixtures updated to
realistic minimal laws; an empty-machine_readable edge case is added.
harvester:
- The writer stays a deliberate write-projection (it carries preamble,
organisation, cvdr_id and per-article references that the executable
ArticleBasedLaw does not, with bespoke quoting/indent post-processing), but
the internal YamlReference struct was a byte-identical duplicate of
types::Reference, so it is dropped and types::Reference is serialized
directly.
- Add regelrecht-law-model as a dev-dependency and two regression tests:
golden byte-identity for a BWB and a CVDR law (the repo previously only
asserted substrings), and a conformance test proving the harvested output
deserializes cleanly into ArticleBasedLaw.
0 commit comments