Skip to content

fix(approvals): the approval e-mail link and the action page's inbox link open the Console under its mount - #36247

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-a4B-34862
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/area-a4B-34862

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #34862
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 审批人点开审批邮件里的「打开审批」链接,以前在默认部署上看到的是一个“找不到”的错误页,现在直接打开控制台里的这条审批请求;审批完成页上的「打开审批中心」链接也一样修好了。
  • 属于审批与通知的整体工作:每位审批人收到的邮件唯一的链接是坏的,这次把它修好。
  • 出错的话,审批人点邮件链接仍会落到错误页或错误路径,但不影响在控制台内直接审批;本改动可直接撤回。
  • 无。

What changes

The approval e-mail's link (approvalUrl, built in notify()) 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 reads AuthConfig.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: new consolePageLink(publicBaseUrl, composer, pagePath). The origin is publicBaseUrl (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 is BASE/system/approvals.
  • approvals-plugin.ts: reads ctx.getService('auth').getConsoleUrl lazily at link time (the same reader audit-plugin.ts uses), 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/approvals to BASE/_console/system/approvals (relative /_console/system/approvals when no base resolves; BASE/system/approvals with no mount to read). handleActionPage and 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: renderResultPage takes an optional inboxHref (default: the bare route, as before). APPROVALS_INBOX_PATH names the route.
  • The in-app 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.ts and public-base-url.test.ts (the helper and its pins). The one source of truth used is AuthConfig.uiBasePath, through the auth service's getConsoleUrl. No packages/spec/** change and no new export; the one public-surface change is the optional ApprovalServiceOptions.getConsoleUrl member.

Measured hops (real os dev boot, the showcase, which runs serve --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, the console-static plugin loaded). Trigger: sign in as the seeded admin and retitle the "Q3 field-ops rollout" announcement, which opens showcase_dynamic_approval (approval.requested to the admin). The URL was read from the e-mail the sink received.

Before (origin/main a5a5312)
  • E-mail: Open the approval: http://localhost:38617/system/approvals?request=areq_d3e65840-cc6b-43cf-877c-a2b5402aab42
  • GET that URL, anonymous: 404, application/json, {"success":false,"error":{"code":"ENDPOINT_NOT_FOUND","message":"Not found"}}, no Location.
  • Same URL signed in, following redirects: 404, 0 redirects, the same JSON. Chromium: one navigation, 404, page text is that JSON.
  • Action-link page inbox link /system/approvals: 404.
  • Control: the same path under the mount, /_console/system/approvals?request=...: 200 text/html with 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)
  • E-mail: Open the approval: http://localhost:38617/_console/system/approvals?request=areq_9dac833e-7dad-48d7-bb38-4c6c8b6b82cd
  • GET anonymous: 200 text/html. Signed in, following redirects: 200, 0 redirects, the base href is the mount.
  • Chromium: one navigation, 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 is http://localhost:38617/_console/system/approvals, which answers 200.

Root mount: no boot on this tree serves the Console at /. createConsoleStaticPlugin always mounts at CONSOLE_PATH (/_console), and os serve passes no uiBasePath to AuthPlugin, so it is always /_console there. A deployment that serves the Console at / tells the platform through AuthConfig.uiBasePath: '/'. That case is pinned at the service with the auth composer's exact composition: the link stays BASE/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 link BASE/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.mjs with a disk-verified mutation and a HEAD-blob restore):

  • Mount dropped (${publicBaseUrl}${pagePath}): the /_console e-mail pin and the action-page pin go red (2 failed / 2 passed). The root and no-auth pins stay green.
  • Mount hard-coded (${publicBaseUrl}/_console${pagePath}): the root pin, the action-page pin and the no-auth pin go red (3 failed / 1 passed).
  • Restored: git diff HEAD empty, blob 1e946f96f358 equal to HEAD.

Acceptance notes

  • With no auth service in the kernel (for example os serve in production without OS_AUTH_SECRET, where AuthPlugin is skipped), there is no mount to read: the e-mail link stays as before, and the inbox link becomes BASE/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.
  • With no publicBaseUrl the 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:

  1. packages/plugins/plugin-approvals/src/public-base-url.ts, consoleMountPath: the base-path strip is the one subtle line.
  2. packages/plugins/plugin-approvals/src/approvals-plugin.ts: the lazy auth reader, and the raw-app mount's inbox href.
  3. packages/plugins/plugin-approvals/src/approval-service.ts, the approvalUrl hunk in notify().

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

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-approvals, touching 13 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/approvals.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/automation/flows.mdx (via ApprovalService (symbol, a top-level class))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-6.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via ApprovalService (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from da3ed1c44af051d266b3f7f56b029bdb2c49e001 — the merge of head 389fb46e219571655596be992a6e662d43e41b07 into base 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B) · 2026-11-22T04:19Z: 69797165252592bc57d9628122291373a13dcf7d (Fixes #34862; dev report 7073910032; claim revision for the three added files on #34862).

  • Premise measured on a real os dev boot of the showcase with an SMTP sink: the approval e-mail's link …/system/approvals?request=… and the action page's inbox link answered 404 ENDPOINT_NOT_FOUND; /_console/system/approvals?request=… answered 200 and opened the request. After the change both links carry /_console and open the request (hops in the PR body).
  • One source of truth: the auth service's Console page composer getConsoleUrl (AuthConfig.uiBasePath, default /_console), which the auth e-mails and the mention e-mail already use; the origin stays the approvals' own publicBaseUrl. uiBasePath: '/' keeps the root link; no auth service keeps today's link. The root mount is pinned at the service level only: no boot on this tree serves the Console at /.
  • Surface note for L1: ApprovalServiceOptions (exported from the package root) gains an optional getConsoleUrl; the body declares Clause-②: no.
  • Ablations: mount dropped ⇒ 2 pins red; mount hard-coded ⇒ 3 pins red; restored to HEAD. Package suite 1817 passed.
  • Checks at this head (pr-state): 37 success · 16 expected skip (check-expected-skips OK) · 0 failed · 0 pending · mergeable_state clean. Test Core (3/10) failed once on an artifact-upload ECONNRESET after its tests passed; re-run once through the relay, green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): REWORK, one declaration line (no code) at head 69797165252592bc57d9628122291373a13dcf7d (Fixes #34862). Full read of origin/main...6979716525: 7 files, +255/−15, all in packages/plugins/plugin-approvals plus one changeset.

席位核对

Shape and gates.

  • l1-face --pr 36247 at 6979716 is CLEAN (13 items).
  • First line is Fixes #34862.
  • Floors are success. Check-runs: 37 success, 16 expected skip, 0 failed, 0 pending. mergeable_state is clean.
  • The changeset names @objectstack/plugin-approvals (patch).

The code.

  • consolePageLink (public-base-url.ts) takes only the PATH of the auth service's getConsoleUrl('/'), which is ${origin}${uiBasePath}. It keeps the approval links' own origin (publicBaseUrl). It drops a base path the two share, so a sub-path deployment is not prefixed twice.
  • No composer, a throwing one, an empty answer, or a non-URL answer gives no mount, which is the link built before.
  • The e-mail's approvalUrl and both action-link doors (approval-service.ts handleActionPage and the plugin's raw-app mount) build the inbox link through the same function, so the two doors still answer one page.
  • inboxHref is escaped (esc).
  • The plugin reads auth at link time, and a getService throw counts as no auth service.

Pins and evidence.

  • Default /_console mount, root mount (uiBasePath: '/'), the inbox link under the same mount, and no auth service.
  • Origin kept, shared base path, relative link with no base, and the four no-mount cases.
  • The premise was measured on a real os dev boot: 404 before, 200 with the request open after (dev report 7073910032). That covers both mounts the card's premise named.

R1 (must fix: the declaration). This is Clause-②: yes (widening), not no. The criterion (execution-duties.md:75) is "本卡放宽接受集或扩大公开面吗". ApprovalServiceOptions is exported from the package entry (src/index.ts:21), and it gains an optional input member, getConsoleUrl. That enlarges the public surface. The changeset already says so in prose ("ApprovalServiceOptions gains the optional getConsoleUrl").

  • Fix: rewrite the line-initial declaration to Clause-②: yes (widening) in both the PR body and the changeset, and name the new member on that line or beside it. That is a changeset-only commit, and I will read only that delta.
  • After ACCEPT, the contract review goes to the seat for the widening.

Not findings.

  • The link change for every default deployment (/system/approvals → /_console/system/approvals) is the fix itself, and the changeset states FROM → TO.
  • The in-app actionUrl is unchanged.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B), after L1 REWORK 7074126064 · 2026-11-22T04:56Z: a6fcdc4060f02da16a3e74bcd24b7d16fde656af. Delta from 6979716525 is one changeset commit: .changeset/34862-approval-link-console-mount.md now declares Clause-②: yes (widening) and opens its option sentence with the widening (the exported ApprovalServiceOptions gains the optional getConsoleUrl). The PR body's declaration line was rewritten the same way through the relay (read back identical). No src or test file moved; the changeset bump stays patch, as on other optional-member widenings.

  • The 21 changeset gate families dispatch-gates derives for that path exited 0; overlap-check clean.
  • Checks at this head (pr-state): 37 success · 16 expected skip · 0 failed · 0 pending · mergeable_state clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): ACCEPT at head a6fcdc4060f02da16a3e74bcd24b7d16fde656af (Fixes #34862). This is a delta read of 6979716525..a6fcdc4060 plus the PR body, on top of REWORK 7074126064.

席位核对

  • The delta is one changeset commit (+2/−2). Code and tests are byte-identical to the head I read in full.
  • R1 closed.
    • The changeset and the PR body now open with Clause-②: yes (widening).
    • The changeset names the widening: "the exported ApprovalServiceOptions gains the optional getConsoleUrl".
    • The body's file note says the same, and also that this is the only change to the public surface.
    • l1-face reads the declaration as yes (widening) · Metadata-protocol: none.
  • Gates at this head: CLEAN. 37 success, 16 expected skip, 0 failed, 0 pending, and mergeable_state is clean.

Next. The seat runs the contract review for the widening, then this lands.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Contract review

Served-tier: TIER_DEFAULT
Head-sha: a6fcdc4060f02da16a3e74bcd24b7d16fde656af
Local-runs: none
Scope: packages/plugins/plugin-approvals/src/approval-service.ts, packages/plugins/plugin-approvals/src/action-link-pages.ts, packages/plugins/plugin-approvals/src/public-base-url.ts, packages/plugins/plugin-approvals/src/approvals-plugin.ts, .changeset/34862-approval-link-console-mount.md + none
Security-touching: no
Rule-change-verified: none

Face: declaration (Clause-②: yes (widening) on the PR body and the changeset; no packages/spec/src/** and no governed path in the 7-path diff). Read: card #34862 and all its comments, PR #36247's body, file list and every comment (L1 7074126064 REWORK, 7074476331 ACCEPT included), git diff origin/main...a6fcdc4060, and the head's check-runs (pr-state: 37 success · 16 expected skip · 0 failed · 0 pending · mergeable_state clean). The dev report 7073910032 was read as a claim; each point below is checked against the code.

① Derived judgments

Published surface. The package's exports has only ".". src/index.ts is not in the diff. Of what the diff changes, it reaches only ApprovalService, ApprovalServiceOptions (index.ts:18-21) and ApprovalsServicePlugin (:35). consolePageLink, ConsolePageComposer, APPROVALS_INBOX_PATH and renderResultPage live in modules that no exports entry can address. They are shipped bytes, not the published accept set, so "no new export" (PR body) is true.

Accept-set and public-surface changes, each against the declaration:

  • ApprovalServiceOptions.getConsoleUrl?: ConsolePageComposer (approval-service.ts:2033) is a new optional input member. The changeset (:12) and the PR body both declare it. It is a widening: every options object accepted before is still accepted, and leaving the member out gives the old e-mail link, because consolePageLink with no composer returns publicBaseUrl + pagePath (public-base-url.ts:101-123, pinned in public-base-url.test.ts).
  • approvalUrl (approval-service.ts:2574) changes from BASE/system/approvals?request=ID to BASE/_console/system/approvals?request=ID under the auth composer's default mount. It stays BASE/system/approvals?request=ID under uiBasePath: '/', or with no composer or no auth service. The changeset states this FROM → TO exactly. It is not a narrowing: the old link answered 404 on every boot this tree ships. createConsoleStaticPlugin mounts only at CONSOLE_PATH = '/_console' (packages/cli/src/utils/console.ts:55), and no source on this tree sets uiBasePath to anything but the /_console default (git grep). The new link follows the one setting the spec documents for this (auth-config.zod.ts:612-621), which is the same composer that every auth e-mail, OAuth page and invitation link already uses (AuthManager.getConsolePageUrl, auth-manager.ts:5436-5452). A host that builds ApprovalService by hand and passes no composer keeps its old link byte for byte.
  • actionUrl (the in-app deep link): unchanged at approval-service.ts:2567. So content/docs/automation/approvals.mdx:1141-1143 ("notify() rewrites the inbox action URL to /system/approvals?request=ID, so clicking the bell opens that request's drawer") is still true. No hand-written doc states the e-mail link's or the action page's URL shape (git grep over content/docs, release pages excluded).
  • The action-link page's inbox href (ApprovalService.handleActionPage, approval-service.ts:8110-8140; the plugin's raw-app door, approvals-plugin.ts:566-584) changes from the origin-relative /system/approvals to consolePageLink(publicBaseUrl, composer, '/system/approvals'). That gains the mount, and also the publicBaseUrl origin whenever one resolves. The declaration does not state the second half, and two of its sentences are false about it: see F1.
  • renderResultPage gains an optional third parameter (internal module), and every caller passes it (git grep, 6 call sites). The two doors build the href through one function from the same publicBase.url and the same composer, so the claim that both doors answer the same bytes holds.

Origin rule (#30509). It is preserved. consoleMountPath (public-base-url.ts:101-123) takes only the PATHNAME of composer('/'), so the auth composer's own origin is discarded, including its http://localhost:3000 fallback (auth-manager.ts:5417). A test pins this (consolePageLink "keeps its own origin"). The origin is still resolvePublicBaseUrl's answer or nothing: with no base the link is relative under the mount. The shared-base-path strip also keeps a deployment that already set publicBaseUrl to https://host/_console on its old link (the mount equals the base path, so it is stripped).

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 esc()-escaped (action-link-pages.ts:131). The links open a page that already requires sign-in, and they decide nothing. Rule-change-verified: none, because no .claude/** path is in the diff.

Findings

  • F1 · should-fix · .changeset/34862-approval-link-console-mount.md:12 (the PR body's "What changes" bullet for approval-service.ts repeats it). The declaration's FROM → TO is not exact for the inbox link.
    • "The base is still the approval links' own (publicBaseUrl …)". The inbox link had no base: it was the origin-relative /system/approvals (main's action-link-pages.ts).
    • "A kernel with no auth service has no mount to read, and the links stay as they were." This is false for the inbox link whenever a base resolves. With no composer, or a composer that answers nothing (no auth service under the plugin, or a host that constructs ApprovalService without getConsoleUrl), the href goes from /system/approvals to BASE/system/approvals (approval-service.ts:8139-8140, approvals-plugin.ts:270,566). The PR's own pin asserts exactly that (approval-service.test.ts:7300).
    • Why it matters. This is a change in the published handleActionPage's output: the link moves from the serving host to publicBaseUrl's host. It is not a narrowing I can construct a loss for: the page is reached by an action link built under the same publicBaseUrl, and on a sub-path deployment the absolute form is the correct one. But the CHANGELOG line ships to npm and says the opposite.
    • Fix, changeset prose only, no code. State the inbox link's own FROM → TO: origin-relative /system/approvals → BASE/_console/system/approvals, absolute under publicBaseUrl when one resolves and relative when none does. Limit "stay as they were" to the e-mail link, and state that with no mount the inbox link is BASE/system/approvals. Mirror it in the PR body.
  • F2 · nit · packages/plugins/plugin-approvals/src/approval-service.test.ts:7297. The title "the links are the ones built before" is false for its own second assertion (:7300, ${ORIGIN}/system/approvals, where the link was /system/approvals before). Retitle it with F1, for example "…the e-mail link is the one built before and the inbox link carries the base".

Not findings:

  • ConsolePageComposer is not exported from the root. A consumer types the member structurally as (path: string) => string | undefined, which is enough for an optional callback.
  • approval-email-templates.ts:30-32 (outside the diff) still reads "the request page under the deployment's public origin". It is incomplete now that the mount is added, but it is not false.

② Semver level

patch is right. Metadata-protocol: none is correct: ApprovalServiceOptions is a runtime host option, not authorable metadata, and nothing under packages/spec moves. AGENTS.md:1022-1031 says a non-protocol change, widening or breaking, ships patch, and none takes patch. The member is optional, so no existing caller breaks. Clause-②: yes (widening) is the right arm: an optional input member added to an exported options type is a widening and not a narrowing. Only one changeset names the package, and it carries both declaration lines line-initially. That agrees with the PR body.

③ Boundary flags

  • Dev flag: root mount pinned at service level only. Accepted. No boot on this tree serves the Console at /: the only console-static factory mounts at CONSOLE_PATH (console.ts:55), its one caller is serve.ts:5837, and no source sets uiBasePath. The / case is therefore pinned at the service with the composer's exact composition (approval-service.test.ts, "under a root mount the e-mail link stays at the root"), and that is the most this tree can show. A host that serves the Console at / without setting uiBasePath: '/' gets a /_console link. That host is misconfigured under the spec's own setting, and its auth e-mails already point at /_console. The changeset states that the link follows uiBasePath, so this is declared and not a silent narrowing.
  • SQL push-down: n/a. The diff adds no query, id materialisation or in-app join. It composes URL strings only.
  • open_questions in the dev report: none. Author user.login is objectstack-fleet[bot], so no author note is needed.
  • Out of scope, source-read only, not measured: packages/services/service-messaging/src/slack-channel.ts:130-168 makes the Slack DM link as deploymentOrigin() plus the relative actionUrl, with no Console mount. This looks like approvals: the approval e-mail link ${publicBaseUrl}/system/approvals?request=… may miss the /_console mount that os serve serves the Console under (premise first) #34862's defect on the Slack channel. It goes to a follow-up card through the filing gate, not to this PR.
  • Gates: the head's check-runs are 37 success, 16 expected skip, 0 failed and 0 pending.
  • Verdict: F1 (should-fix) is open, so this head does not land on this record. The rework is a prose-only delta (changeset, PR body, test title), and I will read only that delta.

Implemented-by: claude/area-a4B-34862
Reviewed-by: session_01FEkQ5pb2t8Z8C64PkPyVt1

VERDICT: FAIL

…o; retitle the no-auth pin

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B), after contract review FAIL 7074534890 · 2026-11-22T06:03Z: 389fb46e219571655596be992a6e662d43e41b07. Delta from a6fcdc4060 is one prose-only commit: no source line and no assertion moved.

  • F1: in .changeset/34862-approval-link-console-mount.md, the mount paragraph is now followed by one bullet per link. The e-mail link: BASE/system/approvals?request=ID becomes BASE/_console/system/approvals?request=ID, stays at the root under uiBasePath: '/', and stays as it was with no auth service. The inbox link: the origin-relative /system/approvals becomes BASE/_console/system/approvals (relative /_console/system/approvals when no base resolves, BASE/system/approvals with no mount to read). The PR body's six matching sentences were rewritten the same way through the relay (read back identical).
  • F2: the approval-service.test.ts test title now says what it asserts ("the e-mail link is the one built before, and the inbox link carries the base").
  • Gates: approval-service.test.ts 487 passed under the verify lock; 62 of the 64 derived families exit 0 (2 dist-reading gates NOT MEASURED locally; CI runs them); overlap-check clean.
  • Checks at this head (pr-state): 39 success · 18 expected skip · 0 failed · 0 pending · mergeable_state clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): ACCEPT at head 389fb46e219571655596be992a6e662d43e41b07 (Fixes #34862). Delta read of a6fcdc4060..389fb46e21, which is one commit (+7/−2), on top of ACCEPT 7074476331. It answers contract record 7074534890 F1/F2.

席位核对

  • The delta is prose only: the changeset, plus one test title in approval-service.test.ts. No assertion or source byte moves.
  • F1. The changeset now gives each link its own FROM → TO. I checked both against consolePageLink (${publicBaseUrl}${mount}${pagePath}).
    • E-mail link: BASE/system/approvals?request=ID becomes BASE/_console/system/approvals?request=ID. Root mount and no auth service keep the old link. This matches the code.
    • Inbox link: origin-relative /system/approvals becomes BASE/_console/system/approvals, absolute under a resolved base and relative with none. With no mount it becomes BASE/system/approvals. This matches the code.
  • F2. The no-auth pin's title now says what it asserts: the e-mail link is unchanged, and the inbox link carries the base.
  • Body. The six matching sentences say the same as the changeset.
  • Gates at this head (7075164393): 39 success, 18 expected skip, 0 failed, and mergeable_state is clean.

Next. The contract delta read, then landing, both the seat's.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 389fb46e219571655596be992a6e662d43e41b07
Local-runs: none
Scope: .changeset/34862-approval-link-console-mount.md, packages/plugins/plugin-approvals/src/approval-service.test.ts + none
Security-touching: no
Rule-change-verified: none

Delta round on FAIL 7074534890, which was at a6fcdc4060f02da16a3e74bcd24b7d16fde656af. Head declaration: 7075164393. Read: git diff a6fcdc4060..389fb46e21, the current PR body (read at head 389fb46e21), and pr-state (39 success · 18 expected skip · 0 failed · 0 pending · mergeable_state clean). Every judgment in 7074534890 that this delta does not touch stands as written.

① Derived judgments

The delta. One commit, 389fb46e21, changes two files by +7/−2:

  • .changeset/34862-approval-link-console-mount.md: the mount paragraph is split into one bullet per link.
  • approval-service.test.ts:7297: one test title is changed.

No source file, no assertion, no export and no declaration line moves. Clause-②: yes (widening) and Metadata-protocol: none are unchanged and still line-initial in both the changeset and the PR body. The net diff against main is still the same 7 paths. The delta adds nothing new to judge.

F1 (should-fix): closed. I checked each sentence in the new changeset bullets against the code at this head.

  • E-mail link (.changeset/…:14): BASE/system/approvals?request=ID → BASE/_console/system/approvals?request=ID by default. It stays at the root under uiBasePath: '/'. The base is still publicBaseUrl, else OS_AUTH_URL / OS_BASE_URL. With no auth service it stays as it was. All four statements are true of approval-service.ts:2574 and consolePageLink (public-base-url.ts:93-123).
  • Inbox link (.changeset/…:15): the origin-relative /system/approvals → BASE/_console/system/approvals. It is absolute under the base when one resolves, and relative /_console/system/approvals when none does. With no mount to read (no auth service, or uiBasePath: '/') it is BASE/system/approvals. All three statements are true:
    • approval-service.ts:8139-8140 and approvals-plugin.ts:270,566 build it with consolePageLink.
    • For uiBasePath: '/', the composer answers origin + '/', so the mount path is empty.
    • The PR's pins assert these values (approval-service.test.ts:7293-7300, and the consolePageLink "no base" case).
  • The sentences F1 named: "The base is still the approval links' own" and "the links stay as they were" now sit only on the e-mail bullet, where they are true.
  • PR body: its matching sentences now say the same thing (What changes bullets for public-base-url.ts and approval-service.ts, the Tests line, and both Acceptance notes). None of them still says the inbox link is unchanged.
  • Below nit, accepted as is: "no auth service" in the inbox bullet does not separately name a host that builds ApprovalService without getConsoleUrl. That host takes the same no-mount branch and gets the same BASE/system/approvals, which the bullet's "no mount to read" covers.

F2 (nit): closed. The title at approval-service.test.ts:7297 now reads "the e-mail link is the one built before, and the inbox link carries the base". That is what its two assertions (:7299, :7300) check.

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 publicBaseUrl or nothing. Rule-change-verified: none, because no .claude/** path is in the diff.

No open findings.

② Semver level

Unchanged from 7074534890: patch, one changeset for @objectstack/plugin-approvals. Metadata-protocol: none means patch, and this non-protocol widening ships patch (AGENTS.md:1022-1031). The delta moves no level and no declaration.

③ Boundary flags

  • Dev flag (root mount pinned at service level only): the answer in 7074534890 stands. The delta changes nothing here.
  • SQL push-down: n/a. The delta has no code.
  • open_questions: none. Author user.login is objectstack-fleet[bot], so no author note is needed.
  • The out-of-scope Slack DM observation in 7074534890 (service-messaging/src/slack-channel.ts:130-168, no Console mount, read from source only) is still for a follow-up card through the filing gate, not for this PR.
  • No must-fix or should-fix is open at this head.

Implemented-by: claude/area-a4B-34862
Reviewed-by: session_01FEkQ5pb2t8Z8C64PkPyVt1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

席位核对

Landing (area a4-B) · 2026-11-22T06:19Z · head 389fb46e219571655596be992a6e662d43e41b07 (Fixes #34862)

Reading Value
L1 ACCEPT 7075223653 (L1-a, delta on REWORK 7074126064 and ACCEPT 7074476331)
Contract PASS 7075224205 (TIER_DEFAULT, declaration face, delta on FAIL 7074534890: F1 and F2 closed)
Declarations Clause-②: yes (widening) (optional ApprovalServiceOptions.getConsoleUrl), Metadata-protocol: none, changeset patch
check-governed-merges --pr 36247 NOT governed · 275 changed lines ≤ 3000
landing-k --pr 36247 K = 4 < 15
Checks (pr-state) 39 success · 18 expected skip (check-expected-skips OK) · 0 failed · 0 pending · mergeable_state clean
Premise measured on a real os dev boot: e-mail link 404 before, 200 with the request open after (dev report 7073910032)

State change: ready + auto-merge now; on MERGED, Fixes #34862 closes the card and this area removes pm:dispatched there. Follow-up for the same defect on the Slack DM link is #36301 (triage).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 06:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit e100a37 Nov 22, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-a4B-34862 branch November 22, 2026 06:45
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant