feat(evidence): define schema-bound extraction contract - #209
feat(evidence): define schema-bound extraction contract#209seonghobae wants to merge 32 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough버전 관리형 Changes추출 스키마 계약
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This PR adds a deterministic, schema-bound extraction contract without changing runtime capture or persistence behavior. The current head passes the listed checks, and no actionable merge-blocking risk remains beyond normal review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Partial implementation of #199.
Buyer-visible boundary
This branch starts the schema-bound extraction portion of the evidence-native replay track. The slice is deliberately deterministic and storage-neutral: a versioned extraction schema binds every typed field to explicit reviewed source channels and a deterministic normalization contract before any WARC persistence, PROV graph emission, browser capture, model interpretation, retention store, or replay runtime can claim authority.
Current exact state
main:b05d5acca82b9d916ada2c8e82f59f92a89817e1;b35d739017aa5d361b605be48045be50b5a35f6f;main; GitHub reports the PR open, Ready, and mergeable;COMMENTEDreviews are not approval.The branch was reconstructed onto the live protected base by another actor before this evidence refresh. The current branch/base relationship and exact-head evidence below were independently re-fetched; predecessor checks are not promoted.
Implemented contract
The implementation adds
ExtractionSchema,ExtractionField, typed value/cardinality metadata, explicit source-channel admission, and typedExtractionNormalizationRuleinoriginweave-evidence. Existing fields default toVerbatim; callers may explicitly chooseTrimTextWhitespacefor text orRfc3339Utcfor timestamp fields. Type-incompatible normalization fails closed withInvalidNormalizationRule. Schema and field identifiers are bounded and grammar-validated; field collections are bounded; fields require at least one reviewed source channel; duplicate channels and duplicate field identifiers fail closed. Reviewed source channels are stored through aBTreeSet, so their public representation is canonical set order rather than caller order. PublicExtractionSchemaErrorimplements deterministicDisplayandstd::error::Error.Cardinality and required status are one internally consistent presence contract.
ExtractionCardinality::Oneis necessarily required;ZeroOrOneis necessarily optional; contradictoryOne/optional andZeroOrOne/required declarations fail closed with typedInvalidCardinalityRequirement.Manyremains explicitly free to be required or optional because this value-object boundary does not define a minimum collection item count. ADR 0106 records these semantics and preserves the authority boundary: schema construction does not grant browser, network, model, secret, storage, retention, disclosure, or governance authority.Test-first repair lineage
The cardinality defect was reproduced before the production repair. Exact RED head
c5a87a64d96b12ef0399b72cb7d0ede3bb7e33d6failed CI run32619683199, Rust-contract job97145852556, becausefield_rejects_contradictory_required_cardinality_contractsobserved that both contradictory declarations still returnedOk.The canonical branch then added the typed cardinality/required check in
ExtractionField::new_with_normalization, exact typed-error assertions, the public error-contract assertion, a positiveMany/required case, and binding semantics in ADR 0106. Earlier valid findings were also repaired: neutral identifier error text, canonical source-channel set identity, ADR coverage, and doctoring traceability. All current inline review threads are resolved; informational identifier/cardinality notes do not create approval authority.Exact-current verification
For unchanged exact head
b35d739017aa5d361b605be48045be50b5a35f6fagainst protected mainb05d5acca82b9d916ada2c8e82f59f92a89817e1:32797549586: success;97651820715: exact-head checkout, repository contracts, canonical formatting, workspace/all-target check, full tests, strict Clippy, and API documentation/rustdoc success on the repository Rust 1.97.1 baseline;97651820781: success with exact owned-production function / line / region / branch coverage all 100%;9545376338,exact-coverage-b35d739017aa5d361b605be48045be50b5a35f6f, digestsha256:12ea3adc9a24216138c131f09d7eb3a8f31aaece2d44699bf31ee844f10eb91b;32797549659: success;32797549579: success;COMMENTEDonly; no qualifying independent approval is established; andNo Manifest V3 result is claimed because the exact-head workflow inventory does not expose an applicable MV3 run. No predecessor, queued, skipped, cancelled, synthetic-merge, status-only, or model-only evidence is promoted as current proof.
Truth boundary
This slice establishes the schema/admission/normalization/error contract only. It does not provide capture persistence, WARC records, PROV graphs, extracted-value runtime validation, browser evidence binding, tenant retention, offline replay, model-output authority, or closure of #199. Those remain dependency-ordered slices.
No workflow, secret, governance, release, tag, publish, approval, or merge mutation is included.