Skip to content

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

Description

@os-support-ai

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

③ topic child · Source: topic #36890. Part of #36890.

为什么

专题把对象、流程、权限集从分区地址(/studio/<包>/data?surface=object:<名> 等)搬到元数据地址(/studio/<包>/metadata/<类型>/<名>)。今天元数据地址上点对象会被 SD/StudioMetadataArea.tsx:161-166(AreaItemOpen)按 SD/metadataArea.ts:70-78 的 AREA_PILLAR_FOR_TYPE 转回分区。如果先把分区地址重定向到元数据地址,两条规则会互相跳成死循环(fable 评审)。所以先把地址收口到一个函数,再由每张设计器卡在装好全屏设计器的同一个 PR 里切换自己的类型。

要改的地址生成点(读代码确认,主干 0819cab,非测试)

  1. AS/utils/appRoute.ts:263, 290, 316(appStudioDesignPath、appStudioSurfacePath、appStudioObjectPath)
  2. SD/metadataArea.ts:86, 108(studioPillarItemPath、areaItemPillarPath)
  3. SD/setupMetadataRedirect.ts:73, 93, 94
  4. AS/chrome/CommandPalette.tsx:1043, 1132, 1152
  5. SD/studioScope.ts:58
  6. AS/console/ai/artifactStudioPath.ts:38、AS/console/ai/AiChatPage.tsx:3146
  7. AS/console/AppNoAccessEmptyState.tsx:150
  8. AS/views/RecordTabsConfig.tsx:112、AS/views/DashboardInPageEditor.tsx:197
  9. SD/BuilderLanding.tsx:113, 169, 822、SD/studioChangesLink.ts:50、SD/switchedOffActionTargets.ts:65
  10. SDS 自身(分区链接、配对包跳转、~org 跳转、权限集「新建类似」)
  11. ui/apps/console/src/components/StudioRoute.tsx:285, 349、ui/apps/console/src/AppContent.tsx:68, 178
  12. 服务端:packages/cli/src/commands/meta/register.ts:213、packages/runtime/src/domains/mcp-authoring.ts:1293-1294(MCP 写草稿后返回给 AI 的审阅链接);skills/objectstack-mcp-build/evals/draft-door-procedure.json 里 5 处同一地址
  13. SD/InterfacesNavRail.tsx:253 随 Studio「界面」整栏作废:顶部导航去掉「界面」,原来在里面改的东西各有去处;前置的运行界面入口全部落地后再摘 #36502 删除,不用改。

(AS/ = ui/packages/app-shell/src/,SD/ = AS/views/studio-design/,SDS = SD/StudioDesignSurface.tsx。)

要做的

  1. 加一个函数(例如 studioItemPath(包, 类型, 名, 选项);服务端两处用一份共享的纯函数或常量,放哪里在 PR 里写明),上面每一处改成调用它。函数暂时仍返回今天的地址,行为不变。
  2. 写一张映射表,覆盖 ?surface= 的全部写法(object:<名> 带视图 id、owd:overview、?nav=),以及要原样保留的 ?changes=review、?review=1、?package=、?scope=environment。后续设计器卡按表切换。
  3. 和 Studio「界面」整栏作废:顶部导航去掉「界面」,原来在里面改的东西各有去处;前置的运行界面入口全部落地后再摘 #36502 第 3 项(旧 /interfaces 地址跳转)用同一张表。

不做的

  • 不改任何地址的实际结果;不加重定向(各设计器卡在自己的 PR 里加;4-1 删分区路由)。

验收

  • 全仓(含 packages/ 和 skills/)不再有手拼 Studio 地址的地方,有一个守门测试或 lint 规则钉住。
  • 全量测试通过,所有现有地址字面不变。packages/ 下的改动带 changeset。

Blocked-by: #36502

Grading: area:ux · Task · Studio navigation (about 20 producers build Studio URLs by hand) · builders and AI review links · evidence: read from code. Topic child ⇒ p2.
Dedupe: studio path helper / appStudioDesignPath (no open card).
Reader: seat repo:objectstack#3, one os-dev card. Size M. Metadata-protocol: none. Wave 1 (after #36502 merges).

Activity

  1. added
    priority:p2
    pm:blocked
    domain:ui
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Claim: PM loop round 1
    Session: session_01WGufzhpykmQZe1yMupC2CU
    Account: os-support-ai
    Branch: claude/issue-36895-studio-path-helper
    Worktree: objectstack-issue-36895
    Domain: domain:ui
    Seat: repo:objectstack#3
    Area: ux-A
    File surface: a new Studio path helper and its route-mapping table (new files under ui/packages/app-shell/src/, plus one shared pure function or constant for the two server producers, located and named in the PR); every producer the card lists under 「要改的地址生成点」 items 1–12 (app-shell utils, studio-design helpers, CommandPalette, AI chat, console routes, packages/cli/src/commands/meta/register.ts, packages/runtime/src/domains/mcp-authoring.ts); a guard test pinning that no producer builds a Studio address by hand; changeset for touched packages/; their tests. ⛔ StudioDesignSurface.tsx (item 10) is edited only after PR #36888 re-enters the merge queue (seat order 09:21Z); until then new files and the other producers only. ⛔ No skills/** edit: the five literals in skills/objectstack-mcp-build/evals/draft-door-procedure.json stay as written, and the guard asserts each one equals the helper's output (the addresses do not change)
    Container & model: M, mode:subagent, model: default, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: platform code in objectstack (about 20 producers build Studio URLs by hand; the epic's per-type URL switch needs one source) | none: no shared helper exists | builders following Studio links and AI review links (MCP draft door)
    Thread-read: 7126750220
    Premise: holds on origin/main 3f568c1 (#36884 merged, which removes InterfacesNavRail.tsx, the card's item 13); the dev re-measures each listed call site against this head, since the card's line numbers are from 0819cab
    Scope: card items 1–3 as filed. Behaviour does not change: the helper returns today's addresses, adds no redirect, and every existing address literal stays byte-identical
    Pre-claim lane: repo:objectstack seat 3 area ux-A; Studio epic #36890 card routed here by the seat (09:21Z)
    Pre-claim deps: Blocked-by #36502, closed by PR #36884, merged 09:18Z as 3f568c1; pm:blocked removed in this stroke
    Prior rulings read: epic #36890 (maintainer's Studio redesign); the card's fable review note on the metadata-area ⇄ pillar redirect loop (why the helper ships first, behaviour unchanged)
    Serial constraints cleared: seat cap of two concurrent StudioDesignSurface.tsx editors until #36893 lands (ux-E's move-only split holds one; #36505's merge round the other until #36888 is queued). Overlap-check before each push, including against #36893's branch once it exists. Reviews go to L1-b (2)

  3. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 24, 2026
  4. 3 remaining items

  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    {
    "issue": 36895,
    "status": "done",
    "branch": "claude/issue-36895-studio-path-helper",
    "pr": "#36973",
    "session": "session_01WGufzhpykmQZe1yMupC2CU",
    "premise_still_valid": true,
    "summary": "Every Studio address in ui/ is now built by one module, ui/packages/app-shell/src/views/studio-design/studioAddress.ts. Its mapping table, studioAddressTable.ts, lists 13 address families, the ?surface= types (object, flow, permission, owd:overview), the three spellings of ?surface= that exist today (component, name, form), and 9 query params. The retired /interfaces redirect (#36502/#36884) now takes its kept-param list from that table, and the list is still exactly changes. On the server, the review links that cli meta register and runtime mcp-authoring print now come from studioChangesReviewLink and studioItemReviewLink in @objectstack/types. That package has no ui dependency. Every address is byte-identical: literal pins hold the old outputs, and the MCP review-link text is unchanged. Re-measured on the head: card items 1-12 are repointed, including item 10 (StudioDesignSurface, after the GO, call-site swaps only). Item 13 is gone, as the card said. Producers the card missed are also repointed: studioInterfacesRetired, metadataArea's area/item/redirect builders, setupMetadataRedirect, switchedOffActionTargets 67/72, studioNewPackage, PackageSwitcher, HomePage, useAddAppEntries, and PackagesPage (landed on main mid-run via #36933, merged in). The eval file has 7 quoted links (5 changes, 2 item-review), not 5. The guard holds all 7 equal to the builder's output, and skills/** is untouched.",
    "tests": "Run at head fa0deb8. ui, affected app-shell/console tests via vitest related, under the lock: 171 files / 1777 tests passed, including the new studioAddress.test.ts (literal pins + table agreement) and studioAddress.guard.test.ts (TS-AST scan of ui/packages//src and ui/apps//src, with controls). @objectstack/types: local project 2 files (studio-review-links.test.ts plus existing) passed, and repo project 3 files passed, including studio-review-links.callers.test.ts (server-package scan, plus all 7 eval literals equal to the builder). runtime: 50 files passed. cli: register-draft.test.ts lives in the integration project, so I ran --project integration on it: 10 tests passed. ui scripts family under the lock: Test Files 172 passed | 2 skipped (174), Tests 5126 passed | 2 skipped, lock VERDICT command-exit 0. Typechecks for types, runtime, cli and app-shell type-check exit 0. Ablation: none, because no tested behaviour changed (byte-identical refactor). The pins are the proof.",
    "gates": "Head fa0deb8. dispatch-gates --commands derived 93 families. Run as a loop with each exit code captured before any pipe: 88 exit 0, plus the ui scripts family exit 0, for 89 run. 4 NOT MEASURED, each exit 3 PREREQUISITE NOT MET (no CLI build / missing dist): check:dual-build-cjs-loads, check:i18n, check:i18n-coverage, check:i18n-walk-parity. Reconciliation: dispatch-gates --repo objectstack-ai/objectstack --ran gave '93 derived famil(ies) accounted for, 89 run, 4 NOT-MEASURED', exit 0. Earlier in the run check:route-envelope went red (exit 1) because it read the module as REST. I renamed the module to studio-review-links and re-ran it: exit 0. Console type-check is NOT MEASURED: it needs every ui plugin dist built (exit 2 for that reason) and is left to CI. test:repo for types ran locally, because the diff adds a repo-project test. PR check-runs at fa0deb8: total 0 when read, because CI had not started yet. Status in_progress; PM reads convergence.",
    "dogfood_battery": "n/a: no ! in the PR title, and the Clause-② line is 'no' with no (narrowing) arm",
    "mcp_calls": "0",
    "api_writes": "2: (1) fleet-write relay pr_create, run 45392570874: POST /repos/objectstack-ai/objectstack/pulls (draft #36973) plus assignee os-support-ai. Read-back: 12767 bytes sent, 12767 stored, identical. (2) The os-dev-report comment on #36895 via post-stamped.mjs: POST /repos//issues/36895/comments. git push is not counted.",
    "deviations": "(1) Two pushes (the first WIP push and 166725c) went out before overlap-check. I ran overlap-check right after each, and every later push was checked first. (2) The full ui suite was narrowed. It ran past an hour (2736 files) on a shared box, so I stopped my own run and used vitest related on the affected files. CI runs the full farm. (3) Console type-check is not measured (see gates). (4) The PR footer is the harness spelling ('Generated with Claude Code' plus the session URL), not os-dev.md's '---' plus 'Generated by Claude Code' form. Dev does not PATCH PR bodies, so the seat may fix it. (5) The harness reminder asks for a model-named Co-Authored-By trailer. Commits carry the model-free 'Co-Authored-By: Claude' trailer, per the dispatch order.",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: designer cards of epic #36890 · StudioDesignSurface keeps its own PILLAR_FOR_SURFACE_TYPE and explicit-pillar studioPillarItemPath/studioOrgScopePath calls (in the regions #36956 moves). A card that deletes a STUDIO_ITEM_PILLAR row must switch those too. Noted in the PR's Acceptance notes and the table's how-to, not filed",
    "carrier: designer cards of epic #36890 · StudioDesignSurface writes the scope segment unencoded, while every other producer encodes it. I kept it as it was via segmentEncoding verbatim, to stay byte-identical. Noted, not filed",
    "carrier: designer cards of epic #36890 · the same object address has three ?surface= spellings (object%3Aname, object:enc(name), form-encoded). All three are kept byte-identical and recorded in the table. Noted, not filed",
    "carrier: none · an incidental hardening: the pillar lookup now uses hasOwnProperty, so /studio/PKG/metadata/constructor/x no longer redirects to a garbage URL built from Object.prototype.constructor. Recorded in the PR's Acceptance notes",
    "carrier: none · overlap: #36956 (claude/issue-36893-sds-pillar-split) has one import-block conflict with this branch on StudioDesignSurface.tsx (adjacent deletions; keep both). My four call sites are not in their moved regions. #36784 conflicts with main on its own, not with this branch"
    ]
    }


    Generated by Claude Code

  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Round 2 delta (merge only) · PR #36973 · head 2a9f6e9864

    1. Merge 6b908b2a36 (git merge --no-edit origin/main at 144d368eac; no rebase, no force-push). One file conflicted: StudioDesignSurface.tsx, its import block. refactor(app-shell): move the Data, Automations and Access pillars out of StudioDesignSurface.tsx (move-only) #36956 dropped the draftVerdict import and this branch dropped the nav-selection import, adjacent lines. Resolved by keeping both deletions. Neither import has a remaining use in the merged file. My four call sites are outside the regions refactor(app-shell): move the Data, Automations and Access pillars out of StudioDesignSurface.tsx (move-only) #36956 moved. The moved pillar modules (DataPillar.tsx, AutomationsPillar.tsx, AccessPillar.tsx) call studioPillarItemPath / studioOrgScopePath, which are builder-backed. They hold no hand-built address, and the guard is green over them.
    2. Fix 2a9f6e9864 for the red Test UI (1/16) on 6b908b2a. The 13379 navigate-host pin reads the console route table as source text, as every top-level path="/..." in App.tsx and StudioRoute.tsx. Round 1 had spelled the /studio route as path={STUDIO_ROOT_PATH}, which took studio out of that table. Chosen: the first option. A route pattern is a declaration, not a producer, so StudioRoute.tsx again writes path="/studio" (byte-identical to main). The guard now spares only the string initializer of a Route element's path attribute. New controls: Link to="/studio", a path on any non-Route tag, and a template-literal Route path are still refused. A plain and a parameterised Route pattern are spared. The pin's control is untouched.

    Local runs at 2a9f6e9864 (under the verify lock):

    • The 13379 pin, studioAddress.test.ts, studioAddress.guard.test.ts and every test reading StudioRoute: Test Files 20 passed (20), Tests 251 passed (251).
    • app-shell type-check: exit 0.
    • eslint on the three round-2 files: 0 errors.
    • At 6b908b2a36: the related ui list (294 files, extended with the tests naming the moved pillar modules) passed 294/294 files, 2488/2488 tests. @objectstack/types local and repo projects: exit 0. types, runtime and cli typecheck: exit 0.

    Overlap (overlap-check before each push):

    GitHub: PR #36973 reads mergeable true (state blocked = draft plus required checks, no longer dirty). CI started on 2a9f6e9864: 64 check-runs, 39 in progress at the time of reading.


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Round 3 delta (L1 S1 + N1, prose only) · PR #36973 · head 2fec7fb8d9: Clause-②: yes (widening) in the changeset and the PR body (Metadata-protocol stays none, bumps stay patch; body read back identical, 12869 bytes); one doc line on studioPath dropping an empty segment; no merge (PR was clean); no code change.


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Claim amendment · 2026-11-24T14:04Z · Area: ux-A
    Clause-②: yes (widening) (was no)
    Metadata-protocol: none

    Per L1 S1 7133576403 on PR #36973: the published @objectstack/types entry gains two exports, studioChangesReviewLink and studioItemReviewLink (via export * from './studio-review-links.js'). The bumps stay patch. Lane-keep: stays in area ux-A; the declaration-face L2 (TIER_DEFAULT) runs in L1-b (3) (claim 7133760397). Reviews now go to L1-b (3), not L1-b (2).

  9. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Round 4 delta (merge only) · PR #36973 · head b6e22ef09384a52025c3fc5ba525102121bcef68


    Generated by Claude Code

  10. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Close-out · 2026-11-24T16:17Z · PR #36973 merged as 9c57bd2 (merge-round ACCEPT 7135695234, TIER_DEFAULT L2 PASS 7135676769 at head b6e22ef). Closed by Fixes; pm:dispatched removed. The worktree and dev agent are gone and nothing is left open. Carried for #36985 (#36899, ux-E / new Studio seat): its merge must repoint studioMenuModel.ts's /studio/ template literal and its studioMetadataAreaPath compositions onto studioAddress.ts, or the address guard goes red. Open nits for the designer cards' reviews: L1 N2 (the guard reads literals only; watch for a path composed onto a builder's output) and the round-1 notes (duplicate PILLAR_FOR_SURFACE_TYPE, unencoded scope segment, three ?surface= spellings, now tabled in studioAddressTable.ts).

  11. removed
    pm:dispatched
    on Nov 24, 2026
  12. added 3 commits that reference this issue on Dec 1, 2026
    9c57bd2
    a68b475
    355c73c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions