Skip to content

fix(plugin-designer, app-shell): app writers save a packaged app at its package - #35151

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35115-app-writes-package-scope
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35115-app-writes-package-scope

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

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

维护者速读

  • 改了什么:控制台「编辑应用」向导和导航同步(新建/删除页面、仪表盘时自动改应用导航)在保存属于某个软件包的应用时,现在带上该包(?package=),与读取时用的是同一个地址;不属于任何包的应用保持原来的无包地址。
  • 为什么改:之前读的是包里的那一行,写却落到无包地址,编辑一个包内应用(名称、导航)可能写到错误的层,不在应用所属的包里。
  • 风险与回滚:只改两处前端写入的地址;受管包的密封应用(ADR-0131 D6)在任一地址都被服务端拒绝,导航同步也照旧跳过它,没有放宽写入面。回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/hooks/useNavigationSync.ts(新增 appAddress,读、写、撤销共用它);ui/packages/plugin-designer/src/pages/EditAppPage.tsx(保存带 servedPackageId);两个 *-35115 测试文件。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-designer/src/__tests__/EditAppPage.packageScope-35115.test.tsx packages/app-shell/src/hooks/__tests__/useNavigationSync.packageScope-35115.test.tsx,预期 2 个文件、6 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

  • N3. Both console app writers now read and save an app at the package that owns it.
    • EditAppPage already read the stored app at the served _packageId; its save now passes the same package as { packageId } (the SDK sends ?package=). One owningPackage reading decides the address for both the read and the save, the same reading App management's saveApp uses: a missing _packageId and the server's sys_metadata sentinel are package-less, so a package-less app keeps the package-less read and save (a three-argument saveItem, byte-identical to before).
    • useNavigationSync gains appAddress(appName): the served app's name and its owning package (isPackageLessItem from studioScope, the existing package-less predicate). storedApp reads at it, and saveApp (so every navigation write and every Undo) saves at it.
    • ADR-0131 D6 holds: the all-apps writes still skip a sealed managed app (isNavigationSyncableApp, unchanged), and the server's save door refuses a write onto an artifact-backed app of a type with no overlay channel whether or not the write names its package (refusePackagedBaseOverride: ITEM_LOCKED when it names the read-only base, NOT_OVERRIDABLE otherwise). Naming the package writes nothing the package-less save did not.
  • N1, left unticked. No existing locale key fits edit-app-load-failed ("Application NAME could not be read for editing: REASON"): the appDesigner.* group holds wizard chrome only, and common.* has no read-failure sentence. EditAppPage uses no translation hook at all, and its sibling strings (not found, the success and failure toasts) are hard-coded too. A new key means every locale pack plus the DESIGNER_DEFAULT_TRANSLATIONS mirror, which is beyond a copy nit.
  • N2, left unticked; its premise is half gone. Measured on the code: a refused authored read already shows its own message. getAuthoredItem rejects with the MetadataError its parseError builds from the server's error.message, and the page's reason() passes that message through. The "unknown error" comes only from the empty read (getAuthoredItem answers null when no layer holds the app), where saveApp throws a bare Error() and there is no server sentence to show. Saying something better there needs a new appManagement.toast.* key in every pack, so it is left.

Tests

  • New pins, one file per writer, named for this card:
    • ui/packages/plugin-designer/src/__tests__/EditAppPage.packageScope-35115.test.tsx: a packaged app is read and saved at its package; a package-less app, and one served with sys_metadata, read with {} and save with three arguments.
    • ui/packages/app-shell/src/hooks/__tests__/useNavigationSync.packageScope-35115.test.tsx: the same three cases for a navigation write, including the Undo save.
  • One existing assertion changed: useNavigationSync.authoredApp-35054.test.tsx pinned the package-less read of its packaged fixture (_packageId: 'com.qa.tr'), the defect this card fixes; it now expects { packageId: 'com.qa.tr' }.

Acceptance notes

  • useNavigationSync now writes at the served app's name, not at the appName argument: the two differ only when a caller passes a route segment (a package id), which no in-repo caller does (the all-apps methods pass app.name).
  • The sys_metadata sentinel constant now has one more module-local copy (EditAppPage, beside MetadataObjectsPage, AppManagementPage, studioScope and appRoute); plugin-designer cannot import app-shell's predicate. Not filed: no defect, a consolidation.
  • The write address was measured at the unit layer (the saveItem options the page and hook hand the SDK, and metaSaveQuery turning packageId into ?package=); NOT MEASURED live against a booted server.

Verification

All readings at head 338b3971 (tree objectstack-ai/objectstack, merge base aef42cba4).

Tests and type-check
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-designer/src/__tests__/ packages/app-shell/src/hooks/__tests__/ packages/app-shell/src/views/metadata-admin/ResourceEditPage.navigationWrites-28680.test.tsx packages/app-shell/src/preview/__tests__/ apps/console/src/pages/system/__tests__/ (lock VERDICT command-exit 0): Test Files 184 passed (184), Tests 1622 passed (1622). The two new pin files re-run at head: 2 files, 6 tests passed.
  • pnpm --filter @object-ui/plugin-designer --filter @object-ui/app-shell run type-check: both tsc --noEmit and tsc -p tsconfig.test.json legs exit 0 (the app-shell re-run after a test-only cast fix, lock VERDICT command-exit 0).
Ablations (scripts/ablation-replace.mjs, each restored with blob == HEAD and git diff HEAD empty)

Subjects are imported by relative source path, so no build sits between the mutation and the run.

  1. EditAppPage save without { packageId: servedPackageId }: the packaged case RED (expected undefined to deeply equal { packageId: 'com.qa.scope' }), the package-less and sentinel cases GREEN. Blob 844e7d40 to 87b19d7c, restored to 844e7d40.
  2. useNavigationSync save without { packageId: address.packageId }: the packaged case RED (expected [ 'app', 'qa_scope_app', undefined ] to deeply equal [ 'app', 'qa_scope_app', …(1) ]), the other two GREEN. Blob 0b302ecd to 9b7f237d, restored to 0b302ecd.
  3. useNavigationSync read without the package: the packaged case RED on getAuthoredItem called with the package, the other two GREEN. Blob 0b302ecd to 681d055e, restored to 0b302ecd.

Direction in each: the one predicted in the file headers.

Derived gate families
  • node scripts/pm/dispatch-gates.mjs --commands: 38 commands; all 38 run, each exit 0 (--ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, all carrying exit codes). The --ran run flagged scripts/check-skill-identifier-liveness.mjs as changed on origin/main after the merge base; this diff touches no skill, and CI runs the current copy.
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (merges cleanly with origin/main).
  • Everything else CI runs (type-check lanes, Test UI shards, the whole-tree and roster families) is left to CI.

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 18, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Final head for L1 · 2026-11-18T08:37Z

Head-sha: 338b397196 · all check-runs success or skipped (39 success, 13 skipped, 0 red) · NOT governed, +317 / −21.
Owed: L1 (first read; area o1-B requests it from L1-a). No L2: ui only, Clause-②: no (no export, prop or locale key changes), Metadata-protocol: none. Inputs: claim 6971820940, dev report 6973015075, area note 6973060711 on #35115 (N3 built here; N1/N2 moved to loose-ends card #35155, so Fixes #35115 stands). Points for the reader: one existing assertion in useNavigationSync.authoredApp-35054.test.tsx changed because it pinned the defect; EditAppPage's read for a sys_metadata-sentinel app now names no package; useNavigationSync writes at the served app's name. ADR-0131 D6 unchanged (sealed managed apps still skipped / refused). Measured at the unit layer only, three ablation legs red.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9

L1 review (#35115) · 2026-11-18T08:39Z

L1: ACCEPT
Head-sha: 338b397

This is the first L1 on this PR. I read the full diff against the merge base aef42cba4e: 6 files, +317 / −21. I also read the card, claim 6971820940, os-dev report 6973015075, area note 6973060711 and the final-head comment 6973403395.

The fix.

  • EditAppPage now derives servedPackageId through one owningPackage reading, which treats a missing _packageId, '' and the sys_metadata sentinel as package-less. The page reads with that address (getAuthoredItem(..., { packageId }) or {}) and saves with it too: saveItem('app', name, merged, { packageId }) for a packaged app, and the three-argument call, unchanged, otherwise. servedPackageId joins the save callback's dependency list.
  • useNavigationSync gains appAddress(appName), built on findApp and the existing isPackageLessItem predicate (studioScope.ts, the same three package-less values). storedApp reads at that address and saveApp saves at it, so every navigation write and every Undo uses the address the read used. findApp only moved above its new caller.
  • ADR-0131 D6 is untouched. isNavigationSyncableApp still keeps the all-apps writes off a sealed managed app, and naming the package does not widen what the server's save door accepts.

Shape and scope.

  • Fixes #35115 is on the first card line, and no closing keyword sits next to another open card. Per area note 6973060711, the card's build item is N3, and N1/N2 moved to the open loose-ends card console UI (area o1-B) loose ends: copy and doc-comment nits from landed reviews #35155, so the closing keyword stands.
  • Every changed path is inside the claim's file surface. The N1/N2 copy paths in the claim are not used, which shrinks the surface rather than leaving it.
  • check-governed-merges --pr 35151: not governed, 338 changed lines, under the 3,000-line threshold.
  • Clause-②: no and Metadata-protocol: none are right. No export, prop, locale key or packages/spec path changes, and the hook's return type is unchanged. No contract record is owed.

Changeset. .changeset/35115-app-writes-package-scope.md is new, not on main. It bumps plugin-designer, app-shell and console at patch. console ships the pre-built SPA that bundles both packages, which is the repo's practice for a UI fix. Its sentences match the diff, apart from N1 below.

Deviations named for this read, all accepted.

  1. The one changed assertion in useNavigationSync.authoredApp-35054.test.tsx: its fixture app has _packageId: 'com.qa.tr', and the old line pinned the package-less read that this card fixes.
  2. EditAppPage no longer reads a sentinel-served app with { packageId: 'sys_metadata' }. Read and save now share one address, the same one App management uses.
  3. useNavigationSync writes at the served app's name rather than at the appName argument. The two differ only for a route segment, and no in-repo caller passes one.

Tests and evidence.

  • Two new pin files, one per writer, each covering three cases: packaged, package-less, and the sentinel. The navigation-sync file also pins the Undo save's address.
  • Three ablation legs in the PR body: the page save, the hook save and the hook read. In each, only the packaged case goes red, and each restore is verified (blob == HEAD, empty diff).
  • The UI suites run: 184 files and 1,622 tests passed. Both type-check legs exit 0. dispatch-gates --commands: 38 derived, 38 run, all exit 0.
  • The write address was measured at the unit layer only. The body says it was not measured live, and I accept that for a call-site argument change.

CI at this head, from check-runs: 39 success, 13 skipped, none failed or in progress.

Must-fix

None.

Should-fix

None.

Notes

  • N1, changeset wording. "An app no package owns, including one served with the sys_metadata sentinel, keeps the package-less address" is exact for the navigation sync and for both saves. The Edit app read is the exception: for a sentinel-served app it used to send ?package=sys_metadata and now sends no package, so that read moves to the package-less address rather than keeping it. This is optional. If the changeset is touched again, "uses" in place of "keeps" would be exact. Otherwise it can go on loose-ends card console UI (area o1-B) loose ends: copy and doc-comment nits from landed reviews #35155 or be left as is.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Landing · 2026-11-18T08:40Z

Probe Reading
check-governed-merges.mjs --pr 35151 NOT governed · +317 / −21, ui-only, Clause-②: no
Head / review 338b397196 · L1-a ACCEPT 6973438958 at this head (first L1; no must-fix, no should-fix), the review of record; no L2 owed · all check-runs success or skipped (39 success, 13 skipped, 0 red)
Freshness K = 9, merges cleanly into origin/main 99a0e4fbfc; overlap-check.mjs clean

Open findings: L1 notes only (N1 changeset wording). #35115 items N1/N2 live on loose-ends card #35155.

State: ready + auto-merge armed by area o1-B (lease o1-B, claim 6971820940); Fixes #35115 closes the card on merge.

Dev-effort: medium · Rounds: 1

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 18, 2026 08:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 2fea6d2 Nov 18, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35115-app-writes-package-scope branch November 18, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m 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.

review follow-ups of PR #35104: app writes from EditAppPage and useNavigationSync save with no package scope

2 participants