Skip to content

feat(analytics): list_datasets offers candidates for a term that matched nothing - #34904

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34763-list-datasets-candidates-fill
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34763-list-datasets-candidates-fill

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #34763

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:list_datasets 在某个词一个成员都没精确命中时,服务器填 candidates:拿这个词和成员的名字、各语言显示名、同义词比"互相包含"(两边都至少 2 个字符),只从这个调用者能看到的数据集和成员里挑,每个词最多 5 个。list_datasets 工具说明和 MCP initialize 里的选择规则同步写上:有候选就反问用户,不替用户选,也不把候选当命中;没命中也没候选才回退到对象查询。
  • 为什么改:[Decision] The published skills: who reviews a change, how they are verified, one catalog or two for code-first and MCP, and the E2 premise reading #34691 裁定 F1 B,「零命中返回候选」由服务器给,产品内 AI 和所有 MCP 客户端读到同一份结果。规范形状已随 spec: list_datasets answers a term with no match with a candidates list, never selected; ADR-0149 D3 gains the amendment note #34761 落地,本 PR 是执行器和说明文字那一半。
  • 风险与回滚:精确命中规则和 matches 一字不改;只在有词零命中且有相近成员时多一个可选键,规范早已声明。说明文字变长:工具说明 1095 → 1414 字节,initialize 规则 453 → 741 字节。回滚就是 revert 本 PR。
  • 先看:packages/services/service-analytics/src/dataset-term-matcher.ts(findDatasetTermCandidates,"相近"规则、命中压制、顺序和上限都在这里)、packages/services/service-analytics/src/dataset-tools.ts(只从已准入成员取候选的那几行,以及 LIST_DATASETS_DESCRIPTION)、packages/mcp/src/mcp-server-runtime.ts(DATASET_SELECTION_RULE)。
  • 两分钟验证:pnpm --filter @objectstack/service-analytics exec vitest run --maxWorkers=2 src/__tests__/dataset-term-matcher.test.ts src/__tests__/dataset-tools.test.ts,预期 2 个文件 58 个测试全绿。
  • 需要你做的:无,席位落地。

What changes

  • The near-term finder (packages/services/service-analytics/src/dataset-term-matcher.ts, new findDatasetTermCandidates beside matchDatasetTerms). For each term with no hit in any listed dataset, it returns the members near it as { term, dataset, member }, to the shape, order and cap of ListDatasetsOutputSchema.candidates and the ADR-0149 D3 amendment note.

    • Near (the card's proposal, kept): after normalizeDatasetTerm, one of the member's targets (its name, its label in every locale of an inline map, each string synonym) contains the term, or the term contains the target, with both sides at least two code points long (DATASET_TERM_NEAR_MIN_CODE_POINTS = 2). No edit distance, stem or embedding. I measured nothing that argued for another rule: on the showcase it gives exactly the card's invoice answer (below).
    • A hit anywhere suppresses the term. The hit test is the same matchedOn equality that matchDatasetTerms reports as matches, over the same members, so a term with a matches entry anywhere in the answer has no candidate. What counts as a match is unchanged, and the existing equality test (no hit on a substring) is untouched.
    • Order and cap: terms in the order sent, datasets in the order listed, each dataset's measures before its dimensions, each in entry order. At most LIST_DATASETS_MAX_CANDIDATES_PER_TERM (5) per term, taken from the front, with no marker for the cut. A term sent twice is offered once, since the second copy adds nothing. The spec is silent on repeated terms; this is my choice, and it is pinned.
  • The fill (packages/services/service-analytics/src/dataset-tools.ts, listDatasets). The finder runs over the per-dataset dimensions / measures lists that the catalogue entry is built from. Those are already filtered by admitDatasetCatalogEntry, so a withheld member, an internal-field member and an unadmitted dataset can never be offered, and every pointer names a member listed in the same answer. candidates is set only when the list is non-empty, so the key is absent rather than an empty list.

  • Selection text, route A (seat amendment 6951344053 on mcp: the open door's initialize instructions carry the ask-data selection rule and the skills install line; /mcp/skill renders from the published skill #34686). LIST_DATASETS_DESCRIPTION and DATASET_SELECTION_RULE now carry the rows of step 2 in skills/objectstack-ask/SKILL.md, each in its own sentences:

    • each word for a thing measured that matches exactly one measure is computed, and two such words are two metrics, computed both;
    • one word matching several measures is a question for the user, without picking;
    • a word with candidates is the same question, listing each candidate's label, dataset label and description; a candidate is never picked and never treated as a match;
    • no match and no candidates falls back to the object tools, labelled as not from a governed metric.
      The dimension-alone, membersWithheld, provenance, 非指标口径 and "name the dataset of the fallback object" sentences of the tool description stay.
    String Before (bytes, UTF-8) After Delta
    LIST_DATASETS_DESCRIPTION 1095 1414 +319
    DATASET_SELECTION_RULE 453 741 +288

    Measured by evaluating each string's source expression at base d947a93c and at this branch. The rule's docblock above DATASET_SELECTION_RULE now names the candidates row too (follow-up round, after fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881 landed; see below).

  • Docs that quote the rule: packages/mcp/README.md (the initialize instructions section) and content/docs/ai/connect-mcp.mdx (Governed metrics and the initialize instructions) carry the same four rows.

  • Checklist: docs/qa/platform-checklist/areas/ai.json ai.mcp-dataset-tools moves to revision 3. It gains a near-miss step (terms: ['invoice'], then ['invoices']) and a matching clause. The description clause now names the candidates row, the qa_no_word clause adds "no candidates key", and automated.ref names the candidate pins. New step and clause are appended, so earlier indices do not move. The checklist README names no generator; pnpm check:platform-checklist is green and wrote nothing.

  • Changeset: .changeset/34763-list-datasets-candidates-fill.md. @objectstack/service-analytics and @objectstack/mcp are both patch, because Metadata-protocol: none takes patch (AGENTS.md Post-Task Checklist step 3). Clause-②: no.

Outside the claimed surface: none. Every file is inside the claim's file surface.

Tests

  • src/__tests__/dataset-term-matcher.test.ts: a new top-level describe('findDatasetTermCandidates') with 6 tests. They cover:
    • both containment directions (金额 near 合同金额, 合同金额 near 金额), with name, label locale and synonym targets after normalization;
    • the two-code-point floor on each side, plus the two-code-point positive control;
    • a hit in another dataset suppresses the term while the other terms still get candidates;
    • order: terms as sent, datasets as given, measures before dimensions even when the dimension is declared first;
    • the cap of 5 per term from the front, counted per term, with every entry a bare { dataset, member, term } pointer;
    • a repeated term, empty terms and no datasets.
  • src/__tests__/dataset-tools.test.ts: a new top-level describe('[#34763] …') with 4 tests over the plugin-wired service and the security double. They cover:
    • the restricted caller u_me: only rev → pipeline.measures.revenue is offered. Nothing is offered for secret (an internal-field member), rate or marg (members over the unreadable margin), or tot (in locked_ds, which u_me may not query, and in closed_ds, which is not API-exposed). Nothing is offered for 营收 either, because it matched.
    • the admin: more is offered by the same rule, and closed_ds and secret_sum never appear;
    • margin, which equals margin_total's label, gets no candidate although margin_rate contains it; the control marg is offered both;
    • the key is absent for no terms, for all-matched terms, and when nothing readable is near.
      Every candidate is checked to resolve to a member listed in the same answer, and the answer parses under ListDatasetsOutputSchema.
  • packages/mcp/src/mcp-dataset-tools.test.ts: a new top-level describe('[#34763] list_datasets candidates pass through MCP unchanged') with 3 tests (folded in during the follow-up round; first landed as a separate file):
    • the fixtures are spec-valid;
    • candidates passes through tools/call list_datasets unchanged, with the same entries in the same order and nothing added;
    • an answer without the key comes back without it.
  • packages/mcp/src/initialize-selection-rule-34686.test.ts pins only that the rule names both tools, not its wording, so it needed no change and is untouched.
Test and typecheck runs

Run at 2926ce23 under the shared verify lock. Each part's exit code was echoed separately.

  • pnpm --filter @objectstack/service-analytics typecheck exit 0. Its tsconfig.json includes src, so __tests__ is compiled.
  • pnpm --filter @objectstack/mcp typecheck exit 0. This runs tsc --noEmit && pnpm check:test-typecheck: check:test-typecheck: OK — @objectstack/mcp's test layer compiles under packages/mcp/tsconfig.test.json; 6 file(s) / 53 error(s) / 8 pinned signature(s) held (debt unchanged).
  • pnpm --filter @objectstack/service-analytics exec vitest run --maxWorkers=2: Test Files 218 passed (218), Tests 5558 passed | 335 skipped (5893), exit 0.
  • pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2: Test Files 70 passed (70), Tests 1244 passed (1244), exit 0.
  • After merging origin/main (14bb6615; the incoming commits touch one unrelated mcp test file and nothing in service-analytics), under the lock: the whole mcp suite gave Test Files 70 passed (70), Tests 1244 passed (1244), and the two service-analytics files gave Test Files 2 passed (2), Tests 58 passed (58); VERDICT command-exit 0.
Ablations (one-time; no permanent test file)

Both ran through scripts/ablation-replace.mjs at 2926ce23. The tests import the subject relatively from src/ (../dataset-term-matcher.js, ../dataset-tools.js), so no dist/ is involved.

  • Per-term cap. Anchor if (++offered >= LIST_DATASETS_MAX_CANDIDATES_PER_TERM) break scan; replaced by ++offered;. On-disk proof: anchor x1 → x0, replacement x0 → x1, blob 85170dd7 → 85f8238f. Result: Tests 1 failed | 57 passed (58), and the failing test was findDatasetTermCandidates > offers at most 5 per term, the first in listing order, with no cut marker. Restored: blob equals HEAD (85170dd7) and git diff HEAD is empty.
  • A hit suppresses candidates. Anchor if (hit) continue; replaced by void hit;. On-disk proof: anchor x1 → x0, blob 85170dd7 → e597fc91. Result: Tests 5 failed | 53 passed (58). The failing tests were the matcher's "offers nothing for a term with a hit in ANY dataset" and all four [#34763] tests in dataset-tools.test.ts. Restored: blob equals HEAD, git diff HEAD is empty, and git status --porcelain is empty.

Acceptance notes

  • Live reading on the showcase (the card's acceptance), taken at 2926ce23. The server was booted with pnpm -C examples/app-showcase exec objectstack dev --fresh -p 38763 --no-watch, against the showcase closure built under the lock. The root pnpm dev refused because its prerequisite check wants every package built. An osk_ key was minted with POST /api/v1/keys as the seeded admin, then tools/call list_datasets was sent over HTTP MCP. Eight datasets were listed in each answer, and no answer was partial.

    terms ['invoice']     showcase_invoice_metrics.matches: []   no other entry has a match
                          candidates: [{term:'invoice', dataset:'showcase_invoice_metrics', member:'measures.invoice_count'},
                                       {term:'invoice', dataset:'showcase_invoice_metrics', member:'measures.paid_count'}]
    terms ['invoices']    showcase_invoice_metrics.matches: [{term:'invoices', member:'measures.invoice_count', matchedOn:'label'}]
                          candidates key: absent
    terms ['qa_no_word']  every entry's matches: []               candidates key: absent
    

    paid_count ("Paid Invoices") is offered beside invoice_count because its label contains invoice. The same boot served the new initialize rule and the new list_datasets description over tools/list, verbatim as in the source.

  • One candidate vs the skill's last row. The ADR-0149 D3 amendment note and the seat's route A say a term with candidates is asked about. The published skill's row "Nothing matches, and the listed measures do not offer several readings of the word" sends one near form to step 4 ("One near form is not a match either: it selects nothing"). For a term with exactly one candidate, the tool texts here say ask, and that row says fall back. Both texts agree that the candidate is never acted on; they differ only on whether to ask first. skills/** is outside this card. Seat 3 has since ruled that one candidate asks (see the ruling note below).

  • How broad near is, measured. Containment at two code points is wide on short ASCII terms. In the unit fixture, tot reaches margin_total ("margin total"), and a two-letter term reaches every target that contains it. The per-term cap of 5 bounds the list. I add no ranking because the spec forbids one.

  • The tool-table row for list_datasets in content/docs/ai/connect-mcp.mdx does not quote the rule, so it is left as it is (claim: those docs change only where they quote the rule).

Verification

Targeted gates (local), derived by dispatch-gates
  • node scripts/pm/dispatch-gates.mjs --commands (no paths) derived 100 families from the tree at 2926ce23. All 100 were run.
    • 98 exited 0 on the first pass.
    • pnpm --filter @objectstack/spec run check:skill-examples and pnpm check:dual-build-cjs-loads first exited 3 (PREREQUISITE NOT MET, no full build yet, so nothing was measured). After a full turbo run build under the lock, both exited 0 (347 prose examples type-check across 3 surface(s); dual-build floors held).
    • node scripts/pm/dispatch-gates.mjs --ran (with :: exit N records): ✓ 100 derived famil(ies) accounted for — 100 run, 0 NOT-MEASURED (a DERIVED zero — all 100 recorded an exit code and none of them is 3).
  • pnpm check:platform-checklist: check-platform-checklist: OK — 16 areas, 433 items.
  • node scripts/check-nul-bytes.mjs: OK.
  • node scripts/pm/check-governed-merges.mjs --branch: NOT governed, 494 changed lines (+466 / -28), under 3000. dispatch-gates --tier: no path-derived mandate.
  • node scripts/pm/overlap-check.mjs before every push. The first run was exit 1 against fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881 on the docblock (see What changes). After the docblock was left alone, every run was exit 0, the last one at 14bb6615.
  • Not run locally, left to CI: the repo-wide scans (pnpm lint), test:repo, the integration layers and dogfood. The title carries no ! and there is no (narrowing) arm, so no full dogfood run is owed.

Ruling note: one candidate asks

With a single candidate for a term, the tool description and the initialize rule say to ask, as the ADR-0149 D3 amendment note does ("With candidates, the AI asks in rule 3's form and acts on none"). This departs from seat 3's earlier ruling on #34792 (Q1 A, record 6945986942: one loose candidate falls back, labelled), which predates candidates. Seat 3 ruled on this PR that the ADR note outranks it. The published skill's row "One near form is not a match either: it selects nothing" is amended under #34868 to ask when list_datasets returns a candidate. The MCP pin is now folded into packages/mcp/src/mcp-dataset-tools.test.ts as a top-level describe (AGENTS.md ruling 6583487846); the separate file is deleted.

Follow-up round

After #34881 landed (c6ecd1fab8), this round did four things:

  • Merged origin/main (c81f498b5f) as merge 762b721b, with the trailers on the merge commit. It merged cleanly. fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881's changes to mcp-dataset-tools.test.ts, skill-md.ts and the DATASET_SELECTION_RULE docblock all came in as written.
  • Folded the MCP pin into packages/mcp/src/mcp-dataset-tools.test.ts as a top-level describe with the same 3 tests. It reuses the harness's makeBridge and callTool. packages/mcp/src/list-datasets-candidates-34763.test.ts is deleted, and the checklist's automated.ref no longer names it.
  • Updated the docblock. fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881's docblock above DATASET_SELECTION_RULE now also says:
    • two words with one measure match each are two metrics, both computed;
    • a word with candidates is the same question, listing label, dataset label and description, never a pick and never a match, even for a single candidate;
    • only a word with no match and no candidate falls back, labelled.
      The rule string itself is unchanged from the first round.
  • Checked that the merged tree agrees with "one candidate asks". I grepped for near form, selects nothing, loose form and single candidate across packages/mcp, service-analytics, skills/objectstack-ask and the docs. The only text that differs is the skill's row "One near form is not a match either: it selects nothing" in skills/objectstack-ask/SKILL.md and in the generated packages/mcp/src/ask-skill.generated.ts. Since fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881, that generated file is what the served /mcp/skill text is rendered from. This difference is expected until skills: the ask-data skill's zero-match row reads the candidates list once list_datasets fills it #34868 amends the skill. The tool description, the initialize rule, packages/mcp/README.md and content/docs/ai/connect-mcp.mdx all say to ask.
Follow-up runs at 883af46
  • Full turbo run build under the lock: VERDICT command-exit 0.
  • Under the lock, each exit echoed separately:
    • pnpm --filter @objectstack/service-analytics typecheck: exit 0.
    • pnpm --filter @objectstack/mcp typecheck: exit 0 (check:test-typecheck: OK — 6 file(s) / 53 error(s) / 8 pinned signature(s) held).
    • service-analytics vitest: Test Files 218 passed (218), Tests 5558 passed | 335 skipped (5893).
    • mcp vitest: Test Files 71 passed (71), Tests 1252 passed (1252).
  • mcp-dataset-tools.test.ts with the verbose reporter: Tests 25 passed (25), including the three [#34763] tests.
  • dispatch-gates --commands (no paths) at 883af46685 derived the same 100 families, and all 100 exited 0. --ran: 100 run, 0 NOT-MEASURED (a DERIVED zero).
  • check:platform-checklist: OK.
  • check-governed-merges --branch: NOT governed, 468 changed lines (+436 / -32).
  • overlap-check: exit 0 against origin/main c81f498b5f. It also checked docs(adr-0149): D3 rule 1 note — a member label matches as resolved along the caller's locale chain #34928, which shares dataset-term-matcher.ts, and merges cleanly.

Generated by Claude Code

…ed nothing

The near-term finder beside matchDatasetTerms (containment either way after
normalization, both sides at least two code points), over admitted members
only, run only for terms with no hit in any listed entry; the list_datasets
description and the MCP initialize selection rule learn the candidates row.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
…single-source change

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

12 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. ⚠️ 1 changed file(s) yielded no anchor (packages/mcp/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/mcp/README.md) — pages documenting those are invisible to this run
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 19 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 97c0e57e0497256db6f36da3c55bb6c5bbc33c6f — the merge of head 883af46685e88741f55ac36c67cad2c8159dcbd6 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 97c0e57e0497256db6f36da3c55bb6c5bbc33c6f && git checkout 97c0e57e0497256db6f36da3c55bb6c5bbc33c6f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c81f498b5f0614157864d9586da718dbe02121b1 883af46685e88741f55ac36c67cad2c8159dcbd6 && git checkout -B drift-repro c81f498b5f0614157864d9586da718dbe02121b1 && git merge --no-ff 883af46685e88741f55ac36c67cad2c8159dcbd6

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:13Z

Head-sha: 14bb661
Reviewer: seat 3 L1-c, for card #34763 (claim 6951477440; os-dev report 6952850821). This is the executor half of #34828's candidates shape.

席位核对

PR shape. Draft, base main, Fixes #34763. No other issue sits next to a closing verb. The body names #34868 as the carrier for the skill's one-near-form row.

Scope vs claim. Every path sits inside the claim:

  • packages/services/service-analytics/src/dataset-term-matcher.ts (findDatasetTermCandidates) and dataset-tools.ts;
  • LIST_DATASETS_DESCRIPTION and DATASET_SELECTION_RULE (mcp-server-runtime.ts);
  • packages/mcp/README.md and content/docs/ai/connect-mcp.mdx;
  • the ai.json checklist (rev 3);
  • tests and one changeset.

Declaration. Clause-②: no / Metadata-protocol: none, and they agree. The shape was published by #34828 at minor; this PR fills it, so @objectstack/service-analytics and @objectstack/mcp at patch are right.

Governed / size. NOT governed, 494 lines.

Check-runs at 14bb661. 59 runs, every one success or skipped: Lint & Repo Gates, TypeScript Type Check, Test Core and all 10 shards, Build Docs, Check Documentation Links, Flag docs affected by code changes, Spec property liveness, Check Changeset, PR-body guards, Governed Surface Queue Guard, Live E2E UI.

Against ADR-0149 D3 and its note (#34828).

  • Exact match stays the only hit. A term with any hit (matchedOn) gets no candidates.
  • A near form is containment either way after normalizeDatasetTerm, with a floor of DATASET_TERM_NEAR_MIN_CODE_POINTS = 2.
  • Candidates are offered, never selected. DATASET_SELECTION_RULE now says to ask about candidates (one or many), not to treat any as a match, and to fall back to rule 4 only when there are none. That is the note's reading, which the seat ruled outranks docs(skills): add objectstack-ask, a skill for answering business questions over MCP #34792 Q1 A.
  • candidates is set only when non-empty, so .min(1) holds.

#34828 N2's four executor invariants. All four are pinned:

  • the cap: 5 per term with break scan, and the ablation takes a sixth entry;
  • every {dataset, member} points at an entry listed in the same answer (listed is built from admitted members);
  • a matched term has no candidate;
  • order: measures before dimensions, in listing order.

Tests and live run. 6 matcher, 4 tools and 3 MCP cases (list-datasets-candidates-34763.test.ts), two ablations. The live showcase run gives invoice → invoice_count, paid_count.

Docblock. The DATASET_SELECTION_RULE docblock is left alone so this PR and #34881 merge cleanly (overlap-check exit 0 at 14bb6615). #34881's rewrite of it points at the skill, which is still right after this lands.

Tool text sizes. LIST_DATASETS_DESCRIPTION 1095 → 1414 bytes, DATASET_SELECTION_RULE 453 → 741 bytes. Acceptable for the rule they now carry.

Must-fix

None.

Should-fix

None.

Notes

Next: o3-E folds the MCP pin into mcp-dataset-tools.test.ts after #34881 merges. That push owes an L1-c delta read at the final head before landing. No seat L2 is owed.

…s harness; the rule's docblock names candidates

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

Copy link
Copy Markdown
Contributor Author

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

L1: ACCEPT (delta, final head) · 2026-11-17T19:03Z

Head-sha: 883af46
Reviewer: seat 3 L1-c. This is a delta read of 14bb6615..883af466 against my 6953727363, the final-head read I owed after the MCP pin fold (os-dev report 6957909999).

席位核对

Delta. Two first-parent commits:

  • 762b721b is a merge of main at c81f498b, which includes fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881 (c6ecd1fa). Its first parent is my ACCEPTed head. The patch-id of the PR's diff from the merge-base to 14bb6615 equals the patch-id of the diff from c81f498b to 762b721b, so the merge adds nothing and resolved no conflicts.
  • 883af466 touches four paths, +85/-119:
    • The pin fold. list-datasets-candidates-34763.test.ts is deleted, and its three cases become a top-level describe('[#34763] …') in mcp-dataset-tools.test.ts, using that harness's own bridge and call helper. The cases are the same: the fixtures parse under ListDatasetsOutputSchema; candidates pass through with the same entries, in the same order and with nothing added; an answer without the key comes back without it. They assert the same things (the bridge-call assertion now reads the harness's calls log). This follows the AGENTS.md ruling 6583487846 the body cites.
    • The checklist. ai.json automated.ref drops the deleted file and keeps the others.
    • The docblock. The DATASET_SELECTION_RULE docblock now describes the candidates row (ask even for a single candidate, never a pick and never a match, and fall back only with no match and no candidate) and the two-metrics row. The rule string itself is byte-unchanged. That is the right place for it now that fix(mcp): render the /mcp/skill data loop from the published objectstack-ask skill #34881 has landed the rewrite this PR had avoided touching.

Gates. Not governed, 468 lines. CI at the report: 40 success, none failed, with two re-runs pending after a body edit. This verdict holds on the condition that Lint & Repo Gates, TypeScript Type Check and Test Core finish green on this head.

My earlier notes. N1 to N3 stand as they were (none were owed). N4, the window in which the served skill text says "one near form selects nothing" while the tool texts ask on any candidate, is now open on main once this lands. The body records it and names #34868 as the carrier. Land #34868 close behind.

Must-fix

None.

Should-fix

None.

Notes

None new.

Next: o3-E lands once the three aggregates are green. #34868 follows to close the skill-versus-tool window. No seat L2 is owed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing · 2026-11-17T19:04Z

Probe Reading
Governed check-governed-merges.mjs --pr 34904: NOT governed, 468 changed lines
Head 883af46685e88741f55ac36c67cad2c8159dcbd6, 6 first-parent commits behind main (under 15, no merge). It includes the clean merge 762b721b of main with #34881
Review L1-c ACCEPT 6953727363 at 14bb6615. Final-head delta ACCEPT 6957974716 at 883af466: the MCP pin is folded into mcp-dataset-tools.test.ts, and the docblock describes candidates. No L2 owed (seat). Claim 6951477440
Checks All 59 check-runs on 883af466 succeeded or were skipped
Rulings One candidate asks (seat Q1 A; the ADR-0149 D3 note outranks #34792 Q1 A). The skill row that still sends one near form to the fallback is fixed by #34868, which follows close behind

State: ready + auto-merge armed. Fixes #34763.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service-analytics: list_datasets fills candidates with near members (name, label, synonym) on a zero-match, only from what the caller may read

2 participants