Repository navigation
fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token - #37185
Conversation
…rites through the authenticated fetch (WIP) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
… fetch ratchet; changesets (WIP) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…ticated fetch; the ratchet reads 'include' as const (WIP) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
… fetch reads them (WIP, shard 1 of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
… of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…shard 5 of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…shard 6 of 6) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…stub, clear of a sibling PR's lines Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…ers read off a Headers, the record-lock read) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…ouble gains headers in its one stub Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…gin-detail load at collection (check:test-source-alias) Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…arer-only-shell-fetch
…alette's plugin-detail load at collection (check:test-source-alias) Claude-Session: https://claude.ai/code/session_01QSeKYnV6DdKeTL414FFGnp Co-authored-by: Claude <noreply@anthropic.com>
…converted authenticated read (headers) The package list now goes through createAuthenticatedFetch, which reads the response's set-auth-token header; the double carried none, so the read threw and the palette drew no Packages group. Claude-Session: https://claude.ai/code/session_01QSeKYnV6DdKeTL414FFGnp Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 (fix round 1, cloud session
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
…arer-only-shell-fetch # Conflicts: # ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.notFound-26708.test.tsx # ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.readOnlyPosture-12453.test.tsx
…r in user terms, and claim only the same-server console requests Claude-Session: https://claude.ai/code/session_01QSeKYnV6DdKeTL414FFGnp Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for the delta read (patch round 2, cloud session
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing · area a4-U · 2026-11-25T05:45Z · head
State change: ready for review + auto-merge armed; the queue lands it. On MERGED the card #37080 closes through |
…llscreen Two conflicts, both a collection-time comment beside an import both sides kept (entryReadsOnce-11797, itemDraftLine-12725): main's comment taken. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B
…h beside the flow's ⋯ menu) Claude-Session: https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F Co-authored-by: Claude <noreply@anthropic.com>
…ess; the sharing overview gets its own route (objectstack-ai#37089) Fixes objectstack-ai#36905 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员在 Studio 里点开一个权限集,右侧整块显示权限矩阵,左上角 × 回到权限集列表,页签里能看引用、历史和源码;「谁能看到哪些记录」有了自己的页面,在左侧菜单「访问」里;旧书签自动跳到新地址。 - 为什么做:Studio 重构专题里「权限集矩阵全屏、默认共享总览独立」这一项,让权限集和其他元数据一样从列表点开、全屏编辑。 - 出错会怎样:有未保存修改时点 ×、切菜单、刷新或关标签页会先问(浏览器后退键不问);AI 留下的草稿有提示并可一键放弃;本改动可以直接撤回。 - 要你做什么:这个改动超过 3,000 行(主要是删掉旧的权限侧栏和只为它服务的测试),按您的安排开发完等您审核合入。 ## What changes A permission set now opens full-screen at its metadata address, and the organization-wide default sharing overview has a route of its own. The Access pillar draws no page any more: every address it answered redirects. Three facts for the reviewer, up front: - **No published string is removed.** The 15 studio catalogue rows only the pillar read (`engine.studio.access.*` of its rail and create dialog, and `engine.studio.owd.railLabel`, en and zh) ship in the released `@object-ui/i18n`, so they stay in `ui/packages/i18n/src/namespaces/studio/en.ts` and `zh.ts`, byte-for-byte as on `main`, unread. `check:i18n-dead-keys` lists them as candidates (report only), as it does other unread rows. - **Merged with objectstack-ai#37108** (⌘K on every Studio design page): `origin/main` is merged at `709d2c1e`, and objectstack-ai#37108's palette and ⌘K pins now expect the set's address and the overview's route. - **The browser's Back button is not guarded** (epic objectstack-ai#36890 decision 12): ×, ‹ ›, the left menu, ⌘K, Back to app, a reload and a tab close ask before unsaved edits are dropped; Back does not. 1. **The set's full-screen page** (`StudioPermissionSetPage`, new). On a package's leg, `/studio/PACKAGE/metadata/permission/NAME` opens the matrix (`PermissionMatrixEditPage`, its Studio presentation) in the area instead of sending the set to the Access pillar (`AREA_DESIGNER_PAGE_TYPES` / `areaItemOpensDesignerPage` in `metadataArea.ts`). The header is the full-screen detail's (`ResourceDetailHeader`, from objectstack-ai#36892/objectstack-ai#36901): × back to the list with its context, ‹ › through it, label (the machine name on its tooltip), type and package, ⋯. The tab row is the matrix's five sections, then `ItemToolTabs`' References, History (with the audit log) and Source; a tool tab is addressable (`?tab=`) and keeps the matrix mounted and hidden. The matrix gains one optional seam for this, `studio.frame` (`renderHeader`, `toolOpen`, `toolPanel`, `onDraftChangesRead`); without it the matrix draws its own header exactly as before. The cross-package leg (`/studio/~all/...`) keeps the matrix's environment page. 2. **What the pillar drew around the matrix comes along.** Discard draft, Explain access, the suggested-audience strip, and on a read-only base "New similar": in ⋯ on the page, and as a row action on the base's own rows in the list of sets (`ResourceListPage`; not on its pair's rows). The copy opens at its own metadata address with the strip saying where it landed (`permissionNewSimilar.tsx`, shared by the page and the list). Unsaved edits: the matrix registers with the shell's leave guard and the top bar's Save, so ×, ‹ ›, the menu, a reload and a tab close ask first; the browser's Back is not guarded (epic decisions 1 and 12). A discard sends a never-published set back to the list only when the package's sets were read and it is not among them: an unanswered read keeps the page on the set. 3. **Card item 6, decided here.** An AI-written pending draft (copilot or MCP) gets the designers' notice (`StudioAiDraftNotice`) with 「放弃 AI 的改动」, which drops that one set's draft at its package and asks first only when the matrix holds unsaved edits: the rule objectstack-ai#37026 applied to the generic item page. A person's own leftover draft keeps Discard draft (decision 14). The matrix reports the draft's `draftChanges` from the read it already makes; no new request. Issue objectstack-ai#36660 stays open: this PR applies its rule on the permission set page only; hooks, added actions and the sharing overview's rows are still its scope. 4. **The sharing overview's own route**, `/studio/PACKAGE/owd` (`StudioOwdOverviewPage`, new; `studioOwdOverviewPath`, `STUDIO_OWD_SECTION`), the Access group's menu entry (`studioMenuModel.ts`: its `to` and the current-entry mapping). A set's per-object visibility badge opens it on that object (`?object=NAME`). Its one read-only mark is the header's (objectui#12453), so the panel's own duplicate is gone. 5. **Address switch.** `permission` leaves `STUDIO_ITEM_PILLAR`, so `studioItemPath` (the palette, the AI artifact links, every producer) answers the metadata address; the menu's designer types are named explicitly so a permission set keeps its entry. `/studio/PACKAGE/access?surface=permission:NAME` redirects to the set's address, `?surface=owd:overview` to the overview, a bare `/access` to the list of sets, other parameters kept (`accessPillarRedirect.ts`). A set a read-only base's `.custom` pair adds (every "New similar" copy among them) was listed on the base's pillar and opened at the pair, writable, while the address named the base: its old address now opens at the pair's, `/studio/PAIR/metadata/permission/NAME?package=PAIR`. For an address that names a set, `AccessPillarLanding` (`accessPillarLanding.tsx`, new) reads the base's and the pair's sets, published and draft, as the pillar listed them, and `accessPillarSetHolder` decides: the base when it holds the name, else the pair when it does, else the base; a failed pair read lists none of the pair's sets, a failed base read stays on the base. The pair is the spec's pairing rule (`customizationPackageId`), as the list of sets derives it. Every other address redirects at once. `.../permission/NAME/history` opens the History tab: `AreaHistoryRedirect`'s own-editor exemption no longer covers a designer page. The address table's rows say where each moved (`redirectsTo`). 6. **The copilot keeps its context.** The pillar put the set in `?surface=`; the page's address carries it in the path, so the copilot's surface context reads a designer page's address too (`areaDesignerItemOf`, pillar `metadata`), and the page reports its label, so the chip still reads 「正在看:权限 · 组织成员」 (objectstack#35018). Only designer-page types are read this way, and `PACKAGE/metadata/permission/new` (the area's create page) is no item; every other area item is unchanged. 7. **Card item 5: the Access pillar and its rail are deleted** (`AccessPillar.tsx`, maintainer's answer on epic objectstack-ai#36890, comment 7145880574: this card, reviewed by the maintainer as Tier H by size). Five test files go with it (`accessCreateTaken-26836`, `accessGuard`, `accessRailLabelLive-26846`, `accessRailLabels-11862`, `accessTabs-12456`), and the Access cases of `StudioRail.noMatches-26733`, `emptyStates-12514`, `readOnlyWording-11781`. Not all of that was pillar-only: `accessTabs-12456`'s matrix cases (the five tabs and sections, the facet panels kept mounted for the Save gate, the bulk strip with keyboard focus, the CRUD write, the sharing chip and the object count) and `accessCreateTaken-26836`'s discard cases (a declined question, a never-published set, a read-only package) moved to the page's pin; what went is the rail, the pillar's own header and its create dialog. The other pins of behaviour that lives on moved to the page too: the matrix's Studio Save (`studioSave-36511`, `saveSurface-12725`), New similar (`accessNewSimilar-28573`, now through ⋯), the suggestions strip on a read-only package (`accessSuggestionsReadOnly-33158`), the zh wording (`accessWording-34795`), the status place (`statusPlace-12524`) and the read-only banner. The page keeps objectstack#34795's ruling: the set's machine name is the title's tooltip, so its header draws no API-name chip. ## Tests <details><summary>New pins</summary> - `StudioPermissionSetPage.fullScreen-36905.test.tsx` (26 in round 1): the detail header and no matrix header; section and tool tabs; a tool tab addressable and the matrix kept mounted; × to the list; Discard draft at the set's package, CONTROL none without a draft; a declined question discards nothing; a never-published set's question and its discard back to the list, CONTROL a published set stays and re-reads; no discard on a read-only package; an unanswered sets read keeps the AI discard on the set; the AI notice for copilot and mcp drafts and its discard without a question on a clean page, CONTROL a person's draft; New similar in ⋯ landing at the copy's address with the strip, the no-package answer, CONTROL none on a writable package; the matrix's five sections (order and landing, each section, facets kept mounted, the bulk strip on every row, keyboard focus, CRUD and the header's count, the sharing chip opening the overview on its object and the object count). - `metadataAreaHost.scope-28561.test.tsx` (+4, "New similar" on a read-only base's rows): the base's row offers it and its pair's row does not; the copy opens at its metadata address in the package the clone door names; an answer naming no package opens nothing and says so; CONTROL a writable package offers none. The list's create button is queried by its new test id (`metadata-list-create`), not its label, which "New similar" no longer collides with. - `accessPillarRedirect.test.ts` (7): set, overview, bare and unknown surfaces, parameters carried; a set held in the pair opens at the pair's address while the overview and the list stay on the base; the set name an address opens; the holder decision (the pair's set, CONTROL the base's own set even when the pair holds the name too, neither, a failed pair read, a failed base read). - `StudioDesignSurface.accessPairCopy-29674.test.tsx` (+4, the retired pillar's address through the real surface): `/studio/BASE/access?surface=permission:COPY` lands on `/studio/PAIR/metadata/permission/COPY?package=PAIR`, the copy reads Custom and an edit saves at the pair; a set created in the pair, still a draft, lands there too; the address's other parameters reach the redirect and ride along (`?ref=bookmark`; `?changes=review` is consumed by the surface, which opens the drawer); CONTROL the base's own set's old address stays on the base and reads Package. - `StudioPermissionSetPage.fullScreen-36905.test.tsx` (+3, the sharing chip's leave guard): with a dirty matrix the chip asks the unsaved-edits question once, and declined the page stays on the set with the edit; confirmed it opens the overview on its object; CONTROL a clean matrix asks nothing. - `StudioMetadataArea.routes-28561.test.tsx` (+4): the set opens in place on writable and read-only packages, CONTROL the cross-package leg keeps the generic page, the old history address opens the History tab. - `metadataArea.test.ts`, `studioAddress.test.ts`, `studioMenuModel.test.ts`: the predicate, the address reader (the create page is no item), `studioOwdOverviewPath`, the moved rows agree with the redirect, the menu entry and current key. </details> <details><summary>Pins moved to the new addresses</summary> - From objectstack-ai#37108 after the merge: `StudioDesignSurface.metadataArea-28561` (⌘K's Default sharing from a set's page opens `/studio/PACKAGE/owd`), `StudioPaletteGroups.surfaceScope-36900` (an item opens at `/studio/PACKAGE/metadata/permission/NAME?package=PACKAGE`, the menu entry at `/studio/PACKAGE/owd`), `studioPaletteModel-36900` (leave, re-enter and stay read on the set's address; the overview's route is a leave). - `StudioRoute.metadataArea-28561` (console): the Studio gate refuses `/studio/PACKAGE/owd` as it refuses the old overview address. - `StudioDesignSurface.pillarNavGuard.test.tsx`: decision 12 on the set page and the overview page (menu, Back to app, the shell seam; dirty matrix and dirty overview rows; CONTROL clean). - `StudioDesignSurface.accessPairCopy-29674.test.tsx`: a pair's copy at the pair's address lists the base's objects, saves at the pair, names the base by its label, reads Custom; CONTROL the base's own set. Its docstring now claims only the header's half it reads. - `StudioItemHeader.statusPlace-12524`: the read-only link is a direct child of the page's action group, the group a direct child of the actions slot. - `StudioDesignSurface.aiChipLabel.test.tsx`: the chip and the agent's surface context on the set page. - `accessSegment-12452`: the old Access address lands on the list of sets with its entry current. `notFound-26708`, `readOnlyPosture-12453`, `pillarsClaimSlot-12725`, `rightSlot-12725`, `backToApp-36501`, `changesCount-11787`, `copilotDraftBadge-12725`, `publishPosture-12517` used the Access pillar as "a package page that claims nothing"; they use the overview page now. </details> <details><summary>Ablations (four, each reverted)</summary> - Round 1: `const aiDraft = …` forced to `false` through `scripts/ablation-replace.mjs`: anchor 1 → 0, blob `3dc44aa6` → `fdd76cfd`; the AI-draft describe went 2 failed, 1 passed (the CONTROL); restored blob == HEAD `3dc44aa6`, `git diff HEAD` empty. - This round, on `11aaddcc`: the never-published test put back to `!read?.published.has(name)` through `scripts/ablation-replace.mjs`: anchor 1 → 0, blob `3ac18e32` → `0923112b`; the page's discard cases went 1 failed (the unanswered-read pin), 9 passed (the published CONTROL among them); restored blob == HEAD `3ac18e32`, `git diff HEAD` empty. A first pass on `3d7c1d00` stayed green: the pin asserted the address right after the reset and raced the navigation, so it now waits for the re-read only a page that stays makes. - Round 3, on `7d5d87bd` (tree identical to `79987757`): the landing's holder ignored (`{ setHeldIn: holder ?? packageId }` → `{ setHeldIn: packageId }` in `accessPillarLanding.tsx`) through `scripts/ablation-replace.mjs`: anchor 1 → 0, blob `f9502964` → `169d7fcc`; `accessPairCopy-29674` went 3 failed (the copy, the pair's draft, the carried query), 8 passed (the base's CONTROL among them); restored blob == HEAD `f9502964`, `git diff HEAD` empty. - Round 3, on `7d5d87bd`: the chip's guard removed (`confirmUnsavedLeave(() => navigate(…))` → a bare `navigate(…)` in `StudioPermissionSetPage.tsx`) through `scripts/ablation-replace.mjs`: anchor 1 → 0, blob `3ac18e32` → `2b68c388`; `fullScreen-36905` went 2 failed (declined and confirmed both ask once), 27 passed (the clean CONTROL among them); restored blob == HEAD `3ac18e32`, `git diff HEAD` empty. A first spelling was refused by the tool before anything ran (its replacement was a substring of the anchor, so the replacement count could not rise). </details> ## Acceptance notes - `StudioDesignSurface`'s `PILLAR_FOR_SURFACE_TYPE` still routes a `permission` surface request through `/access?surface=`, and its "open Access" toast action through bare `/access`; both now land via the redirect. They go with the pillar routes in objectstack-ai#36909. - `PermissionMatrixEditor`'s Studio header without a `frame` (its own `StudioItemHeader`, History button and ⋯) has no Studio host since the pillar is gone; 13 of the matrix's own unit tests still render it, so it stays this round and its doc comments say so. Deleting it with those tests' rewrite goes with objectstack-ai#36909. The matrix's prop docs no longer name the Access pillar as their host. - On a pair's leg the provenance chip reads Custom for every set (`customizationMark: 'added'`): a permission set takes no override (ADR-0005), so a set the pair holds is one it adds. - The suggested-audience strip draws on every set page, as it drew above every set in the pillar. - `node scripts/pm/overlap-check.mjs` on `7d5d87bd` (tree identical to `79987757`): `origin/main` (`3b4f0b98`) merges cleanly; objectstack-ai#37185 merges cleanly; objectstack-ai#37168 and objectstack-ai#37169 (open) conflict on `StudioAiCopilot.tsx`, `StudioDesignSurface.tsx`, `StudioMetadataArea.tsx`, `metadataArea.ts`, `studioAddress.ts`, `studioMenuModel.ts` and their tests; objectstack-ai#37166 now conflicts on `StudioDesignSurface.notFound-26708.test.tsx`, a file this round does not touch. Whichever lands second rebases. - The seat's L1 REWORK (7150986891) on the contract review (7150969735): M1 fixed (item 5, pinned in `accessPairCopy-29674` and `accessPillarRedirect.test.ts`, ablated); S1 fixed (the chip's dirty-matrix cases, ablated); N1 fixed (the carried-query case through the real surface). The pair redirect reads the spec's pairing rule rather than the surface's `pairId`: that value is set only once the package list and its manifests answer, and a failed manifests read leaves it unset, which would hold the redirect forever. - Review nits from the seat's L1 (7147848289): N1 above; N2, N3, N4, N7, N8 and N10 fixed in the pins and comments named in Tests; N5 fixed (`areaDesignerItemOf` reads `permission/new` as no item); N6 fixed and pinned (the unanswered-read case, ablated above); N9 in item 3. ## Verification First to read: 1. `ui/packages/app-shell/src/views/studio-design/StudioPermissionSetPage.tsx` — the page; the discard paths (`dropDraft`) and the New similar landing. 2. `ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx` — the `frame` branch of `renderStudio`: the sections stay mounted under a tool tab. 3. `ui/packages/app-shell/src/views/studio-design/StudioAiCopilot.tsx` — the copilot's context now reads a designer page's path. Two-minute check: on HotCRM, open `/studio/PACKAGE/access?surface=permission:NAME` from an old bookmark — it lands on `/studio/PACKAGE/metadata/permission/NAME?package=PACKAGE`, the matrix full-screen with × in the header (for a "New similar" copy on a read-only base, on `/studio/PACKAGE.custom/metadata/permission/NAME?package=PACKAGE.custom`, writable); the menu's Access group opens 「谁能看到哪些记录」 at `/studio/PACKAGE/owd`. <details><summary>Local runs</summary> Round 3, head `79987757` (tree identical to `7d5d87bd`, where these ran; only the two commit messages' trailer pair was reworded), through `scripts/pm/os-verify-lock.sh`: - `ui/packages/app-shell/src/views/studio-design/` whole directory: 299 files passed, 2206 tests. - `ui/packages/app-shell` `type-check` (both `tsc` programs): exit 0, 0 errors. - eslint `--no-inline-config` on the six touched source and test files: exit 0, 0 errors (11 warnings, every one on an untouched line of `StudioDesignSurface.tsx`). - Run one by one, exit captured before any pipe, each exit 0: `check:test-source-alias` (also on `79987757`), `check:nul-bytes`, `check:cross-package-test-inputs`, `check:undeclared-dep-imports`, `check:tier-file-adoption`, `check:published-files`, `check-empty-changeset.mjs`, `check-adr-0087-registration.mjs`, `check-changeset-no-major.mjs`, `check-closing-keyword-parity.mjs`. The other 28 families of the same 38-family derivation read no file this round changes and were green on `bcde26a0`; CI runs them all. Round 2: `objectstack-ai/objectstack`, head `bcde26a0` (origin/main merged at `709d2c1e`), through `scripts/pm/os-verify-lock.sh`: - Affected UI set on `80bd343a` (73 files: every test this PR adds or edits, plus each that names the page, the list page, the area's address reader, the palette or the overview's route): 73 passed, 938 tests; the 15 files `bcde26a0` then edited re-run there: 15 passed, 108 tests. CI runs the whole UI farm. - `ui/packages/app-shell` `type-check` (both `tsc` programs) on `bcde26a0`: exit 0. - `check-i18n-call-site-keys.mjs` exit 0; `check-i18n-dead-keys.mjs` exit 0 (report only; the 15 restored rows are listed as candidates). - `dispatch-gates.mjs --commands` (same 38 families on `80bd343a` and `bcde26a0`): run one by one, exit captured before any pipe. `check:test-source-alias` exit 1 on `80bd343a` (15 surface tests this PR edits now reach the palette's `import('@object-ui/plugin-detail')` since objectstack-ai#37108; collection-time import added in `bcde26a0`), re-run exit 0; every other family exit 0; `pnpm --dir ui exec vitest run scripts/` 172 files passed, 2 skipped, 5130 tests. `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, every line with its exit code. On `bcde26a0` re-run: `check:test-source-alias`, `check:undeclared-dep-imports`, `check:cross-package-test-inputs`, `check:type-check-debt`, `check:nul-bytes`, each exit 0. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYocL4fDtJqdSgFrR6h)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…s approval went next (objectstack-ai#37148) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBCKqH7woNZCA4ZVP1id8Jp7)_ Fixes objectstack-ai#35863 repo:objectstack#3 · os-support-ai · session_01WGufzg3ayWUHg9nLoybejn Clause-②: yes Metadata-protocol: none ## 维护者速读 - 审批人打开自己已经审过的审批单时,「审批进度」里在已决步骤下多出一行:审批已流转到哪一步并在等谁决定,或者整条审批已经结束、结果是什么。 - 属于审批流程体验:解决审过的人看不到「后来怎么样了」的问题。 - 出错时这一行不显示或说法不准,不影响审批本身,撤回这个改动即可恢复原样。 - 无。 ## What changes **Served shape (`@objectstack/spec/contracts`, `ApprovalRequestRow.flow_route`).** One optional member, `outcome`, served only beside `ahead: 'decided'`: - `step?: { id, label }`: the run's latest request when it is a later one than this request (same `flow_run_id`, opened after it, on any node, a later round of the same node included; a pending one wins over a decided one). Absent when no later request was opened. - `status: ApprovalStatus`: that latest request's status, or this request's own when `step` is absent. `pending` with a `step` = the approval went on to that step and waits on its decision. - `ended: boolean`: the record's approval is known to have stopped: a root run, whose own flow body starts no child run (`subflow` / `map`), that has stopped for good. `false` = not known (rounds 1 to 3 below). `outcome` is absent when nothing past the request is known (no later request in the run and the approval not known to have ended, or several later requests are pending at once), so nothing is guessed. A pending request's route never carries it. **Server (`@objectstack/plugin-approvals`).** `routeOutcome` in `approval-route.ts` is the rule, a pure function over the run's own request rows (the same rows `passedSteps` already reads) and whether the run has ended. `flowRoute` calls it for decided rows only. `ApprovalService.attachFlowRoute` reads "ended" off the run itself through `automation.getRun`, judged by the dead-run sweep's own `TERMINAL_RUN_STATUSES` (derived from the total `RUN_STATUS_LIVENESS` map), in the new `runHasEnded`. An unreadable run reads as "not known to have ended", never as a failed read: the field is display-only like the rest of the route. **Docs.** `content/docs/automation/approvals.mdx` gains the decided route's `outcome`, beside the existing `flow_route` example (the docs drift check named that page). **UI (`@object-ui/app-shell`, `@object-ui/i18n`, `@object-ui/console`).** `ApprovalStepLine` takes an `outcome` prop and, with `decided`, draws one line under the decided step, outside the ordered list so assistive tech never counts it as a step: "Went on to STEP, waiting for a decision", "Went on to STEP: DECISION", "Went on to STEP, then ended: DECISION", or "The approval ended here". The approval request page's decision panel hands it the served outcome on a decided route only. Four new `approvalsInbox` rows in all eleven built-in locales. The console's `ApprovalRequest` type and app-shell's `ApprovalRequestLite` mirror the member. ### Why this shape (card option 2, one outcome) and not option 1 (the steps after) - Option 1 needs a `rejected` step state: a widening of the `state` enum every step-line consumer switches on, and it still needs a separate marker for "ended". - The card asks the UI for one line under the decided step; one outcome is exactly that line's data. - Reading the run's latest request (rather than walking the graph) keeps the route's existing rule: history, never the graph, and nothing guessed. ### Read first (by risk) 1. `routeOutcome` in `packages/plugins/plugin-approvals/src/approval-route.ts`: which later row is "the latest", the parallel-pending refusal, and the ended-at-this-request arm. 2. The `outcome` doc on `flow_route` in `packages/spec/src/contracts/approval-service.ts`: the contract text the L2 read judges. 3. `outcomeText` in `ui/packages/app-shell/src/views/approval-progress/ApprovalStepLine.tsx`: which status draws which sentence, and when it draws nothing. ### Two-minute verification `pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/flow-route.integration.test.ts`: expect 14 passed, including "a request decided at step 1 of a two-step route: the outcome says step 2 is pending, then that the approval ended there". ## Tests - `approval-route.test.ts`: a new `routeOutcome` describe (9 cases): later pending, ended at a later step (approved and rejected), ended at this request (approved, rejected, recalled, cancelled), not ended and nothing later (no outcome), a later round of the same node, pending wins over decided, parallel pending (no outcome), rows that are not later requests, and `flowRoute` carrying it on decided rows only. - `flow-route.integration.test.ts` (real ObjectQL over SQLite, real AutomationEngine and approval node): the existing decided pin now asserts `outcome: { status: 'approved', ended: true }` at the last step; new pins for the card's two cases (decided at step 1 of a two-step route shows step 2 `pending`, then `rejected, ended` once step 2 is rejected), a first-step rejection ending the approval, and a pending request carrying no outcome. - `ApprovalDecisionPanel.stepLine-12491.test.tsx` (the existing harness, a new top-level describe, 7 cases): each sentence, no line without an outcome or with nothing to say, no line on a pending route, and every locale pack carrying the four rows. ## Acceptance notes - Size: 850 added / 18 removed lines over 24 files at 6080e34, under the 3,000-line human-merge threshold. - The line does not say who holds the later step. The card mentions it in passing; the approver names of a later step are information this request's reader was never served, so naming them is a read-access question, not a display one. Not filed: no defect, and the card's own ask (step N / ended approved / rejected / recalled) is met. - `ended: true` with `status: 'approved'` reports the last decision; a root run that failed after that approval also reads "ended". The run's own status is not served here; that would be a second widening for a rare case. - Claim file surface: the diff also touches `ui/packages/i18n/src/locales/*.ts` (the four rows the line needs), `ui/apps/console/src/services/approvalsApi.ts` (the console's type mirror of `flow_route`) and `content/docs/automation/approvals.mdx` (the page that documents `flow_route`). - The shape reported to the zone named `{ status, step? }`; the landed shape adds `ended`, because "the approval ended" is a fact about the run, not about any one request's status. ## Round 1 (L2 FAIL 7147867236, L1 REWORK 7147881964), head 99ab892 - **M1, a child run's end.** The approval node now records on each new request whether its run is a root run or a child (`subflow` body, `map` item: the engine links those upward by `$parentRunId`), as `__runRoot` on the config snapshot (precedent `__round`; no schema change). `attachFlowRoute` asks the run for "ended" only when the snapshot says root; a child run's request, a request opened before the stamp, or an unreadable run is never served `ended: true`. New pin in `flow-route.integration.test.ts`: an approval inside a `subflow` whose child run completed while the root run went on to the general manager serves no outcome, and the root run's last request then served `{ status: 'approved', ended: true }` (round 2 withdraws that: its flow hosts a `subflow`); a second pin removes the stamp from a decided last-step request and the outcome disappears. Ablations: root-run read forced `true` gives 2 failed / 9 passed; executor stamp forced `true` gives 1 failed / 10 passed; both restored. - **S1, audience.** The `outcome` contract doc and the `attachFlowRoute` docblock state the disclosure: every reader of the request gets the later step's node id and label and that request's status, never its id, approvers, comments or field values, within the request-visibility bound of ruling record 5299823744 as the seat ruled for this card. - **S2, an unreadable run (option a).** `ended` is now defined as "known to have stopped" (`false` = not known, including an unreadable run), and the contract, the changeset and `approvals.mdx` say an outcome with a later request is served even when the run cannot be read. **N1**: the contract says `status` is the last decision only when it is not `pending`. - Checks: `@objectstack/plugin-approvals` full suite Test Files 128 passed (128), Tests 1934 passed (1934); plugin-approvals and spec typecheck exit 0; spec rebuilt and `check:generated` all 14 up to date; overlap-check clean against main and the open PR heads, objectstack-ai#37145 included. CI at 99ab892: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; mergeable clean. The local re-run of the derived gate list at this head stopped at 9 of 121 (all exit 0) when the container restarted; CI ran the families. ## Round 2 (L2 FAIL 7150840780, L1 REWORK 7150863825), head e264c10 - **M2, a later step in a child run.** Chosen: the second of the two named ways. "Ended" is never claimed for a run whose flow can start a child run; child runs' rows are not read. `flowHostsChildRuns` (`approval-route.ts`) says whether the flow holds a `subflow` or `map` node anywhere, regions included (`loop` body, `parallel` branch, `try_catch`, every graph `collectFlowGraphs` walks), and `attachFlowRoute` asks the run for "ended" only when it does not. Two choices inside it, stated so they can be judged: - It is read off the flow definition (the same body the route's steps are read off), not off the run's step log: the persisted step log is compacted to a bounded number of steps, so "the run never ran a child-run node" cannot be proven from it, while "the flow has none" can. The cost is that a flow with a `subflow` on a branch the run never took also never says "ended"; the line is then left out, never wrong. - It covers the case with a `step` too, not only "ended with no later step": with manager → general manager → subflow legal → end, the manager's outcome would otherwise read `{ step: gm, status: 'approved', ended: true }` and name the general manager's decision as the last one while legal came after. With this rule it reads `{ step: gm, status: 'approved', ended: false }`, which is true. - Not chosen, reading child runs' rows: a request does not record its root run id (only `__runRoot`, a yes/no), the engine serves no "children of a run" read, and walking `$parentRunId` chains from the read side would need a new engine member, outside the claimed surface. - Served shape for the review's setup (manager in the root run, then a subflow holding legal, then the end; legal rejects, the root run completes): the manager's request is served `flow_route: { steps: [manager done], ahead: 'decided' }` with no `outcome`. Pinned exactly in `flow-route.integration.test.ts` ("a later step in a child run: the root run's end is not served as \"ended here\" for the request before it"). The round-1 hosted pin now asserts that the root run's own last request also gets no outcome, its flow hosting a `subflow`. - Contract, changeset and `approvals.mdx`: "known to have stopped" now names "runs a flow that can start a child run" among the `false` cases, and `step` says a request a child run opened is not among the run's requests. - **N4**: the `attachFlowRoute` docblock reads "as the seat ruled on PR objectstack-ai#37148". - Unit: a `flowHostsChildRuns` describe (3 cases): `subflow` and `map` at the top level; inside a `loop` body, a `parallel` branch, a `try_catch` catch, and nested two deep; none anywhere (approvals, gateways, a `loop` of approvals, an empty flow). - Ablations (through `scripts/ablation-replace.mjs`, restored to blob == HEAD each time): the gate in `attachFlowRoute` forced off gives Tests 2 failed / 10 passed (the new pin and the hosted pin); `map` removed from the child-run node types gives 2 failed / 26 passed; the region walk replaced by the top-level nodes gives 1 failed / 27 passed. - Checks: targeted `approval-route.test.ts` + `flow-route.integration.test.ts` Test Files 2 passed (2), Tests 40 passed (40); `@objectstack/plugin-approvals` full suite Test Files 128 passed (128), Tests 1938 passed (1938); plugin-approvals and spec typecheck exit 0; spec rebuilt and `check:generated` all 14 up to date; overlap-check clean against origin/main and PR heads objectstack-ai#37185, objectstack-ai#37173, objectstack-ai#37166. CI at e264c10: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; mergeable clean. ## Round 3 (L2 PASS with S3 7151818256, L1 REWORK 7151830517), head 6080e34 - **S3, which flow body is judged.** Chosen: refuse "ended" unless the run provably ran the body armed now; no new engine member. `ranArmedBody` (`approval-service.ts`) holds when the armed body is the flow's newest registration in the engine's version history (`getFlowVersionHistory`, compared as the very object) and was registered strictly before the run started (the run log's `startedAt`, which a resume carries over unchanged). A run starts on the body armed at its start and resumes pinned to it, so with nothing registered since, that body is the one it ran. `runHasEnded` now requires it beside the terminal status. - Not the run's `flowVersion`: it is the author's number and an edit need not change it (the edit pin re-registers under the same version). - Not judging the run's own version out of the history: the history is the engine's in-memory list since boot and a version number can repeat, so it can name the wrong body; the run log carries no body checksum to match. - `getFlowVersionHistory` and `startedAt` are declared on the plugin's automation surface as members `AutomationEngine` already implements and returns publicly, the existing precedent for that interface. - Cost, stated: a flow registered again after a run started (an edit, a rollback, the re-registration every restart makes) leaves that run's requests without "ended", so after a restart older decided requests drop the line until a new run. Omitted, never wrong. - **Pins** (`flow-route.integration.test.ts`): a run that started a `subflow` (legal rejects, the root completes), then its flow re-registered under the same version without the subflow: the manager's request still serves no `outcome`; a run started on the edited body then ends at the manager, `{ status: 'approved', ended: true }`. A rollback: version 2 (with the subflow) runs, `rollbackFlow` re-arms version 1 (without): no `outcome`. - **Wording**: the contract, the changeset and `approvals.mdx` now say "the flow body the run ran" and when that body is known, and list "ran a body that is not known (its flow was registered again since it started)" among the `false` cases. - **N5**: the `CHILD_RUN_NODE_TYPES` docblock names the only two executors that set `$parentRunId` (`builtin/subflow-node.ts`, `builtin/map-node.ts`), says `loop`, `parallel` and `try_catch` stay in-run, and that a new child-run starter joins the set in the same change. A pin would have to read `service-automation` sources from this package's tests, which the cross-package test-input gate refuses, so it is a comment. - **Left, with reasons.** N2 (later is measured against `created_at`, not the decision): a run opens its requests one after another, so the order they were opened in is the order the approval moved in; the only same-run overlap is parallel branches, which `routeOutcome` already refuses to pick from. No reachable wrong case, so no change and no card needed in my view. **N3, fixed after all**: both UI mirrors now type `outcome.status` as the row's own `status` (`ApprovalRequestRow['status']` in the console, `ApprovalRequestLite['status']` in app-shell), the open union each already uses, rather than a bare `string`. - Ablations (through `scripts/ablation-replace.mjs`, restored to blob == HEAD each time): `ranArmedBody` dropped from `runHasEnded` gives Tests 1 failed / 12 passed (the edit pin); the time test forced true gives 1 failed / 12 passed (the edit pin); the identity test dropped gives 1 failed / 13 passed (the rollback pin). - Checks: targeted `approval-route.test.ts` + `flow-route.integration.test.ts` Tests 42 passed; `@objectstack/plugin-approvals` full suite Test Files 128 passed (128), Tests 1940 passed (1940) at bfff5d1 (6080e34 adds only the two UI type lines); `ApprovalDecisionPanel.stepLine-12491.test.tsx` Tests 20 passed (20) at 6080e34; plugin-approvals and spec typecheck exit 0; spec rebuilt and `check:generated` all 14 up to date; overlap-check clean against origin/main and the open PR heads before each push. Three pushes this round, not one: 30ec243 (S3), bfff5d1 (the rollback pin, once the identity ablation showed that branch unpinned), 6080e34 (N3); CI on the first two was cancelled by the next push. CI at 6080e34: 70 check-runs, 61 success, 9 skipped, 0 failed, every required context green; merges cleanly with main. ## Verification <details><summary>Targeted tests (code at 19f57ef; later commits touch only the changeset, the docs page and one test import)</summary> - `pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/approval-route.test.ts src/flow-route.integration.test.ts`: VERDICT command-exit 0, Test Files 2 passed (2), Tests 34 passed (34). - `pnpm --dir ui exec vitest run packages/app-shell/src/views/approval-decision/ApprovalDecisionPanel.stepLine-12491.test.tsx packages/app-shell/src/views/RecordApprovalsPanel.stepProgressVertical.test.tsx packages/app-shell/src/views/RecordApprovalsPanel.servedRoute-26668.test.tsx`: VERDICT command-exit 0, Test Files 3 passed (3), Tests 29 passed (29). - `pnpm --filter @objectstack/plugin-approvals typecheck && pnpm --filter @objectstack/spec typecheck`: VERDICT command-exit 0. - `pnpm --filter @objectstack/spec check:generated`: all 14 generated artifacts up to date (spec dist built after the contract edit). </details> <details><summary>Ablations (each through scripts/ablation-replace.mjs, mutation proven on disk, restored, tree clean after)</summary> - `flowRoute` outcome replaced by `undefined`: Tests 4 failed / 30 passed (the `flowRoute` unit case and the three integration outcome pins). - `runHasEnded` forced `false`: Tests 3 failed / 6 passed in the integration file (every `ended: true` pin). - The decision panel's `outcome` hand-off deleted: Tests 4 failed / 16 passed (every drawn-line case). All three suites import source, not `dist/`, so no rebuild leg applies. </details> <details><summary>Local gates (dispatch-gates, derived at 19f57ef and again at 1f6480a)</summary> Derived by `node scripts/pm/dispatch-gates.mjs --commands` (120 families once the docs page joined the diff); `--ran` reconciliation: 120 of 120 accounted for. 117 exit 0. Exit 3 (prerequisite not met in this container, nothing measured; CI ran them green): - `node scripts/check-plugin-teardown-shape.mjs --self-test`: exit 3 (shallow clone cannot reach the pinned positive control) - `pnpm check:dual-build-cjs-loads`: exit 3 (reads built output of the whole workspace) - `pnpm check:i18n`: exit 3 (needs its package build closure; nothing compared) Exit 0: - `node scripts/check-adr-0087-registration.mjs --base origin/main` - `node scripts/check-adr-0087-registration.mjs --self-test` - `node scripts/check-changeset-no-major.mjs --base origin/main` - `node scripts/check-closing-keyword-parity.mjs` - `node scripts/check-closing-keyword-parity.mjs --self-test` - `node scripts/check-comment-mask-adoption.mjs` - `node scripts/check-comment-mask-adoption.mjs --self-test` - `node scripts/check-comment-mask-corpus.mjs` - `node scripts/check-dev-prereqs.mjs --self-test` - `node scripts/check-dts-emitted.mjs --self-test` - `node scripts/check-empty-changeset.mjs --base origin/main` - `node scripts/check-empty-changeset.mjs --self-test` - `node scripts/check-issue-citations.mjs` - `node scripts/check-plugin-teardown-shape.mjs` - `node scripts/check-sdui-manifest.mjs` - `node scripts/check-sdui-manifest.mjs --self-test` - `node scripts/check-tenant-audit-census.mjs` - `node scripts/check-tenant-audit-census.mjs --self-test` - `node scripts/ci/assert-turbo-remote-cache.mjs --self-test` - `node scripts/ci/plan-test-core-shards.mjs --self-test` - `node scripts/ci/prune-turbo-cache.mjs --self-test` - `node scripts/ci/snapshot-next.mjs --self-test` - `node scripts/docs-audit/check-affected-docs.mjs` - `node scripts/docs-audit/check-drift-comment.mjs` - `node scripts/pm/check-governed-queue-guard.mjs --self-test` - `node scripts/pm/release-rehearsal-clone.mjs --self-test` - `node scripts/release-pending-publish.mjs --self-test` - `pnpm --dir ui exec vitest run scripts/` - `pnpm --filter @objectstack/lint run check:doc-formula-expressions` - `pnpm --filter @objectstack/spec run check:api-surface` - `pnpm --filter @objectstack/spec run check:authorable-surface` - `pnpm --filter @objectstack/spec run check:browser-reachable-entries` - `pnpm --filter @objectstack/spec run check:docs` - `pnpm --filter @objectstack/spec run check:dual-source-exports` - `pnpm --filter @objectstack/spec run check:duration-unit-keys` - `pnpm --filter @objectstack/spec run check:empty-state` - `pnpm --filter @objectstack/spec run check:entry-nameability` - `pnpm --filter @objectstack/spec run check:error-code-provenance` - `pnpm --filter @objectstack/spec run check:export-origins` - `pnpm --filter @objectstack/spec run check:exported-any` - `pnpm --filter @objectstack/spec run check:liveness` - `pnpm --filter @objectstack/spec run check:llms-txt` - `pnpm --filter @objectstack/spec run check:skill-refs` - `pnpm --filter @objectstack/spec run check:strictness-ledger` - `pnpm --filter @objectstack/spec run check:variant-docs` - `pnpm --filter @objectstack/spec run check:yaml-examples` - `pnpm check:adr-anchors` - `pnpm check:adr-symbol-anchors` - `pnpm check:changeset-gate-self-tests` - `pnpm check:ci-filter-parity` - `pnpm check:cli-command-ids` - `pnpm check:closed-ceremony-text` - `pnpm check:cross-package-test-inputs` - `pnpm check:dispatcher-error-vocabulary` - `pnpm check:doc-authoring` - `pnpm check:driver-memory-census` - `pnpm check:dts-closure` - `pnpm check:engine-double-contract` - `pnpm check:error-status-conformance` - `pnpm check:gitlink-declared` - `pnpm check:i18n-stale-fill` - `pnpm check:issue-citations` - `pnpm check:keyed-text-bounds` - `pnpm check:lean-entry-closure` - `pnpm check:logger-receiver-detach` - `pnpm check:merge-driver` - `pnpm check:nul-bytes` - `pnpm check:object-def-param-keys` - `pnpm check:objectql-double-limit` - `pnpm check:optional-error-sink` - `pnpm check:org-identifier` - `pnpm check:page-declaration-shape` - `pnpm check:platform-object-tenancy-census` - `pnpm check:pm-expected-skips` - `pnpm check:pm-prior-rulings` - `pnpm check:published-files` - `pnpm check:query-options-erasure` - `pnpm check:refd-timer-probe` - `pnpm check:registry-log-declared` - `pnpm check:rest-log-spy-declared` - `pnpm check:role-word` - `pnpm check:settings-bind-window` - `pnpm check:skill-identifier-liveness` - `pnpm check:slot-lookup` - `pnpm check:sourcemap-no-sources-content` - `pnpm check:spec-docblock-symbol-anchors` - `pnpm check:spec-parsed-alias` - `pnpm check:system-context-census` - `pnpm check:test-source-alias` - `pnpm check:tier-file-adoption` - `pnpm check:type-check-coverage` - `pnpm check:type-check-debt` - `pnpm check:undeclared-dep-imports` - `pnpm check:vouch-for-reference-callers` - `pnpm check:watch-hint-literal` - `pnpm check:where-matcher` - `node scripts/check-adr-links.mjs` - `node scripts/check-adr-links.mjs --self-test` - `node scripts/check-doc-route-spelling.mjs --advisory` - `node scripts/check-doc-route-spelling.mjs --self-test` - `node scripts/check-docs-section-name.mjs` - `node scripts/check-docs-section-name.mjs --self-test` - `node scripts/check-section-landing-index.mjs` - `node scripts/check-section-landing-index.mjs --self-test` - `pnpm --filter @objectstack/lint run check:doc-security-posture` - `pnpm --filter @objectstack/spec run check:skill-examples` - `pnpm check:corpus-claim-drift` - `pnpm check:doc-anchors` - `pnpm check:doc-frontmatter` - `pnpm check:docs-audit-scope` - `pnpm check:docs-redirects` - `pnpm check:docs-single-h1` - `pnpm check:docs-spec-enumerations` - `pnpm check:docs-transcript-drift` - `pnpm check:published-readme-links` - `pnpm check:react-page-adapter-contract` - `pnpm check:vendor-version-stamps` </details> - After the docs page and the test import landed: `pnpm check:test-source-alias` exit 0 at 1f6480a (CI had flagged the decision panel harness reaching the lazy `@object-ui/plugin-detail` load without a module-top import; the harness now imports it at collection); the edited harness file re-run, Test Files 1 passed (1), Tests 20 passed (20). CI at head 1f6480a: 61 success, 9 skipped, 0 failed of 70 check-runs; every required context green (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate) and Check Changeset green. Mergeable: clean. NOT MEASURED locally: `Type Check UI` (`@object-ui/app-shell type-check` needs the UI package closure built; the local run stopped on missing-module errors only, none in a touched line). CI's `Type Check UI` is the reading. --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzg3ayWUHg9nLoybejn <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzg3ayWUHg9nLoybejn --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…age, and the pill drops its duplicate All apps row (objectstack-ai#37204) repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW Fixes objectstack-ai#37163 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:桌面端应用切换菜单去掉了多余的「全部应用」一行;找不到页面、无权访问、AI 不可用等页面上的「返回首页」按钮,以及左上角产品标志的读屏名称,改为「返回应用起始页」;手机端完全不变。 - 为什么做:属于「去掉顶栏和平台首页那一层」专题的收尾,桌面端平台首页已下线,这几处还在承诺一个不存在的首页或应用列表。 - 出错会怎样:最坏是某处文案读起来不顺,跳转目标没有任何改动;可直接撤回。 - 要你做什么:无。 ## What changes Measured first, at `origin/main` a10345a. From 768 px up `useHomePath()` answers `resolveDesktopHomePath` (the last-used app, else the declared default, else the first product app). Desktop `/home` redirects into that app (`HomeRoute` → `RootLandingRedirect`) and draws only the no-apps empty state for a viewer with no product app. So no desktop page lists the apps. The pill's 「Switch Application」 group lists every app the launcher serves (`useLauncherApps`, Setup as the 「Settings」 row). It has no cap. - `layout/AppSwitcher.tsx`: the 「All apps」 row (`app-switcher-all-apps`) is removed. It linked to `homePath`, the same target as the 「Back to app start page」 row above it, and the switch group is the list it promised. This dropdown is desktop-only: a phone opens the app-list sheet, which never had the row. The `LayoutGrid` import and the stale comments go with it. - `components/NotFoundState.tsx` `BackToHomeButton` (access denied, verdict screens and route-not-found in `AppContent.tsx`, plus `RecordDetailView.tsx`): reads `layout.appSwitcher.backToHome` 「Back to app start page」 from 768 px up and `empty.appAccessDeniedHome` 「Back to home」 on a phone (`usePhoneViewport`, imported directly so the component still does not load the `useHomePath` module graph). - `console/ai/AiUnavailable.tsx`: same split for its way-home button. - `layout/AppHeader.tsx`: the product mark's `aria-label` is `layout.appSwitcher.backToHome` on a desktop and `layout.appSwitcher.productHome` 「PRODUCT home」 on a phone. `title` stays the product name. - `@object-ui/i18n`: untouched. No key added or removed (`backToHome` already reads 「Back to app start page」 / 返回应用起始页 in all eleven locales since objectstack-ai#37159; `allApps`, `productHome`, `appAccessDeniedHome` and `unavailableHome` keep their phone readers). Hence `Clause-②: no`. - Targets: unchanged everywhere. Serial constraint with objectstack-ai#37166 (zone a4-S; it also edits `AiUnavailable.tsx` and three StudioRoute console tests). Round 1's one-line import overlap in `AiUnavailable.tsx` was removed by moving the import one line up. Round 2 (head `156171ded`) updates three console tests to the desktop wording. They are `StudioRoute.test.tsx:387` and `StudioRoute.lazyBuilder-11798.test.tsx:187`, which looked the mark up by its phone name at jsdom's 1024 px, and `StudioRoute.metadataArea-28561.test.tsx:150`, whose old-name absence check could no longer fail; it now checks `data-testid="app-bar-product-home"`. Those three files conflict textually with objectstack-ai#37166. By the seat's ruling this PR lands first, and objectstack-ai#37166 resolves them as follows: it keeps its own deletion of the two front-door tests, and on `metadataArea-28561` keeps its comment line plus this PR's test-id assertion (posted on objectstack-ai#37166 as 7153261562). `overlap-check` at `156171ded`: `origin/main`, objectstack-ai#37215 and objectstack-ai#37185 merge cleanly; the only overlap is objectstack-ai#37166 in those three files. Read first, by risk: 1. `ui/packages/app-shell/src/layout/AppSwitcher.tsx`: the removed row (the only behaviour change besides labels). 2. `ui/packages/app-shell/src/components/NotFoundState.tsx`: the viewport choice shared by four screens. 3. `ui/packages/app-shell/src/layout/AppHeader.tsx`: the mark's `label` ternary. Two-minute check: at a desktop width, open any app's pill. The menu lists the apps, then 「Back to app start page ⌘⇧H」 and 「Settings」, with no 「All apps」. Open `/apps/APP/no-such-page`: the button reads 「Back to app start page」. Narrow the window under 768 px and the same page reads 「Back to home」. ## Tests Pins per surface at desktop width, with the phone as the CONTROL. Each new pin is a top-level `describe` in the surface's existing harness: - App pill: `AppSwitcher.homeMenu-12605`. The outline has no `app-switcher-all-apps`, exactly one link to the app start page, and every app in the switch group. Phone control: the drawer's 「All apps」 still pinned, unchanged, in `UnifiedSidebar.mobileAppHeader-12201`. - `BackToHomeButton`: `NotFoundState.test`. At 1280 px it reads 「Back to app start page」 with no "home" in it. CONTROL at 375 px: 「Back to home」, opens `/home`. - `AiUnavailable`: `RequireAiSurface.test`. Desktop reads `layout.appSwitcher.backToHome`. CONTROL on a phone: `console.ai.unavailableHome`. - Product mark: `AppHeader.homeMark-12605`. At 1280 px its accessible name is 「Back to app start page」 and `title` the product name. CONTROL at 375 px on `/home`: 「PRODUCT home」, href `/home`. Existing pins re-pointed to the desktop wording, or to `app-switcher-home` in place of the removed row: `AppSwitcher.appIdentity-12201`, `AppSwitcher.hostSingleApp-12913`, `AppHeader.pageRouteNoAuthoringHandles-12198`, `RecordDetailView.recordReadFailure-11902`, `AppContent.deniedVsUnpublished`, `AppContent.noAppComponentRoutes`. <details><summary>Affected suites (vitest, from ui/), head 646cd3e</summary> ``` pnpm exec vitest run --maxWorkers=2 NotFoundState RecordDetailView.recordReadFailure-11902 AppContent.deniedVsUnpublished AppContent.noAppComponentRoutes RequireAiSurface AiChatPage AiUnavailable AppHeader. AppSwitcher. SidebarAppMenu-36112 UnifiedSidebar. usePhoneNavDrawerHistory-29131 KeyboardShortcutsDialog StudioDesignSurface.homeLoop-12513 StudioDesignSurface.backToApp ConsoleLayout. AppContent.packageless setupRedirectTarget Test Files 127 passed (127) Tests 974 passed (974) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Reverse verification (one-shot, restored)</summary> `node scripts/ablation-replace.mjs` replaced the desktop arm of `BackToHomeButton` with the old `empty.appAccessDeniedHome` key (anchor x1 -> x0, replacement x0 -> x1, blob da89f6f -> 07b506144a86) and ran `NotFoundState.test`: ``` × names the object and its cause, and the way back opens Home × a deployment that declares its landing app returns there × zh: the way back reads in the reader language × on a desktop it names the app start page Home now is, not a home page Tests 4 failed | 1 passed (5) ablation-replace: ok restored: blob == HEAD (da89f6f) and `git diff HEAD` is empty ``` The phone CONTROL stayed green under the mutation. There was no build step, because the harness imports app-shell source relatively. </details> <details><summary>Type-check, lint, gates</summary> ``` pnpm --filter '@object-ui/app-shell^...' build && pnpm --filter @object-ui/app-shell run type-check TYPECHECK_EXIT=0 eslint --no-inline-config (14 touched ui files): 0 errors, 23 warnings (pre-existing no-explicit-any) node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main, objectstack-ai#37166) dispatch-gates --commands: 38 derived families, all 38 exit 0 (ui scripts/ suite: Test Files 172 passed | 2 skipped); --ran: 0 UNRUN ``` </details> ## Acceptance notes - `RequireAiSurface`'s published `redirectTo` prop can send the no-assistant screen's button somewhere other than `useHomePath()`. No in-repo caller passes it. The desktop label assumes the default target. - On a desktop the way home briefly names `/home` until the `/me/apps` answer is held, or for a viewer with no product app, where `/home` draws the no-apps empty state. That is the same caveat objectstack-ai#37159 accepted for the ⌘⇧H row. - The `console.ai.unavailableError` sentence still says "head back home" on a desktop. Fixing it needs a new locale key, so it stays outside this diff (see report). - Same family, outside this card's file surface: `ui/apps/console/src/components/StudioRoute.tsx` `StudioAccessRequired` 「Back to home」 links to `useHomePath()`. It is in objectstack-ai#37166's diff, so it is reported rather than touched. Also stale prose only: `runtime-config.ts` (the `hideSingleAppSwitcher` doc mentions the 「All apps」 row) and `docs/qa/platform-checklist/areas/approvals.json` (the switcher offers "Showcase, Back to home and All apps"). ## Verification Round 2, head `156171ded`: the 3 StudioRoute files `Tests 34 passed (34)`; the red leg (the two files at their old content) gave `Tests 2 failed | 20 passed (22)`; a broad sweep of 872 test files `Tests 8296 passed (8296)`; the derived gate families, 38 of 38 exit 0. CI at this head: 38 success, 13 expected skip, 0 failed. Round 1, head 646cd3e. Local: affected suites, ablation, app-shell type-check, touched-file eslint, the derived gate families. CI owns the full farm. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ddress, tabs in objectstack-ai#36513's order (objectstack-ai#37168) Fixes objectstack-ai#36904 Refs objectstack-ai#36513 (its section 一, the tab order, is delivered here; its section 二 was superseded by epic objectstack-ai#36890) Clause-②: no Metadata-protocol: none ## 维护者速读 - Studio 里点开一个对象,设计器在右侧整屏打开,有自己的地址;左上角 × 回对象列表,右上角 ‹ › 看上一个、下一个,设计器左边那一列对象列表没有了。 - 这是 Studio 改版专题里的对象设计器一张,也按之前定的把对象页签排成:记录、字段布局、验证、操作、设置、钩子、API。 - 出错时管理员会打不开或改不了对象(Studio 最常用的路径),旧链接也会落到对象列表;整张合并即可撤回。 - 这张约 4200 行(4,177 行),超过 3000 行:其中删掉的测试约 1700 行(六个整份删掉的测试文件约 1000 行,测的是左侧列表、页内新建、空包页面和实时请求,这些本卡都去掉了),改写和新增的测试约 1000 行,产品代码约 1400 行;需要您审核后合并。 ## What changes - **The object designer is full-screen on the object's address**, `/studio/PKG/metadata/object/NAME`, mounted by the "All metadata" area (`StudioMetadataArea`). The area decides it with the zone's shared designer-page helper from objectstack-ai#37089: `AREA_DESIGNER_PAGE_TYPES`, `areaItemOpensDesignerPage({ packageId, type })` and `areaDesignerItemOf(pathname, segment)`, which reads `new` as the create page, never an item. objectstack-ai#37089 landed first; this branch merged main, so the one list now holds both types, `['permission', 'object']`, and `AreaItemOpen` mounts the permission set's matrix or the object designer by type. For an object, the environment scope and `?review=1` keep the generic page, as the pillar did (`areaItemAsksGenericPage`, shared with `areaItemPillarPath`); the permission page keeps objectstack-ai#37089's behaviour and opens on any query. The header is the shared full-screen item header (`ResourceDetailHeader`): × back to the object list with the list's filter and sort, ‹ › through the list, Esc. No switcher, no "open in app" (epic decision 7). - **No left list, no in-page New.** `DataPillar` takes `objectName` and designs that one object: the object rail, its search and customization filter, the in-page 新建 dialog and the empty-package state are gone. Creating an object is the object list's 「新建」 (`MetadataListCreateDialog`, objectstack-ai#36897), which already has the OWD choice, the app-menu join and the read-only base's `.custom` landing; checked before deleting this copy. - **Tabs in objectstack-ai#36513's order**, verbatim: 记录、字段布局、验证、操作、设置、钩子、API (`objectDesignerTabs.ts`). Narrow columns fold Hooks and API into "Advanced" first (below 1200px), then the other three (below 1000px); each trigger's menu lists only what is folded at its width (`dataTabsFold.ts`). The five header icons became tabs through the shared `ItemToolTabs` (hand-off brief): References, History (audit log inside), Source (layers inside). The open tab is `?tab=` in the address, carried by ‹ ›. - **The address switch.** `object` leaves `STUDIO_ITEM_PILLAR`, so every `studioItemPath` producer opens the new address: the app's 「对象设置」 (`appStudioObjectPath`), the record page's 「配置页面」 (`recordTabsStudioPath`), ⌘K, the AI artifact link, and the switched-off action link (`?action=NAME` on the new address). `/studio/PKG/data` redirects (`dataPillarRedirect`): with `?surface=object:NAME` to that object's designer (`?action=` kept; `?view=`, `?nav=` dropped), otherwise to the object list (`?changes=review`, the server's draft-review link, kept). A `.custom` pair's old address lands on the pair's own area. An object request from the Changes sheet navigates to the object's address in the package that holds the draft (`draftScope`: on a read-only base, its `.custom` pair). - **`AreaHistoryRedirect`:** objects no longer take the designer-item exemption (`/metadata/object/NAME/history` opens the designer's History tab). The line itself stays for flows until objectstack-ai#36903; removing it now would send a flow's history to the flow pillar and lose it. - Kept as the card asks: the copilot's 「对象 · 页签」 chip and the AI-change line. The copilot read the open item only from `?surface=`, which the new address does not carry, so it now also reads it from the designer's address (`areaDesignerItemOf`, as objectstack-ai#37089 does). - Fixed on the way: a partly refused AI-drafts discard kept its message for one render only (the object re-read the discard triggers cleared `error`); it is now its own state. The retired-Interfaces notice is latched on the landing path, not the pillar, since the home is the area's object list now. ### This rework round (L1 7149684173) - **M1:** the rail-switch suite's four cases are carried onto the designer's × and › on the real surface (`StudioDesignSurface.heldDataLeave-26705`, new top-level describe): an unsaved edit that is not held asks on › and ×; an edit whose Save was refused asks; a saved edit leaves without asking; nothing pending leaves at once and sends nothing. - **S2:** the Changes-sheet object link uses `draftScope ?? packageId` (`StudioDesignSurface.tsx`), pinned in `heldDataCreate-26845` (a read-only base with a listed pair lands on the pair's address). - **S3:** `/metadata/object/X/history` opens the designer on History (`StudioMetadataArea.routes-28561`); `?tab=hooks` and `?tab=history` open those tabs, `?tab=nonsense` opens Records (`DataPillar.flatTabs-12450`). - **S4:** `copilotChangesLine-34725` asserts the partly-refused discard's message is still on screen after the object re-read. - **S5:** metadata-address cases in `studioSurfaceContext` (the object, its history address, and the create page, the list and a generic item naming nothing) and `studioSurfaceLabel-8219` (the chip shows the label only for the object the address names). - **S6:** `ui/packages/app-shell/README.md` sends an object to its designer's address; the changeset is rewritten in user terms. - **S7:** `areaItemOpensObjectDesigner` and `metadataAddressArtifact` are replaced by objectstack-ai#37089's helper (above); after objectstack-ai#37089 landed, main is merged and the list holds both types. - **N8, found on the browser walk:** an address naming no object offered it as an "Unpublished new object"; it now says "Object not found" (`objMissing`, `DataPillar.tsx`; pinned in `draftOnlyNoLayers-12508`). - **Added by seat a4-S:** the object create publishes pinned (`publishCreated`, `If-None-Match: *`), as the flow create does, so an object another writer published under the name since the check is refused, not replaced. Pinned in `MetadataListCreateDialog.pairCreate-36897`, with the in-package taken notice and its Open. - **N2, N3, N4:** stale comments corrected (`SidebarItemMenu.tsx`, `studioAddressTable.ts`, `studioInterfacesRetired.ts`, the header-label comment in `DataPillar.tsx`, which now says what the code does: the draft's label when there is one); two controls carried over (a package with no namespace previews and saves the bare identifier, in `MetadataListCreateDialog.pairCreate-36897`; a label-less draft-only object is titled by its name, in `DataPillar.draftOnlyNoLayers-12508`). **N7:** `areaDesignerItemOf` reads `/metadata/object/new` as the create page. ## Tests - New: `objectDesignerTabs.test.ts` (order word for word, address round trip, tool tabs, values that open nothing); `metadataArea.test.ts` (the designer-page helper, `dataPillarRedirect`, `areaDesignerItemOf`); `DataPillar.flatTabs-12450` rewritten for the ruled order, the two-step fold and `?tab=`. - Rehosted on the list dialog (the create's home now): the OWD default, the stored-name preview (with and without a namespace) and the taken-identifier refusal into `MetadataListCreateDialog.pairCreate-36897`; the app-menu join suite, the OWD select, the labels and the taken-identifier object block onto `MetadataListCreateDialog`. - Converted: about 60 designer and surface suites now open the object on its address (`objectName`, area routes). - Deleted, behaviour removed by this card, each with the pin that remains: `StudioDesignSurface.emptyPackage` (no in-page empty state), `StudioDesignSurface.createObjectOwd` (duplicated in `MetadataListCreateDialog.pairCreate-36897`: chosen and default `sharingModel`, `mode: 'draft'`), `DataPillar.railSwitchFlush-27511` (its four cases now on the designer's × and ›, `heldDataLeave-26705`), `DataPillar.surfaceRequest` (the pillar's own live-request apply; the surface's navigation is pinned in `heldDataCreate-26845`), `DataPillar.draftObjectLabel-11843` (the rail's label read; the header's label is pinned in `draftOnlyNoLayers-12508`, both the labelled and the label-less draft), `StudioDesignSurface.aiApplyRefresh` (the rail growing on the pulse); and the rail-only cases inside `autosaveSwitch-11232`, `celGate`, `actionDeepLink-34724`, `heldDataLeave-26705` (the rail switch case became × back to the list), `StudioRail.noMatches-26733` (Data rail), `oneSurface-28572` (pair rows on the rail). <details><summary>Local runs at a9e7bb7, the CI follow-up at 562d068, the main merges at 046762e and 64a5a2d, and the seat's additions at d09f2b3 / 2bf127d</summary> **Main merge after objectstack-ai#37185, `64a5a2d7`:** app-shell closure rebuilt (VERDICT exit 0); app-shell type-check 0 `error TS` (VERDICT exit 0); every app-shell suite naming the designer, the area, the copilot, the menu model, the permission page, the access redirect or the create dialog, plus every app-shell test objectstack-ai#37185 touched (359 files): `Test Files 359 passed (359)`, `Tests 3237 passed (3237)`, VERDICT exit 0. `dispatch-gates --commands` (39 families) all exit 0; `--ran` "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN". Declared narrowing: `pnpm --dir ui exec vitest run scripts/` was killed by the container's memory limit at the default worker count (twice, once with nothing else running), so it ran with `--maxWorkers=2`: `Test Files 172 passed | 2 skipped (174)`, exit 0; CI runs it at its own width. `check:test-source-alias` exit 0; overlap-check: origin/main merges cleanly. **Seat additions, `d09f2b31` (code) and `2bf127d4` (changeset wording):** the create dialog's suites plus the create-adjacent surface suites (8 files): `Test Files 8 passed (8)`, `Tests 67 passed (67)`, VERDICT exit 0; app-shell type-check 0 `error TS` (VERDICT exit 0); eslint 0 errors, no warning on an added line; `check:test-source-alias`, `check:nul-bytes`, `check:cross-package-test-inputs` and `check-empty-changeset` exit 0; overlap-check: origin/main `0a1b69c0` merges cleanly. **CI at the head, `64a5a2d7`:** 62 check-runs, 47 success, 15 skipped, 0 failed. **CI at `2bf127d4`:** the same, 45 success, 13 skipped, 0 failed. **CI at `046762e5`:** 58 check-runs, 45 success, 13 skipped, 0 failed (Test UI, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset, Check PR Size among the successes). **Main merge, `046762e5`** (after objectstack-ai#37089 landed; 139 files, +1,601 / −2,489 = 4,090 changed lines against the new merge base): `pnpm install`, then the app-shell dependency closure rebuilt (lock VERDICT command-exit 0); app-shell type-check 0 `error TS` (VERDICT exit 0); every app-shell suite naming the designer, the area, the copilot, the menu model, the permission page or the access redirect (258 files): `Test Files 258 passed (258)`, `Tests 2237 passed (2237)`, VERDICT exit 0; `dispatch-gates --commands` (39 families) all exit 0, `--ran` "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN" (a derived zero); overlap-check: origin/main `8b74082f` merges cleanly. Tree of `a9e7bb72` = tree of the tested commit `3b4d4722` (`79415e13`, compared byte for byte; the commits were reworded for the trailer rule before the push, no file changed). CI follow-up, `562d0689`: Test UI (5/16) failed at `a9e7bb72` on `objectDesignerTabs.test.ts`'s order pin (this card's own test, unchanged this round): the studio namespace fetches its zh catalogue on demand, so in a worker where no earlier suite had loaded it, `t(key, 'zh-CN')` answered English. Reproduced locally by running the file alone (1 failed); fixed with the module-top `await loadStudioCatalogue('zh')` other suites use (alone: 4 passed); app-shell type-check 0 `error TS` (VERDICT exit 0); `check:test-source-alias` exit 0; overlap-check: origin/main merges cleanly. - The suites this round edits (10 files): `Test Files 10 passed (10)`, `Tests 103 passed (103)`, lock VERDICT command-exit 0 (before the not-found fix; its suite is in the broad run below). - Every app-shell suite naming `DataPillar`, `StudioDesignSurface`, `StudioMetadataArea`, `StudioAiCopilot`, `metadataArea` or a `metadata/object` address (259 files): `Test Files 259 passed (259)`, `Tests 2211 passed (2211)`, lock VERDICT command-exit 0. - `@object-ui/app-shell` type-check (src `tsc --noEmit`, then `tsconfig.test.json`): 0 `error TS`, lock VERDICT command-exit 0. eslint `--no-inline-config` on the edited files: 0 errors (40 warnings, none in a line this round added). - `dispatch-gates --commands` (39 families): all 39 exit 0; `--ran` reconciliation: "39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN", a derived zero. Re-run at `3b4d4722` after the last commits: `check:test-source-alias`, `check:cross-package-test-inputs`, `check:nul-bytes`, `check-empty-changeset`, `check-changeset-no-major`, each exit 0. - `overlap-check` before the push: origin/main merges cleanly; the sibling drafts conflict textually (Acceptance notes). Ablations, each through `scripts/ablation-replace.mjs` on committed code, restored, `git diff HEAD` empty after (the app-shell suites import the source, so no build leg): | Mutation | Turned red | |---|---| | `unsavedPillarWork` without `saveBar.dirty` (M1) | 3 of the 5 new departure cases (› and × over an unsaved edit, the refused Save); the saved-edit and nothing-pending controls stayed green | | the Changes link back on `packageId` (S2) | the read-only base's pair-address case | | objects back on the history exemption (S3) | the object history-address case | | the designer tab not seeded from `?tab=` (S3) | `?tab=hooks` and `?tab=history` | | the discard refusal back on `error` (S4) | the partly refused discard case | | the copilot's address read removed (S5) | the address cases in both copilot suites (3) | | `objMissing` always false (N8) | the not-found case | | the object create's `publishCreated` dropped (`d09f2b31`) | the pinned-publish case and the pair-create case's call shape | | the taken holder never this package (`d09f2b31`) | the in-package notice-and-Open case (a first attempt was refused by the tool as a replacement it could not count, so nothing ran; re-run with a countable replacement) | </details> ## Acceptance notes - **S8, fixed (added by seat a4-S from the objectstack-ai#37169 L1, 7152310574):** the list dialog's taken-name notice tells the two cases apart. When the package the create writes to holds the object, it reads `engine.studio.data.createTaken` (read again) and offers 「打开」, which opens that object's designer (`studioItemPath`). When the holder is elsewhere, it keeps `createTakenElsewhere` and offers no Open. The `onOpenExisting` prop has the same shape as objectstack-ai#37169's flow side. - **i18n keys:** the released `@object-ui/i18n@18.6.0` keys this PR leaves unread are kept (the optional drop from ruling 7153326968 is not taken). `Clause-②` stays `no`. - **Header shows the machine name beside the label (N4):** the designer's header is the shared full-screen item header, which shows the API name beside the label, as every Studio item page does; objectstack-ai#34794 kept it in the tooltip on the old pillar header. Kept, for one header across Studio's item pages. - **N1, for objectstack-ai#36909:** `useRequestedSurface` has no product reader left after this card; objectstack-ai#36909 (route and remnant deletion) removes it with the pillar routes. - **N2, for objectstack-ai#36909:** the retired-Interfaces redirect goes `/interfaces` → `/data` → the object list, two hops; the hop through `/data` goes when objectstack-ai#36909 retires `STUDIO_HOME_PILLAR` and the pillar routes. Only the stale comments are fixed here. - **N8, fixed:** the browser walk showed that an address naming no object did not show a refusal strip but offered the name as an "Unpublished new object" to design. It now says "Object not found" (an existing `@object-ui/i18n` string, `engine.form.objectNotFound`) under the header, whose × goes back to the list. - **For objectstack-ai#36903:** `AreaHistoryRedirect`'s designer-item exemption line now serves flows only; objectstack-ai#36903 deletes it when the flow designer moves. - **Old base address of a pair's object:** `/studio/BASE/data?surface=object:PAIR_OBJECT` (what the retired rail mirrored for an object the `.custom` pair adds) now redirects to the base's area, where that name does not resolve; the pair's own address works, and the object list and the Changes sheet link pair objects to it. - **Paused objectstack-ai#36784** (public forms, now closed): it conflicted textually with this branch on `StudioDesignSurface.tsx`, the Data pillar mount removed here. - **Main merged after objectstack-ai#37089 (objectstack-ai#36905, the permission designer) landed:** 15 files conflicted, all resolved toward both designers (the shared list, the area's mount by type, the copilot comment, the menu model's named designer types, the sharing overview's route beside the object designer's reports, and the test files' collection-time imports and pillar lists). **Main merged again after objectstack-ai#37185 landed** (`64a5a2d7`): two conflicts, each resolved by hand. `StudioDesignSurface.entryReadsOnce-11797.test.tsx` and `StudioDesignSurface.itemDraftLine-12725.test.tsx` both kept the collection-time `@object-ui/plugin-detail` import; only main's explanatory comment beside it differed, and main's comment was taken. `StudioDesignSurface.readOnlyPosture-12453.test.tsx` auto-merged and keeps both sides: this PR's designer address in `PILLARS` and objectstack-ai#37185's header-carrying fetch doubles. Sibling drafts objectstack-ai#37169 (objectstack-ai#36903, flow designer) and objectstack-ai#37166 still conflict textually; whichever lands later merges main. - Size: over 3,000 changed lines, Tier H by size (maintainer ruling recorded on epic objectstack-ai#36890, comment 7145880574). ## Verification Read first (risk order): `views/studio-design/DataPillar.tsx` (the removed rail and create, the header and tab block), `views/studio-design/StudioMetadataArea.tsx` + `metadataArea.ts` (the mount, the designer-page helper and `dataPillarRedirect`), `views/studio-design/StudioDesignSurface.tsx` (the `/data` redirect, `requestSurface` and `unsavedPillarWork`). Two-minute check: on the showcase app, open an app's 「对象设置」. Expected: the URL is `/studio/PKG/metadata/object/NAME`, the designer fills the right pane with no object column, the tabs read 记录、字段布局、验证、操作、设置、钩子、API、被引用、历史、源码; › opens the next object on the same tab; × returns to the object list. ### Browser walk (rework S1), showcase Run at `a9e7bb72` on a live stack: the showcase backend (`objectstack dev --seed-admin`, its own port and database, closure built at this head) with the Console's dev server from this branch's `ui/` source, Chromium through Playwright, signed in as the seeded admin. In this boot `com.example.showcase` is a read-only package, so the walk also covers the `.custom` pair. Every step below passed unless it says otherwise. | Step | What was done | What the browser showed | |---|---|---| | 1 | Object list, click the Account row | `/studio/com.example.showcase/metadata/object/showcase_account?package=…`; the designer fills the right pane beside the left menu, no object column; tab row Records, Field layout, Validations, Actions, Settings, (Hooks, API folded into Advanced at this width), Referenced by, History, Source; ‹ 1 / 24 › | | 2 | Advanced → Hooks, then › | `?tab=hooks`; › opened `showcase_announcement` on the same tab, `2 / 24` | | 3 | History tab | `?tab=history`, the History panel | | 4 | × | back to `/studio/com.example.showcase/metadata/object?package=…` | | 5 | Old link `/studio/PKG/data?surface=object:showcase_account&view=x&action=nope` | `/metadata/object/showcase_account?action=nope&package=…&tab=actions` (`view` dropped) | | 6 | Old home `/studio/PKG/data` | the object list | | 7 | `/metadata/object/showcase_account/history` | the designer on `?tab=history` | | 8 | Field layout → Add field "Walk Probe" (unsaved), then × | the native question "You have unsaved changes. Leave this page anyway?"; dismissed, the designer and the top bar's Save stayed. The walk's next page load was then held by the browser's leave prompt (first run: the navigation aborted while that prompt was dismissed) | | 9 | The running app's Accounts list → ⋮ → Object settings | `/studio/com.example.showcase/metadata/object/showcase_account?package=…`, the designer | | 10 | Object list → 新建 "Walk Gadget" on the read-only package | created in the pair: `/studio/com.example.showcase.custom/metadata/object/showcase_custom_walk_gadget?package=com.example.showcase.custom`, the designer open on it | | 11 | `/metadata/object/no_such_object_36904` | **first run: "Unpublished new object", offered as a new object to design.** Fixed in this round (`objMissing` in `DataPillar.tsx`, pin in `draftOnlyNoLayers-12508`); re-run: "Object not found" with the name, × in the header | | 12 | Viewport 1100px | Validations, Actions and Settings fold too: Records, Field layout, Advanced, Referenced by, History, Source | Console: 36 `Failed to load resource` errors over the whole walk; the five read were a 401 (before sign-in) and 404s. Not traced one by one, and nothing on screen failed. **HotCRM: NOT MEASURED.** Reason: this session's GitHub access is scoped to `objectstack-ai/objectstack`, so the HotCRM app (its own repository) cannot be cloned and booted here. The HotCRM leg the card names carries to objectstack-ai#36910 (the end-to-end walk-through card) as NOT MEASURED, with this reason. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ress; no flow rail (objectstack-ai#36903) (objectstack-ai#37169) Fixes objectstack-ai#36903 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no page under `skills/` or `content/docs/` names the Automations rail's strings or teaches overriding a Studio console string ## 维护者速读 - 搭建者在 Studio 点开一个流程,会在右侧全屏打开它的设计器,左上角 × 回到流程列表,‹ › 按列表顺序看上一个、下一个;原来设计器左侧那一列流程列表没有了,组织级流程也在同样的新地址上打开。流程的“审阅草稿”链接打开通用详情页并显示审阅;权限集的审阅链接照旧打开它的权限矩阵页。 - 这是 Studio 重构专题(左侧菜单 → 列表 → 右侧全屏详情)里流程设计器的一张,和对象、权限集的设计器共用同一套“设计器页面”写法。 - 出错时最可能是旧书签没跳对、或某个流程打不开;不改数据和元数据协议。原流程列表专用的 9 条界面文字随 19.0.0 大版本退役,已在变更说明里逐条列出(若有人自定义过这几条翻译,自定义将不再显示),回退这个 PR 即可恢复。 - 这个 PR 超过 3000 行,按您的裁决在席位审核后请您审核;另有一个问题请您定:流程列表要不要加“触发对象”和“运行状态”两列(需要另开一张协议卡)。 ## What changes - **The flow designer is full-screen on its metadata address.** `/studio/PACKAGE/metadata/flow/NAME` mounts the designer (`AutomationsPillar`, now fixed on one flow named by the route). The area decides it through the shared designer-page helper in `metadataArea.ts` (`AREA_DESIGNER_PAGE_TYPES`, `areaItemOpensDesignerPage`, `areaDesignerItemOf`), now on main from objectstack-ai#37089; after the merges the list is `['permission', 'object', 'flow']`. Header: the shared full-screen item header (`ResourceDetailHeader`): × back to the list with its filters, ‹ › in the list's order (decision 10), title, type, package, and the flow's ⋯ (New similar, Delete). Tabs: Canvas, Variables, Runs, Problems, Debug, then References, History, Source from `item-tools/ItemToolTabs` (hand-off §2); the open tab is `?tab=` (`flowDesignerTabs.ts`). - **No flow rail.** The rail, its search, object groups, legend, status dots, contributed-flow rows and the pillar's own New dialog are deleted. Create is the list's 「新建」 (`MetadataListCreateDialog`, same presets). - **Nine released console strings are retired, declared (M1, ruling 7153171432 「B」 with 7153326968 「下一版是大版本 19.0.0」).** The nine `engine.studio.auto.*` keys only the rail read (`heading`, `none`, `emptyMain`, `group.noObject`, `kind.record`, `kind.scheduled`, `kind.screen`, `kind.autolaunched`, `legend`) are removed from `en` and `zh` of `@object-ui/i18n`'s studio namespace. The changeset declares `Clause-②: yes (narrowing)`, carries the BREAKING note, the ADR-0087 `not-required (no-migration-prescription)` disposition and a 「Removed translation keys」 list, and keeps `'@object-ui/i18n': patch` (the one `major` is objectstack-ai#37223's). `engine.studio.org.none` is kept: S5 reads it. - **Address switch.** `flow` leaves `STUDIO_ITEM_PILLAR` (with objectstack-ai#37168's `object` gone too, it is empty), so `studioItemPath`, ⌘K, the AI artifact links and the Changes drawer open the new address. Old addresses redirect (`automationsPillarRedirect.ts`): `/automations?surface=flow:NAME` to the flow, bare `/automations` to the list; `?view=`/`?nav=` dropped, everything else kept (including `?changes=review`). - **`~org` flows** live on the package-less scope's own area leg: list `/studio/~org/metadata/flow?source=runtime`, flow `/studio/~org/metadata/flow/NAME?source=runtime`. Its list offers no 「新建」, and when it is empty it says how a packaged flow is changed instead (`engine.studio.org.none`, ADR-0146 D11), through a new optional `emptyListHint` on the area host. An empty, unsearched list there reads as empty, not as "No matches for """. - **Copilot context** has the sisters' shape: a designer on its metadata address sends `{ pillar: STUDIO_METADATA_AREA, artifact }`, the same block as objectstack-ai#37089 (on main) and objectstack-ai#37168, plus `orgScopeFlowOf` for the `~org` leg. - **Review links, in plain words:** a flow's review link opens the general item page with its review; a permission set's review link keeps its matrix page; an object's opens the general item page with its review, as objectstack-ai#37168 shipped it. - **One predicate for the generic page.** `?review=1` and `?scope=environment` keep an item on the generic item page through `areaItemAsksGenericPage`, with objectstack-ai#37168's text, for a designer type whose generic page serves that review (the flow). A type whose item page is its own editor (`registerMetadataResource`'s `EditPage`: the permission set's matrix) has no generic review, so it keeps its designer page, exactly as main does. Seat 4 recorded this as the measured form of its ruling A (7157282796). See Acceptance notes. - **Taken name in this package.** The list dialog's flow create says 「This package already has an automation…」 (`engine.studio.auto.createTaken`) and offers Open, to the flow's address, when the flow holding the identifier is this package's; `createTakenElsewhere` otherwise. - **Kept (card item 6):** the copilot's refresh after its edits (`useMetadataRefreshNonce`) and its current-item report (`onSurfaceLabelChange`). objectstack-ai#36726's pinned publish on Save and on the switch is unchanged; the list dialog's flow create publishes with `publishCreated`. - **Run status (card item 2):** the list has no column for it or for the trigger object (the spec's flow columns are NAME, LABEL, type, DESCRIPTION). Both stay on the designer header's Trigger and Status pills. No `packages/spec` change; the column question is a fork for the maintainer. ## Empty state and old deep links (card item 7) - A package with no flow: the flow list's own empty state. The designer is never opened on nothing. - An address naming a flow the package does not hold: one block, 「The link names flow “NAME”, which is not here.」, nothing else opened. A package-less flow opens in `~org` instead (objectui#11553). - Old `/studio/PACKAGE/automations`, `/studio/BASE.custom/automations` and `/studio/~org/automations` links redirect as above. `…/metadata/flow/NAME/history` opens the History tab. - Delete returns to the flow list (its filters kept); no other flow is opened in the deleted one's place. ## Tests - This round: - `heldFlowLeave-26705`: an unsaved, NOT held edit. × asks, Cancel keeps the edit, OK lands on the list with nothing sent; › the same, onto the next flow; CONTROL: after Save neither asks. The Changes sheet's flow request: over a dirty or a held edit it asks, then lands; on the open flow it does nothing; CONTROL: no edit, no question. - `packageLessFlows-11553`, through the real surface: the old address of a package flow lands on its address with the designer open; a read-only base's old address naming a pair-added flow lands on the base's address, writable, with the pair chip; the pair's old address lands on the pair's own address; CONTROL: the base's own flow stays read-only. Also the `~org` Changes request landing on the scope's flow, and the empty `~org` list's guidance. - `tabs-12454`: `?tab=runs` and `?tab=history` open their panel on the real designer; CONTROL: no tab, Canvas. - `createTaken-26917`: a published flow in this package reads `createTaken` and Open lands on `/studio/PKG/metadata/flow/escalate`; another package's keeps `Elsewhere` and no Open. - `aiChipLabel`: repinned to `{ pillar: 'metadata', artifact }`. - `customizeFlow-28570`: the Restore dialog's label is read off the header's title. - Earlier rounds: the remaining `AutomationsPillar.*` suites and the `StudioDesignSurface.*` / `StudioMetadataArea.*` suites that open a flow, converted to the address. Deleted as rail-only, each with the pin that covers what is left: `AutomationsPillar.railSearch-11794`, `FlowStatusDot`, `FlowStatusDot.registration-12349`, `StudioDesignSurface.railUnboundReason-11281` (the unbound reason is on the header's Status pill, `flowStatusTruth-11779`), `.automationsRailOrder-12612`, `.draftObjectFlowGroup-29706`, and the rail cases in `.emptyStates-12514`, `.homeLoop-12513`, `.oneSurface-28572`, `.autosaveSwitch-11232`, `.heldFlowCreate-26845`, `StudioRail.noMatches-26733`. New pins: `automationsPillarRedirect.test.ts`, `flowDesignerTabs.test.ts`, the helper and predicate cases in `metadataArea.test.ts`, the designer and `/history` routes in `StudioMetadataArea.routes-28561`. <details><summary>Ablations (each: committed fix, anchored mutation through the ablation-replace script, restored to the HEAD blob)</summary> - M2, `dirty: autoDirty` → `dirty: false` at `AutomationsPillar.tsx:803`: the two new guard cases go red on `expected "vi.fn()" to be called 1 times, but got 0 times` (lines 315, 338), the CONTROL goes red on Save not offered, and the 5 held-step cases stay green (`Tests 3 failed | 5 passed (8)`). Restored: blob `068563e042de` == HEAD, `git diff HEAD` empty. - S4, `here: own.some(…)` → `here: false`: the in-package case goes red, the others stay green (`1 failed | 9 passed (10)`). Restored: blob `c5263910bff6` == HEAD. - S5, the area host's `emptyListHint` spread deleted: the empty `~org` list case goes red (`1 failed | 23 passed (24)`). Restored: blob `5386130ea404` == HEAD. - The first M2 run went red at the case's own precondition (Save not offered), not at the question; the precondition was moved out of the shared helper and the ablation re-run as above. Declared, not hidden. </details> <details><summary>Local readings (final head first; earlier heads named)</summary> - **Final head `9fcff540`** (the third merge of `origin/main`, at `1b91538b` with objectstack-ai#37168, in `7a7af7ad`; then the lint fix). CI on `7a7af7ad` was red in Lint UI only: three imports that the retired-pillar cases left unused (`fireEvent` and `screen` in `expectedMisses-11799`, `parseSurfaceParam` in `metadataArea.test`). `9fcff540` removes them; no source changed. Readings on that tree, each under the lock: - `pnpm --dir ui --filter @object-ui/app-shell run lint`: exit 0, 0 errors. - app-shell type-check (src and `tsconfig.test.json`): exit 0, 0 `error TS`. - Full run over `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console`, `packages/i18n/`, `clickableNonControlCensus-13461` and the console's `StudioRoute`: Test Files 1508 passed (1508); Tests 15400 passed, 14 skipped; VERDICT command-exit 0. - `check:i18n-keys`: exit 0. `check:test-source-alias`: exit 0 before the push. The 36 light derived families re-ran on `7a7af7ad`: all exit 0. `overlap-check`: `origin/main` and objectstack-ai#37226 merge cleanly; objectstack-ai#37166 conflicts. - Full dogfood battery on `7a7af7ad` (the lint fix changes no runtime file), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. - Ablation of the review rule after the merge: `const genericPage = areaItemAsksGenericPage(search) && !getMetadataResource(type)?.EditPage;` → `const genericPage = false;` in `StudioMetadataArea.tsx`. `routes-28561`: Tests 2 failed, 32 passed (34). The object's `?review=1` CONTROL and the flow's `?review=1` case go red (`expected 'flow-designer' to be 'item'`); the permission set's matrix pin stays green. Restored: blob `c3b2d2786f9f` == HEAD. - CI on `9fcff540`: 58 check-runs, all completed: 45 success, 13 skipped (path filters, opt-in and queue jobs), 0 failed. Lint UI, Type Check UI, Test UI (shards 1–16), Build & E2E UI, Live E2E UI, Lint & Repo Gates, TypeScript Type Check, Test Core, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset and PR-body guards: success. - **Review-link round, head `d3e30576`** (on top of `3f65d38b`, below): app-shell type-check exit 0. `StudioMetadataArea.*`, `StudioPermissionSetPage.*`, `metadataArea.*`, `packageLessFlows-11553`, `heldFlowLeave-26705`, `oneSurface-28572` and `AppContent.setupMetadataStudio-28578`: Test Files 8 passed (8), Tests 218 passed (218). Ablation as above. Full dogfood battery on `d3e30576` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. CI on `d3e30576`: 58 check-runs, 45 success, 13 skipped, 0 failed. - **Final head `3f65d38b`** (the second merge of `origin/main`, at `6211ddf4`). app-shell type-check: exit 0. `studio-design`, `metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai`, `packages/i18n/` and `clickableNonControlCensus-13461`: Test Files 1265 passed (1265), Tests 13230 passed, 14 skipped (VERDICT command-exit 0). Full dogfood battery, `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. The derived gate list is unchanged (38); its 36 light families re-ran, all exit 0. `check:test-source-alias`: exit 0 before the push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168 and objectstack-ai#37166 conflict. - Diff against the merge base with `origin/main` at `3f65d38b`: 94 files, +2,235 / −2,787. - **M1 round, head `576f67d3`.** `check-adr-0087-registration --base origin/main`: exit 0, one declared-breaking changeset with `not-required (no-migration-prescription)`. `check-changeset-no-major`: exit 0. `check-empty-changeset`: exit 0. `ui` `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`: exit 0 each. `packages/i18n/` plus `plainLanguage-11659`, `studio-locale.i18n` and `packageLessFlows-11553`: Test Files 114 passed (114), Tests 2060 passed, 13 skipped (VERDICT command-exit 0). app-shell type-check: exit 0. The 36 light derived families re-run: all exit 0. Full dogfood battery (owed by the `(narrowing)` arm), `pnpm --filter @objectstack/dogfood test` under the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); VERDICT command-exit 0. `check:test-source-alias`: exit 0 before the push. - `pnpm --filter @object-ui/app-shell type-check` (src and `tsconfig.test.json`): exit 0 on `49bf2233`, after the `@object-ui/*` dependency closure was rebuilt from this tree (turbo, 68 tasks). - Full run on `1d6b2854` (the merge plus its seam fixes), over `packages/app-shell/src/views/studio-design`, `packages/app-shell/src/views/metadata-admin`, `CommandPalette.studioScope-11863`, `console/ai` and `clickableNonControlCensus-13461`: Test Files 2 failed, 1150 passed (1152); Tests 3 failed, 11175 passed, 1 skipped. The failures came from the merge: `homeLoop-12513` opened on `/access`, which objectstack-ai#37089 turned into a redirect; and `MetadataListCreateDialog.pairCreate-36897` mounts the dialog without a router, where this round's Open used `useNavigate`. Both are fixed at `49bf2233`, where the touched files re-ran: Test Files 24 passed (24), Tests 176 passed (176). - `dispatch-gates --commands`: 38 families. `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, all with exit codes, all 0. `pnpm --dir ui exec vitest run scripts/` was OOM-killed on its first run beside the full suite; re-run alone under the lock it exited 0 (Test Files 172 passed, 2 skipped). `check:type-check-debt` re-measured under the lock: OK, 0 raw errors. - `check:test-source-alias`: exit 0 before each push. `overlap-check`: `origin/main` merges cleanly; objectstack-ai#37168, objectstack-ai#37166 and objectstack-ai#37185 conflict (exit 1). - ESLint (`--no-inline-config`) over every changed `ui/` file: 0 errors, 59 warnings. </details> ## Acceptance notes - **M1, how it ended.** Round 2 first restored the ten released keys (the L1's preferred fix). The maintainer then ruled retire-and-declare (7153171432 「B」; next release is the major, 7153326968), so this round removes the nine keys no code reads and declares them; the tenth, `engine.studio.org.none`, is read again by the `~org` list (S5) and stays. `studioAutomationCopy.plainLanguage-11659`'s heading case went with its row (N1, first option). The ~35 keys main had already removed are objectstack-ai#37223's, not declared here. - **Merged `origin/main` at `bc3ec37a`, which holds objectstack-ai#37089 (the permission designer).** The merge unions the two designers: `AREA_DESIGNER_PAGE_TYPES = ['permission', 'flow']`, `STUDIO_ITEM_PILLAR` keeps `object` only, and `AreaItemOpen` mounts `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. Two consequences, both deliberate: - **Declared deviation, accepted (seat 4, 7157282796): a permission set's `?review=1` keeps main's behaviour and opens the matrix page.** The ruling said uniform (A), on this branch's recommendation. Checking it showed the premise was false. For a type whose item page is its own editor, the generic page never draws: `MetadataResourceEditPage` hands the item to the registered `PermissionMatrixEditPage`, which has no draft review. Neither it nor main's `StudioPermissionSetPage` reads `?review=1`. Uniform would therefore have sent a set's review link to Setup's matrix editor, with no review sheet and outside the Studio page: a regression. So `AreaItemOpen` asks the generic page only for a type with no own `EditPage`. That is the flow here and the object in objectstack-ai#37168 (objectstack-ai#37168 should check the object's registry before relying on it). Pinned in `routes-28561` (`?review=1` keeps the matrix page), and ablated: dropping the `EditPage` guard reds it, `1 failed | 31 passed (32)`, restored to the HEAD blob. The flow's `?review=1` still opens the generic page and its review (the case beside it). - **Carrier for the permission set's review, objectstack-ai#37269.** Two live links write a permission set's `?review=1` today: the Packages page's per-draft review link (`PackagesPage.tsx:1317`) and the chat's 「Review N changes」 (`AppContent.tsx:286`). Both open the matrix page with no review, as on main. objectstack-ai#37269 makes the matrix page show the draft's changes; this PR does not change what those links open. - The census rows for `AccessPillar.tsx` and `AutomationsPillar.tsx` `setRailOpen` both go: both rails are gone. - **Merged `origin/main` again at `6211ddf4`**, after objectstack-ai#37185 (the authenticated fetch) and objectstack-ai#37232 (the menu's type table) landed and the PR showed a conflict. Two files conflicted, each resolved so both sides survive: `CommandPalette.studioScope-11863.test.tsx` (one comment above the shared `@object-ui/plugin-detail` warm-up; main's wording kept) and `FlowItemMoreMenu.tsx` (main's `authFetch` for the clone door kept; the `STUDIO_HEADER_ICON_BUTTON` import this branch had dropped as unused stays dropped). objectstack-ai#37168 had still not merged, so the exemption below stands. - **Merged `origin/main` a third time, at `1b91538b` (objectstack-ai#37168, the object designer).** This PR now lands second of the pair, so it carries the routing ruling. The 47 conflict hunks in 22 files were resolved so both designers survive: - `AREA_DESIGNER_PAGE_TYPES = ['permission', 'object', 'flow']`, and `STUDIO_ITEM_PILLAR` is empty. - `AreaItemOpen` mounts `DataPillar` for an object, `AutomationsPillar` for a flow and `StudioPermissionSetPage` for a set. objectstack-ai#37168's `type === 'object'` review gate is replaced by the one `EditPage` rule; it gives the object the same answer. - Both creates' `onOpenExisting` paths are kept: the object's at its target package, the flow's in this package. The prop, which both PRs added, is passed once. - Both old-pillar redirects (`/data`, `/automations`) are kept. - Two suites lost their last case, every one a retired pillar's in-place behaviour: `StudioRail.noMatches-26733` (all three rails are gone) and `StudioDesignSurface.autosaveSwitch-11232` (main kept only the Automations cases and this branch only the Data cases, and both pillars are gone). Each is deleted. What they pinned for items is pinned per item: the area keys each designer by item, and `heldFlowLeave-26705`'s › case pins that the next flow opens clean, with nothing sent. - **`AreaHistoryRedirect`'s designer-item exemption (`pillarItem`) is deleted** (seat 4's routing: the second lander of objectstack-ai#37168 and objectstack-ai#37169 deletes it). With `STUDIO_ITEM_PILLAR` empty it could no longer fire. `routes-28561`'s CONTROL keeps its own-`EditPage` leg (the standalone history page), and its object leg is repointed at the object designer's History tab; the flow's `/history` opens the flow designer's History tab (the case beside it). - The closing line on line 1 is kept this round (N4): the maintainer is still to answer card item 2. - N2: the stale `/studio/~org/automations` comments in `src/index.ts` and `studioScope.ts` now name the scope's area addresses. - N3: not changed. The caption's `title="API name: …"` predates this PR: main's pillar header set the same `titleProps.title`, and 20 test lookups across 15 suites key on it. A cut label's hover still shows the API name; the changeset now names the api-name chip instead of a tooltip. - N5 / `orgScopeFlowOf` (seat 4: keep it): a one-line comment at the leg says it is dormant because the package-less scope mounts no copilot (objectui#11553). No surface-level `~org` copilot case is possible: the package-less scope mounts no copilot (`slotHost` needs a package, objectui#11553; `packageLessFlows-11553` pins `chatDock.mounts === 0`). The `~org` leg's context is pinned on the pure `orgScopeFlowOf` in `metadataArea.test.ts`. - N6: four `docs/qa/platform-checklist/areas/studio-authoring.json` items still describe the deleted rail and the `~org` pillar: `automations-rail-and-new-flow`, `org-scope-flows`, `flow-status-matches-runtime`, `flow-edge-type-authoring`. They carry to objectstack-ai#36910, whose item 3 owns that rewrite. - N7: corrected. CI on `5d9bb8da` was 47 success and 15 skipped, and "Check PR Size" was skipped, not passed. - N8: the Restore case reads its label off the header's title (`auto-canvas-caption`), so it still cross-checks the dialog. - S6: `ui/packages/app-shell/README.md`'s package-less section describes the scope's area leg; the changeset is in user terms, with no route templates and no query parameters. - The suites this PR edits import `@objectstack/lint` and `@object-ui/plugin-detail` at module top, so the dynamic imports their source reaches are paid at collection (`check:test-source-alias`). - Overlaps at this head (`9fcff540`): objectstack-ai#37166 conflicts with this branch; `origin/main` and objectstack-ai#37226 merge cleanly. Whichever lands later merges main. - Left for objectstack-ai#36909 (pillar leftovers): `groupFlowsByObject`, `withContributedFlowGroups`, `ContributedRailRow`, `useOpenContributor`, the console's `/studio/~org` bare route, and producers still writing the old `/automations` (all redirect). ## Verification First read, by risk: `StudioMetadataArea.tsx` (`AreaItemOpen`: the designer decision for both types, the `~org` leg), `metadataArea.ts` (the shared helper and `areaItemAsksGenericPage`), `MetadataListCreateDialog.tsx` (the taken-name branch). Two-minute check: open `/studio/com.example.showcase/automations?surface=flow:showcase_urgent_task_alert`; expect the flow full-screen at `/studio/com.example.showcase/metadata/flow/showcase_urgent_task_alert?package=com.example.showcase`, with × to the list and ‹ › enabled. <details><summary>Live walk-through (showcase, earlier round, head 5d9bb8d)</summary> Stack: `pnpm dev -- --fresh -p 38917` after `pnpm build`, and the Console dev server, driven with Playwright. It covered the list, the full-screen canvas, › and ×, a `~org` flow, an old bookmark, bare `/automations` and `/history`. No page errors. HotCRM was not walked: this container holds only this repository. This round adds no new screen path that the cases above do not drive through the real surface; it was not re-walked. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…or Setup > Packages (objectstack-ai#37166) Fixes objectstack-ai#36908 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员和开发者打开 Studio 不再看到软件包卡片页:有上次用过的软件包就直接进它;没有的话,能打开设置软件包列表的人进那个列表,打不开的开发者进「全部元数据」;已安装应用「改了什么」挪到了设置里的软件包详情;「添加应用」菜单去掉了「用 AI 搭建」,「在 Studio 中新建」改名为「新建空白应用」,凡是开放了元数据编辑的环境都会出现。 - 这是 Studio 重构专题的「去掉 Studio 首页」一步:首页的入口大多已有去处,但软件包的「管理」和「全部软件包」要等 Studio 顶栏菜单那张卡(objectstack-ai#37139)补上,一步「新建应用」要等新建软件包对话框那张卡(objectstack-ai#37134);另有三个入口没能在真实环境走过,「添加应用」菜单这一轮的变化(去掉「用 AI 搭建」、改名「新建空白应用」)也没在真实环境走过,都只有自动测试覆盖。 - 维护者已裁定统一「已定制」的口径(objectstack-ai#37236),但设置里的软件包详情和本次更新说明里的一句话目前仍把标签页等排列调整算作「已定制」;改正由那张卡完成,本 PR 不妨碍它。 - 只有 Studio 权限、没有设置权限的开发者现在没有任何页面能新建软件包,因为新建入口只在设置里;这要等 Studio 顶栏菜单(objectstack-ai#37139)和新建软件包对话框(objectstack-ai#37134)两张卡落地。 - 如果出错,用户进 Studio 会落到软件包列表或「全部元数据」页,而不是首页;这次只改界面,不改数据,可以直接撤回。 - 服务器没有报告用户权限时,这些「新建」入口按有权限处理,把人带到设置里的新建软件包;真正能否创建仍由服务器判断,席位建议保持这样。 - 本 PR 超过 3000 行(主要是删除旧首页和它的测试),请您按大 PR 流程审核后再合并。 ## What changes Epic objectstack-ai#36890 decision 9: the package-card page at bare `/studio` (`BuilderLanding`) is removed. This PR finds a new home for every entry it carried and deletes the page, the code only it used, and its tests. Every Studio exit that names no package now makes one choice, `studioEntryFallbackPath`: Setup → Packages (`/apps/setup/component/developer/packages?face=admin`) for a principal holding `setup.access` and `manage_platform_settings`, and `/studio/~all/metadata` (the All metadata area) for one who may enter Studio but not that page. The capability set is the one Studio's entry gate read: app-shell now exports `StudioEntryPermissionsProvider` and `useStudioEntryPermissions`, and the console's `RequireStudioAccess` provides the set around the `/studio` subtree. Outside that provider the set reads as holding nothing, so nobody is sent to a page they may not open. | Entry the home carried | Where it goes now | |:---|:---| | bare `/studio` | `StudioEntryRedirect` (in the lazy Studio chunk). It opens the newest remembered package (the recent `package` entries `StudioRoute` records) that `GET /api/v1/packages` still lists, else `studioEntryFallbackPath`. If the list cannot be read, it opens the newest remembered package, and Studio reports the failed read itself. | | New package (`/studio?new=package`) | `SETUP_NEW_PACKAGE_PATH`: the admin face with `?new=package`. It opens New Package on arrival and drops the param with a replace. After create it lands in Studio on the new package (objectstack-ai#36834). Callers: Home's no-agent chip, the `/ai` no-assistant screen, the 「Add app」 menu and the no-apps screen, all labelled 「New blank app」 / 「新建空白应用」 now (below); for an author who may not open Setup → Packages each of them, like the bookmark, opens the All metadata area instead (`useNewPackageDoorPath`, `newPackageDoorPath`). An old `/studio?new=package` bookmark goes there for a holder of the pair, and to the All metadata area for anyone else (`studioNewPackageEntryPath`). One-step 新建应用 is objectstack-ai#37134. | | `~all` / `~org` cards | Already in the left menu (objectstack-ai#36899). Nothing more to do here. | | Per-app "n customized, m switched off" and the "Customizations in this environment" panel | `PackageCustomizationsPanel`, shown in a read-only base's detail sheet on the admin face. It is not shown for an authored package, a `.custom` pair or a kernel package. It has a summary line, rows with tabs (adds Layouts), search, Show all, and 「Customize in Studio」. **"Customized" now counts `counts.arrangements`.** This delivers objectstack-ai#36833's requirement in the panel's new home; objectstack-ai#36833 was closed as not planned (ruling 7125820739), so this PR does not close it. | | Card Manage and the All packages link (development face) | Not this card: the door is added by objectstack-ai#37139 (card note 7146329913). The development face stays reachable by its address. | | Recently viewed | Now Studio's entry itself: `/studio` opens the newest remembered package. | | 「包不存在」 → Studio home | The button follows `studioEntryFallbackPath`: 「Open the package list」 → Setup → Packages for a holder (`engine.studio.notFound.packageList`), 「Open All metadata」 → the All metadata area otherwise (new key `engine.studio.notFound.allMetadata`). | | `AppContent` fallbacks, `packagedActionsStudioPath` fallback with no package named | `SETUP_PACKAGES_PATH`. | | `studio:builder` (the `@objectstack/studio` app's 「应用构建」) | Forwards to `/studio`. | | 「Add app」 (sidebar app menu, and the no-apps screen's buttons) | Maintainer rulings 7153161067 and 7153400210 on objectstack-ai#36908: 「Build with AI」 (to bare `/studio`) is removed, and `new-in-studio` is pushed for every admitted viewer on a deployment that offers metadata authoring, whether or not the build agent is served. It is relabelled under its existing key `home.build.inStudio`: en "New blank app", zh-Hans 「新建空白应用」, zh-Hant regenerated (「新建空白應用」), and the eight other packs translated anew, as `check:i18n-drift` requires of an en change. Home's no-agent chip and the `/ai` button read the same key; their inline `defaultValue` now matches the en value (`check:i18n-keys`); the chip's condition and target are unchanged. It stays inside `isAiStudioEnabled()`, because with `features.aiStudio` false the runtime offers no metadata authoring; a viewer `useMayAddApp` admits there gets the marketplace's two entries, so the list is never empty for an admitted viewer. `SidebarAppMenu` reads the list itself and draws neither 「Add app」 nor its separator for an empty list. Home's 「Build an app」 chip and Home's 「Build with AI」 drawer button are untouched. | Removed: `BuilderLanding.tsx`, its `BuilderLanding.*` test files, `fetchInstalledPackageRow` (only the home's Manage called it) with its pin, and the home's console frame in `StudioRoute` (header and command palette). Two deleted suites still pinned code that stays, and those halves moved (see Tests): the permission matrix's read-only hint copy, and the three new-app door cases. `LandingCustomizationsPanel` and `landingCustomizations-io` were renamed and rewritten as `PackageCustomizationsPanel` and `packageCustomizationRows`. `newAppDoor.ts`, `PackageFormDialog`'s `newApp` branch and the `engine.studio.newApp.*` strings stay for objectstack-ai#37134; the branch keeps its three cases, now mounted on `PackageFormDialog` itself. **Strings.** The home's `engine.studio.landing.*` keys and `engine.studio.landingHome` that ship in the released `@object-ui/i18n@18.6.0` (71 in each of `en` and `zh`, measured against the published tarball; 3 of them are still read by the Packages page) stay, the other 68 no longer read. Removing a published key is a narrowing, so this PR removes none. The four landing keys added after 18.6.0 and never released (`manage`, `manageTitle`, `allPackages`, `allPackagesTitle`) are removed. `engine.packages.customizations.*`, `engine.studio.notFound.packageList` and `engine.studio.notFound.allMetadata` are added (38 keys per language). The PR changes no existing value. **Changesets.** `36908-remove-studio-home.md` (app-shell, console, platform-objects) says what users see, in their words. The i18n note is in its own `@object-ui/i18n`-only changeset, `36908-studio-home-strings.md`. Both carry the two declaration lines. Checklist: `studio-authoring.package-customization-counts-and-marks` (rev 4) and `studio-authoring.org-scope-flows` (rev 5) are re-pointed. The rev 4 note now says objectstack-ai#36833 was closed as not planned and this card delivers its requirement; its `acceptance[2].verify` names `PackageCustomizationsPanel.test.tsx` as the pin. Also re-pointed off the removed home: `automation.setup-packaged-automation-board` (rev 15: title, `steps[1]`, `acceptance[0]`; the packaged-actions bookmark with no `?package=` opens Setup → Packages), `studio-authoring.first-run-loop` (rev 16, `steps[1]`: 「Build an app」 opens the last package or Setup → Packages, the other chip reads 「New blank app」), and the fixture lines of `automation.packaged-flow-clone-contract` (rev 14), `studio-authoring.held-edit-leave-guard` (rev 12) and `ux-conventions.write-feedback` (rev 18), which made their scratch package on the Studio landing. Size at `54e4586e`: +2,306 / −5,217 across 101 files rename-aware (+2,680 / −5,591 across 103 without renames), mostly deletions. Per ruling 7145880574 on objectstack-ai#36890 this lands as one PR, reviewed by the maintainer after L1. **Overlaps** (overlap-check at `54e4586e`, against `origin/main` `4fb03ebb`, exit 1 for objectstack-ai#37249 below): origin/main merges cleanly. This round merged main six times: `cf77ecb9` (K 12) was clean, and `54e4586e` (K 9, with objectstack-ai#37169) is resolved below. Resolved: - objectstack-ai#37089 (landed as `886e9707`): conflicted in `StudioDesignSurface.notFound-26708`; both sides added the same `@object-ui/plugin-detail` import, main's comment kept. The same merge brought objectstack-ai#37198's address-guard fixtures spelling the removed `STUDIO_LANDING_PATH`; they are dropped here. - objectstack-ai#37185 (landed as `ad604c10`): `PackageSwitcher.tsx` keeps this branch's side (`fetchInstalledPackageRow` and `STUDIO_LANDING_PATH`, which objectstack-ai#37185 moved onto the authenticated fetch, are deleted here); its edits to the six test files this branch deletes were stub adaptations (a `headers` field, a module-top import, the gate's fetch double) with no subject left to pin. The new customizations read goes through `packageCustomizations-io.ts`, already on the authenticated fetch; `PackageCustomizationsPanel.test.tsx`'s stub now carries `headers: new Headers()`. - objectstack-ai#37204 (landed as `bd98dd12`): `StudioRoute.test.tsx` and `StudioRoute.lazyBuilder-11798` keep this branch's removal of the home-frame cases; `StudioRoute.metadataArea-28561` keeps this branch's comment line and objectstack-ai#37204's `app-bar-product-home` test-id absence, without the old-name check. - objectstack-ai#37241 (landed as `fc216747`): `SidebarAppMenu.tsx` takes its `AppMenuList` and keeps this branch's `offerAddApp` separator; its new `SidebarDocsPortalMenu` gets the same rule (the 「Add app」 list read there, nothing drawn for an empty list, `AddAppSubmenu entries={…}`), pinned in its `SidebarAppMenu-36112` block (「New blank app」 and no 「Build with AI」 with the build agent served; a Studio-only author to `~all`; the empty-list guard). - objectstack-ai#37168 (landed as `1b91538b`): `PackageFormDialog.newAppStep-36748` keeps this branch's host and adds objectstack-ai#37168's `/studio/:packageId/metadata/*` route; `notFound-26708` keeps this branch's provider and Setup / All metadata routes and adds objectstack-ai#37168's metadata-area route (the removed home's `/studio` route stays out). Its edits to the two `BuilderLanding.*` files this branch deletes were the switched-off action's new address; that pin now lives at `PackageCustomizationsPanel.test.tsx:188`, updated here to `/studio/APP/metadata/object/opportunity?action=clone_opportunity`. - objectstack-ai#37169 (landed as `4fb03ebb`; this PR is the second lander): `BuilderLanding.orgScope-11553` stays deleted. objectstack-ai#37169 only moved the removed home's ~org card to `/studio/~org/metadata/flow?source=runtime`, and the org-scope entry is pinned by `StudioDesignSurface.packageLessFlows-11553`, which objectstack-ai#37169 updated. `notFound-26708` keeps this branch's `StudioEntryPermissionsProvider` and Setup / All metadata routes, with objectstack-ai#37169's comment naming `/automations` too. Nothing else conflicted. `AREA_DESIGNER_PAGE_TYPES` and the removed `AreaHistoryRedirect` exemption came in untouched. The 18.6.0 studio key comparison was re-run against `4fb03ebb`: the branch removes only the four never-released keys, adds 38 per language and changes 0 values; all 71 released landing keys are present. Still open; whichever lands second merges main and resolves: - objectstack-ai#37249 (objectstack-ai#37227) conflicts in `HomePage.desktopNoApps-36732` and `HomePage.noAgentsBuildChip-26614` (this branch's Studio-only chip case). Beyond the text: its first case expects the no-apps doors `[template, marketplace]` with the build agent served, and 「New blank app」 now shows there too (ruling 7153400210), so the second lander keeps `new-in-studio` first. Its HomePage filter of `build-with-ai` becomes a no-op. It touches neither `home.build.inStudio`'s values nor the chip's lines (measured by `git merge-tree` against its branch). - objectstack-ai#37226, objectstack-ai#37215, objectstack-ai#37210, objectstack-ai#37165, objectstack-ai#37282 and objectstack-ai#37284 merge cleanly. ### Read first 1. `ui/packages/app-shell/src/views/studio-design/StudioEntryRedirect.tsx`: the whole `/studio` decision, and the two capability helpers. Risk: where a non-administrator lands (the `studioEntryFallbackPath` pair), now for the bookmark too. 2. `ui/packages/app-shell/src/views/studio-design/PackageCustomizationsPanel.tsx` and the mount in `PackagesPage.tsx` (`PackageDetailSheet`). Risk: the gate `!authoring && !writable && !isKernel && !isCustomizationPackage(id)`. 3. `ui/apps/console/src/components/StudioRoute.tsx` with `studioEntryPermissions.ts`: the index route and the capability set the entry gate provides to Studio (`StudioEntryPermissionsProvider`), which the not-found exit reads. ### Two-minute verification As the seeded admin with nothing remembered, open `/_console/studio`. Expected: you land on Setup → Packages (`…/developer/packages?face=admin`). Open the ObjectStack Showcase row: its detail shows "Customizations in this environment" with a Customize in Studio link. ## Tests New pins: - `StudioEntryRedirect.test.tsx` (12 cases): the newest remembered package the list still names opens; a package the list no longer names is skipped; nothing remembered leads to Setup → Packages, read without a list request; a Studio-only principal lands on `~all`; a failed list read opens the newest remembered package; the old new-package bookmark is forwarded for an administrator (CONTROL) and sends a Studio-only principal to `~all`, never to Setup; both helpers read the same capability pair. - `StudioDesignSurface.notFound-26708`: the not-found button opens Setup → Packages for an administrator (CONTROL), and for a Studio-only principal it reads 「Open All metadata」 and opens `~all`, never Setup. The harness provides the entry gate's set through `StudioEntryPermissionsProvider`. - `PermissionMatrixEditor.readOnlyHintCopy-12171.test.ts`: the half of the deleted `BuilderLanding.environmentOverlayCopy-12171` that covered `perm.readOnly.artifact.hint`, which `PermissionMatrixEditor` still draws. No table names the organization axis; lit control that it names the environment overlay in every table; lit control that `t()` serves the value the extractor read, for every declared locale. - `PackageFormDialog.newAppStep-36748.test.tsx`: the three `BuilderLanding.newAppDoor-36748` cases, moved onto `PackageFormDialog` with `newApp={newAppStep(client, locale)}`, mounted as the home mounted it (create mode, Studio on the new package after save): the dialog worded for an app in zh; package POST, app draft, app publish, then the Studio header names the app and 「‹ Back to app」 opens it; a taken app name refuses the confirm and writes nothing. - `PackageCustomizationsPanel.test.tsx`: the rows and counts, including the **objectstack-ai#36833 arrangement-only case**; the empty and failed states (never "0"); row and switched-off-action links; tabs, search and Show all; zh words; and the moved rows and labels io. - In the `PackagesPage` administration-face harness, two describes: "the new-package deep link" (3 cases) and "a read-only base's customizations in its detail" (6 cases: a code package draws the section with arrangements counted; an authored package does not; the development face does not; a read-only `.custom` pair draws none and sends no customizations request; a kernel package's detail, opened directly because the admin face lists none, draws none and sends no request; CONTROL, the same direct render of a code package draws it and reads once). - Unreported capability set on the doors: `HomePage.noAgentsBuildChip-26614` renders Home inside the real `MePermissionsProvider` with an authenticated answer that carries no `systemPermissions`; the chip opens Setup's New Package (the fail-open). CONTROL, the same provider with a reported set holding `manage_metadata` alone: the chip opens `/studio/~all/metadata`. - Studio-only author on the doors outside Studio: `SidebarAppMenu-36112` (「New blank app」 links to `/studio/~all/metadata`) and `HomePage.noAgentsBuildChip-26614` (the chip navigates there, never to Setup); `StudioEntryRedirect.test` holds `newPackageDoorPath` to the same two answers. - `SidebarAppMenu-36112` (the shared harness, new top-level describe): with build and ask, the legacy build id, ask only, other agents only, or no agent served, 「Add app」 offers `new-in-studio` ("New blank app", to New Package), the template and the marketplace, and never 「Build with AI」; never empty for an admitted viewer with authoring but no marketplace, or a marketplace but no authoring; CONTROL, with neither the viewer is not admitted; guard, an admitted viewer handed no entries gets no 「Add app」 and no separator. `HomePage.desktopNoApps-36732`: the no-apps doors are `[new-in-studio, template, marketplace]` with the build agent served. - Converted, not deleted: the StudioRoute gate, lazy-module, recent-visit and access-notice pins; `studio:builder` registration (now a forward); `setupMetadataRedirect`; `studioAddress` and its guard (the guard no longer names the deleted `STUDIO_LANDING_PATH`); the Home, sidebar 「Add app」 and `/ai` deep-link hrefs; the vocabulary census; `consoleTopBar.height-12639`; `AppContent.setupMetadataStudio-28578`. <details><summary>Local runs at this round's heads</summary> **Rework 2, objectstack-ai#37169's merge, head `54e4586e`** (after merging `origin/main` `4fb03ebb`, K 9, and `pnpm --filter '@object-ui/console^...' build`, lock VERDICT command-exit 0): - vitest over app-shell `views/studio-design`, `console/home`, `console/ai`, `console/__tests__`, `layout/`, `hooks/`, `PackagesPage*` and `PackageFormDialog*`, plus console `components/`: Test Files 826 passed (826); Tests 6948 passed; lock VERDICT command-exit 0. - type-check `@object-ui/app-shell` (src + `tsconfig.test.json`) and `@object-ui/console`: exit 0. eslint on the two touched test files: exit 0. - Exit 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost), and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources and the three vi-mock gates. - The full `check:platform-checklist` exits 1 on one finding, and `origin/main` `4fb03ebb` fails the same way: `automation.json` anchors `FlowItemMoreMenu.tsx#FlowItemMoreMenu`, which objectstack-ai#37169 removed. That is main's to fix, not this PR's. **Rework 2 (delta L1 S1, N4, N5), head `cf77ecb9`** (after merging `origin/main` `4ed453dc`, K 12, clean, and `pnpm --filter '@object-ui/app-shell^...' build`, lock VERDICT command-exit 0): - vitest over `console/home`, `console/ai`, `RequireAiSurface`, `AppContent.setupMetadataStudio-28578`, `setupMetadataRedirect.test`, `PackageCustomizationsPanel.test`, `StudioEntryRedirect.test`, `SidebarAppMenu-36112` and `hooks/`: Test Files 210 passed (210); Tests 1827 passed; lock VERDICT command-exit 0. - Mutation through `scripts/ablation-replace.mjs`: `useNewPackageDoorPath` made to fail closed (`Array.isArray(systemPermissions) && hasCapabilities(…)`) → `HomePage.noAgentsBuildChip-26614` 4 failed / 12: the new unreported case, plus the three no-agent cases whose stub leaves `systemPermissions` undefined; the reported-set control stayed green. Restored to the HEAD blob, `git diff HEAD` empty. - type-check `@object-ui/app-shell` (src + `tsconfig.test.json`): lock VERDICT command-exit 0. eslint `--no-inline-config` on the 4 touched ui files: exit 0. - Exit 0: check:platform-checklist, `check-platform-checklist --changed-from origin/main` (4 anchored files, 11 anchors, 0 lost), check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:issue-citations, and under `ui/` check:i18n-keys, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. `git grep -n "Studio landing" docs/qa/platform-checklist/areas`: history entries only, plus `studio-authoring.json:35` and `:2290`, already stale on main (the studio-home button). - overlap-check: exit 1, only for objectstack-ai#37249 and objectstack-ai#37169 (objectstack-ai#37169 has since landed; see Overlaps). **Third part (seat answers to N1 and N3, then objectstack-ai#37241's and objectstack-ai#37168's merges), final head `1c7f29cc`:** - After merging main with objectstack-ai#37241 and objectstack-ai#37168 (`2ae0823f`) and rebuilding (VERDICT command-exit 0): `views/studio-design`, `layout/`, `console/docs`, `console/home`, `console/ai`, `console/__tests__`, `hooks/`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, console `components/` and `pages/`, `packages/i18n/src/__tests__`: Test Files 1162 passed (1162); Tests 10870 passed, 13 skipped; VERDICT command-exit 0. type-check `@object-ui/i18n`, `@object-ui/app-shell`, `@object-ui/console`: VERDICT command-exit 0. Exit 0 at this head: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, check:issue-citations, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, `check-platform-checklist --changed-from origin/main`, and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources, check:phantom-deps, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. - After a fresh closure build (VERDICT command-exit 0): `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `hooks/`, `StudioEntryRedirect*`, `notFound-26708`, console `StudioRoute*`: Test Files 376 passed (376); Tests 3153 passed; VERDICT command-exit 0. - Mutation through `scripts/ablation-replace.mjs`: `useNewPackageDoorPath` forced to the Setup path (`true || hasCapabilities(…)`) → 2 failed / 43, exactly the two Studio-only door cases; restored to the HEAD blob, `git diff HEAD` empty. - type-check `@object-ui/app-shell` and `@object-ui/console`: VERDICT command-exit 0. eslint on the 7 touched files: 0 errors. Exit 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, and under `ui/` check:i18n-keys, check:i18n-drift, check:unreferenced-sources, check:phantom-deps, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape. **Second part of the round (the 「Add app」 rulings, then three main merges), head `64e7071b`:** - At `048a5a84` (rulings + first merge): `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `hooks/`, `packages/i18n/src`, `PackageCustomizationsPanel`, console `StudioRoute*`: Test Files 486 passed (486); Tests 5161 passed, 13 skipped; lock VERDICT command-exit 0. - At `fe78cd2b` (after objectstack-ai#37185's merge), the overlap: `views/studio-design`, `layout/`, `console/home`, `console/ai`, `console/__tests__`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `sameServerFetch*` (objectstack-ai#37185's ratchet), `apps/console/src/components`, `packages/i18n/src`: Test Files 1 failed, 888 passed (889); Tests 2 failed, 8291 passed. The failures were two cases of `layout/__tests__/designModeMenuSave-36363`, a file this branch does not touch; run alone it read 47 passed (47), and it passed again in the run below, so it was load in the big run. - At `45e4a5eb` (after objectstack-ai#37204's merge and a rebuild): `apps/console/src/components`, `layout/`, `console/home`, `console/ai`, `RequireAiSurface`, `packages/i18n/src/__tests__`: Test Files 436 passed (436); Tests 4837 passed, 13 skipped; lock VERDICT command-exit 0. (A first attempt at this run hit a 590 s cap before its verdict and is not counted.) - Mutation checks through `scripts/ablation-replace.mjs` (blob moved, restored to the HEAD blob, `git diff HEAD` empty): the hook's entry key back to `build-with-ai` → `SidebarAppMenu-36112` 7 failed / 32; the empty-list guard removed (`offerAddApp = mayAddApp`) → 1 failed / 32, the guard case. - CI on `45e4a5eb` failed `Type Check UI` at `check:i18n-keys`: Home's chip kept `defaultValue: 'New in Studio'` against the new en value. Fixed at `64e7071b` with the chip's default and the eight packs (`check:i18n-drift`); locally at `64e7071b`, exit 0: `check:i18n-keys`, `check:i18n-drift`, and the job's other static steps (`check:phantom-deps`, `check:self-import`, `check:unreferenced-sources`, `check:doc-example-readers`, `check:side-effects-array`, `check:spec-symbols`, `check:icon-record-names`, `check:designer-field-key-parity`, `check:action-forward-parity`, `check:esm-specifiers`, `check:handler-key-reads`, `check:metadata-write-doors`, `check:control-bytes`, `check:shell-escape-residue`, `check:vi-mock-specifiers`, `check:vi-mock-inherit`, `check:vi-mock-override-shape`, `check:test-path-roots`, `check:prompt-keys`), plus `check:keyed-text-bounds` and `check:i18n-stale-fill`. Vitest over `packages/i18n/src`, `console/home`, `console/ai`, `RequireAiSurface`, `SidebarAppMenu-36112`: Test Files 213 passed (213), Tests 2745 passed, 13 skipped, lock VERDICT command-exit 0. - type-check at `45e4a5eb` after `pnpm --filter '@object-ui/console^...' build` (VERDICT command-exit 0): `@object-ui/i18n`, `@object-ui/app-shell` (src + `tsconfig.test.json`), `@object-ui/console` passed, VERDICT command-exit 0. eslint `--no-inline-config` on this part's 6 ui files: 0 errors. - Gates at `45e4a5eb`, all 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, check:issue-citations, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost). `pnpm --filter @object-ui/i18n gen:zh-hant` after the merges: every target already current. - 18.6.0 studio-namespace comparison at `fe78cd2b`, unchanged: 71/71 published landing keys present in `en` and `zh`; 35 missing, all already missing on main; 0 values changed vs main, 4 never-released keys removed, 38 added. **First part of the round (L1 and contract-review fixes):** - Targeted vitest at `4121473e` (after the first main merge, K 26), one locked run over `apps/console/src`, `packages/i18n/src`, `views/studio-design`, `metadata-admin/PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `console/__tests__/AppContent*`, `console/home/__tests__/HomePage*` and `layout/`: Test Files 1 failed, 1050 passed (1051); Tests 1 failed, 10456 passed, 13 skipped. The failure was the moved new-app pin's own harness (it navigated to the bare package path, which only the console route table expands); fixed at `4121473e` by landing on the package's Studio home as the removed home did, then 3 passed (3). - After the second main merge (`df4a65cb`) and the guard fix (`329ddefc`), the overlap re-run under the lock: `views/studio-design`, `apps/console/src/components`, `PackagesPage*`, `PackageFormDialog*`, `PermissionMatrixEditor*`, `packages/i18n/src`, `consoleTopBar*`, `AppContent*`: Test Files 594 passed (594); Tests 6016 passed, 13 skipped; lock VERDICT command-exit 0. - Mutation checks, each through `scripts/ablation-replace.mjs` (anchor 1 → 0, blob verified moved, restored to the HEAD blob with `git diff HEAD` empty), at `4121473e`: - 「组织」 written into the zh `perm.readOnly.artifact.hint`: `PermissionMatrixEditor.readOnlyHintCopy-12171` 1 failed / 3 ("no table names the organization axis"). - `!isKernel` removed from the detail gate (`PackagesPage.tsx:1271`): 1 failed / 6, the kernel case only. - `!isCustomizationPackage(id)` removed: 1 failed / 6, the `.custom` pair case only. - The bookmark forward reverted to `SETUP_NEW_PACKAGE_PATH`: `StudioEntryRedirect.test` 1 failed / 11, the Studio-only bookmark case. - The not-found exit reverted to `SETUP_PACKAGES_PATH`: `notFound-26708` 1 failed / 14, the Studio-only case. No dist leg was needed: these tests import app-shell by relative path, and the ui vitest config aliases `@object-ui/i18n` to its `src`. - type-check at `329ddefc` after `pnpm --filter '@object-ui/console^...' build` (lock VERDICT command-exit 0): `@object-ui/i18n`, `@object-ui/app-shell` (src and `tsconfig.test.json`, which lists all six new or changed test files) and `@object-ui/console` passed, lock VERDICT command-exit 0. - eslint `--no-inline-config` on this round's 11 changed ui files: 0 errors, 15 warnings. - Gates at `329ddefc`, exit captured before any pipe, all 0: check:test-source-alias, check:nul-bytes, check:cross-package-test-inputs, check:i18n-stale-fill, check:keyed-text-bounds, check:platform-checklist, `check-platform-checklist --changed-from origin/main` (11 anchors, 0 lost). At `4121473e`, also 0: check:issue-citations, check:doc-authoring, check:gitlink-declared, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration (2 non-breaking changesets), check-closing-keyword-parity, check:changeset-gate-self-tests, and the edited `ui/scripts/check-eager-closure-budget.mjs`'s tests (6 files, 305 passed). `check:i18n`: PREREQUISITE NOT MET locally (the CLI build closure is not built); it reads the platform translation bundles, which this round does not touch; its evidence is CI. `dispatch-gates --ran`: 57 of 74 derived families not run locally, declared; their evidence is this head's check-runs. - **i18n against the published `@object-ui/i18n@18.6.0`** (`npm pack`, read by AST, nothing evaluated), on the merged tree: all 71 published `engine.studio.landing*` keys are present in `en` and `zh`; 35 published keys are missing at this head and all 35 are already missing on `origin/main`; against `origin/main` this PR changes 0 values, removes exactly the four never-released keys, and adds 38 per language (`engine.packages.customizations.*`, `engine.studio.notFound.packageList`, `engine.studio.notFound.allMetadata`). </details> ## Acceptance notes - The environment-wide list the home drew across all installed apps (one list, a total, grouped by app) is now shown per app only, in each read-only base's detail in Setup → Packages. - "Customized" now has two meanings. The Setup detail counts tab, field-group and action-layout arrangements with overrides and extensions; the All metadata header still draws `customizationTotal` (overrides + extensions, `customizationMarks.ts:96-97`, drawn at `DirectoryPage.tsx:246-249`), and the same total gates the list filters in `ResourceListPage` and `useListOrderedNames`. Not aligned here: adding arrangements to that total would stop the header equalling the sum of its per-type tiles and change which lists offer the customized filter. Not aligned here (seat answer A): follow-up card filed: objectstack-ai#37236. objectstack-ai#37236 has since been ruled B (7158100447): 「已定制」 stays overrides + extensions, and the Setup detail's count changes there to match. Until it lands, the Setup detail counts arrangements as described here. - The new-package doors outside Studio (Home's no-agent chip, the `/ai` screen's door, 「Add app」's 「New blank app」 and with it the no-apps screen) make the same choice as Studio's entry, through `useNewPackageDoorPath` (seat answer to N1): Setup's New Package for a holder of `setup.access` + `manage_platform_settings`, the All metadata area for an author who may enter Studio but not open that page. They sit outside the entry gate's provider, where `useStudioEntryPermissions` holds nothing, so they read the session's own `usePermissions().hasCapabilities`, which fails open on an unreported set as the doors' own authoring gate does (the Setup app still refuses a non-holder). That is the doors' doctrine, judged A in contract review 7162083002 ④: the door is only a link, and the server still refuses a package create without `manage_metadata` (`package-routes.ts:102-106`). Pinned by the unreported-set case in `HomePage.noAgentsBuildChip-26614` (the real `MePermissionsProvider`, no `systemPermissions`, the chip opens Setup's New Package; control: a reported set without the pair opens `/studio/~all/metadata`). - A Studio-only author (`studio.access` + `manage_metadata`, without the Setup pair) has no screen that creates a package at this head: 「New blank app」 opens All metadata, which has no New Package, where on main the same door opened the dialog inside Studio. The server still admits the create. This follows ruling N1 (a), and waits for objectstack-ai#37134 / objectstack-ai#37139. - Two console test files pinned only the home's frame and are deleted: `StudioRoute.landingI18n.test.tsx` (its header crumb) and `StudioRoute.searchPalette-11863.test.tsx` (⌘K on the home; ⌘K inside Studio is objectstack-ai#36900). The other StudioRoute pins now stub the entry. - Duplicate pins named for deleted tests (AGENTS.md, ruling 6120820653): the new-package deep link is pinned in the `PackagesPage` admin harness; the customization counts, rows and labels in `PackageCustomizationsPanel.test.tsx`; the org-scope entry by `StudioDesignSurface.packageLessFlows-11553` and the menu pins from objectstack-ai#36899; the permission hint copy and the new-app step moved, above. The home's own layout, ordering, Duplicate form, recent cards and Manage pins have no remaining surface to pin. - Possibly orphaned now that the frame is gone, not removed here: `AppHeader` `variant="studio"` and `CommandPalette` `scope="studio"` (objectstack-ai#36900 may reuse the scope). - 「Build with AI」 is gone from the 「Add app」 menu and the no-apps screen (ruling 7153161067). Home's 「Build an app」 chip still targets bare `/studio`, and Home's own 「Build with AI」 drawer button is untouched; objectstack-ai#37227 / objectstack-ai#37249 removes both from Home. - The kept-unread released studio keys stay as they are this round (the seat made dropping them optional under the 19.0.0 ruling); `home.buildWithAI` is still read by Home and is untouched. - Recents are read local-first, and the server copy arrives after first render (`RecentItemsProvider`). On a device with no local copy, `/studio` falls back before that copy arrives; "opens the package you were last in" holds on a device that already has it. - The 68 published landing keys are kept and unread. `check-i18n-dead-keys` (report-only, not in CI) will list them as candidates, and a later change can decide to retire them. - `docs/qa/platform-checklist/FOLLOW-UPS.md` still names `BuilderLanding` in a dated follow-up entry; it is a log and was left as written. ## Verification Walked on a live stack at `a21c7b6f` (the previous head). Server: `pnpm -C examples/app-showcase exec objectstack dev --seed-admin -p 4710` (CLI and showcase closure built in a worktree). Console: this branch's `ui/apps/console` under Vite on 4711, proxied to it. Signed in as the seeded admin and driven with Playwright; key screens confirmed by screenshot. | Entry | Observed | |:---|:---| | `/studio`, nothing remembered | → `/apps/com.objectstack.setup/component/developer/packages?face=admin` | | `/studio?new=package` (old bookmark) | → same page, `new=package` dropped, New Package dialog open | | `/apps/setup/component/automation/packaged-actions` (no package) | → Setup → Packages (admin face) | | `/studio/no_such_pkg_36908` | 「Package not found…」 with 「Open the package list」 → Setup → Packages | | ObjectStack Showcase (code) row → detail | "Customizations in this environment", "No changes in this environment yet", Customize in Studio → `/studio/com.example.showcase/data` | | `/studio` after visiting that package | → back into `/studio/com.example.showcase/data…` (remembered) | | Sidebar app menu → 「Add app」 | New in Studio (the label at `a21c7b6f`; 「New blank app」 now) → `…packages?face=admin&new=package`; clicked, it lands there with the dialog open | | `/ai` (no assistant on this stack) | 「New in Studio」 (the label at `a21c7b6f`; 「New blank app」 now) → `…packages?face=admin&new=package` | | New Package dialog → Create package | → `/studio/com.default.walk-pkg-36908/data` | | That authored package's detail | no customizations section (count 0); Open in Studio present | | `/studio/~all/metadata` | renders the All Metadata Types area | Not walked live, each pinned by unit tests: - Home's 「New blank app」 chip (「New in Studio」 at `a21c7b6f`): its condition does not hold on this seeded stack (`HomePage.noAgentsBuildChip-26614`, `HomePage.desktopNoApps-36732`). - A non-administrator's landings (bare `/studio`, the old bookmark and the not-found button for a Studio-only principal): no such principal is seeded (`StudioEntryRedirect.test.tsx`, `StudioDesignSurface.notFound-26708`); their target `~all` renders above. - `studio:builder`: the `@objectstack/studio` app does not load on a stock boot (`registerStudioComponents.builderLazy-11798`). This round's changes were not walked live: the Studio-only exits, the moved pins and the changesets change no administrator-visible entry above; the 「Add app」 menu's new contents (no 「Build with AI」, 「New blank app」 always) and the relabel are pinned in `SidebarAppMenu-36112` and `HomePage.desktopNoApps-36732`. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkEULEjF814KSPBLVC)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…s UI language (objectstack-ai#37543) <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgTACWfLyuZEQ4gVESvk5YRQ)_ Part of objectstack-ai#37483 ## What changes Test-only. Two pins hold every approvals reader and the notification inbox read to the console's authenticated fetch, which sends the active UI language as `Accept-Language`: - `ui/packages/app-shell/src/hooks/__tests__/approvalsUiLocale-37483.test.tsx`: the approval history read (`listApprovalActions`, `/approvals/requests/:id/actions`), `remindApprovalRequest`, `fetchPendingApprovalPage` (bell, home, full-page inbox), and the notification inbox: the real `AdapterProvider` mounted with `useSharedInboxFeed`, asserting the header on its `sys_inbox_message` read. - `ui/apps/console/src/services/approvalRequestsDataSource.uiLocale-37483.test.tsx`: the request page's history (`sys_approval_action` timeline) and request read (`process_label` / `step_label`) through `routeApprovalRecordReads(adapter)`, as `AppContent` wires it. Each pin sets `<html lang="en">` and asserts `Accept-Language: en`. The controls are on the stamp itself: an empty `<html lang>` adds no header rather than a guessed one. ## Why The card was measured on the 18.6.0 bundles. On `main` the shared helper the card suggests already does the job: `createAuthenticatedFetch` (`@object-ui/auth`) stamps `<html lang>` as `Accept-Language` on every `/api/` call, and the readers it names now go through it: - `useRecordApprovals` (`fetchJson`: request, actions, remind) and `sharedUserFeeds` (`fetchPendingApprovalPage`) moved from a bare `fetch` + `bearerAuthHeaders()` to it in objectstack-ai#37185 (merged 2026-11-25, after 18.6.0). - `approvalsApi.ts` and `approvalRequestsDataSource.ts` have used it since objectstack-ai#27040 / objectstack-ai#28619. - The inbox (`sys_inbox_message`, `sys_notification_receipt`) reads through the console adapter, which `AdapterProvider` builds on the same fetch. So no source change is needed for approval history; what was missing is a pin that keeps these surfaces on that transport. Ablation: replacing the stamp in `createAuthenticatedFetch` with a no-op turns all six positive pins red, controls stay green; building `AdapterProvider`'s adapter on a bare `fetch` turns the inbox pin red. **Why `Part of`, not `Fixes`:** the inbox read already went through the stamped adapter at 18.6.0, so "fixed after 18.6.0" does not explain the inbox evidence in comment 7186322473. The card stays open until a header capture of `GET /api/v1/data/sys_inbox_message` on a `main` build settles it (reported on the card). ## Verification - `pnpm --dir ui exec vitest run packages/app-shell/src/hooks/__tests__/approvalsUiLocale-37483.test.tsx apps/console/src/services/approvalRequestsDataSource.uiLocale-37483.test.tsx`: 9 passed. - Ablations above: 6 failed / 3 passed with the stamp removed; inbox pin red with the adapter on a bare `fetch`. - `eslint` on both files: clean. `check:commit-card-trailers`, `overlap-check`: clean. Publishes nothing (test files only), so `skip-changeset`. Clause-②: no Metadata-protocol: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CbGtuQD4c5iyX7mqpV <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbGtuQD4c5iyX7mqpV --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…, and the fetch ratchet follows a fetch alias (objectstack-ai#37654) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDJAbBe3iTrFcF7GZrucZ32)_ Fixes objectstack-ai#37242 ## What changes - **N4 — the AI chat page's object read.** `appOfObject` (which app a record hand-off from the chat opens under) moves out of `AiChatPage.tsx` into `app-shell/src/console/ai/appOfObject.ts` and reads `/api/v1/meta/object/<name>` through `createAuthenticatedFetch()`, keeping `credentials: 'include'`. `AiChatPage.tsx` imports it; its three call sites are unchanged. The `AiChatPage.tsx` row leaves the shrink-only allow-list of `sameServerFetch.bearer.ratchet.test.ts` (its reason, an open PR on the file, no longer held). - **N1 — the ratchet sees through a fetch alias.** `bareCookieOnlyCalls` now also counts a call through a local name bound to the global `fetch`: - `const f = fetch` (or `window.` / `globalThis.` / `self.fetch`) counts in every scanned tree; - a name bound to a `?? fetch` / `|| fetch` fallback (`const doFetch = opts.fetchImpl ?? fetch`) counts in app-shell and the console only. ## A decision made here The fallback form is **not** followed in the renderer packages. There `const doFetch = apiFetch ?? fetch` is the documented channel (the ratchet's own header: the host's `apiFetch`, falling back to the global `fetch` only in a host that mounts none), and following it everywhere flags 17 conforming sites (`ShareDialog`, `ObjectChart`, `MePermissionsProvider`, `queueClaim`, `useRowApprovalLocks`, …). App-shell and the console build `createAuthenticatedFetch` per call, so there a `?? fetch` name is the bare fetch under another name. The header says so, and the detector's case table pins both sides (a renderer-tree `apiFetch ?? fetch` name reads 0, a plain alias reads 1). ## Why `objectstack-ai#37185` moved the shell's same-server calls onto the authenticated fetch and added the ratchet. Its L1 left two follow-ups: the ratchet did not see `flowDraftChecks.ts`'s `doFetch` alias, so reverting that conversion stayed green; and the chat page's object read was still cookie-only, so under a bearer-only session every record hand-off from the chat fell back to the Setup shell. ## Verification - Ablations against this head (each restored after): - `flowDraftChecks.ts:104` back to `opts.fetchImpl ?? fetch` — on `main` the ratchet stays 4/4 green; here it goes red, naming `flowDraftChecks.ts:114 :: doFetch(…)`. - `appOfObject.ts` back to the bare `fetch` — red, naming `appOfObject.ts:19 :: fetch(…)` (no row allows it). - New `console/ai/__tests__/appOfObject.bearerSession-37242.test.ts`, against a server that answers only the bearer: with a token stored the read carries `Authorization: Bearer <token>` beside `credentials: 'include'` and returns the owning app; CONTROL, no token: the read goes out cookie-only and falls back to `setup`. - `pnpm --dir ui exec vitest run` over `packages/app-shell/src/console/ai/`, `packages/app-shell/src/preview/` and the ratchet: 780 tests green; the ratchet re-run on this head (rebased on `main` bdbe01e): 4/4. - `type-check` for `@object-ui/app-shell`: clean. `eslint` on the changed files: 0 errors. - `overlap-check`: exit 0. Clause-②: no Metadata-protocol: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `eslint` on the changed files passes (the full `pnpm lint` runs in CI). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (full local suite not run; CI carries it) --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUuauSMJu1nVSQRQri Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37080
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Same-server
/api/reads and writes in app-shell and the console that called the bare globalfetchwithcredentials: 'include'(the session cookie and nothing else) now go throughcreateAuthenticatedFetchfrom@object-ui/auth, exactly as #37077 did for the Setup pages: built per call (createAuthenticatedFetch()(input, init), a localauthFetchin each module),credentials: 'include'kept on every call, so the cookie still rides along and a401now reaches the console's session-ended check. No second auth-fetch helper and no new export. Nothing changes in what the server accepts.The measured case: under a bearer-only session,
readPackagesPayload(GET /api/v1/packages, the session's held package list read by the sidebar, the app header, the command palette and the Studio entries) sends the bearer and the list loads (pinned below).The family, measured at
origin/main63ab47979 non-test files under
ui/packages/app-shell/srcandui/apps/console/srccontaincredentials: 'include'. Read call by call (AST scan of everycredentials: 'include'property and the call it is handed to):Converted here: 64 calls in 39 files.
app-shell/.../studio-design/packages-io.tsreadPackagesPayload(GET /api/v1/packages, the measured case),ensureCustomizationPackage,duplicatePackageapp-shell/.../studio-design/packageCustomizations-io.ts,PackageSwitcher.tsx,AutomationsPillar.tsx,FlowItemMoreMenu.tsxapp-shell/src/hooks/useConversationList.tsapp-shell/src/hooks/useChatConversation.tsapp-shell/src/console/ai/buildDebugApi.tsapp-shell/src/hooks/useAiUsage.tsapp-shell/src/services/suggestedBindingsApi.tsapp-shell/src/preview/commitHistory.tsapp-shell/src/preview/DraftChangesPanel.tsx,UnpublishedAppBar.tsx,usePendingDrafts.tsapp-shell/src/preview/flowDraftChecks.tsopts.fetchImpl ?? createAuthenticatedFetch())app-shell/src/views/changeOwner.tsapiFetch ?? createAuthenticatedFetch())app-shell/src/views/metadata-admin/PackageFormDialog.tsx,catalog-activation.ts,permission-set-clone.ts,sharing-rule-catalog.tsapp-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx,connector-input-fields.tsapp-shell/src/views/metadata-admin/previews/FlowRunsPanel.tsx,useFlowNodePalette.ts,PagePreview.tsxapp-shell/src/views/setup/packagedActionLedger.ts,packagedFlowLedger.tsapp-shell/src/hooks/useRecordApprovals.ts,sharedUserFeeds.ts,useInboxBell.tsapp-shell/src/console/AppNoAccessEmptyState.tsx,connect/ConnectAgentWidget.tsx,deployment-notice/deploymentNoticeState.tsapp-shell/src/console/marketplace/marketplaceApi.tsserverFetch(/cloud-connection/install,install-namespace,installation, and on the control plane its owninstall_packageaction and installed-state route)app-shell/src/layout/designModeMenuSave.ts/api/v1/i18n/locales)app-shell/src/layout/ContextSelectors.tsx{ sameOriginOnly: true }: the endpoint is author-written (optionsSource.endpoint) and may name another hostconsole/src/pages/developer/AgentConnectSection.tsx,IntegrationsPage.tsxconsole/src/pages/auth/DeviceAuthPage.tsxOf the card's named ones:
packages-io.tsreadPackagesPayload,useConversationList,useChatConversation,suggestedBindingsApiand the studio-design writes (ensure-customization, duplicate, customizations, flow clone) are all converted.suggestedBindingsApi,useRecordApprovals,sharedUserFeeds,useInboxBell,ConnectAgentWidget,deploymentNoticeStateand threemarketplaceApicalls already set the bearer header by hand (authHeaders/bearerAuthHeaders/withEnvAuth), so those were not cookie-only; they are converted anyway for the session-ended check and the one mechanism, and their hand-rolled header is left in place (the wrapper sets the same value).Already authenticated or injected (not the family): 24 files.
settings/api.ts,AuditLogPage.tsx,approvalsApi.ts,studioEntry.ts,ExcelImportBar.tsx,CloudAiModelStatus.tsx,useEnvironmentEntitlements.ts,storageUsageEndpoint.ts,ImpersonationBanner.tsx,useImpersonationExit.ts,RecordAttachmentsPanel.tsx,RecordDetailView.tsx,useConsoleActionRuntime.tsx,AccessExplainPanel.tsx,MetadataTypeActions.tsx,PackagesPage.tsx,DatasourceResourcePage.tsx,personalViews.ts,connectorConnections.ts,connectorCredentials.ts, and the injected transports ofmyPreferences.ts,slackDoors.ts,orgEnvironments.ts,useLauncherApps.tsx.App.tsxnames the string in a comment only.Left, on the pin's shrink-only list: 21 calls in 15 files, each with its reason in the pin (
sameServerFetch.bearer.ratchet.test.ts,ALLOWED):console/src/LocalizationFetchProvider.tsx(1) andconsole/src/languageSeed.ts(not counted by the pin: it handssharedGetJsona transport argument that may beundefined): the boot read of/api/v1/auth/me/localization, shared in flight by a key built from the init with the early requestindex.htmlsends. A session it cannot see readsauthenticated: falseand falls back to the browser language rather than failing. Its transport is its own decision (Acceptance notes).console/src/components/FormPage.tsx(1): the bare channel is the public form route's on purpose.console/src/lib/auth-preflight.ts,console/src/lib/early-discovery.ts(1 each): set the bearer header themselves on purpose.console/src/pages/auth/OAuthConsentPage.tsx(3),followAuthorize.ts(1),handoffClientName.ts(1): the OAuth hand-off, whose authorize step is a top-level navigation that can only carry the cookie.console/src/pages/auth/SetupPage.tsx,app-shell/src/console/auth/bootstrapStatus.ts,console/src/pages/auth/VerifyEmailPage.tsx,app-shell/src/chrome/ConditionalAuthWrapper.tsx,app-shell/src/runtime-config.ts(1 each): read before or without a session.app-shell/src/console/ai/AiChatPage.tsx(1): an open PR (feat(console): conversation focus — a pinned record in the chat request, shown as a chip, kept across navigation #37123) edits this file; its call moves with that work.app-shell/src/console/marketplace/marketplaceApi.ts(5): each targetsgetCloudBase() || SERVER_URL, the cloud control plane's own origin whenever one is configured, which must never see this runtime's bearer.app-shell/src/views/metadata-admin/previews/ActionPreview.tsx(1): the test request of anapiaction preview, sent to the author-written target; its transport is not decided here.The other two fenced files hold no family call:
RecordDetailView.tsxanduseConsoleActionRuntime.tsxalready route everycredentials: 'include'call through theirauthFetch. Neither was edited.Tests
ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts(new, the enumeration pin; runs in Test UI, app-shell'sunitproject): parses every non-test source file of both trees with the TypeScript parser and refuses a bare cookie-only call (the transport is the globalfetch,window.fetch,globalThis.fetch,self.fetch, one of those as a??/||fallback, orsharedGetJsonwithout its transport argument; the init carriescredentials: 'include', inline or as aconstof the file,as constincluded). The URL is not judged: a call that must stay bare is a counted row with its reason. Four cases: the scan reads both trees (more than 500 and 100 files); a 13-case detector battery (each bare spelling found, each authenticated one not); every bare call is a counted row; every row is still exact (a file that sheds a call must shrink its row).ui/packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts(new): against a server that refuses any request without the bearer, with a token stored,fetchPackagesloads the list and its one request carriesAuthorization: Bearer TOKENandcredentials: 'include';fetchListedPackageIdslikewise; the duplicate write, the commit timeline and revert, suggested bindings and the build-debug report carry the bearer. Each with a cookie-only control (no token stored: noAuthorization,credentials: 'include').Test doubles that moved (118 files, no assertion weakened):
Responsedoubles ({ ok, status, json }) gainheaders: new Headers(), the headers a realResponsecarries and the authenticated fetch reads (set-auth-token), as fix(console): Settings, Packages, Audit Log and the connector pages send the stored bearer token #37077 did. The 102nd,StudioPaletteGroups.surfaceScope-36900(the command-palette suite that reachedmainafter round 0), doublesGET /api/v1/packages: without the headers the convertedreadPackagesPayloadthrew on the double and the palette drew no Packages group. ForfetchInstalledPackageRow-7881andStudioDesignSurface.readOnlyPosture-12453the headers are added at the one stub instead of each answer.@object-ui/authmock answeredcreateAuthenticatedFetch: () => vi.fn()(a transport that answers nothing) now hand the authenticated fetch's requests to the globalfetchthe file already stubs: the fourRecordApprovalsPanelsuites andRecordDetailVieweditLockedByState-32756,phoneFace-27058,userActionPredicates,harness.RecordDetailViewapproval suites whoseauthFetchSpystands for the action door: approvals reads (now through the authenticated fetch too) are handed to the file's wire double, as before (approvalRecallGate,accessEndedAfterDecision-26589,approvalDeclaredActions,approvalLock-12220,approvalLock-25934).StudioRoute.searchPalette-11863(console): its auth mock answers the Studio permissions read and hands every other request (the package list) to the wire double.useConversationListandBuildDebugDrawerassert{ credentials: 'include', headers: expect.any(Headers) }(exact keys, as before);DraftChangesPanel.flowChecks-34818readsAccept-Languageoff aHeaders.RecordDetailView.headerApiInterpolation: the flow-trigger case asserts exactly one call to the trigger door, filtered by its path, since the page's own reads now share that spy.Acceptance notes
plugin-*hooks out unless measured here):credentials: 'include'with the barefetchremains inui/packages/plugin-chatbot(useAgents,useAiModels,useHitlInChat,usePendingActions),plugin-detail(queueClaim,stageChangeStarts,useRecordEditable),plugin-grid(useRecordCrudVerdicts,useRowApprovalLocks),plugin-dashboard(DatasetWidget),plugin-charts(ObjectChart),fields(ShareableObjectRefField,preferenceOptions),components(ShareDialog) andpermissions(MePermissionsProvider). Not each read call by call.fetch('/api/…')with no init at all is cookie-only as well (the defaultsame-origincredentials) and is outside the pin's spelling:views/metadata-admin/widgets.tsxfetchFieldSelectorOptions(GET /api/v1/objects/:name/fields).LocalizationFetchProviderandlanguageSeedread/api/v1/auth/me/localizationcookie-only; under a bearer-only session that read answers anonymously and the console falls back to the browser language instead of the user's own locale. Not measured in a browser; left because the request key is shared with the early requestindex.htmlsends.authHeadersinsuggestedBindingsApi,bearerAuthHeaders,withEnvAuth) are now redundant there; not removed here.Verification
The measured case and the pins (green at the head)
packages-io.bearerSession.test.tsand the ratchet are in the rerun below (all green). The ratchet's detector battery first went red on a real detector issue: at a script's top levelawait (x)(…)parses as a call ofawait, so the(apiFetch ?? fetch)case read 0; the cases now run inside an async function.Ablation: one conversion reverted, both pins red
Through
scripts/ablation-replace.mjsonpackages-io.ts: anchorconst res = await authFetch('/api/v1/packages', {hit 1 → 0, blobd3c93d771344→42f8862ba05e; the ratchet and the bearer-session file run under the lock:The cookie-only control stayed green. Restored: blob
d3c93d771344equal toHEAD,git diff HEADempty.Suites
The whole
@object-ui/app-shelland@object-ui/consolesuites, under the shared verify lock, in six shards (cd ui && pnpm exec vitest run --maxWorkers=3 --shard=k/6 packages/app-shell apps/console) at32505939(the final source; only test files changed after it). These are the readings BEFORE the doubles moved, and they are how the moved doubles were found:The 117 failing files are exactly the 117 moved doubles. Each was re-run after its fix (the two new pin files with them):
Test Files 116 passed | 3 failed (119), then the three fixed againTest Files 3 passed (3). After the last two type fixesTest Files 2 passed (2), and after the collection-time imports the 34 files that gained oneTest Files 34 passed (34)/Tests 319 passed (319), at5dde589a8c. The 2,655 files that passed in the shards were not edited. A full re-run after the fixes was not done locally (NOT MEASURED, reason: about 90 minutes of shared lock); Test UI runs the full affected set on this PR.Type-check through turbo (dependency closure built):
@object-ui/app-shelland@object-ui/consoletype-checkTasks: 77 successful, 77 totalat3080a68173;@object-ui/app-shellagain at5dde589a8cafter the last test edits,Tasks: 69 successful, 69 total. The first run found two type errors in my test edits (a typed tuple, an object literal against a declared parameter type), fixed in3080a68173.pnpm --dir ui exec vitest run scripts/after building the seven@objectstackpackages as Test UI does:Test Files 172 passed | 2 skipped (174),Tests 5131 passed | 2 skipped (5133).Gates
node scripts/pm/dispatch-gates.mjs --commands(no paths, merge base63ab4794): 39 families. All 39 run locally, each exit captured before any pipe; 37 lock-free families re-run at5dde589a8c, all exit 0;pnpm check:type-check-debtexit 0 (0 raw tsc error(s) total, none above its recorded number); the uiscripts/suite above exit 0. Reconciled:dispatch-gates --ran:39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero).check:test-source-aliasfirst went red on the edited suites (exit 1): 34 of them reach a dynamicimport('@objectstack/lint'),import('@objectstack/formula')orimport('@object-ui/plugin-detail')in the source under test with no collection-time load. Each gained the module-top side-effect import the gate prescribes (5dde589a8c), then exit 0.overlap-checkbefore every push: at4a990ef7it merges cleanly withorigin/main(93bd4595) and with #37204, #37188 and #37148, and exits 1 on textual conflicts with three open Studio PRs that edit the same test files: #37166, #37168, #37169 (inStudioDesignSurface.*,BuilderLanding.*,CommandPalette.studioScope-11863,StudioRoute.searchPalette-11863, and #37166/#37169 also inPackageSwitcher.tsx,FlowItemMoreMenu.tsx). Whichever lands second takes the merge.Round 1: main merged at 3b4f0b9, re-measured at e055596
CI at
5dde589awas red on two causes, both frommainmoving (the ⌘K palette work):check:test-source-aliasexit 1: four edited suites (StudioDesignSurfaceentryReadsOnce-11797,itemDraftLine-12725,notFound-26708,readOnlyPosture-12453) now reachimport('@object-ui/plugin-detail')through the surface's command palette and its record preview. Each gained the prescribed module-topimport '@object-ui/plugin-detail';(38 files carry a collection-time import in all). Then exit 0.StudioPaletteGroups.surfaceScope-36900: 3 failed, 8 passed; after its package-list double gainedheaders(above), 11 passed. No assertion changed.Readings at
e0555965, under the shared verify lock:The one failing file is
ReportNewPage-36692.test.tsx, which this branch does not touch (nor its page); it passed 3 of 3 runs alone (Tests 6 passed (6)each). Its second failure received the first case's save call, late: its cases flush bysetTimeout(0)rounds while the page loads its Han romanizer lazily, so on a loaded box the save can land after the case ends.@object-ui/app-shelltype-checkthrough turbo:Tasks: 69 successful, 69 total.pnpm --dir ui exec vitest run scripts/:Test Files 172 passed | 2 skipped (174),Tests 5131 passed | 2 skipped (5133).Gates:
dispatch-gates --commands(merge base3b4f0b98): 39 families, all run, each exit captured before any pipe, all exit 0.check:type-check-debtfirst answered exit 3 (its closure build queued behind the suite above and never got the lock: not measured), then exit 0 under the lock (0 raw tsc error(s) total, none above its recorded number).dispatch-gates --ran:39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero …).Read first
ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts: the detector and theALLOWEDrows (each reason is a claim about a call left bare).ui/packages/app-shell/src/layout/ContextSelectors.tsx: the one conversion withsameOriginOnly, because its URL is author-written.ui/packages/app-shell/src/console/marketplace/marketplaceApi.ts: which calls moved ontoserverFetchand which stay bare because they may target the cloud origin.Two-minute check:
cd ui && pnpm exec vitest run packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts packages/app-shell/src/views/studio-design/packages-io.bearerSession.test.ts, expectTest Files 2 passed (2).Round 2: main merged at 93bd459, re-measured at 4a990ef
mainafter round 1 and left this PR conflicting inStudioDesignSurface.notFound-26708andStudioDesignSurface.readOnlyPosture-12453: both sides add the sameimport '@object-ui/plugin-detail';with a different comment. The merge (48321c62) keeps one import withmain's comment, so againstmainthose two files differ only by round 0's doubles.credentials: 'include'line underui/packages/app-shell/srcorui/apps/console/src, and their one new hand-rolled Response double already carriesheaders: new Headers().4a990ef7) now name every converted door in user terms (flow clone, permission-set clone, page preview, the no-access state and the design-mode language list were missing) and claim only "the other same-server console requests", since the 21 listed calls stay cookie-only.Readings at
4a990ef7, under the shared verify lock (packages/specmoved onmain: the seven@objectstackpackages Test UI builds were rebuilt first, andpnpm --filter @objectstack/spec check:generatedreadsAll 14 generated artifacts are up to date):check:test-source-aliasexit 0.@object-ui/app-shelltype-checkthrough turbo:Tasks: 69 successful, 69 total.dispatch-gates --commands(merge base93bd4595): the same 39 families, all run, each exit captured before any pipe, all exit 0 (check:type-check-debt:0 raw tsc error(s) total, none above its recorded number; the uiscripts/suiteTest Files 172 passed | 2 skipped (174)).dispatch-gates --ran:39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero …). The whole app-shell and console suites were not re-run this round (NOT MEASURED, reason: about 70 minutes of shared lock for a merge that changed no source line of this PR); Test UI runs the affected set on this PR.Generated by Claude Code