Skip to content

D4: quiet, paced re-screen of the queue - #2373

Merged
neuromechanist merged 10 commits into
feature/issue-2182-epic-pq-decidefrom
feature/issue-2182-quiet-rescreen
Nov 25, 2026
Merged

neuromechanist merged 10 commits into
feature/issue-2182-epic-pq-decidefrom
feature/issue-2182-quiet-rescreen

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Part of #2364. Part of #2182.

Card D4: a quiet, paced re-screen of the publication queue. nemar admin repo publish screen-batch [--ids <file> | --status <requested|blocked> | --all-active] [--per-minute <n>] [--apply] re-screens many requests in one batch. It is a dry run unless --apply is given, and the CLI paces the dispatches itself (default 4 a minute, at most 10, because each screen is a GitHub Actions run). Ctrl-C stops dispatching, closes the batch on the screens already started, and those still report.

Each screen stores the same result a single screen stores, and the gate and the review start are unchanged. The batch sends no per-request administrator mail and no depositor mail on a block; one digest goes to the administrators when it ends. The digest is due when every request has settled or two hours after the last dispatch (the existing watchdog), is claimed with a lease so exactly one is sent, and names the screen states before and after, the finding kinds, the requests whose state changed, the requests the batch blocked (depositor not mailed) and the requests that did not report. A report that arrives after the digest is mailed as an ordinary one, so no mail is dropped without the digest naming it. A blocked request is screened and stays blocked.

Changes: migration 0150 (screen_batches, nullable identifier_screen_batch_id); the screen route takes an optional { batch_id }; two new admin routes to create and close a batch; the store, callback and watchdog paths mark a batch screen's mail as covered by the digest in the same statement that stores it; the digest template and its copy table in email.ts; ADR 0086 amendment. Migration number: 0150 was the next free one on the base; if #2372 or a later card lands a migration first, this one is renumbered after merging the base.

Tested: backend/test/screen-batch-flow.test.ts (20 tests through the real admin and webhook routes over real SQLite, mail counted at the Resend boundary), test/screen-batch.unit.test.ts, and test/screen-batch-cli.test.ts (the real CLI against the real routes on loopback, including the measured pace and Ctrl-C). Every rule was reverted or widened one line at a time and a test failed each time. The full bun test was not run (about 80 minutes). wrangler d1 migrations apply --local stops at the existing migration 0021 ("contains several transactions"), unrelated to this change; migration 0150 itself was applied to a local workerd D1 and accepted.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2373

Version: 0.10.40-PR2373.72e08df
Commit: 72e08df


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Merge gate (lead): head 93df0bc. Every remote check passes on this head. Review: round 1 panel (code+tests; errors+comments+types), 6 important findings and 7 suggestions fixed (the batch settle redesign); round 2 delta review clean, its 2 suggestions fixed in b178f48. After the review, CI found two wiring tests (the route and export pins, the OIDC route walk and the sweep declaration), both fixed in 20dc859 and 93df0bc and green here. The earlier repull CLI timeouts are a known flake (#2377).

…e' into feature/issue-2182-quiet-rescreen

# Conflicts:
#	test/admin-route-inventory.unit.test.ts
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Merge gate (lead): head 72e08df, which merges the decide branch (D1) in; the only conflict was the route total (now 274). Every remote check passes on this head. Review history as in the earlier gate comment.

@neuromechanist
neuromechanist merged commit f554e79 into feature/issue-2182-epic-pq-decide Nov 25, 2026
27 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2182-quiet-rescreen branch November 25, 2026 22:46

This branch was previously deployed

1 inactive deployment
npm — 72e08df0 Deployed Nov 25, 2026 by neuromechanist via publish #4883
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