Repository navigation
fix(metadata-protocol): the packaged app base carries contributed navigation, so Setup entries translate - #30553
Conversation
…se (#30504 repro) Claude-Session: https://claude.ai/code/session_01Utp6CayrDmiTYnJJzkKhec Co-authored-by: Claude <[email protected]>
… app base (#30504) Claude-Session: https://claude.ai/code/session_01Utp6CayrDmiTYnJJzkKhec Co-authored-by: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Utp6CayrDmiTYnJJzkKhec Co-authored-by: Claude <[email protected]>
📓 Docs Drift Check3 anchor(s) derived from 1 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 — 10 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 9675ab1c3f90ee08bf919f876184fdcb99dd8602 && git checkout 9675ab1c3f90ee08bf919f876184fdcb99dd8602
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 86ae2cac6ef7c859dd3d0f9305ca68e62666b790 5eef42172758da663c1d22226f21cfa36b7d3a9f && git checkout -B drift-repro 86ae2cac6ef7c859dd3d0f9305ca68e62666b790 && git merge --no-ff 5eef42172758da663c1d22226f21cfa36b7d3a9f
node scripts/docs-audit/affected-docs.mjs --json 86ae2cac6ef7c859dd3d0f9305ca68e62666b790 |
|
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF 维护者速读
席位意见:ACCEPT(#30504)。中文(及其他语言)控制台的设置侧栏子菜单现在按翻译显示,不再整片英文;英文界面不变,定制包自己写的菜单仍只用定制包的译文。 席位核对Head-sha:
|
Requested by Bill · project thread
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF
Fixes #30504
Clause-②: no
Metadata-protocol: none
维护者速读
packages/metadata-protocol/src/protocol-discovery-and-bases.ts的getPackagedAppBase;packages/objectql/src/protocol-custom-override-bare-slot-envelope.test.ts末尾新增的[#30504]用例。pnpm --filter @objectstack/objectql exec vitest run src/protocol-custom-override-bare-slot-envelope.test.ts -t 30504,应看到 4 个用例通过;或用中文打开控制台的设置,侧栏子菜单显示「用户」「权限集分配」等中文。What changes
getPackagedAppBase(name)(the body inprotocol-discovery-and-bases.ts;protocol.tsandmeta-item-read-gate.tsare untouched) now answers the app's packaged declaration with the code layer's navigation contributions folded in, through the one fold every served app read already applies,SchemaRegistry.applyNavContributions(ADR-0029 D7). No second copy of the fold. When the registry has no such method (a double) the declaration alone is answered, and a throw from the fold answers the declaration alone, which is the basemainanswered.Why this is the fix: the served app is
declaration + contributions(protocol-meta-item-reads.tsfolds them on read), while the base handed totranslateAppwas the declaration alone. For a node id the known base lacks,packagedNavNodesanswers{},valueOverridesPackagedBasereads the label as changed, and a changed label reads only the pair's translations (ADR-0146 D2). Outside a pair that bundle is empty, so every contributed entry kept its source text. With the contributions in the base, a contributed node is judged against its own packaged label and the catalog applies.ADR-0146 D2 is preserved: a node a
.customoverride authors is in no contribution, so it is still absent from the base and still reads only the pair's translations, else its own text. Shape B (packagedNavNodesanswering "no base knowledge" for an unknown id) was not taken, as the dispatch ruled: it would let the base catalog relabel an override-authored node.Tests
[#30504]inpackages/objectql/src/protocol-custom-override-bare-slot-envelope.test.ts(the metadata-protocol: page, app, dataset, doc and book serve a published override only from the registry bare slot; build the row-served path, then take them out of it #29613/Declared overrides: a mapping override publishes but is never served, doc and mapping overrides cannot be restored, and an override's label can be hidden by translation #30062 real-boot harness that already pins the packaged app base), with and without a metadata service:用户inzh-CNandUsersinen;nav_customkeepsCustom entrywith no pair translation (the catalog's基包译文is not taken) and reads the pair's自定义入口when the pair ships one, while the contributednav_usersreads用户in both.main: the test committed first (97886306),@objectstack/metadata-protocolbuilt without the fix: 4 failed / 87 skipped (expected {} to deeply equal { nav_users: 'Users' }). With the fix and a rebuild: the file 91/91 passed.origin/mainand rebuilding the objectql closure: this file plusregistry-nav-contribution-group-semantics.test.tsandregistry-nav-contribution-disabled-package.test.ts, 112/112 passed.pnpm --filter @objectstack/metadata-protocol exec vitest run: 316 files passed / 4 skipped, 22425 tests passed / 26 skipped (before the main merge; the merge brought only two metadata-protocol test files).pnpm --filter @objectstack/metadata-protocol --filter @objectstack/objectql typecheck: lock VERDICT command-exit 0.Acceptance notes
setup, plus one intoaccount(packages/mcp/src/connect-ui.ts,nav_connect_agent), the same code path, fixed here (live: served连接智能体). Studio carries no code-level contributions, so it is not on this path.protocol.ts's public docblock forgetPackagedAppBasestill reads "answered the same way" as the page base; it is left untouched to stay off seat 5's facade series, and the new behaviour is documented on the body inprotocol-discovery-and-bases.ts. A one-line docblock follow-up there can ride a laterprotocol.tsPR.nav_webhooksreadsWebhooksin zh-CN: that is the catalog's own zh-CN value, not a miss.Verification
Live: showcase stack, GET /api/v1/meta/app/setup, signed in as the seeded admin
examples/app-showcase,objectstack dev --seed-admin --freshon this branch's build (fix included):Accept-Language: zh-CN: 9/9 group headings and 45/45 leaf entries in the catalog's zh-CN text (44 contain CJK; the 45th isnav_webhooks=Webhooks, the catalog's value). First leaves:nav_system_overview=系统概览 | nav_packaged_actions=打包动作 | nav_marketplace_browse=浏览应用市场 | nav_marketplace_installed=已安装应用 | nav_users=用户 | nav_organization=当前组织 | nav_business_units=业务单元 | nav_teams=团队. Onmainthe ui seat's dev measured 0/45 (os-dev-report 6660644606).Accept-Language: en: 0/9 and 0/45 CJK, labels unchanged (Users,Organization, …).GET /api/v1/meta/app/accountin zh-CN:nav_connect_agent=连接智能体.Gates (local subset, derived by dispatch-gates --commands on this diff)
58 derived families, all
:: exit 0;--ranreconciles 58 run, 0 NOT-MEASURED. Two first ran as exit 3, PREREQUISITE NOT MET, and were re-run once their prerequisite was met:check-plugin-teardown-shape.mjs --self-test(shallow clone, after fetching its pinned fixture commit621a4876) andcheck:dual-build-cjs-loads(seven packages had nodist/; 116 entry points across 71 packages load). Record: project filesserver-seat4/30504/.pnpm lint: no findings. Taken on head5eef4217.Generated by Claude Code