Repository navigation
Coverage contract and reader registry (A1) - #2374
Merged
neuromechanist merged 6 commits intoNov 25, 2026
Merged
neuromechanist merged 6 commits into
neuromechanist merged 6 commits into
Conversation
Migration 0150 rebuilds upstream_repull_screens so both status CHECKs accept the report-version-2 word. Rows, ids, the one-waiting index and the foreign key carry over. Tested on bun:sqlite and Miniflare D1, and replayed with migrations:d1-check.
Adds the format reader registry with a page-cached RangeSource, the shared report builder, and the copy tables. Report and preflight go to version 2 (read_by_format, companion_missing, readers); the door reads v1 verbatim and v2 under the per-reader rule. partially-screened replaces the old word in new reports and gates the same. Targeted screen tests pass with EDF verdicts unchanged.
Stub readers registered through the scan's readers option prove the v2 rules: clean without EDF, thrown reads failed, limits and missing companions partial, the page cache, the gate and the copy tables.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2374Version: 🤖 Updated on each push. |
Adds it to the root tsconfig include, types the Miniflare D1 helper from Miniflare so Bun types suffice, and uses db.run over the deprecated exec. Typecheck and the migration tests pass.
Refuses a whole-file answer to an offset read (range-ignored), counts a complete result from a limited source as partial, writes the reader contract down, re-reads the EDF header inside the counted try, builds tallies from a checked literal, and advertises partially-screened only. New tests kill the surviving cache and door mutants; targeted root and backend tests pass.
READ_FAILURE_COPY is a Record over the closed failure classes and a v2 description prints each read failure with its remedy and docs link. Tests cover range-ignored at the door and in the lines; targeted root and backend tests pass.
Contributor
Author
|
Merge gate (lead): head 5d2887f; every remote check passes (shard 6 failed once on the repull CLI timeout flake #2377 and passed on its one rerun). Locally on this head: typecheck clean; 73 targeted contract and report tests pass. Review: round 1 panel (code+tests; errors+comments+types), 1 important finding and 7 items fixed, with the three surviving mutants now killed; round 2 delta review found 1 important gap (the read-failure copy was not wired) and 1 suggestion, both fixed in 5d2887f and checked by the lead from the diff. |
neuromechanist
merged commit Nov 25, 2026
5c3d65d
into
feature/issue-2182-epic-pq-evidence
59 of 61 checks passed
This was referenced Nov 27, 2026
Merged
This branch was previously deployed
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.
Part of #2185
Part of #2182
Card A1 of the publication-queue plan: the coverage contract and the reader registry that cards A2, A4, A5, A6 and A9 build on.
What changed
shared/identifier-readers.ts):RangeSource, a page cache with 64 KiB pages, coalesced reads and a read/byte tally,ReaderLimits,FormatReader, the closedReaderIdunion and the new incomplete reasons.READERSholds EDF/BDF only (256 bytes, one read).formatCoveragemoved here and returns{ byReader, unscreened }. A companion that a reader claims counts with its recording; a missing one is counted and makes that recording partial.shared/identifier-report-builder.ts): reads every recording through its reader under its limits. Each read ends one of four ways: complete, partial (with a reason: limit, time, companion-missing, or the reader's own), failed (any throw), or not read (sampled out). The builder also ownsclassifyDataset, and its EDF statistics match the old loop. The fleet scan, the CI screen and the upload preflight all reach it throughscanDatasetFromManifest.shared/identifier-screen-report.ts):REPORT_VERSION = 2addsread_by_format,companion_missingandreaders. The door parses v1 with the v1 rule verbatim and v2 with the per-reader rule:cleananddates-onlyneed at least one recording, every recording format to have a reader, and every file read completely.no-recordingsneeds no recording of any format.partially-screenedreplacesclean-edf-only-others-unscreenedin new reports. Both gate toacknowledge; no other state's gate changed.zip:<ext>.PREFLIGHT_VERSION = 2.--acknowledge-identifier-preflightacceptsclean-edf-only-others-unscreenedas an alias ofpartially-screened, so existing pipelines keep working.shared/identifier-screen-copy.ts):KIND_COPY,STATUS_COPYandINCOMPLETE_COPY, each aRecordover its union of{ statement, read, remedy, anchor }, plusSCREEN_DOCS_URL(the identifier-screening page). The verdict labels, causes, count lines and the preflight refusal moved here. A v2 description follows each state, kind and reason with its remedy and docs link; a v1 report renders exactly as before. The date warning andpublicationRequestNoticestay in the report module, by ruling.findSupersededand the annex-key reading use the registry, so a replaced recording in any registered format is read in its old version.upstream_repull_screensso both status CHECKs acceptpartially-screened(lead ruling). Rows, ids, the one-waiting index and the foreign key carry over.Tests
test/identifier-coverage-contract.test.tsandbackend/test/repull-screens-partially-screened-migration.test.ts(bun:sqlite and Miniflare D1).findSupersededhas a new test with a reader registered only in the test.partially-screened. Fixtures that are v1 records are marked v1.KIND_COPYfailsbun run typecheck(TS2741).bun run migrations:d1-checkreplays all 141 migrations on local D1 and matches bun:sqlite.