Skip to content

refactor(studio): every Studio address comes from one builder; no address changes - #36973

Merged
objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/issue-36895-studio-path-helper
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/issue-36895-studio-path-helper

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #36895

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户无感:Studio 里所有链接、跳转、AI 给出的审阅链接,地址一个字节都没变。
  • 属于「Studio 重构」专题:先把所有生成 Studio 地址的地方收到一个函数,之后每张设计器卡只改一处就能切到新地址,不会出现两条跳转规则互相跳的死循环。
  • 出错的表现是某个 Studio 链接打开到错的页面或打不开;本改动只换写法不换地址,可以直接撤回。
  • 无。

What changes

One builder for every Studio address, and every producer the card lists now calls it. Every address is byte-for-byte what it was before. Nothing redirects and no route changes.

  • Console builder (new file): ui/packages/app-shell/src/views/studio-design/studioAddress.ts. It holds studioPath, the one path builder, and on top of it studioLandingPath, studioPackagePath, studioPillarPath, studioHomePath, studioItemPath, studioPillarItemAddress, studioSurfaceQuery, the "All metadata" builders, studioChangesReviewPath and studioItemReviewPath.
    • The vocabulary also lives here: root, home pillar, ~org, ~all, metadata, interfaces, and the changes and review params. The modules that exported these before re-export them under the same names.
    • STUDIO_ITEM_PILLAR is the per-type switch. AREA_PILLAR_FOR_TYPE, which the area's pillar redirect reads, is now this same object. When a designer card deletes a type's row, every studioItemPath caller and the area redirect move together, so the two cannot loop.
  • Mapping table (new file): studioAddressTable.ts. It has three tables:
    • STUDIO_ADDRESS_FAMILIES: 13 address shapes.
    • STUDIO_ITEM_TYPES: object (with its view, action and nav qualifiers), flow, permission, and owd:overview. Each row gives today's pillar and the metadata address the type moves to.
    • STUDIO_QUERY_PARAMS: surface, view, action, nav, changes=review, review=1, package, scope=environment and new. Each row says whether the param is carried verbatim, rides as a qualifier, or is replaced.
    • Card item 3: the retired /interfaces redirect (retiredInterfacesTarget, landed by fix(studio): retire Studio's Interfaces column (objectstack#36502) #36884) now reads which params it keeps from this table (STUDIO_RETIRED_INTERFACES_KEPT_PARAMS). Its output is unchanged.
  • Three ?surface= spellings, all kept. Producers did not agree on how to write the value, and each spelling is kept as a named option (StudioSurfaceSpelling):
    • 'component' (surface=object%3Aaccount) is used by most producers.
    • 'name' (surface=object:account) is used by appStudioObjectPath.
    • 'form' (URLSearchParams, surface=object%3Aa&action=x) is used by switchedOffActionPath.
    • StudioDesignSurface writes the scope segment unencoded, and that is kept too, as segmentEncoding: 'verbatim'.
  • Server shared function, located in @objectstack/types: packages/types/src/studio-review-links.ts exports studioChangesReviewLink and studioItemReviewLink. Both server producers already depend on @objectstack/types, and neither may depend on the Console. packages/cli/src/commands/meta/register.ts and packages/runtime/src/domains/mcp-authoring.ts (reviewRoutes) now call them. The review-link text served to the AI is unchanged (pinned below).
    • I did not choose @objectstack/spec: that would add a contract-package export, and spec holds no runtime logic.
    • The module is named -links, not -routes, because check:route-envelope reads any *-routes.ts as a REST module.
  • Producers repointed (re-measured on 3f568c1 and later):
    • Card items 1–9: appRoute.ts ×3, metadataArea.ts, setupMetadataRedirect.ts ×3, CommandPalette.tsx, studioScope.ts, artifactStudioPath.ts, AiChatPage.tsx, AppNoAccessEmptyState.tsx, RecordTabsConfig.tsx, DashboardInPageEditor.tsx, BuilderLanding.tsx, studioChangesLink.ts and switchedOffActionTargets.ts.
    • Card item 10, StudioDesignSurface.tsx: only its four hand-built call sites are swapped (pair-base redirect, Access pillar open, requestSurface, pillar nav links). The edit merges cleanly with Studio 重构(P0):StudioDesignSurface.tsx 纯搬移拆文件——数据、自动化、访问三个分区各成一个模块,保留再导出 #36893's split branch (git merge-tree, exit 0).
    • Card item 11: StudioRoute.tsx and AppContent.tsx. Route patterns use STUDIO_ROOT_PATH, and the :packageId landing redirect uses STUDIO_HOME_PILLAR, the same relative data.
    • Card item 12: the two server producers.
    • Card item 13: InterfacesNavRail.tsx is gone, as stated.
    • A producer that landed on main meanwhile (feat(console): Setup gets one Packages entry, the package list's administration face; Installed Apps retires #36933) is repointed too: PackagesPage.tsx's local studioPackagePath now returns studioHomePath.
    • Producers the card missed, now repointed:
      • studioInterfacesRetired.ts
      • metadataArea.ts: studioMetadataAreaPath, studioMetadataItemPath, areaLocationRedirect
      • setupMetadataStudioPath itself
      • switchedOffActionTargets.ts: the action item path and switchedOffActionListPath
      • studioNewPackage.ts (STUDIO_NEW_PACKAGE_PATH) and PackageSwitcher.tsx (STUDIO_LANDING_PATH)
      • HomePage.tsx and useAddAppEntries.ts (bare /studio)
    • Line numbers moved from the card's (AiChatPage and DashboardInPageEditor). Three of the card's sites already called a helper (CommandPalette's ~org flow, BuilderLanding's ~org card, and RecordTabsConfig, which now calls studioItemPath).
  • New exports from @object-ui/app-shell: STUDIO_ROOT_PATH, STUDIO_HOME_PILLAR, studioLandingPath and studioPackagePath.

Why

The Studio redesign moves objects, flows and permission sets from pillar addresses to metadata addresses (/studio/PKG/metadata/TYPE/NAME). The area already redirects a pillar type back to its pillar. Redirecting the pillar address first would loop, so every producer has to share one builder before any designer card flips its type.

Tests

  • studioAddress.test.ts (new) pins each builder to literal addresses: every family, all three spellings, verbatim segments, search and hash, the area, the review links, and the repointed module builders. It also checks that the table agrees with the code (AREA_PILLAR_FOR_TYPE is STUDIO_ITEM_PILLAR, item rows, param keys, family builders, and the params kept on the /interfaces redirect).
  • studioAddress.guard.test.ts (new) is the guard. It parses every non-test source under ui/packages/PKG/src and ui/apps/APP/src and refuses two things:
    • a string or template literal starting with /studio;
    • a path composed onto STUDIO_ROOT_PATH.
    • Only studioAddress.ts (and the table's placeholder shapes) are allowed.
    • It has positive controls: the walk must reach StudioDesignSurface and the console's StudioRoute, and the matcher must fire on the builder file.
  • packages/types/src/studio-review-links.test.ts (new) pins the server's two links to literals.
  • packages/types/src/studio-review-links.callers.test.ts (new, repo project) has two parts:
    • It refuses a /studio literal in any packages/** .ts source outside the shared module, with controls: both server producers are walked, and the matcher fires twice on the allowed file.
    • It holds every review link quoted in skills/objectstack-mcp-build/evals/draft-door-procedure.json equal to studioChangesReviewLink / studioItemReviewLink for the package, type and name that link names. The file has 7 quoted links: 5 Changes links and 2 item reviews, 3 distinct values. The skill file is not edited.
    • Its radius is declared: vitest.repo-tests.json, CROSS_PACKAGE_TEST_INPUTS, and the @objectstack/types#test:repo turbo inputs. Ci.yml's crosspkg: filter already covers the skills root.
  • Existing pins of every repointed producer stay green unchanged. That is the byte-identity proof: none of their expected literals was touched.
Local runs (head fa0deb8, after merging origin/main 4f9a3f8)
  • pnpm --dir ui exec vitest run on the 171 test files that name a repointed producer, the package list, or the builder: Test Files 171 passed (171), Tests 1777 passed (1777). The full app-shell + console suite (2736 files) is CI's Test UI; it was started locally and stopped, since at two workers it did not finish in an hour.
  • @objectstack/types:
    • local, studio-review-links.test.ts: 2 passed;
    • repo, studio-review-links.callers.test.ts: 3 passed.
  • @objectstack/runtime src/domains/mcp-authoring.test.ts: 50 passed.
  • @objectstack/cli --project integration src/commands/meta/register-draft.test.ts: 10 passed. Run locally because it is the one test that pins the CLI's printed review link.
  • pnpm --filter @objectstack/types typecheck and pnpm --filter @object-ui/app-shell type-check: exit 0 on fa0deb8. @objectstack/runtime and @objectstack/cli typecheck: exit 0 on 947b96e, the pre-merge head. @object-ui/console type-check was NOT MEASURED: it needs every ui plugin's dist built, so it is left to CI's Type Check UI.
  • pnpm --dir ui exec vitest run scripts/: 172 passed, 2 skipped. pnpm --dir ui check:new-line-citations: 0 new.

Acceptance notes

Verification

  • Read first, ranked by risk:
    1. the StudioDesignSurface.tsx hunks (four call sites, verbatim segment);
    2. metadataArea.ts (the area's redirect now reads STUDIO_ITEM_PILLAR);
    3. studioAddress.ts studioSurfaceQuery (the three spellings).
  • Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/studioAddress.test.ts packages/app-shell/src/views/studio-design/studioAddress.guard.test.ts. Expect 2 files and all tests passing. Then add any literal beginning with /studio to a ui source and watch the guard name the file and line.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (spec untouched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (CI)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU

…ope audit does not read it as a REST module (#36895)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…, calls the builder (#36895)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…udio-path-helper

StudioDesignSurface.tsx import block: main (#36956) dropped the draftVerdict
import and this branch dropped the nav-selection import; both deletions kept.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
@github-actions github-actions Bot added size/xl 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 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/runtime, @objectstack/types, touching 5 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/types/src/index.ts, packages/types/vitest.repo-tests.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/deployment/cli.mdx (via os meta register (command, read off packages/cli/src/commands/meta/register.ts))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/types/src/index.ts, packages/types/vitest.repo-tests.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 62 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 4c4a677721d33e3d48637647466042aa3b15b5b0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 0337f4eecbc66d3ff8c1fbb67b55969227b8c98a — the merge of head b6e22ef09384a52025c3fc5ba525102121bcef68 into base 4c4a677721d33e3d48637647466042aa3b15b5b0, 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 0337f4eecbc66d3ff8c1fbb67b55969227b8c98a && git checkout 0337f4eecbc66d3ff8c1fbb67b55969227b8c98a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4c4a677721d33e3d48637647466042aa3b15b5b0 b6e22ef09384a52025c3fc5ba525102121bcef68 && git checkout -B drift-repro 4c4a677721d33e3d48637647466042aa3b15b5b0 && git merge --no-ff b6e22ef09384a52025c3fc5ba525102121bcef68

node scripts/docs-audit/affected-docs.mjs --json 4c4a677721d33e3d48637647466042aa3b15b5b0

⚠️ 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 4c4a677721d33e3d48637647466042aa3b15b5b0 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… guard spares Route path patterns (#36895)

A route pattern declares what the console serves and builds no link. The
console route table is read as source text by the onSuccess navigate-host
pin, whose control reads every top-level path="/..." literal; spelling the
pattern through STUDIO_ROOT_PATH took 'studio' out of that table.

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

objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — REWORK · repo:objectstack#3 · head 2a9f6e9 · 2026-11-24T13:55Z

L1: REWORK
Head-sha: 2a9f6e98648235287f6517a979fd4309d517e60a
Reviewer: L1-b (3) (seat 3, epic #36890 PRs; area ux-A).
Tier: not Tier H. This is card #36895's only PR: 37 files, +1347/−143 (1,490 lines, under the 3,000-line per-card line). check-governed-merges --pr 36973: 0 of 37 paths governed.

Read

Checklist

  • Shape. Draft, base main, first line Fixes #36895. The single PR delivers items 1–3, so Fixes is right.
  • Scope. Card items 1–12 are repointed. Item 13 left with fix(studio): retire Studio's Interfaces column (objectstack#36502) #36884. The extra producers the report names (studioInterfacesRetired, the metadataArea builders, studioNewPackage, PackageSwitcher, HomePage, useAddAppEntries, PackagesPage) are the same defect class and inside the claim's "every producer" surface. StudioDesignSurface.tsx has call-site swaps only, made after the GO. skills/** is untouched, as the claim requires. The CI wiring in turbo.json and scripts/cross-package-test-inputs.mjs exists so the types callers test's input set includes the eval file it reads.
  • Byte identity. I checked each swap against the builder in studioAddress.ts:
    • studioPath writes /studio, then the segment (encodeURIComponent unless verbatim), the section, the rest, the query, the search and the hash. That is the old concatenation order.
    • The three ?surface= spellings each match their old producer:
      • component = encodeURIComponent(formatSurfaceParam(..)): CommandPalette, artifactStudioPath, RecordTabsConfig, the pillar links.
      • name = type: plus the encoded name: the appStudioObjectPath bridge.
      • form = URLSearchParams: switchedOffActionPath.
    • verbatim is kept where the old code wrote scopeSegment or ~org raw.
    • artifactStudioPath: studioItemPath sends object and flow to their pillars and dashboard, page, view and app to the area page, as before. permission is not in its switch, so the Access mapping cannot leak in.
    • setupMetadataRedirect keeps the area's item page for every type on purpose (studioMetadataItemAddress, not studioItemPath, which would send a pillar type to its pillar), with a comment.
    • The literal pins in studioAddress.test.ts and studio-review-links.test.ts hold the old outputs.
  • Item 2, the mapping table. studioAddressTable.ts lists 13 families, the surface types (object, flow, permission, owd:overview), the three spellings, and the kept params (changes, review, package, scope, nav, view, action). Each entry has its future metadata address. Met.
  • Item 3, one table for the /interfaces redirect. KEPT_PARAMS reads STUDIO_RETIRED_INTERFACES_KEPT_PARAMS, which is still exactly changes. Met.
  • Acceptance: the repo has no hand-built Studio address, and a guard pins it.
    • Under ui/, an AST guard refuses /studio-prefixed literals and composition onto the root constant. A <Route path> string initializer is spared, with controls.
    • Under packages/, studio-review-links.callers.test.ts scans packages/**/*.ts and holds all 7 eval literals equal to studioChangesReviewLink / studioItemReviewLink.
    • The skills literals stay literal by claim and are pinned to the builder. Met.
  • Server. os meta register and the MCP reviewRoutes print the same text through the two new @objectstack/types functions. @objectstack/types has no ui dependency.
  • Changeset. @objectstack/types, @objectstack/runtime, @objectstack/cli, @object-ui/app-shell and @object-ui/console patch, Metadata-protocol: none. I read it sentence by sentence and it matches the diff, apart from the declaration line (S1).

Answers to ux-A's three questions

  1. Yes, the new exports need the arm (S1 below).
  2. The overlap with Studio 重构(1-3):去掉顶部分区,换成可折叠的左侧分组菜单(数据、界面、自动化、平台、访问、AI),右侧是列表和全屏详情 #36899 is handled correctly as written. Whichever of the two lands second resolves the conflicts as stated: take Studio 重构(1-3):去掉顶部分区,换成可折叠的左侧分组菜单(数据、界面、自动化、平台、访问、AI),右侧是列表和全屏详情 #36899's nav deletion in StudioDesignSurface.tsx and keep both imports in metadataArea.ts. It must also repoint studioMetadataArea-composed paths and the /studio/ prefix literal in studioMenuModel.ts onto studioAddress.ts, or this guard goes red on main. I will check this when feat(studio): a collapsible left menu of six groups replaces the top pillar nav #36985 comes to me.
  3. Gates. The 4 families not measured locally (check:dual-build-cjs-loads, check:i18n, check:i18n-coverage, check:i18n-walk-parity) exited 3 on a missing prerequisite, and the report declares them. CI's check-runs are the evidence for them. Test Core (9/10) was still pending at this read, so the delta read takes the full set green on the new head.

Findings

No must-fix.

  • S1 (should-fix): the declaration should be Clause-②: yes (widening), not no. @objectstack/types is published (no private), and its entry gains two exports through export * from './studio-review-links.js': studioChangesReviewLink and studioItemReviewLink. That adds to a published package's public surface. The fleet's precedent for a new public member of a published package is yes (widening) (.changeset/36011-restore-factory-view.md, and fix(plugin-approvals): the no-approver decide refusal and a multi-slot submitter notice read in the reader's language #36846 on this seat). The new @object-ui/app-shell exports do not count, because that package is private: true. Fix: change the line in the PR body and in .changeset/36895-studio-address-builder.md to Clause-②: yes (widening), and keep Metadata-protocol: none and patch. The yes then owes a TIER_DEFAULT contract review, which I will run on the new head. That change is in prose only.
  • N1 (nit). studioPath drops an empty segment (studioHomePath('') gives /studio). The old concatenation gave /studio//data. Every caller I read guards a missing package first, so no address changes in practice. If the builder ever meets an empty segment, a doc line or an assertion would make this explicit.
  • N2 (nit). The guard reads literals only. A path composed onto a builder's output (`${studioPackagePath(p)}/x`) passes it. None exists today, but the designer cards' reviews should watch for one.
  • N3 (nit). The claim named "the five literals" in the eval file, and the file has 7 (5 changes, 2 item review). The guard covers all 7, and the report says so.

Delta read owed: L1 on the new head plus a TIER_DEFAULT L2 (S1). A push that changes only the PR body and the changeset keeps everything else in this read.

…segment is dropped (#36895)

@objectstack/types is published and its entry gains studioChangesReviewLink
and studioItemReviewLink, a widening of its public surface. Metadata-protocol
stays none, so the bumps stay patch. Doc only in studioAddress.ts.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 2fec7fb · 2026-11-24T14:02Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 2fec7fb8d95df575a9c39560b89a78efd457abd7
Local-runs: none

This is the declaration face. The review is owed by the Clause-②: yes (widening) line alone. record-recognisers --template --paths over the PR's 37 committed paths finds no published schema, no governed path and no narrowing. Claim 7133760397.

Inputs read:

  • Card Studio 重构(1-4a):所有产生 Studio 地址的地方改成调用同一个函数(行为不变,为逐类型切换新地址做准备) #36895, claim 7127323340 and amendment 7133793684. readClause2Line on the amendment gives declared · yes · widening.
  • Dev report 7132003021 and the round-2 and round-3 deltas 7132795527 and 7133713245.
  • The PR body (lines 5–6: Clause-②: yes (widening), Metadata-protocol: none).
  • The net diff origin/main...2fec7fb8. git diff 2a9f6e98 2fec7fb8 touches only the changeset (the declaration line) and one doc paragraph in studioAddress.ts, so every code file is byte-identical to the head L1 read in 7133576403.
  • Check-runs on 2fec7fb8, read at this record: 15 success, 12 expected skip, 41 in progress, 0 failed. Round 2's head 2a9f6e98 had the same code and was all green. Full green on this head is a landing check, not part of this verdict.

Nothing was built, run or re-run.

① Derived judgments

  • J1, @objectstack/types public surface. The package is published: no private, files: [dist, …], and an exports["."] entry from dist/index. Its src/index.ts adds export * from './studio-review-links.js', so two new functions are reachable from the entry type graph:

    • studioChangesReviewLink(packageId), which returns /studio/<enc pkg>/data?changes=review;
    • studioItemReviewLink(packageId, type, name), which returns /studio/<enc pkg>/metadata/<enc type>/<enc name>?review=1.

    Both are additive. Nothing is removed or renamed, and no existing signature changes. This is a widening of the public surface, declared that way.

  • J2, the server outputs are unchanged. os meta register's draft line (draftSaveLines) and the MCP authoring tools' reviewRoutes (changes, item) now call J1's functions. Their bodies are the old template literals verbatim: encodeURIComponent on each segment, in the same order and with the same query. The existing pins that quote the old literals are not in the diff and are green on the round-2 head: packages/runtime/src/domains/mcp-authoring.test.ts and packages/cli/src/commands/meta/register-draft.test.ts. The text an AI is handed, and that a CLI user reads, is byte-identical. No wire, tool schema or error code moves.

  • J3, the skill's evals. The 7 links quoted in skills/objectstack-mcp-build/evals/draft-door-procedure.json (5 Changes, 2 item review) are read, not edited. studio-review-links.callers.test.ts holds each one equal to J1's output, so a later address move cannot leave the skill teaching a stale link silently. skills/** is not in the diff, so the rules face is not touched.

  • J4, the ui side. @object-ui/app-shell gains exports (STUDIO_ROOT_PATH, STUDIO_HOME_PILLAR, studioLandingPath, studioPackagePath). That package is private: true, so these are not a published surface and add nothing to J1. @object-ui/console is an app. The ui swaps are byte-identical, as L1 read them.

  • J5, Metadata-protocol: none. Nothing an author writes moves: no spec key, value or metadata type.

② Semver level

  • The Clause-②: yes (widening) line now reads the same on all three carriers: the changeset body, PR body line 5, and claim amendment 7133793684. That matches J1 and the precedent for a new public member of a published package (.changeset/36011-restore-factory-view.md; fix(plugin-approvals): the no-approver decide refusal and a multi-slot submitter notice read in the reader's language #36846).
  • patch on @objectstack/types, @objectstack/runtime and @objectstack/cli is right: a non-protocol widening with Metadata-protocol: none ships patch (AGENTS.md, Post-Task Checklist step 3). Not breaking, so no ADR-0087 disposition is owed. runtime and cli changed source with no user-visible effect, and naming them in the changeset is correct.
  • F1 (nit). The changeset's "Server" bullet says the two functions are "new in @objectstack/types". It does not say these are its first Studio-address exports, and that the Console builds the same two addresses in its own builder (studioChangesReviewPath / studioItemReviewPath). The source doc comment says so. This is prose only, with no contract effect.

③ Boundary flags

F1 has no effect on correctness or the contract, so this is the final round.

Implemented-by: claude/issue-36895-studio-path-helper
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head 2fec7fb · 2026-11-24T14:37Z

L1: ACCEPT
Head-sha: 2fec7fb8d95df575a9c39560b89a78efd457abd7
Reviewer: L1-b (3). This is the delta read on REWORK 7133576403 at 2a9f6e98.
Contract review: TIER_DEFAULT PASS 7133872199 on this head (claim 7133760397). It is final, with nits only.
Tier: not Tier H. 1,494 lines, the card's only PR. Not governed (0 of 37 paths).

Delta read

  • git diff 2a9f6e98 2fec7fb8 touches two files, +5/−1:

    • the changeset's declaration line, Clause-②: no changed to Clause-②: yes (widening);
    • one doc paragraph on studioPath dropping an empty segment (N1).

    No code moved, so round 1's checklist stands as read.

  • Check-runs on 2fec7fb8: 60 success, 12 expected skip, 0 failed, 0 pending; mergeable clean.

Findings

  • S1: closed. Clause-②: yes (widening) now reads the same on all three carriers:

    • the changeset;
    • PR body line 5;
    • claim amendment 7133793684, line-initial (readClause2Line gives declared · yes · widening).

    Metadata-protocol: none and patch are unchanged.

  • N1: closed. It is now documented on studioPath.

  • N2 and N3 stand as nits. Neither needs a change.

  • The L2 nit F1 (the changeset's server bullet could name the Console's twin builders) is prose only.

No must-fix and no should-fix remain open. ux-A lands it on full green. Landing order with #36985 (#36899): whichever PR lands second repoints studioMenuModel.ts onto studioAddress.ts.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

Landing · 2026-11-24T14:38Z · ACCEPT 7134683237 at head 2fec7fb · TIER_DEFAULT L2 PASS 7133872199 (same head)

reading value
check-governed-merges.mjs --pr 36973 NOT governed · +1351/−143 (1494 ≤ 3000); card #36895 total = this one PR (per-card rule of 2026-11-24 08:28Z)
landing-k.mjs --pr 36973 OK · K = 3 < 15 · no new locale pack under a label PR · no shared book moved under this PR's
checks at 2fec7fb 60 success, 12 expected skip, 0 failed or pending; mergeable clean

Open findings: nits only (L1 N2: the guard reads literals only, so a path composed onto a builder's output passes it, and designer-card reviews watch for one; N3: the eval file holds 7 links, not the claim's five, and all 7 are pinned; L2 F1: the changeset's server bullet could name the Console's twin builders). Landing order with #36985 (#36899): whichever lands second reconciles StudioDesignSurface.tsx (take #36899's nav deletion) and metadataArea.ts (keep both imports), and repoints studioMenuModel.ts's /studio/ literal and its studioMetadataAreaPath compositions onto studioAddress.ts. State: ready + auto-merge (Tier S). On MERGED, #36895 closes by Fixes; area ux-A removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 14:39
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 24, 2026
…udio-path-helper

HomePage.tsx: main (#36989) added the catalogServesBuild import beside this
branch's studioLandingPath import; both kept. useAddAppEntries.ts: main's
buildServed condition kept, its '/studio' target written as studioLandingPath()
(byte-identical).

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head b6e22ef · 2026-11-24T15:12Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b6e22ef09384a52025c3fc5ba525102121bcef68
Local-runs: none

This is a delta round on record 7133872199 (head 2fec7fb8, PASS), and it is still the declaration face. Claim 7135653014.

Inputs read:

Nothing was built, run or re-run.

① Derived judgments

  • J1–J5 of 7133872199 stand. The published surface is unchanged: @objectstack/types still adds exactly studioChangesReviewLink and studioItemReviewLink. The server's review-link text and the private app-shell exports are also unchanged.
  • The merge resolutions touch only private @object-ui/app-shell call sites, and they keep the same addresses.

② Semver level

  • Clause-②: yes (widening) and Metadata-protocol: none are unchanged on the changeset, the PR body and claim amendment 7133793684. patch stands.

③ Boundary flags

No finding. Landing waits for full green on this head; that is a landing check, not part of this verdict.

Implemented-by: claude/issue-36895-studio-path-helper
Reviewed-by: session_01WGufzhjqviExWpzQMm57Mt

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt

席位核对 — ACCEPT · repo:objectstack#3 · head b6e22ef · 2026-11-24T15:14Z

L1: ACCEPT
Head-sha: b6e22ef09384a52025c3fc5ba525102121bcef68
Reviewer: L1-b (3). This is the merge-round read on ACCEPT 7134683237 at 2fec7fb8.
Contract review: TIER_DEFAULT PASS 7135676769 on this head (claim 7135653014).

Merge-round read

  • b6e22ef0 merges main 4c4a6777 into 2fec7fb8, with no rebase and no force-push.
  • git diff 4c4a6777 b6e22ef0 has the same changed lines as the ACCEPTed net diff: 37 files, +1351/−143, identical as multisets. The merge carries no change of the PR's own.
  • The two conflict resolutions against fix(console): show the AI-build entries only where the catalog serves build; old build threads still open #36989 are right:
    • HomePage.tsx keeps both imports.
    • useAddAppEntries.ts keeps main's buildServed condition and writes its target as studioLandingPath(), which gives the same bytes as '/studio'.
  • The merged tree has no new hand-built /studio literal outside the builder: comments and the spared <Route path> only.

Every round-1 and round-3 finding stays as recorded. Landing still requires full green on b6e22ef0 (28 success, 27 in progress, 0 failed at this read).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

Re-landing · 2026-11-24T15:38Z · merge-round ACCEPT 7135695234 at head b6e22ef · TIER_DEFAULT L2 PASS 7135676769 (same head)

The queue dropped the previous landing (7134722281) with MERGE_CONFLICT against #36989. The round-4 merge of main 4c4a677 resolved it (delta 7135603814), and the net diff is unchanged (37 files, +1351/−143).

reading value
check-governed-merges.mjs --pr 36973 NOT governed · 0 of 37 paths · 1494 ≤ 3000; card #36895 total = this one PR
landing-k.mjs --pr 36973 OK · K = 2 < 15 · no new locale pack under a label PR · no shared book moved under this PR's
checks at b6e22ef 58 success, 10 expected skip, 0 failed or pending; mergeable clean

Open findings: nits only, as recorded in 7134722281. Landing order with #36985 (#36899) is unchanged: whichever lands second repoints studioMenuModel.ts onto studioAddress.ts. State: ready + auto-merge (Tier S). On MERGED, #36895 closes by Fixes; area ux-A removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 9c57bd2 Nov 24, 2026
68 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36895-studio-path-helper branch November 24, 2026 16:17
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…pillar nav (objectstack-ai#36985)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTuMGhLAZx29zwDrayDGZZF)_
Fixes objectstack-ai#36899
Part of objectstack-ai#36890
Clause-②: yes (widening)
Metadata-protocol: none

repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

## 维护者速读

- 建应用的人在 Studio
里,顶部那排“数据/自动化/访问/全部元数据”切换没了,换成左侧一列可折叠菜单:数据、界面、自动化、平台、访问、AI
六组,每组带数量和搜索,折叠后刷新还记得,手机上是抽屉。
- 属于“Studio 重构”这条主线(左侧菜单是后面列表页、全屏详情和设计器改造的落脚点)。
- 出问题时作者可能找不到某类元数据的入口,或折叠状态不记忆;不动任何数据,直接撤回这次改动就回到顶部切换。
- 无。

## What changes

**Studio's one navigation is now a left menu of six groups** (amended
ADR-0084: Data, UI, Automation, Platform, Access, AI; zh
数据、界面、自动化、平台、访问、AI). The top pillar switcher is gone from every Studio
page.

- **What it lists.** Each group lists the metadata types the open
package holds, by the type directory's own rule: `scopeDirectoryEntries`
(new `directoryScope.ts`) is now read by both `DirectoryPage` and the
menu, so the two never disagree. A group carries its type count, an
entry its item count (the diagnostics sweep the directory already
reads), and a search box narrows entries by label or machine name.
Object, Flow and Permission Set are always listed, so an empty package
can create its first one.
- **Where entries go.** A type entry opens that type's list in the area
(`/studio/PKG/metadata/TYPE?package=PKG`); an item of an object, flow or
permission set still opens its designer through `areaItemPillarPath`, so
the pillar routes stay and are reached as before. Four entries are not a
type: **Organization flows** (`/studio/~org/automations`) under
Automation, **Default sharing** (the Access pillar on
`?surface=owd:overview`; the page itself is objectstack-ai#36905's) under Access,
**Diagnostics** (`metadata/_diagnostics`) under Platform, and
**Positions and permissions** (the environment catalog on `~all`) under
Access. Datasource still goes to Setup (ADR-0146 D1).
- **Current entry.** The open page's entry carries `aria-current="page"`
and the sidebar's active state: an area page marks its type, a pillar
marks the type it designs (Data marks Object, Automations marks Flow,
Access marks Permission Set, Access on the OWD overview marks Default
sharing).
- **Collapse.** It is the app sidebar's own primitive (`SidebarProvider`
/ `Sidebar collapsible="offcanvas"` from `@object-ui/components`),
docked below the top bar. The top bar's leading toggle hides and shows
it; the state survives a reload under **Studio's own cookie
`studio_menu_state`**, never the app sidebar's `sidebar_state`. Below
768 px it is a drawer that closes when an entry is chosen.
`SidebarProvider` gains an optional `cookieName` prop for this (default
unchanged), declared as a new shadcn local-patch family in
`ui/scripts/shadcn-local-patches.mjs` with its pin.
- **Group names (binding note 7127465963, first option).** The menu maps
the two names itself: `studioMenuGroupLabel` (new
`studioMenuGroupLabel.ts`) names the `system` group Platform / 平台 and
the `security` group Access / 访问 (new keys
`engine.studio.menu.groupSystem` / `groupSecurity`); the other four
groups read `translateMetadataDomain`. Only the left menu's group
headings use it. The shared dictionary is unchanged (System / 系统,
Security / 安全): Setup's datasource pages read it for `PageShell`'s
domain badge, and no other Studio heading or chip is renamed.
- **Clause-② yes (widening):** the published `@object-ui/components`
`SidebarProvider` gains an optional `cookieName` prop (claim amendment
on objectstack-ai#36899, 7134770955).
- **`~all` frame: merged into one shell.** `/studio/~all/metadata/*` is
now served by the same route as a package's area
(`:packageId/metadata/*` already outranked `~all/*`), and
`StudioDesignSurface` draws it with no package, no package actions and
no right slot, beside the same menu. The landing's frame
(`StudioConsoleFrame`) now frames only the landing.
`areaLocationRedirect` now sends a `~org` area URL, or `?package=~org`,
to the package-less flows instead of reading `~org` as a package.
- **「‹ Back to app」 (decision 5 + maintainer ruling 7127681255).** It
names the current package's app, never a remembered app of another
package; a recorded page of one of the package's own apps is still where
it returns. A package with no app, and the org-level and cross-package
entries, name the package (or the scope: Organization flows / Positions
and permissions) and go to the apps home.
- **变更 / 发布 stay where they are:** at the right end of the top bar,
beside Cancel and Save, drawn while drafts are pending
(objectstack#36511).
- Kept: the save coordinator, the unsaved-work guard (a menu link that
leaves asks once through the shell's link guard; the Default sharing
entry, which re-enters the open Access pillar on another query, asks
through the surface's own confirm and then remounts the pillar once the
router holds the new query), the right slot and copilot dock, the
changes panel and Publish, the writable gate and paired package, and the
package-missing empty state (no menu there).
- en and zh strings: `engine.studio.pillar.*` removed,
`engine.studio.menu.*` added.

### Choices the card asked to state

| Question | Choice |
| --- | --- |
| Group names | Mapped in the menu only (`studioMenuGroupLabel`): system
= Platform/平台, security = Access/访问; the shared dictionary keeps
System/Security |
| `~all` frame | Merged into the builder's shell: one shell, one menu on
every Studio page |
| Cookie key | `studio_menu_state` (own key; `sidebar_state` untouched)
|
| 变更 / 发布 | Stay at the top bar's right end beside Cancel / Save |
| Address builder (objectstack-ai#36895, PR objectstack-ai#36973) | objectstack-ai#36973 landed first
(9c57bd2); main merged at c840fdd and the menu repointed at
7617f52: every `studioMenuModel.ts` link and its open-page detection
now come from the `studioAddress.ts` builders, byte-identical (the menu
tests pin the hrefs). No `STUDIO_ITEM_PILLAR` row and no scope-segment
encoding is changed here. |

### Where the work landed outside the stated file surface

- `ui/packages/components/src/ui/sidebar.tsx` and
`ui/scripts/shadcn-local-patches.mjs` (the surface said "read; a new
cookie key"): the provider hard-coded `sidebar_state` on every write, ⌘B
included, so a second key needed the `cookieName` prop. It is a declared
local patch with its pin.
- `ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.tsx` and
new `directoryScope.ts`: the directory's listing rule moved into one
helper the menu shares (item 1 says the menu reuses the directory's
grouping data).
- The apps home: the console has no `/apps` index route, so "back to the
apps home" goes to `useHomePath()` (the `/home` launcher in Studio),
which is what the console calls the apps home.
- The menu's group labels carry `HIDDEN_ICON_LABEL_NOT_FOCUSABLE`, as
every `SidebarGroupLabel` call site does (objectui#12795 call-site pin);
the menu is offcanvas, so the classes never take effect there.

### Known regression (temporary, accepted by the seat 2026-11-24 13:41Z)

- **⌘K on `~all`:** `~all` now renders inside Studio's builder shell, so
the console `AppHeader` and its ⌘K command palette are no longer drawn
on the `~all` leg. Studio's own ⌘K arrives with objectstack-ai#36900, which is queued
next on the list side once this PR and objectstack-ai#36895 land.

## Tests

- New: `studioMenuModel.test.ts` (groups, entries, links, counts,
current-entry rule, search), `StudioMenu.test.tsx` (own cookie and
remount, app sidebar collapse does not collapse the menu, drawer below
768 px closing on choose, aria-current, counts, search with no-match
status, focus order toggle then search then entries), a sidebar
`cookieName` case in `sidebar-cookie-restore.test.tsx`, the patch-family
pin in `shadcn-local-patches.test.ts`, a `~org` case in
`metadataArea.test.ts`, console route cases (`~all` on the builder
route, the entry gate before `~org/automations`, the OWD overview and
Diagnostics, no recent-package record for `~all`).
- The eight surface tests that asserted `studio-pillar-nav` now assert
the menu: `notFound-26708`, `accessSegment-12452`,
`heldDataLeave-26705`, `heldFlowLeave-26705`, `interfacesRetired-36502`,
`metadataArea-28561`, `pillarNavGuard`, `narrowHeader-12509`;
`backToApp-36501` and `packageLessFlows-11553` follow decision 5. Also
converted: `packageListErrorPosture` (the menu and its toggle survive a
package-list failure), `homeLoop-12513` (the menu toggle is the bar's
first button, Back to app the first way out after it) and
`heldFlowLeave-26705` (module-top `@objectstack/lint` import, as its
held-data sibling has). `studioMenuModel.test.ts` also pins the menu's
own group names (en and zh) and the shared dictionary keeping System/系统
and Security/安全; `PageShell.narrowHeader-12306` is back to main's
'Security'.
- E2E: `ui/e2e/studio-left-menu-36899.spec.ts`, a Chromium page bundling
the real menu: docked at the left with the content beside it, off the
canvas when collapsed with the content at full width, still collapsed
after a reload (cookie on a real http origin), a drawer inside the
viewport at 390 px.

<details><summary>Local readings at 214400b, patch rounds to
7617f52</summary>

- `vitest run` on the 50 touched and related files (touched tests, every
test naming `translateMetadataDomain` or a `security`/`system` domain,
DirectoryPage, StudioRoute, StudioBackToApp, packageLess, sidebar):
`Test Files 50 passed (50)`, `Tests 450 passed (450)`, lock `VERDICT
command-exit 0`.
- `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2
skipped (174)`, `Tests 5130 passed | 2 skipped`, `VERDICT command-exit
0` (at b901832; the last commit touched only the e2e spec).
- `type-check` of `@object-ui/components`, `@object-ui/i18n`,
`@object-ui/app-shell`, `@object-ui/console` and `type-check:e2e`:
`VERDICT command-exit 0` (at b901832; `type-check:e2e` re-run at
214400b).
- `playwright test e2e/studio-left-menu-36899.spec.ts --project
chromium`: `3 passed`.
- Derived gate families (`dispatch-gates.mjs --commands`): all 18 exit 0
locally; `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`,
`check:new-line-citations`, `check-nul-bytes`, `check-platform-checklist
--changed-from origin/main` exit 0.
- Patch round at df57661 (CI red at 214400b on "Test-source alias
gate"): `heldFlowLeave-26705` now imports `@objectstack/lint` at module
top, as its held-data sibling does. `node
scripts/check-test-source-alias.mjs` exit 1 before, exit 0 after (`123
packages with tests scanned`); `--self-test` exit 0.
- Patch round at 1f7534d (CI red at df57661 on Test UI 3/16, 4/16,
14/16): the three files at the pre-fix versions `Test Files 3 failed
(3)`, `Tests 3 failed | 10 passed (13)`, `VERDICT command-exit 1`; on
the fix `Test Files 3 passed (3)`, `Tests 13 passed (13)`, `VERDICT
command-exit 0`.
- Patch round at 0af200c (L1 REWORK 7134737804, S1 + S2):
`studioMenuModel.test.ts` `Tests 11 passed (11)` plus the other 5
touched files green; `check-test-source-alias` exit 0;
`@object-ui/app-shell` type-check exit 0; `check:i18n-keys` /
`check:i18n-dead-keys` / `check:i18n-drift` exit 0; card 2,362 changed
lines.
- Merge + repoint at 7617f52 (objectstack-ai#36973 merged): conflicts in
`metadataArea.ts` (main's `studioAddress` imports kept, this branch's
`~org` import added) and `StudioDesignSurface.tsx` (header pillar nav
stays removed; main's other `studioAddress` edits kept).
`studioAddress.guard.test.ts` red at c840fdd (`Tests 1 failed | 1
passed (2)`, offender `studioMenuModel.ts:173`), green after the
repoint; 20 touched/related files `Tests 166 passed (166)`; card 2,364
changed lines (+1774/−590, 37 files).

</details>

## Acceptance notes

- Screenshots below are the real console (`ui/apps/console` dev server,
this branch) against a running server: a self-built app (created through
the Studio landing's New app, `com.default.field-service`) on the
showcase example server, and HotCRM (its own repo at main,
`app.objectstack.hotcrm`) on its published 18.6.0 server. On HotCRM the
Data pillar's rail shows "Couldn't read customizations": that is this
branch's console against an older published server, not the menu.
- Readings from the same runs: no `studio-pillar-nav` on the page; six
groups in order; the Object entry current on the Data pillar; after
collapse `data-state=collapsed`, the cookie `studio_menu_state=false`
and no `sidebar_state`, still collapsed after a reload; at 390 px no
docked menu until the toggle, then a 288 px drawer at the left edge.
- Overlap check (`overlap-check.mjs`, final head): merges cleanly with
main; textual conflicts with objectstack-ai#36973, objectstack-ai#36958 and objectstack-ai#36784 in
`StudioDesignSurface.tsx` (and `metadataArea.ts` with objectstack-ai#36973), all in
the header region this card replaces. Their code is not reshaped here.

### Wide (self-built app)

![Studio left menu, wide, self-built
app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-wide.png)

### Collapsed (self-built app)

![Studio left menu, collapsed, self-built
app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-collapsed.png)

### Narrow, 390 px drawer (self-built app)

![Studio left menu, drawer at 390 px, self-built
app](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/selfbuilt-narrow.png)

### Wide (HotCRM)

![Studio left menu, wide,
HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-wide.png)

### Collapsed (HotCRM)

![Studio left menu, collapsed,
HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-collapsed.png)

### Narrow, 390 px drawer (HotCRM)

![Studio left menu, drawer at 390 px,
HotCRM](https://raw.githubusercontent.com/objectstack-ai/objectstack/ecb115a7ace8ef97fb1b25f37497fd526861d956/issue-36899/hotcrm-narrow.png)

## Verification

Read first, by risk:

1.
`ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx`:
the header and body row (menu mounted inside the provider), the `~all`
branch, and the re-entry remount (`reenterPillar` plus its layout
effect).
2. `ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts`:
what each scope lists and where each entry goes; `studioMenuCurrentKey`.
3. `ui/packages/components/src/ui/sidebar.tsx` with
`ui/scripts/shadcn-local-patches.mjs`: the `cookieName` prop and its
declared patch.

Two-minute check: open `/studio/PKG/data` for any package, click the
toggle at the top-left, reload. Expected: the left menu stays hidden
after the reload, and the app sidebar elsewhere in the console keeps its
own state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziBCAytAzzCu3iPBFR -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…end the stored bearer token (objectstack-ai#37077)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTDAJKyXUan6fJCKsZUf5Pv)_

Fixes objectstack-ai#36981

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:管理员只靠浏览器里保存的登录令牌在线(会话 Cookie
被同机第二个本地运行时替换、被拦截或被清掉)时,设置、已安装应用、审计日志、连接器凭据和连接器连接这几页从报"需要登录"变为正常加载;只用
Cookie 登录的管理员看不到任何变化。
- 为什么做:控制台其它页面都会带上登录令牌,只有这几张设置页漏带,属于"控制台设置页"这一块的体验缺陷,替所有遇到这种登录状态的管理员解决。
- 出错会怎样:最坏情况是这几页重新读不到数据,与修复前一样显示加载失败;不改服务端接受什么、不改登录方式,可以直接撤回本次改动。
- 要你做什么:无。

## What changes

These Setup surfaces called their endpoints with the session cookie
only, so a session held by its bearer token alone (the case the card
measures) read a 401 there while the rest of the console worked. Each
now goes through `createAuthenticatedFetch` from `@object-ui/auth`, the
path every other console request already takes. `credentials: 'include'`
is still passed on every call, so the cookie rides along exactly as
before. A 401 now reaches the console's session-ended check, as it does
on every other page. Besides the bearer, the shared wrapper also stamps
`X-Tenant-ID` (the active organization) and `Accept-Language` (from the
html `lang` attribute, never overriding a header the caller set) on
these calls, and stores a rotated `set-auth-token` from the response,
exactly as it already does for every other console request (L1 N1).
Nothing changes in what the server accepts, how sessions are minted,
stored or refreshed, cookies, CORS or any policy.

| Surface (card row) | Calls routed through the authenticated fetch |
|---|---|
| All settings and every namespace page | the five `/api/settings` calls
in `pages/settings/api.ts` (list, read, save, action, and the judged
client-address read of the Authentication and Access policy pages) |
| Installed apps (Packages) | `PackagesPage`'s `apiJson` (every
`/api/v1/packages` call the page makes); in `marketplaceApi.ts`, the
runtime's own `/api/v1/cloud-connection/installed` and `org-packages`
reads and every `/api/v1/marketplace/install-local*` call |
| Audit log | the `/api/v1/data/sys_audit_log` read |
| Connector credentials | the three credential-ref calls in
`connectorCredentials.ts` |
| Connector connections | the one `call` helper in
`connectorConnections.ts` (declaration, registry, status, begin, revoke)
|

Each module builds the wrapper per call
(`createAuthenticatedFetch()(input, init)`, as `approvalsApi.ts` does).
A module-level instance would run at import, before a test file's
hoisted `@object-ui/auth` mock can supply it.

Audit log failure state: a failed read no longer draws the "No audit
entries" empty state, because the table card is not drawn under the
alert. The alert shows the refusal's own sentence when the response
carries the declared envelope (`readEnvelopeFailureText`). Otherwise it
shows the page's own "Failed to load audit log". It never shows the raw
response body or a bare machine code.

`marketplaceApi.ts`: the calls to the cloud control plane's own origin
(`getCloudBase()`) and the marketplace browse calls (`credentials:
'omit'`) are deliberately left alone. The cloud origin must never see
this runtime's bearer.

## Tests

New pins, each with a cookie-only control (no token stored: no
`Authorization` header, `credentials: 'include'`):

- `ui/apps/console/src/pages/settings/api.bearer.test.ts`: every
settings call sends `Authorization: Bearer TOKEN` when a token is
stored.
-
`ui/apps/console/src/pages/system/AuditLogPage.bearerAndFailure.test.tsx`:
the ledger lists against a server that answers only the bearer. A 401
(the REST seam's flat body) shows "Failed to load audit log", with no
`HTTP 401`, no JSON and no `UNAUTHENTICATED`, and does not show "No
audit entries". An enveloped 403 shows its sentence. An empty answer
still shows the empty state.
- `ui/packages/app-shell/src/views/setup/setupDoorsBearer.test.ts`:
every connector credential and connection call, and the org-packages,
cloud-installed and install-ledger reads.
-
`ui/packages/app-shell/src/views/metadata-admin/PackagesPage.bearerSession.test.tsx`:
the Installed Apps address lists a marketplace install against a server
that refuses any request without the bearer.

Fixture triage: the authenticated fetch reads `response.headers` (for a
rotated session token, which a real `Response` always carries). The
`Response` doubles of 29 existing settings, connector and Packages test
files carried only `ok`, `status` and `json`. Each gains `headers: new
Headers()`. The display-locale harness
(`consoleFaces.displayLocale-9909.test.tsx`) mocks
`createAuthenticatedFetch` with a fixed empty answer, so its mock now
hands a case that stubs the wire to that stub. No assertion changed.

## Acceptance notes

- Same defect family, not fixed here (reported for a family card):
`packages-io.ts`'s held package-list read (`GET /api/v1/packages`, read
by the shell's sidebar, header and Studio entries on every page) is
cookie-only too. In the browser it answered 401 on every Setup page with
a bearer-only session. Fixing it moves the `Response` doubles of roughly
a dozen unrelated shell test files, so it was left out of this card.
Many other `ui/` modules still call `fetch` with the cookie only.
- `actionErrorDetail` (`@object-ui/core`) reads a bare-string `error`
before `message`. Against the REST seam's flat 401 body (`{ error:
'UNAUTHENTICATED', code, message }`, a sanctioned envelope per
`anonymous-deny.ts`), it therefore answers the code. That is where the
connector connections page's bare `UNAUTHENTICATED` came from. With the
bearer attached these surfaces no longer meet that 401, and a real ended
session goes to the session-ended check. The shared reader is not
changed here.
- Browser cookie-only control: after sign-in, the console's session
check writes the token back into localStorage from the cookie session,
so a "cookie only, no token" state cannot be held in a real browser tab.
The cookie-only control is therefore pinned at unit level. In the
browser, the cookie session still loads every surface.

## Verification

<details><summary>Reproduced on main, then fixed (real boot: showcase
backend + Console dev server, signed in, session cookie removed, bearer
kept)</summary>

On `main` (305fe60), every surface answered 401 without the bearer:

```text
settings hub        401 GET /api/settings bearer=no            "Authentication is required to access this endpoint."
settings/company    401 GET /api/settings/company bearer=no
access_policy       401 GET /api/settings/access_policy, 401 GET /api/v1/auth/client-address
installed apps      401 GET /api/v1/packages, 401 GET /api/v1/marketplace/install-local   "... (UNAUTHENTICATED)"
audit log           401 GET /api/v1/data/sys_audit_log         "HTTP 401: {"error":"UNAUTHENTICATED",...}" + "No audit entries"
connector creds     401 GET /api/v1/automation/connectors/credential-refs
connector conns     401 GET /api/v1/meta/connector             "Could not load connector connections. UNAUTHENTICATED"
```

With the fix, in the same state, every request carried the bearer,
answered 200, and the pages rendered their content (settings manifests
and fields, the Packages list, audit rows, the connector empty states).
No page showed `HTTP 401`, `UNAUTHENTICATED` or "Authentication is
required".
</details>

<details><summary>Pins fail on main's source, pass on the fix;
ablation</summary>

Against main's source (the seven source files restored to `305fe60e6e`
on disk, each blob checked equal to the base blob, then restored to
`HEAD`, with `git diff HEAD` empty afterwards), the four new pin files
failed exactly the bearer pins and the audit failure-state pins. The
cookie-only controls and the empty-state control passed:

```text
Test Files  4 failed (4)
     Tests  21 failed | 21 passed (42)
```

Ablations at `8d5bf768c5`, through `scripts/ablation-replace.mjs`. Each
mutation was proven on disk (anchor 1 to 0, blob moved). Each restore
was proven (blob equal to `HEAD`, `git diff HEAD` empty).

```text
settings api.ts     createAuthenticatedFetch()(input, init) -> fetch(input, init)   6 failed | 6 passed (12)   only the bearer cases
PackagesPage.tsx    same mutation                                                   1 failed | 1 passed (2)    the bearer-only listing
AuditLogPage.tsx    table-card guard -> always drawn                                2 failed | 3 passed (5)    both failure-state pins
```

An earlier ablation of `connectorConnections.ts` (module-level form)
turned exactly its five bearer cases red: `5 failed | 18 passed (23)`.
</details>

<details><summary>Suites, typecheck and gates</summary>

Run at `7d8601826f` (the final head): the eight edited or new test files
that changed last, `Test Files 8 passed (8)`, `Tests 74 passed (74)`.
`@object-ui/app-shell` `type-check` exit 0. At `8d5bf768c5`:
`@object-ui/console` `type-check` exit 0. Both typechecks ran after
building the dependency closure (`pnpm --filter '@object-ui/console^...'
build`, exit 0).

Full package suites were run at `f8533fabdd`. Only test files changed
after it.
- `@object-ui/console`: `Test Files 1 failed | 331 passed (332)`, `Tests
7 failed | 3560 passed (3567)`. All seven failures were in
`consoleFaces.displayLocale-9909.test.tsx`, whose auth mock answered
`{}` for the audit ledger. Its mock was fixed at `fc22fa2f7d`. The file
then passed alone: 15 of 15.
- `@object-ui/app-shell`: `Test Files 1 failed | 2416 passed | 1 skipped
(2418)`, `Tests 1 failed | 22867 passed | 9 skipped (22877)`. The one
failure (`RecordDetailView.recordPageTiers-26678`) is outside this
diff's reach and passed alone, 10 of 10, at `fc22fa2f7d`. The full run
took 6054 s on a shared box.

Derived gate families (`node scripts/pm/dispatch-gates.mjs --commands`):
all 39 ran at `8d5bf768c5`, each exit 0. That includes `pnpm
check:type-check-debt` under the lock and `pnpm --dir ui exec vitest run
scripts/` (`Test Files 172 passed | 2 skipped`). `--ran` printed: "39
derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED
zero …)". At that head `check:test-source-alias` was red on four edited
test files. The fix (module-top side-effect imports) landed as
`7d8601826f`. At `7d8601826f`, `check:test-source-alias`,
`check:undeclared-dep-imports` and `check:nul-bytes` each exited 0.

`node scripts/pm/overlap-check.mjs` ran before each push from the third
one on: `VERDICT clean exit 0`, and objectstack-ai#36973 (which shares
`PackagesPage.tsx`) merges cleanly.
</details>

Read first:
1. `ui/apps/console/src/pages/system/AuditLogPage.tsx`: the failure and
empty-state hunk. The table card is now conditional.
2. `ui/packages/app-shell/src/console/marketplace/marketplaceApi.ts`:
confirm only same-server calls moved to `serverFetch`, and that no
`getCloudBase()` call did.
3. `ui/apps/console/src/pages/settings/api.ts`: the five call sites.

Two-minute check: sign in on the Console, delete the
`better-auth.session_token` cookie in devtools, and open Setup, then All
Settings. The settings cards load. On `main` the page reads
"Authentication is required to access this endpoint."

---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB)_

<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziG2t1d9cfRQJDrHkB -->

---------

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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio 重构(1-4a):所有产生 Studio 地址的地方改成调用同一个函数(行为不变,为逐类型切换新地址做准备)

2 participants