Repository navigation
B4: review inputs widened to metadata, and the review record - #2382
neuromechanist merged 24 commits into
Conversation
…e' into feature/issue-2188-review-inputs
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2382Version: 🤖 Updated on each push. |
|
Merge gate (lead): head 2e3df25, with the decide branch (B3, D3) merged in. Every remote check passes after one rerun of integration shard 4 (the repull CLI flake, #2377). Review: round 1 panel (code+tests; errors+comments+types), 1 important finding (screen reason codes reaching the model through the previous denial: now an allowlist of non-screen codes) and 5 more fixed, plus the lead's rulings (the Worker inputs endpoint with no workflow change; registry title, creators and publisher; the lineage cache service; inputs_unavailable after served inputs counted against the cap); round 2 delta review resolved all six items, and its three suggestions are fixed in 2e3df25. |
b8bcd9e
into
feature/issue-2182-epic-pq-decide
Part of #2188. Part of #2182.
Card B4 of the publication-queue plan: the publication review now reads the dataset's metadata besides ADR 0102's root documents, never its data, and every review stores and shows a reproducibility record (ADR 0139, decisions 5, 6, 7 and 9). This follows the lead ruling of 2026-11-25: the workflow
run-publication-review.ymlis unchanged, and the Worker serves the widened inputs.What changed
New callback route
POST /webhooks/publication-review-inputs, beside the claim and the result. It uses the same authentication (the review's callback token and nonce). It answers only for a claimed review that has not reported (409 otherwise). It is read-only and returns:datasets.enrichment_json, with its update instant; an anonymous release gets no creators);readResubmissionNote;A failed read answers 502. The dispatch payload is unchanged, and a test pins its keys.
The job (
scripts/ci/publication-review.ts) fetches the inputs after the claim and before anything is examined. A failure, or any answer other than 200, is the new run errorinputs_unavailable(copy, migration CHECK and vocabulary added; it is not a verdict and never eligible for an automatic deny). The job never reviews with part of its inputs.Pre-send (
presendInputs) normalizes, cuts and scans each of the five sections (enrichment, registry records, lineage, coverage, note) under its own budget. It uses the same rules and the same single mint as for documents. A section with a finding is withheld whole and recorded as atext_withheldpart.Prompt (
publication-review-prompt/2): five more fenced, untrusted sections; a metadata state block in the facts; and the fifth question,note_addresses_reasons, asked only when a note was shown.Verdict:
license_lineage_unconfirmed(unknown class, an override clears it);compatible_attributionwith noSourceDatasetscredit adds the platform findingsource_credit_missing(concern);failorunknownaddsresubmission_note_unaddressed(unknown class). It can never producepassorfail.Report version 2 carries the record: prompt version, model calls with their effort, the SHA-256 input digest (the fixed nonce makes it stable across runs), and the resolver version. Stored version 1 reports still parse.
Migration 0152 rebuilds
publication_reviews, with every row and index kept. It addsscanner_id,reader_versions,resolver_version,models,prompt_versionandinput_digest, and theinputs_unavailableword. The scanner and reader versions come from the Worker's own copy of the screen report.Display: the record shows in
nemar admin dataset publish showand innemar dataset publish status(asreview_recordandreview_record_lines).ADR 0139: dated amendment to decision 7, and the index line updated.
Tests
test/publication-review-inputs.test.tsandbackend/test/publication-review-inputs.test.ts. They cover:unresolvedgiveslicense_lineage_unconfirmedand neverfail;passorfail;scanJsonSection(object)call removed, two tests fail ("an enrichment with a patient name under an identifier key, deep inside a field" and "an enrichment with a file URL"). The lineage class widened tofail, theunresolvedentry removed, the note's class widened tofail, the note coercion removed and the claim check removed each fail at least one test.Gates
bun run typecheck,bun run lint,cd backend && bun run typecheck,bunx biome checkon every touched file: clean on the head.publication-review*test (root and backend), the license-lineage route, the ADR index and the resubmission note: 1,631 tests, all green after the last fix.bash scripts/ci/unit-pure-files.sh | xargs bun test --parallel=4): 28,069 tests in 1,001 files, with 6 failures. Two came from this change and are fixed in the last commit: the status keys pin and the webhooks route inventory. Three are unrelated to this diff, which touches none of their files: the two account-copy parity tests, which read a local website checkout, and the git-annex UUID retry test. They were not re-run on the base.Notes for review
workerLineageCacheis imported from the admin lineage route module, to avoid editing D1's files.