Repository navigation
fix(objectql): the packaged object base carries the fields a code extender adds, so /meta translates a dependent package's added fields - #34156
Conversation
…s field on the packaged base and the served /meta read Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…ender adds, so /meta translates a dependent package's added fields getPackagedObjectBase now also carries every field a CODE extend contributor adds under a name the owner does not declare (fold order, same filter as packagedRules). Owner-declared fields, the scalars and fieldPatches stay the owner's; tenant overlays and stored extensions add nothing. The stale spec comments that described the base as the owner alone are rewritten. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…ed fields Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…ension i18n pins Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 175 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 561147d71af21d39e74451e62956e0c28437c0e1 && git checkout 561147d71af21d39e74451e62956e0c28437c0e1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 121017b91d12602f8db428d3403cb1a638a7b92f 265a82f18135486bea5619b27f3958eb222530c4 && git checkout -B drift-repro 121017b91d12602f8db428d3403cb1a638a7b92f && git merge --no-ff 265a82f18135486bea5619b27f3958eb222530c4
node scripts/docs-audit/affected-docs.mjs --json 121017b91d12602f8db428d3403cb1a638a7b92f
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv Request: review · PR #34156 · S1/A2 · Fixes #33800 (half 1, option A; half 2 stays D) · head ecffbe8 · 2026-11-15T23:12Z Reviewer: review-a of seat
Dev report: 6902334065. Declaration lines: Changeset sentences for the ACCEPT to check against the diff:
Checks at this head: 56 success, 11 skipped, 0 red. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review claim (review-a, S1) · head ecffbe8 · 2026-11-15T23:14Z |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Contract reviewServed-tier: Read: card #33800 (body and all 7 comments, rulings 6895879286 and 6896340775 included), PR #34156 (body, file list, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Findings:
Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review — PASS (should-fix owed before landing)Head-sha: Contract face: Should-fix (from the record, and I found it independently in the code; delta review after the fix)
What holds (rest of the diff)
Nits (no re-review needed) The record's two comment nits:
Fold both into the should-fix round if you touch those comments. Gates: at review time 56 success, 11 skipped, none red, so every check is green. |
…lds, as the served fold withholds them Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 265a82f · 2026-11-16T01:03Z |
|
domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv Request: delta review · PR #34156 · S1/A2 · Fixes #33800 · head 265a82f · 2026-11-16T01:07Z The area declares this head final. It answers review-a's should-fix in 6903069973 by the first route:
Delta report: 6904478515. Checks at this head: 56 success, 11 skipped, 0 red. Owed: review-a's delta ACCEPT, and a delta contract record at |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T01:08Z. Delta review of this head against PASS 6903060139 at ecffbe8 (by the lane's own reviewer); claim: comment 6904455068; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for domain:server#5; reviewed by os-tesla, who neither dispatched nor implemented it. Read: card #33800 (body, all comments, seat ruling 6895879286 and maintainer ruling 6896340775), the PR body and comments, record 6903060139, the changeset, the net diff at this head, the two dev commits ① Derived judgments
② Semver level
CI is complete and green on this head, so this PASS waits on no check. ③ Boundary flags
④ Design judgmentPrior findings, by id (record 6903060139).
Independent judgment of the contract at this head. The seat ruling's option A is implemented as ruled: only field names the owner does not declare, the New findings.
No must-fix. Two should-fix, neither needing a new head. Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Contract review — deltaServed-tier: Read: the prior record, the PR's two delta commits ( MergeClean. The PR's net diff has the same stable patch-id against its merge base as against main parent Status of prior findings
Sentences checked
FindingsNo must-fix. No should-fix.
GatesCheck-runs on Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review — PASS (delta)Head-sha: Should-fix 1: fixed. Comment nits: fixed. The delta contract record is comment 6904556587 (PASS, Nits (no re-review needed) The record's three:
Gates: at review time 56 success, 11 skipped, none red, so every check is green. The PR can land. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv 席位核对 · ACCEPT · Head-sha: 265a82f · 2026-11-16T01:12Z
|
Requested by Steedos · project thread
维护者速读
objectExtensions给基础包对象新增的字段(如 carbon 包给crm_account加的cb_market),在中文等非默认语言下读/api/v1/meta/object时,字段名和选项名现在按该依赖包自己的翻译包显示,不再是英文。fieldPatches改的文字、租户和.custom加的字段都按原样不动。回滚即 revert 本 PR。packages/objectql/src/registry.ts(packagedAddedFields与getPackagedObjectBase,重写后的 ⛔ 段)、packages/objectql/src/protocol-packaged-object-base.test.ts(边界钉子)、packages/objectql/src/protocol-meta-effective-schema.test.ts(中文读回再保存仍存英文原文)。pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-object-field-patch-i18n.test.ts,预期 12 passed,其中新增组断言 zh-CN 下cb_market为「市场」、选项为「内销 / 出口」,基础包自己被改名的字段仍保持原文。Fixes #33800
Half 2 of the card (a dependent package's
fieldPatcheslabel/description getting its own translation) is out of this PR by maintainer ruling 6896340775: D stands and it has its own card. Until that card lands, patched text shows as written in every language.Clause-②: no
Metadata-protocol: none
What changes
The defect, measured on
origin/main45dee17. A select fieldcb_marketadded by a dependent code package throughobjectExtensions, with the zh-CN rows in that package's pack, was served under zh-CN asMarket/Domestic/Export. That held on the item read and on the list read (translateMetaDocument/translateMetaList, over a realSchemaRegistry).translateObjectworked as designed. Its input was the problem:SchemaRegistry.getPackagedObjectBasereturned the owner's declaration alone, so the field had no packaged counterpart and every slot of it counted as authored after the fact.Origin. The label and option-label divergence checks came in with #29624 (59775a0, shipped in 18.3.0). It was not #29948, and not 18.4.0: the path is identical from 18.3.0 to 18.4.0 (measured:
translateObject,packagedObjectField,valueOverridesPackagedBase,getPackagedObjectBaseandtranslateMetaDocumentagree at the 18.3.0 and 18.4.0 tags).The fix (seat ruling 6895879286, option A).
getPackagedObjectBasenow also carries every field that a CODEextendcontributor adds under a name the owner does not declare (packagedAddedFields). It uses the same filter aspackagedRules(ownership === 'extend' && isCodeArtifactBody). This extends #27559's rule-name principle to field names: the catalog rows for such a field can only translate what its extender ships. Boundaries, each one pinned:labelonto?layers=trueonly — the two reads #7556 reconciled on FIELDS now disagree on LABEL #8037).fieldPatchesare not merged, and the scalars are untouched._provenance: 'org') extension, the.custompair's included, stay diverged.labelonto?layers=trueonly — the two reads #7556 reconciled on FIELDS now disagree on LABEL #8037 reason.metadata-protocol's echo restore and base accessor, the REST read gate, and objectql'sengine-validation-messages, which reads.validationsonly.The save door agrees with the read.
restoreTranslatedObjectEchoes(#29673) reads the same accessor. A zh-CN read of the added field, echoed back by a PUT, is stored as the extender's source text (Market,Domestic,Export), both over a stored row and with none.Extender-added
listViews: not applicable, no card.ObjectExtensionSchemarefuseslistViewson an extension (packages/spec/src/data/object.zod.ts, its guidance: "listViewscannot be contributed through an object extension"). SotranslateObjectListViewsnever sees a view an extender added.Stale comments rewritten: the
TranslateDocumentOptions.packagedBasedoc, thepackagedObjectFielddoc, thetranslateObjectdocblock sentence on undeclared fields, and thei18n-resolver.test.tscomment on the undeclared-field pin. These are comment-only changes in@objectstack/spec.Contract declaration.
Clause-②: no. No accept set, export, schema or response shape changes, and nothing previously served is refused. What changes is the label text that non-default-locale/api/v1/meta/objectreads serve for fields a code extender adds; the changeset says so. Default-locale reads are unchanged. Not breaking, so no!, banner or ADR-0087 marker, and the dogfood battery is not owed.Tests
packages/objectql/src/protocol-packaged-object-base.test.ts(the existing harness forgetPackagedObjectBase, per ruling 6583487846): a new top-level describe with 7 cases. The BY REFERENCE pin is flipped: with the shared fixture'sloyalty_tierextension the base is now a copy that carries the field, and a label-only extension still returns the owner by reference.packages/rest/src/meta-object-field-patch-i18n.test.ts(the existing harness for the meta-object extension i18n exit): a new top-level describe with 5 cases (item read, list read, base fields, owner field redeclared, tenant-added field).packages/objectql/src/protocol-meta-effective-schema.test.ts(the existing Studio in zh-CN: a new object publishes "successfully" and never reaches the data plane, because its echoed queue column carries a translated label #29673 door harness): a new top-level describe with 2 cases (with and without a stored row).Red before the fix (45dee17 + pins): objectql 4 failed / 9 passed; rest 4 failed / 8 passed (
expected 'Market' to be '市场').Acceptance notes
steedos-labs/os-project-blackcat-crmis not readable from this session. The card's own facts point to a code package rather than a storedobject_extensionrow. The fields come in "throughobjectExtensions" (the manifest key of a code package), they carry no__csuffix, and the package "passes validate".listViews: none can exist (the extension schema refuses the key), so there is nothing to translate and no card to file.Verification
All on head
ecffbe8d0(origin/main86350e125merged), unless a line names another head.Pins, typecheck, generated artifacts (locked, final head)
Package suites (head c856cd3: the fix merged with origin/main fb79d47; the final head adds only a test import and a main merge that touches no package of this diff's behaviour)
Ablations (each leg: ablation-replace, objectql build, ablation-dist-preflight, pins, restore with blob == HEAD)
A3's first run was a no-op: the anchor sat inside its own replacement, and ablation-replace refused it with a drop of 0. It was rerun with a different anchor, and the line above is that rerun. A1's first run failed the dts build (an unused binding) and was rerun clean.
Gate sweep and PR-body gates
dispatch-gates --commandsderived 93 families. 92 were run locally with exit codes recorded and exit 0, after one fix:check:test-source-aliasasked for a module-top@objectstack/spec/uiimport in the rest pin file, which is added.check:dual-build-cjs-loadsis left to CI.pnpm lintexit 0. Run with this body:check-changeset-no-major,check-adr-0087-registration,check-closing-keyword-parity,check-partof-closing-keyword, all exit 0.git merge-tree --write-treeis clean against origin/main, #33821 (already merged) and #34025 (the one open PR touchingi18n-resolver.ts).🤖 Generated with Claude Code