Repository navigation
fix(metadata-protocol): a code package's placed tab or added field is saved in its source text from a translated read - #36813
Conversation
… over an older stored row is saved as its source The save door's translated-echo restore now takes the packaged owner beside the packaged base, so what the base carries beyond the owner (a field a code extender adds, a relatedLists entry its place splices in) is the last source for a field or entry the stored row does not declare at all. The TranslateDocumentOptions.packagedBase docblock names the placed entries and where a placement is judged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
📓 Docs Drift Check10 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 — 176 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 ff3d5ce74645f6c59abf7a09935788ebebd3f896 && git checkout ff3d5ce74645f6c59abf7a09935788ebebd3f896
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 15e41882289f6745017657fda3e975fccecf8e13 && git checkout -B drift-repro 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 && git merge --no-ff 15e41882289f6745017657fda3e975fccecf8e13
node scripts/docs-audit/affected-docs.mjs --json 65ee4b7ad49361bc3cfaf3a32c9ed02752d4a152 |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract-review-claim: session_01WGufziwMkZG34d69p8BHb4 · head 15e4188 · 2026-11-24T02:22Z Face: published schema ( |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract reviewServed-tier: Read for this record: card #36595 (body and its three comments: triage 7089293793, claim 7118543153, dev report 7119401800), PR #36813 (body, both comments, the five-file net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 席位核对 — ACCEPT · repo:objectstack#3 · head 15e4188 · 2026-11-24T02:29ZL1: ACCEPT Checklist
FindingsMust-fix: none. Should-fix: none. The contract review's N1 ("declares Before landing (paper, seat; not a finding on this diff)The contract review's ③ found two seat routes the PR body relies on that are not on GitHub. Card #36595 carries only triage, the claim and the dev report.
Post both on #36595 before or with the partial Landing notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB Landing · 2026-11-24T02:31Z · ACCEPT 7120201019 (L1-b) at head 15e4188
State: ready + auto-merge (area ux-D, not governed, ≤3000 lines). |
…rrangement hides or re-states without a label is refused (objectstack-ai#37600) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#36595 Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#37620 ## 维护者速读 - 用户能看到什么变化:只影响作者跑 `os validate`。如果应用的定制包(`.custom`)把某个相关列表标签页隐藏了,或者改成不带标题的写法,而翻译包里还留着这个标签页标题的译文,现在会报错,提示这条译文没人读。以前这种译文校验能通过,但页面上本来就不会显示它。 - 为什么做:这是 objectstack-ai#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 `continue`d 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 objectstack-ai#37622, not widened in this PR. ## Why The card's item 4 (from the contract review of objectstack-ai#36574): a permissive lint that let a translator ship a title the record page never shows. Items 1–3 landed in objectstack-ai#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 - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
Refs #36595 (items 1, 2, 3; item 4 is left out and reported to the seat as a fork)
Clause-②: no
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB
维护者速读
What changes
Item 1 (save door, main item).
restoreTranslatedEchoestakes a new optionalpackagedOwnerbesidepackagedBase. With it, what the packaged base carries beyond the owner (a field a code extender adds under a name the owner does not declare, and arelatedListsentry whoselistthe owner does not name, i.e. one a code extender'splacesplices in) is the LAST source, used only for an incoming field or entry the stored row does not declare at all. The save door (ProtocolDiscoveryAndBasesFacet.restoreTranslatedObjectEchoes) reads the owner from the engine's registry (getPackagedObjectOwner, the readgetPackagedObjectBasealready falls back to) and hands it in. Landing point:protocol-translated-echo.ts, as the dispatch expected, plus the one hand-over line inprotocol-discovery-and-bases.ts. The objectql packaged-base producer is unchanged: it already carries the placed entries and added fields (#36574's route (a)); what was missing was a source on the save side.What does not change, by construction:
packagedBasedocblock onrestoreTranslatedEchoesdescribes).overlay ?? own), so a body carrying it again keeps its text.protocol-save.ts,source: item) and the pure injected-column half (source: undefined) pass no owner and behave as before.Reachability (measured on origin/main 844218f, by reading). No in-repo editor reaches the edge:
ui/packages/data-objectstack/src/authored-layers.ts,authoredBuffer: thedraftlayer, else an object'soverlay ?? code), never the translated served read;ResourceEditPage.tsxuses it for every translatable type.recordTabsConfigSave.ts, "composed over what is STORED, never what is served").?state=draftread is translated but not folded (protocol-meta-item-reads.ts, the A tenant object overlay drops everyobjectExtensionsfield from the resolved schema, andeffectivecontradictscodein the same response #8027 note: the fold runs after the draft return), so it never carries a placed entry.GET /meta/object/NAMEread IS folded and translated (translateMetaDocumentinpackages/rest/src/meta-item-read-gate.ts), andPUT /meta/object/NAMErunsrestoreTranslatedObjectEchoeswith the stored row as source. So the edge is reachable by any API client that saves the read it got back; the fix applies as defence for that door. Not reproduced over HTTP in this PR.Item 2 (N4): documented deviation, no fix — a seat-accepted deviation (repo:objectstack#3, 2026-11-24T01:45Z). The base judges "declares
relatedLists" on the owner; the fold judges it on its base layer (overlay ?? own). Making the base follow a tenant overlay would make the PACKAGED base read a tenant row (the docblock defines it as the code layer, before any overlay) and would change which text a reader sees in a case the card does not settle (a catalog translation instead of the authored placement label), which the dispatch routes to a fork. The deviation is now stated in theTranslateDocumentOptions.packagedBasedocblock: where only a tenant overlay declaresrelatedLists, the placed tab has no packaged counterpart, reads as authored, and the deployment catalog does not translate it. No wrong text is served (the label shown is the extender's own source).Item 3 (N5): docblock only.
TranslateDocumentOptions.packagedBase(packages/spec/src/system/i18n-resolver.ts) now names the placedrelatedListsentries besidevalidationsand addedfields.Item 4 (lint union): left out, reported as a fork. Measured with a throwaway probe (deleted): an owner-labelled
_relatedLists.contactkey resolves with 0 findings when a.customarrangement hides the entry ({ list: 'contact', hidden: true }) or names it bare (['case', 'contact']); the control (owner entry unlabelled, arrangement hides it) gives 1translation-target-unknownfinding at severityerror. Tightening the rule would therefore turn an accepted key into anos validateerror, a(narrowing)arm, so it is not in this PR.No ruling governs the edited lines: the
ruling/maintainer/⛔lines near each edit were read; the only one nearby (protocol-translated-echo.ts, the patch-entry rule "asked throughpackagedOwner... byscalarOverridesPackagedBase, ⛔ never a second copy") is about patch entries and is untouched; the new source asks no override question. Decisions cited: ADR-0029 D9.2 / D9.2a.Tests
protocol-translated-echo.test.ts, describe "a code extender's placed title or added field, over a stored row that predates it": the pure restore, the tenant-rename and owner-dropped controls, and the door test "the save door hands the restore the packaged owner: a non-source-locale save over the stored row lacking the entry keeps the source title" (the card's re-check criterion).packagedBasedocblock.Acceptance notes
restoreTranslatedEchoes' local callback parameter insourceOfis also spelledpackagedOwner(pre-existing, a different thing: the packaged slot owner for a patch entry). The new argument is always read asargs.packagedOwner; no shadowing, but the names read alike.validate-translation-references.tssays "where the target declares" (the looser spelling the review's N4 noted); left as is, outside this PR's items.Verification
Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol-translated-echo.test.tsshows 19 passed, including the five cases of the new describe.Read first:
packages/metadata-protocol/src/protocol-translated-echo.ts(theextenderDoccut: the stored-row and owner exclusions are the risk), thenprotocol-discovery-and-bases.ts(the owner read), then the docblock ini18n-resolver.ts.Local runs (head 15e4188)
vitest run src/protocol-translated-echo.test.ts src/protocol-translated-echo.related-lists-36528.test.ts: Test Files 2 passed, Tests 22 passed.@objectstack/metadata-protocolsuite under the lock: Test Files 365 passed, 9 skipped (374); Tests 23359 passed, 45 skipped; VERDICT command-exit 0.@objectstack/metadata-protocoltypecheck: exit 0 (--listFilesincludes the test file).@objectstack/objectqldoor files (protocol-meta-effective-schema.test.ts,registry-related-lists-label-translation-36528.test.ts) against the rebuilt closure: 28 passed.pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date.Ablation (committed fix, restored to HEAD by blob)
['extender', extenderDoc]source (node scripts/ablation-replace.mjs, anchor 1 to 0, blob 120e8d8e to 6ca9d157): 3 failed / 16 passed: the pure restore, the owner-dropped case's extender half, and the door test. Restored: blob == HEAD (120e8d8e),git diff HEADempty.packagedOwnerhand-over inprotocol-discovery-and-bases.ts(anchor 1 to 0): 1 failed (the door test) / 18 passed. Restored: blob == HEAD,git diff HEADempty.Derived gate families
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 90 commands; all 90 run locally,--ranreconciliation: 90 derived, 90 run, 0 UNRUN.check:cross-package-test-inputs,check:tier-file-adoption,check:nul-bytes,check:undeclared-dep-imports,check:test-source-alias,check:issue-citations,check-closing-keyword-parity) re-run at 15e4188: all exit 0.check:test-source-aliaswas red at 13ff81c (the new door test reached@objectstack/lintthrough dynamic imports inside a clock); fixed by the module-top import it prescribes, green at 15e4188.check-plugin-teardown-shape --self-test(exit 3: shallow clone cannot reach its pinned fixture commit);check:dts-closure(exit 1),check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET) andcheck:lean-entry-closure(exit 3): each reads the whole tree's builtdist/, which this worktree does not hold. CI's.test:repo(the vitestrepoproject), Test Core shards, Build Core, type-check lanes and the dogfood battery: CI's.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB
Generated by Claude Code