Skip to content

fix(lint): the translation-reference rules judge a locale pack's picklists face - #24474

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-23566-picklist-translation-refs
Oct 19, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-23566-picklist-translation-refs

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #23566

Clause-②: no

What changed

packages/lint/src/validate-translation-references.ts now reads a locale pack's picklists face. Until now nothing read it, so a wrong key passed os lint --strict and was dropped silently at runtime. Two rules already covered the same mistakes elsewhere, and this change extends both of them to the new face. No rule id is added, and each finding carries the severity of its field-level twin (the triage ruling: "the two existing rules … extend to the picklist face, at their field-level twins' severity. No new rule id."):

key verdict severity
picklists.NAME naming a list that no package in the stack declares translation-target-unknown, with "Did you mean" from the declared list names; fix line: "Match the key to a picklist's name, or drop it." error (same as the field orphan)
picklists.NAME.options.KEY where KEY is not a value of that list translation-option-key-unknown, with the field twin's two arms: a key spelled as the DISPLAY LABEL is told the value to rename it to, and any other key gets the nearest declared value warning (same as a field option key)

What a key resolves against. The rule uses the same set the runtime uses. lookupPicklistOption (@objectstack/spec/system) is called with the list's name and each served option's value read as text. For a picklist-bound field, the served options are the list's own options plus every picklistExtensions entry for it (PicklistServedFieldSchema). So the universe is the declaration's options together with the options every extension adds. Lists and extensions are read from the stack in hand and from every packages[].manifest body. Both keys have the concat disposition, which places them inside the ADR-0130 D4 assembled body, the same reasoning the other sibling-package folds use. When both the stack and a sibling declare a list, the declaration being judged keeps the slot (the dashboards' decision). Extensions are a union.

What is not judged. If the stack only extends a list and no package of the stack declares it, the picklists.NAME subtree is skipped wholly. The owner's options cannot be seen from here. This is rung 2b of the object ladder (objectExtensions) applied to a list.

os explain translation-target-unknown and os explain translation-option-key-unknown (rule-explanations.ts) now name the face, and the module header documents it.

Deviation from the field twin (one, deliberate)

The field twin's option-key fix line ends with "Declared values: …". The picklist fix line does not. It stays one line of at most 200 characters, the shape #22161 settled on, and the verdict's "Did you mean" names the nearest value. The field twin's hint is unchanged.

Tests (at head d237990699, after merging origin/main 26501ae24f)

  • New describe block the picklist face (#23566) in validate-translation-references.test.ts, one pin per leg:
  • pnpm --filter @objectstack/lint test: 145 files and 6871 tests passed, lock VERDICT command-exit 0. pnpm --filter @objectstack/lint typecheck: VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec test:repo: 69 files and 1134 tests passed, VERDICT command-exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 64 commands, and I ran all of them. Reconciled with --ran (each line CMD :: exit N): 62 exit 0 and 2 NOT MEASURED. check:dual-build-cjs-loads and check:lean-entry-closure exited 3 with PREREQUISITE NOT MET, because they need a whole-workspace pnpm build that I did not run locally. CI builds the full tree for them.
  • Consumer sweep: no example in this repository declares or translates picklists (git grep -n picklists -- examples returns 0 hits), so no shipped stack starts failing. HotCRM keeps its local guard until this ships (see the card's consumer note).

Acceptance notes

  • content/docs/protocol/kernel/i18n-standard.mdx: the table of resolvable keys has no picklists.{list} / picklists.{list}.options.{value} rows. The file is outside this card's claimed surface, so it is left for a docs follow-up. Carrier: none named.
  • Boundary: suppose a field references a list (picklist: NAME) owned by a dependency outside the artifact. A picklists.NAME translation key for that list is reported as translation-target-unknown. This matches the object twin's verdict for an object contributed by another installed package. It does not match the CLI's picklist-reference-unverified notice for the reference itself.

Generated by Claude Code

…tion-reference rules

`picklists.<name>` no package declares is `translation-target-unknown`
(error); an option key under `picklists.<name>.options` that is not a value
of the list or of a `picklistExtensions` entry for it is
`translation-option-key-unknown` (warning) -- each at its field twin's
severity. A list the stack only extends is skipped wholly.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/lint, touching 5 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/install-modes.mdx (via picklistExtensions (literal, a string literal in buildUniverse))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-6.mdx (via picklistExtensions (literal, a string literal in buildUniverse))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb → packageMentionDocs.

Which tree this was computed on

This run read content/docs from b5ed262e91032f8c1dcf58ac4b90097e5d170c70 — the merge of head d237990699af42ced9b5e4b3bc86977a63f99fa5 into base 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b5ed262e91032f8c1dcf58ac4b90097e5d170c70 && git checkout b5ed262e91032f8c1dcf58ac4b90097e5d170c70
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb d237990699af42ced9b5e4b3bc86977a63f99fa5 && git checkout -B drift-repro 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb && git merge --no-ff d237990699af42ced9b5e4b3bc86977a63f99fa5

node scripts/docs-audit/affected-docs.mjs --json 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 31ce45c071bbcb6e92a730ce19ebf30dcfa361cb → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Review: ACCEPT · PR #24474 @ d237990699af42ced9b5e4b3bc86977a63f99fa5 · domain:spec seat 3 · 2026-10-19T06:12Z

Session session_01D6F9axfoPzR7t8G1J7Ytzz · baozhoutao. Reviewer of record; checked against GitHub, not the report.

  • Shape: draft, Fixes #23566, Clause-②: no; +323/−7, 4 files; not governed.
  • The ask: a locale pack's picklists.<name> is judged against Picklist.name (orphan → translation-target-unknown, error), and picklists.<name>.options.<key> against the list's option values plus every picklistExtensions[] entry for it (mis-key → translation-option-key-unknown, warning, with the display-label rename arm). Same severities as the field twin; no new rule id. A list the stack only extends is skipped, as rung 2b does for objects.
  • Pins: both legs against the field twin, the display-label arm, a lit control, extension values, a sibling-package list and extension, and the extended-only skip.
  • Changeset: 23566-picklist-translation-refs.md, @objectstack/lint patch.
  • Gates: 64 derived, 62 exit 0; check:dual-build-cjs-loads and check:lean-entry-closure not measured locally (need a workspace build); CI measures them.
  • Out of scope, noted: the i18n-standard doc table has no picklists.* rows; a docs follow-up, not this PR.
  • CI on the head: read at this act; the seat lands on green through the merge queue.

Generated by Claude Code

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 tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants