feat: add offline maintainer corpus validation - #11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 502672cb2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| return lane; | ||
| } | ||
|
|
There was a problem hiding this comment.
Reject blank PCF scores instead of treating them as zero
When a JSON case uses pcf.score: null or a CSV row leaves pcfScore blank, this coercion turns the missing value into 0, so the corpus is accepted and the case is included in the 0-19 calibration bin instead of failing closed. Since pcf.score is required by the new contract, missing or blank scores should be rejected before calling Number.
Useful? React with 👍 / 👎.
| const pcfPresent = timing.pcfSeconds !== "" && timing.pcfSeconds !== undefined && timing.pcfSeconds !== null; | ||
| if (!baselinePresent && !pcfPresent) return null; | ||
| const baselineSeconds = Number(timing.baselineSeconds); | ||
| const pcfSeconds = Number(timing.pcfSeconds); | ||
| if (!(baselineSeconds > 0) || !(pcfSeconds >= 0)) { |
There was a problem hiding this comment.
Require both timing values before scoring savings
When a CSV row has baselineSeconds set but leaves pcfSeconds blank, or JSON uses pcfSeconds: null, the both-absent check is skipped and Number("")/Number(null) becomes 0, so the receipt reports a full time saving for a case with incomplete timing instead of rejecting it. This corrupts timing aggregates whenever only one side of the timing pair is present.
Useful? React with 👍 / 👎.
Summary
pcf validate-corpuscommand for consented JSONL or CSV adjudicationsWhy this is narrow
The change is one validation core, one focused test file, and the minimum CLI, package, and operator-documentation wiring. It adds no dependency, network call, GitHub write capability, evaluator threshold change, or benchmark expectation change.
Validation
node --test test/corpus-validation.test.mjs— 6/6 passednpm run ci:gates— 263/263 tests, 77/77 benchmark cases, 29/29 adversarial cases, maintainer demo PASSnpm run mcp:smoke— PASS; no public-write toolsgit verify-commit 502672cb2ca0ddeeb67088dcd2102a617370d186— good signaturegit diff --check— PASSBoundaries
No real participant corpus is included, and product validity remains
INCONCLUSIVEuntil a genuinely consented independent-maintainer corpus exists. The prospective-study runner is deliberately reserved for a separate follow-up PR so this review remains five files and one commit.