From c808340d3dd88ef5a29168e7f6fc593d36b8e9fa Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Tue, 3 Nov 2026 13:49:33 +0800 Subject: [PATCH] fix(contracts): accept recovery-lineage fields on corpora specs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit khm-latn.yaml (run-081 recovery record, 2026-10-29) records sources[].provenance, raw file sha256s and recovery_run — provenance the ledger must keep. The strict schema forbade the extra keys, so contract validation has been red on main since the record landed. Add the three fields as optional, typed; extra=forbid stays for everything else. --- src/pipeline/contracts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pipeline/contracts.py b/src/pipeline/contracts.py index 00911ff6..b12c87fa 100644 --- a/src/pipeline/contracts.py +++ b/src/pipeline/contracts.py @@ -69,6 +69,7 @@ class CorpusSource(_Strict): sha256: str | None = None license: str mount: str | None = None # container mount point for legacy scripts (e.g. /data-dia) + provenance: str | None = None # upstream URL + snapshot date for recovered corpora license_review: LicenseReview | None = None @model_validator(mode="after") @@ -94,6 +95,10 @@ class CorpusSpec(_Strict): task: TaskKind sources: list[CorpusSource] = Field(min_length=1) splits: dict[str, SplitSpec] + # recovery lineage: raw source files as staged + the run that rebuilt + # the splits (khm-latn recovery record) + raw: dict[str, dict[str, str | int]] | None = None + recovery_run: str | None = None @model_validator(mode="after") def _splits(self) -> CorpusSpec: