Repository navigation
B3: resubmission note on publication requests - #2379
Merged
neuromechanist merged 7 commits intoNov 25, 2026
Merged
neuromechanist merged 7 commits into
neuromechanist merged 7 commits into
Conversation
…e' into feature/issue-2368-resubmission-note # Conflicts: # src/commands/dataset.ts
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2379Version: 🤖 Updated on each push. |
…e' into feature/issue-2368-resubmission-note # Conflicts: # backend/src/services/identifier-screen.ts
Contributor
Author
|
Merge gate (lead): head 53a642a. Every remote check passes after one rerun of integration shard 4 (the repull CLI timeout flake, #2377). Review: round 1 panel (code+tests; errors+comments+types), 1 important finding and 7 more fixed; round 2 delta review resolved all eight items. One suggestion (optional chaining on the readline handle) is rejected: a TypeError on an inquirer change fails the Ctrl+C test at once, where optional chaining would hide it. The depositor mail derives its text part from html that never holds the note. |
neuromechanist
merged commit Nov 25, 2026
3aa8a21
into
feature/issue-2182-epic-pq-decide
51 of 53 checks passed
This was referenced Nov 26, 2026
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 #2368. Part of #2182.
Card B3 of the publication-queue plan (ADR 0139, decision 5): a publication request can carry a resubmission note of at most 2,000 characters, the CLI asks for one after a denial, and administrators see it wherever they see the request.
What changed
resubmission_note TEXTandprevious_request_id INTEGERtopublication_requests(both nullable). D4 (D4: quiet, paced re-screen of the queue #2373) adds 0150 and had not merged when this PR was opened, so 0150 is absent from this branch; 0151 touches no column 0150 does, and if D4: quiet, paced re-screen of the queue #2373 merges first, merge the base into this branch before merging it.shared/resubmission-note.ts, used by the Worker and the CLI: trimmed, empty becomes NULL, at most 2,000 characters (code points) after trimming, no control character except a line break (CRLF is read as a line break). A refused note is a 400invalid_resubmission_notewith the rule's sentence and areason, and nothing is written or mailed.POST /datasets/:id/publish/requestreadsresubmission_notefrom its optional JSON body, stores it, linksprevious_request_idto the dataset's most recent earlier request when that one was denied and not withdrawn (ADR 0104), echoesresubmission_note_recordedon success, and keeps an earlier note when a held request is asked again without one.GET /datasets/:id/publish/statusgainsdenied_by_kind(agentwhen anauto_denyaudit row names the request, elseadministrator, null unless the request was denied and not withdrawn). The constantAUTO_DENY_AUDIT_ACTIONis shared so the denial that writes the row (B5) and this read use one word.nemar dataset publish request [--note <text> | --note-file <path>]: with neither flag and a denied (not withdrawn) last request, a terminal is asked once with the card's sentence, and a session with no terminal is told a note can be added and goes on. The CLI refuses a note the Worker would refuse before it sends anything.previous_request_idare on the review detail (GET /admin/publish/:id/review, soshow,nextand the web detail JSON) and on the list rows (the row already spreadspr.*);showprints the note quoted under the label "Depositor's note" with a line saying the depositor wrote it;listmarks a request that has one; the admin mail renders it as a labeled, quoted, fully escaped block. The depositor's own mails and status answer never carry it.Tests
backend/test/resubmission-note.test.ts(real routes over bun:sqlite with every migration applied, GitHub and Resend as local stand-ins): the rule at its edges (2,000 and 2,001, emoji, padding, control characters, non-text), no row and no mail on a refusal, held-request keep and replace,previous_request_idfor a denial, a first request, a withdrawal, and a withdrawal after a denial, the status answer's agent and administrator readings including a payload that is not JSON, the list row and review detail, the mail (escaped HTML and Markdown, no block without a note, read from the row whichever caller sends it), and that the depositor's denial mail never carries the note.test/publish-resubmission-note-cli.test.ts(the CLI spawned against the real backend app, a pseudo-terminal for the prompts):--note,--note-file, both flags, an unreadable file, 2,000 vs 2,001, a control character, the offer with no terminal, no offer after a withdrawal or for a first request, the prompt at a terminal (administrator and agent wording, Enter to skip, an over-long answer refused), andshow,show --jsonandlist.test/helpers/pending-cli.ts, the review detail's key list, and one source regex for the INSERT.account-copy-parityandpublication-review-copy-parity(the sibling website checkout lacks keys),git-annex-remote(the same failure on the decide branch), and one compute test that passed on rerun. Each rule was checked by reverting its line and confirming a test fails (28 mutations, including widening and narrowing the bound, UTF-16 length, the withdrawal exclusion in both the link and the prompt, the escaping, and thejson_validguard).Not done here
nemarOrg/websiteand needs the same question and aresubmission_notefield; the sentence and limit are inshared/resubmission-note.ts.openapi.jsondocuments only the public catalog routes, so there was nothing to change in it.wrangler d1 migrations apply --local) fails on the older migration 0021 ("contains several transactions"), before reaching 0151; the migration is applied by every test throughfreshDb, which applies all migrations in order.