Skip to content

Publication queue: evidence lane (epic #2182) - #2426

Merged
neuromechanist merged 50 commits into
devfrom
feature/issue-2182-epic-pq-evidence
Nov 27, 2026
Merged

neuromechanist merged 50 commits into
devfrom
feature/issue-2182-epic-pq-evidence

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2182. The evidence lane (lane E) of the publication-queue epic: the identifier screen now reads EEG, fNIRS and MATLAB formats beyond EDF and BDF, says what it could not read and how to fix it, and can be reproduced by the depositor on their own copy.

What the lane adds

Phase PRs merged into the lane

#2374 (A1), #2378 (A3), #2381 (A2), #2385 (A4), #2389 (A9), #2392 (A6), #2395 (A5), #2398 (A10). Each had a review panel and a delta review per the board.

Migrations and ADRs

  • Migration 0155 (0155_repull_screens_partially_screened.sql, written as 0150 in A1 and renumbered here after dev's 0150 to 0154) rebuilds upstream_repull_screens so both status checks accept partially-screened; rows, ids, the index and the foreign key carry over. Its tests were updated to the new name.
  • No new ADR. The lane works under ADR 0086 and ADR 0090; ADR 0139 (decide lane) is already on dev.

Merge of dev into the lane

  • Conflicts: package.json and backend/package.json versions (dev's taken), scripts/ci/publication-review-evidence.ts imports (formatCoverage and readerMatch from shared/identifier-readers, FindingKind from shared/identifier-scan), src/commands/dataset.ts imports (dev's license-lineage imports kept), and CHANGELOG.md. dev was merged twice, the second time after Release prep 0.10.42: changelog and timings table #2425: dev's dated ## 0.10.42 (decide lane and the CI section) is kept, and the evidence section sits under ## Unreleased above it.
  • Seam fix: scripts/dev/measure-queue-blockers.ts (decide lane, D2) imported formatCoverage from shared/identifier-scan, which A1 moved; test/upstream-ack.unit.test.ts failed to load after the merge. It now imports from shared/identifier-readers.
  • test/unit-pure-timings.json: 15 evidence-lane entries, each the wall time of a local bun test run. The 18 decide-lane entries dev was missing (dev's Tests run on Publication queue: decide lane (epic #2182) #2397's merge failed ci-tier-routing) were added here with Release prep 0.10.42: changelog and timings table #2425's values and now come from dev, since Release prep 0.10.42: changelog and timings table #2425 merged.

Owner gates

  • Release order: the Worker accepts report version 2 in the same release that starts emitting it; requests screened in the deploy window are re-screened with nemar admin dataset publish screen-batch (O2 in the plan's checkpoints).
  • After release: O2 (quiet re-screen of the queue and digest comparison) and O5 (SNIRF day-precision birth dates in queued conversions: the depositor scrubs them).
  • Still open for the lead at CP-E2: swapping B4's local v2 screen-report reader in backend/src/services/publication-review-inputs.ts for A1's types now that both lanes meet.

What I ran

  • bun run typecheck (root and backend), bun run lint, bun run lint:scrub: pass.
  • test/ci-tier-routing.unit.test.ts and test/adr-index.unit.test.ts: 152 pass.
  • backend/test/migrations.test.ts and both migration tests for 0155: pass.
  • Every test file this branch changes or adds against dev (29 files: readers, HDF5 and MAT walkers, coverage contract, report, preflight, fleet, CI screen, dataset screen and its spawn tests, docs anchors, review evidence) plus the 18 decide-lane files and test/api-export-surface.unit.test.ts, one process per file with an empty environment: 51 files, 1,839 pass, 0 fail; docs-anchors skips 3 tests without a docs checkout.
  • Not run: the full suite, migrations:d1-check (it runs wrangler) and the live tier; CI on this PR covers them.

Seam review

  1. CHANGELOG release note was missing the owner steps and the preflight version skew. Added O2 (the quiet screen-batch re-screen and the digest comparison against plan.md), O5 (day-precision SNIRF DateOfBirth in queued conversions, which the depositor scrubs), and the note that a new CLI sending a v2 upload preflight to an older Worker gets a refusal, prints the warnUnrecordedPreflight warning, and continues the upload: 4a27222.

  2. Memory on the depositor's machine (risk R15): the local paths read 16 files at once, and a large EEGLAB .set can peak near 1 GB RSS. The shared builder now takes a per-reader-class concurrency limit (readerClassLimits); nemar dataset screen and the upload preflight pass LOCAL_READER_CLASS_LIMITS, at most 2 MAT/EEGLAB, HDF5 (SNIRF, NWB) or ZIP files at once, while other files keep 16. The CI screen and fleet scan pass no limits and are unchanged. Tests with stand-in readers that record their overlap, at the builder and at both entry points; risks.md R15 updated: aae0c67.

3a. Contract test that a reader scan that never resolves, with a tiny timeMs, ends partial with reason time: 8ee9d38.

3b. A malformed reader result (no findings, a null finding, an unknown coverage or reason, a non-array needs, a negative unscreened count) escaped the pool and stopped the whole screen. It now fails only that file, under the closed class internal, and the screen goes on: 8ee9d38.

3c. namedCompanionsMissing lowercased every path once per file that named a missing companion, quadratic on a dataset of thousands of .set files missing their .fdt. The builder now builds the lowercased set once per dataset; 6,000 such files take about 100 ms (about 1,240 ms before), under a 500 ms bound: 13946dd.

  1. Stale comments in backend/src/services/upstream-repull-facts.ts (lists partially-screened) and shared/upstream-ack.ts (no longer "matches nothing before A1"): e6fd1b0.

  2. The comment in backend/src/services/publication-review-inputs.ts now says the narrow shape is deliberate and pinned to A1's report by a drift test. The drift test builds a real v2 report with A1's builder over real fixtures, passes it through parseScreenReport and JSON, and checks that readNarrowScreenReport, coverageOf and the inputs route give the same tallies, readers and unscreened counts. It found a real drift: COVERAGE_KEY refused an archive's inner format keys (zip:.xdf), so the review's coverage silently dropped them; the key now accepts the screen report's own zip: format keys: 1e7cc50.

Changelog bullets for the local bound and the coverage key fix: a4da724.

* Allow partially-screened in re-pull screens

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.

* Read recordings through a reader registry

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.

* Test the coverage contract

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.

* Typecheck the new migration test

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.

* Address review round 1 of the coverage PR

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.

* Print the words of each read failure

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.
* Add the h5py oracle for HDF5 metadata

* Add HDF5 fixtures and their h5py oracle output

* Add a bounded HDF5 metadata walker

* Test the HDF5 walker against h5py

* Count logical reads; default cap 20,000

* Review round 1: never throw, shuffle, zero sizes

* Bound each fuzz walk at 200 ms
* Add text-header kinds, copy and helpers

* Register BrainVision and NIRx readers

* Add the reader false-positive measure script

* Bounded pure-TypeScript HDF5 metadata reader (A3) (#2378)

* Add the h5py oracle for HDF5 metadata

* Add HDF5 fixtures and their h5py oracle output

* Add a bounded HDF5 metadata walker

* Test the HDF5 walker against h5py

* Count logical reads; default cap 20,000

* Review round 1: never throw, shuffle, zero sizes

* Bound each fuzz walk at 200 ms

* Add not-applicable and notes to readers

* Apply lead rulings to text-header readers

* Bound free text; decode UTF-16 headers

* Scan unplaced text; narrow not-applicable

* Require three signs for not-applicable
* Add SNIRF and HDF5 finding kinds with copy

* Map HDF5 walker reasons to reader reasons

* Add SNIRF variant and identifier HDF5 fixtures

* Register SNIRF and generic HDF5 readers

* Test the SNIRF and HDF5 readers

* Add reader false-positive measurement script

* Pin the walker object cap in a test

* Pin snirf-measurement-date as a date kind

* Bare name fields and fused codes in HDF5 text

* Pin the page cache's byte budget boundary

* Add review-round HDF5 fixtures and README notes

* Unscanned strings and typed limit in walkForReader

* Numeric identifiers, thing qualifiers, tag case

* Test the review-round reader rules

* Numeric 0 and -1 are identifier placeholders

* One person-field rule for every reader

* Token person rule, describing words, -1 string
* Say where content-absent content is kept

* Add nemar dataset screen

* Skip the notices request for local-only commands

* Test dataset screen parity, gaps and no writes

* Release-tag scanner id; local copy in shared

* Review fixes: update check, history, git failures

* Pin unsafe-directory exit 2
* Add the ZIP reader and register it

* ZIP reader tests and fixtures

* FP measure: URL keys, inner unscreened

* Coverage contract: the registry lists zip

* NIRx subject Name: shared SubjectID rule

* ZIP: one path finding per kind per archive

* ZIP: hidden entries, unresolved sizes corrupt

* Finding.entries is reader-internal; comments

* Review evidence: a raw .zip counts once

* ZIP: directory must meet its end record

* Test the ZIP64 end record's declared size
Conflicts: versions taken from dev; evidence imports (readerMatch, formatCoverage from identifier-readers) kept with dev's FindingKind and license-lineage imports. Evidence migration 0150_repull_screens_partially_screened renumbered to 0155 after dev's 0150 to 0154.
dev's D2 measurement script imported formatCoverage from identifier-scan, which the evidence lane moved to identifier-readers (A1); test/upstream-ack.unit.test.ts failed to load after the merge. Tested: that file, 31 pass.
Wall time of a local bun test run per file, so the unit-pure shards balance them and ci-tier-routing finds no missing file.
dev's ci-tier-routing check fails on 18 decide-lane files (#2397 merged after #2423). Values copied from #2425, which adds the same entries to dev, so the two merge cleanly.
Unreleased section for the evidence lane (A1 to A6, A9, A10) and migration 0155.
CHANGELOG: dev dated 0.10.42 with the decide section; the evidence section moves to Unreleased above it.
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2426

Version: 0.10.43-PR2426.a4da724
Commit: a4da724


🤖 Updated on each push.

This branch was previously deployed

1 inactive deployment
npm — a4da7242 Deployed Nov 27, 2026 by neuromechanist via publish #5031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant