Skip to content

reading first: does list_datasets match a member's translated label from a translation bundle, or only an inline label map #34720

Closed

Description

@objectstack-fleet

epic:#34659#1 · hotlong · session_01Q4EjjMnXJdSZifpEN5i7aU

Filing gate: ④ a child of the cross-lane parent #34659 (the 「MCP 二期与问数」 epic), filed on the maintainer's word in this seat's chat, 2026-11-17. On the synonyms layer, verbatim: 「同意,所以hotcrm 也需要立卡改进对吧」, answering the seat's three-layer proposal (authors write synonyms; the server hints on a zero-match; the client asks back).

Why

An app that follows the platform's own convention keeps its Chinese names in a translation bundle. If the term matcher reads only what is written on the dataset itself, a user who types the Chinese name the product shows them on the dashboard still misses the metric.

Who acts: a read-only reading first (server lane, packages/services/service-analytics); the build half waits for the reading and, if it widens what counts as a match, for the maintainer.

Evidence (objectstack a0326b06, read 2026-11-17; code read, not run)

  • packages/services/service-analytics/src/dataset-term-matcher.ts: the match targets are the member's name, "its label in every locale of an inline map", and each of its synonyms. labelTargets reads member.label only.
  • Whether the members handed to the matcher already carry bundle translations resolved for the caller's locale was not determined.

Scope

  • Reading: boot an app whose dataset member has a bundle translation and no inline map, call list_datasets({ terms: [<the translated label>] }) under that locale, and record whether it matches. Post the reading on this card.
  • If it does not match: state the options (resolve the caller's locale before matching; match every locale's bundle value; leave it to synonyms) with what each does to ADR-0149 D1/D3, and hand the choice to the maintainer. No build before that.

Done when

  • The reading is on this card, and either the card closes as "already matches" or it names the decision it needs.

Relations

Activity

  1. added
    pm:epic
    area:ai
    domain:server
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → p2 · domain:server · pm:on-hold (epic #34659 is still in design) · 2026-11-17T08:46Z

    ⛔ Not a claim.

  3. added
    pm:on-hold
    priority:p2
    and removed
    pm:epic
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: pm:on-hold → pm:queue (问数 milestone released) · 2026-11-17T09:53Z

    ⛔ Not a claim. The grade is unchanged.

  5. added
    pm:queue
    and removed
    pm:on-hold
    on Nov 17, 2026
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 1 · 2026-11-17T09:59Z
    Session: session_01WGufzg1NmbJpZhtiWQkTir
    Account: os-support-ai
    Branch: claude/issue-34720-dataset-label-reading
    Worktree: objectstack-issue-34720
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: reading only — packages/services/service-analytics/**, packages/runtime/src/domains/mcp.ts, packages/mcp/src/stdio-data-bridge.ts read; a throwaway boot fixture outside the tree. No build half: the card hands any widening to the maintainer first.
    Container & model: S, mode:subagent (area o3-F), model: TIER_DEFAULT (dispatch-gates --tier on service-analytics + mcp paths: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (a reading card)
    Thread-read: 6944644667
    Premise: holds (area code read at origin/main f02f4f6: the matcher (dataset-term-matcher.ts:39-52) reads member.label as a string or an inline map only; on the HTTP door loadDatasets (packages/runtime/src/domains/mcp.ts:1520-1538) runs translateMetaList with the request locale and translateDataset (packages/spec/src/system/i18n-resolver.ts:2582) translates member labels, so the matcher sees the caller-locale bundle label; the stdio bridge's loadDatasets (packages/mcp/src/stdio-data-bridge.ts:1414-1420) does not translate. The live reading decides; the card's open question stands.)
    Serial constraints cleared: none — a reading, no push expected beyond the card comment
    Pre-claim lane: domain:server — packages/services/service-analytics/**, packages/runtime/src/domains/mcp.ts (read only); routed to area o3-F by the seat (epic #34659 release, 6944452341)
    Pre-claim deps: no Blocked-by:; hold lifted for milestone 1 by the maintainer 09:42Z (6944452341)
    Prior rulings read: list_datasets,synonyms,translated,matchDatasetTerms → 3 hits; ADR-0149 D1 (label is a match target "in every locale of an inline map"; synonyms not bundle keys), ADR-0149 D2 (list_datasets source "localized at the metadata boundary for the caller's locale"), ADR-0149 D6; thread: triage 6943208308 and 6944644667 (queue) only. No conflict: the card asks a reading, and any widening of what matches goes to the maintainer.

    Lease o3-F (seat post #34584); child of epic #34659.

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  8. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Reading: does list_datasets match a member label that comes from a translation bundle?

    Short answer. Over HTTP, yes, but only in the caller's locale. Over stdio, no: not in any locale.

    • Commit read: origin/main f02f4f6. This was a live boot on both MCP transports. The unit-level fallback was not needed.
    • Fixture: examples/app-crm, dataset crm_opportunity_metrics, unmodified. Every member label is a plain English string with no inline map. The zh-CN bundle carries datasets.crm_opportunity_metrics.{dimensions,measures}.MEMBER.label.
    • Bundle-only terms (zh-CN bundle labels that are not in any synonyms): 总金额 (total_amount), 平均成交额 (avg_amount), 阶段 (stage).
    • Controls: 客户 is both the account bundle label and an account synonym. Total Amount and total_amount hit the member name.
    • HTTP calls: the worktree's own build, os dev --seed-admin. An API key was minted with POST /api/v1/keys, then POST /api/v1/mcp sent tools/call list_datasets with x-api-key and {"terms":["总金额","平均成交额","阶段","客户","Total Amount","total_amount"]}. One call per Accept-Language value.
    • stdio calls: the same home and the same key, with OS_MCP_STDIO_ENABLED=true and OS_MCP_STDIO_API_KEY. The client sent initialize, then the same tools/call over the process's stdin/stdout.

    matches for crm_opportunity_metrics, verbatim (each entry is term → member · matchedOn)

    Call Labels shown in the catalogue matches
    HTTP, Accept-Language: zh-CN 阶段 / 客户 / 成交日期 · 商机数 / 总金额 / 平均成交额 总金额 → measures.total_amount · label; 平均成交额 → measures.avg_amount · label; 阶段 → dimensions.stage · label; 客户 → dimensions.account · label; Total Amount → measures.total_amount · name; total_amount → measures.total_amount · name
    HTTP, Accept-Language: en Stage / Account / Close Date · Opportunities / Total Amount / Avg Deal Size 客户 → dimensions.account · synonym; Total Amount → measures.total_amount · name; total_amount → measures.total_amount · name
    HTTP, no header (workspace default en) as en as en
    stdio, workspace default en as en as en
    stdio, workspace default zh-CN (throwaway copy of app-crm outside the tree, i18n.defaultLocale: 'zh-CN', never committed) as en, English 客户 → dimensions.account · synonym; Total Amount → measures.total_amount · name; total_amount → measures.total_amount · name
    Control: the same zh-CN copy over HTTP, no header zh-CN labels all six, the same as the first row

    The control row shows the zh-CN default did take effect on that boot. So the stdio result is the transport's own behaviour, not a default that failed to apply.

    Verdict per transport

    • HTTP, caller's locale is the bundle's locale: MATCHES. The hit is reported as matchedOn: "label".
    • HTTP, the caller is in another locale (en, or no header with an en default): DOES NOT MATCH the zh-CN bundle label. A Chinese name hits only if it is also a synonym.
    • stdio: DOES NOT MATCH a bundle label in any locale. That includes a workspace whose default is the bundle's locale. The catalogue it shows is untranslated too.

    Mechanism, as measured (each assumption held)

    • Matcher: dataset-term-matcher.ts:39-52 reads member.label only, as a string or as every value of an inline map.
    • HTTP door: packages/runtime/src/domains/mcp.ts:1520 loadDatasets runs translateMetaList with metaRequestLocale (Accept-Language, then ?locale=, then the i18n default). translateDataset (i18n-resolver.ts:2626) replaces each member label from the bundle for that one locale. dataset-tools.ts:439 then matches the members it was handed. The matcher sees the caller-locale bundle string and no other locale's bundle value.
    • stdio door: packages/mcp/src/stdio-data-bridge.ts:1414-1420 loadDatasets returns getMetaItems({ type: 'dataset' }) with no translation step. plugin.ts:318-321 says the stdio principal speaks the workspace default locale, but the dataset loader never applies it.

    Does the stdio gap contradict ADR-0149 D2?

    Yes. D2's list_datasets source sentence reads: "localized at the metadata boundary for the caller's locale the way the REST door localizes a saved dataset". It names no transport exception, and D2 says both bridges call the same executor "with the principal they already bind". The stdio bridge localizes nothing, so its catalogue labels and its label matches disagree with the HTTP door for the same workspace and key. This half is not a fork: D2 already rules what stdio should do. I report it to the seat as a contract defect for filing. It is not fixed on this card.

    The fork that needs the maintainer: a bundle label typed in another locale

    D1 makes label a match target ("a label IS the first synonym"), and the matcher's doc says "in every locale of an inline map". D3 rule 1 says "its label in every locale". Today a label written as an inline map matches in every locale, but the same word written in a bundle matches only in the caller's locale. The axes below are the two this card names (the effect on D1 and on D3), plus cost.

    • A. Resolve the caller's locale before matching. This is today's HTTP behaviour, and stdio would be brought to it under D2.
      • D1: unchanged.
      • D3: rule 1's "every locale" has to read as "every locale of an inline map, plus the bundle label in the caller's locale", and the matcher doc and D3 wording should say so. Equality after normalization is unchanged.
      • Collisions: one remains. D1's save-time collision check does not see bundle labels, so a bundle label that equals another member's synonym yields two hits (rule 3 asks) in that one locale, with no save-time refusal. That is already true on HTTP today.
      • Cost: no matcher change. The only work is the stdio defect.
    • B. Match every locale's bundle value.
      • D3: "every locale" becomes literal for both label forms.
      • D1: "synonyms are not bundle keys" still holds, but its dataset-level uniqueness check stops covering the match-target set. Bundle values live outside the dataset, and runtime-authored translations change them without a dataset save. Cross-member collisions would then surface only as runtime rule-3 questions that the author was never refused for.
      • Display: a hit can land on a word the response never shows. For example, an en caller typing 总金额 gets matchedOn: "label" while the catalogue shows "Total Amount".
      • Cost: the executor needs the bundle and the supported-locale list. service-analytics reads no i18n today, so the loader would have to hand over per-member label maps. There is also a possible spec question: should a match say which locale it hit?
    • C. Leave cross-locale words to synonyms.

    Recommendation for the maintainer (not a ruling): A as the rule, with C for cross-locale words. Concretely:

    1. Keep matching on the caller-locale label, which is today's HTTP behaviour.
    2. Bring stdio to D2, the separate defect above.
    3. Amend the D3 rule 1 and matcher wording to name the caller-locale bundle label.
    4. Tell authors, through the synonyms authoring card, that a name meant to match across languages goes into synonyms.

    The reasons: it keeps D1's save-time collision check meaningful, it keeps every hit on a word the caller is shown, and it needs no new dependency in service-analytics. B widens the match set beyond anything validation can see.

    Not done: no build half, no PR, no label change. The card stays open for the maintainer's choice between A, B and C.

    {
      "issue": 34720,
      "status": "reading",
      "branch": "claude/issue-34720-dataset-label-reading",
      "pr": null,
      "session": "session_01WGufzg1NmbJpZhtiWQkTir",
      "premise_still_valid": true,
      "summary": "Live reading at f02f4f63 on examples/app-crm. HTTP MCP list_datasets matches a zh-CN bundle label only when the caller's locale is zh-CN, and not for an en or no-header caller. stdio matches no bundle label in any locale, including under a zh-CN workspace default: its loadDatasets does not localize, which contradicts ADR-0149 D2. Options A/B/C for cross-locale bundle labels are handed to the maintainer; the recommendation is A plus C.",
      "verdict": { "http_caller_locale": "matches", "http_other_locale": "does not match", "stdio": "does not match (any locale)" },
      "maintainer_decision_needed": true,
      "security_findings": "none",
      "out_of_scope_findings": ["class: b · reach: MCP stdio list_datasets under a zh-CN workspace default answers English member labels and no bundle-label match, while HTTP with no header on the same app answers zh-CN and matches · Seam: spec:ADR-0149 D2 list_datasets source localized at the metadata boundary → runtime:packages/mcp/src/stdio-data-bridge.ts loadDatasets · dedupe words: stdio list_datasets locale, stdio-data-bridge loadDatasets translate, dataset label bundle stdio, translateMetaList stdio"]
    }
  9. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Maintainer ruling · 2026-11-17T11:19Z

    The fork in the live reading 6945257866 (a bundle-only translated label, typed in another locale) was put to the maintainer on a decision card in seat 3's thread after a fable review. Options: A+C caller-locale labels plus synonyms (recommended); A+C plus a publish-time collision check; B every locale's bundle value; C only, bundle labels never match. The maintainer chose, at 2026-11-17T11:18Z, verbatim: 「A+C 本语言标签+同义词」.

    What it means:

    This card's reading is answered. It closes when o3-F posts its close-out; the app-crm synonym entries and the D3 qualifier are for epic:#34659#1 to file or fold.

  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Close-out · 2026-11-17T11:22Z

    Done when, as the card states it: "The reading is on this card, and either the card closes as 'already matches' or it names the decision it needs."

    No code, branch or PR came from this card. Closing as completed.

  11. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions