Repository navigation
fix(approvals): the approval e-mail link and the action page's inbox link open the Console under its mount - #36247
Conversation
…link open the Console under its mount The links that open a Console page (the approval e-mail's approvalUrl and the action-link pages' inbox link) now carry the Console's mount, read from the auth service's Console page composer (getConsoleUrl, AuthConfig.uiBasePath), under the approval links' own base (publicBaseUrl). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
…t type debt Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin da3ed1c44af051d266b3f7f56b029bdb2c49e001 && git checkout da3ed1c44af051d266b3f7f56b029bdb2c49e001
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d 389fb46e219571655596be992a6e662d43e41b07 && git checkout -B drift-repro 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d && git merge --no-ff 389fb46e219571655596be992a6e662d43e41b07
node scripts/docs-audit/affected-docs.mjs --json 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B) · 2026-11-22T04:19Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, one declaration line (no code) at head 席位核对Shape and gates.
The code.
Pins and evidence.
R1 (must fix: the declaration). This is
Not findings.
|
…-② yes) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B), after L1 REWORK 7074126064 · 2026-11-22T04:56Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对
Next. The seat runs the contract review for the widening, then this lands. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Contract reviewServed-tier: Face: declaration ( ① Derived judgmentsPublished surface. The package's Accept-set and public-surface changes, each against the declaration:
Origin rule (#30509). It is preserved. Security-touching: no. No changed hunk teaches permission, sharing, credential, token or authentication behaviour. The auth service is read only for a URL path, and the action-token peek and redeem calls are untouched. The new href is Findings
Not findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…o; retitle the no-auth pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Final head declared (area a4-B), after contract review FAIL 7074534890 · 2026-11-22T06:03Z:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对
Next. The contract delta read, then landing, both the seat's. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 Contract reviewServed-tier: Delta round on FAIL 7074534890, which was at ① Derived judgmentsThe delta. One commit,
No source file, no assertion, no export and no declaration line moves. F1 (should-fix): closed. I checked each sentence in the new changeset bullets against the code at this head.
F2 (nit): closed. The title at Security-touching: no. The delta is prose and a test title, and no hunk teaches permission, credential, token or authentication behaviour. The origin rule judgment in 7074534890 stands: the composer's origin is dropped, and the base is No open findings. ② Semver levelUnchanged from 7074534890: ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 席位核对Landing (area a4-B) · 2026-11-22T06:19Z · head
State change: ready + auto-merge now; on MERGED, |
…bjectstack-ai#36306) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XP3RHGWUG7UH3fNa4tBa9UC)_ repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1 Fixes objectstack-ai#36035 Clause-②: no Metadata-protocol: none ## 维护者速读 - 审批动态里「无人可审」那条系统说明不再显示岗位内部名:中文读者看到岗位的中文名(如「销售经理」),没有翻译时用岗位自己的显示名,都没有才退回内部名;英文审计原文不变。 - 接着上一轮「转交给管理员说明用岗位显示名」的修复,补上它留下的「无人可审」说明,属于控制台核心业务操作体验专题。 - 只改读取时的显示,库里存的审计原文和旧请求的说明都原样保留,转交规则不动;出问题可直接撤回。 - 无。 ## What changes 1. **The note stores its literals as a reference.** `no-approver-note.ts`: a new note stores `slots` (the slate's `type:value` literals, `noApproverSlots`) in the `__noApproverNote` snapshot entry instead of the pre-composed `who` string. `noApproverWho(slate, positionLabel?)` composes `type 'value'`, naming a position by the label `positionLabel` answers, else by its name. `noApproverSentence` / `noApproverNoteText` take an optional `positionLabel` and compose from `slots`; a note that stored `who` (written before this change) is rendered from that string exactly as before. `noApproverNoteOf` reads either shape. 2. **The read names the position the way objectstack-ai#36030 does.** `ApprovalService.localizeRoutingNotes` builds the label map for the note's positions through the existing `notePositionLabels` (reader's pack `positions.NAME.label`, else the declared `label` from `positionLabelSource`, else nothing) and passes it to `noApproverNoteText`. No second resolver: the position-name extraction is `slatePositions`, factored out of `adminRescuePositions` in `admin-rescue-note.ts`, which now delegates to it. 3. **The stored English is unchanged.** The write site (`approval-service.ts`, one hunk) stores `slots`; the row's `comment` is still `noApproverNoteText(note)` with no render, which composes the same `position 'NAME'` English as before. The refusal remedy and the submitter's notice still compose from the slate with no labels (see Acceptance notes). 4. **Docs.** `content/docs/automation/approvals.mdx`, the no-approver paragraph: the note names the position by its label for a reader and by its name in the stored text. `approval-service.ts` carries three small hunks (import, the write line, the read line); the note module could not carry the write and the read alone. `overlap-check` is clean against objectstack-ai#36295, objectstack-ai#36247, objectstack-ai#36144 and objectstack-ai#36135, which share that file. ## Tests <details><summary>Pins: admin-rescue-named-slate.integration.test.ts, new describe "[objectstack-ai#36035] the no-approver note names its position by its label"</summary> The suite's real `ApprovalService` on `ObjectQL` over in-memory SQLite, an organization with no administrator (so the request opens on the slate that names no one), the plugin catalog plus an app pack in a real in-memory `i18n` service, and a `positionLabelSource` declaring `sales_manager` as "Sales Manager". - the snapshot stores `{ action_id, slots: ['position:sales_manager'] }`; the row stores the English with `position 'sales_manager'`; a no-locale read is served that English; - zh-CN (pack label 销售经理) reads `...担任 position '销售经理' 的成员...` and no `sales_manager`; - en and ja-JP (no pack key) read `position 'Sales Manager'`; - a position no pack and no declaration knows (`treasury`) keeps its name; - CONTROL: a note rewritten to the old stored shape (`who: "position 'sales_manager'"`) renders exactly as before in zh-CN, en and with no locale. The pin went into the existing harness file as a sibling of the objectstack-ai#35418 describe rather than a new file: it reuses that file's engine, organizations and `open` helper (AGENTS.md: a new pin for a component with a shared harness goes into that file). </details> <details><summary>Ablations at 8a83eed (scripts/ablation-replace.mjs, each restored to the HEAD blob with an empty git diff HEAD)</summary> - A1 read site passes no `positionLabel`: 2 failed (zh-CN pack label, declared label) / 3 passed. - A2 write site stores the composed `who` again: 3 failed (snapshot shape, zh-CN, declared) / 2 passed. - A3 an unknown position's name dropped: 3 failed (snapshot English, unlabelled name, legacy row) / 2 passed. - A4 a stored `who` no longer read: 1 failed (legacy CONTROL) / 4 passed. </details> <details><summary>Runs at 8a83eed</summary> - `pnpm --filter @objectstack/plugin-approvals test`: Test Files 126 passed (126), Tests 1813 passed (1813). - `pnpm --filter @objectstack/plugin-approvals typecheck`: exit 0 (test layer held at its ledgered debt). - eslint over the four changed source files: exit 0. </details> ## Acceptance notes - The `__noApproverNote` snapshot entry is internal to `@objectstack/plugin-approvals` (nothing in `packages/spec`, `ui/` or the package index reads it); new notes carry `slots`, older ones keep `who`, and the read accepts both. - Same family, not in this PR, carried by objectstack-ai#36308 (class a, user-visible): the decision door's refusal remedy and the submitter's `approval.comment` notice compose the no-approver sentence from the slate with no labels, so they still name the machine name (`...holds position 'legal'...`, pinned in `exclude-submitter.integration.test.ts`). The notice is rendered per recipient at delivery, so labelling it needs the recipient's locale, not the reader's. - Observation, carried by objectstack-ai#36308 (class a, user-visible): the `{{who}}` hole carries the approver type's English machine token in every pack, so a zh-CN reader now reads `担任 position '销售经理' 的成员`, where the administrators' note translates the type (`岗位「销售经理」`). Translating the type needs a per-type clause in all eleven catalogs; out of this card's scope. ## Verification Read first: `no-approver-note.ts` (`noApproverWho`, `noApproverSentence`, `noApproverNoteOf` — the old/new shape split), the `localizeRoutingNotes` hunk in `approval-service.ts`, the write hunk at `slateSource = 'no_one'`. Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec vitest run src/admin-rescue-named-slate.integration.test.ts -t 36035` — expect 5 passed. <details><summary>Local gates at 8a83eed</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran`: 103 derived families accounted for, 103 run, 0 NOT-MEASURED (a derived zero: every family recorded an exit code, all 0). Four first answered exit 3 (prerequisite) and were rerun after it was met: `check-plugin-teardown-shape --self-test` (pinned fixture commit fetched), `check:skill-examples`, `check:i18n` and `check:dual-build-cjs-loads` (after the build closure finished). `overlap-check`: clean against origin/main and 4 open PRs. CI families: not yet reported at open. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1)_ <!-- signed: repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #34862
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The approval e-mail's link (
approvalUrl, built innotify()) and the action-link result page's "Open the Approvals Inbox" link now carry the Console's mount. The mount is not written in plugin-approvals: it is read from the auth service's Console page composer,getConsoleUrl(AuthManager.getConsolePageUrl, which readsAuthConfig.uiBasePath, default/_console). That is the composer the auth e-mails and the mention e-mail (plugin-audit) already use, so the approval links now follow the same one setting.public-base-url.ts: newconsolePageLink(publicBaseUrl, composer, pagePath). The origin ispublicBaseUrl(approvals: approval.requested / reminders / outcomes are emitted with no channels, so they are inbox-only; request e-mail too, with an approval e-mail template that deep-links to the approval page (objectstack-ai/cloud#2549 ruling B) #30509's no-guess origin rule is unchanged; the composer's own origin is dropped). Only the composer's PATH is taken, minus any base path the two share, so a sub-path deployment is not prefixed twice. No composer, a composer that throws, or one that answers no URL gives no mount: the e-mail link is then the one built before, and the inbox link isBASE/system/approvals.approvals-plugin.ts: readsctx.getService('auth').getConsoleUrllazily at link time (the same readeraudit-plugin.tsuses), and passes it to the service. The raw-app action-page mount builds the inbox href through the same function.approval-service.ts:ApprovalServiceOptions.getConsoleUrl(optional, additive).approvalUrl=consolePageLink(publicBaseUrl, getConsoleUrl, actionUrl). The action page's inbox link moves from the origin-relative/system/approvalstoBASE/_console/system/approvals(relative/_console/system/approvalswhen no base resolves;BASE/system/approvalswith no mount to read).handleActionPageand the plugin's raw-app door build it through the same function, so the two action-page doors still answer the same bytes.action-link-pages.ts:renderResultPagetakes an optionalinboxHref(default: the bare route, as before).APPROVALS_INBOX_PATHnames the route.actionUrl(/system/approvals?request=ID) is unchanged: the Console routes on it.Files outside the claim's named surface, named before editing:
approvals-plugin.ts(the wiring),public-base-url.tsandpublic-base-url.test.ts(the helper and its pins). The one source of truth used isAuthConfig.uiBasePath, through the auth service'sgetConsoleUrl. Nopackages/spec/**change and no new export; the one public-surface change is the optionalApprovalServiceOptions.getConsoleUrlmember.Measured hops (real
os devboot, the showcase, which runsserve --dev)Boot:
objectstack dev --seed-admin --fresh -p 38617,OS_BASE_URL=http://localhost:38617, SMTP pointed at a local sink (OS_EMAIL_PROVIDER=smtp,OS_MAIL_SMTP_HOST=127.0.0.1,OS_MAIL_SMTP_SECURE=false), Console built (pnpm console:build, theconsole-staticplugin loaded). Trigger: sign in as the seeded admin and retitle the "Q3 field-ops rollout" announcement, which opensshowcase_dynamic_approval(approval.requestedto the admin). The URL was read from the e-mail the sink received.Before (origin/main a5a5312)
Open the approval: http://localhost:38617/system/approvals?request=areq_d3e65840-cc6b-43cf-877c-a2b5402aab42GETthat URL, anonymous:404,application/json,{"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}}, noLocation.404, 0 redirects, the same JSON. Chromium: one navigation,404, page text is that JSON./system/approvals:404./_console/system/approvals?request=...:200 text/htmlwith the base href set to the mount; in Chromium it opens the request ("Q3 field-ops rollout", Pending, Approve / Reject).After (this branch, plugin-approvals rebuilt)
Open the approval: http://localhost:38617/_console/system/approvals?request=areq_9dac833e-7dad-48d7-bb38-4c6c8b6b82cdGETanonymous:200 text/html. Signed in, following redirects:200, 0 redirects, the base href is the mount.200, then the Console routes to/_console/apps/com.objectstack.setup/sys_approval_request/record/areq_9dac833e-..., which shows the request (title, Pending, Lead Review, Approve / Reject).GET /api/v1/approvals/act?token=not-a-token:200, and the inbox link ishttp://localhost:38617/_console/system/approvals, which answers200.Root mount: no boot on this tree serves the Console at
/.createConsoleStaticPluginalways mounts atCONSOLE_PATH(/_console), andos servepasses nouiBasePathtoAuthPlugin, so it is always/_consolethere. A deployment that serves the Console at/tells the platform throughAuthConfig.uiBasePath: '/'. That case is pinned at the service with the auth composer's exact composition: the link staysBASE/system/approvals?request=ID. Not measured on a real boot, because no boot here can produce it.Tests
approval-service.test.ts, new top-level describe "Console page links carry the Console mount": e-mail link under/_console, under/, the action page's inbox href under both, and no auth service (the e-mail link as before, the inbox linkBASE/system/approvals).public-base-url.test.ts,consolePageLink: composer origin ignored, root mount, shared sub-path, no base, and no composer / undefined / throws / not a URL.pnpm --filter @objectstack/plugin-approvals typecheck: exit 0, test-typecheck debt held.pnpm --filter @objectstack/plugin-approvals test: 126 files, 1817 tests passed.Ablations (src-imported suite, both legs through
scripts/ablation-replace.mjswith a disk-verified mutation and a HEAD-blob restore):${publicBaseUrl}${pagePath}): the/_consolee-mail pin and the action-page pin go red (2 failed / 2 passed). The root and no-auth pins stay green.${publicBaseUrl}/_console${pagePath}): the root pin, the action-page pin and the no-auth pin go red (3 failed / 1 passed).git diff HEADempty, blob1e946f96f358equal to HEAD.Acceptance notes
os servein production withoutOS_AUTH_SECRET, whereAuthPluginis skipped), there is no mount to read: the e-mail link stays as before, and the inbox link becomesBASE/system/approvals(it was the origin-relative/system/approvals). Nobody can sign in to such a deployment's Console, so its approvals inbox cannot be used anyway.publicBaseUrlthe e-mail link is still relative, now under the mount (/_console/system/approvals?...) when the auth service answers; the inbox link is then the relative/_console/system/approvals.Verification
First files to read, by risk:
packages/plugins/plugin-approvals/src/public-base-url.ts,consoleMountPath: the base-path strip is the one subtle line.packages/plugins/plugin-approvals/src/approvals-plugin.ts: the lazy auth reader, and the raw-app mount's inbox href.packages/plugins/plugin-approvals/src/approval-service.ts, theapprovalUrlhunk innotify().Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-service.test.ts -t "Console page links carry the Console mount"shows 4 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1