Repository navigation
feat(runtime): the customizations read serves the nav contributions other packages add to a base's apps - #29742
Conversation
…red on main Co-Authored-By: Claude <noreply@anthropic.com>
readBaseContributions reads the navigation-contribution registry the served app's fold reads, for each app registered under the base: one entry per item with an id, the contribution's group when it names one, the disabled-package skip the fold applies, and the base and pair excluded through the shared stamp predicate. The spec nav arm drops its planned marker; docs regenerated. Co-Authored-By: Claude <noreply@anthropic.com>
…n merge Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 173 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 d04d248aada870f93cab5b09545762c35d47c8a5 && git checkout d04d248aada870f93cab5b09545762c35d47c8a5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3eeb81d19495b9e4064685fc9662936a834f017c be2875456d3eb4a0f32bfaf0021cc62a0d57b1c9 && git checkout -B drift-repro 3eeb81d19495b9e4064685fc9662936a834f017c && git merge --no-ff be2875456d3eb4a0f32bfaf0021cc62a0d57b1c9
node scripts/docs-audit/affected-docs.mjs --json 3eeb81d19495b9e4064685fc9662936a834f017c |
|
domain:server#3 · os-warren · session_01JQwxbYyp6wSRcywGFK2L4A Contract reviewServed-tier: Reviewer: an at-tier subagent adopted by this seat. Inputs: card #28722 and every comment, ruling 6566915346 (#27928 letter E), the PR body, file list and net diff at the head, the head's check-runs (none failed at review time; Test Core / Test UI / type checks / builds still in progress, read again by the seat before landing). ① Derived judgments
② Semver levelChangeset: ③ Boundary flags
④ Design judgment
Findings:
No must-fix. Implemented-by: VERDICT: PASS |
…d-ahead members Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:server#3 · os-warren · session_01JQwxbYyp6wSRcywGFK2L4A Contract reviewServed-tier: Delta review by the same at-tier reviewer as record 6594600155: one commit ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentThe zod header now agrees with the file's own markers. The regenerated mdx paragraph is the zod comment verbatim, and the mdx still carries both Implemented-by: VERDICT: PASS |
…ent export as declared ahead The nav arm is served by #28722's server slice (#29742); the paragraph now names PackageExportBundleSchema (#28914) alone. Reference doc regenerated. Claude-Session: https://claude.ai/code/session_01JQwxbYXRMR5S5B7JSmKkV7 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#3 · os-warren · session_01JQwxbYyp6wSRcywGFK2L4A 维护者速读
席位核对ACCEPT ·
|
…he reference after merging main With #29742 (nav arm), #29755 (whole-deployment export) and this change (withheldMaps) all served, no member of package-lifecycle.zod.ts is declared ahead of its producer. Claude-Session: https://claude.ai/code/session_01JQwxbYXRMR5S5B7JSmKkV7 Co-authored-by: Claude <noreply@anthropic.com>
Requested by Warren · project thread
Fixes #28722
Ruling-ref: 6566915346
Clause-②: no
Metadata-protocol: none
维护者速读
GET /packages/:id/customizations的contributions现在真正返回nav条目:别的已安装包往本包应用里加的导航项,每条写明是哪个包加的;spec 里nav臂去掉 [PLANNED — not yet served] 标记。nav条目,形状 spec 早已声明;读的是菜单折叠用的同一个注册表,停用包的条目不列,和菜单一致;导航项本身不加任何键;回滚即撤掉此 PR。packages/runtime/src/domains/packages.ts(readBaseContributions新增的 nav 段与排序)、packages/runtime/src/domains/packages-customizations.test.ts(新测试)、packages/spec/src/api/package-lifecycle.zod.ts(去标记)。pnpm --filter @objectstack/runtime exec vitest run src/domains/packages-customizations.test.ts,预期 22 个测试全部通过。What changes
The customizations read now serves the
navkind ofcontributionsthat the spec declared ahead of its producer in #29401 (ruling 6566915346, letter E).readBaseContributions(packages/runtime/src/domains/packages.ts) reads the navigation-contribution registry (getAppNavContributions), the one the served app's fold (applyNavContributions) reads, for every app registered under the base (listItems('app', baseId)). It writes one entry per item of a contribution'sitemsthat declares anid:{ kind: 'nav', app, group?, name, packageId }.groupis the contribution'sgroupwhen it names one, including a group the app does not declare (the fold relocates those items to the top level, and the spec arm says the group is still named). A separator with noidis not an entry, and a contributed group's children ride inside it.isPackageDisabled, packages: an admin cannot disable a type:module sub-package of an installed app (422 WRITABLE_PACKAGE_REQUIRED), and a disabled package's nav contributions stay in the app #28117), asked per read. The base and its pair are excluded through the stamp predicate thefieldandflowkinds already share (codePackageOf), which also drops a package-less registration and thesys_metadatasentinel. Nothing is read from or written to any nav item, and no client-side join on names is involved.fieldandflowentries first, ordered as before. Then thenaventries, by app, group (no group first), name and package.counts.contributionscounts every entry.Excludetype annotation feat(spec): the customizations read's contributions declare a nav kind, with an entry shape per kind #29401 added is gone. The local types are the member's own arms.packages/spec/src/api/package-lifecycle.zod.ts): thenavarm's describe drops[PLANNED — not yet served], and so do the member describe, the schema describe, the file header and the schema docblock. The docblock keeps the ruling's MUSTs: the same registry, no disabled package, no key on any nav item. The schema accepts exactly what it accepted before. The planned-marker pin inpackage-lifecycle.test.tsis flipped in the same change: the arm, the member and the schema now carry noPLANNED/not yet served.content/docs/references/api/package-lifecycle.mdx(gen:docs, the only artifactcheck:generatednamed stale).content/docs/api/metadata-api.mdxnow names thenavkind as served..changeset/28722-customizations-serve-nav-contributions.md:@objectstack/runtimepatch and@objectstack/specpatch (the describe text ships indist). The authorable-surface shard did not move:check:generated, includingcheck:authorable-surface, exits 0 with nopackages/spec/authorable-surface/**change. So the declaration isMetadata-protocol: none, andClause-②: nobecause the arm was already declared.Why
#28722 Wanted 3: Studio needs one served answer naming the package behind each navigation entry another package adds to an installed base's app, so it can draw those entries greyed with their source (ADR-0029 D7, ADR-0146 D3, #27356 row 20). The spec slice (#29401) declared the shape. This serves it from the registry the menu fold reads.
Tests
packages/runtime/src/domains/packages-customizations.test.ts. The fixture's base now ships an app with a group, and the other base ships one of its own. The card's third package also contributes a nav item through its manifestnavigationContributions. The pair contributes a nav item to the base's app, and so does the base itself.GetPackageCustomizationsResponseSchema.registry.getApp) carries beyond the base's and the pair's own.sys_metadatasentinel are not listed.packages/spec/src/api/package-lifecycle.test.ts: the three planned-marker pins flipped.Red first, then green
8b347c02on base744211fc(packages.tsunchanged):vitest run src/domains/packages-customizations.test.tsexit 1, 6 failed and 16 passed of 22. Every failure is an AssertionError on missingnaventries.package-lifecycle.zod.ts: exit 1, 3 failed and 50 passed of 53. With the zod edit: exit 0, 53 of 53.66293723: runtime suite file exit 0, 22 of 22.Ablations (each through scripts/ablation-replace.mjs, restored to the HEAD blob 21dfef8a1015, git diff HEAD empty; runtime reads packages.ts from src, so no rebuild between legs)
codePackageOfreplaced by the rawpackageId: 6 red (base, pair, sentinel and package-less items appear).listItems('app', baseId)replaced bylistItems('app'): 2 red (the not-owned test, and another base's read).groupspread deleted: 2 red. The first attempt passed an empty--replacement, which the tool refused before running anything (replacement count 0 to 0). It was rerun with--delete.Local readings (final head `58810e41`)
origin/maintwice throughscripts/pm/os-regen-merge.sh: atfc558923, and at3d5933a9after feat(spec,runtime): a package export carries its namespace and dependencies, so a reinstalled .custom pair keeps both (#29617) #29651 touched bothpackage-lifecycle.zod.tsandpackages.ts(no conflicts). The second merge took main's side ofcontent/docs/references/api/package-lifecycle.mdx, which was then regenerated from the merged tree (gen:schemavia the spec build, thengen:docs) ina4c5be41. A third merge at0eb97fa4(58810e41) took in fix(runtime): the base export serves the base's own document while a .custom override of it is live #29687, which is packages: a published dashboard or report override removes the item from the base's export, where ADR-0146 D8 item 3 says the base export is unchanged #29649's change topackages.ts(seat 4's serial PR). It merged with no conflicts and no regeneration owed. Every reading below was retaken at58810e41unless it names another head.turbo run build --filter='@objectstack/runtime...'VERDICT command-exit 0 (34 tasks) at58810e41.turbo run build --filter='./packages/**'VERDICT 0 (78 tasks) was the prerequisite forcheck:skill-examplesandcheck:dual-build-cjs-loads, which exit 3 with no built output.packages/speccheck:generated: before regeneration it named exactlycheck:docsstale. Aftergen:docsit exits 0, includingcheck:authorable-surfacewith no shard change, which is theMetadata-protocol: nonereading. One run ata4c5be41reportedcheck:test-typecheckastsc … failed without diagnosticswhen started withoutNODE_OPTIONS. Rerun alone with--max-old-space-size=4096it is OK (52 files, 240 errors, 131 pinned signatures held), and the finalcheck:generatedexits 0.pnpm --filter @objectstack/spec test: exit 0, Test Files 803 passed (803), Tests 23782 passed, 1 todo (head9540d333).src/api/package-lifecycle.test.tsat58810e41: 57 passed.pnpm --filter @objectstack/spec typecheck: exit 0.pnpm --filter @objectstack/runtime typecheck: exit 0 at58810e41. The first run at9540d333exited 1 only because@objectstack/driver-tursohad nodist(TS2307 in an untouched test file). Once that package was built, it exits 0.pnpm --filter @objectstack/runtime testunder the lock, at58810e41: VERDICT command-exit 0, Test Files 531 passed (531), Tests 8529 passed, 19 skipped.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat58810e41(and before ata4c5be41, same result): 104 commands, all 104 exit 0 (stdin closed, exit captured before any pipe).--ran: 104 derived, 104 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. In the first round at9540d333, three commands exited 3 on prerequisites:check-plugin-teardown-shape --self-test(shallow clone; its fixture commit was fetched, then 48 cases pass), andcheck:skill-examplesandcheck:dual-build-cjs-loads(no built output; exit 0 after the build above).pnpm lint: exit 0 at58810e41.test:repo(CI's Test Core), and full dogfood (no!in the title, no narrowing arm).Acceptance notes
package-lifecycle.zod.tsthat lists the declared-ahead members. This PR leaves onlywithheldMapsthere, so whichever lands second takes the other's sentence. packages: a published dashboard or report override removes the item from the base's export, where ADR-0146 D8 item 3 says the base export is unchanged #29649 (seat 4) touchesownDocumentsOfinpackages.ts, a region disjoint from this one. packages: a package export marks each withheld connector header/env map, so an import knows it is incomplete (#28640 ruling 3A) #29342 had not landed at the final merge. packages: a published dashboard or report override removes the item from the base's export, where ADR-0146 D8 item 3 says the base export is unchanged #29649 landed as fix(runtime): the base export serves the base's own document while a .custom override of it is live #29687 and is merged in (58810e41).listItems('app', baseId)already hides the base's app, so the read lists nonaventry, whilefieldentries on its objects are still listed. Nothing is served to contribute to in that state, and the docblock says so.Verification
pnpm --filter @objectstack/runtime exec vitest run src/domains/packages-customizations.test.ts→ 22 passed.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbYJ6AF6nA1jMoub4rQ