Skip to content

Evidence schema reconciliation

Issue #54 covers unknown fields, types, array/count bounds and byte ceilings across capacity, report and checkpoint evidence. This inventory records the admission contracts, corrective enforcement and verified legacy qualifications for the issue. Structural validation must be followed by canonical admission.

Current envelopes and owners

Envelope Schema or canonical owner Unknown fields Byte boundary
Capacity raw v1–v4 benchmarks/schema/performance-raw-v*.schema.json; validate_raw_report() Schema documents are mostly closed; runtime retains historical permissiveness at some boundaries, still subject to secret/nonfinite checks load_raw_report() reads at most 64 MiB+1, then checks actual bytes before decode
Capacity raw v5 Current raw schema and validate_raw_report() Closed envelope and selected records; every histogram/bucket field and integer is validated before analysis Same bounded file read; retained artifact hashing also observes the 64 MiB ceiling; direct Mapping validation is a different entry point
Capacity aborted v1 Aborted schema and _validate_aborted_report() Closed root; one known abort reason, unavailable measurements/cleanup, and exactly empty artifacts; UUID and normalized UTC calendar timestamps Raw reader boundary
Capacity summary v1–v4 Legacy summary schema documents No current comparison admission; cannot manufacture current control/provenance evidence No general summary-file reader identified
Capacity summary v5 Current summary schema, summarize_capacity(), compare_summaries() Closed root and evidence records; validated startup/histogram records; historically open curve items, subject to recursive safety and canonical projections Direct Mapping entry point; no independent file admission ceiling
Evaluation report v1/v2 load_report_json() / _report_from_dict() / EvaluationReport Several legacy structures discard unknown fields; typed identity/evidence extensions have their own closed decoders UTF-8 JSON admission at 16 MiB; report file reader uses cap+1 read
Evaluation checkpoint v1 load_checkpoint_json() / EvaluationCheckpoint.from_dict() and nested decoders Exact fields at checkpoint, identity, cursor, completed trial and several nested records 1 MiB UTF-8 payload; file reader uses cap+1 read

Discarded report fields are not arbitrary metadata support. They do not survive canonical reconstruction or serialization. Permissive legacy admission must not be described as a closed wire contract or as authority to retain private fields. Existing unavailable legacy evidence remains unavailable; no checksum, acquisition record or provenance is fabricated by this audit.

Structural inventory

These counts inspect explicit type: object / type: array declarations, including definitions, within each file. They do not expand references or claim runtime reachability. A closed count means additionalProperties: false; an array bound means a directly declared maxItems.

Schema Objects / closed Arrays / bounded
Aborted v1 1 / 1 0 / 0
Raw v1 17 / 16 5 / 1
Raw v2 18 / 17 5 / 1
Raw v3 24 / 23 5 / 1
Raw v4 32 / 31 5 / 1
Raw v5 45 / 44 5 / 1
Summary v1 4 / 2 1 / 0
Summary v2 4 / 2 2 / 0
Summary v3 4 / 2 2 / 0
Summary v4 5 / 3 3 / 0
Summary v5 8 / 6 5 / 0

Missing maxItems does not prove unbounded admission: file bytes, duration, work budgets or canonical count conservation can provide different limits. The collection table and corpus below record these different admission paths rather than inventing universal array ceilings.

Verified initial gap and corpus

The shared corpus in tests/unit/test_evidence_schema_agreement.py uses the standard Draft 2020-12 validator with a local registry of all committed capacity schemas and the canonical runtime reader. Its initial valid document and six unknown-field mutations agree at root, identity, counts, health, observations and startup. Two additional mutations reproduced a disagreement: the schema rejected unknown histogram/bucket fields, while raw v5 runtime accepted them. Raw v5 now checks those exact field sets before histogram analysis. Historical raw versions retain their existing admission behavior. Focused evidence changed from 2 failures/7 passes to 9 passes; the existing capacity analysis contracts also pass (141 tests).

The validator is a development dependency, with all references registered offline. Registry keys use the existing schema ID or a deterministic local namespace for the aborted schema without an ID. The test does not fetch remote schemas. The API follows the primary validation documentation and registry documentation.

Verified admission and qualifications

The corpus now has 129 cases: raw closure/types, every-bucket validation including empty counts and tails after a satisfied percentile, summary root/scope, canonical report/checkpoint mutation admission, growing-file byte boundaries, retained-artifact hash boundaries and safe decode/read diagnostics. Summary unknown-root and production-scope mutations reproduced two disagreements before correction. Bounded raw admission no longer trusts the earlier stat size or performs an unbounded text read. Private decode/read causes are suppressed in rendered diagnostics. Summary latency records now share current raw histogram admission, including unselected curve points. Three additional mutations cover unknown fields, invalid tails and invalid zero-count buckets; the published schema and summary comparison both reject them. Nested startup mutations reproduced four schema rejections admitted by comparison when matching copies were corrupted together. Comparison now uses the raw startup shape owner. Duplicate startup records are rejected and malformed records yield the fixed evidence error rather than KeyError. Coverage and uniqueness are semantic checks: the structural schema can admit incomplete or duplicate run sets. Raw run timestamp bounds are not present in summary records and are not fabricated. Candidate dirty flags require booleans before equality; a numeric zero previously compared equal to a retained false flag despite schema rejection. The corpus includes this counterexample. Eight report/checkpoint cases exercise complete trial arrays, missing and duplicate records, and boolean trial indices through canonical JSON decoders. Both reject these malformed arrays/counts; valid reports and fully completed checkpoints round-trip without changing retained evidence. Both report-v1 and report-v2 now exercise unknown/count mutations and completed-trial arrays, including checkpoints derived from each. The v2 fixture declares a synthetic typed Dataset Identity; optional provenance and execution evidence remain explicitly unavailable. Legacy unknown envelope fields are discarded in both report versions, while checkpoint envelopes remain closed. Summary curve item schemas retain historical open structure. A benign unknown field remains admitted by comparison but is unsupported: the builder emits only its six known fields and the comparison result does not retain extension data. Direct Mapping admission does not erase caller data or provide a metadata storage API. Two secret-like extension mutations reproduced a safety gap; comparison now applies the existing recursive secret/nonfinite check to the entire summary, including curve and first-nonpassing records, before checksum and semantic admission. Every curve point now requires a nonempty run array, integer trial count equal to its run count, and a result array of the same length containing known classifications. Five mutations reproduced three admissions of contradictory counts or result lengths; canonical comparison now rejects all five. Historical structural curve schemas remain open; arithmetic reconciliation is canonical. Selected capacity must equal the selected point's retained lower achieved-rate interval bound. A doubled-capacity mutation with a fresh checksum reproduced admission before this projection check. Every point also requires a positive finite scheduled rate, nonnegative finite median and two ordered nonnegative finite interval bounds. These shape/projection checks do not authenticate measurements or recreate confidence coverage from unavailable trial-rate observations. Five aborted-envelope cases cover valid admission, unknown fields, invented measurement availability, nonempty artifacts and impossible calendar timestamps. Calendar validation closed one reproduced schema/reader disagreement. Direct in-memory aborted validation permits the unsigned pre-publication builder shape; the persisted schema requires a digest and load_raw_report verifies it. No checksum or completed acquisition evidence is fabricated. Reason count is exactly one and artifact count zero; there are no independently extensible nested records in this envelope. Eight legacy cases cover raw v1–v4 with and without unknown root fields. Known vintage shapes pass their structural schemas; unknown roots are schema-rejected but historically reader-admitted. The reader returns no reconstructed upgrade and does not mutate these documents. Absent current execution/latency-reference evidence remains absent, and current capacity summarization rejects all four vintages. Unknown legacy fields are unsupported and may remain in caller/raw documents; unlike typed Evaluation Reports, this raw path does not promise to discard them. Fourteen JSON byte-edge cases cover report 16 MiB and checkpoint 1 MiB admission at cap−1, cap, and cap+1 for text and bytes. Whitespace-padded valid documents preserve canonical content at both admitted boundaries. Oversize invalid UTF-8 receives the size error before decoding. These readers bound parsing admission; text encoding and caller allocation occur before the byte check, so this is not a guarantee against the caller allocating oversized text. Three summary selection mutations reproduced admission of reversed curve order, earlier selection despite a later confirmed point, and an invented first-nonpassing record. Builder and comparison now share the existing selection owner: last point with at least five passing trials, and first later nonpassing point after any confirmation. Comparison requires strictly increasing scheduled rates and matching retained projections. This preserves the builder's existing behavior rather than changing the scientific selection policy or inventing unavailable raw measurements.

Collection or count Existing admission contract
Raw phase boundaries Exactly three ordered non-overlapping phases in schema and reader
Raw histogram buckets Schema has no independent length cap; current reader checks all field sets, integer values, increasing bounds and exact count sum, even for zero-count histograms
Raw time series At least one sample, strictly increasing elapsed time; no independent maxItems, subject to the raw file byte limit; numerical extension columns remain structurally open
Raw reasons Structural schemas retain a string array; canonical admission requires exact recomputed classification reasons, so arbitrary strings are not supported metadata
Raw retained artifacts At least one; no independent count ceiling, subject to raw document bytes and per-artifact bounded hashing
Summary curve/evidence arrays No schema maxItems; reader reconciles run coverage and uniqueness across arrays. Direct Mapping caller allocation is not a file admission guarantee
Report trials Exactly plan repetitions, 1–100; JSON admission at 16 MiB; total bootstrap work at 10,000,000 units
Report intervals/trial scores Confidence interval has exactly two finite numbers; summary scores must agree with known trials and recomputed summaries
Evaluation writer At most 100,000 cases, 256 Measurements, 1,000,000 planned executions; these writer limits must not be claimed as identical legacy report-import limits
Checkpoint completed trials At most plan repetitions (100); cursor, contiguous indices and execution counts must reconcile; JSON admission at 1 MiB
Imported case/count metadata Nonnegative/positive integers and conservation checks; no universal small count ceiling. Imported metadata cannot authorize bypassing evaluator/resume preflight bounds
  • Shared coverage now includes nested summary histogram/startup records, both report versions, complete checkpoint arrays, aborted evidence and all four legacy raw versions.
  • Structural checks are explicitly separated from checksum, classification, arithmetic and experiment truth. A correctly shaped document cannot certify those semantic properties.
  • The development environment now explicitly installs rfc3339-validator for JSON Schema date-time checks. Three invalid timestamp cases reproduced schema admission before installation and rejection afterwards. FormatChecker alone does not install this dependency. RFC3339 structure does not prove raw timestamp ordering or the reader's narrower uppercase UTC representation.
  • Four shared qualification cases explicitly prove structural admission followed by canonical rejection: restart count 0.0, equivalent +00:00 timestamp spelling, an unrecognized reason, and histogram count-sum contradiction. JSON Schema mathematical integers differ from lexical Python integer admission; canonical raw timestamps use uppercase UTC Z. The standard validator type system is unchanged. Reason arrays preserve historical structural permissiveness but must equal canonical classification output; they cannot carry arbitrary retained metadata. Histogram conservation is arithmetic, not certified by structural type checks. These are documented layered admission distinctions rather than claims that every structural acceptance is executable evidence.
  • Direct Mapping entry points operate on caller-allocated documents; their validation does not establish a pre-allocation byte boundary. Raw file and canonical report/checkpoint JSON readers have independent admission caps recorded above. The development dependency's build and installed wheel smoke gates passed. These independent entry-point qualifications are part of the contract.

Acceptance evidence

Issue criterion Authoritative evidence and scope
Unknown fields, types, arrays/counts and bytes Envelope/collection tables above; committed capacity schemas; canonical raw, summary, report and checkpoint readers; 129 shared corpus cases
Close gaps or qualify legacy behavior Raw/summary histogram and startup closure, summary recursive safety, count and selection projections; explicit vintage root/curve and discarded typed-report qualifications above
Shared adversarial corpus tests/unit/test_evidence_schema_agreement.py sends the same capacity mutations to offline Draft202012 validation and canonical admission; typed report/checkpoint cases use their canonical JSON decoders. Deliberate structural/semantic differences are asserted separately, not hidden by validator overrides
Versioning and unavailable evidence compatibility.toml Consumer integration contract 78; existing raw/summary v5 field sets and wire layout preserved. Legacy tests assert unchanged documents, absent execution/reference evidence and rejection of current qualification; aborted evidence retains unavailable observations
Meaning, privacy and optional isolation No Consumer vocabulary or optional imports added to base runtime; recursive summary safety and fixed raw decode diagnostics have adversarial tests; clean installed-wheel smoke verifies disabled side effects and unavailable OpenTelemetry
Gates and documentation Focused corpus, static, unit, integration and docs gates passed; packaging dependency lock/build/smoke passed. implementation-handoff.md records commands, baseline failures, corrections and terminal results. Collector assets unchanged, so native Collector verification is not evidence required by this slice

The corpus establishes the declared examples and boundaries, not exhaustive proof for every JSON value or experiment authenticity. Current capacity requires current raw evidence; legacy structural acceptance cannot manufacture provenance, checksum validity or production qualification.