Skip to content

Commit a48e05f

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7
1 parent 517e415 commit a48e05f

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

‎docs/adr/0043-actionable-approval-links.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ GET-executes design gets requests approved by robots.
6666
brute force is not the threat — leaked links are, and those die on
6767
first use / decision / reassign / expiry).
6868

69+
Note (2026-11-24): comment capture on the confirm page has shipped for
70+
reject, in PR #36695. A reject link's confirm page carries a required
71+
reason field, posted as `comment` beside the token, and the decision
72+
records that text as its comment. A POST whose `comment` is missing, blank
73+
or not a string is answered the same confirm page again with status `400`:
74+
nothing is decided and the token is not consumed, so the approver can type
75+
a reason and send the same link again. An approve link is unchanged: its
76+
page has no comment field and the decision records the fixed comment "Via
77+
action link". The first Non-goals bullet above stands as written for v1.
78+
6979
## Consequences
7080

7181
- The remind nudge becomes genuinely actionable — one tap from the

‎packages/spec/src/contracts/approval-service.ts‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,18 +1391,29 @@ export interface IApprovalService {
13911391
* What it serves, exactly as the plugin's self-hosted pages serve it today:
13921392
* - `GET` renders. It reads the raw token from the `token` query parameter
13931393
* and answers the confirm page — the request summary and a form that
1394-
* `POST`s the token back — or, for a token that is invalid, expired,
1395-
* consumed or no longer live, the explanatory result page. ⛔ A `GET`
1394+
* `POST`s the token back (a reject link's form also carries a required
1395+
* reason field, named `comment`) — or, for a token that is invalid,
1396+
* expired, consumed or no longer live, the explanatory result page. ⛔ A `GET`
13961397
* never decides: mail gateways prefetch every link in a message, and a
13971398
* `GET` that executes gets requests approved by robots.
13981399
* - `POST` redeems. It reads the token from the `token` field of the form
1399-
* body, runs ADR-0043's whole redemption chain (hash lookup, not
1400-
* consumed, not expired, request still `pending`, approver still holding
1401-
* the slot, consume, then decide AS that approver), and answers the
1402-
* result page.
1400+
* body and, for a reject link, the reason from its `comment` field (the
1401+
* last of each when a field repeats). It runs ADR-0043's whole redemption
1402+
* chain (hash lookup, not consumed, not expired, request still `pending`,
1403+
* approver still holding the slot, consume, then decide AS that approver,
1404+
* a reject recording that reason as its comment), and answers the result
1405+
* page. An approve link reads no `comment` and records the fixed comment
1406+
* "Via action link".
1407+
* - A reject whose `comment` is missing, blank or not a string — judged by
1408+
* the same rule every reject door applies — is refused before the token
1409+
* is consumed: it answers the same confirm page again, carrying the
1410+
* refusal, with status `400` (the redemption outcome `reason_required`).
1411+
* Nothing is decided and the link stays live, so the approver can type a
1412+
* reason and send the same link again. A dead link is judged first and
1413+
* is still told on its result page.
14031414
* - Both answer an HTML page. A dead link is told on the page, never as an
14041415
* error status: ADR-0043 answers "this link is no longer valid", not an
1405-
* error code.
1416+
* error code. The `400` above refuses the input, not the link.
14061417
*
14071418
* **The token is the only credential.** This member takes no
14081419
* {@link ExecutionContext} and reads no session, cookie or `Authorization`
@@ -1433,8 +1444,9 @@ export interface IApprovalService {
14331444
* behind it.
14341445
*
14351446
* @param request - The forwarded request: on `GET` the token is in its query
1436-
* string, on `POST` in its form body
1437-
* @returns The page to show the approver
1447+
* string, on `POST` in its form body, beside a reject's `comment`
1448+
* @returns The page to show the approver: on `POST`, the result page, or
1449+
* for a reject with no reason the confirm page again with status `400`
14381450
*/
14391451
handleActionPage?(request: Request): Promise<Response>;
14401452
}

0 commit comments

Comments
 (0)