From a48e05f9a1ebf8934b0fa59005cf7aaa26af2d89 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 22:19:04 +0000 Subject: [PATCH 1/2] docs(spec,adr): the action-page contract and ADR-0043 name the reject link's required reason IApprovalService.handleActionPage's docblock now says the POST also reads a reject's reason from the form's `comment` field, and that a reject with no reason is answered the confirm page again with status 400 (outcome `reason_required`), the token unconsumed. ADR-0043 gains an add-only note under its Non-goals: comment capture shipped for reject in #36695. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7 --- docs/adr/0043-actionable-approval-links.md | 10 +++++++ .../spec/src/contracts/approval-service.ts | 30 +++++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/docs/adr/0043-actionable-approval-links.md b/docs/adr/0043-actionable-approval-links.md index 9ded55e1417..485798d14c4 100644 --- a/docs/adr/0043-actionable-approval-links.md +++ b/docs/adr/0043-actionable-approval-links.md @@ -66,6 +66,16 @@ GET-executes design gets requests approved by robots. brute force is not the threat — leaked links are, and those die on first use / decision / reassign / expiry). +Note (2026-11-24): comment capture on the confirm page has shipped for +reject, in PR #36695. A reject link's confirm page carries a required +reason field, posted as `comment` beside the token, and the decision +records that text as its comment. A POST whose `comment` is missing, blank +or not a string is answered the same confirm page again with status `400`: +nothing is decided and the token is not consumed, so the approver can type +a reason and send the same link again. An approve link is unchanged: its +page has no comment field and the decision records the fixed comment "Via +action link". The first Non-goals bullet above stands as written for v1. + ## Consequences - The remind nudge becomes genuinely actionable — one tap from the diff --git a/packages/spec/src/contracts/approval-service.ts b/packages/spec/src/contracts/approval-service.ts index e43d2d0c696..a42aba259a1 100644 --- a/packages/spec/src/contracts/approval-service.ts +++ b/packages/spec/src/contracts/approval-service.ts @@ -1391,18 +1391,29 @@ export interface IApprovalService { * What it serves, exactly as the plugin's self-hosted pages serve it today: * - `GET` renders. It reads the raw token from the `token` query parameter * and answers the confirm page — the request summary and a form that - * `POST`s the token back — or, for a token that is invalid, expired, - * consumed or no longer live, the explanatory result page. ⛔ A `GET` + * `POST`s the token back (a reject link's form also carries a required + * reason field, named `comment`) — or, for a token that is invalid, + * expired, consumed or no longer live, the explanatory result page. ⛔ A `GET` * never decides: mail gateways prefetch every link in a message, and a * `GET` that executes gets requests approved by robots. * - `POST` redeems. It reads the token from the `token` field of the form - * body, runs ADR-0043's whole redemption chain (hash lookup, not - * consumed, not expired, request still `pending`, approver still holding - * the slot, consume, then decide AS that approver), and answers the - * result page. + * body and, for a reject link, the reason from its `comment` field (the + * last of each when a field repeats). It runs ADR-0043's whole redemption + * chain (hash lookup, not consumed, not expired, request still `pending`, + * approver still holding the slot, consume, then decide AS that approver, + * a reject recording that reason as its comment), and answers the result + * page. An approve link reads no `comment` and records the fixed comment + * "Via action link". + * - A reject whose `comment` is missing, blank or not a string — judged by + * the same rule every reject door applies — is refused before the token + * is consumed: it answers the same confirm page again, carrying the + * refusal, with status `400` (the redemption outcome `reason_required`). + * Nothing is decided and the link stays live, so the approver can type a + * reason and send the same link again. A dead link is judged first and + * is still told on its result page. * - Both answer an HTML page. A dead link is told on the page, never as an * error status: ADR-0043 answers "this link is no longer valid", not an - * error code. + * error code. The `400` above refuses the input, not the link. * * **The token is the only credential.** This member takes no * {@link ExecutionContext} and reads no session, cookie or `Authorization` @@ -1433,8 +1444,9 @@ export interface IApprovalService { * behind it. * * @param request - The forwarded request: on `GET` the token is in its query - * string, on `POST` in its form body - * @returns The page to show the approver + * string, on `POST` in its form body, beside a reject's `comment` + * @returns The page to show the approver: on `POST`, the result page, or + * for a reject with no reason the confirm page again with status `400` */ handleActionPage?(request: Request): Promise; } From 5d4cdbc23f2f43ad74b6132f90221e9e5bdd52ed Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 22:23:04 +0000 Subject: [PATCH 2/2] chore(changeset): patch note for the handleActionPage contract docblock Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7 --- .../36709-action-page-contract-reject-reason.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/36709-action-page-contract-reject-reason.md diff --git a/.changeset/36709-action-page-contract-reject-reason.md b/.changeset/36709-action-page-contract-reject-reason.md new file mode 100644 index 00000000000..d6f93021fe2 --- /dev/null +++ b/.changeset/36709-action-page-contract-reject-reason.md @@ -0,0 +1,14 @@ +--- +'@objectstack/spec': patch +--- + +docs(spec): the `IApprovalService.handleActionPage` contract names the reason a reject link's POST now carries + +Clause-②: no +Metadata-protocol: none + +Documentation only; no type, schema or export changes. The docblock shipped in `@objectstack/spec`'s contract types now matches what the ADR-0043 action page does since the reject-reason change in `@objectstack/plugin-approvals`: + +- The confirm page for a reject link carries a required reason field, and the `POST` reads it from the form's `comment` field beside `token` (the last of each when a field repeats). +- A reject whose `comment` is missing, blank or not a string is answered the same confirm page again with status `400` (redemption outcome `reason_required`): nothing is decided and the token is not consumed. A dead link is still told on its result page with `200`. +- An approve link reads no `comment` and records the fixed comment "Via action link".