Skip to content

fix(lint)!: a _relatedLists translation key over a list the .custom arrangement hides or re-states without a label is refused - #37600

Draft
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-gvxx96-36595
Draft

objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-gvxx96-36595

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #36595

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37620

维护者速读

  • 用户能看到什么变化:只影响作者跑 os validate。如果应用的定制包(.custom)把某个相关列表标签页隐藏了,或者改成不带标题的写法,而翻译包里还留着这个标签页标题的译文,现在会报错,提示这条译文没人读。以前这种译文校验能通过,但页面上本来就不会显示它。
  • 为什么做:这是 Translated related-list titles, follow-ups of #36528: a placed title the source row does not carry can be stored translated on save, and three narrower edges #36595 剩下的第 4 项。校验规则先看到「原对象给这个列表写了标题」就放行了,没有考虑定制包会把整条替换掉,结果作者以为翻好了,实际页面看不到。
  • 出错会怎样:最坏是把一条其实有用的译文误报成错。规则的判断和运行时 registry 应用定制编排的顺序、覆盖规则逐条对齐,有测试钉住;第一方示例和 HotCRM 里没有命中的写法。
  • 要你做什么:这是收窄(以前能过的现在报错),属 Tier H,需要审批人批准;还欠契约审核(L2)。

What changes

The reading (at origin/main): the registry applies the paired .custom arrangement after the owner's tab list and every place entry, and each arrangement entry REPLACES every entry it covers (packages/objectql/src/registry-custom-arrangement.ts, the relatedLists step; relatedListNameCovers: the same list, or a bare child for every list of that child). { list, hidden: true } leaves no tab; a bare name or an entry with no label leaves the tab titled by the child FK's relatedListTitle. The lint fold (validate-translation-references.ts) checked the owner's labelled set first and continued before the hidden check, and object-graph.ts dropped the arrangement's bare names (.filter(isRec)). So _relatedLists.<list> over an owner-labelled list the arrangement hides or names bare was accepted though nothing reads it.

  • packages/lint/src/object-graph.ts: VisibleObjectExtension gains relatedListArrangement, the extension's relatedLists as written, bare names included (undefined when it writes none). relatedListEntries is unchanged.
  • packages/lint/src/validate-translation-references.ts: per target, placements are folded first (the arrangement's own entries skipped), then every extension's arrangement in fold order, each in two passes as the registry reads it: first its entries drop every label (and earlier hidden) they cover, then it adds its own labelled entries and its hidden ones. So one entry never strips the label a sibling of the same arrangement gives ([{ list: 'event.related_to', label }, 'event'] resolves in either order). The hidden message now matches by cover, so { list: 'event', hidden: true } names event.related_to as hidden. A key over an owner-labelled list the arrangement re-states without a label names the arrangement, and its hint (like the hidden one) points at the owner's label.
  • ADR-0087: semantic entry translation-related-list-key-under-arrangement-refused at step 19 (packages/spec/src/migrations/entries/semantic/19.…; PROTOCOL_VERSION is 19.0.0, so migrate meta --from 18 lists it), and the changeset is marked registered. No D2 conversion: dropping the key or re-stating the arrangement's entry with the owner's own label is the author's call. The remedy names the owner's label because an object read translates a label only while it still equals the packaged one; its surface names the labelled bare child { list: 'event', label } covering the owner's event.related_to.
  • Docs: the _relatedLists row of the reference-rule table in content/docs/protocol/kernel/i18n-standard.mdx states the arrangement's effect.
  • Changeset: @objectstack/lint minor with the BREAKING note, @objectstack/spec patch (the ledger entry).

Small calls made here (no card), per seat route 7120211674 (option A, item 4 only):

  • The lint fold applies every extension's relatedLists as an arrangement, as it already did for hidden. The registry serves only the object's own pair and names the other writers, which is a separate refusal at publish / os validate. This fold does not re-derive which package is the pair.
  • os i18n extract (i18n-walk.ts) still scaffolds _relatedLists.<list> from the owner's labelled entries and reads no extension, as before this change. In a stack that holds both the owner and its .custom pair, it can scaffold a key this rule now refuses. That universe difference predates this PR (the extractor reads no extension at all). It is filed with the object-read pair-catalog gap as review follow-ups of PR #37600 #37622, not widened in this PR.

Why

The card's item 4 (from the contract review of #36574): a permissive lint that let a translator ship a title the record page never shows. Items 1–3 landed in #36813.

Verification

  • packages/lint/src/i18n-related-lists-arrangement-36595.test.ts (new, 7 tests):
    • An owner-labelled list the arrangement hides is refused with the hidden message.
    • The same list named bare, as { list } or as { list, hidden: false }, is refused with the no-label message, which names the .custom arrangement.
    • A bare child beside its labelled dotted list in one arrangement leaves the label, in either order (fails on 61beb993c). A sibling cancelling a hidden entry has no pin: a list both shown and hidden in one arrangement is refused at save by the object schema (refuseContradictoryRelatedListEntries).
    • A bare child hides or strips the dotted owner entry.
    • The arrangement is applied after a placement that another package folds later, at higher priority.
    • A relabelled list and lists the arrangement does not cover resolve.
    • Control: with no arrangement, nothing changes.
    • Red first: against origin/main's two source files, 4 of the 6 fail; with the change, 6/6 pass.
  • i18n-related-lists-label-36528.test.ts (the existing _relatedLists pins, the hidden: true one included): unchanged and passing.
  • Local runs, head b18f2ca55 (contract-review fixes; 61beb993c before):
    • @objectstack/lint full vitest: 237 files, 9,687 passed.
    • tsc --noEmit and eslint on the touched files: exit 0.
    • @objectstack/spec vitest src/migrations: 201/201.
    • check:generated --fix: all up to date. gen:migration-registry picks up the entry. check:upgrade-guide: ok.
    • node scripts/check-adr-0087-registration.mjs --base origin/main: ✓ registered. check-empty-changeset: ✓. overlap-check: exit 0.
  • Dogfood battery: on 61beb993c, os-dev report 7196396955 (one load timeout in an unrelated install-local case, green when rerun alone). On the final head b18f2ca55: VERDICT command-exit 0, Test Files 488/491 (3 skipped), Tests 4135/4203 (68 skipped), no failure; os-dev report 7197867160.

Contract review (L2) is owed before landing: the diff declares Clause-②: no (narrowing) and adds a packages/spec/src/** ledger entry. Tier H: an authorized approval is needed to land.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj


Generated by Claude Code

…ement hides or re-states without a label

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
@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 Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

9 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
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 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 — 177 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 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from dd7ecdb473c5a3b732b84b7b9c2685e5f0595265 — the merge of head b18f2ca55b4d35252852aaf90aa2751dc32d5f06 into base 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a, 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 dd7ecdb473c5a3b732b84b7b9c2685e5f0595265 && git checkout dd7ecdb473c5a3b732b84b7b9c2685e5f0595265
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a b18f2ca55b4d35252852aaf90aa2751dc32d5f06 && git checkout -B drift-repro 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a && git merge --no-ff b18f2ca55b4d35252852aaf90aa2751dc32d5f06

node scripts/docs-audit/affected-docs.mjs --json 54d6726c09019bd1d9da29b7aee3fb9e907dbb0a

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 61beb993c3a932e9df8af98a079b415fc5a03c10
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.translation-related-list-key-under-arrangement-refused.ts + packages/lint/src/validate-translation-references.ts, packages/lint/src/object-graph.ts

Read for this record: card #36595 with every comment (route 7120211674, release 7120821760, claim 7195029524, dev report 7196396955), the PR body and its six files, the net diff against main, and the check-runs on the head (all concluded success or skipped, none failed). Code outside the diff was read, not reviewed. Nothing was built or run.

① Derived judgments

  • Accept-set of translation-target-unknown (error), declared arm. A _relatedLists.LIST key over a list the owner or a placement labels is now refused when an entry of an extension's relatedLists covers that list and is hidden, bare or unlabelled. Right. The registry keeps, of the tab list that steps 1 and 2 gave, only the entries no written name covers (registry-custom-arrangement.ts, the carried filter), so the served entry has no label, and translateObjectRelatedLists translates only an entry that authors one. The registry pin registry-related-lists-label-translation-36528.test.ts serves ['Notes', 'crm_task'] for exactly this shape.
  • Same refusal, an arm the texts do not name. A labelled entry for a bare child ({ list: 'event', label }) also takes the owner's title off event.related_to. Right by the same filter. The entry's surface and the changeset list only hidden, bare and unlabelled; see S2.
  • An undeclared narrowing. A key over a list the arrangement itself labels is refused when a later entry of the same arrangement covers it. Wrong: S1.
  • No widening found. A non-hidden arrangement entry adds the same label fact it added on main; the hidden facts only choose the message.
  • Public surface. VisibleObjectExtension.relatedListArrangement is internal: packages/lint/src/index.ts exports no type of the extension fold. @objectstack/spec/migrations gains one semantic entry and no schema, export or key. The step it lands in is wrong: M1.

② Semver level

The changeset grades @objectstack/lint minor and @objectstack/spec patch, declares Metadata-protocol: narrowed and the no (narrowing) arm of the Clause-② line, carries the BREAKING note with its from and to, and one registered marker naming the new id. That matches what the diff publishes: a key os validate accepted is refused (narrowed), one moved package is at minor, no accept-set is widened and no export is added. Check Changeset and the registration gate are green on the head. The marker's id is unchanged by M1's fix. The note's second remedy ("give the arrangement's entry a label and keep it") carries S2.

③ Boundary flags

  • open_questions. The dev report lists none.
  • Dev flag: the fold applies every extension's relatedLists, not only the pair's. Accepted as a stated deviation. A writer that is not the base's pair is refused at os validate and os build (packages/cli/src/utils/extension-arrangement.ts), so a stack that validates clean has no second writer for this fold to misread.
  • Dev flag: os i18n extract reads no extension (carried as "noted, not filed"). Escalated to the seat: it needs a card, and it is wider than the scaffold. os i18n check counts expected keys from the same walk (collectExpectedEntries), so in a stack that holds the owner and its pair, the coverage gate counts the owner-labelled key as missing and os validate refuses it when written. Before this PR the two readers agreed on the owner's label; this PR makes them disagree there. Measured first-party exposure is none, so this does not block the PR, but "noted, not filed" is not a disposition.
  • Skills-docs: none. Escalated to the L1 line check: the stated reason does not hold as written. skills/objectstack-i18n/SKILL.md (the _relatedLists.{list} row) and skills/objectstack-data/rules/relationships.md both name the key and when it resolves. Neither says what the arrangement does to it.
  • Dogfood battery (dev report 7196396955). Accepted as evidence for this head. One case of 4203 failed, a 5000 ms timeout in packages/qa/dogfood/test/bare-name-one-holder.dogfood.test.ts (install-local of a package that ships mappings and datasets). That package ships no translation and no object extension, and what the diff adds to the lint is one field per extension entry and one loop over arrangement entries, which cannot cost a case seconds. The file alone was green on the same head (18/18), so the failure reads as load under a 43-minute battery, not as this change. The battery is owed on the final head, and this head will move (M1).
  • SQL push-down. Not applicable: a static, in-memory lint fold and a ledger entry. No query, no id materialisation, no join.
  • Security. Nothing found.

④ Design judgment

The narrowing itself. Against the published rule on main ("a key over an entry with no label is an orphan"), the declared arm makes the rule's own refusal real: it judges the tab list as the registry serves it. It takes no working capability away. One bound, stated for the reader: "nothing reads the key" holds while the pair's arrangement is installed and enabled; disabling the pair serves the owner's label again.

M1 (must-fix) — the entry is filed in the step into protocol 18, and the change ships on protocol 19. The file is named 18.…, so the generator puts it in MIGRATIONS_BY_MAJOR[18].semantic. At this head PROTOCOL_VERSION is '19.0.0' (packages/spec/src/kernel/protocol-version.ts), entries/README.md names an entry file by the protocol major, and step 19 in registry.ts.template says "Later retirements on the v19 line add their entries as files". .changeset/37223-v19-line-opens.md, in this head's base, says every release from here is 19.0.0-next.N and latest stays on 18.x. The changeset of this PR agrees: "where 18.x accepted it". composeMigrationChain replays the steps with m > fromMajor, so objectstack migrate meta --from 18, the path of every author whose bundle 18.x accepted, replays step 19 only and never lists this entry. The generated upgrade guide, a projection of the registry, would list it under the step into 18, a protocol that does not refuse the key. Fix: name the file 19.translation-related-list-key-under-arrangement-refused.ts. The id and the changeset marker stay. Precedent since the protocol move: 19.data-table-staged-edit-retired.ts.

S1 (should-fix) — the fold does not apply one arrangement the way the registry does, and refuses a key the served object reads. validate-translation-references.ts (the #36595 loop) walks the arrangement entry by entry and lets each entry delete every label it covers, including a label an earlier entry of the same arrangement just added. The registry does not: every non-hidden entry is served (shown), and the cover test runs only against the list steps 1 and 2 gave (carried). For relatedLists: [{ list: 'event.related_to', label: 'Meetings' }, 'event'] the registry serves the labelled entry, and the catalog translates it where that label is the owner's text (see S2). main accepted the key. This head refuses it with "carries no label", although the served entry carries one. The reverse order passes, so the verdict depends on tab order. The schema accepts a bare child beside one of its relationships (object-extension-arrangement.test.ts, "a child shown with one of its relationships hidden is no contradiction"). The same loop also un-hides: for [{ list: 'event.related_to', hidden: true }, 'event'] the registry keeps the list hidden, and the fold drops the hidden fact, so the key gets the "carries no label" sentence and a hint to label an entry no tab shows. Fix: two passes per arrangement, as the registry runs them: first drop the labels of steps 1 and 2 that a written name covers, then add the arrangement's own labelled, non-hidden entries; a shown entry does not un-hide a list the same arrangement hides. Pin both shapes.

S2 (should-fix) — the entry's second remedy is not true as written. replacement says to give the arrangement's entry a label "and keep the key, which then translates that label", and acceptanceCriteria accepts "the record page shows the translated title". As read in the tree (not run), for an object a code package owns: the packaged base an object read is compared with holds the owner's entries and the placed ones, never the arrangement's (getPackagedObjectBase); a label that differs from the base's for that list, or sits on a list the base has no entry for, is read from the pair's catalog alone (translateObjectRelatedLists, labelCatalogs); and an object read is handed no pair catalog, because servedOverrideBaseOf answers none for object (packages/rest/src/meta-item-read-gate.ts, both translate calls; packages/types/src/share-link-resolve-answer.ts states it). So the key translates the arrangement's label only while that label is the owner's own text for the list. Any other title is served as written in every locale, the lint accepts the key, and the acceptance arm cannot be met. That is the class this card set out to close, reached by following the entry. Fix in the entry (and the changeset's BREAKING note, which repeats it): state the condition, or prescribe only what holds (drop the key; or re-state the entry with the owner's label unchanged to keep its translated title). Name the labelled bare-child arm in surface while there. For the seat, outside this diff: the rule has accepted a key over any arrangement-labelled list since #36574, and registry-related-lists-label-translation-36528.test.ts shows it translated only with a hand-passed pairBundle. Whether the object read should hand the pair's catalog, or the rule should refuse those keys, needs a card.

N1 (nit) — for a bare or unlabelled re-statement the finding says the list "carries no label in relatedLists" and hints "Give the entry a label". An author reading the owner sees a label there. The hidden arm names the .custom arrangement; this arm could too.

The implementing files otherwise agree with the entry: object-graph.ts carries the arrangement as written, bare names included, and leaves relatedListEntries unchanged; placements are folded before any arrangement, whatever the extensions' order; the hidden message matches by cover.

M1 is a FAIL. M1, S1 and S2 each move the head, so the fix earns a delta review and a battery on the new head.

Implemented-by: claude/project-thread-gvxx96-36595
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: FAIL

…rowing at step 19

Contract review on the #36595 change:
- The migration entry moves to step 19 (PROTOCOL_VERSION is 19.0.0), so
  `migrate meta --from 18` lists it.
- Each arrangement strips what it covers from the owner's list and the
  placements first, then adds its own labels and hidden entries, as the
  registry reads it: one entry never strips a sibling's label.
- A key over an owner-labelled list the arrangement re-states without a
  label names the arrangement, and its hint points at the owner's label.
- The remedy text names the owner's own label: an object read translates
  a label only while it equals the packaged one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj

This branch has not been deployed

No deployments
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