Skip to content

docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain - #34928

Merged
os-zhuang merged 3 commits into
mainfrom
claude/issue-34870-adr-0149-label-locale
Nov 17, 2026
Merged

os-zhuang merged 3 commits into
mainfrom
claude/issue-34870-adr-0149-label-locale

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

repo:objectstack#3 · os-support-ai · session_01WGufzg1NmbJpZhtiWQkTir

Closes #34870

Clause-②: no
Metadata-protocol: none

Landing: Tier H (docs/adr/**). This PR stays draft; no seat readies, queues or arms auto-merge on it.

维护者速读

  • 改了什么:ADR-0149 D3 第 1 条下加一段只增不改的修订说明,写明「标签在每个语言下都是匹配目标」的准确含义:内联多语言标签的每个语言都算,翻译包里的标签只算为调用方语言解析出的那一个值(沿解析器的语言链:先按平台语言阶梯找请求语言,含变体扩展,再找部署声明的回退语言;请求语言即编写语言时跳过回退);别的语言的词只有写成同义词才命中。dataset-term-matcher.ts 的文档注释改成同样的话。没有任何代码行为变化。
  • 为什么改:reading first: does list_datasets match a member's translated label from a translation bundle, or only an inline label map #34720 的裁决「A+C 本语言标签+同义词」(记录 6946563869)已定,但 ADR 原文和匹配器注释仍写「every locale」,读起来像翻译包的所有语言都能命中,与裁决和 HTTP 入口的实际行为不符。
  • 风险与回滚:只改文档与注释,零运行时风险。回滚即 revert 本 PR。
  • 先看:① ADR-0149 D3 第 1 条下的修订说明,看是否如实转述裁决;② 其中「按传输层的调用方语言」一条:stdio 入口现在也走翻译(用 i18n 服务的默认语言),不是派发词所说的「不翻译」,见 Acceptance notes;③ dataset-term-matcher.ts 顶部注释。
  • 两分钟验证:pnpm check:adr-symbol-anchors,预期最后一行 ✅ check-adr-symbol-anchors: ... anchors across 158 records resolve(修订说明里新增的符号锚都能解析)。
  • 需要你做的:席位 L2 复核后,亲手合并本 PR(Tier H:docs/adr/**)。

What changes

  • docs/adr/0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md (10 lines added, 0 removed): an add-only amendment note, nested under D3 rule 1 so the numbered list stays intact. It follows the record's existing amendment-note form (the spec: list_datasets answers a term with no match with a candidates list, never selected; ADR-0149 D3 gains the amendment note #34761 note after rule 5) and its measurement discipline (symbol anchors only; the line positions are below, not in the record). It states:
    • an inline label map: every locale is a target, unless the bundle answers for that member;
    • a bundle label: one value, resolved for the caller's locale along the resolver's locale chain (option A; fix round 1 spells the chain out), resolved before matching; where the bundle answers, its value replaces the authored label (string or inline map), so the authored label is then no target, the consequence the ruling records;
    • a word in another language is an authored synonym (option C); candidates offer, never hit;
    • the caller's locale per transport: HTTP reads Accept-Language, falling back to the i18n default; stdio has no request and translates for the i18n service's default locale; with no resolvable i18n service the catalogue is untranslated on either;
    • the matcher is unchanged.
  • packages/services/service-analytics/src/dataset-term-matcher.ts (doc comments only, +13 / -3): the module comment and the MatchableMember.label comment say the same words. No statement, type or export changes.

Why

The decision text said a member's label matches "in every locale". The ruling on #34720, verbatim 「A+C 本语言标签+同义词」 (ruling record 6946563869), and the HTTP door hold it narrower. The note did not ride #34761's ADR note (PR #34828).

Code readings behind each claim (base ab441988)

File and line positions, measured at the base commit
  • HTTP door: packages/runtime/src/domains/mcp.ts:1542 (loadDatasets inside datasetToolMembers) runs translateMetaList with requestLocale at :1555 = metaRequestLocale({ headers: context.request?.headers }, i18n). Headers only, so the locale is Accept-Language, else the i18n service's default.
  • packages/rest/src/meta-item-read-gate.ts:3208 metaRequestLocale: Accept-Language, then ?locale=, then i18n.getDefaultLocale(). :3538 translateMetaList returns the items untranslated when no locale resolves; :3286 metaTranslateOptions adds the i18n fallback locale as the lookup chain.
  • packages/spec/src/system/i18n-resolver.ts:1907 maps dataset to translateDataset (:2626); translateDatasetMembers (:2545, label lookup :2562) writes the bundle string over member.label when the bundle answers, an inline map included (the doc block's "An inline locale map is never changed" sentence: the catalog applies to it). localeChain (:649) is the caller's locale plus the fallback chain.
  • Executor: packages/services/service-analytics/src/dataset-tools.ts:365 loads through the transport's loadDatasets; :439 hands the loaded (translated) members to matchDatasetTerms. The matcher (dataset-term-matcher.ts, labelTargets) reads a string or each value of an inline map and never reads a bundle.
  • stdio: packages/mcp/src/stdio-data-bridge.ts:1431-1458 runs the same translateMetaList, with requestLocale at :1453 = metaRequestLocale(undefined, i18n), the i18n service's default locale. This landed with fix(mcp): stdio list_datasets localizes the dataset catalogue for the workspace default locale #34833 (commit 6320abba), the change made for card mcp: the stdio door's list_datasets never localizes, so its catalogue and label matches ignore the workspace default locale (ADR-0149 D2) #34787.

Tests

No behaviour change, so no new test and no ablation. At head 233683d6:

Typecheck and tests, service-analytics
  • pnpm --filter '@objectstack/service-analytics^...' build && pnpm --filter @objectstack/service-analytics run typecheck (under the verify lock): VERDICT command-exit 0, tsc --noEmit clean.
  • pnpm --filter @objectstack/service-analytics test (under the verify lock): Test Files 218 passed (218), Tests 5548 passed | 335 skipped (5883), VERDICT command-exit 0.

Acceptance notes

Verification

At head 233683d6, change set derived by node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (2 paths vs merge base ab4419881): 54 local commands run, 52 exit 0, 2 NOT MEASURED (prerequisites, not red). --ran reconciliation: 54 derived famil(ies) accounted for — 54 run, 0 UNRUN.

Selected verdict lines
  • pnpm check:adr-symbol-anchors exit 0: ✅ check-adr-symbol-anchors: 3740 anchors across 158 records resolve
  • node scripts/check-adr-links.mjs exit 0: ✅ check-adr-links: 1150 relative link destination(s) under docs/adr/ resolve
  • pnpm check:adr-index exit 0: adr-index --report: OK — docs/adr/README.md is current
  • pnpm check:adr-anchors exit 0
  • pnpm check:nul-bytes exit 0: check-nul-bytes: OK (scanned 25983 text file(s) ... no raw ASCII control bytes)
  • node scripts/check-issue-citations.mjs exit 0: ✅ check-issue-citations: no issue citations added against ab4419881 (1 file(s) read); pnpm check:issue-citations (self-test) exit 0
  • pnpm check:doc-authoring exit 0
  • node scripts/pm/overlap-check.mjs --branch=HEAD exit 0: VERDICT clean exit 0 (origin/main 13e0305c33 and feat(analytics): list_datasets offers candidates for a term that matched nothing #34904)
  • NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test exit 3, reason: its fixture is pinned to commit 621a4876, which this shallow checkout cannot reach (checker health only, cannot judge this diff). pnpm check:dual-build-cjs-loads exit 3, reason: PREREQUISITE NOT MET, no full pnpm build in this worktree. CI runs both.

The repo-wide runs (pnpm lint, the full check:* farm, Test Core) are CI's.

Fix round 1

Head 4b963c98 answers the seat's L2 record (comment 6954921504, S1, with N1 to N3 folded in) and the L1-c ACCEPT's note N1 (comment 6954336709), which made the same point as S1. Prose only: no statement, type or export changes. The body's What changes bullet and the 维护者速读 line above were edited to match.

  • S1, the bundle label's locale chain. The note had said a bundle label matches in "the caller's locale only" and that "the bundle's values in other locales are not" targets. The resolver says otherwise. lookupDatasetMemberAttr walks localeChain: first the requested locale, read through pickData / resolveBundleLocale (exact, case, platform table language, base language, variant expansion), then the deployment's declared fallback locale. metaTranslateOptions supplies that fallback from getFallbackLocale(), and localeChain skips it when the caller's locale is the authored one (getSourceLocale(), else getDefaultLocale()). The note's bundle point now states that chain, says one value is served per member and only that value is a target, and replaces the clause with "no other bundle value is". It gives two worked cases. A zh-TW caller against a bundle whose only Chinese locale is zh-CN is served the zh-CN label: resolveLocaleAmong step 5, variant expansion. A fr caller in a deployment authored in another language, with declared fallback en, is served the en label when the bundle has no French one. The bold lead now reads "the one translation-bundle label resolved for the caller's locale". New anchors: i18n-resolver.ts#lookupDatasetMemberAttr, i18n-resolver.ts#resolveBundleLocale, meta-item-read-gate.ts#metaTranslateOptions. The matcher's module comment mirrors the chain in one clause, and its MatchableMember.label comment says "resolved for", not "resolved to".
  • N1, the HTTP pair-translation corner. When no i18n service resolves, stdio has no locale (metaRequestLocale(undefined, undefined) is undefined), so translateMetaList returns the items untranslated. HTTP is different: Accept-Language still yields a locale, and pairTranslationBundleOf reads a declared override's pair bundle from the protocol. translateDataset then applies it through labelCatalogs. The note now names that one exception (anchor meta-item-read-gate.ts#pairTranslationBundleOf).
  • N2, other doors. The note adds one sentence. Any other door to the same executor, cloud's service-ai ToolRegistry (D2) among them, supplies the executor's loadDatasets itself and owes the same translation step. The contract it points to is dataset-tools.ts#DatasetToolsDeps, whose loadDatasets doc already says "localized at the metadata boundary for the caller's locale". No repository beyond those the ADR already names is cited.
  • N3, the PR in the note header. The header now says "PR docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain #34928" instead of "this PR". That is ADR-0011's note form, minus the commit, which does not exist before merge.
Fix round 1 verification, head 4b963c9
  • Named gates, each exit code captured before any pipe: pnpm check:adr-symbol-anchors exit 0, ✅ check-adr-symbol-anchors: 3745 anchors across 158 records resolve (3740 at round 0, plus the five new anchors). pnpm check:adr-links exit 0, 1150 relative link destination(s) under docs/adr/ resolve. pnpm check:adr-index exit 0, docs/adr/README.md is current. pnpm check:adr-anchors exit 0. pnpm check:doc-authoring exit 0. pnpm check:nul-bytes exit 0, no raw ASCII control bytes. pnpm check:issue-citations (self-test) exit 0. node scripts/check-issue-citations.mjs exit 0, no issue citations added against ab4419881 (1 file(s) read).
  • pnpm --filter '@objectstack/service-analytics^...' build, then pnpm --filter @objectstack/service-analytics typecheck, both under the verify lock: VERDICT command-exit 0 each, tsc --noEmit clean.
  • Derived families: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack gave 54 commands, all run. 52 exited 0. 2 are NOT MEASURED for the same reasons as round 0, both prerequisites and not reds. check-plugin-teardown-shape --self-test exited 3: the fixture commit 621a4876 cannot be reached from this shallow checkout. check:dual-build-cjs-loads exited 3 with PREREQUISITE NOT MET: there is no full build here. --ran gives 54 derived famil(ies) accounted for — 54 run, 0 UNRUN. The derivation warned STALE TREE: this branch is 11 commits behind origin/main, and dispatch-gates.mjs and its data file changed in that range. CI derives on its own tree.
  • node scripts/pm/overlap-check.mjs exit 0: VERDICT clean exit 0, against origin/main 46991d0e and feat(analytics): list_datasets offers candidates for a term that matched nothing #34904.
  • No test or ablation: the matcher's code lines are unchanged.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (Not touched.)
  • 2. Every name I added uses the casing for its kind. (No names added.)
  • 3. No formatter ran; pnpm lint passes. (Left to CI.)
  • 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. (Publishes nothing: skip-changeset.)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is Chinese by the dev agent's rule).
  • The Before Submitting list in CONTRIBUTING.md is done, with the repo-wide runs left to CI as stated above.

Generated by Claude Code

…'s locale only

ADR-0149 D3 rule 1 said a member's label matches "in every locale". The
maintainer's ruling 「A+C 本语言标签+同义词」 (ruling record 6946563869) and
both transports hold it narrower: every locale of an inline label map, plus
the translation bundle's label in the caller's locale; a word in another
language hits only as an authored synonym. An add-only amendment note under
rule 1 records it, and the term matcher's doc comment says the same. No
behaviour change.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 17, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 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 — 10 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 c81f498b5f0614157864d9586da718dbe02121b1 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json c81f498b5f0614157864d9586da718dbe02121b1

⚠️ 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#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT · 2026-11-17T16:36Z

Head-sha: 233683d
Reviewer: seat 3 L1-c, for card #34870 (the D3 rule 1 qualifier that maintainer ruling 6946563869 on #34720 asks for; os-dev report 6954260196).

席位核对

PR shape. Draft, base main, Closes #34870. No other issue sits next to a closing verb. Two paths, +23/-3.

Governed / size. check-governed-merges --pr 34928: GOVERNED, landing tier H, on 1 of 2 paths (docs/adr/**). The low-risk skills arm does not apply, since this is an ADR rule text. The route is the seat's fable L2 (a rules face), then the seat's Tier H record and os-zhuang's hand. The area never readies it.

Declaration. Clause-②: no / Metadata-protocol: none. There is no changeset: dataset-term-matcher.ts changes by doc comments only, and Check Changeset is green.

Check-runs at 233683d, read at about 16:36Z. 56 runs, none failed. Already success: PR-body guards, Governed Surface Queue Guard, Check Documentation Links, Flag docs affected by code changes, Check Changeset, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Test UI, Dogfood Regression Gate. Still in_progress: Build Core, all 10 Test Core shards, Live E2E UI, the remaining Lint legs and the four Type Check · legs. This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

Against the ruling. I read 6946563869 on #34720. The option text quoted, 「A+C 本语言标签+同义词」, is byte-identical. The note carries each part of the ruling's execution:

  • A: a bundle label is matched only in the caller's locale, resolved before matching.
  • C: a cross-locale word is an authored synonym, and candidates does not rescue it.
  • The D3 wording: every locale of an inline map, plus the bundle label in the caller's locale, and the matcher's doc comment says the same.
  • The known consequence: under a translated locale, an English source label that is not the member's name misses.

Add-only. The ADR diff is 10 + lines and 0 - lines. The note is nested under rule 1 in ADR-0011's > **Amendment note** form, the same form #34828 used after rule 5. It says it changes no other word of rule 1, and rule 1's text is untouched.

Each code claim, checked on this head. Every symbol anchor resolves:

  • The bundle answer replaces the authored label, inline map included. In i18n-resolver.ts translateDatasetMembers, when lookupDatasetMemberAttr answers, the member is returned with label set to that string, whatever was authored. When it does not answer, raw is kept, inline map and all. So the note's 「it takes the place of the authored label … so the authored label is then no target」 is exact, and it correctly does not suggest both are targets.
  • HTTP. runtime/src/domains/mcp.ts#datasetToolMembers runs translateMetaList with requestLocale set to metaRequestLocale({ headers: context.request?.headers }, i18n). That reads Accept-Language, then ?locale=, then the i18n service's getDefaultLocale().
  • stdio. stdio-data-bridge.ts (around line 1453 on this head) runs the same translateMetaList with metaRequestLocale(undefined, i18n), which means the i18n default locale. The dev's corrected premise holds: the stdio translation from fix(mcp): stdio list_datasets localizes the dataset catalogue for the workspace default locale #34833 is on main.
  • No i18n service. In both doors, the resolver failure is caught and the untranslated list is returned, so the authored label alone is the target. That matches the note.
  • The matcher. It never reads the bundle. Its two doc-comment edits say the same as the note in the same words, and no code changes.

Must-fix

None.

Should-fix

None.

Notes

Next: the seat's fable L2 (rules face), then the seat's Tier H record and os-zhuang. A later push owes an L1-c delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 233683d6ee98accf75b8a0dd6e0ae6324c861e68
Local-runs: none
Scope: docs/adr/0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md + packages/services/service-analytics/src/dataset-term-matcher.ts
Security-touching: no

Inputs read: card #34870 (body and its three comments: triage 6951462561, claim 6953575714, os-dev report 6954260196); PR #34928 body, file list (2 paths, +23/-3) and the net diff against main (merge base ab441988; main at 189358f2 moves none of the files this review reads); the 59 check-runs on this head. The ruling record 6946563869 on #34720 was read because the diff quotes it. Code outside the diff was read on this head, never reviewed.

Check-runs on 233683d6, read 2026-11-17T16:57Z: 59 runs, all completed: 38 success, 21 skipped, none failed, cancelled or timed out. Green among them: Check Changeset, Governed Surface Queue Guard, PR-body guards, Check Documentation Links, every Lint · leg, the four Type Check · legs, Build Core, Test Core 1/10 to 10/10.

① Derived judgments

  • Accept-set: none changes. The diff holds no statement, type, export or schema edit; the matcher's code lines are byte-unchanged. Right.
  • Public surface: MatchableMember.label and the module comment gain doc text only. MatchableMember is exported, so the published declaration file carries a longer comment and nothing else. Right.
  • Rule text: ADR-0149 D3 rule 1 is untouched (10 added lines, 0 removed); the note qualifies the label target and says it changes no other word. Right.
  • The matcher's behaviour as the note states it, read in matchDatasetTerms / labelTargets: a string label is one target, a plain-object label contributes each string value, the bundle is never read. Right.
  • The note's account of WHICH bundle value the matcher is handed is wrong in one clause: S1 below.

② Semver level

Clause-②: no. Agreed. No changeset, label skip-changeset, Check Changeset green. The ADR is not published; the package diff is comments only, so nothing ships that a consumer can observe. Metadata-protocol: none is right.

③ Boundary flags

  • open_questions: empty in the os-dev report. Nothing to answer.
  • Dev flag 1, the dispatch's stdio premise was stale: confirmed. packages/mcp/src/stdio-data-bridge.ts#createStdioDataBridge runs translateMetaList with metaRequestLocale(undefined, i18n), the i18n service's default locale. The note states the code, which is right.
  • Dev flag 2, attribution line and plain-text trailer: PR-body form, PR-body guards is green; not a contract matter.
  • Dev flag 3 (PR body), the bundle replaces and does not add: confirmed in packages/spec/src/system/i18n-resolver.ts, translateDatasetMembers: when the member lookup answers, label is set to that string whatever was authored; when it does not, the raw member is returned, inline map included.
  • Overlap with open PR feat(analytics): list_datasets offers candidates for a term that matched nothing #34904 on the same file: the lane seat's; no contract effect here.
  • SQL push-down: not applicable. No query, no id materialisation, no join in the diff.
  • Security: no changed hunk teaches permission, sharing, credential, token or authentication behaviour. The matcher's "admitted members only" sentence is pre-existing and untouched.

④ Design judgment

No must-fix. One should-fix, owing a delta review. Three nits.

S1 (should-fix) — "the caller's locale only … the bundle's values in other locales are not" is contradicted by the resolver the note cites.
The bundle label is not read at the caller's locale alone. lookupDatasetMemberAttr walks localeChain(opts), and metaTranslateOptions (packages/rest/src/meta-item-read-gate.ts) fills that chain with the deployment's declared fallback locale (getFallbackLocale()), skipped only when the caller's locale is the authored one. Each step is then read through pickData / resolveBundleLocale, the platform locale ladder (case, table language, base language, variant expansion). So on this head:

  • a zh-TW caller against a bundle that holds zh-CN and no Traditional key is served, and matched on, the zh-CN value, with no fallback declared at all (variant expansion);

  • a fr caller in a deployment with fallback en is served, and matched on, the en bundle value, and by the note's own replacement rule the authored label is then NO target.
    A reader of the note predicts the opposite in both cases: no bundle value for my locale, so the bundle does not answer, so the authored label still matches. That reader is the one the note is written for: the app author deciding which words must be authored as synonym entries (option C, the remedy the note prescribes), and the D5 scenario author writing expected hits and misses. Both get it wrong for any deployment with a declared fallback or a regional variant. The half-sentence "only that resolved value is a target" is true; the next clause and the bold lead deny what "resolved" includes. The ruling itself anchors option A to "today's HTTP behaviour", so spelling the chain out restates the ruling, it does not widen it.
    Fix, prose only, in the note's bundle point and mirrored in one clause of the matcher's module comment: say the bundle label is resolved for the caller's locale along the resolver's locale chain (the requested locale by the platform locale ladder, then the deployment's declared fallback locale, which is skipped when the caller's locale is the authored one); exactly one value is served per member and only that value is a target; and replace "the bundle's values in other locales are not" with "no other bundle value is". The symbol to anchor is packages/rest/src/meta-item-read-gate.ts#metaTranslateOptions.

  • N1 (nit) — "a host whose i18n service cannot be resolved serves the catalogue untranslated" is exact on stdio (no service, no locale, translateMetaList returns the items) and has one corner on HTTP: with an Accept-Language header a locale still resolves, and a dataset that is a .custom pair's declared override is still handed its pair's own translations (pairTranslationBundleOf, read from the protocol, not from the i18n service), which labelCatalogs then applies. Rare enough (authored pair translations on a host with no i18n service) to leave or to soften with "apart from a declared override's pair translations". No effect on the ruled rule.

  • N2 (nit) — "per transport" lists the HTTP door and stdio. D2 names a third caller of the same executor, cloud's service-ai registry, which supplies its own loadDatasets. The matcher comment's "the transport localizes the catalogue before it runs" covers it in the code; the note could say in half a sentence that any other door owes the same translation step. Accepted deviation or a follow-up card.

  • N3 (nit) — the note header says "this PR" with no number. It follows the spec: list_datasets answers a term with no match with a candidates list, never selected; ADR-0149 D3 gains the amendment note #34761 note in the same record, so it is consistent here, but ADR-0011's note names the PR and commit. Leave it, or fold into a status-hygiene pass.

Judged and found to hold:

  • Ruling quote: 「A+C 本语言标签+同义词」 is byte-identical in the ADR note, in the matcher comment and in ruling record 6946563869 (compared as bytes). The record id and its link are right, and the note's four parts (A, C, the D3 wording, the known consequence) are each the ruling's.
  • Inline map point: every locale is a target unless the bundle answers. Holds (labelTargets, and the pass-through of the raw member when the lookup misses).
  • Option C point: synonyms are never translated (translateDataset docblock, D1's i18n stance); candidates offer and never hit, as the rule 5 note says. The D1 fragment link matches the heading.
  • HTTP: packages/runtime/src/domains/mcp.ts#datasetToolMembers hands metaRequestLocale the request headers only, so Accept-Language, else the i18n default. Holds; the ?locale= arm is unreachable there and the note rightly omits it.
  • stdio: holds, as in ③.
  • "The matcher is unchanged" and "its doc comment says the same": hold. The two comment edits say the note's words; MatchableMember.label's "arrives already resolved … as a string" is what translateDatasetMembers writes.
  • Carrier: an add-only Amendment note blockquote nested under the rule it qualifies is the record's own form (the spec: list_datasets answers a term with no match with a candidates list, never selected; ADR-0149 D3 gains the amendment note #34761 note after rule 5) and the registry's (40 such notes across docs/adr/; AGENTS.md names "add-only ADR notes" as a landing class). The note narrows how a sentence is read and reverses no decision, so no new ADR and no status-line change is owed. Right carrier.
  • All six symbol anchors in the note resolve on this head (Lint · docs & code guards is green; each was also read).

Verdict on this head: PASS, with S1 open. S1 is a prose-face fix that moves the head; the delta review of that fix is owed before this record can clear.

Implemented-by: claude/issue-34870-adr-0149-label-locale
Reviewed-by: session_01WGufzgh1zkZzDXL36ckWAG

VERDICT: PASS

The D3 rule 1 amendment note said a bundle label is matched in "the
caller's locale only" and that "the bundle's values in other locales are
not" targets. The resolver says otherwise: lookupDatasetMemberAttr walks
the requested locale through the platform locale ladder (variant
expansion included), then the deployment's declared fallback locale
(metaTranslateOptions), skipped when the caller's locale is the authored
one. The note now states that chain, keeps "one value is served and only
that value is a target", and names two worked cases. It also names the
HTTP pair-translation corner when no i18n service resolves, says any
other door to the executor owes the same translation step, and names
the PR in its header. The matcher's module comment mirrors the chain in
one clause. Prose only; no code changes.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT (delta) · 2026-11-17T17:53Z

Head-sha: 4b963c9
Reviewer: seat 3 L1-c. This is a delta read of 233683d6..4b963c98 against my 6954336709, answering the seat's fable L2 S1 (6954921504) and my N1 (os-dev report 6956227841).

席位核对

Delta. Prose only, on the same two paths:

  • the ADR-0149 D3 rule 1 note;
  • the matcher's module comment and the label doc. The code lines are byte-unchanged.

The note is still add-only against main: every changed line sits inside the PR's own note. The tier is still H (docs/adr/**). CI at report time: none failed, some legs still running. This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

L2 S1 and my N1: closed. The bundle point now names the chain, and I checked each symbol on this head:

  • i18n-resolver.ts#lookupDatasetMemberAttr (:2521) reads along localeChain.
  • i18n-resolver.ts#resolveBundleLocale (:543) documents the ladder "exact → case-insensitive → platform table language → base-language → variant-expansion". That is the note's 「case, platform table language, base language, variant expansion」.
  • meta-item-read-gate.ts#metaTranslateOptions (:3286) sets fallbackChain from getFallbackLocale() and defaultLocale from the source or default locale. localeChain skips the fallback when the requested locale is that default. That matches the note's 「skipped when the caller's locale is the one the labels are authored in」.
  • Both worked cases follow from that: zh-TW reaches a zh-CN-only bundle by variant expansion with no fallback declared, and fr reaches the en label through a declared en fallback.
  • 「One value is served per member … no other bundle value is」 states the invariant exactly. The bold lead and the matcher comment say the same in one clause each.

L2 nits folded.

  • N1, the HTTP pair exception. In translateMetaList, the locale comes from requestLocale(i18n), which on HTTP still answers from Accept-Language when the i18n service is absent. pairTranslationBundleOf (:3398) is read from the protocol, so a .custom pair's override can still be translated with no i18n service. On stdio, metaRequestLocale(undefined, undefined) is undefined, and the list returns untranslated. So 「the one exception is on HTTP」 is exact.
  • N2, other doors. dataset-tools.ts#DatasetToolsDeps (:156) is where an external door supplies loadDatasets, and the note puts the translation duty there, with cloud's ToolRegistry as the example.
  • N3. The header reads 「PR docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain #34928」.

Anchors. adr-symbol-anchors passes with the five new anchors, as the report says. Every one resolves to the line I read.

Must-fix

None.

Should-fix

None.

Notes

Next: the seat's L2 delta, then the Tier H record and os-zhuang. #34943 folds the same wording, and its delta read follows. A later push owes an L1-c delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4b963c9824ac155296328f5a8723915650155995
Local-runs: none
Scope: docs/adr/0149-ai-answers-business-questions-through-the-dataset-semantic-layer.md + packages/services/service-analytics/src/dataset-term-matcher.ts
Security-touching: no

DELTA review from 233683d6ee98accf75b8a0dd6e0ae6324c861e68 (my record, comment 6954921504: PASS with S1 open, nits N1 to N3) to this head. Read: git diff 233683d6..4b963c98 (one commit, the same two paths), the net diff against main (merge base ab441988), card #34870 with its new os-dev report 6956227841, and the 58 check-runs on this head. Everything the earlier record judged and this delta does not touch stands as written there.

Check-runs on 4b963c98, read 2026-11-17T18:00Z: 58 runs, all completed: 36 success, 20 skipped, 2 failure. The two failures are one event: Type Check · workspace (job 134234042188) ended on "The action 'Checkout repository' has timed out after 20 minutes", so no type check ran, and the aggregate TypeScript Type Check reports that leg. Green: every Lint · leg (the ADR symbol-anchor gate among them), Governed Surface Queue Guard, PR-body guards, Check Documentation Links, Build Core, Test Core 1/10 to 10/10, and the other three Type Check · legs. THE HEAD IS NOT GREEN: the workspace type-check gate has no verdict on this head. This record judges the contract; it does not stand in for that gate. A re-run of the failed job on this same head is owed before any landing step, and it does not move the head.

① Derived judgments

  • Still prose and comments only. Against the merge base the package file changes comment lines alone (every changed line sits inside a doc block; no statement, type or export moves); the ADR is 10 added lines, 0 removed, all inside the PR's own note. Right.
  • Accept-set and public surface: unchanged from the earlier record. The exported MatchableMember.label carries a reworded comment. Right.
  • Rule 1's own text is untouched. Right.

② Semver level

Clause-②: no. Agreed, as before: no changeset, label skip-changeset still on the PR; Check Changeset reads skipped on this head (both of its runs), where it read success on 233683d6, so it gives no verdict here and the judgment rests on the diff: comments in a published package ship nothing observable.

③ Boundary flags

  • os-dev report 6956227841: open_questions empty, out_of_scope_findings empty.
  • Dev flag, the branch is 11 commits behind main: read. main has since reshaped the two doors (mcp: list_objects and describe_object serve labels and descriptions in the caller's locale, as the REST metadata door does #34872: metaTranslationSources on HTTP, defaultLocaleSources on stdio), and both anchored symbols, datasetToolMembers and createStdioDataBridge, still exist there with the same locale reads (request headers on HTTP, no request on stdio). The note's per-transport sentences hold on main as on this head.
  • Dev flag, the PR body was not patched this round (a new body waits for the seat): the body is not judged here; the tree is.
  • SQL push-down: not applicable. Security: no changed hunk teaches permission, sharing, credential, token or authentication behaviour.

④ Design judgment

  • S1: closed. The bundle point now states the chain the resolver walks, and each part was read on this head:
    • packages/spec/src/system/i18n-resolver.ts#lookupDatasetMemberAttr walks localeChain, first non-empty string wins: "one value is served per member".
    • resolveBundleLocale is the ladder each step is read through; the note's "case, platform table language, base language, variant expansion" is its documented order after the exact match.
    • packages/rest/src/meta-item-read-gate.ts#metaTranslateOptions puts the declared fallback locale on the chain and hands the authored locale (declared source, else default) as the one whose requests skip it: the note's "skipped when the caller's locale is the one the labels are authored in".
    • Both worked cases follow: zh-TW reaches a zh-CN-only bundle at the ladder's last step with no fallback declared; fr reaches the en label through a declared en fallback when the bundle has no French key.
    • "the bundle's values in other locales are not" is gone; "no other bundle value is" is exact. The bold lead and MatchableMember.label no longer say "only"; the matcher's module comment mirrors the chain in one clause.

No must-fix. No should-fix. Two new nits.

The three earlier nits, folded in this delta, were re-read for new error and none was found:

  • N1 fold, the HTTP exception: exact. With no i18n service, translateMetaList still resolves a locale from Accept-Language on HTTP, and pairTranslationBundleOf reads a declared override's pair translations from the protocol; on stdio no locale resolves and the list returns as it came.
  • N2 fold, other doors: packages/services/service-analytics/src/dataset-tools.ts#DatasetToolsDeps is where a door supplies loadDatasets, and that member's own doc already asks for a list "localized at the metadata boundary for the caller's locale". The sentence adds no duty D2 did not state. The D2 fragment link matches the heading.
  • N3 fold: the header names PR docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain #34928.
  • The five new symbol anchors (lookupDatasetMemberAttr, resolveBundleLocale, metaTranslateOptions, pairTranslationBundleOf, DatasetToolsDeps) each resolve to a declaration on this head, and Lint · docs & code guards is green.

New nits, neither affecting correctness or the contract:

  • N4 (nit) — the declared fallback locale is itself read through the same ladder; the note describes the ladder for the requested locale only. Not false, one step short of complete.
  • N5 (nit) — the PR title still reads "in the caller's locale only", the wording this delta retired from the tree. A title edit moves no head.

Verdict on this head: the contract holds, S1 is closed and nothing graded is open. The red Type Check · workspace is an unmeasured gate, not a finding against the diff; it must be re-run to green on this head before the record is used to land anything.

Implemented-by: claude/issue-34870-adr-0149-label-locale
Reviewed-by: session_01WGufzgh1zkZzDXL36ckWAG

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot changed the title docs(adr-0149): D3 rule 1 note — a bundle label matches in the caller's locale only docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

Regen-provenance: 6956500816 · 4b963c9824ac155296328f5a8723915650155995 → 3d92094558cb3739ac60893c332786494aa88767 · git diff --name-only → (empty)

Merge-only hop (pr_update_branch, main c81f498): git merge-tree --write-tree 4b963c98 c81f498b = c006574b = the merge commit's tree, so no hand resolution; the L2 record carries to this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg

L1: ACCEPT (merge-only) · 2026-11-17T18:24Z

Head-sha: 3d92094
Reviewer: seat 3 L1-c. This confirms the head move 4b963c98..3d920945 against my ACCEPT 6956307098.

席位核对

A clean main merge. The new head is a merge commit:

  • its first parent is my ACCEPTed head 4b963c98;
  • its second parent is main at c81f498b.

The PR's own diff is unchanged. The patch-id of the diff from the merge-base to 4b963c98 equals the patch-id of the diff from c81f498b to the new head (262227be…, identical), so the merge adds nothing to the PR. My ACCEPT carries over to this head.

The hop reruns CI after a runner red. That red was not the PR's doing, as o3-F's relay records. The ACCEPT's condition stands: Lint & Repo Gates, TypeScript Type Check and Test Core must finish green on this head.

Must-fix

None.

Should-fix

None.

Next: unchanged from my ACCEPT 6956307098. A later push owes an L1-c delta read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

席位记录 · 2026-11-17T19:24Z

Head-sha: 3d92094558cb3739ac60893c332786494aa88767

维护者速读(终稿)

  • 改了什么:ADR-0149 D3 第 1 条下加一段只增不删的修订说明,写明「成员标签在每个语言下都是匹配目标」的准确含义:内联多语言标签的每个语言都算;翻译包里的标签只算为调用方语言解析出的那一个值(沿解析器的语言链);别的语言的词只有写成同义词才命中。同时写明各传输层怎么取调用方语言(HTTP 读 Accept-Language,stdio 用 i18n 服务的默认语言)。dataset-term-matcher.ts 的文档注释改成同样的话。没有任何代码行为变化。
  • 为什么改:ADR-0149 D3 rule 1: a bundle label matches in the caller's locale; the matcher's comment says the same #34870。reading first: does list_datasets match a member's translated label from a translation bundle, or only an inline label map #34720 的裁决「A+C 本语言标签+同义词」(记录 6946563869)已定,但 ADR 原文和匹配器注释仍写「every locale」,读起来像翻译包的所有语言都能命中,和裁决、HTTP 入口的实际行为不符。
  • 风险与回滚:只改文档和注释,零运行时风险。Clause-②: no,Metadata-protocol: none,无 changeset(skip-changeset)。回滚即 revert。
  • 先看:ADR-0149 D3 第 1 条下的修订说明,看是否如实转述裁决;其次 packages/services/service-analytics/src/dataset-term-matcher.ts 顶部注释。
  • 两分钟验证:pnpm check:adr-symbol-anchors,最后一行应为 ✅ check-adr-symbol-anchors: ... anchors across 158 records resolve。
  • 需要你做的:这是 Tier H,因为改到 docs/adr/**。它只加不删,但新增行是列表项而不是纯散文,所以够不上「只加注」的放权臂。请 os-zhuang 审批。本 head 有 L1-c 的 ACCEPT(6957052227,沿用到本 head)和席位 L2 delta PASS 6956500816,再加一条 Regen-provenance(合 main 无手解冲突)。批准后由 o3-F 合入。

席位意见:建议批准。L2 共两轮:

  • 首轮 PASS 6954921504(233683d6),留 S1:语言链没写全;
  • 4b963c9 上 delta PASS 6956500816,S1 已关。之后只合了 main,Regen-provenance 证明 merge-tree 与合并提交的树相同。

现在只剩 nit N1–N5,都不影响正确性。

席位核对

  • 形态:Closes #34870;草稿 PR,base main,+27/−3,2 个文件。受管命中 docs/adr/**(ADR-0149)。
  • 前提实测:裁决原文「A+C 本语言标签+同义词」(6946563869)。L2 在 head 上逐条读过:HTTP 入口 metaRequestLocale 只读请求头;stdio 入口自 fix(mcp): stdio list_datasets localizes the dataset catalogue for the workspace default locale #34833 起用 i18n 默认语言翻译;translateDatasetMembers 在翻译包有值时覆盖作者标签;匹配器只读字符串或内联映射,从不读翻译包。
  • 门禁:本 head 的 check-runs:37 success,17 skipped,0 failed(Type Check · workspace 之前两次死在 checkout 超时,本 head 的重跑已绿)。ADR 符号锚门禁绿。
  • 接受的偏差:
    • N4:修订说明只写了请求语言的阶梯,没写回退语言同样走阶梯。不算错,只是少一步。
    • N5:标题已按 N5 改过(o3-F 18:24Z)。
    • N1–N3 已在 delta 轮折入。
  • 范围外去向:无。
  • 落地条款:Tier H,批准前 ⛔ 不 ready、不入队、不开自动合并。若 main 前移,o3-F 先合 main;纯合并补 Regen-provenance,手解冲突补 L1 和席位 L2 delta。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 17, 2026 21:53
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 9e71ef8 Nov 17, 2026
88 of 90 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-34870-adr-0149-label-locale branch November 17, 2026 22:18
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44184901367 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Build Docs — 失败步骤: Build Docs (the command production runs)(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 30 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-0149 D3 rule 1: a bundle label matches in the caller's locale; the matcher's comment says the same

3 participants