Give CDEB its schemas and a verifier that owns the whole study tree - #444
Merged
Conversation
CDEB-01, the first infrastructure ticket of the protocol landed in #442. Six schemas -- the measured row, the evaluator output, attempts, the public freeze, candidates and sealed-task metadata -- all closed with additionalProperties false, and a recursive verifier over bench/results/cdeb that default CI now runs beside the legacy gate. The verifier's shape answers #441 rather than repeating it. The legacy gate is deliberately default-in over a flat directory because its failure mode was a file nobody registered; CDEB's failure mode is the opposite -- an analysis surface discovering inputs it was never meant to read -- so every study entry is accounted for or the study fails, and classification is the explicit benchmark field, never a reused schema_version. Derived fields are recomputed, not trusted: total_token_volume against the raw category sum, and decision_safe_success against stop_reason and the evaluator fields, so a row claiming a safe success on a timeout fails whatever its schema-valid shape says. A RESULT.json sitting beside missing expected rows fails as a verdict from an incomplete matrix, which is the artifact the analyzer must never produce. The schemas needed Ajv2020: the package's default entry carries only the draft-07 meta-schema and refuses a 2020-12 document at compile time. Limit: the schemas freeze protocol 1.2.0 constants -- thresholds, matrix size, category names -- so a protocol change is a schema change and CI notices Ruled-out: default-in discovery over the CDEB tree like the legacy gate | that gate's enemy was the unregistered file, CDEB's is the unregistered input, and #441 showed a glob passing a stopping rule on contamination Ruled-out: validating with the draft-07 Ajv entry and downgrading the schemas | the 2020-12 entry ships in the same package, and weakening six schemas to fit a meta-schema is backwards Warn: every failure fixture is the one valid row with a single mutation, so keep the valid-row builder in lockstep with result.schema.json -- a builder drift fails all eleven cases at once and reads as a broken verifier Blast: local Undo: easy Certainty: firm Verified: eleven subprocess cases against the real verifier -- clean study passes, no-studies exits zero, and empty study, unknown file, invalid row, wrong benchmark, token-sum mismatch, derived mismatch, simulated row, duplicate id, and missing-row-with-verdict each fail with the named finding Provenance: authored Record-Id: r-cdebver01
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (21)
Ruled out (58)
Warnings (14)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #443. CDEB-01 — the first infrastructure ticket of the protocol landed in #442.
What lands
Six schemas in
bench/cdeb/schemas/, alladditionalProperties: false, all requiring the explicitbenchmark: "cdeb-v1"discriminator:resultevaluatorattemptstudycandidatenatural_recordandbenchmark_authoredare conststaskbench/cdeb/verify.mjs— the recursive verifier of §21.1, and CI integration:npm run bench:verifynow chains the legacy gate and this one. The CI yaml invokes the npm script, verified, so nothing bypasses it.The design inversion, stated
The legacy gate is deliberately default-in over flat
bench/results/*.jsonlbecause its failure mode was a file nobody registered (#392). CDEB's failure mode is the opposite — an analysis surface discovering inputs it was never meant to read. #441 showed the M5 analyzer glob 1,835 rows from four experiments and nearly pass its own stopping rule on the contamination.So in a CDEB study every entry is accounted for or the study fails, and classification is the explicit
benchmarkfield —schema_versionis never reused as a skip discriminator (§21.2).Derived fields are recomputed, not trusted (§14.7)
total_token_volumeagainst the raw category sumdecision_safe_successagainststop_reason+ evaluator fields — a row claiming a safe success on a timeout fails whatever its schema-valid shape saysAnd a
RESULT.jsonsitting beside missing expected rows fails as "a verdict from an incomplete matrix" — the artifact the analyzer must never produce (§22.6).One dependency gotcha
The schemas declare draft 2020-12;
ajv's default entry ships only the draft-07 meta-schema and refuses them at compile time.Ajv2020fromajv/dist/2020.js, with the reason at the import. Weakening six schemas to fit a meta-schema would have been backwards.Tests — 11, structured as control + single mutation
The clean study passes (the control), and each failure case is that same valid row with exactly one thing broken — so a passing case proves the verifier caught that defect, not an accident of the fixture: empty study, unknown file, invalid row, wrong
benchmark, token-sum mismatch, derived mismatch, simulated row, duplicate id, missing-row-with-verdict. All drive the real verifier as a subprocess, because the acceptance criteria are exit codes CI will see.Verification
npm run bench:verifygreen with both verifiers chained (legacy: 1,592 rows in 14 files; CDEB: no studies yet, exits 0).test/dogfood.test.tsre-run after committing: 9 passed.