Repository navigation
Commit 8ddadc1
docs(spec,adr): the action-page contract and ADR-0043 name the reject link's required reason (#37153)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBEaJzgBWzjWCNjBjkVoeRto)_
Fixes #36709
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:用户无感;只改审批"邮件一键处理链接"的接口说明和对应架构决策记录的补充说明,让它们写明驳回时必须填写理由、不填会被退回确认页。
-
为什么做:属于"审批流程"这一块;上一轮已让邮件链接驳回必须填写理由,但对外发布的接口说明和决策记录还停留在旧说法,会误导读这些文字的开发者和
AI。
- 出错会怎样:只是文字,不改任何行为;写错最多是说明不准,可以直接撤回。
- 要你做什么:本次含一条架构决策记录的补充说明,而该记录没有"决策/状态"小节,自动判定只能归为需要审批人合并的一档,请按该档处理。
## What changes
Text only, no behaviour change. PR #36695 made the email action-link
reject require a typed reason; contract review 7101851923 on it (nit N1)
found two texts still describing the old POST.
- `packages/spec/src/contracts/approval-service.ts`, the
`IApprovalService.handleActionPage` docblock only:
- `GET`: a reject link's confirm form also carries a required reason
field, named `comment`.
- `POST`: reads `token` and, for a reject link, `comment` (the last of
each when a field repeats); a reject records that reason as its comment;
an approve reads no `comment` and records the fixed "Via action link".
- New bullet: a reject whose `comment` is missing, blank or not a string
is refused before the token is consumed and answered the same confirm
page again, carrying the refusal, with status `400` (redemption outcome
`reason_required`). A dead link is judged first and still gets its `200`
result page. The existing "never as an error status" sentence gains "The
`400` above refuses the input, not the link."
- `@param` / `@returns` say the same.
Each statement is read off the implementation on `origin/main` 517e415
(`ApprovalService.handleActionPage`, `redeemActionToken`,
`actionRedemptionPage` in
`packages/plugins/plugin-approvals/src/approval-service.ts`), not off
the card.
- `docs/adr/0043-actionable-approval-links.md`: one ADD-ONLY paragraph
after the Non-goals list. No existing line edited or removed; the first
Non-goals bullet stands as written for v1.
- `.changeset/36709-action-page-contract-reject-reason.md`:
`@objectstack/spec` patch. Measured, not assumed: the docblock ships.
After `pnpm --filter @objectstack/spec build`, the new sentence "refuses
the input, not the link" is found in `dist/contracts/index.d.ts` and
`.d.mts`, both inside `files[]` (`dist`). Positive control: the existing
"The token is the only credential" sentence is found in the same two
files. So `skip-changeset` would be wrong, and `Check Changeset` needs
either a changeset or that label.
Read first (by risk): (1) the new `400` bullet in the docblock, since it
is the contract sentence an AI caller reads; (2) the ADR paragraph, for
add-only shape; (3) the changeset.
## Tests
No behaviour moved, so no test was added and no ablation applies
(docblock and ADR text).
<details><summary>Local runs on 5d4cdbc</summary>
- `pnpm --filter @objectstack/spec build`: lock VERDICT command-exit 0.
- `pnpm --filter @objectstack/spec typecheck`: lock VERDICT command-exit
0; `check:test-typecheck: OK`.
- `pnpm --filter @objectstack/spec test`: lock VERDICT command-exit 0;
`Test Files 889 passed (889)`, `Tests 28273 passed | 1 todo (28274)`.
</details>
## Acceptance notes
- **Landing tier.** The ADR row's add-only arm cannot apply to this ADR,
whatever the note says. `addOnlyNoteReasons` from
`scripts/pm/check-governed-merges.mjs`, run on this diff at full
context, returns exactly one reason:
"`docs/adr/0043-actionable-approval-links.md` names no decision or
status heading, so where a note sits cannot be judged". ADR-0043's
headings are TL;DR, Mechanics, Non-goals (v1) and Consequences, and its
Status is a bold line, not a heading. An add-only diff cannot add such a
heading to the base side, so this PR reads Tier H. The note's own lines
pass every other test the reader applies (no removed line, plain-prose
allowlist, no status line, no header-block line).
- Contract review N2 to N5 on PR #36695 stay outside this card, as that
review placed them.
## Verification
<details><summary>Derived gate families (dispatch-gates, tree a48e05f
then 5d4cdbc)</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 85 commands with the changeset
present. 82 exited 0. Three exited 3 (PREREQUISITE NOT MET), left to CI
and recorded as NOT MEASURED:
- `node scripts/check-plugin-teardown-shape.mjs --self-test`: the
fixture is pinned to a commit a shallow checkout cannot reach.
- `pnpm check:dual-build-cjs-loads`: needs the whole workspace built.
- `pnpm check:lean-entry-closure`: needs `@objectstack/objectql` built.
`pnpm --filter @objectstack/lint run check:doc-formula-expressions`
first exited 3 (unbuilt `@objectstack/formula`); after building formula
and lint it exited 0.
`--ran` reconciliation: "85 derived, 82 run, 3 NOT-MEASURED, 0 UNRUN" (3
derived from a recorded exit 3).
Overlap: `node scripts/pm/overlap-check.mjs
--branch=claude/issue-36709-approval-action-page-docs` reported `VERDICT
clean exit 0` before each push. The in-flight branch
`claude/issue-37041-batch-lock-detail-lines` (a770353) does not touch
`packages/spec/src/contracts/approval-service.ts`, and this diff stays
inside the `handleActionPage` docblock.
</details>
Two-minute check: `git diff origin/main...HEAD --
docs/adr/0043-actionable-approval-links.md` shows only `+` lines (ten of
them). `grep -n "reason_required"
packages/spec/src/contracts/approval-service.ts` hits the docblock once.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzg3KqwSpt61Y8ovKK7)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzg3KqwSpt61Y8ovKK7 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6161010 commit 8ddadc1
3 files changed
Lines changed: 45 additions & 9 deletions
File tree
- .changeset
- docs/adr
- packages/spec/src/contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1391 | 1391 | | |
1392 | 1392 | | |
1393 | 1393 | | |
1394 | | - | |
1395 | | - | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
1396 | 1397 | | |
1397 | 1398 | | |
1398 | 1399 | | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1403 | 1414 | | |
1404 | 1415 | | |
1405 | | - | |
| 1416 | + | |
1406 | 1417 | | |
1407 | 1418 | | |
1408 | 1419 | | |
| |||
1433 | 1444 | | |
1434 | 1445 | | |
1435 | 1446 | | |
1436 | | - | |
1437 | | - | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1438 | 1450 | | |
1439 | 1451 | | |
1440 | 1452 | | |
0 commit comments