Skip to content

Phase: a pending publication request is a state, not an error - #1678

Merged
neuromechanist merged 37 commits into
feature/issue-1671-epic-bru-upload-fixesfrom
feature/issue-1646-publish-pending-state
Oct 8, 2026
Merged

neuromechanist merged 37 commits into
feature/issue-1671-epic-bru-upload-fixesfrom
feature/issue-1646-publish-pending-state

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Right after an upload, nemar dataset publish request <id> is refused with block reason bids_validation_pending or bids_validation_in_progress because the BIDS validation run has not started or finished.
The backend records the request as blocked and a sweep continues it once CI passes, but the CLI printed "re-request publication" and exited 1, so a depositor concluded the request had been rejected and scripted uploads wrapped the command in their own retry loops (issue #1646).
A CI-pending refusal is now reported as a pending state with exit 0, and the user checks CI with the command that already exists, nemar dataset ci <id>.

The first commit is the contributor's original change (PR #1652, bruAristimunha), preserved with authorship.
A client-side --wait loop was rejected in review: the server already records the request and owns the transition, and every re-request repeats the GitHub readiness check and rewrites the row once a minute for up to 24 hours per waiting client.
What is kept from the contributor's work: recognizing the two CI-pending block reasons (isCiPendingBlock), the hint helper and their tests, in src/lib/publish-pending.ts (renamed from publish-wait.ts).

The commits on top fall in three groups.

CLI

  • --wait, the retry loop and the polling plumbing are removed
  • a CI-pending refusal is an info message and exits 0, with one clause for "has not started yet" and another for "is still running"; the hint says the request is recorded, that NEMAR continues it once validation passes (no time is promised), how to check validation (nemar dataset ci <id>), that a re-run after the request moved on answers "a request already exists, nothing more is needed", and that a failed validation or a missing submission minimum leaves the request blocked with nothing emailed; the CI link from the response is printed
  • every other refusal (bids_validation_failed, min_requirements_failed, 409, 403, an owner name missing, an unknown reason) is unchanged and still exits 1
  • publish status shows a waiting request in the same info style (it printed a red "Blocked: ... then re-request publication"), with a hint that keeps --anonymous for an anonymous request
  • an --anonymous request whose response does not confirm anonymity now exits 1 on both the pending and the accepted path (the accepted-path warning predates this PR and exited 0); the hint's --anonymous comes from the flag that was typed, never from the server's echo, because a re-request resets anonymous to what the flag says and "run it again" would otherwise turn a blind request into a named one
  • the upload's success output says BIDS validation runs on GitHub after the upload, how to check it, and to request publication once it has passed; when CI could not be set up (owners cannot run the admin-only command) it says CI is set up when publication is requested; sandbox xx datasets get no publish line; deployCiStep now returns its outcome
  • the shared accepted-request notice gains one sentence: "You will be emailed if a check needs your attention, and when an administrator decides." It does not promise a mail when the checks complete, because a clean identifier screen mails the admins, not the requester
  • publish request --help-all gained two lines on the same flow

Backend (separate commits, droppable)

  • the ADR 0026 submission minimums and, for --anonymous, the blind check now apply to a request that is only blocked on CI, through one shared function (checkSubmissionGate) used by both the request route and the sweep: before this change a CI-pending request skipped them in the route and the sweep released it without them, and a request right after an upload is nearly always pending; a missing minimum is answered at once as min_requirements_failed with its reasons; the sweep re-blocks a request that fails the gate, and an anonymous blind that cannot be read is never released
  • the sweep's three writes (release, minimums re-block, failing-validation relabel) are conditional on the row exactly as it was read (status, anonymous flag, block reason, updated_at): without that, a concurrent request --anonymous could be overtaken and the row released with anonymous=1 while Authors still named the depositor (ADR 0065: irreversible); a lost race counts as skipped; a real race is tested
  • an empty or unreadable README no longer switches the whole gate off; the sweep's gate reads use a single-attempt policy that never sleeps and a per-run budget of 100 reads (rows beyond it are deferred, not guessed); rows the sweep looks at and leaves no longer starve the queue
  • when the CI readiness check itself throws (a GitHub outage, an expired token), the row is still written but the route answers HTTP 503 ci_check_unavailable instead of a 422 identical to "no run yet", so the CLI reports an error rather than "recorded, will continue"; the block-reason vocabulary is unchanged
  • the pending block messages no longer say "then re-request publication" (the in-progress message keeps the phrase exemplar-clone.ts and import-openneuro.ts match)
  • the two pending reasons are declared once in shared/contract/publication.ts (CI_PENDING_BLOCK_REASONS, isCiPendingReason); two additive exports, the vocabulary schema is unchanged

Docs

  • amendments to ADR 0086 (the pending-state decision, what the sweep checks and writes, its cadence and caps), ADR 0090 (the notice) and a pointer from ADR 0026

Part of epic #1671. Supersedes #1652 (contributor PR retargeted to the epic branch). Issue: #1646.

For the owner to review

  • The backend commits change policy, not only wording. The minimums gate on the pending path and in the sweep, the conditional sweep writes, and the 503 are there because the pending-state design makes the sweep the default path after an upload, which would otherwise bypass a binding hard gate (ADR 0026) and could release an anonymous request under a name (ADR 0065). They are in their own commits so they can be reviewed or dropped separately, but the CLI promise "NEMAR continues it once validation passes" is only honest with them.
  • Shared text and mail. publicationRequestNotice is printed by the CLI and returned by the backend route as request_notice; ADR 0090 names it as the one place those sentences are spelled, so its amendment was updated and the pinning tests were changed deliberately. The requester is mailed when a screen finds something (to requested_by), on denial (to requested_by) and on approval (to dataset.owner_email, which differs only when an admin requests on an owner's behalf). A requester mail on a clean screen would be a small backend change and a product decision; it is not made here.
  • Exit code. A pending request exits 0, so a script cannot tell "recorded as pending" from "accepted" by exit status alone.
  • Unconfirmed anonymity now exits 1 on the accepted path too.

Behavior to know about

  • The blocked-request sweep runs from the daily scheduled cleanup (03:00 UTC in production, at most 50 rows scanned, 10 released and 100 gate reads per run), so a recorded request can wait up to a day. The CLI promises no time.
  • A failing validation re-labels the request and mails nobody; cancelled and timed_out runs stay blocked (sweep behavior, unchanged).
  • After a 503, publish status still shows the row as waiting; telling an outage from a wait needs a stored marker or a new block reason (follow-up).
  • bids_validation_pending is still what the backend writes for an outage row, but the response to the request is the 503.
  • A transient README read error in the route adds the ethics reason (the user can re-request); in the sweep the same error defers the row instead.

Test plan

  • bun run typecheck (root and backend), biome check on the 26 changed .ts files
  • backend: publish-request-ci-pending 77, requester-mail-recipients 2, anonymity-publication-paths 48, identifier-screen-flow 53, cron-sweep-wiring 129, cron-dev-safety 43 and the adjacent publication, approval and anonymous-release suites; CLI: publish-pending 11, publish-pending-cli 25, publish-status-pending-cli 8, upload-success-next-steps 11, the notice-pinning tests, ADR index 8: all pass, 0 fail
  • the CI-tier grep (testRequest|TEST_API_URL|runCli\() finds nothing in any new or edited file except test/identifier-screen-cli.test.ts and test/publish-anonymous-cli.test.ts, which already matched before this change
  • about 130 mutations applied one at a time and restored byte-identical, each caught: pending exiting 1, error styling, clause swap, notice sentence, upload block lines and sandbox exemption, 422 handling, bids_validation_failed treated as pending, the typed-flag hint, the anonymity warning and exit code on both paths, headline stream, 503 handling, the status view, the gate in the route and in the sweep, anonymous unreadable fails closed, each of the sweep's conditional-write terms, the read budget, the requeue, the mail recipients
  • Not run: the full suite, the live tier, a real GitHub outage

Follow-ups (not in this PR)

  • a stored marker or a distinct ci_check_unavailable block reason (with a website vocabulary sync) so publish status can tell an outage from a wait
  • the sweep handling cancelled and timed_out runs, and mailing on a failing-validation relabel or a minimum re-block
  • run the sweep on the frequent cron tick
  • a docs.nemar.org page for the upload-to-publication flow
  • a requester mail on a clean screen, and a machine-readable --json result
  • move test/identifier-screen-cli.test.ts and test/publish-anonymous-cli.test.ts out of the live tier

bruAristimunha and others added 21 commits October 7, 2026 20:00
Right after an upload, 'nemar dataset publish request' is refused with
block_reason bids_validation_pending ('BIDS validation has not run yet') or
bids_validation_in_progress. The request IS recorded as blocked and a daily
sweep clears it once CI is green, but the CLI exited 1 with only
're-request publication', so scripted uploads (the iEEG campaign lanes)
wrapped the command in their own retry loops.

- Without --wait: a CI-pending refusal says the request is recorded and
  re-checked automatically, and names '--wait' and 'nemar dataset ci <id>'.
- --wait [minutes] (default 30, max 24 h) re-requests every minute while,
  and only while, CI has not concluded; a validation failure or any other
  refusal is reported at once. Re-requesting updates the one blocked row
  server-side; admins are notified only when the request is accepted.
The CLI no longer re-requests on a timer. A depositor follows CI with 'nemar dataset ci <id>' and requests again, or leaves the recorded request to the server's sweep. Keeps the CI-pending predicate and hint; drops the interval, clock and sleep plumbing and the tests that existed only for it.
publicationRequestNotice gains one sentence: 'You will be emailed if a check needs your attention, and when an administrator decides.' It promises only mail the requester gets: the identifier screen's blocked mail, and the approval and denial mails. A clean screen mails the admins, so nothing says the requester hears when the checks complete.

The tests that pin the notice are changed deliberately, not loosened: test/identifier-screen-report.test.ts (wording, varying part, one-place-only phrases), backend/test/identifier-screen-flow.test.ts (request_notice) and test/identifier-screen-cli.test.ts (printed lines, now five). ADR 0090 gets an amendment.
A publication request made before BIDS validation has concluded is recorded and continues on its own once validation passes, so the CLI reports it in the info style and exits 0 instead of printing a failure and exiting 1 (issue #1646). The headline tells 'has not started yet' from 'is still running'; the lines after it promise no time and name 'nemar dataset ci <id>'. An anonymous depositor is handed --anonymous back in the command to run again, because a re-request restates the flag, and an anonymous request the server did not echo as anonymous is warned about.

Every other refusal (validation failed, minimums, 409, 403, identifier findings, a 5xx) keeps its text and exits 1. The help text says validation must complete first. Tests spawn the real CLI against a local stand-in server. ADR 0086 gets an amendment.
printUploadSuccess now says BIDS validation runs on GitHub after the upload, how to follow it ('nemar dataset ci <id>') and that publication is requested once it has completed ('nemar dataset publish request <id>'). A sandbox (xx) dataset is not told to request publication, since the backend refuses it. Issue #1646.
The pending-state CLI test invented a docs.nemar.org page, which test/docs-links.unit.test.ts rightly could not resolve. It now imports SUBMISSION_POLICY_URL from the backend.
Backend. A request made while BIDS validation is pending or running skipped the ADR 0026 submission minimums and the ADR 0065 anonymity blind check, and the blocked-request sweep released it without evaluating either. A request right after an upload is nearly always pending, so the sweep was the default path and a named depositor could be released under the blind label, which cannot be undone.

The check moves into one function, checkSubmissionGate, that the request route and the sweep both call. The route now runs it when CI is the only block (a missing minimum is answered at once as min_requirements_failed with its reasons, and a re-request re-records the verdict instead of erasing it); not when CI failed, the owner has no name, or the readiness check itself could not run. The sweep runs it before releasing a request: a failing one is re-blocked as min_requirements_failed, an anonymous blind that could not be read waits for the next run. OpenNeuro imports and exemplars keep their exemption except for an anonymous request.

backend/test/anonymity-publication-paths.test.ts pinned the gate's source text in the route; the two source pins now follow it to submission-gate.ts. The behavior is driven through the real route and the real sweep in backend/test/publish-request-ci-pending.test.ts. ADR 0086's amendment now says what the sweep checks.
Backend. The readiness check mapped any exception (token, workflow deploy, GitHub outage, expired PAT) to bids_validation_pending, byte-identical to 'no run yet', so a depositor was told the request was recorded and would continue when the sweep, which makes the same GitHub calls, may never move it. The row is still written, but the route now answers 503 with error ci_check_unavailable and a message, no block_reason and no status, so nothing reads it as pending. The shared block-reason vocabulary is unchanged; a distinct block reason with a website sync is left as a follow-up. ADR 0086 amendment updated.
Backend. The bids_validation_pending and bids_validation_in_progress messages still told the depositor to 're-request publication', which contradicts a request that is recorded and continues on its own. They now say so. 'BIDS validation is currently running' stays in the in-progress message verbatim because src/lib/exemplar-clone.ts and src/lib/import-openneuro.ts decide to keep waiting by matching that substring; a test pins it, and pins its absence from the pending message. The failed, minimums and other messages are unchanged.
Backend tests. publish-request-ci-pending.test.ts gains the exact key sets of the pending, minimums, owner-name, already-open (409) and not-owner (403) bodies from the real route, so the CLI test's stand-in server cannot drift from them. requester-mail-recipients.test.ts checks the recipients the new request notice promises: a denial goes to requested_by, an approval to the dataset owner, with the two being different people so a swap of columns fails.
CLI. The hint now opens with 'Your request is recorded.' (the headline is on stderr and the hint on stdout, so a caller that drops stderr still reads that a request exists), says to check validation with 'nemar dataset ci <id>', that a repeat request may answer 'already exists' and need nothing more, and that a failed validation leaves the request blocked with no mail. The CI link the refusal carries is printed. isCiPendingBlock also requires the body to say status: blocked. The client leads with the message of a ci_check_unavailable 503, not the bare code.

An anonymous request whose server echo is not exactly true now prints the warning and exits 1 on both the pending path and the accepted path (the accepted-path warning predates this change and exited 0). The command to run again takes its --anonymous from what was typed, never from the echo. The detailed help says what a request made before validation has completed does.

Tests: the stand-in bodies carry the key sets the real route sends and the 409 and 403 bodies are the real ones; the identifier-finding case, which the route never returns, is gone. The harness moves to test/helpers/pending-cli.ts and the child gets a dead proxy with loopback exempt.
CLI. publish status printed a request waiting on BIDS validation as a red 'Blocked:' followed by the server's 'then re-request publication', and a dim 'run publish request <id> to retry now' without --anonymous, which for an anonymous request converts a blind request into a named one (the backend resets the flag on every request).

A request blocked only on validation is now shown the way publish request shows it: an info line that tells not started from running, the same hint (the command to run again carries --anonymous for an anonymous request) and the CI link. It prints no identifier-screen block, because the screen starts only when the request is released and the backend would word its absence as 'NOT RUN for this request' in red. Every other blocked reason stays a red block, and the retry command it prints now keeps --anonymous too.
CLI. deployCiStep returned nothing, so the success output said BIDS validation runs after the upload and sent the user to 'nemar dataset ci' even when the upload could not set CI up (an owner is refused by the admin-only route, and the only code that deploys CI for an owner is the publication request itself). deployCiStep now returns configured, not-configured or unknown (a resumed upload whose CI step an earlier run completed), and printUploadSuccess says 'CI is set up when you request publication' when it was not configured. A sandbox (xx) dataset keeps only the lines that do not name a publication request. 'Follow' becomes 'Check' and 'completed' becomes 'passed', since a completed run can have failed.
Backend test. The bodies the CLI tests answer with (test/helpers/pending-cli.ts) are compared field for field with what the real route sends for a pending, in-progress, failed, owner-name and ci_check_unavailable refusal, and by key set for the minimums, accepted and status bodies. A drift in either side now fails here instead of leaving the CLI tests green against a body the Worker no longer sends.
Backend test. identifier-screen-flow.test.ts asserted that a publication request with no GitHub credential is answered 422, because the readiness check that cannot run was reported as pending. It is answered 503 ci_check_unavailable now (the request is still recorded and blocked), so the case asserts that.
test/publish-anonymous-cli.test.ts predates the exit-1 rule for an anonymous release the server did not confirm: its body test answered without the confirmation and expected exit 0, and the two warning cases did not look at the exit code. The body test now gets the confirmation a real backend sends and the warning cases assert exit 1.
A request blocked for a reason other than pending validation still shows its identifier screen in publish status; only a request waiting on validation leaves it out. Closes a surviving mutant that hid the block for every blocked request.
ADR 0086 amendment: the sweep cadence is stated with its caps and kept out of the decision, the identifier-finding claim is corrected (the request route never returns it; a finding blocks later), the reason a CLI loop is rejected is given, and history phrasing is gone. ADR 0090 amendment: the notice has five lines. The README index lines for both mention their amendments.
Comments only. Five code references and two test names cited 'ADR 0090, amendment 2026-10-07', but ADR 0090 now has three amendments dated 2026-10-07; they cite the one by its title. The publicationRequestNotice docblock no longer claims that nothing else in the repository spells the sentences (tests and ADR 0090 quote them); it says that no other source file does and that a test enforces it. A backend test comment states what the message must not say instead of what it used to say.
The blocked-request sweep runs from the 03:00 UTC scheduled cleanup in production (backend/wrangler-sccn.toml).
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1678

Version: 0.10.15-PR1678.fba8e94
Commit: fba8e94


🤖 Updated on each push.

The two block reasons that only say validation has not concluded were spelled three times: a Set in the CLI, an inline pair in the request route and a list in the sweep. They are now CI_PENDING_BLOCK_REASONS, CiPendingReason and isCiPendingReason in shared/contract/publication.ts, which the CLI re-exports, the route calls and the sweep spreads into its candidate list. The block-reason vocabulary itself is unchanged. No behavior change.
Backend, comments and one condition. CI_CHECK_UNAVAILABLE_MESSAGE and its doc block sat between the BLOCK_MESSAGES doc block and BLOCK_MESSAGES; the message moves above both. The 503 branch tests ciCheckFailed alone, since it is only ever set together with blocked. The comment above the minimums call keeps the route-specific rule (when it runs) and points at checkSubmissionGate for the rest instead of restating it. No behavior change.
Backend. The dataset_description.json read and the README loop shared one try, so a README that could not be read took the whole gate with it: a 0-byte README.md (GitHub answers base64 with empty content, which getFileContent threw on) made a native request fail open, so Name, Authors and ethics were never checked and the sweep released it, and an anonymous request stayed unverified forever, a permanent daily error in the sweep.

The README is now read only when EthicsApprovals lists no approval (the one rule it can change) and a README that cannot be read counts as one with no statement, so it never takes the Authors rule with it. getFileContent returns the empty string for a zero-byte base64 file. A description that cannot be read is 'unverified' for everyone; the route keeps its policy (an anonymous release is blocked, a native submission goes on to the admin review) and the sweep defers the row, so a native request whose description cannot be read is no longer released by the sweep.
Backend. The sweep's submission-gate reads used the default GitHub policy: below 50 remaining requests a read sleeps up to 60 s before it goes out, and a 5xx or 429 retries with Retry-After up to 60 s, so one row measured 3 s with a bucket that resets in 3 s and a batch of rows could stall a scheduled invocation. Gate-blocked and unverified rows do not count toward the 10-unblock cap, so 50 rows with no README made about 300 requests.

getFileContent takes a retry policy and the sweep passes LOOKUP_ONCE (interactive kind, one attempt, the policy branchExists already uses for the same reason). Any read that fails in the sweep, native or anonymous, defers the row to the next run and counts it as an error: a daily batch loses a day by waiting, and a verdict from a partial look is worse. The gate's reads share a budget across the sweep (MAX_GATE_READS_PER_SWEEP, 100, a parameter for tests); once it is spent the rows not yet evaluated are left untouched and counted in the tally as deferred, with the number of reads made as gateReads, and the cron log line says deferred. The route keeps its policy.
Backend. The sweep checked the budget before calling the gate, and the gate checks it before every read, so the first check was redundant for a row that needs reads and wrong for one that needs none: an exempt dataset was held back by a spent budget though the gate would have cleared it without reading. The sweep no longer checks; a test releases an exempt row with the budget at zero.
Backend. The sweep reads its candidate rows, spends GitHub calls on each, and writes afterwards, with only status = 'blocked' to guard the write. A request made again in between (a native pending row re-requested with --anonymous while the file still names the depositor) is still blocked, so the sweep released it on a verdict reached for the native row and ended with anonymous = 1, no block reason and stale reasons: a named depositor under the blind label, which ADR 0065 says cannot be undone.

All three writes (release, minimums re-block, failing-validation relabel) are now conditional on the row being as it was read: status, anonymous, block_reason and updated_at, with IS so a NULL compares. A write that finds the row changed is left undone and counted as skipped, not released and not an error. The release also clears min_requirements_reasons, as the route does. The tests make the real route request mid-run from inside the GitHub stand-in, and change each of the three columns alone for each of the three writes.
Backend test. A denial leaves block_reason and anonymous as they were and, within the same second, updated_at, so only the status term of the sweep's write condition can see it; the per-column race cases did not include it, and removing the term left them green. The three writes now have a case that changes status alone.
Backend. The sweep takes candidates oldest updated_at first, 50 at a time, and a row it looked at and left as it was (CI still running, a file that could not be read, a CI lookup that failed, a dataset with no repository, a request already labelled as failing) kept its old updated_at, so 50 of them filled every run and nothing behind them was ever reached. Those rows are now moved to the back of the queue by stamping updated_at, under the same condition as the other writes. Rows it did not look at (over the unblock cap, or deferred by the read budget) are left where they are so the next run starts with them.
Backend test. Moving a looked-at row to the back of the sweep's queue writes updated_at under the same condition as the sweep's other writes; a row that a concurrent request changed in between is left alone. Removing the condition left the suite green.
Comment and ADR 0086. The route comment and the ADR said the sweep 'makes the same calls' and would fail the same way. It does not: it reads the run list with the same credential and recovers when GitHub does, but it does not deploy the workflow, so a request recorded after a failed deploy waits for a run nothing starts. They now say that, and that the row keeps the pending reason so publish status still shows it as waiting on validation; telling the two apart would take a stored marker and stays a follow-up.
The pending hint told the depositor that a failed validation leaves the request blocked with nothing emailed, but not that a submission minimum failing when the sweep goes to release it does the same: the sweep re-blocks the request as min_requirements_failed and mails nobody. The hint and ADR 0086 say so, and ADR 0026's Consequences, which said the gate runs only on publication requests, point at the amendment that has the sweep run it too.
CLI, no behavior change. The status handler tested isCiPendingReason twice, once only to narrow the type, and built the retry command outside the only branch that uses it. The pending reason is computed once, narrowed, and used for both the screen suppression and the info branch; the retry command moves into the red branch.
The two pending-output CLI test files repeated the same stand-in setup, reset hooks and spawn helpers, and the stand-in repeated its own defaults again. usePendingCliHarness() owns the stand-in, its reset (now a method on it), the per-test config directory and the default timeout for a file, so the 33 per-test timeout arguments go (the two tests that run twice keep an explicit one). pendingStdout() is the repeated expectation of what a pending request prints. spawnBun() is split out of spawnCli so the upload test's subprocess reuses the config directory, the environment scrub, the dead proxy and the signal check instead of repeating them. Behavior of the tests is unchanged and every earlier mutation stays killed.
Rename describe_ to descriptionJson (it took a new ethics parameter in the same change), loop over cases.entries() instead of recomputing an index, and cut the 503 tests to what the field-for-field body pin does not already say: the status, the error code and the recorded row. The test that the body has no block reason is the pin's toEqual.
ADR 0086 amendment. The README is read only when no approval is listed and never takes the other rules with it; the route and the sweep differ on a description they cannot read (the route's policy, the sweep defers); the sweep's reads never sleep, share a budget and give no verdict from a partial look; every write is conditional on the row as read; rows looked at and left move to the back.
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review record

Two passes of the PR review toolkit (Sonnet agents): code review, test analysis, silent-failure hunt, comment analysis and a propose-only simplifier on the CLI redesign; then a second focused review of the backend code that the first round added, and a second simplifier on the whole PR. Every finding below was fixed unless it is listed under "Not done". Tip at the time of writing: a8c9d1ef.

Critical

  • The sweep and the route skipped the ADR 0026 minimums and the anonymity blind check on the new default path (code review, silent-failure hunt, test analysis): a CI-pending request never evaluated them, the sweep released it without them, and re-requesting while CI ran erased a recorded min_requirements_failed. One shared gate now runs in the request route (a missing minimum is answered at once) and in the sweep before release.
  • An infrastructure failure read as "recorded, will continue automatically", exit 0 (silent-failure hunt, ran): the route answered the same 422 body for a GitHub outage or expired token as for "no run yet". It now answers 503 ci_check_unavailable after writing the row.
  • publish status told an anonymous depositor to re-run publish request without --anonymous (code review, ran): the re-request resets anonymous, so it would silently turn a blind request into a named one. The status hint keeps the flag, and a pending request is shown in info style.

Important

  • The sweep could release an anonymous request after a concurrent re-request (focused backend review, ran): the gate used the row as read at the start of the run while the UPDATEs guarded only status = 'blocked'. All three sweep writes now bind the observed status, anonymous flag, block reason and updated_at; a lost race counts as skipped; the real race is a test.
  • An empty or unreadable README switched the whole gate off (focused backend review, ran): the README read is now independent and only adds the ethics reason; a description that cannot be read is unverified (anonymous requests are never released on it; the sweep defers the row).
  • The sweep's gate reads could sleep inside scheduled() (focused backend review, ran): the sweep uses a single-attempt policy that never sleeps and a budget of 100 reads per run.
  • Unconfirmed anonymity exited 0 (silent-failure hunt, ran): now exit 1 on both the pending and accepted paths; the hint's flag comes from the typed flag.
  • Upload advice was wrong when CI could not be set up (silent-failure hunt, ran): deployCiStep returns its outcome and the output says CI is set up when publication is requested.
  • Comments and ADR text that were false (comment analysis): "an identifier finding keeps its text and exit 1" (the route never returns one; findings block asynchronously), "exactly as a re-request would" for the sweep, the sweep's cadence, the "nothing else spells these sentences" claim, and history narration.
  • Test gaps (test analysis): three surviving anonymity mutants, the headline stream and info styling, the exact hint lines, the stand-in bodies against the real route, the approval and denial mail recipients, the real 409 and 403 bodies.

Suggestions and nice-to-have (all applied)

  • Pending reasons declared once in the shared contract; hint wording; the ci_url printed; status: blocked required by isCiPendingBlock; help text; stale sweep rows no longer starve the queue; the sweep's tally reports skipped, deferred and gateReads; stacked doc blocks; shared CLI test harness, default timeouts, a spawnBun helper; ADR index lines and cross-references.

Verification

  • Typecheck, Biome on 26 files, 352 backend and 69 CLI tests in the final spot check (many more across the adjacent suites), tier grep clean apart from two files that were already live-tier.
  • About 130 mutations applied one at a time and restored byte-identical, each caught; three survivors were found by the authors during the rounds and closed by new tests (the status term of the sweep's write condition, the sweep's own redundant budget pre-check, a status view hiding the screen for every block).

Not done (tracked follow-ups)

  • a stored marker or a distinct block reason so publish status can tell an outage from a wait
  • the sweep's handling of cancelled and timed_out runs and a mail on a failing-validation relabel
  • running the sweep on the frequent cron tick, a docs page, a requester mail on a clean screen, --json
  • moving the two pre-existing live-tier test files out of the live tier

The services/github export-surface pin deliberately excludes symbols that exist for cross-module wiring; LOOKUP_ONCE is only used by the submission gate, so it is imported from its module, as branchExists already is. unit-pure failed on the extra runtime export; the pin is unchanged.

This branch was previously deployed

1 inactive deployment
npm — fba8e94d Deployed Oct 8, 2026 by neuromechanist via publish #3247
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.

2 participants