Skip to content

feat: let a reviewer ask the applicant while the review stays open - #2803

Draft
jeremi wants to merge 56 commits into
feat/dev-prod-posturefrom
feat/proposal-asks
Draft

jeremi wants to merge 56 commits into
feat/dev-prod-posturefrom
feat/proposal-asks

Conversation

@jeremi

@jeremi jeremi commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Stacked on #2798 and lands after it (base feat/dev-prod-posture).

Why

A reviewer often needs one more thing before deciding. Until now the only way to ask was to send the request back, which ended the review and restarted it at the first stage. With this change a reviewer asks the applicant while the review stays open, the applicant answers on their Proposal with their own sign-in, and the same reviewer decides the same task. It covers #2799 and the first part of #2800 (supporting files on a submitted Proposal).

What changes

BReg

  • Asks on the Proposal: BReg reads each review provider's asks and shows them on the applicant's Proposal. While an ask is open the Proposal reads status: awaiting-party and turn: party, and appears in GET /v1/proposals?turn=party. Hooks asked and answered.
  • Answering: POST on the ask's answer link, with text and supporting files, needs the answer operation and a person's own sign-in (not an agent or service). BReg delivers the answer to the provider with its own service credentials; the applicant's token never leaves BReg.
  • Who sees answers: on the Proposal, only the person who may answer. In the review context (GET /v1/proposals/{proposalId}/review-context?include=answers), human reviewers of the current review see the answers and download the cited files, even when the Action declares no additions field. Agents, services, delegated institutional reads and the batch review-context route get none. Each answer records which files it cited, and each ask-bound download records who read it.
  • Supporting files: an Action can declare one additions slot. An applicant adds a file to a submitted Proposal without a new submission version; the ETag changes and Apply is unchanged.
  • A served status on every Proposal (draft, awaiting-party, in-review, approved, processing, applied, rejected, cancelled), derived by the same rule as turn. Revise and Rebase are no longer offered once a decision is recorded.
  • A manual Apply refused for a reason the applicant can fix (the target changed, a frozen field guard failed, a unique conflict) is recorded as a block with the matching recovery (rebase or revise), so the Proposal returns to the applicant instead of stalling. A refusal caused by the applying officer's own write boundary records nothing.
  • Every Proposal route declares exactly the problem codes it returns. Submit with an empty required slot answers 422 attachment.required; a file still being verified answers 409 attachment.verification-pending; a rejected optional file answers 422 attachment.verification-rejected. The Submit link shows the same outcome before the call.
  • Every Proposal command returns the full document (decision, handoffRefusal, input included) under the same rule a Get by that caller applies.
  • The compiler refuses a grant that can Edit, Revise or Rebase unless its readableInputs cover every input it may write (breg.proposal.input-write-unreadable).
  • The lifecycle explanation format moves to v1alpha9 and lists the statuses.

Review protocol

  • Asks: a feed of ask announcements, an ask read, and an answer call that carries only the subject and the answer time.

Casework

  • A stage opts in with asks: {}; a producer declares readsAsks. The task holder asks with POST /v1/review-tasks/{taskId}/asks; the task stays at its stage with its holder, marked waiting, then answered or expired. At most 50 asks per review request.
  • Optional due date (answerWithin, onDue: return-to-reviewer), judged by when the applicant answered. Optional clock pause while an ask is open (pauseClocks, which requires answerWithin).
  • Optional resubmission: resume-at-returning-stage: a resubmission after a send-back starts at the stage that sent it back, while the earlier request is within its result retention and the stages up to that one are unchanged. Reviewers who decided a stage in an earlier round stay excluded from the stages above it. Earlier stages do not see content the resubmission changed, so keep the first-stage default where every stage must see the final content.

Changes existing users will notice

  • Hooks without a transitions filter now also receive added, asked and answered.
  • Declaring or changing an Action's additions slot changes its revision, so Proposals already submitted must rebase.
  • The slot upload route answers 413 attachment.too-large and 415 attachment.content-type (was 400 request.invalid and 415 unsupported.media_type).
  • An editing grant must now read every input it may write; projects with narrower readableInputs on Edit, Revise or Rebase grants are refused at compile time.
  • The Proposal attachment download is declared as any media type, matching what is served.

Fixed on the way

  • Casework's dispatch outbox set a delivery's next attempt from the application clock while the claim compared it with the database clock, so an immediate claim could find nothing when the host ran ahead. Both now use the database clock. This predates the branch.

Checks

Linux (dev server) at cc42f7286e, the last code commit: identifiers generate and check, BReg check-contracts.sh in full (including its Python suites) and check-client-contract.sh, Casework check-schemas.sh and product contracts, BReg and Casework Node bindings, all passing. The two commits after it are a changelog correction and the identifier catalogue that run generated.

macOS, per part: fmt; clippy with -D warnings on every changed crate; BReg library (958) and PostgreSQL suites (postgres_proposal, postgres_proposal_review_delivery, postgres_proposal_security, postgres_proposal_task_authority, proposal_asks); Casework library, review_postgres, review_http, migration pins; protocol and client tests; BReg Node and Python bindings; the executable reviewed-evidence journey with real BReg, Casework and Evidence binaries (ask, answer with a file, reviewer download, decision on the same task; 43 checks), run again after the last change.

Not covered: the S3 path for additions (the database store path is tested); an upgrade fixture with ask-feed receipts written before their retention window was stored; Casework native Python runtime tests; Vale on the docs.

A command response carries decision, handoffRefusal and input under the Get authority of the caller's profile, so a client need not read the Proposal again. A profile without Get is served none of them. A response that serves a public reason records the same audit marker a read does.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
The download answers with the stored content type, so its OpenAPI response is */* as the Document Store declares its content download.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…eclare it reads them

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ped 404 and 409

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…to the producer

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…keep delegated reads free of ask state

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
… its read

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…Proposal receipts

A replay that serves a stored public reason records the audit marker, the receipt binding covers the grant's readableInputs, the Get gate fails on errors other than a refusal, the self link and attachment metadata reuse that gate, and the docs say what a command response and its replay serve.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…olves it

The hint no longer offers narrowing writableInputs, the diagnostic path names the profile and Action, a table test pins the standing-agent exemption from the refusing side, and two fixtures say why they use Submit.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…sumes

A request that resumes at the returning stage stores the staff who decided the earlier round's prior stages, so excludePreviousStageReviewers holds across rounds and after the earlier request is erased. Claim, assignment, staffing, accountability reads and decisions all consult the set.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…ecided

A resumed request now stores each earlier-round reviewer up to and including the returning stage with the stage index they decided, so excludePreviousStageReviewers keeps them out of later stages exactly as within one request, while the returning stage's reviewer may review it again. A later round erased first stops an older changes-requested round from resuming. Tests cover the staffing-shortfall and accountability-read exclusions, and the security contracts map cross-round separation of duties.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…unchanged

Earlier-round reviewers are stored with stage positions, so a revision that reorders stages at or below the returning stage could under-exclude them. Such a resubmission now starts at the first stage; stages added or reordered above the returning stage still resume.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Agents, delegated reads and services holding get-review-context no longer receive context.asks or the ask-bound download, and the batch inbox read carries no asks or ask disclosure audit.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…t problems and lifecycle v1alpha9

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…er boundary refusals out of Apply blocks

The Proposal document's asks member reached every Get holder, and a manual Apply refused for one caller's row boundary blocked the Proposal for everyone. Asks now follow Answer admission, which takes the human caller test, and a write-boundary refusal persists nothing. The Casework docs state that resuming at the returning stage skips earlier stages for changed content, and document the per-request ask cap.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Opt into live applicant answers only for displayed review context, preserve human credentials, and cover preflight and inbox omissions across BReg and Casework.

Allow uncited current-submission files at the additions limit, signal permanent clock-skew delivery refusals, and prune value-free feed receipts without rereading retained asks after cursor resets.

Record the answer, disclosure, replay, erasure and feed security invariants with executable regression tests and generated contracts.

Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>

This branch has not been deployed

No deployments
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