Repository navigation
fix(rest): the app metadata bundle serves its objects in the object list's order - #29752
Conversation
The bundle built its objects as navigation reach, then inbound relations, so a navigation object that references another navigation object sat ahead of its place in the object list. Serve the same set in the object list's order; names the list does not hold keep their navigation order after it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWHJEZNQyk4aybUZm1
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWHJEZNQyk4aybUZm1
…s order The AppMetadataBundleResponseSchema docblock and its `objects` description said navigation order, then registry order. State the object list's order the route now serves, with unlisted names after in navigation order. Regenerated the API reference page; no shape change. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWHJEZNQyk4aybUZm1
📓 Docs Drift CheckThis PR changes 2 package(s): 12 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 171 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 20d74aa781a436870756ea70bfb1e492b957bd45 && git checkout 20d74aa781a436870756ea70bfb1e492b957bd45
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c76c0e042ea1efc9ccb7b209a82dd8f0fc119953 03d20969e341ad9566aae4c738fefc6abee8b365 && git checkout -B drift-repro c76c0e042ea1efc9ccb7b209a82dd8f0fc119953 && git merge --no-ff 03d20969e341ad9566aae4c738fefc6abee8b365
node scripts/docs-audit/affected-docs.mjs --json c76c0e042ea1efc9ccb7b209a82dd8f0fc119953
|
|
domain:server#1 · os-warren · session_01JQwxbXsK9j25sd7eVwW96G Contract-review-claim: session_01JQwxbXsK9j25sd7eVwW96G · head 03d2096 · 2026-11-03T03:22Z |
|
domain:server#1 · os-warren · session_01JQwxbXsK9j25sd7eVwW96G Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
domain:server#1 · os-warren · session_01JQwxbXsK9j25sd7eVwW96G 席位核对ACCEPT ·
|
Requested by Warren · project thread
Fixes #29680
Clause-②: no
Metadata-protocol: none
Claim: 6593195648 (seat
domain:server#1). Triage designation 6593258467: one cross-domain PR indomain:servercovering the rest fix and the twoapp-bundle.zod.tsorder sentences. This unblocks #29552 leg 1, whose PR waits on this one (Blocked-by).维护者速读
GET /meta/app/{appId}/bundle)里的objects改按对象列表的顺序返回,不再是"导航先、反向关联后"。集合不变,只是顺序。spec 里该响应的文档注释和objects描述同步改成对象列表顺序,参考页按生成器重新生成。objects的顺序会变;今天没有读者依赖这个顺序(界面按名字建索引)。导航顺序本就与列表一致的包逐字节不变。回滚即 revert。packages/rest/src/meta-app-bundle-routes.ts的inObjectListOrder和调用处;packages/spec/src/api/app-bundle.zod.ts的两句契约文字;meta-app-bundle-routes.test.ts新增的 rest(app bundle): serve the bundle's objects in the object list's order, not navigation-reach first #29680 用例。pnpm --filter @objectstack/rest exec vitest run src/meta-app-bundle-routes.test.ts,预期 1 个文件、19 个用例全部通过。What changes
packages/rest/src/meta-app-bundle-routes.ts. The bundle built its objects asmembers('object', [...reach.objects, ...inbound]).inboundRelationObjectsskips the reach targets, so an inbound object that is also a navigation object (contactreferencingaccount) kept its navigation place. The route now serves the same names through a new exportedinObjectListOrder(list, names): every name the object list holds, at its first position in that list (the listobjectList()already reads), then the names the list does not hold, in their own (navigation) order. The set is unchanged, so views and pages, which derive from the served set, do not move. Nothing else in the bundle changes.packages/rest/src/rest-route-ledger.ts. The route's ledger note now reads "objects: navigation plus one hop of inbound relationships, in object-list order".packages/spec/src/api/app-bundle.zod.ts. Docs only, no key and no shape change. The docblock'sobjectsbullet said "in navigation order; then ... in registry order"; it now says the navigation objects and their inbound relations come "all in the object list's order; a name the object list does not hold follows the listed ones, in navigation order". Theobjects.describe()says "in the object list's order".content/docs/references/api/app-bundle.mdxwas regenerated withgen:schema+gen:docs; no other tracked artefact moved..changeset/29680-app-bundle-object-list-order.md:@objectstack/restpatch,@objectstack/specpatch (the docblock ships indist).Readers of the bundle's
objectsarray (checked before editing):ui/packages/data-objectstack/src/app-bundle.tsindexAppBundleindexes every member by type and name into aMap;packages/clientmeta.getAppBundlepasses the body through. No reader relies on reach-first order. Navigation reads the app's own entries, not this array.Tests
packages/rest/src/meta-app-bundle-routes.test.ts:enableCache: falsebundle) now expectaccount, contact, secret_deal, note, task, deal_line. That fixture is the card's case:contactis a navigation object that referencesaccount.inObjectListOrderunit case, including names the list does not hold (kept after, in their own order).contactthenaccount(one references the other): objects come backaccount, contact, note, task; views and pages are the same set as before.accountonly): the servedobjectsare byte-equal to the reach-first derivation's item reads (account, contact, note).Ablation: reach-first again, once, restored
Through
scripts/ablation-replace.mjs(wrap mode, restore trap) underos-verify-lock, on commit 8c59a53. The test imports the route fromsrc(relative import), so no build leg applies.The CONTROL stayed green under the mutation: reach-first and list order agree on it.
Acceptance notes
check:dev-prereqs(local-only) exits 1 on this container because 35 workspace packages (mostlyui/**) are not built;packages/spec/distwas rebuilt from this head before the gates.Verification
All on head 03d2096 (after merging
origin/main0eb97fa), underos-verify-lockwhere heavy:Local gates
An earlier gate run on 8c59a53 caught an apostrophe that broke the single-quoted ledger note (
check-comment-mask-corpus,check:doc-authoringand two siblings refused to parse the file); commit 092ed98 fixed it.Human Minimum
packages/specholds no runtime logic.inObjectListOrder).pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbWHJEZNQyk4aybUZm1
Generated by Claude Code