Repository navigation
refactor(studio): every Studio address comes from one builder; no address changes - #36973
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…uilder (#36895) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…der (#36895) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…36895) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
… ones (#36895) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…#36895) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: 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
📓 Docs Drift CheckThis PR changes 3 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 62 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 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
|
… 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
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — REWORK · repo:objectstack#3 · head 2a9f6e9 · 2026-11-24T13:55ZL1: REWORK Read
Checklist
Answers to ux-A's three questions
FindingsNo must-fix.
Delta read owed: L1 on the new head plus a |
…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
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head 2fec7fb · 2026-11-24T14:02Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract reviewServed-tier: This is the declaration face. The review is owed by the Inputs read:
Nothing was built, run or re-run. ① Derived judgments
② Semver level
③ Boundary flags
F1 has no effect on correctness or the contract, so this is the final round. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — ACCEPT · repo:objectstack#3 · head 2fec7fb · 2026-11-24T14:37ZL1: ACCEPT Delta read
Findings
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 |
|
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)
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 |
…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
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract-review-claim: session_01WGufzhjqviExWpzQMm57Mt · head b6e22ef · 2026-11-24T15:12Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt Contract reviewServed-tier: This is a delta round on record 7133872199 (head Inputs read:
Nothing was built, run or re-run. ① Derived judgments
② Semver level
③ Boundary flags
No finding. Landing waits for full green on this head; that is a landing check, not part of this verdict. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhjqviExWpzQMm57Mt 席位核对 — ACCEPT · repo:objectstack#3 · head b6e22ef · 2026-11-24T15:14ZL1: ACCEPT Merge-round read
Every round-1 and round-3 finding stays as recorded. Landing still requires full green on |
|
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).
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 |
…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)  ### Collapsed (self-built app)  ### Narrow, 390 px drawer (self-built app)  ### Wide (HotCRM)  ### Collapsed (HotCRM)  ### Narrow, 390 px drawer (HotCRM)  ## 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>
…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>
Requested by Yibo Wang · project thread
Fixes #36895
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
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.
ui/packages/app-shell/src/views/studio-design/studioAddress.ts. It holdsstudioPath, the one path builder, and on top of itstudioLandingPath,studioPackagePath,studioPillarPath,studioHomePath,studioItemPath,studioPillarItemAddress,studioSurfaceQuery, the "All metadata" builders,studioChangesReviewPathandstudioItemReviewPath.~org,~all,metadata,interfaces, and thechangesandreviewparams. The modules that exported these before re-export them under the same names.STUDIO_ITEM_PILLARis 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, everystudioItemPathcaller and the area redirect move together, so the two cannot loop.studioAddressTable.ts. It has three tables:STUDIO_ADDRESS_FAMILIES: 13 address shapes.STUDIO_ITEM_TYPES:object(with itsview,actionandnavqualifiers),flow,permission, andowd: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=environmentandnew. Each row says whether the param is carried verbatim, rides as a qualifier, or is replaced./interfacesredirect (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.?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 byappStudioObjectPath.'form'(URLSearchParams,surface=object%3Aa&action=x) is used byswitchedOffActionPath.segmentEncoding: 'verbatim'.@objectstack/types:packages/types/src/studio-review-links.tsexportsstudioChangesReviewLinkandstudioItemReviewLink. Both server producers already depend on@objectstack/types, and neither may depend on the Console.packages/cli/src/commands/meta/register.tsandpackages/runtime/src/domains/mcp-authoring.ts(reviewRoutes) now call them. The review-link text served to the AI is unchanged (pinned below).@objectstack/spec: that would add a contract-package export, and spec holds no runtime logic.-links, not-routes, becausecheck:route-envelopereads any*-routes.tsas a REST module.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.tsandswitchedOffActionTargets.ts.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).StudioRoute.tsxandAppContent.tsx. Route patterns useSTUDIO_ROOT_PATH, and the:packageIdlanding redirect usesSTUDIO_HOME_PILLAR, the same relativedata.InterfacesNavRail.tsxis gone, as stated.PackagesPage.tsx's localstudioPackagePathnow returnsstudioHomePath.studioInterfacesRetired.tsmetadataArea.ts:studioMetadataAreaPath,studioMetadataItemPath,areaLocationRedirectsetupMetadataStudioPathitselfswitchedOffActionTargets.ts: the action item path andswitchedOffActionListPathstudioNewPackage.ts(STUDIO_NEW_PACKAGE_PATH) andPackageSwitcher.tsx(STUDIO_LANDING_PATH)HomePage.tsxanduseAddAppEntries.ts(bare/studio)~orgflow, BuilderLanding's~orgcard, and RecordTabsConfig, which now callsstudioItemPath).@object-ui/app-shell:STUDIO_ROOT_PATH,STUDIO_HOME_PILLAR,studioLandingPathandstudioPackagePath.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_TYPEisSTUDIO_ITEM_PILLAR, item rows, param keys, family builders, and the params kept on the/interfacesredirect).studioAddress.guard.test.ts(new) is the guard. It parses every non-test source underui/packages/PKG/srcandui/apps/APP/srcand refuses two things:/studio;STUDIO_ROOT_PATH.studioAddress.ts(and the table's placeholder shapes) are allowed.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,repoproject) has two parts:/studioliteral in anypackages/**.tssource outside the shared module, with controls: both server producers are walked, and the matcher fires twice on the allowed file.skills/objectstack-mcp-build/evals/draft-door-procedure.jsonequal tostudioChangesReviewLink/studioItemReviewLinkfor 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.vitest.repo-tests.json,CROSS_PACKAGE_TEST_INPUTS, and the@objectstack/types#test:repoturbo inputs. Ci.yml'scrosspkg:filter already covers the skills root.Local runs (head fa0deb8, after merging origin/main 4f9a3f8)
pnpm --dir ui exec vitest runon 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/runtimesrc/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 typecheckandpnpm --filter @object-ui/app-shell type-check: exit 0 on fa0deb8.@objectstack/runtimeand@objectstack/clitypecheck: exit 0 on 947b96e, the pre-merge head.@object-ui/consoletype-checkwas 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
PILLAR_FOR_SURFACE_TYPE(identical toSTUDIO_ITEM_PILLARtoday). The Automations and Access pillars callstudioPillarItemPath(..., 'automations' | 'access', ...)explicitly. Neither is hand-built, so the guard passes. I left them alone to keep this diff to call-site swaps that merge cleanly with Studio 重构(P0):StudioDesignSurface.tsx 纯搬移拆文件——数据、自动化、访问三个分区各成一个模块,保留再导出 #36893's move-only split. The flow and permission designer cards switch those call sites, or fold the map intoSTUDIO_ITEM_PILLAR, in the same PR that flips the type.studioItemPillarlooks up the type map withhasOwnProperty. The oldAREA_PILLAR_FOR_TYPE[type]lookup matchedObject.prototypemembers, so/studio/PKG/metadata/constructor/xredirected to a garbage pillar URL. It now opens the generic item page. This is pinned instudioAddress.test.ts. No metadata type has such a name.overlap-checkexits 1 on two PRs.draftVerdictimport lines directly above thenav-selectionimport, and this PR deletes that import (its last user was therequestSurfacecall site). The resolution is to keep both deletions. All four of this PR's call sites stay in StudioDesignSurface after the split, and none is in a moved region.origin/mainitself at the same single hunk (the react-router import, a line this PR does not touch): conflict count 1 with this branch and 1 with main alone.Verification
StudioDesignSurface.tsxhunks (four call sites, verbatim segment);metadataArea.ts(the area's redirect now readsSTUDIO_ITEM_PILLAR);studioAddress.tsstudioSurfaceQuery(the three spellings).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/studioto a ui source and watch the guard name the file and line.Human Minimum
packages/specholds no runtime logic. (spec untouched)pnpm lintpasses. (CI)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU