Skip to content

Publication queue: decide lane (epic #2182) - #2397

Merged
neuromechanist merged 14 commits into
devfrom
feature/issue-2182-epic-pq-decide
Nov 26, 2026
Merged

neuromechanist merged 14 commits into
devfrom
feature/issue-2182-epic-pq-decide

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Lane D (decide) of epic #2182. These tools let NEMAR decide the publication queue with evidence the depositor can check: upstream license lineage, a documented batch acknowledgment, a quiet re-screen, a review widened to metadata with a reproducible record, a resubmission note, an automatic denial (off by default) and the license permission workflow. ADR 0139 is the specification. ADR 0086 gains an amendment; ADR 0102's cap amendment is in #2370.

Part of #2182. Closes #2361, #2362, #2363, #2364, #2368, #2188, #2369 and #2391 when this merges.

Phases (each squash-merged into this branch after its own review)

A seam review of the whole branch found no critical issues; its findings are fixed in #2394. Migrations 0150 to 0154 replay cleanly on a fresh database (bun run migrations:d1-check).

Release order and owner steps

  • Deploy the Worker and the review script together. Reviews that start in between report inputs_unavailable; restart them with nemar admin dataset publish start <id>.
  • Neither owner switch is set by this PR: PUBLICATION_REVIEW_ENABLED in production is Turn on the publication review in production, cap 150 (shadow first) #2370 (draft, with its checklist), and PUBLICATION_AUTO_DENY_MODE and PUBLICATION_AUTO_DENY_DAILY_CAP are absent, guarded by backend/test/auto-deny-switch-flag.test.ts.
  • After release: run nemar admin dataset publish screen-batch --all-active (dry run first), then calibrate automatic deny in shadow (plan step C1) before on.
  • Docs anchors for docs.nemar.org (license-lineage-, public-upstream-acknowledgment, automatic-denial-) are listed in the seam review and are the evidence lane's A10.

Test plan

  • Every phase PR: its own review (a two-reviewer panel, plus a delta review where round 1 was substantial) and green remote checks on its final head.
  • Seam review: typecheck and lint clean. The pure tier fails only in files this branch does not touch (compute tests under --parallel, and the website parity and annex UUID tests that fail on dev too).
  • Full remote CI on this PR, required before merge.

* Add queue and a7 id lists for D2 [skip ci]

* Add queue blocker measurement script

* Add D2 queue blocker report [skip ci]

* Allowlist extensions, clean temp dirs on signal

* Regenerate D2 report with review notes [skip ci]
* Add shared upstream license lineage resolver

Resolver, compatibility lattice and copy tables (epic #2182 card D1), with recorded DataCite, Crossref, OpenAlex, OpenNeuro and PhysioNet fixtures. Tested: bun test test/license-lineage.test.ts; live DOI test passed locally.

* Switch upload provenance to the shared rule

An unrecognized source license now needs permission instead of passing. Tested: bun test test/license-provenance.test.ts test/license-tier.test.ts.

* Add admin license-lineage route

GET /admin/datasets/:id/license-lineage, read-only, Worker-cached per DOI. Tested: route test and admin route inventory.

* Add license-check and license-lineage commands

nemar dataset license-check <path> and nemar admin dataset license-lineage <id>. Tested: CLI spawn test against a recorded stand-in, export surface pin.

* Move license-lineage under admin dataset publish

ADR 0135 caps admin dataset at twelve visible children (test/admin-write-flag.unit.test.ts). Adds spawn tests for the admin command. Tested: license-check-spawn, admin-write-flag.

* Map MIT, BSD, Apache-2.0 and the PD mark

MIT, BSD-2/3-Clause and Apache-2.0 become permissive-attribution (compatible_attribution); the Public Domain Mark becomes cc0 (lead ruling 2026-11-25). Tested: license-lineage, license-provenance, license-tier, spawn and route tests.

* Redact a contributor in lineage fixtures

Review round 1 item 10. Tested: bun test test/license-lineage.test.ts.

* Report input reads and harden lineage parsing

Review round 1 items 1-8: read states for the description and metadata (422 and CLI exit 1 when unparseable), CLI path checks, unparseable 200 bodies, strict SA version, PhysioNet access policy, own-DOI exclusion, cache validation, read lines and anchors. Tested: lineage, spawn, route tests.

* Name unrecognized licenses in upload prompt

Review round 1 item 9. Tested: bun test test/license-provenance.test.ts.

* Exit outside try; unknown target license

Review round 2: license-check exits outside every try, an unreadable description leaves target_license null (printed unknown), and the fixtures README explains the kept curator names. Tested: targeted lineage files.
* Add screen batches table and digest service

* Cover a batch screen's mail with the digest

* Add the screen-batch command

* ADR 0086 amendment: paced re-screen digest

* Digest: separate reported, not started, late

* Review round 1: settle once, close, digest buckets

* Batch claim loses to a counted screen

* Update route and export pins for screen batches

* Wire the digest pass and the batch route walk
* Add resubmission note column and its rule

* Store and show the resubmission note

* Ask for a resubmission note after a denial

* Read the POST body by path in a pending test

* B3 review round 1: author, text part, prompt
* Add public-upstream acknowledgment rule

* Share lineage read; guard a shown-state ack

* Add POST /admin/publish/acknowledge-batch

* Add publish acknowledge-batch command

* ADR 0086: batch acknowledgment amendment

* Share the image name-class rule

* Check the screened tree; cap a batch at 20

* Approve: a recorded ack is the caller's only

* Batch ack: a BIDS photo file is not eligible

* Batch ack: undo on a failed audit write

* Generate the batch-ack exclusion module

* Batch ack: review round 1 fixes

* Batch ack: ack and audit in one D1 batch

* Batch ack: write_failed outcome; audit state
* Review contract: inputs, note answer, record

* Pre-send examines the widened inputs

* Job reads inputs from the Worker, records digest

* Inputs route, record columns, migration

* Read the stored note by its own rule

* Backend tests: record columns, v2 read-back

* Show the review record in show and status

* ADR 0139: amend decision 7 [skip ci]

* Check the stored note before GitHub reads

* Tests: inputs route, pre-send, lineage, note

* E2E: inputs at the head, record shown

* Sort imports in the review script

* Admin detail test: the record key

* Pins: status record keys, inputs route

* Move the lineage cache into a service

* Lineage records: title, creators, publisher

* Review inputs: previous denial codes, registry fields

* Review round 1: screen codes, efforts, cap

* Review round 1: enrichment source and parse

* ADR 0139: previous denial is codes [skip ci]

* Count inputs_unavailable once inputs were served

* Round 2: guard the stamp, ADR line, rewrap
* Migration 0153: confirming runs, auto_denied

* Share the deny path; add restore route

* Auto-deny rule, owner switch and copy table

* Confirming run on the confirming model

* Automatic deny, shadow, cap, digest and mail

* Ready-to-approve mail for a passed review

* CLI: nemar admin dataset publish restore

* E2E: confirming run denies through the job

* Pin the restore route and export

* confirm_failed; confirm runs off depositor tally

* Review round 1: mail state, stale guards, digest

* List an undelivered denial mail exactly once
* Migration 0154: license permissions and basis

Tested: migrations:d1-check, publication-review-migration.test.ts.

* License evidence copy and permission rule

Tested: test/license-permission.unit.test.ts.

* A recorded permission clears the lineage reason

Tested: contract, cure-split, admin-routes, inputs tests.

* Depositor notice and status lines

Tested: backend/test/license-permission.test.ts.

* Admin route: record license permission

Tested: backend/test/license-permission.test.ts, route inventory.

* CLI: publish license-permission command

Tested: test/admin-publish-license-permission-cli.test.ts.

* ADR 0139: amend for license permission evidence

* Keep the review view clear of the mail code

Tested: identifier-screen-stored, publish-request-ci-pending.

* Test the permission line in the admin mail

Tested: backend/test/license-permission.test.ts.

* Name the start command in basis_unrecorded

Tested: backend/test/license-permission.test.ts.

* Mail admins and depositor after a record

Tested: backend/test/license-permission.test.ts, mutation-checked.

* Record once; show and audit the ticket

Review round 1 items 1 to 3. Tested: backend/test/license-permission.test.ts.

* Mail states: review_unreadable, no_recipient

Review round 1 items 4, 6, 7, 8, 9. Tested: backend/test/license-permission.test.ts.

* CLI mail lines, closed types, softer copy

Review round 1 items 5, 9, 10. Tested: test/license-permission.unit.test.ts.

* Tests: race, unreadable review, no recipient

Mutation-checked: no unique index, conflict not refused, mail on conflict, unreadable as not_ready.

* ADR 0139: ticket confirmation, may bind
* Seam fixes: CHANGELOG entry, admin dataset wording

* Seam fixes: review round 1
neuromechanist added a commit that referenced this pull request Nov 26, 2026
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Heads-up on D1 migration numbers: #2412 (the ADR 0134/0137 epic into dev) adds 0150-0153 (compute-pipeline-progress, quality documents, quality views, serving-index key). This PR also adds 0150-0154. dev ends at 0149 today and nothing rejects two files with the same prefix, so whichever of the two reaches dev second has to renumber its migrations after the other's (here: 0154+ if #2412 lands first). #2412 is also adding a check for unique migration prefixes.

Agentic AI tools were used. The author assumes full responsibility for this content.

Bun's 5 s default test timeout killed a cold uv run (resolving edfio and numpy) before the spawn's own 120 s limit; scrub-tools shard 1 failed with status null in run 45754555613. Tested: cold uv cache with --timeout 300, 3 fail before, 3 pass after; both files 69 pass.
@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2397

Version: 0.10.41-PR2397.bfdd4e3
Commit: bfdd4e3


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 7909603 into dev Nov 26, 2026
89 of 91 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2182-epic-pq-decide branch November 26, 2026 23:23
neuromechanist added a commit that referenced this pull request Nov 27, 2026
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.
neuromechanist added a commit that referenced this pull request Nov 27, 2026
Dates 0.10.42, adds the 18 pure test files #2397 added to the timings table, records #2423, and makes the upstream-ack audit assertion order-independent.

This branch was previously deployed

1 inactive deployment
npm — bfdd4e35 Deployed Nov 26, 2026 by neuromechanist via publish #5015
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