Repository navigation
feat(spec): a navigation translation node may carry keywords without a label - #39207
objectstack-fleet[bot] merged 4 commits into
Conversation
…label (#39146) Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 183 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 d0776a94f10d0d562c48d4e912411b2bf62b5e73 && git checkout d0776a94f10d0d562c48d4e912411b2bf62b5e73
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f1df7a8f4c408734a4a77e6fb83a92b6f286177c 6f8e8ca249bc57928e563584bdf2155aa076dd27 && git checkout -B drift-repro f1df7a8f4c408734a4a77e6fb83a92b6f286177c && git merge --no-ff 6f8e8ca249bc57928e563584bdf2155aa076dd27
node scripts/docs-audit/affected-docs.mjs --json f1df7a8f4c408734a4a77e6fb83a92b6f286177c |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract-review-claim: session_01QSeKYnrQ7UMtHofKQVjcH2 · head 6f8e8ca · 2026-12-02T23:39Z First full record at |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: First record on this PR, read at 2026-12-03T00:00Z. Merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Findings: S1 (should-fix) — the PR body's
Implemented-by: VERDICT: PASS 维护者速读:放宽与申报一致,五个共用该形状的 schema 都只多接受「只有 keywords 的导航翻译节点」,运行时标签沿语言链回落到源标签、关键词按裁决叠加,覆盖检查仍把缺的标签报为未翻译;一条应改项在 PR 正文( |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39207 (#39146, epic #39050) · head 席位核对ACCEPT · repo:objectstack@os-justin · head
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Landing · 2026-12-03T00:09Z · PR #39207: the seat ACCEPT is above, the contract review PASS is 7362701980 at the same head, and CI is green. Not governed (204 lines), so the seat lands it through the queue. |
Fixes #39146
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #39209 —
content/docs/ui/apps.mdx:315-318teaches bundle nav keywords beside the label;content/docs/ui/translations.mdxandskills/objectstack-i18n/SKILL.mdlist the label only (contract review 7362701980, S1)Widened: a navigation translation node,
apps.APP.navigation.IDin a translation bundle and in a registeredtranslationitem, now parses withkeywordsand nolabel; itslabelis optional wheneverkeywordsis present.维护者速读
What changes
packages/spec/src/system/translation.zod.ts: the app navigation node'slabelis now.optional(), and the node carries.refine(requiredOneOf(['label', 'keywords'])), so a node must carry at least one of the two. A node with neither is refused at...navigation.ID.labelwith a sentence naming both keys and the two ways out.requiredOneOfis the declared, projectable refinement (shared/refinement-projection.ts), so the published JSON Schema states the same rule.translateApp(packages/spec/src/system/i18n-resolver.ts, which the metadata protocol calls) readslabelper key along the locale chain (lookupNavLabel), so a keywords-only node falls through to the next locale's label, else the source label; keywords merge under the add rule of seat ruling 7347779833 (a), as before.os i18n checkandos lint(computeI18nCoverageover the lint walker'sapps.APP.navigation.ID.labelentries) look the label key up as a non-empty string, so a keywords-only node still reports its label as untranslated.app-nav-keywords.test.ts(the "node still owes its label" control becomes "keywords-only parses" plus "neither is refused") andtranslation-contributed-nav-bundle.test.ts(its@ts-expect-erroron an empty node became unused, since the type no longer requireslabel; the schema-level refusal at the same path still holds).packages/spec/docs/references/system/translation.md(check:generated --fix, which namedcheck:docsas the only stale artifact).Tests
packages/spec/src/system/translation-nav-keywords-only.test.ts(A translation bundle can give a navigation entry its keywords without pinning its label (#39050) #39146): keywords-only parses at the bundle and item doors;translateAppserves the source label and the merged keywords; the next locale's label is served along the chain; a node with neither key is refused at both doors (code: custom, path...nav_positions.label); label-only still parses.packages/cli/test/i18n-nav-keywords-only-coverage.test.ts(A translation bundle can give a navigation entry its keywords without pinning its label (#39050) #39146): a keywords-only node's label is reported by the coverage gate asapps.kw_desk.navigation.nav_cases.label; control with the label present reports nothing.refine(() => true, ...)throughscripts/ablation-replace.mjsturned "refuses a node with neither label nor keywords" red (1 failed, 5 passed); restored, blobf90c1682d6e5equal to HEAD andgit diff HEADempty.Acceptance notes
packages/metadata-protocol/src/protocol.tsfortranslateApp; the function lives inpackages/spec/src/system/i18n-resolver.ts. No change was needed there.label?: string; the "at least one" rule is schema-only (the type does not express it). The rewritten pin intranslation-contributed-nav-bundle.test.tssays so.Verification
Read first:
packages/spec/src/system/translation.zod.ts(the navigation node, label and the refine), thenpackages/spec/src/system/translation-nav-keywords-only.test.ts.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/system/translation-nav-keywords-only.test.tsshows 6 passed.Local results at
6f8e8ca249:Tests and typecheck
pnpm --filter @objectstack/spec test: 1 failed / 29224 passed before the reversed pin was rewritten (app-nav-keywords.test.tsCONTROL "the node still owes its label", which this card reverses); the rewritten file then 42 passed. New and touched spec files: 4 files, 247 passed.pnpm --filter @objectstack/cli exec vitest runoni18n-nav-keywords-only-coverage,i18n-contributed-nav-coverage,i18n-coverage: 3 files, 47 passed.pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/cli typecheck: exit 0.pnpm --filter @objectstack/spec check:generated --fix: regeneratedcheck:docsonly;check:authorable-surfacegreen, and the built JSON Schema carries the rule asanyOf: [required label, required keywords].Derived gates (dispatch-gates --commands, 95 families)
check:i18n-walk-parityandcheck:type-check-debtafter a rebuild of spec and cli; they first refused with exit 3 on a stale dist).check:dual-build-cjs-loads, reason: it needs every package'sdist/(a fullpnpm build); left to CI.dispatch-gates --ran: 95 derived accounted for, 94 run, 1 NOT-MEASURED.Generated by Claude Code