Skip to content

feat(studio): remove the Studio home; /studio opens the last package or Setup > Packages - #37166

Merged
os-zhuang merged 32 commits into
mainfrom
claude/issue-36908-remove-studio-home
Nov 25, 2026
Merged

os-zhuang merged 32 commits into
mainfrom
claude/issue-36908-remove-studio-home

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Fixes #36908
Clause-②: no
Metadata-protocol: none

维护者速读

What changes

Epic #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 (#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 #37134.
~all / ~org cards Already in the left menu (#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 #36833's requirement in the panel's new home; #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 #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 #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 #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 #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 #36890 this lands as one PR, reviewed by the maintainer after L1.

Overlaps (overlap-check at 54e4586e, against origin/main 4fb03ebb, exit 1 for #37249 below): origin/main merges cleanly. This round merged main six times: cf77ecb9 (K 12) was clean, and 54e4586e (K 9, with #37169) is resolved below. Resolved:

Still open; whichever lands second merges main and resolves:

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 Studio 首页的定制数量不计页签排列:只有排列定制的包显示为未定制 #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.
Local runs at this round's heads

Rework 2, #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 feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #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 fix(app-shell)!: Home no longer offers Build with AI or Build an app #37249 and feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 (feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 has since landed; see Overlaps).

Third part (seat answers to N1 and N3, then #37241's and #37168's merges), final head 1c7f29cc:

  • After merging main with feat(console): the docs portal draws in an app-less variant of the app shell from 768 px up #37241 and feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #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 fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token #37185's merge), the overlap: views/studio-design, layout/, console/home, console/ai, console/__tests__, PackagesPage*, PackageFormDialog*, PermissionMatrixEditor*, sameServerFetch* (fix(app-shell,console): the shell package list, AI chat lists and studio-design reads and writes send the stored bearer token #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 fix(console): on a desktop the way-home controls name the app start page, and the pill drops its duplicate All apps row #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).

Acceptance notes

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

Studio's entry no longer draws the package-card home: it opens the package
the author was last in, else Setup > Packages (or the All metadata area for
a principal who may not open it). The console's new-package doors land on
Setup > Packages with New Package open (?new=package on the admin face), and
the not-found state and the retired Setup redirects that name no package
land on the package list. WIP: the BuilderLanding page and its tests are not
deleted yet.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
The StudioRoute pins now stub the entry instead of the package-card home;
the two files that pinned only the home's console frame (its header crumb
and its command palette) are deleted; studio:builder's registration test
reads the forward to /studio; the not-found pin opens Setup > Packages.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
Setup > Packages' admin face now owns that deep link, pinned in the
PackagesPage administration-face harness.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
…Packages

BuilderLanding, its tests and its dead engine.studio.landing.* strings
are deleted. A read-only base's detail on Setup > Packages' admin face
now draws what this deployment changed on it (the home's per-app line
and Customizations panel), counting tab arrangements as customizations,
with a Customize in Studio link. Stale references are re-pointed.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects, touching 1 documentable anchor(s).

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

  • content/docs/permissions/authorization.mdx (via /studio/:packageId/:tab (route, a path literal in a comment in navigation))
What this run could not see

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

Which tree this was computed on

This run read content/docs from 00c64454f883d25f70fb5f463b378d8c6012e781 — the merge of head 54e4586edffc4227ca75e2bf69adad4131d510d6 into base 08bf7d2a41a754c601af90281446acf38c3169ec, which is what actions/checkout gives a pull_request run. Not the PR head.

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

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 00c64454f883d25f70fb5f463b378d8c6012e781 && git checkout 00c64454f883d25f70fb5f463b378d8c6012e781
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 08bf7d2a41a754c601af90281446acf38c3169ec 54e4586edffc4227ca75e2bf69adad4131d510d6 && git checkout -B drift-repro 08bf7d2a41a754c601af90281446acf38c3169ec && git merge --no-ff 54e4586edffc4227ca75e2bf69adad4131d510d6

node scripts/docs-audit/affected-docs.mjs --json 08bf7d2a41a754c601af90281446acf38c3169ec

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

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

…nd pin

check:test-source-alias: the pin reaches import('@object-ui/plugin-detail')
through the command palette; the home-loop pin is left as main has it.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H
…ensus

The census listed StudioRoute.tsx as a literal copy of the bar; that frame
went with the Studio home. Five frames remain, all token or AppShell.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYoTgerzGuKa8DDrMii
68 of the deleted engine.studio.landing keys and landingHome ship in
@object-ui/i18n 18.6.0; removing a published key is a narrowing. They
return to en and zh unread. The four never released stay removed.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYoTgerzGuKa8DDrMii
…tup > Packages

The retired page's no-package fallback opened the Studio home; with that
home removed it opens the package list on the admin face. The pin still
expected /studio. The named-package case is unchanged.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYoTgerzGuKa8DDrMii
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Finalized head for L1 · 2026-11-25T02:41Z · a21c7b6ff · zone a4-S (#36908)

  • CI on a21c7b6ff: 61 success, 12 skipped (path filters, opt-in and queue jobs), 0 failed.
  • Size: +1,610 / −5,318. That is Tier H by size under ruling 7145880574. After L1 and a same-head contract review PASS, seat 4 hands it to the maintainer. The zone does not ready, queue or arm it.
  • os-dev reports: Studio 重构(决定 9):去掉 Studio 首页(/studio 的包卡片页),逐项搬走它承载的入口 #36908 comments 7142300468 (round 1, stopped at the 3,000 line), 7149154327 (hand-off at the move to cloud) and 7150638739 (final, cloud session session_01QSeKYoTgerzGuKa8DDrMii).
  • i18n: 68 of the 72 engine.studio.landing.* / landingHome keys the earlier round deleted ship in the released @object-ui/i18n@18.6.0, measured on the packed tarball. All 68 are restored, unread. The 4 that never shipped are removed.
  • Walk-through: every reachable moved entry was walked on a live showcase stack (PR body, Verification). Not walked live:
    • Home's 「New in Studio」 chip: its condition does not hold on the seeded stack.
    • A non-admin's /studio landing: no such user is seeded.
    • studio:builder: the studio app does not load on a stock boot.
      Each of these has unit pins.
  • Open question for the maintainer, from the dev: with an AI build surface served, 「Build with AI」 (useAddAppEntries, HomePage:981) still targets bare /studio, which now opens the last package or Setup → Packages. The dev recommends A: leave it, because that entry was never on the home and a different target is a separate product card.
  • The dev declared deviations: edits in its own container's primary checkout before moving to a worktree (nothing lost, both trees clean), and a narrowed local gate run that leaves the full farm to CI.
  • Overlaps declared: feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168 and feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 conflict with this branch in the deleted BuilderLanding.* tests, StudioDesignSurface.notFound-26708 and the studio en/zh namespaces. Whichever lands second merges main.
  • Clause-②: no · Metadata-protocol: none.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: a21c7b6ff4c648c77d903f75713871acba2750b9
Local-runs: none
Scope: the whole diff, all 82 paths of git diff 1f3e9f68e703..a21c7b6f. Reviewed: .changeset/36908-remove-studio-home.md, ui/packages/app-shell/src/index.ts, views/studio-design/StudioEntryRedirect.tsx + .test.tsx, studioNewPackage.ts, studioAddressTable.ts, studioAddress.test.ts, setupMetadataRedirect.ts + .test.ts, PackageSwitcher.tsx, packages-io.ts, StudioDesignSurface.tsx + .notFound-26708.test.tsx, PackageCustomizationsPanel.tsx + .test.tsx, packageCustomizationRows.ts (renamed from landingCustomizations-io.ts), views/metadata-admin/packageSource.ts, PackagesPage.tsx + PackagesPage.installedAppsUpdates-34722.test.tsx, console/home/HomePage.tsx, console/ai/AiUnavailable.tsx, hooks/useAddAppEntries.ts, ui/apps/console/src/components/StudioRoute.tsx + its five converted pins, studioBuilder.ts, registerStudioComponents.tsx + registerStudioComponents.builderLazy-11798.test.tsx, AppContent.tsx, ui/packages/i18n/src/namespaces/studio/{en,zh}.ts, ui/packages/i18n/src/locales/en.ts, packages/platform-objects/src/apps/studio.app.ts. The deleted BuilderLanding.* (15 files), LandingCustomizationsPanel.tsx, fetchInstalledPackageRow-7881.test.ts, StudioRoute.landingI18n and StudioRoute.searchPalette-11863 were checked for exports, routes and pins only. Read, not reviewed: BuilderLanding.tsx and studioNewPackage.ts at the merge base, context/RecentItemsProvider.tsx, apps/console/src/components/studioEntry.ts, packages/platform-objects/src/apps/setup-nav.contributions.ts, packages/rest/src/package-routes.ts, the four package.json files, .changeset/config.json, and the published @object-ui/i18n@18.6.0 tarball from the npm registry

Full review of this head, made without the L1's conclusions. Inputs:

  • git diff 1f3e9f68e703..a21c7b6f, against the merge base with origin/main: 82 files, +1,610 −5,318.
  • The files at this head, the PR body's declaration lines, and the published @object-ui/i18n@18.6.0 tarball.
  • The 73 check-runs on this head: 61 success, 12 skipped, 0 failed or pending.

The recogniser decides no face from the paths and defers to the changeset. The changeset reads Clause-②: no with no arm, so this is the declaration face at TIER_DEFAULT. The review is owed because the PR is Tier H by size. git merge-tree --write-tree origin/main a21c7b6f exits 0 against origin/main 3b4f0b9.

① Derived judgments

Published @object-ui/* exports and types: none moved.

  • Every source change outside i18n is in @object-ui/app-shell, which is "private": true. That covers the dropped BuilderLanding, STUDIO_NEW_PACKAGE_PATH, STUDIO_LANDING_PATH, fetchInstalledPackageRow, StudioBuilderLoading and LandingCustomizationsPanel, and the new StudioEntryRedirect and SETUP_PACKAGES_PATH barrel exports.
  • The published @object-ui/console maps exports["."] to plugin.js / plugin.d.ts only, and plugin.ts is not in the diff. studioBuilder.ts and registerStudioComponents.tsx are bundled SPA code.
  • @object-ui/i18n's namespace modules are typed as a string-to-string record, so their type surface is unchanged.
  • At this head, git grep finds no reference to any removed symbol outside CHANGELOGs, except two stale mentions (N4).

i18n, checked against the released tarball. I read dist/namespaces/studio/{en,zh}.js from @object-ui/i18n@18.6.0 by AST and compared it with the base and head src/namespaces/studio/{en,zh}.ts, without evaluating either.

  • 18.6.0 ships 70 engine.studio.landing.* keys plus engine.studio.landingHome, 71 in total, in both en and zh.
  • All 71 are present at this head in both languages. Their values are byte-equal to the merge base: the PR changes no existing key's value.
  • Three of the 71 are still read by PackagesPage.tsx: dupDefaultName, dupNamePlaceholder and dupIdPlaceholder.
  • The other 68 have no reader at this head, including any template-key read. The zone's "68 shipped keys kept and unread" holds.
  • The PR removes exactly four keys: engine.studio.landing.manage, .manageTitle, .allPackages and .allPackagesTitle. They are in en and zh at the base, are absent from the 18.6.0 tarball, and have no reader at this head. The zone's "4 never-shipped keys removed" holds.
  • The PR adds 37 keys to each language: 36 engine.packages.customizations.* and engine.studio.notFound.packageList. Every key the new panel and the not-found action read is among them.
  • The locales/en.ts and makerEmptyState-v1-scope-8329.test.ts hunks change comments only.
  • Outside this diff, not graded: 35 other keys in the 18.6.0 studio namespace are already missing at the merge base and on origin/main. Examples are engine.studio.openApp* (removed by Studio 左上角改成「‹ 返回应用」加应用名;去掉首页图标、应用切换和右上角的「打开应用」(外壳专题第 12 项,设计板图 47) #36501, cd51dbbbcf4) and engine.studio.owd.save* (removed by feat(studio): every human editor saves live; an item's unpublished AI changes can be dropped on its page (#36511, PR 3 of 3) #36652, 9fa05c63b4a). This PR neither causes nor worsens that.

Routes and bookmarks. Each is judged against what the retired home read at the merge base. That home read one query param, new=package, and nothing else.

  • Bare /studio and /studio/ now go through StudioEntryRedirect. It picks the newest remembered package that the package list still names, or the newest one if the list read fails. Otherwise it goes to studioEntryFallbackPath: Setup → Packages for a holder of setup.access + manage_platform_settings, and /studio/~all/metadata for anyone else.
    • The gate's capability set reaches the entry through StudioEntryPermissions. StudioRoute.test.tsx pins that with toHaveBeenCalledWith(OPERATOR_CAPS).
    • Each branch has a case in StudioEntryRedirect.test.tsx.
  • /studio?new=package goes to SETUP_NEW_PACKAGE_PATH, whatever is remembered. PackagesPage opens New Package on the admin face and drops the param with a replace. It drops the param without opening anything on the development face.
    • Each half fails on revert. Without the forwardNew branch, the bookmark case lands on /studio/com.acme.crm. Without the PackagesPage effect, the deep-link describe goes red.
    • A Studio-only principal is not handled (S1).
  • Any other query on bare /studio, such as the old packagedActionsStudioPath output /studio?package=all, is dropped and goes through the entry. The old home read none of them, so nothing it honoured is lost.
  • studio:builder (/apps/APP/component/studio/builder) forwards to /studio with a replace. This is pinned in builderLazy-11798, which shows that a revert to the old lazy landing no longer reaches the /studio route.
  • packagedActionsStudioPath with no package or package=all now goes to SETUP_PACKAGES_PATH. A named package is unchanged.
    • The converted table cases fail on revert. The PR's ablation shows 2 of 84 failing.
    • AppContent.setupMetadataStudio-28578 pins the same thing through the real route.
  • The not-found action now goes to Setup → Packages, on the admin face. Pinned in notFound-26708, which fails on revert because the old /studio route is gone from its harness. A Studio-only principal is not handled (S1).
  • AppContent's ObjectRedirect / SystemCatalogRedirect fall back to SETUP_PACKAGES_PATH only when setupMetadataStudioPath returns null. For object and the two catalog types, that does not happen at this head.

api-surface baselines. The only baselines are packages/spec/api-surface*. The diff touches nothing in packages/spec, so no baseline is owed.

Accept sets. No schema, spec or authorable key moves. studio.app.ts and the CLI integration test change only comments. The route table keeps every segment; the /studio index changes what it draws, not which addresses it accepts.

S1 (should-fix) — the capability split this PR draws for bare /studio does not reach two of the other exits that name no package.

  • StudioEntryRedirect returns Navigate to={SETUP_NEW_PACKAGE_PATH} for ?new=package before it reads systemPermissions. So a principal holding studio.access without setup.access or manage_platform_settings is sent to the Setup page that studioEntryFallbackPath exists to keep them away from.
  • At the merge base, that same address opened PackageFormDialog inside Studio, and creating a package there needs only manage_metadata (package-routes.ts).
  • The not-found action calls shellNavigate(SETUP_PACKAGES_PATH) with no capability check. A Studio-only principal who opens a stale /studio/ID is offered a way out that leads to a page they cannot open.
  • The only bookmark case renders with ADMIN, so neither branch is pinned for the other class.
  • Fix:
    • Send ?new=package from a non-holder to studioEntryFallbackPath(systemPermissions).
    • Give the not-found action the same choice, for example by reading the gate's set through a hook that app-shell exports.
    • Pin both with a Studio-only case beside an admin CONTROL in StudioEntryRedirect.test.tsx and notFound-26708.

N1 (nit) — recents are read localStorage-first, and the server copy arrives after first render (RecentItemsProvider).

  • On a device with no local copy, StudioEntryRedirect sees no remembered package and redirects to the fallback before that copy arrives. "Opens the package you were last in" holds only on a device that already has the copy.
  • No test pins either behaviour.

N2 (nit) — the panel gate !authoring && !writable && !isKernel && !isCustomizationPackage(id) is pinned for a code package, an authored package and the development face. The kernel exclusion and the .custom exclusion have no case. !writable already covers a writable pair, so the gap is narrow.

N3 (nit) — on the declaration line, the PR adds 37 keys to the published studio namespace. On main, such additions are declared both Clause-②: yes (widening) (for example the engine.studio.newApp.* changeset) and Clause-②: no (#36501, #36901, #35018). This PR is in line with the second group. The choice changes neither the bump nor the review owed, since Tier H owes it anyway.

N4 (nit) — two stale mentions remain:

  • studioAddress.guard.test.ts:55 still allow-lists STUDIO_LANDING_PATH, which no longer exists.
  • The check-eager-closure-budget.mjs:920 docblock still names BuilderLanding as lazily loaded. That is a historical comment, but it now names a deleted module.

② Semver level

All four entries take patch. The changeset and the PR body both carry the declaration lines at line start: Clause-②: no and Metadata-protocol: none.

  • Metadata-protocol: none holds: no metadata author can write anything new or different, and none takes patch (AGENTS.md, Post-Task Checklist step 3).
  • Clause-②: no holds for the narrowing arm, because no published key, export or prop is removed or renamed. The widening question is N3.
  • @object-ui/i18n: patch is right. The change adds keys and removes only keys that were never released.
  • @object-ui/console: patch: its SPA bundle changes and its published entry does not.
  • @object-ui/app-shell: patch is private, and @objectstack/platform-objects: patch changes a comment only. Both are permitted.
  • No BREAKING banner, migration mapping or ADR-0087 marker is owed.
  • The changeset's claims about exports and keys are true at this head. Its redirect sentence for /studio is true. Its sentence for the old ?new=package bookmark is true for an administrator only (S1).

③ Boundary flags

Implemented-by: claude/issue-36908-remove-studio-home
Reviewed-by: fresh subagent of session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head a21c7b6ff4c648c77d903f75713871acba2750b9 · 2026-11-25T02:57Z

Open

Gates.

  • Check-runs at this head: 61 success, 12 expected skips, 0 failed. Both Lint & Repo Gates and TypeScript Type Check succeeded.
  • Clause-②: no holds: no published key is removed, and app-shell is private. Metadata-protocol: none holds. No Skills-docs line is owed. All four packages take a patch bump, which is right.
  • K = 26. The PR is not stale against main: the merge is clean, CI's base is 4 commits behind main, and none of those commits touches a Studio, i18n or Packages file. The merged tree still refers to nothing this PR removes, apart from the N4 names.
  • feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 conflicts in the studio en/zh files and in notFound-26708. Whichever PR lands second merges main and runs the 18.6.0 key comparison again.

Next: fix S1–S6 and the nits, and have the maintainer rule on 「Build with AI」. The seat then reviews the changes on the new head and runs a same-head contract review before handing the PR to the maintainer.

  • Contract review at this head: 7151294694 (TIER_DEFAULT): PASS with one should-fix. Fix it in the same round. The old /studio?new=package bookmark and the "package not found" button both send everyone to Setup → Packages. They skip the permission check this PR added for bare /studio, so a user who can enter Studio but cannot open that Setup page lands on a page they can't open. Route both through the same check, and add a test for that user.
  • 「Build with AI」 → bare /studio: the seat is putting this to the maintainer with the measured behaviour. Leave the target as is in this round. If the ruling changes it, it is a one-line follow-up.
  • Next: one patch round for S1–S6 and the contract review's should-fix, then merge main (K 26). After that the seat reads the delta, runs a delta contract review, and hands the PR to the maintainer. It is Tier H by size (6,928 lines), so it does not self-land.

…d not-found exit to All metadata

The retired /studio?new=package bookmark and the package-not-found state's
way out both sent every principal to Setup > Packages. A principal who may
enter Studio but not open that Setup page landed on its access-denied page.
Both now read the capability set Studio's entry gate read, through a provider
app-shell exports, and choose the same way bare /studio does.

Also: the permission matrix's read-only hint copy pin moves off the deleted
Studio-home test; the new-app step's three cases move onto PackageFormDialog;
the Packages detail gate gets its kernel and .custom cases; the changeset is
rewritten in user terms with the i18n note in its own changeset; stale names
of the removed home are corrected.

Claude-Session: https://claude.ai/code/session_01QSeKYkEULEjF814KSPBLVC
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 54e4586edffc4227ca75e2bf69adad4131d510d6
Local-runs: probe — the delta L1's pin ablation: vitest on HomePage.noAgentsBuildChip-26614 in a throwaway worktree at this head after the app-shell closure build (baseline 12 passed of 12), four single-site mutations each restored (worktree clean after, removed); and released-keys-removed.mjs read at the merge base and at this head
Scope: none (no reviewFace hits: no published schema and no governed path; record-recognisers.mjs --paths on the 101 files decides no face and defers to the changeset's Clause-②: no, which carries no (narrowing) arm) + the delta since record 7162083002: docs/qa/platform-checklist/areas/automation.json, studio-authoring.json, ux-conventions.json, ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx, console/home/HomePage.tsx, console/ai/AiUnavailable.tsx, views/metadata-admin/packageSource.ts, the merge resolution in views/studio-design/StudioDesignSurface.notFound-26708.test.tsx, ui/packages/i18n/src/namespaces/studio/{en,zh}.ts as merged, .changeset/36908-remove-studio-home.md, .changeset/36908-studio-home-strings.md, and the PR body's two declaration lines. Read, not reviewed: hooks/useNewPackageDoorPath.ts, ui/packages/permissions/src/MePermissionsProvider.tsx, views/studio-design/setupMetadataRedirect.ts, views/studio-design/metadataArea.ts, ui/packages/i18n/scripts/released-keys-removed.mjs, and the @object-ui/i18n@18.6.0 tag

Same-head review of the delta since record 7162083002 (head 1c7f29cc), and of the declaration again at this head. The delta is two commits of the branch's own (checklist text; one test file and four comments) and two merges of main, the second carrying #37169. The diff against the merge base 4fb03ebb is 101 files, +2,306 −5,217. Check-runs on this head: 73, of which 61 success, 12 skipped, 0 failed. git merge-tree --write-tree origin/main is clean against 039b2884 (K 6 by landing-k.mjs).

Prior items: N1: closed. N2: closed.

① Derived judgments

Released translation keys: none removed, re-measured after #37169 and #37230.

  • main's released-keys-removed.mjs against the @object-ui/i18n@18.6.0 tag: 76 keys absent at the merge base 4fb03ebb, and the same 76 at this head.
  • Studio namespace, en and zh, against 4fb03ebb: the branch removes exactly four keys (engine.studio.landing.manage, .manageTitle, .allPackages, .allPackagesTitle). None is in the tag. It adds 38 per language and changes 0 values.
  • All 71 released engine.studio.landing* keys are present at head.
  • The eleven locale packs change one value each, home.build.inStudio, and no key.
  • So Clause-②: no holds. No (narrowing) arm and no 「Removed translation keys」 entry is owed on the open 19.0.0 line.

Published exports and types: none moved by the delta.

  • The two own commits touch a test file, three comments and three checklist files. No barrel and no published entry is in them.
  • The merged tree with origin/main names none of the removed symbols (BuilderLanding, STUDIO_LANDING_PATH, fetchInstalledPackageRow, LandingCustomizationsPanel, landingCustomizations-io).

The merges.

The declaration line, four carriers. readClause2Line and readMetadataProtocolLine return no and none on the PR body, both changesets and the card's newest Claim: comment (7141034666).

② Semver level

  • Unchanged from record 7162083002: four patch entries across two changesets, each with Clause-②: no and Metadata-protocol: none at line start. Neither changeset file changed since 1c7f29cc.
  • main entered Changesets pre mode (chore(release)!: enter Changesets pre mode (next) so 19.0.0 opens; retire the 18.6.0 i18n keys no code reads #37230) between the two heads. That changes the version these patches publish under, not their level.
  • Metadata-protocol: none holds: the delta changes no route, door or wire shape.
  • No BREAKING banner, migration mapping or ADR-0087 marker is owed.

③ Boundary flags

  • Dev report 7165780205:
    • Open question 1 (overlap-check exit 1 from open-PR conflicts): answered A in the delta L1. It orders the landing, not the push.
    • Open question 2 (nested 速读 sub-lines): answered A. The seat's hand-off comment carries the four-line form.
    • Deviations: three extra fixture lines re-pointed, each with a revision entry, accepted; no revision entry on counts-and-marks, accepted, since its revision 4 is this PR's own; one merge started in the primary checkout and aborted, with both merge parents on main's first-parent line and nothing stray on the branch.
    • security_findings is none.
    • Out-of-scope finding: the full check:platform-checklist is red on main for an anchor feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 removed. It is not this PR's and goes to the seat.
  • SQL push-down: no server or query code is in the delta.
  • Permission gates: unchanged. The new cases read the door's link target only.
  • Outside this review's faces: the delta L1 at this head is ACCEPT with two nits, both prose.

④ Design judgment

The delta adds a pin, not behaviour. Two questions.

  • Does the new pin hold the doctrine judged A in record 7162083002 ④? Yes.
    • The unreported case mounts Home under the real MePermissionsProvider with an authenticated answer that has no systemPermissions, and expects Setup's New Package. The control gives a reported set holding manage_metadata alone and expects /studio/~all/metadata.
    • Run here: the door made to fail closed turns the unreported case red and leaves the control green; the door forced to Setup turns the control red; the provider's own hasCapabilities made to fail closed turns the unreported case red and nothing else. So the case reads the real provider's answer, and each direction has a case that fails.
  • Do the checklist re-points describe this head? Yes for every scored text.
    • The packaged-actions bookmark with no package: packagedActionsStudioPath returns SETUP_PACKAGES_PATH, as the item's title, steps[1] and acceptance[0] now say.
    • 'Build an app' still targets bare /studio, which StudioEntryRedirect resolves to the last package or the fallback, as first-run-loop steps[1] says.
    • N3 — in the first item, fixtures.knownGaps[0] still says that bookmark opens "/studio (the landing)", and steps[1] spells the landing address with the setup alias where the PR's walk recorded com.objectstack.setup. Neither is a scored clause.

Implemented-by: claude/issue-36908-remove-studio-home
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 54e4586edffc4227ca75e2bf69adad4131d510d6
Local-runs: probe — the delta L1's pin ablation: vitest on HomePage.noAgentsBuildChip-26614 in a throwaway worktree at this head after the app-shell closure build (baseline 12 passed of 12), four single-site mutations each restored (worktree clean after, removed); and released-keys-removed.mjs read at the merge base and at this head
Scope: none (no reviewFace hits: no published schema and no governed path; record-recognisers.mjs --paths on the 101 files decides no face and defers to the changeset's Clause-②: no, which carries no (narrowing) arm) + the delta since record 7162083002: docs/qa/platform-checklist/areas/automation.json, studio-authoring.json, ux-conventions.json, ui/packages/app-shell/src/console/home/__tests__/HomePage.noAgentsBuildChip-26614.test.tsx, console/home/HomePage.tsx, console/ai/AiUnavailable.tsx, views/metadata-admin/packageSource.ts, the merge resolution in views/studio-design/StudioDesignSurface.notFound-26708.test.tsx, ui/packages/i18n/src/namespaces/studio/{en,zh}.ts as merged, .changeset/36908-remove-studio-home.md, .changeset/36908-studio-home-strings.md, and the PR body's two declaration lines. Read, not reviewed: hooks/useNewPackageDoorPath.ts, ui/packages/permissions/src/MePermissionsProvider.tsx, views/studio-design/setupMetadataRedirect.ts, views/studio-design/metadataArea.ts, ui/packages/i18n/scripts/released-keys-removed.mjs, and the @object-ui/i18n@18.6.0 tag

Same-head review of the delta since record 7162083002 (head 1c7f29cc), and of the declaration again at this head. The delta is two commits of the branch's own (checklist text; one test file and four comments) and two merges of main, the second carrying #37169. The diff against the merge base 4fb03ebb is 101 files, +2,306 −5,217. Check-runs on this head: 73, of which 61 success, 12 skipped, 0 failed. git merge-tree --write-tree origin/main is clean against 039b2884 (K 6 by landing-k.mjs).

Prior items: N1: closed. N2: closed.

① Derived judgments

  • Re-served at the declaration face's tier. record-recognisers --paths decides no schema or rules face on this diff, so the record's tier is TIER_DEFAULT. The text is the same review posted as 7168234100, which was mislabelled CONTRACT_REVIEW_TIER, a seat error.

Released translation keys: none removed, re-measured after #37169 and #37230.

  • main's released-keys-removed.mjs against the @object-ui/i18n@18.6.0 tag: 76 keys absent at the merge base 4fb03ebb, and the same 76 at this head.
  • Studio namespace, en and zh, against 4fb03ebb: the branch removes exactly four keys (engine.studio.landing.manage, .manageTitle, .allPackages, .allPackagesTitle). None is in the tag. It adds 38 per language and changes 0 values.
  • All 71 released engine.studio.landing* keys are present at head.
  • The eleven locale packs change one value each, home.build.inStudio, and no key.
  • So Clause-②: no holds. No (narrowing) arm and no 「Removed translation keys」 entry is owed on the open 19.0.0 line.

Published exports and types: none moved by the delta.

  • The two own commits touch a test file, three comments and three checklist files. No barrel and no published entry is in them.
  • The merged tree with origin/main names none of the removed symbols (BuilderLanding, STUDIO_LANDING_PATH, fetchInstalledPackageRow, LandingCustomizationsPanel, landingCustomizations-io).

The merges.

The declaration line, four carriers. readClause2Line and readMetadataProtocolLine return no and none on the PR body, both changesets and the card's newest Claim: comment (7141034666).

② Semver level

  • Unchanged from record 7162083002: four patch entries across two changesets, each with Clause-②: no and Metadata-protocol: none at line start. Neither changeset file changed since 1c7f29cc.
  • main entered Changesets pre mode (chore(release)!: enter Changesets pre mode (next) so 19.0.0 opens; retire the 18.6.0 i18n keys no code reads #37230) between the two heads. That changes the version these patches publish under, not their level.
  • Metadata-protocol: none holds: the delta changes no route, door or wire shape.
  • No BREAKING banner, migration mapping or ADR-0087 marker is owed.

③ Boundary flags

  • Dev report 7165780205:
    • Open question 1 (overlap-check exit 1 from open-PR conflicts): answered A in the delta L1. It orders the landing, not the push.
    • Open question 2 (nested 速读 sub-lines): answered A. The seat's hand-off comment carries the four-line form.
    • Deviations: three extra fixture lines re-pointed, each with a revision entry, accepted; no revision entry on counts-and-marks, accepted, since its revision 4 is this PR's own; one merge started in the primary checkout and aborted, with both merge parents on main's first-parent line and nothing stray on the branch.
    • security_findings is none.
    • Out-of-scope finding: the full check:platform-checklist is red on main for an anchor feat(studio): the flow designer opens full-screen on its metadata address; no flow rail (#36903) #37169 removed. It is not this PR's and goes to the seat.
  • SQL push-down: no server or query code is in the delta.
  • Permission gates: unchanged. The new cases read the door's link target only.
  • Outside this review's faces: the delta L1 at this head is ACCEPT with two nits, both prose.

④ Design judgment

The delta adds a pin, not behaviour. Two questions.

  • Does the new pin hold the doctrine judged A in record 7162083002 ④? Yes.
    • The unreported case mounts Home under the real MePermissionsProvider with an authenticated answer that has no systemPermissions, and expects Setup's New Package. The control gives a reported set holding manage_metadata alone and expects /studio/~all/metadata.
    • Run here: the door made to fail closed turns the unreported case red and leaves the control green; the door forced to Setup turns the control red; the provider's own hasCapabilities made to fail closed turns the unreported case red and nothing else. So the case reads the real provider's answer, and each direction has a case that fails.
  • Do the checklist re-points describe this head? Yes for every scored text.
    • The packaged-actions bookmark with no package: packagedActionsStudioPath returns SETUP_PACKAGES_PATH, as the item's title, steps[1] and acceptance[0] now say.
    • 'Build an app' still targets bare /studio, which StudioEntryRedirect resolves to the last package or the fallback, as first-run-loop steps[1] says.
    • N3 — in the first item, fixtures.knownGaps[0] still says that bookmark opens "/studio (the landing)", and steps[1] spells the landing address with the setup alias where the PR's walk recorded com.objectstack.setup. Neither is a scored clause.

Implemented-by: claude/issue-36908-remove-studio-home
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

维护者速读

Approval request at 2026-11-25T16:37Z. Seat opinion: approve. The delta since the last review is checklist text, one test file, four comments and two merges of main; it changes no behaviour. The L1 at this head is ACCEPT with two prose nits, and the same-head contract review is PASS. All 73 check-runs are green or expected skips, main merges cleanly, and K is 6. #37249 conflicts with this PR in two Home test files, so whichever of the two lands second merges main first.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 25, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 25, 2026 16:42
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit fbb62e1 Nov 25, 2026
79 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-36908-remove-studio-home branch November 25, 2026 17:09
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…dio-design reads and writes send the stored bearer token (objectstack-ai#37185)

Fixes objectstack-ai#37080

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:浏览器里只剩登录令牌(会话 Cookie 被替换、拦截或清掉)的用户,侧边栏、应用头部、命令面板和 Studio
入口里的应用包列表不再消失,AI 对话列表、建议权限绑定、提交历史、草稿面板等也正常加载;只用 Cookie 登录的用户看不到任何变化。
-
为什么做:控制台其它请求都会带上登录令牌,这一批读写漏带,属于"控制台登录状态体验"这一块的缺陷,替所有处于这种登录状态的用户解决,并加了一道测试防止以后再写出漏带令牌的请求。
- 出错会怎样:最坏情况是这些地方重新读不到数据,与修复前一样;不改服务端接受什么、不改登录方式,可以直接撤回。
- 要你做什么:无。

## What changes

Same-server `/api/` reads and writes in app-shell and the console that
called the bare global `fetch` with `credentials: 'include'` (the
session cookie and nothing else) now go through
`createAuthenticatedFetch` from `@object-ui/auth`, exactly as objectstack-ai#37077 did
for the Setup pages: built per call (`createAuthenticatedFetch()(input,
init)`, a local `authFetch` in each module), `credentials: 'include'`
kept on every call, so the cookie still rides along and a `401` now
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/main` 63ab479

79 non-test files under `ui/packages/app-shell/src` and
`ui/apps/console/src` contain `credentials: 'include'`. Read call by
call (AST scan of every `credentials: 'include'` property and the call
it is handed to):

**Converted here: 64 calls in 39 files.**

| File | Calls |
|---|---|
| `app-shell/.../studio-design/packages-io.ts` | `readPackagesPayload`
(`GET /api/v1/packages`, the measured case),
`ensureCustomizationPackage`, `duplicatePackage` |
| `app-shell/.../studio-design/packageCustomizations-io.ts`,
`PackageSwitcher.tsx`, `AutomationsPillar.tsx`, `FlowItemMoreMenu.tsx` |
1 each (customizations read, switcher list, automation status, flow
clone) |
| `app-shell/src/hooks/useConversationList.ts` | 4 (list, detail,
rename, delete) |
| `app-shell/src/hooks/useChatConversation.ts` | 3 (read, create,
update) |
| `app-shell/src/console/ai/buildDebugApi.ts` | 1 (build-debug report) |
| `app-shell/src/hooks/useAiUsage.ts` | 1 |
| `app-shell/src/services/suggestedBindingsApi.ts` | 4 (list, confirm,
dismiss, reopen) |
| `app-shell/src/preview/commitHistory.ts` | 2 (timeline, revert) |
| `app-shell/src/preview/DraftChangesPanel.tsx`,
`UnpublishedAppBar.tsx`, `usePendingDrafts.ts` | 2, 1, 1 |
| `app-shell/src/preview/flowDraftChecks.ts` | the default transport
(`opts.fetchImpl ?? createAuthenticatedFetch()`) |
| `app-shell/src/views/changeOwner.ts` | the fallback transport
(`apiFetch ?? createAuthenticatedFetch()`) |
| `app-shell/src/views/metadata-admin/` `PackageFormDialog.tsx`,
`catalog-activation.ts`, `permission-set-clone.ts`,
`sharing-rule-catalog.ts` | 1, 2, 1, 1 |
| `app-shell/src/views/metadata-admin/inspectors/`
`FlowReferenceField.tsx`, `connector-input-fields.ts` | 2, 1 |
| `app-shell/src/views/metadata-admin/previews/` `FlowRunsPanel.tsx`,
`useFlowNodePalette.ts`, `PagePreview.tsx` | 1, 1, 2 |
| `app-shell/src/views/setup/` `packagedActionLedger.ts`,
`packagedFlowLedger.ts` | 2, 1 |
| `app-shell/src/hooks/` `useRecordApprovals.ts`, `sharedUserFeeds.ts`,
`useInboxBell.ts` | 1 each |
| `app-shell/src/console/` `AppNoAccessEmptyState.tsx`,
`connect/ConnectAgentWidget.tsx`,
`deployment-notice/deploymentNoticeState.ts` | 1, 2, 2 |
| `app-shell/src/console/marketplace/marketplaceApi.ts` | 5 same-server
calls onto the existing `serverFetch` (`/cloud-connection/install`,
`install-namespace`, `installation`, and on the control plane its own
`install_package` action and installed-state route) |
| `app-shell/src/layout/designModeMenuSave.ts` | 1
(`/api/v1/i18n/locales`) |
| `app-shell/src/layout/ContextSelectors.tsx` | 1, with `{
sameOriginOnly: true }`: the endpoint is author-written
(`optionsSource.endpoint`) and may name another host |
| `console/src/pages/developer/` `AgentConnectSection.tsx`,
`IntegrationsPage.tsx` | 2, 1 |
| `console/src/pages/auth/DeviceAuthPage.tsx` | 3 (claim, approve, deny:
a signed-in act) |

Of the card's named ones: `packages-io.ts` `readPackagesPayload`,
`useConversationList`, `useChatConversation`, `suggestedBindingsApi` and
the studio-design writes (ensure-customization, duplicate,
customizations, flow clone) are all converted. `suggestedBindingsApi`,
`useRecordApprovals`, `sharedUserFeeds`, `useInboxBell`,
`ConnectAgentWidget`, `deploymentNoticeState` and three `marketplaceApi`
calls 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 of `myPreferences.ts`, `slackDoors.ts`, `orgEnvironments.ts`,
`useLauncherApps.tsx`. `App.tsx` names 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) and
`console/src/languageSeed.ts` (not counted by the pin: it hands
`sharedGetJson` a transport argument that may be `undefined`): the boot
read of `/api/v1/auth/me/localization`, shared in flight by a key built
from the init with the early request `index.html` sends. A session it
cannot see reads `authenticated: false` and 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 (objectstack-ai#37123)
edits this file; its call moves with that work.
- `app-shell/src/console/marketplace/marketplaceApi.ts` (5): each
targets `getCloudBase() || 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 an `api` action preview, sent to the author-written
target; its transport is not decided here.

The other two fenced files hold no family call: `RecordDetailView.tsx`
and `useConsoleActionRuntime.tsx` already route every `credentials:
'include'` call through their `authFetch`. Neither was edited.

## Tests

- `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts`
(new, the enumeration pin; runs in **Test UI**, app-shell's `unit`
project): parses every non-test source file of both trees with the
TypeScript parser and refuses a bare cookie-only call (the transport is
the global `fetch`, `window.fetch`, `globalThis.fetch`, `self.fetch`,
one of those as a `??` / `||` fallback, or `sharedGetJson` without its
transport argument; the init carries `credentials: 'include'`, inline or
as a `const` of the file, `as const` included). 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, `fetchPackages` loads the list and its one request
carries `Authorization: Bearer TOKEN` and `credentials: 'include'`;
`fetchListedPackageIds` likewise; 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: no
`Authorization`, `credentials: 'include'`).

Test doubles that moved (118 files, no assertion weakened):

- 102 files: hand-rolled `Response` doubles (`{ ok, status, json }`)
gain `headers: new Headers()`, the headers a real `Response` carries and
the authenticated fetch reads (`set-auth-token`), as objectstack-ai#37077 did. The
102nd, `StudioPaletteGroups.surfaceScope-36900` (the command-palette
suite that reached `main` after round 0), doubles `GET
/api/v1/packages`: without the headers the converted
`readPackagesPayload` threw on the double and the palette drew no
Packages group. For `fetchInstalledPackageRow-7881` and
`StudioDesignSurface.readOnlyPosture-12453` the headers are added at the
one stub instead of each answer.
- 8 files whose `@object-ui/auth` mock answered
`createAuthenticatedFetch: () => vi.fn()` (a transport that answers
nothing) now hand the authenticated fetch's requests to the global
`fetch` the file already stubs: the four `RecordApprovalsPanel` suites
and `RecordDetailView` `editLockedByState-32756`, `phoneFace-27058`,
`userActionPredicates`, `harness`.
- 5 `RecordDetailView` approval suites whose `authFetchSpy` stands 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.
- 3 assertions read the init the wire received (the last two files are
also among the 101): `useConversationList` and `BuildDebugDrawer` assert
`{ credentials: 'include', headers: expect.any(Headers) }` (exact keys,
as before); `DraftChangesPanel.flowChecks-34818` reads `Accept-Language`
off a `Headers`.
- `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

- Same defect family outside the two trees, not touched (the card scopes
the `plugin-*` hooks out unless measured here): `credentials: 'include'`
with the bare `fetch` remains in `ui/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`) and `permissions`
(`MePermissionsProvider`). Not each read call by call.
- A bare `fetch('/api/…')` with no init at all is cookie-only as well
(the default `same-origin` credentials) and is outside the pin's
spelling: `views/metadata-admin/widgets.tsx` `fetchFieldSelectorOptions`
(`GET /api/v1/objects/:name/fields`).
- `LocalizationFetchProvider` and `languageSeed` read
`/api/v1/auth/me/localization` cookie-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 request
`index.html` sends.
- The hand-rolled bearer helpers left beside converted calls
(`authHeaders` in `suggestedBindingsApi`, `bearerAuthHeaders`,
`withEnvAuth`) are now redundant there; not removed here.

## Verification

<details><summary>The measured case and the pins (green at the
head)</summary>

`packages-io.bearerSession.test.ts` and 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 level `await (x)(…)` parses as a
call of `await`, so the `(apiFetch ?? fetch)` case read 0; the cases now
run inside an async function.
</details>

<details><summary>Ablation: one conversion reverted, both pins
red</summary>

Through `scripts/ablation-replace.mjs` on `packages-io.ts`: anchor
`const res = await authFetch('/api/v1/packages', {` hit 1 → 0, blob
`d3c93d771344` → `42f8862ba05e`; the ratchet and the bearer-session file
run under the lock:

```text
FAIL sameServerFetch.bearer.ratchet.test.ts > every bare cookie-only call is a counted row of the shrink-only allow-list
  + "packages/app-shell/src/views/studio-design/packages-io.ts:398 :: fetch('/api/v1/packages', …)"
FAIL packages-io.bearerSession.test.ts > loads the package list, sending the stored bearer beside the cookie
FAIL packages-io.bearerSession.test.ts > answers the listed-id read from the same authenticated request
Test Files  2 failed (2)
     Tests  3 failed | 14 passed (17)
```

The cookie-only control stayed green. Restored: blob `d3c93d771344`
equal to `HEAD`, `git diff HEAD` empty.
</details>

<details><summary>Suites</summary>

The whole `@object-ui/app-shell` and `@object-ui/console` suites, under
the shared verify lock, in six shards (`cd ui && pnpm exec vitest run
--maxWorkers=3 --shard=k/6 packages/app-shell apps/console`) at
`32505939` (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:

```text
shard 1/6: Test Files  21 failed | 440 passed (461) · Tests  121 failed | 4304 passed (4425)
shard 2/6: Test Files  16 failed | 446 passed (462) · Tests  64 failed | 4352 passed | 1 skipped (4417)
shard 3/6: Test Files  23 failed | 439 passed (462) · Tests  104 failed | 4111 passed (4215)
shard 4/6: Test Files  17 failed | 445 passed | 1 skipped (463) · Tests  87 failed | 4383 passed | 8 skipped (4478)
shard 5/6: Test Files  26 failed | 436 passed (462) · Tests  116 failed | 4636 passed (4752)
shard 6/6: Test Files  14 failed | 448 passed (462) · Tests  77 failed | 4286 passed (4363)
```

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 again `Test Files 3 passed (3)`.
After the last two type fixes `Test Files 2 passed (2)`, and after the
collection-time imports the 34 files that gained one `Test Files 34
passed (34)` / `Tests 319 passed (319)`, at `5dde589a8c`. 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-shell` and `@object-ui/console` `type-check` `Tasks: 77
successful, 77 total` at `3080a68173`; `@object-ui/app-shell` again at
`5dde589a8c` after 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 in
`3080a68173`.

`pnpm --dir ui exec vitest run scripts/` after building the seven
`@objectstack` packages as Test UI does: `Test Files 172 passed | 2
skipped (174)`, `Tests 5131 passed | 2 skipped (5133)`.
</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` (no paths, merge base
`63ab4794`): 39 families. All 39 run locally, each exit captured before
any pipe; 37 lock-free families re-run at `5dde589a8c`, all exit 0;
`pnpm check:type-check-debt` exit 0 (`0 raw tsc error(s) total, none
above its recorded number`); the ui `scripts/` 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-alias` first went red on the edited suites (exit 1):
34 of them reach a dynamic `import('@objectstack/lint')`,
`import('@objectstack/formula')` or `import('@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-check` before every push: at `4a990ef7` it merges cleanly with
`origin/main` (`93bd4595`) and with objectstack-ai#37204, objectstack-ai#37188 and objectstack-ai#37148, and exits
1 on textual conflicts with three open Studio PRs that edit the same
test files: objectstack-ai#37166, objectstack-ai#37168, objectstack-ai#37169 (in `StudioDesignSurface.*`,
`BuilderLanding.*`, `CommandPalette.studioScope-11863`,
`StudioRoute.searchPalette-11863`, and objectstack-ai#37166/objectstack-ai#37169 also in
`PackageSwitcher.tsx`, `FlowItemMoreMenu.tsx`). Whichever lands second
takes the merge.
</details>

<details><summary>Round 1: main merged at 3b4f0b9, re-measured at
e055596</summary>

CI at `5dde589a` was red on two causes, both from `main` moving (the ⌘K
palette work):

- `check:test-source-alias` exit 1: four edited suites
(`StudioDesignSurface` `entryReadsOnce-11797`, `itemDraftLine-12725`,
`notFound-26708`, `readOnlyPosture-12453`) now reach
`import('@object-ui/plugin-detail')` through the surface's command
palette and its record preview. Each gained the prescribed module-top
`import '@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 gained `headers` (above), 11 passed. No
assertion changed.

Readings at `e0555965`, under the shared verify lock:

```text
ratchet + bearer-session pin + main's 35 incoming app-shell/console test files + the 5 edited files:
  Test Files  41 passed (41) · Tests  394 passed (394)
whole @object-ui/app-shell + @object-ui/console (cd ui && pnpm exec vitest run --maxWorkers=3 packages/app-shell/ apps/console/):
  Test Files  1 failed | 2779 passed | 1 skipped (2781) · Tests  2 failed | 26745 passed | 9 skipped (26756)
```

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 by `setTimeout(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-shell` `type-check` through 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 base `3b4f0b98`): 39 families,
all run, each exit captured before any pipe, all exit 0.
`check:type-check-debt` first 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 …)`.
</details>

## Read first

1. `ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts`:
the detector and the `ALLOWED` rows (each reason is a claim about a call
left bare).
2. `ui/packages/app-shell/src/layout/ContextSelectors.tsx`: the one
conversion with `sameOriginOnly`, because its URL is author-written.
3. `ui/packages/app-shell/src/console/marketplace/marketplaceApi.ts`:
which calls moved onto `serverFetch` and 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`,
expect `Test Files 2 passed (2)`.


<details><summary>Round 2: main merged at 93bd459, re-measured at
4a990ef</summary>

- objectstack-ai#37089 landed on `main` after round 1 and left this PR conflicting in
`StudioDesignSurface.notFound-26708` and
`StudioDesignSurface.readOnlyPosture-12453`: both sides add the same
`import '@object-ui/plugin-detail';` with a different comment. The merge
(`48321c62`) keeps one import with `main`'s comment, so against `main`
those two files differ only by round 0's doubles.
- Main's ten new commits add no `credentials: 'include'` line under
`ui/packages/app-shell/src` or `ui/apps/console/src`, and their one new
hand-rolled Response double already carries `headers: new Headers()`.
- The two changesets (`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/spec`
moved on `main`: the seven `@objectstack` packages Test UI builds were
rebuilt first, and `pnpm --filter @objectstack/spec check:generated`
reads `All 14 generated artifacts are up to date`):

```text
the ratchet, the bearer-session pin, the 5 test files edited in round 1, every existing test file the merge touched
in the two trees, and the suites named for each source file it touched:
  Test Files  311 passed (311) · Tests  2133 passed (2133)
```

`check:test-source-alias` exit 0. `@object-ui/app-shell` `type-check`
through turbo: `Tasks: 69 successful, 69 total`. `dispatch-gates
--commands` (merge base `93bd4595`): 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 ui
`scripts/` suite `Test 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.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_
<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYmRepQK9DkZeU7F53D -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…p shell from 768 px up (objectstack-ai#37241)

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Fixes objectstack-ai#37197
Part of objectstack-ai#37150 — this PR carries its last open item (item 2, the
standalone `/docs` portal's frame, ruled B in objectstack-ai#37150 comment
7151721568); items 1, 3 and 4 landed in objectstack-ai#37193.

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
电脑上打开独立文档门户(文档首页、书、文章)时,顶栏没有了,左侧是和应用页面同样的侧栏:顶部是中性的「文档」入口(点开是你的应用列表和「添加应用」),正文是按应用分组的全部文档目录,「全部文档」排第一行;应用内文档的侧栏也把「全部文档」挪到了「返回应用」下面、目录之上的第一行;手机不变。
- 属于「去掉顶栏和平台首页那一层」专题,是「文档页进应用外壳」那张卡的最后一项:两个文档入口从此是同一种外观,按你批准的设计图做的。
- 出错时电脑上的文档门户会少了目录或入口,打开门户不会改动「上次使用的应用」;改动只在前端,直接撤回这个改动即可恢复原样。
- 无。

## What changes

From 768 px up, `/docs…` now renders in an app-less variant of the app
shell, as designed in stage 1 and approved on objectstack-ai#37197 (comment
7153085446, the maintainer: 「5 处都按建议,批准设计」).

- **New `DocsPortalShell`** (`ui/packages/app-shell/src/console/docs/`,
exported from `@object-ui/app-shell`): on a phone it is `HomeLayout
variant="docs"`, unchanged; from 768 px up it mounts the real `AppShell`
with `showHeader={false}`, `UnifiedSidebar` in a new `docsPortal` mode,
the docs-navigation slot from objectstack-ai#37193, the page header's group and expand
button (`ShellPageActionsScope sidebarExpand appless`), Home's AI drawer
and Home's command palette (`HomeCommandPalette`, now exported from
`HomeLayout`). Like `ConsoleLayout`, it draws a non-shrinking box at the
top of the content holding `ChromeBannerHost` and `ConnectionBanner`, so
the standing banners (impersonation, read rate, storage) and a
lost-connection notice sit beside the fixed sidebar instead of over its
head (seat L1 S2). The connection state comes from the data adapter, as
`AppContent` reads it. It sets the navigation context to `home`, as
Home's frame does, and never sets the current app, remembers a last app
or applies an app's branding.
- **`UnifiedSidebar` `docsPortal`** (+ `docsPortalSearch`): the shell
head and foot as in an app, a neutral 「Documentation」 head
(`SidebarDocsPortalMenu`) instead of the app's name menu, and the
docs-navigation target as the body. The search field is drawn only when
a palette is mounted (Home's palette needs a host app).
- **`SidebarDocsPortalMenu`** (in `SidebarAppMenu.tsx`): the app menu's
list, extracted into `AppMenuList` and shared by both menus, under 「Your
apps」, with no row checked and no app-scoped row (「Design layout」, 「Edit
app」), plus 「Add app」 for the viewers who may build. Choosing an app
opens `/apps/APP`.
- **`ShellPageActionsScope appless`**: the page header's group without
an app: the assistant, and `HelpMenu inApp={false}` with no app package.
Without it the group resolves the app from the navigation context or the
URL's second segment, which on the portal would be the last app or a
book slug.
- **`PortalDocsNav`** (console `DocsNav.tsx`): every book the portal's
index lists, under its app's heading, in the index's order
(`groupBooksByApp`, the index's own grouping). Each book is named by its
index card's label, so an implicit platform book reads as its app does
(「系统设置」), not as its package id's last segment (「Setup」). `DocShell` and
`DocPage` hand it to the sidebar on `/docs…`.
- **「All documentation」 the first docs row in both docs sidebars** (seat
ruling on objectstack-ai#37241: the back link is shell navigation, not a docs row):
whenever the column is in the shell sidebar, `DocsNav` draws it as the
first docs entry, marked current on the portal index. In an app's docs
reader and in `AppDocsNav` it sits directly under 「← Back to APP」 and
above the filter and the books; on the portal, which has no back link,
it is the column's first row. The phone guard is the slot itself: a
phone mounts no docs sidebar, so the column the page draws keeps the
link at its foot, unchanged.
- **DELIBERATE CORRECTION** of objectstack-ai#37193's pending changeset
`.changeset/37150-docs-pages-in-app-shell.md` (seat ruling on objectstack-ai#37241).
One sentence. It was "The `/docs` portal is not changed by this
release." and now reads "The `/docs` portal draws in the same frame from
768 px up too, in a variant that belongs to no app (its own entry
describes it)." `check-empty-changeset` is red on this by design; the
dispatching seat's record confirms it.
- `content/docs/frontend/app-shell.mdx`: the stale line "the app bar …
on an app's docs pages, which mount no sidebar" is corrected. An app's
docs pages draw the shell from 768 px up, and the portal draws the same
frame with a neutral head.
- `App.tsx`: `DocsPortalRoute` mounts `DocsPortalShell` in place of
`DefaultHomeLayout variant="docs"`. No route, redirect or URL changes.

Files to read first, by risk:
1. `ui/packages/app-shell/src/console/docs/DocsPortalShell.tsx`: the
variant switch, and what it does not write.
2. `ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`: the
`docsPortal` hunks (`shellChrome`, the head, the body condition,
`hasCommandPalette`).
3. `ui/apps/console/src/pages/DocsNav.tsx`: `inSidebar` (the first-row
move and its phone guard), and `PortalDocsNav`'s labels.

## Tests

- New `DocsPortalShell-37197.test.tsx`: real `DocsPortalShell`,
`AppShell`, `ShellPageActionsScope`, docs slot and `NavigationProvider`.
- `/docs`, `/docs/crm` and `/docs/crm/crm_intro` at 768 and 1440 px: no
`header` element, the sidebar in `docsPortal` mode with no
`activeAppName`, the page's tree drawn in the sidebar. PHONE CONTROL for
each path at 390 px: Home's docs frame, no sidebar.
- No app guessed: opened cold (1440 and 390), the context is `home`, no
current app, and no last-app key is in storage; that storage check
carries the pin. The `rememberApp` spy is only a tripwire for a future
frame that would remember an app. After an app was open, on a
package-named path, the head names no app, the help menu gets
`inApp=false` and no package, and the current app stays as it was.
- The app-less group, and the collapsed expand button in the docs header
with no corner fallback; phone control.
- Design point 5, the default accent (seat L1 S1): after an app whose
`branding.primaryColor` was open, with `--primary`/`--accent` left on
the root, the portal's root carries neither. Phone control.
- The banners (seat L1 S2): at 1440 px a standing banner mounted above
the routes (as `ConsoleShell` does) is drawn exactly once, inside the
portal's banner box at the top of the content. A disconnected adapter
shows the connection notice in that box; a connected one shows none.
PHONE CONTROL: the banner stays where the shell mounts it, drawn once,
with no box and no notice.
- `docs-portal.test.tsx`, new block `objectstack#37197`: the portal tree
in the shell (first row, `aria-current` on the index, sections in the
index's order, no back link, no in-page column). A book open in the tree
with the article current. The label fix (an app labelled `System
settings`, so not 「Setup」). Every portal URL form in the shell: index,
SLUG, book NAME, NAME/DOC, doc-name-is-also-a-book-name, canonical
SLUG/DOC, implicit package book, slug-that-is-another-book's-name. In an
app's reader and docs index, 「All documentation」 is the first docs row:
the back link stays the column's top row, and 「All documentation」
precedes the filter and the first book. PHONE CONTROL: the in-page
column of the portal and of an app keeps it last.
- `SidebarAppMenu-36112`, new block: the portal head reads
「Documentation」, lists the apps under 「Your apps」 with none checked,
opens any app by its address, gives 「Add app」 to an admin who may author
and no app-scoped row; member control.
- `UnifiedSidebar.footerSlot-36739`, new block: in Home's context with a
remembered app, `docsPortal` draws the portal head (not the app's), the
page's tree as the body and the account foot; no search field without a
palette; control without `docsPortal`.
- **objectstack-ai#37193's N1**, in `ConsoleLayout.noTopBar-36112`: a docs route with
`connectionState: 'disconnected'` shows `ConnectionBanner` in the
banners box at 1440 px. A collapsed docs route draws the expand button
in the docs header (a `DocShell` stand-in that reads the shell's expand
slot) and no corner fallback. Each has a phone control.

Ablations, each via `scripts/ablation-replace.mjs`: anchor 1 to 0 on
disk, restored blob equal to HEAD, `git diff HEAD` empty. The tests
import `src`, so there is no `dist` leg.
1. The variant switch, `DocsPortalShell` `if (phone) {` changed to `if
(phone || true) {`: `Tests 7 failed | 4 passed (11)`. Every desktop pin
went red; the four phone controls stayed green.
2. The first-row switch, `DocsNav` `inSidebar` forced false: `Tests 4
failed | 76 passed (80)`. The two portal-tree tests and the two
app-sidebar tests went red; the PHONE CONTROL stayed green. Re-run after
the reorder, at `2961b4a9`: the same 4 red, PHONE CONTROL green,
restored blob == HEAD.
3. The label fix, `{ ...resolved, label: card.label }` changed to
`resolved`: the label test went red (`1 failed`).
4. The app-less group, `appless` removed from the scope: the
no-guessed-app help test went red (`1 failed | 10 passed`).
5. S1, `AppShell` handed the host app's `branding` (anchor
`navbar={null}` replaced): `Tests 1 failed | 15 passed (16)`, the
default-accent pin red, its phone control green. A first attempt put the
anchor inside its own replacement; the tool refused it ("a drop of 0")
and restored the file, so it measured nothing and was re-run.
6. S2, `ChromeBannerHost` deleted: `1 failed | 15 passed (16)`, the 1440
banner pin red. `ConnectionBanner` deleted: `1 failed | 15 passed (16)`,
the notice pin red. The PHONE CONTROL stayed green in both.

Local runs. Each ran under `os-verify-lock` with `--maxWorkers=2`; every
one reports `VERDICT command-exit 0` unless it says otherwise.

<details><summary>Test readings</summary>

- At `95a165e3`, before the main merge, the five touched or new suites
with `--reporter=verbose` (every new block listed): `Test Files 5 passed
(5) / Tests 140 passed (140)`.
- After merging `origin/main` (`0a1b69c0`), the closure was rebuilt
(`turbo run build --filter='@object-ui/console^...'`, `Tasks: 75
successful, 75 total`). Then a NARROWED suite ran at `1ffad1a4`: 186
files, every app-shell and console test naming `ConsoleLayout`,
`UnifiedSidebar`, `SidebarAppMenu`, `ShellPageActions`, `HomeLayout`,
`DocsPortalShell`, `sidebarDocsNavSlot`, `DocsNav`, `DocShell` or
`DocPage`, plus every console `pages/` test. Result: `Test Files 3
failed | 183 passed (186) / Tests 3 failed | 1680 passed (1683)`. The
three reds were tests that count what this change adds:
- `App.docsPortalLazy` stubbed the old portal frame but not the new one,
so the real shell's bell and agent reads escaped to the network;
- `expressionUser.mountSites.ratchet` counts expression mount sites, and
`DocsPortalShell` is a new one;
- `unsavedEditsLeave.census-13253` counts `UnifiedSidebar`'s
`onAppChange` reads, and the portal head's wrapped read is a new one.
All three were fixed in `7977d28b`, which changes tests only, and
re-run: `Test Files 3 passed (3) / Tests 12 passed (12)`.
- DECLARED NARROWING: the full app-shell and console suites were not run
locally; CI `Test UI` runs them.
- `type-check` for `@object-ui/app-shell` and `@object-ui/console` at
`1ffad1a4`: `VERDICT command-exit 0` (the later commit changes tests
that the same programs compile). Lint on the changed files: 0 errors,
and no new warning after typing the shared list's props.

</details>

<details><summary>Rework 2 readings at fecd4e2 (seat L1 7155677032: S1
accent pin, S2 banner host, S3 + N1 note wording, N2)</summary>

- The closure was rebuilt (`Tasks: 75 successful, 75 total`). Then
`DocsPortalShell-37197`, `ConsoleLayout.noTopBar-36112`,
`App.docsPortalLazy` and `expressionUser.mountSites.ratchet` ran: `Test
Files 4 passed (4) / Tests 31 passed (31)`, `VERDICT command-exit 0`.
- `type-check` for app-shell and console at `e78f292d`: `VERDICT
command-exit 0`. For app-shell again at `fecd4e23`, after the hook was
moved to `useSyncExternalStore`: exit 0.
- Lint on the two changed source files: 0 errors and no warning. The
first spelling of the hook drew `react-hooks/set-state-in-effect`; that
is why it was rewritten.
- S3: the 37197 note now opens "was the one documentation page that
still drew a top bar on a desktop". `/organizations` and Home's
no-product-app state still draw one. N1: search is described "when there
is an app to search". The note also names the standing notices at the
top of the page's content.
- `app-shell.mdx` needed no edit: its portal sentence ("draws the same
frame there", the content area carrying the standing banners) is now
true at this head.
- The derived gate list at `fecd4e23` is unchanged (71). Of the 70 light
ones, 68 exited 0 at once. `check:skill-examples` exited 3
(`client-react` was not built in the fresh worktree); after building it,
exit 0. `check-empty-changeset` exited 1: the DELIBERATE CORRECTION,
confirmed by the seat's contract review. ui `vitest run scripts/`: `Test
Files 172 passed | 2 skipped (174)`. `--ran`: `71 derived, 71 run, 0
NOT-MEASURED (a DERIVED zero)`. overlap-check: clean against `main`,
objectstack-ai#37166, objectstack-ai#37168 and objectstack-ai#37169, and exit 1 against objectstack-ai#35129 only (accepted);
the push was gated on that.

</details>

<details><summary>Rework readings at 2961b4a (seat ruling: order,
changeset, app-shell doc)</summary>

- The closure was rebuilt (`Tasks: 75 successful, 75 total`, 74 cached).
Then `apps/console/src/pages/`, `packages/app-shell/src/console/docs/`,
`UnifiedSidebar.footerSlot-36739`, `SidebarAppMenu-36112` and
`ConsoleLayout.noTopBar-36112` ran: `Test Files 177 passed (177) / Tests
1656 passed (1656)`, `VERDICT command-exit 0`.
- `dispatch-gates --commands` at `2961b4a9` derived 71 commands (the
changeset and the doc add the docs families). Of the 70 light ones, 68
exited 0 at once.
- `check:skill-examples` exited 3: it refused for a missing
`@objectstack/client-react` build. After building that package it ran
with exit 0 (`350 prose examples type-check`).
- `check-empty-changeset` exited 1: the DELIBERATE CORRECTION above, red
by design.
- `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2
skipped (174)`.
- `--ran`: `71 derived, 71 run, 0 NOT-MEASURED (a DERIVED zero — all 71
recorded an exit code and none of them is 3)`.

</details>

## Acceptance notes

- **N2 and the stage-2 views** are real renders against the showcase
example on a fresh database: zh-CN browser locale, `deviceScaleFactor`
2, this branch's Console on Vite. They were committed at `672b06dd` and
removed in the next commit, so the PR's file list carries no binaries:
- [1 · /docs at
1440](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/1-portal-landing-1440.png):
the 「文档」 head, 「全部文档」 first and current, books under 「功能展示」 and 「系统设置」,
and the Setup book named 「系统设置」 as its card is. The page's one `header`
element is the index's own title block, not a bar.
- [2 · a doc
open](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/2-portal-doc-open-1440.png):
no `header` element on the page.
- [3 · the head menu
open](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/3-portal-head-menu-open-1440.png):
「你的应用」, the two apps and 「添加应用」; 0 checked rows; the URL is unchanged
(measured).
- [4 ·
collapsed](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/4-portal-sidebar-collapsed-1440.png):
one expand button, in the docs header, and no corner fallback
(measured).
- [5 · 768
px](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/5-portal-landing-768.png).
- Phone 390 px, unchanged: [6 ·
landing](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/6-phone-portal-landing-390-unchanged.png)
and [6b · a
doc](https://raw.githubusercontent.com/objectstack-ai/objectstack/672b06dd86559c2061bc0c8e975cf325dc5de7d4/design/37197/stage2/6b-phone-portal-doc-390-unchanged.png).
- [7 · an app's docs
reader](https://raw.githubusercontent.com/objectstack-ai/objectstack/0b9b82809015d40074d9aa71ea5a3528cd44b20d/design/37197/stage2/7-app-docs-reader-1440.png):
「← 返回功能展示」, then 「全部文档」 as the first docs row. Re-captured at `2961b4a9`
and committed at `0b9b8280`.
- **N2** · [8 · an app's docs page that is not the reader (not found),
the `AppDocsNav`
column](https://raw.githubusercontent.com/objectstack-ai/objectstack/0b9b82809015d40074d9aa71ea5a3528cd44b20d/design/37197/stage2/8-app-docs-not-found-appdocsnav-1440.png),
with the same order. Re-captured too.
- No last-app key was found in the browser's storage after any desktop
view (measured on each).
- Home's command palette keeps its scope: the host app it searches is
read the way Home reads it, as the portal's old frame did, and is never
written back. That is search scope, not a frame app: the sidebar head,
branding and help name no app.
- The portal's desktop sidebar carries the host's footer slot (the
administrator's 「开始使用」 checklist in the screenshots), as every shell
sidebar does.
- Book labels in an **app's** docs column (`usePackageDocsNavBooks`)
still read the book's own label. For an implicit book of an app's own
package that is the humanized package id. The approved scope was the
portal tree, so this is noted, not changed.
- `overlap-check` reports exit 1 against objectstack-ai#35129, the bot-maintained
Version Packages PR (`chore: version packages`). That PR deletes every
pending changeset, so the DELIBERATE CORRECTION above meets it as a
modify/delete conflict on `.changeset/37150-docs-pages-in-app-shell.md`.
Nothing was resolved by hand. `origin/main` and every sister PR (objectstack-ai#37166,
objectstack-ai#37168, objectstack-ai#37169) merge cleanly.

## Verification

Two-minute check: run `pnpm --dir ui exec vitest run
packages/app-shell/src/console/docs/__tests__/DocsPortalShell-37197.test.tsx`.
Expected: 16 passed, among them three per-path desktop pins and five
PHONE CONTROLs. Or open `/docs` at 1440 px: no top bar, a 「文档」 head, and
「全部文档」 first in the sidebar.

<details><summary>Gate readings</summary>

- `dispatch-gates --commands` (objectstack-ai/objectstack, 16 paths
against merge base `93bd45957`; the list is unchanged at the final head)
derived 38 commands. 37 ran at `e4db1f12`, and `pnpm --dir ui exec
vitest run scripts/` ran under the lock at `eea1765f`: `Test Files 172
passed | 2 skipped (174)`. All exited 0 except
`check:test-source-alias`. It asked for the palette's lazy
`@object-ui/plugin-detail` load to be paid at collection in the new
suite; fixed in `1ffad1a4` and green since.
- `--ran` reconciliation: `38 derived, 38 run, 0 NOT-MEASURED (a DERIVED
zero — all 38 recorded an exit code and none of them is 3)`.
- At the final head `7977d28b`, these re-ran and exited 0:
`check:test-source-alias`, `check:cross-package-test-inputs`,
`check:nul-bytes`, `check:type-check-debt`, `check:tier-file-adoption`,
`check-empty-changeset`, `check-changeset-no-major`, and under `ui/`
`check:new-line-citations` (`0 new citation(s)`).
- `overlap-check` before every push: `VERDICT clean exit 0`.
`origin/main` merges cleanly, as do objectstack-ai#37166, objectstack-ai#37168 and objectstack-ai#37169, which
share `app-shell/src/index.ts` or `SidebarAppMenu-36112.test.tsx`.
- Size at `fecd4e23`: 21 files, +1323 / -152. No governed path.

</details>

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…tire the 18.6.0 i18n keys no code reads (objectstack-ai#37230)

Fixes objectstack-ai#37223

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no file under skills/ or content/docs names any of
the 67 retired keys (git grep, each key)

## 维护者速读

- 用户无感:合并后主干进入预发布阶段,下一次出版本得到 19.0.0-next.0;同时把 18.6.0 已发布、现已没有代码读取的 67
条界面文案在新大版本里声明退役。
- 属于「界面文案清理」大卡;按你「下一版是大版本 19.0.0」和「走预发布路线」两次裁决,照上一次开大版本(18)时的同款做法。
- 合并本身不发布任何东西:每一次预发布都要你批准才会发出,普通安装拿到的仍是
18.x;若有部署改写过这些文案,改写不再生效;在切出第一个预发布版之前,删掉三个新文件即可撤回。
- 要你做的两件事(按 7158089101 的裁决 A):① 合并前给本单加上 `allow-major` 标签,作为你对 19.0.0
大版本的人工确认;在加标签之前,「Check Changeset」因级别检查(`Metadata-protocol: none` 旁有
`major`)保持红色,属预期,门禁本身不改。② 由你亲自合并本单(和上次开 18 一样,席位只审不合)。

## What changes

1. **`.changeset/pre.json`**, written by `pnpm changeset pre enter next`
(`@changesets/cli` 3.0.3) and committed as the tool wrote it: `{ "mode":
"pre", "tag": "next" }`. ⛔ No `changeset version` output is committed,
and nothing was published.
2. **`.changeset/37223-v19-line-opens.md`**, front matter
`"@objectstack/spec": major`: the v19 line's opening note (rulings
7153326968 and 7153441862), `Clause-②: no`, and its ADR-0087
`not-required (no-migration-prescription)` disposition, in the form the
v18 opening (objectstack-ai#22084) used. Why spec: the protocol lockstep admits
`PROTOCOL_VERSION` one major ahead only in pre mode WITH a pending
`@objectstack/spec` major, and `scripts/sync-protocol-version.mjs`
derives the protocol version from spec's major.
3. **`.changeset/37223-i18n-removed-released-keys.md`**,
`'@object-ui/i18n': major`: the **BREAKING** banner, its own ADR-0087
disposition, and the 「Removed translation keys」 list (67 keys, each
once, with its locales). Two majors in one `fixed` group still give one
19.0.0; the changeset says so.
4. **`ui/packages/i18n/scripts/released-keys-removed.mjs`** (zero
third-party deps): reads the package's published catalogues out of git
at the tag `@object-ui/i18n@18.6.0` and at a ref (default
`origin/main`), and prints every key the tag has that the ref lacks,
grouped by namespace, with the locales it was removed from. Which files
are catalogues is read from the package: `package.json` `exports`, the
all-packs door `src/locales/index.ts`, and each non-pack-shaped
namespace's `index.ts` (`studio`).

No code change, no key restored, no `PROTOCOL_VERSION` edit, no
`allow-major` label, no edit to `.changeset/config.json`, to either
changeset guard, or to `release.yml`.

## Reproduction

```
$ node ui/packages/i18n/scripts/released-keys-removed.mjs
Keys in @object-ui/i18n@18.6.0 absent at origin/main (d15e439): 67
## locales (32)    every one removed from all 11 locales (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant)
## studio (35)     every one removed from both locales the namespace ships (en, zh)
```

The 35 Studio keys are the ones the card expected (objectstack-ai#36501, objectstack-ai#36652). The
32 language-pack keys are extra; some of them are also named in earlier
pending `patch` changesets, and this one lists the whole 18.6.0 set once
for the major's notes. Keys that the open PRs objectstack-ai#37169, objectstack-ai#37166 and objectstack-ai#37168
remove are still on main, so they are not reported or declared here. No
non-test file under `ui/`, `apps/` or `packages/` quotes any of the 67
keys.

## The no-major guard reads `pre.json` from the head checkout

| Leg | Reading at `e43e989948` |
|---|---|
| As committed, `node scripts/check-changeset-no-major.mjs --base
origin/main` | exit 0: `Changesets is in pre-release mode (tag: next) —
major bumps are the expected product of an RC window; skipping the
no-major guard.` |
| Control, `.changeset/pre.json` deleted from the working tree only |
exit 1: `This PR introduces changeset(s) that declare a major bump.` |
| Restored with `git checkout HEAD -- .changeset/pre.json` | `git diff
HEAD` empty (0 bytes), blob hash equals the HEAD blob, guard exit 0
again |

## Pins (throwaway detached worktree at `e43e989948`, never committed,
removed after)

- `pnpm changeset version` exits 0. All 112 `fixed`-group members read
`19.0.0-next.0`. `pre.json` is unchanged. `packages/spec/CHANGELOG.md`
and `ui/packages/i18n/CHANGELOG.md` each open `## 19.0.0-next.0` / `###
Major Changes`.
- `node scripts/sync-protocol-version.mjs` (the root `version` script's
next step) rewrites `PROTOCOL_VERSION` in
`packages/spec/src/kernel/protocol-version.ts`: `PROTOCOL_VERSION 18.0.0
→ 19.0.0 (lockstep with @objectstack/spec@19.0.0-next.0)`.
- `protocol-version.test.ts` on that tree: `Test Files 1 passed (1)`,
`Tests 3 passed (3)`.

## `release.yml` in pre mode: `next` gets the prerelease, `latest` stays
18.x

A reading of the files; nothing edited, nothing run.

- Job `publish`, step `Publish to npm + push version tags` runs `pnpm
run release`, which ends in `scripts/release-publish.sh`, which runs
`changeset publish` with no `--tag`.
- `@changesets/cli` 3.0.3 `getReleaseTag`
(`dist/getPublishPlan.mjs:599-601`): with a pre state and no `--tag`,
the tag is `preState.tag` = `next`, unless every published version of a
package is already a `next` prerelease. `dist/publish.mjs` refuses a
custom tag in pre mode.
- `npm view` today: `@objectstack/spec` and `@object-ui/i18n` read
`latest` = `18.6.0`, `next` = `0.0.0-next-20261125013212` (a snapshot,
whose prerelease id is not `next`), so neither is "only-pre". Each
publishes `19.0.0-next.0` to `next`; `latest` stays `18.6.0`.

## Acceptance notes

- **Open question: the level axis stays red.**
`check-changeset-no-major.mjs`'s level axis refuses `Metadata-protocol:
none` beside any entry at `minor` or above (verdict `none-minor`). It
runs whatever the pre mode is, and only `allow-major` skips the step.
Measured at `e43e989948` with a `pull_request` payload carrying this
body's two lines: the no-major guard is exempt (pre mode), and the level
axis exits 1. The v18 opening passed because its body had no
`Metadata-protocol:` line. This PR changes neither the gate nor the
declaration.
- **The version-PR lane refuses the protocol move.** `release.yml`'s
`version-pr` validation marks a pass that rewrites
`packages/spec/src/kernel/protocol-version.ts` as UNVALIDATED and
refuses it, because the example apps declare `engines.protocol: '^18'`
(`examples/app-crm`, `app-showcase`, `app-todo`) and the ADR-0087 D1
handshake would refuse them under 19. So the version step would sync the
constant, but that lane will not carry it: `PROTOCOL_VERSION` → 19.0.0
still needs its own reviewed PR (objectstack-ai#37229), which should also move the
example apps' `engines.protocol`. With this PR's pre mode and pending
spec major, the protocol lockstep admits the constant one major ahead.
- `pnpm check:pm-dispatch-gates` is green with `pre.json` tracked (`2313
cases pass`), and the objectstack-ai#22084 amendment (`CONSUMED_PRERELEASE_EXCLUDED`
in `scripts/check-adr-0087-registration.mjs`) is still on main. No gate
script is edited.
- Landing: the maintainer merges (precedent objectstack-ai#22084); seats review only.
The PR stays draft.

## Verification

Two-minute check: `node scripts/check-changeset-no-major.mjs --base
origin/main` prints the pre-mode exemption line and exits 0; `node
ui/packages/i18n/scripts/released-keys-removed.mjs` prints `67` on its
first line.

Read first:
1. `.changeset/pre.json` and `.changeset/37223-v19-line-opens.md`: the
line opening.
2. `.changeset/37223-i18n-removed-released-keys.md`: the list.
3. `ui/packages/i18n/scripts/released-keys-removed.mjs`, `discover()`.

<details><summary>Local gates at e43e989: 36 commands, all exit
0</summary>

```
exit 0 :: cd ui && node scripts/check-ui-root-lookups.mjs
exit 0 :: node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0 :: node scripts/check-adr-0087-registration.mjs --self-test
exit 0 :: node scripts/check-changeset-fixed.mjs
exit 0 :: node scripts/check-changeset-fixed.mjs --self-test
exit 0 :: node scripts/check-changeset-no-major.mjs --base origin/main
exit 0 :: node scripts/check-changeset-no-major.mjs --self-test
exit 0 :: node scripts/check-closing-keyword-parity.mjs
exit 0 :: node scripts/check-closing-keyword-parity.mjs --self-test
exit 0 :: node scripts/check-comment-mask-corpus.mjs
exit 0 :: node scripts/check-empty-changeset.mjs --base origin/main
exit 0 :: node scripts/check-empty-changeset.mjs --self-test
exit 0 :: node scripts/check-sdui-manifest.mjs
exit 0 :: node scripts/check-sdui-manifest.mjs --self-test
exit 0 :: node scripts/ci/snapshot-next.mjs --self-test
exit 0 :: node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0 :: node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0 :: node scripts/release-pending-publish.mjs --self-test
exit 0 :: pnpm check:adr-anchors
exit 0 :: pnpm check:changeset-gate-self-tests
exit 0 :: pnpm check:closed-ceremony-text
exit 0 :: pnpm check:dispatcher-error-vocabulary
exit 0 :: pnpm check:docs-image-tag
exit 0 :: pnpm check:driver-memory-census
exit 0 :: pnpm check:gitlink-declared
exit 0 :: pnpm check:nul-bytes
exit 0 :: pnpm check:pm-dispatch-gates
exit 0 :: pnpm check:published-files
exit 0 :: pnpm check:refd-timer-probe
exit 0 :: pnpm check:registry-log-declared
exit 0 :: pnpm check:rest-log-spy-declared
exit 0 :: pnpm check:skill-identifier-liveness
exit 0 :: pnpm check:test-source-alias
exit 0 :: pnpm check:tier-file-adoption
exit 0 :: pnpm check:undeclared-dep-imports
exit 0 :: pnpm check:watch-hint-literal
```

`node scripts/check-governed-merges.mjs --pr 37230`: `0 of 4 path(s) hit
the register` · `NOT governed` · `368 changed line(s) ≤ 3000`.

Dogfood battery (`!` title): `Test Files 487 passed | 3 skipped (490)`,
`Tests 4128 passed | 68 skipped (4196)`, lock VERDICT command-exit 0,
measured at `e90f9aa1b9`. The commits after it add `.changeset/` files
and rework a script nothing imports.

</details>

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

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…state; × returns to the list (objectstack-ai#37226)

Fixes objectstack-ai#36906

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 管理员在 Studio 的仪表盘、报表列表里点一项会直接进入应用里的编辑状态(仪表盘进编辑态、报表打开构建器),页头的 × 回到刚才的
Studio 列表(刷新后也在),报表列表的「新建」进入应用的新建报表页。
- 属于 Studio 重构专题:Studio 是某个应用的开发界面,这一步打通了 Studio 和应用之间的往返编辑。
- 从 Studio
报表列表新建的报表改由应用的新建报表页保存,和以前一样存进该包(已安装的应用存进它的定制包),只有保存那一刻定制包恰好用不了时才存到包外并提示列表里看不到它;出错会影响打开到哪里和新报表存在哪里,可以直接撤回,已存的报表留在原处,只有草稿的仪表盘和报表、以及已安装应用定制包里的仪表盘和报表暂时仍打开
Studio 原来的详情页。
- 无。

## What changes

Epic objectstack-ai#36890, decisions 3, 6, 13 and 15.

- **Studio opens a dashboard or a report in its app.** A plain open of a
dashboard or a report in Studio's list no longer shows the generic item
page. It opens the item's page in an app, using the arrival state the
design mode already uses: the dashboard opens in its edit state, the
report opens its builder. The Studio address is replaced, not stacked,
so browser Back from the app lands on the list.
- **Which app (decision 6).** It is the app the author came from, when
that app is one of the package's published apps, or when its menu opens
the item. Otherwise it is the package's first published app. With no
app, the item keeps the generic item page (decision 3). The same happens
on the cross-package leg, and whenever the address asks the item page
for one of its own tools (a tab, the draft review, a selection), so
History and the draft door's review links still land there. The rule is
shared with Studio's back link (`studioBackTarget`), so the two cannot
disagree. It lives in a new pure module, `studioAppEdit.ts`, and the
area's step is `StudioAreaAppOpen.tsx`.
- **× back to Studio (decision 15).** The app address carries `?studio=`
with the Studio list it came from, filters and sort included. It is
built and read only through `studioAddress.ts` (`withStudioReturn`,
`readStudioReturn`) and registered as a reserved console param. The
value is read as untrusted: only a Studio address on this origin is
followed. While the param is present, the dashboard page and the report
page draw a × that returns to that list, after a reload too. The report
builder's own × does the same. Leaving unsaved edits asks first.
- **Report New (decision 13).** Studio's report list New opens
`/apps/APP/reports/new` in the app picked the same way. Its × goes back
to the list, and the saved report's page keeps the way back. With no
app, the area creates as before. Dashboard New is objectstack-ai#36907's, untouched.
- **Where that new report is saved.** Opened from Studio, the new-report
page saves the report into the app's package, the way a new view made in
an app is saved (`resolveRuntimeCreatePackage`): the package when it is
writable, else its `.custom` pair through the ensure door; when neither
can be had, naming no package, as views fall back, and then an info
notice says the report was saved outside the app's package, so the
Studio list does not show it (`report.builder.savedOutsideApp`, the
counterpart of a view's `onSavedOutsideApp` notice). The draft, the
publish and the discard of a refused publish all name that package
(`saveAndPublishInPackage`), so on every other leg the report is in the
list × returns to. The console warning `resolveRuntimeCreatePackage`
prints on that fallback now names the type it saves (it said "the view"
for a report too): the function takes the type as its second argument.
On a read-only base whose pair door is closed (walled, or a kernel
package), report New no longer opens the app page: it goes back to the
list, as every create there does.
- **An item with no published version keeps the generic item page.**
Before handing over, `StudioAreaAppOpen` reads the item once, as the app
reads it (published, no draft preview, `?package=` the open package). No
published version (a draft only: an AI draft, a create whose publish was
refused), or a failed read, keeps Studio's generic item page, which is
the page that opens the draft. Only then are the package's apps read.
- **A dashboard made in Studio lands in its app, and Back skips the
create page.** The area's own create publishes and lands on the item,
which the gate forwards to the app. In a package's area, for a dashboard
or a report, that landing now replaces the create page's history entry
(`studioCreateLandsInApp`, read by `ResourceEditPage`), so Back from the
app lands on the list. Every other type, and Setup, land as before.
- **The report builder's × and the new-report page's × ask over unsaved
edits outside Studio too.** Both handlers already received `dirty` for
the Studio leg; the ask now runs before either leg.
- **No dashboard edit on a phone.** `useDashboardEditOffered` now also
requires a window at least `sm` (640 px) wide, the width from which the
edit state's side panel is drawn. Before, only the button's CSS hid it.
A landing that asks for the edit state on a narrower window is cleared
and opens nothing, so neither Studio nor the design mode can put a phone
into the edit state.
- New `studioReturn` strings, and `report.builder.savedOutsideApp`, in
every bundled locale (additive only; no released key removed). zh-Hant
is regenerated from zh-Hans by its generator.

## Why

The maintainer asked that dashboards and reports listed in Studio open
straight into the front end's design page (epic objectstack-ai#36890). The epic's
decisions fix which app, the fallback, the report New target and the
address-borne way back.

## Tests

- New `studioAppEdit.test.ts`: decision 6, rule by rule; the new-report
variant; agreement with the back link; the app addresses.
- `studioAddress.test.ts`, new top-level describe: the `?studio=`
builder and reader, the refusals both ways (another origin,
protocol-relative, `/studiox`, a backslash, `javascript:`), and the
reserved-param registry.
- New `StudioAreaAppOpen-36906.test.tsx`, through the real
`StudioMetadataArea` routes: the app picked, the arrival carried, the
return address (list context kept, item-only params dropped), the
replace, and every open that keeps the item page (a tab, the review, no
app, the cross-package leg, other types). Also report New, and its
fallback.
- `DashboardView.inPageEdit-36372.test.tsx`, new describe: landing from
Studio, × target, × after a reload, the dirty prompt, the phone landing
(cleared, no edit, no Edit button), and an off-Studio value drawing no
×.
- `ReportView.designModeExclusion-36692.test.tsx`, new describe: landing
in the builder, the builder × to Studio, its dirty prompt, the page ×
beside Edit, and the card's check: reached with the design mode already
on, no builder and no Edit, while × still goes back.
- `ReportNewPage-36692.test.tsx`, new describe: × to Studio, and Save
keeping `?studio=`. This round: Save from Studio names `packageId: P` on
the draft and the publish; on a read-only base it names the pair
(`P.custom`, asked of the ensure door); CONTROL: a refusing ensure door
falls back to the package-less save. × over an edit asks; declining
stays with nothing sent; agreeing goes back to the Studio list (and the
clean × asks nothing). Outside Studio: Save names no package and asks no
package door, and × over an edit asks.
- `StudioAreaAppOpen-36906.test.tsx`, previous round: a draft-only
dashboard row keeps the item page and reads no app; so does a draft-only
report and a failed read; `studioCreateLandsInApp` rule by rule. Its
"dashboard create → Save lands on the app's dashboard and Back lands on
the list" case drives the area's routes over a create STUB (`CreateStub`
reimplements the landing), so it pins the gate's forward and Back over a
replaced entry, not `ResourceEditPage`'s call site; that is pinned in
the new file below. A read-only base (`readOnly`, `customization` handed
in): its dashboard row opens in the base's app; a pair-row address
(`/studio/BASE.custom/metadata/dashboard/X?package=BASE.custom`) keeps
the generic page (the starting point of objectstack-ai#37237); report New opens the
base app's new-report page; with the pair door walled, or no
customization, report New goes back to the list.
- `ReportView.designModeExclusion-36692.test.tsx`, previous round:
outside Studio, a clean builder × closes without asking; over an edit it
asks, declining keeps the builder, agreeing closes it.
- New `ResourceEditPage.createLandingReplace-36906.test.tsx` (this
round), the REAL `MetadataResourceEditPage` over a real `MetadataClient`
and an in-memory server: under a `MetadataAreaHost` with a `packageId`,
a dashboard create's Save lands on the item with a REPLACE
(`useNavigationType`); CONTROLs: a `view` create in the same area, and a
dashboard create with no area host (Setup), land with a PUSH. Each case
also pins the save's `?package=` (the area's package, or none).
- `ReportNewPage-36692.test.tsx`, this round: the refusing-door CONTROL
now also asserts the info notice (once, the
`report.builder.savedOutsideApp` key) and that the console warning names
the report; the package, pair and outside-Studio cases assert no notice.
The clock is gone from the save cases: the Han romanizer `handleSave`
awaits is paid once in a `beforeAll` (a cold dynamic import, paid at
collection), and every save case waits on the address it asserts
(`waitFor`) instead of two `setTimeout(0)` ticks, so a late save can no
longer land in the next case.
- Ablation (one, on the behaviour change the tests pin): with the phone
gate removed from `useDashboardEditOffered`, the phone pin fails 1/1.
Restored, its blob equals HEAD's and `git diff HEAD` is empty.
- This round's ablations, each through `scripts/ablation-replace.mjs`
(anchor 1 to 0, restore proven blob == HEAD and `git diff HEAD` empty),
are listed under Verification.

## Acceptance notes

- **Read first, by risk (rework 2):** the notice line after the save in
`ReportNewPage.tsx` (fires only when Studio opened the page, the app has
a package, and none could be had), and the new real-page pin
`ResourceEditPage.createLandingReplace-36906.test.tsx`.
- **Read first, by risk (rework 1):** the save hunk of
`ReportNewPage.tsx` (where a report made from Studio is written: the
package, its pair, or none), the published-version read at the top of
`StudioAreaAppOpen.tsx`'s effect, and the `replace` on the create
landing in `ResourceEditPage.tsx` (shared by every type; it reads
`studioCreateLandsInApp`, true only for a dashboard or report in a
package's area).
- **Read first, by risk (first round):** `StudioAreaAppOpen.tsx` (async
app pick and replace; the fallback), the `useDashboardEditOffered` and
arrival hunks in `DashboardInPageEditor.tsx` and `DashboardView.tsx`
(the phone gate now also governs the design mode's landing), and the
`?studio=` reader in `studioAddress.ts` (an address-bar value followed
by a navigate).
- `StudioMetadataArea.tsx` is kept narrow: one import, the item open
wrapped in `StudioAreaAppGate`, and the create split. Open PRs objectstack-ai#37089,
objectstack-ai#37168 and objectstack-ai#37169 edit the same file in other hunks. `overlap-check`
merges cleanly with all three at this head. Whichever lands later merges
main.
- **Callers of the persistence path.** `runtime-metadata-persistence.ts`
changes in one place this round:
`resolveRuntimeCreatePackage(appPackageId, type, doors?)` takes the type
it resolves for, only so its fallback warning names it; its answer is
unchanged, and its two internal callers pass the type they save
(`view`). The new-report page now also calls two of its existing
exports: `resolveRuntimeCreatePackage` (other callers:
`createRuntimeMetadata` and `saveAndPublishRuntimeMetadata` themselves,
for views only) and `saveAndPublishInPackage` (other callers:
`saveInPlace`, the in-page dashboard and report Save, and
`setup/publicForms.ts`). `saveAndPublishRuntimeMetadata`'s other callers
(`objectViewViewSharing.ts`, `objectViewViewCrud.tsx`,
`setup/publicForms.ts`) and `createRuntimeMetadata`'s
(`objectViewViewCrud.tsx`, `ObjectDataPage.tsx`) are untouched.
- **Outside Studio, a new report is saved where it was before.** The
new-report page reached from the app's own reports index still saves
naming no package, and asks no package door (pinned). Only the page
opened from Studio's report list resolves a package.
- **Draft-only check (M2): one read, not the list row's mark.** The read
covers every way into the item address: a list click, a typed or shared
address, and the area's create landing on the item. The list row's draft
mark would cover the click only. The read is asked as the app asks it,
so the two cannot disagree.
- **A pending Studio draft over a published version.** The item has a
published version, so it opens in the app, which shows the published
version. A dashboard's edit state then refuses to open, with the
existing toast 「This dashboard has unpublished changes in Studio.
Publish or discard them there, then edit it here.」, so the page stays a
viewer. A report's page shows the published version, and its builder
opens on the pending draft's content (the report's Edit reads the stored
draft layer first, `authoredBuffer`); the builder's Save is then refused
with 「This report has unpublished changes. Publish or discard them
above, then save.」, and nothing is written over the draft (the
first-write pin). Either way the draft stays Studio's to publish or
discard. Read from the code at this head, not walked.
- Reload (seat ruling: keep as shipped): after a reload, × back to the
Studio list survives, but the editor does not reopen. A reloaded or
shared address never opens an editor by itself; that is the arrival
modules' rule.
- Card item 5 (a dashboard saved on an installed app lands in `.custom`)
is pinned at unit level by the existing case "an installed package saves
into its customization pair". It is NOT MEASURED live on HotCRM: no
HotCRM checkout is in this session. That leg carries to objectstack-ai#36910.
- Follow-up card filed: objectstack-ai#37237. In this PR, a `.custom` pair's
dashboards and reports keep the generic item page (decision 6, rule 3);
objectstack-ai#37237 resolves them through the base package's apps.

## Verification

Two-minute check: open Studio for a writable package with a published
app, go to Reports, press New, pick a data source and a measure, name
it, and Save. Expected: the report's page in the app, with a 「Back to
Studio」 ×; click it, and the new report is in the Studio list.

Rework 2's readings are at head `298361bd` (this branch with
`origin/main` `057cedfa` merged in) unless a line names another head.
The previous rounds' readings below keep their own heads (`08107d2f`,
`727300e5`).

<details><summary>Live walk-through, this round (per-agent stack; CRM
example plus one writable package)</summary>

The stack is a fresh `examples/app-crm` backend (`pnpm dev:crm --
--fresh`) with the Console served by Vite from this branch's `ui/`
source, driven by Playwright as the seeded admin, at `727300e5`. In this
stack the CRM package is a read-only code package, so it walks the
read-only base leg. A second package, created writable through `POST
/api/v1/packages` with one published app, walks the writable leg.

Writable package (11 PASS, 0 FAIL):
- A dashboard staged as a draft only (`PUT ?mode=draft`), opened at its
Studio row address, stays on Studio's generic item page.
- Studio's dashboard New, then Save: lands on `/apps/PKG/dashboard/NAME`
with the way back to the dashboard list. The app page shows the
just-published dashboard in its edit state (no 「not found」). Browser
Back from there lands on the dashboard list, not on the create page.
- Studio's report New opens the app's new-report page. After picking a
data source and a measure and saving, it lands on the report's page with
the way back. `GET /api/v1/meta/report/NAME?package=PKG` answers 200
with `packageId: PKG`. × returns to the report list, and the new report
is in it.
- No page errors.

Read-only CRM package:
- Report New, then Save: the server holds the new report in
`com.example.crm.custom` (a read at `?package=com.example.crm` answers
409 naming that pair as the holder). × returns to the CRM report list,
and the new report is in it.
- Dashboard New there is the area's own create in the pair (unchanged).
Its Save lands on the pair's item page, which keeps the generic page (no
app of its own; objectstack-ai#37237). Back lands on the list.
- No page errors.

HotCRM: NOT MEASURED, carried to objectstack-ai#36910.
</details>

<details><summary>Tests, rework 2 (head `298361bd` unless
named)</summary>

- The six pin files (`ReportNewPage-36692`,
`ReportView.designModeExclusion-36692`, `StudioAreaAppOpen-36906`,
`studioAppEdit`, `studioAddress`, `DashboardView.inPageEdit-36372`) plus
the new `ResourceEditPage.createLandingReplace-36906`, default workers,
3 runs on this merged tree: each run lock VERDICT command-exit 0, Test
Files 7 passed (7), Tests 95 passed (95). The six alone, 3 runs at
`35c94a71` (merged with `origin/main` `ede9b91f`): each 6 passed (6), 92
passed (92).
- The seat's S3 red (2 failed of 92 on the merged tree) did NOT
reproduce on this box: the six at the merge commit `ad67a645`, before
the fix, ran 92 of 92 green once. So the clock is shown another way:
with `loadHanRomanizer` slowed by 100 ms (a mutation through
`scripts/ablation-replace.mjs`, restored blob == HEAD), the previous
round's test file fails its two clock-bound save cases (plus its
refusing-door CONTROL, which also lacks the new `toast.info` mock),
while this round's file passes 13 of 13.
- At `35c94a71`, the wider set: every `ResourceEditPage*`,
`runtime-metadata-persistence*`, `Report*` and `DashboardView*` test,
`urlParams.test.ts`, `views/studio-design/`, `views/studio-detail/` and
`packages/i18n/`. Lock VERDICT command-exit 0, Test Files 505 passed
(505), Tests 4838 passed, 13 skipped.
- `pnpm --filter @object-ui/app-shell run type-check`, both tsc
programs, at `35c94a71`: lock VERDICT command-exit 0, 0 `error TS`. (The
final merge brings no app-shell or i18n file.)
- eslint on this round's changed ui files: 0 errors; the 15 warnings are
existing ones (`no-explicit-any`, `only-export-components`).
- Ablations this round, each through `scripts/ablation-replace.mjs`
under the lock (anchor 1 to 0, restore proven by blob == HEAD and `git
diff HEAD` empty):
8. The call site, `replace: studioCreateLandsInApp(areaHost?.packageId,
type),` to `replace: false,` in `ResourceEditPage.tsx`: the new
dashboard REPLACE case fails (1 failed, 2 passed of 3); both CONTROLs
stay green.
9. The notice line removed from `ReportNewPage.tsx`: the refusing-door
CONTROL fails (1 failed, 12 passed of 13).
</details>

<details><summary>Tests, previous rounds</summary>

- At `08107d2f`, the seven touched test files (`ReportNewPage-36692`,
`ReportView.designModeExclusion-36692`, `StudioAreaAppOpen-36906`,
`studioAppEdit`, `studioAddress`, `DashboardView.inPageEdit-36372`,
`urlParams`): lock VERDICT command-exit 0, 7 files, 99 tests passed.
- At `727300e5`, the wider set: every `DashboardView*` and `Report*`
test, every `ResourceEditPage*` test, every
`runtime-metadata-persistence*` test, `views/studio-design/`,
`views/studio-detail/`, `src/__tests__/`, `src/preview/`,
`urlParams.test.ts` and `packages/i18n/`. Lock VERDICT command-exit 0,
585 of 585 files, 5,662 passed, 13 skipped.
- `pnpm --filter @object-ui/app-shell run type-check`, both programs, at
`08107d2f`: exit 0, 0 `error TS`.
- eslint on the nine changed ui files: 0 errors. The warnings are
existing ones.
- Ablations, each through `scripts/ablation-replace.mjs` under the lock
(anchor 1 to 0; restore proven by blob == HEAD and `git diff HEAD`
empty). ui tests resolve `src` directly, so no `dist` leg applies:
1. New-report page, the ask removed: the two "x over unsaved edits" pins
fail (2 of 13).
2. New-report page, `dirty &&` dropped (asks on a clean x): the two
clean-x pins fail (2 of 13).
3. New-report page, the package resolve replaced by `null`: the package
pin, the pair pin and the refusing-door CONTROL fail (3 of 13). The
CONTROL fails because no door is asked at all.
4. Report builder, the ask removed: the Studio dirty pin and the new
outside-Studio pin fail (2 of 8).
5. `StudioAreaAppOpen`, the no-published-version fallback disabled: the
two draft-only pins fail (2 of 16).
6. `studioCreateLandsInApp` forced to `false`: the create-then-Back pin
and the rule pin fail (2 of 16). Corrected in rework 2: this reaches the
pure rule and the create stub's own copy of the landing in
`StudioAreaAppOpen-36906`, not `ResourceEditPage`'s call site (the
seat's call-site ablation left that file green, 16 of 16). Ablation 8
above reaches the call site.
7. Report New on a read-only base, the pair-door condition removed: the
closed-door pin fails (1 of 16).
</details>

<details><summary>Local gates, rework 2 (`dispatch-gates.mjs
--commands`, 73 families)</summary>

- At `298361bd`: all 74 derived families exit 0, each recorded as `cmd
:: exit N` and reconciled with `--ran`: "74 derived famil(ies) accounted
for — 74 run, 0 NOT-MEASURED". The ui `scripts/` family ran under the
lock with `--maxWorkers=1`: Test Files 172 passed, 2 skipped. (The same
72 non-ui families also ran at `35c94a71`, all exit 0 after
`check:skill-examples` first refused with exit 3 because
`@objectstack/client-react` was not built in this worktree, then exit 0
once built.)
- Also at `298361bd`: `check:test-source-alias` exit 0, ui
`check:i18n-keys` exit 0 (every call-site key resolves against the en
pack), `check:nul-bytes` exit 0, `check-platform-checklist
--changed-from origin/main` exit 0 (0 anchored files), and
`overlap-check` VERDICT clean exit 0 (`origin/main` `057cedfa`, objectstack-ai#37249,
objectstack-ai#37210, objectstack-ai#37169, objectstack-ai#37166). The same alias and overlap checks also ran
clean before the push.
- CI runs the full farm on this PR.
</details>

<details><summary>Local gates, previous round (`dispatch-gates.mjs
--commands`, 73 families at that head)</summary>

- At `08107d2f`: all 73 derived families exit 0, each recorded as `cmd
:: exit N` and reconciled with `--ran`: "73 derived famil(ies) accounted
for — 73 run, 0 NOT-MEASURED". Two needed a second run:
`check:skill-examples` first exited 3 (it refused, measuring nothing,
because `packages/client`'s source was newer than its build after a
local history rebuild), then 0 after rebuilding `client`; the ui
`scripts/` family ran under the lock with `--maxWorkers=1`: 172 files
passed, 2 skipped.
- `check:test-source-alias` first exited 1 at `727300e5`: the new-report
page now imports the draft bar's package rule, which reaches
`@objectstack/lint`. The test file pays that load at collection (`import
'@objectstack/lint'`, the gate's prescription); exit 0 since, and at
`08107d2f`.
- Also at `08107d2f`: `overlap-check` VERDICT clean (main, objectstack-ai#37249,
objectstack-ai#37210, objectstack-ai#37169, objectstack-ai#37168, objectstack-ai#37166), `@objectstack/spec check:generated`
exit 0 after the merge, and `check-platform-checklist --changed-from
origin/main` exit 0 (no anchored file changed).
- CI runs the full farm on this PR.
</details>

## 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. (eslint on the changed
files locally; the repo-wide run is CI's.)
- [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.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… and their notes follow the new currency (objectstack-ai#37284)

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW

Fixes objectstack-ai#36412

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

## 维护者速读

-
用户可见变化:在报价、订单、发票里选产品带出价格后,如果在同一次编辑中改了币种,价格不会被改动或清空,下方会说明这笔价格是按哪个币种带入的、记录现在是哪个币种;没带入的价格提示会跟着换成新币种;改成与产品价格相同的币种时,提示保留、价格仍空,并提示重新选取即可带入。
- 为什么做:这是「选产品不跨币种抄价格」那张卡里最后一项(「保留金额并提示」及其 B 方案),替多币种单据的使用者补上改币种后的说明。
- 出错会怎样:只影响价格下方的提示文字,不写入、不清除任何金额;手动输入的金额不显示提示;可以直接撤回这一个合并。
- 要你做什么:无。

## What changes

The ruling item on this card (comment 7118795825, 「保留金额并提示」) and its
branch B (comment 7158109013), on both hosts: the line-item grid
(`GridFieldWidget`) and the record form (`LookupField` with the declared
pairs). Scope is bounded by ADR-0144 D2: new records, records with no
saved lines, lines staged in the same edit, and declared pairs on the
record's own amounts. Items 1–4 landed in objectstack-ai#36918. With this PR the
card's last open item is done.

- **Point 1: a currency change in the same edit never changes or clears
a filled amount.** Measured first. This already holds on `main`
(`057cedfa9b6`): nothing writes an amount when the code changes. The new
pins were run against main's source files, and every amount assertion
passed there; the only failures were the note lines that come after them
(see Tests). Pinned either way, on both hosts. This PR adds no write.
- **Point 2: an amount a pick copied gets a note once the currencies
differ.** `judgePickWrites` now records each amount it copies as
`CopiedAutofill` (`target`, `source`, `value`, `under`: the code the
target was in at the write). The plan gains the optional `copied`,
absent when there is none. Each host keeps these beside the withheld
values of the same pick. When drawing, it shows "Unit Price was copied
as $100.00, but the record is now in EUR. Enter Unit Price in EUR if it
should change." only when all of these hold (`copiedAutofillNow`): the
field still holds that pick, the target still holds the copied value,
and the code the target is in now is known and differs from `under`. A
currency change back ends the note.
- **Point 3: a withheld note already shown refreshes to the record's new
currency.** `withheldAutofillNow` judges each shown withheld item again
with `crossCurrencyRefusal`, using the picked amount's own currency (its
`from`) against the target's currency as it is now. The note follows the
new code, and its reason too: a code cleared reads "no currency is
chosen".
- **Point 4: a hand-typed amount gets no note.** Only a pick records a
copied amount, and the note needs the target to still hold the copied
value. So an amount typed by hand, or typed over a copied one, says
nothing.
- **Branch B.** When the record's currency turns to the picked amount's
own, the re-judgement copies nothing. The item takes the new reason
`nowSameCurrency`, the note stays and the cell stays empty: "Unit Price
was not filled when it was picked. The record is now in USD: pick again
to fill $100.00." A pick again fills it (pinned as the control on the
record form). When the target still holds an earlier value (`held`), the
sentence says to clear the field, then pick again
(`lookup.autofillNowSameCurrencyHeld`, round 3).
- "Now" on each host is the same context the pick used, with no picked
row. On the grid that is `gridAutofillCurrency` on the current line,
with `columnCurrencies` (a header-following line) or `columnFields` (the
line's own code). On the record form it is `currencyFor` on the live
record, followed parent included. So a code written later in the edit is
read exactly as a pick would read it.
- i18n: three sentences, `lookup.autofillNowSameCurrency`,
`lookup.autofillNowSameCurrencyHeld` and `lookup.autofillCopiedUnder`,
in all 11 packs (zh-Hant generated by `gen:zh-hant`) and in
`FIELD_DEFAULTS`.
- One changeset, `.changeset/36412-currency-change-notes.md`:
`@object-ui/fields` and `@object-ui/i18n`, both `patch`. The objectstack-ai#36918
changeset is left untouched. `@object-ui/plugin-form` changes in its
test file only, which is not published.

## Clause-② rework: route (a), `copied` optional

At the seat's rework the first declaration, `Clause-②: no`, did not
hold. Route (a) is taken; no route (b), nothing here needs `copied` to
be required. `LookupAutofillPlan.copied` is now optional (`copied?:
CopiedAutofill[]`). `judgePickWrites` leaves it out when the pick copied
no amount under a judged currency, and every in-package reader treats
absent as none (`LookupField`'s two `noteWithheld` calls,
`GridFieldWidget`'s pick, `planLookupAutofill`'s pass-through). A plan
built without `copied` is still a plan, so nothing is narrowed. The
published `@object-ui/fields` surface widens:
- new exports `withheldAutofillNow`, `copiedAutofillNow`,
`copiedAutofillMessage` and the type `CopiedAutofill`;
- the optional member `LookupAutofillPlan.copied`;
- the `WithheldAutofill.reason` union gains `nowSameCurrency`, so code
that switches over every reason gains one case.

The same declaration is in the changeset. `Metadata-protocol: none`
stands: no spec key, value or metadata type changes. A pin asserts that
a plan which copied no amount carries no `copied`.

## Tests

Round 3 (the seat's S1, N1, N2 and N4), all under `os-verify-lock`:
- Both pin files at `dd0ebf7f96`: Tests 71 passed (71). Two new pins
hold the held branch B case on each host (grid: header USD over a line
holding 80, then EUR; form: an `overwrite: true` pair over a typed 80 on
a EUR quote, then USD). Each asserts the exact clear-then-pick-again
sentence and that the earlier value stays. The grid branch B pin now
ends with the N4 control: a pick again fills 100 and no note remains.
- Ablation: the held arm in `withheldAutofillMessage` is deleted
(`ablation-replace --delete`, restored to the HEAD blob `848e5fd1844c`).
Tests 2 failed, 9 passed: exactly the two held pins fail. The non-held
branch B pins on both hosts stay green, so their wording is unchanged.
- The three-package run at `dd0ebf7f96` failed one test,
`all-locales-key-parity` "placeholders match en in every pack": the
first zh-Hans text of the new key named `{{field}}` three times against
en's two, and zh-Hant was generated from it. Fixed in `315c0d8fef`. At
that head, `packages/i18n/` gives Test Files 111 passed, Tests 2028
passed, 13 skipped. Only locale strings changed between the two heads;
fields and plugin-form were green at `dd0ebf7f96` (685 of 687 files
passed, 1 skipped, and the one failure was that i18n test). `type-check`
of the three packages exits 0 at `315c0d8fef`.

Round 2 (the Clause-② rework), head `a602513471`, all under
`os-verify-lock`: the same three-package run gives Test Files 686
passed, 1 skipped (687), and Tests 9840 passed, 21 skipped (9861),
`VERDICT command-exit 0`. `type-check` of the three packages exits 0.
Ablations of the reworked lines, each restored to the HEAD blob
`e96dadd3fbba`:
- `copied` always present (`return copiedAmounts.length > 0 ? { ...plan,
copied: copiedAmounts } : plan;` becomes `return { ...plan, copied:
copiedAmounts };`): Tests 1 failed, 8 passed. The absent-means-none pin
fails.
- No copied note, re-run on the new head: Tests 3 failed, 6 passed. The
copied note fails on both hosts, plus the pure pin.

Round 1 readings follow. Tests on head `482148532`, all under
`os-verify-lock`: `pnpm --dir ui exec vitest run --maxWorkers=2
packages/fields/ packages/plugin-form/ packages/i18n/` gives Test Files
686 passed, 1 skipped (687), and Tests 9840 passed, 21 skipped (9861),
`VERDICT command-exit 0`. `type-check` of `@object-ui/fields`,
`@object-ui/plugin-form` and `@object-ui/i18n` exits 0, after the
closure build. Both pin files are in the `tsconfig.test.json` program
(`--listFiles`: 1 hit each).

<details><summary>New pins, the point 1 measurement, and
ablations</summary>

- `ObjectForm.lookupAutofill-28245.test.tsx`, new describe "a same-edit
currency change keeps amounts and says so", 4 tests through
`ObjectForm`. (1) A USD quote picks a $100 product. Changed to EUR, it
keeps 100 and shows the copied note with its exact text. Control: before
the change there is no note, and changing back to USD ends it. (2) A JPY
quote's withheld note names GBP and no longer JPY after the code becomes
GBP, and the price stays empty. (3) Branch B: a EUR quote's withheld
note reads exactly "Unit Price was not filled when it was picked. The
record is now in USD: pick again to fill $100.00." once the code becomes
USD, and the price stays empty. Control: the pick again fills 100 and no
note remains. (4) A typed 55 gets no note through a currency change, and
neither does 55 typed over a copied 100.
- `GridField.lookupAutofill-28245.test.tsx`, new describe of the same
name, 5 tests. The same four cases through `GridField`, with the header
currency handed in as `columnCurrencies` and changed by a rerender, for
a product priced in EUR. One more is pure: `withheldAutofillNow` follows
the currency now, `nowSameCurrency` applies when it matches, and with no
currency known the item is returned unchanged; `copiedAutofillNow` names
a differing code only while the target holds the copied value. The
objectstack-ai#36412 declared-pairs pin now also asserts `copied` (the price is
recorded under the code the same pick wrote).
- **Point 1 measured on main's code.** The five source files were
restored to `057cedfa9b6` in the tree only, the `-t ruling` pins were
run, and the files were restored with `git checkout HEAD` (`git diff
HEAD` empty afterwards). Result: 7 failed, 2 passed. The two hand-typed
pins passed. Both copied-amount pins failed on the note line after their
amount assertion (ObjectForm line 745, GridField line 641): the amount
kept its value through the currency change on main. The refresh and
branch B pins failed on their note text, and the pure pin failed on the
missing export. Point 1 has no implementing line to ablate: nothing
writes an amount on a currency change, before or after this PR.
- Ablations on the committed tree with `scripts/ablation-replace.mjs`
(`lookupAutofill.ts`; vitest aliases `@object-ui/*` to `src`, so no
`dist` sits between mutation and run), `-t ruling`, each restored to the
HEAD blob `18535d11faef`:
- ` if (!now) return item;` becomes ` return item;` (no refresh): Tests
5 failed, 4 passed. Refresh and branch B on both hosts, plus the pure
pin.
- ` return to && to !== item.under ? to : undefined;` becomes ` return
undefined;` (no copied note): Tests 3 failed, 6 passed. Copied note on
both hosts, plus the pure pin.
- ` if (!sameValue(current, item.value) || !now) return undefined;`
becomes ` if (!now) return undefined;` (a typed-over amount keeps the
note): Tests 3 failed, 6 passed. Hand-typed on both hosts, plus the pure
pin.

</details>

## Acceptance notes

- Clause-②: `yes (widening)` (see the rework section above). The diff
touches no `packages/spec/**` and no metadata. `git grep` finds
`LookupAutofillPlan` only inside `ui/packages/fields`.
- Branch B over a filled target (round 3, the seat's S1): a withheld
value that carries `held` (a pick over a target that still holds an
earlier value) now gets its own branch B sentence,
`lookup.autofillNowSameCurrencyHeld`: "Unit Price was not filled when it
was picked and still holds its earlier value. The record is now in USD:
clear Unit Price, then pick again to fill $100.00." For a declared pair
without `overwrite`, picking the same record again does not replace a
value that record did not fill (the spec's overwrite rule), so the
sentence says to clear the field first. Re-pick behaviour is unchanged.
- A copied amount whose record's currency becomes unset or unreadable
gets no note (no current code to name). Only a known, different code is
named, as the ruling's example reads.
- N9 (record-page editor re-renders): not measured. The new work per
render is one re-judgement per shown note, and nothing runs when no pick
left a note.

## Verification

<details><summary>Gates</summary>

- Round 3: `dispatch-gates --commands` derived the same 41 at
`315c0d8fef`. All 41 ran with exit 0, including the ui `scripts/` family
(172 files passed, 2 skipped; 5130 tests passed). `--ran`: 41 derived,
41 run, 0 NOT-MEASURED, 0 UNRUN. ui `check:i18n-keys`,
`check:i18n-drift`, `check:i18n-dead-keys` and
`check:new-line-citations` exit 0 (run at `dd0ebf7f96`; the later commit
changes two locale strings, and key parity is pinned by the i18n suite
above). Size: 19 files, +582/-38 (620 changed lines); with objectstack-ai#36918's 714
the card totals 1,334, under 3,000.
- Round 2: `dispatch-gates --commands` derived the same 41 at
`a602513471`. All 41 ran with exit 0, including the ui `scripts/` family
(172 files passed, 2 skipped; 5130 tests passed). `--ran`: 41 derived,
41 run, 0 NOT-MEASURED, 0 UNRUN.
- Round 1: `dispatch-gates --commands` (no paths, change set from the
merge base) derived 41 commands at `482148532`. All 41 ran with exit 0.
`pnpm --dir ui exec vitest run scripts/` ran under the lock with
`--maxWorkers=2`: Test Files 172 passed, 2 skipped, and Tests 5130
passed, 2 skipped. `dispatch-gates --ran` with exit codes recorded: 41
derived, 41 run, 0 NOT-MEASURED, 0 UNRUN, exit 0.
- ui `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys` and
`check:new-line-citations`: exit 0, with 0 new citations.
- `overlap-check` before each push: VERDICT clean, exit 0. Re-read after
`git fetch` against `origin/main` `622f3985fe` and 5 PR heads that share
files (objectstack-ai#37282, objectstack-ai#37249, objectstack-ai#37226, objectstack-ai#37210, objectstack-ai#37166): clean. `--pr=37264`
named explicitly: merges cleanly.

</details>

Read first, by risk: (1) `judgeCopy`, `withheldAutofillNow` and
`copiedAutofillNow` in `lookupAutofill.ts`; (2) the note block at the
end of `LookupField.tsx` (`pickStands`, `currencyNow`); (3) the per-row
note block in `GridFieldWidget.tsx` (`lineCurrencyNow`).

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-form/src/ObjectForm.lookupAutofill-28245.test.tsx -t
ruling` passes 4 tests. In them, a USD quote picks a $100 product,
changes its currency to EUR, keeps 100, and shows "Unit Price was copied
as $100.00, but the record is now in EUR."

https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…sentence name the app start page (objectstack-ai#37340)

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes objectstack-ai#37207

Clause-②: yes (widening) — one new published language-pack key,
console.ai.unavailableErrorDesktop, in all eleven packs
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:桌面端无权进入 Studio 时的「返回首页」按钮改为「返回应用起始页」;AI
服务连不上时的提示句末尾也从「返回首页」改为「返回应用起始页」,与下方按钮一致;手机端不变。
- 为什么做:属于「去掉顶栏和平台首页那一层」专题的收尾,补上上一轮同类改动没覆盖到的两处文字。
- 出错会怎样:最坏是某种语言的提示句读起来不顺,跳转目标没有任何改动;可直接撤回。
- 要你做什么:无。

## What changes

Measured first, at `origin/main` fbb62e1 (after objectstack-ai#37166 landed):
`StudioRoute.tsx` `StudioAccessRequired` read
`empty.appAccessDeniedHome` 「Back to home」, and
`console.ai.unavailableError` ended "or head back home." on every width.
This follows objectstack-ai#37204's desktop/phone split (`usePhoneViewport`, under 768
px is a phone).

- `ui/apps/console/src/components/StudioRoute.tsx`: the Studio refusal's
way-home link reads `layout.appSwitcher.backToHome` 「Back to app start
page」 from 768 px up, and `empty.appAccessDeniedHome` 「Back to home」 on
a phone. `usePhoneViewport` comes from the `@object-ui/app-shell`
barrel, which already exports it. The link target (`useHomePath()`) is
unchanged.
- `ui/packages/app-shell/src/console/ai/AiUnavailable.tsx`: with
`hasError`, the sentence reads the new
`console.ai.unavailableErrorDesktop` from 768 px up ("Couldn't reach the
AI service. It may be temporarily offline — try again, or go back to the
app start page."). A phone keeps `console.ai.unavailableError`. It now
names the same place as the button under it.
- `@object-ui/i18n`: `console.ai.unavailableErrorDesktop` added once in
each of the 11 packs. Each translation reuses that pack's own
`layout.appSwitcher.backToHome` wording for "app start page" (zh-Hans
返回应用起始页). No key removed or renamed.

Clause-② measured: leaf keys per pack, base fbb62e1 → head, read by
importing each pack file: en 5040→5041, zh-Hans 5040→5041,
zh-Hant/ja/ko/de 5034→5035, fr/es/pt-BR 5191→5192, ru 5348→5349, ar
5662→5663. The new key is present in 11 of 11 packs and absent from all
11 at base. Only this one key is added. Props, exports and targets are
unchanged.

Read first, by risk:
1. `ui/packages/app-shell/src/console/ai/AiUnavailable.tsx`: the nested
`phone` ternary inside `hasError`.
2. `ui/apps/console/src/components/StudioRoute.tsx`: the link label
ternary.
3. `ui/packages/i18n/src/locales/de.ts` (and the other non-en packs):
the translated sentence.

Two-minute check: at a desktop width, sign in as a user without
`studio.access` and open `/studio`. The button reads 「Back to app start
page」. Narrow the window under 768 px and it reads 「Back to home」.

## Tests

One pin each, at desktop width, with the phone as the CONTROL. Each is a
new top-level `describe` in the surface's existing harness:
- Studio refusal: `StudioRoute.test.tsx` "/studio refused: the way home
names where it goes, by viewport". At 1280 px the link is 「Back to app
start page」 and no 「Back to home」 link exists. CONTROL at 375 px: 「Back
to home」.
- AI unreachable: `RequireAiSurface.test.tsx` "the unreachable-service
sentence names where its way home goes, by viewport". It renders
`AiUnavailable` with `hasError`. Desktop:
`console.ai.unavailableErrorDesktop`, not `console.ai.unavailableError`.
CONTROL on a phone: the reverse.

Existing pins moved to the desktop wording, because jsdom's window is
1024 px: `StudioRoute.test.tsx` `WAY_HOME`, and
`StudioRoute.accessNotice-12035.test.tsx` `wayHomeIn` (now reads
`layout.appSwitcher.backToHome` from each pack).

<details><summary>Affected suites (vitest, from ui/), head
51f74e6</summary>

```
pnpm exec vitest run --maxWorkers=2 RequireAiSurface StudioRoute console-namespace-3546 all-locales-key-parity en-zh-key-parity AiChatPage
 Test Files  44 passed (44)
      Tests  386 passed (386)
os-verify-lock: VERDICT command-exit 0
```
</details>

<details><summary>Ablations (one-shot, restored to the HEAD
blob)</summary>

Studio refusal. In `StudioRoute.tsx`, `node
scripts/ablation-replace.mjs` swapped the desktop arm's
`layout.appSwitcher.backToHome` for `empty.appAccessDeniedHome` (anchor
x1 -> x0, blob eb1f535 -> 95423fd7baec):
```
× on a desktop, where home is an app's start page, it reads as the app pill's row does
(+ 7 existing desktop refusal cases that read WAY_HOME)
Tests  8 failed | 12 passed (20)
ablation-replace: ok restored: blob == HEAD (eb1f535) and `git diff HEAD` is empty
```
The phone CONTROL stayed green.

AI unreachable. In `AiUnavailable.tsx`, the swap was
`console.ai.unavailableErrorDesktop` → `console.ai.unavailableError`
(anchor x1 -> x0, blob be89670 -> dada400011a4):
```
× on a desktop, where the button opens an app's start page, the sentence says so
Tests  1 failed | 13 passed (14)
ablation-replace: ok restored: blob == HEAD (be89670) and `git diff HEAD` is empty
```
Neither ablation needed a build step: both test files import the mutated
source directly (console's own file; app-shell by relative path).
</details>

<details><summary>Type-check, i18n gates, derived gates</summary>

```
pnpm --filter '@object-ui/console^...' build   VERDICT command-exit 0
pnpm --filter @object-ui/app-shell --filter @object-ui/console --filter @object-ui/i18n run type-check   VERDICT command-exit 0
ui: check:i18n-keys EXIT=0 (5898/5898 literal keys resolve) · check:i18n-drift EXIT=0 (1 key added, 0 en values changed) · check:i18n-dead-keys EXIT=0
node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main; objectstack-ai#37249 shares the 11 locale packs and merges cleanly)
dispatch-gates --commands (after the changeset): 41 derived families; 40 run locally, all 40 exit 0
NOT MEASURED: pnpm --dir ui exec vitest run scripts/ (the ui scripts/ suite). The first run was SIGKILLed by the
  shared box's OOM killer; two lock retries got queue-timeout (exit 99) behind another session's full dogfood run.
  This diff edits no ui/scripts file. CI runs the suite.
dispatch-gates --ran: 41 derived, 40 run, 1 UNRUN (the line above)
```
</details>

## Acceptance notes

- `RequireAiSurface`'s `redirectTo` prop can still send the button
somewhere other than `useHomePath()`. objectstack-ai#37204 already accepted this for
the button label, and the new sentence takes the same assumption.
- Stale prose that the card lists as not in scope (`runtime-config.ts`
`hideSingleAppSwitcher`, `approvals.json`, `studio-authoring.json:35`):
none of those files is in this diff, so none is touched.

## Verification

Local: affected suites, both ablations, type-check of the three touched
packages, the ui i18n gates, 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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…etup → Packages names arrangements apart (objectstack-ai#37351)

Fixes objectstack-ai#37236

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 管理员在 设置 > 软件包 打开一个应用的详情时,「已定制」只数改过和新增的条目;只调整了排列的应用现在显示「已定制 0 项,调整排列 2
处,已停用 0 项」,不再显示「已定制 2 项」,排列明细照常列出。
- 属于 Studio 改版:按维护者裁定,「已定制」在设置详情、全部元数据页头和列表筛选里只有一个意思(覆盖 + 扩展)。
- 出错时管理员只会看到这一行数字或措辞不对,不碰任何数据,可直接撤回。
- 无。

## What changes

- **Setup → Packages detail** (`PackageCustomizationsPanel.tsx`): the
「已定制」 / "customized" count is now `customizationTotal` (overrides +
extensions), the one number the All metadata header and both lists'
「customized」 filter already read. Arrangements are named in their own
segment, `engine.packages.customizations.arranged` (en `{count}
rearranged`, zh-CN `调整排列 {count} 处`), drawn only when the count is above
0. The "No changes" line now needs all three counts at 0, so an
arrangement-only app never reads "No changes".
- Arrangement-only app: `0 customized, 2 rearranged, 0 switched off` /
`已定制 0 项,调整排列 2 处,已停用 0 项`.
  - No arrangement: unchanged, `1 customized, 0 switched off`.
- The rows (`customizationRowsOf`) and the 「布局」 tab are unchanged;
arrangements are still listed.
- **`customizedCountOf` is retired**, not fixed to delegate. Its only
job was the second meaning of 「已定制」. Keeping a second name for
`customizationTotal` would leave two doors to the same number, and the
drift this card fixes came in through that second door. Its one caller
and its one test go with it.
- **`customizationTotal` is unchanged**, and so are the header
(`DirectoryPage.tsx`) and both filters (`ResourceListPage.tsx`,
`useListOrderedNames.ts`). They gain pins, not code.
- **i18n:** one additive key in en and zh-CN. No key is removed and no
released key changes meaning
(`engine.packages.customizations.customized` keeps its text, and it has
not been released yet: it arrived with objectstack-ai#37166's unreleased changeset).
- **DELIBERATE CORRECTION of an existing changeset**,
`.changeset/36908-remove-studio-home.md` (unreleased). Its sentence "The
count now includes tab, field-group and action-layout arrangements, so
an app whose only change is a tab arrangement shows as customized."
would ship false after this change. It now reads: "Tab, field-group and
action-layout arrangements are named on their own in that line, not
counted as customized."
- No server, spec or route change.

## Tests

One pin per surface, each on an arrangement-only base fixture (two
arrangements, no override, no extension):

| Surface | Pin |
|:--|:--|
| Setup detail, en | `PackageCustomizationsPanel.test.tsx`:
arrangement-only app reads exactly `0 customized, 2 rearranged, 0
switched off`, both rows listed |
| Setup detail, zh-CN | same file: exactly `已定制 0 项,调整排列 1 处,已停用 0 项` |
| All metadata header |
`metadataAreaHost.customizations-28568.test.tsx`: no
`directory-customizations-total`, no tile, no failure line |
| ResourceListPage filter | same file: no `metadata-only-customizations`
on the arrangement-only base's list |
| useListOrderedNames filter | same file: with `?customized=1`, the ‹ ›
names keep the row (the filter is not offered), with a HotCRM control
that keeps only its customized row |

Also: no arrangement means no arrangement segment, and the mixed fixture
now reads `2 customized, 1 rearranged, 1 switched off`.

<details><summary>Targeted run (head c9c1d9e)</summary>

```
$ cd ui && pnpm exec vitest run PackagesPage.installedAppsUpdates-34722 PackageCustomizationsPanel metadataAreaHost.customizations-28568 customizationMarks
 Test Files  4 passed (4)
      Tests  77 passed (77)
os-verify-lock: VERDICT command-exit 0

# every app-shell test that reads the changed code (45 files, grep of the panel, rows, marks, header, both filters and the detail sheet), on 08fe4e46, the same diff before the last rebase over objectstack-ai#37338
 Test Files  45 passed (45)
      Tests  661 passed (661)
```
</details>

<details><summary>Ablations: each pin red alone when its own surface
counts arrangements</summary>

Each mutation adds `+ counts.arrangements` at one call site through
`scripts/ablation-replace.mjs` (anchor x1 → x0, blob changed, restored
to the HEAD blob with an empty `git diff HEAD`). The tests import
source, so there is no `dist/` leg.

```
A1 PackageCustomizationsPanel.tsx   customized: customizationTotal(read) + read.counts.arrangements
   × lists one row per change ... counts them
   × objectstack#37236: an arrangement-only app reads 0 customized beside its arrangement count ...
   × zh-CN: ... an arrangement-only app is 已定制 0 项 beside 调整排列
   Tests  3 failed | 10 passed (13)
A2 DirectoryPage.tsx header   customizationTotal(...) + counts.arrangements > 0
   × the directory header draws no total for a base whose only change is an arrangement
   Tests  1 failed | 12 passed (13)
A3 ResourceListPage.tsx showCustomizedFilter   same mutation
   × the list offers no "customized" filter to a base whose only change is an arrangement
   Tests  1 failed | 12 passed (13)
A4 useListOrderedNames.ts customizedOffered   same mutation
   × the detail ‹ › names: "only customizations" is not offered to it, so it filters nothing out
   Tests  1 failed | 12 passed (13)
each: "ok restored: blob == HEAD and `git diff HEAD` is empty"
```
</details>

<details><summary>Package suite and type-check</summary>

```
pnpm --filter @object-ui/app-shell type-check     VERDICT command-exit 0
pnpm check:type-check-debt                        re-measure: OK, 0 raw tsc errors

NARROWED, declared: the package's full `pnpm test` (2430 test files) was stopped after 70 minutes on the shared box,
26 files in. The 45-file scoped set above replaces it locally; CI's `Test UI` runs the whole package.
```
</details>

## Acceptance notes

- Wording choice: en reads `{count} rearranged`, matching the line's
other participles ("customized", "switched off") and avoiding "1
arrangements". zh-CN reads the ruling's own `调整排列 {count} 处`. The new
segment uses the line's existing separator (`, ` / `,`), not the ruling
example's ` · `, so the line has one separator.
- "Don't show a 0-count segment" is applied to the new segment only. The
customized and switched-off segments keep objectstack-ai#37166's behaviour (both
always drawn once anything is non-zero), so an arrangement-only app
still shows `0 customized`, as the card asks.

## Verification

Read first: `PackageCustomizationsPanel.tsx` (the summary line), then
the new `describe` at the end of
`metadataAreaHost.customizations-28568.test.tsx`.

Two-minute check: from `ui/`, `pnpm exec vitest run
packages/app-shell/src/views/studio-design/PackageCustomizationsPanel.test.tsx`.
Expect 13 passed, including "an arrangement-only app reads 0 customized
beside its arrangement count".

## Gates

Derived union (`dispatch-gates.mjs --commands`), run on the final head
c9c1d9e: 38 derived, 38 run, 0 NOT-MEASURED (`--ran` reconciliation
exit 0).

- 37 exit 0, plus `check:changeset-fixed` (outside the derivation, run
because `.changeset` holds its roster) exit 0.
- 1 exit 1, expected: `check-empty-changeset.mjs --base origin/main`
refuses the edit to `.changeset/36908-remove-studio-home.md`. This is
the DELIBERATE CORRECTION declared above, not a collision. The gate
stays red until the dispatching seat confirms the correction by its own
record.
- Push gates: `check:test-source-alias` exit 0, `check:i18n-keys` exit
0, `overlap-check.mjs` VERDICT clean exit 0, `check:nul-bytes` exit 0.

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

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…bjectstack-ai#37249)

repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes objectstack-ai#37227

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or doc teaches the two Home entries or the
phone welcome copy; `git grep` of `skills/` and `content/docs/` finds
none of them or the retired keys

## 维护者速读

- 手机首页、以及电脑上「暂无应用」页面,不再出现「用 AI
搭建」和「搭建应用」两个入口;部署了构建智能体时,手机上「暂无应用」的欢迎语改为普通文案,不再承诺「用 AI
搭建」。「新建空白应用」「从模板开始」和其它入口照旧。
- 落实维护者「两个入口一并去掉」的裁决,以及席位关于欢迎文案的裁决,属于 Studio 首页收口这条主线。
- 若出错,用户会看到缺了一个本该保留的入口、删掉的入口又出现,或欢迎文案不对;改动只删不加,撤回即可恢复。
- 无。

## What changes

- `HomePage.tsx`
- The greeting row's agent-present build chip, 「Build an app」 (to bare
`/studio`), is gone. The no-agent form, 「New blank app」
(`home.build.inStudio`), is untouched: label, key, condition and target
are exactly as on main.
- `HomeAiActions` no longer draws 「Build with AI」. 「Ask AI」 keeps
exactly the gate it had: hidden for a maker the build agent serves (the
cloud#1674 convergence), shown otherwise.
- The phone zero-app admin welcome, where the build agent is deployed,
now shows `home.noAppsTitle` and the existing NoBuild/NoAi description,
not 「Build your business system with AI」 and "Describe your business in
one sentence — AI generates …". Without the build agent the welcome is
unchanged. No new key is added.
- The desktop no-apps empty state is not changed here. Since objectstack-ai#37166 the
shared 「Add app」 list holds no 「Build with AI」 door, so the doors are
`new-in-studio`, `template`, `marketplace`. The page-side filter from
the earlier head was a no-op after the merge and is removed.
  - Doc comments that described the two entries are rewritten.
- `QuickActions.tsx`: comment only (the component has no call site).
- Retired from all eleven locale packs, each released in 18.6.0 and with
zero readers on the merged tree: `home.build.title`, `home.buildWithAI`
(its last reader was this page's CTA; objectstack-ai#37166 removed the sidebar's) and
`home.welcomeAdminDescription`. `home.build.inStudio`, `home.welcome`
and `home.build.noCapability` stay; they are still read.
- Changeset `37227-home-drop-build-entries.md`: `Clause-②: yes
(narrowing)`, the three keys under 「Removed translation keys」,
`not-required (no-migration-prescription)` disposition.

## Overlap and ordering

Answering the landed notice 7169175122 (body refreshed
2026-11-25T19:21Z): objectstack-ai#37166 merged first (fbb62e1). This branch merged
`origin/main` (merge commit b1f7c48, no rebase). Two test files
conflicted and keep both PRs' pins:
- `HomePage.desktopNoApps-36732`: objectstack-ai#37166's doors list `[new-in-studio,
template, marketplace]` and its Setup → Packages target are kept. This
PR adds two assertions: no 「Build with AI」 label and no bare `/studio`
door.
- `HomePage.noAgentsBuildChip-26614`: objectstack-ai#37166's `setupPair` state and its
Studio-only author case (to `~all`) are kept, beside this PR's
`answered` latch and `catalogAnswered()`.

`overlap-check` at the new head: VERDICT clean (origin/main; no open PR
shares a file).

## Tests

- `HomePage.noAgentsBuildChip-26614`: with the build agent in the
catalog, no build chip of either form, for a maker and for a session
that may not author, and for the legacy build-agent id. Each absence is
read after the catalog stand-in has answered.
- `HomePage.desktopNoApps-36732`: as above.
- `HomePage.authoringCapabilityGate`: the gate acts on 「Start with a
template」. The capability-present case pins both entries absent. The
phone zero-app welcome pins `home.noAppsTitle` + NoAi and no
`home.welcome`.
- `HomePage.phoneTapTargets-29147`: the phone-target case pins both
entries absent. A new top-level describe covers the phone zero-app admin
welcome: build agent → `noAppsTitle` + NoAi; build + ask → `noAppsTitle`
+ NoBuild; CONTROL with no agent → `home.welcome` + NoAi.
- `HomePage.greetingAndApps-12601`: build-chip assertions move to the
template chip.
- `HomePage.aiStudioDisabled`, `HomePage.marketplaceDisabled`: their
catalog is a custom agent, so the chip these flags gate is 「New blank
app」.

## Acceptance notes

- `homeAffordancesFollowDeclaration-7256`, `landingHomeParity-7256`,
`homeRecoveryRedirectsFollowDeclaration-7373`, `useHomePath.test`,
`homePath.test` and `workspaceAdminPositions-5389` mention 「Build an
app」 only in prose about a past defect, and assert nothing about the
chip.
- The earlier head's gap note (no button on an aiStudio + build-agent +
no-marketplace no-apps state) is closed by objectstack-ai#37166: 「New blank app」 now
shows there on every deployment with AI Studio.

## Verification

Two-minute check: run `pnpm --dir ui exec vitest run
packages/app-shell/src/console/home/`. All files pass. No assertion
finds `home-build-app` or `home-build-with-ai` on the page, and the
phone zero-app welcome with the build agent reads `«home.noAppsTitle»`.

Read first, by risk:
1. `HomePage.tsx`, the admin zero-app welcome: the title and description
branches.
2. `HomePage.tsx` `HomeAiActions`: the early return `if (!askAvailable
|| maker) return null`, which keeps the 「Ask AI」 gate byte-equivalent.
3. The two merge-resolved test files (above).

<details><summary>Ablations on the merged head
(scripts/ablation-replace.mjs; the tests import HomePage from
src)</summary>

Every mutation was checked on disk (anchor 1 to 0, blob changed). Every
restore was checked: blob == HEAD 1f30b19, `git diff HEAD` empty.
Suite: phoneTapTargets, authoringCapabilityGate, noAgentsBuildChip,
greetingAndApps.

- Old welcome description restored (`home.welcomeAdminDescription` when
the build agent is deployed): 3 failed / 54 passed.
- Old welcome title restored (`home.welcome`): 3 failed / 54 passed.
- 「Build an app」 chip restored: 8 failed / 49 passed.
- 「Build with AI」 restored in `HomeAiActions`: 4 failed / 53 passed.

</details>

<details><summary>Local gates and tests (head 7e70756)</summary>

- `vitest run` over `packages/app-shell/src/console/home/`,
`packages/app-shell/src/layout/` (incl. SidebarAppMenu-36112),
`packages/app-shell/src/hooks/`, `packages/i18n/` and
`check-i18n-call-site-keys`: Test Files 423 passed (423); Tests 4858
passed, 13 skipped. VERDICT command-exit 0.
- `pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run
type-check`: both Done. VERDICT command-exit 0.
- `dispatch-gates --commands`: 41 families, plus
`check:changeset-fixed`, all exit 0. `--ran`: "41 run, 0 NOT-MEASURED (a
DERIVED zero)".
- Dogfood battery: head 7e70756; VERDICT command-exit 0; Test Files
487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); no
failures.

</details>

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio 重构(决定 9):去掉 Studio 首页(/studio 的包卡片页),逐项搬走它承载的入口

3 participants