Skip to content

Commit 38ab473

Browse files
docs(skills): objectstack-ask answers a word that names the field a filtered measure aggregates from that field (ADR-0149 D3 note of 2026-12-01) (#38915)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBG4YD4RMAt72Ga5PdYYZDAQ)_ Fixes #38870 Clause-②: no Metadata-protocol: none ## 维护者速读 - 通过 MCP 连到环境来问数的 AI 客户端会读我们对外发布的「问数」技能:用户说的词正好是某个带筛选条件的指标所汇总的字段时(例如「工时」对「计费工时」),技能原先教它反问,现在教它直接按该字段回答、注明非指标口径、顺带提一句那个更窄的指标,和服务端已上线的行为一致。 - 属于「AI 通过数据集语义层回答业务问题」这条线:服务端规则已随上一个改动合并,这次让发给客户的技能文本跟上,避免技能和工具说明各说一套。 - 若措辞有误,最坏是某个 AI 在本该反问时直接按字段回答(或反过来);不带筛选的指标、跨关联路径的字段、一个词同时指向不同字段,这三种情况技能里仍写明照旧反问;只改文字和由它生成的技能页,不涉及数据和元数据格式,可整体撤回。 - 这是对外发布的技能文本,需要你批准后才能合并;其中技能长度上限按实测上调了 167 个计数单位(先删掉了一处重复说法)。 ## What changes PR #38869 made `list_datasets` stop offering, for a word, a measure that carries a `filter` and aggregates a field the word names (ADR-0149 D3, the amendment note of 2026-12-01; ruling record 7301332152). The two tool texts say so; the published `objectstack-ask` skill still said every measure candidate is asked about. This PR brings the skill to the tool texts, in their words. No code path changes. - **`skills/objectstack-ask/SKILL.md`, step 1.** One new bullet under the `candidates` bullet: a measure that carries a filter and aggregates a field the word names (the word equals or is inside the field's label or name; the name only where the host reads no field labels) is not offered for that word. A measure with no filter or over a relationship path is offered as before, and so is every measure when the word names different fields through different candidates. - **Step 2 table.** One new row after the `candidates` row: for a word that names the field a filtered measure aggregates, `nextStep.note` names the field; the client does not ask about that measure, answers from the field (step 4, the labelled fallback) and mentions the measure as a narrower declared metric. Another measure candidate left for the word is asked about first, and the field then answers only if the question settles nothing. - **Paid down first.** The listing instruction was written twice: in the several-measures row ("List each candidate's label, its dataset's label and its description.") and in the paragraph under the table (": name each option by its label in a bullet, and quote its description as written"). It keeps one home, the row, which now reads "List each candidate's label, its dataset's label and its description as written, one bullet each." The paragraph's half is deleted. The `candidates` row's "Ask the same way" still points at that row. - **Step 4 is unchanged.** The card also names the last two step 4 bullets. They were read and left: "Open the answer with one line saying it is not from a governed metric" is the label the new row sends the reader to, and the line about a dataset on the fallback object is the recommended line the ADR note says "is unchanged and stays recommended practice". - **`skills/objectstack-ask/evals/metric-selection-fallback.json`.** Two cases added (ids 26 and 27), both with the `nextStep.note` in the executor's own zh-Hans sentences. 26: 「工时」 beside the filtered measure 计费工时 over the field 工时, `no_measure`, no `candidates`: the field answers through `describe_object` and `aggregate_records`, labelled 非指标口径, the measure mentioned, no question and no dataset query. 27: 「销售」 beside 销售额 over the field 金额, `candidates_only`: still a question, nothing computed. Case 17 (the English "sales" near-miss) is untouched. - **`packages/mcp/src/ask-skill.generated.ts`.** Regenerated by `node scripts/gen-mcp-ask-skill.mjs`; not hand-edited. - **`scripts/check-skills-token-ratchet.mjs`.** The `objectstack-ask` row moves 1873 to 2040, with the comment pattern of the rows above it. No other row moves. - **Changeset.** `.changeset/38870-ask-skill-field-term.md`, `patch` on `@objectstack/skills` and `@objectstack/mcp` (the served `GET /mcp/skill` page ships in the mcp `dist`). ### The skill's rule against the tool texts, clause by clause Sources at this head: `LIST_DATASETS_DESCRIPTION` is in `packages/services/service-analytics/src/dataset-tools.ts` (its field sentence is `DATASET_FIELD_TERM_SENTENCE`, lines 115-118, joined at line 135); the `candidates` description is `packages/spec/src/ai/dataset-tools.zod.ts` lines 325-341; `DATASET_SELECTION_RULE` is `packages/mcp/src/mcp-server-runtime.ts` lines 1908-1925. | Clause | Skill (`SKILL.md` line) | Source | |:--|:--|:--| | A measure that carries a filter and aggregates a field the word names is not offered for that word | 49-51 | spec `candidates` 329-330: "A measure that carries a filter and whose aggregated field the term names ... is not offered for that term" | | "Names" means the word equals or is inside the field's label or name | 49-50 | `dataset-tools.ts` 116-117 and `mcp-server-runtime.ts` 1919-1920: "it equals or is inside that field's label or name"; spec 329-330 | | A host that reads no field labels tests the name only | 50-51 | `dataset-tools.ts` 135: "A host that reads no field labels tests the field name only." | | A measure with no filter is offered as before | 51-52 | spec 333: "a measure with no filter is offered as before" | | A measure over a relationship path is offered as before | 52 | not in either tool text; ADR-0149 D3 note of 2026-12-01, second point (`docs/adr/0149-...md` line 206): "A measure whose `field` is a relationship path is not tested: it stays offered and asked about, as before." | | Every measure is offered when the word names different fields through different candidates | 52-53 | spec 332-333: "Such a measure is still offered when the term names different fields through different candidates" | | `nextStep.note` names the field | 64, left cell | spec 331: "`nextStep.note` names the field and mentions the measure as a narrower declared metric" | | The word is not asked about for that measure | 64 | `dataset-tools.ts` 117 and `mcp-server-runtime.ts` 1920: "is not asked about for that measure" | | The field answers it under the labelled fallback | 64 ("answer from the field (step 4)"; step 4 opens the answer with the 非指标口径 line) | `dataset-tools.ts` 117-118 and `mcp-server-runtime.ts` 1920-1921: "the field answers it through the object query tools, labelled as not from a governed metric" | | The measure is mentioned as a narrower declared metric | 64 | `dataset-tools.ts` 118 and `mcp-server-runtime.ts` 1921: "the measure is mentioned as a narrower declared metric" | | Another measure candidate left for the word is asked about first; the field answers only if the question settles nothing | 64 | spec 333-335: "with another measure candidate left for the term, that one is asked about first and the field answers only if the question settles nothing" | Not restated, on purpose: "its dataset's entry still lists it" (spec 332), which changes nothing a client does. The tool texts say "the field"; the dispatch text said "base field". The skill uses the tool texts' word and states the relationship-path case once, so the two do not say one thing twice. ### Skill size (ruling record 6513306068) Raise path the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B): the deletion of restatement in the same file is the listing instruction above. | Reading | Before (`origin/main` ac97540) | After (fcdacb2) | |:--|--:|--:| | `skills/objectstack-ask/SKILL.md`, lines | 127 | 132 | | `skills/objectstack-ask/SKILL.md`, bytes | 7516 | 8185 | | same file, ratchet tokens (27-byte stamp line unpriced) | 1873 | 2040 | | all 14 `skills/*/SKILL.md`, lines | 2475 | 2480 | | ratcheted bundle total, tokens | 186955 | 187122 | Bytes by part: step 1 bullet +385, step 2 row +337, the row that keeps the listing +28, the paragraph's half -81; net +669. `ceil((8185 - 27) / 4) = ceil(8158 / 4) = 2040` (+167), pinned at the measurement, zero headroom. Eval fixtures are measured and not ratcheted: the eval file goes 39453 to 43750 bytes. ## Tests All at fcdacb2, heavy runs under `os-verify-lock.sh`. - `pnpm --filter @objectstack/mcp test`: 89 files, 1669 tests passed (it holds the generated module and the served `GET /mcp/skill` section byte-equal to the skill, `skill-single-source-34686.test.ts`). - `pnpm --filter @objectstack/mcp typecheck`: exit 0. - `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 scripts/platform-catalog.test.ts src/shared/retired-key-migrate-sentence.test.ts scripts/export-list.test.ts` (the spec tests that read `skills/**` or name the ratchet script): 3 files, 44 tests passed. - `skill-evals --dry-run --skills objectstack-ask` parses the catalog: 27 behaviour cases and 7 trigger cases; no model was called. - No pin test reads the changed sentences' content, so none was updated. The one test that reads the skill text is the byte-equality pin above. <details><summary>Ablation: the new step 2 row deleted on disk, then restored</summary> `node scripts/ablation-replace.mjs --file skills/objectstack-ask/SKILL.md --anchor (the new row) --delete`, mutation proven on disk (anchor 1 to 0, blob cd96e31 to 68662b5d305c), three checks read on the mutated tree: - `node scripts/gen-mcp-ask-skill.mjs --check`: exit 1, "ask-skill.generated.ts is stale against skills/objectstack-ask/SKILL.md". - `node scripts/check-skills-token-ratchet.mjs`: exit 1, "is 1956 tokens; its ratchet ceiling is 2040, above the measurement by 84". - `vitest run src/skill-single-source-34686.test.ts` (mcp): 2 failed, 1 passed ("the generated module equals the skill's data loop", "the served section equals the skill's data loop"). Restored: blob equals HEAD (cd96e31), `git diff HEAD` empty, `git status --porcelain` empty; the three checks re-run green (exit 0, exit 0, 3 passed). What this shows and what it does not: the three checks hold the generated page and the row's price to the skill. None of them reads what the sentence says. The check that would is the model eval (cases 26 and 27), and it was not run: NOT MEASURED: skill evals, reason: a model round is the eval seat's, not a local gate. </details> ## Acceptance notes - `LIST_DATASETS_DESCRIPTION` lives in `packages/services/service-analytics/src/dataset-tools.ts`, not in the spec file; the spec file holds the `candidates` description. Both were read as sources. - The eval file had no 销售 / 销售额 case before this PR; the near-miss that asks was case 17, in English ("sales" near Sales Amount). Case 17 is kept as it was and case 27 adds the Chinese pair from the ADR note. - The catalogue lists no `field` and no `filter` for a measure, so a client cannot test the rule itself: what it sees is the measure missing from `candidates` and the field named in `nextStep.note`. The step 2 row is keyed on that. - Local gates: `dispatch-gates.mjs --commands` derived 91 families at fcdacb2; `--ran`: 91 accounted for, 88 run and exit 0, 3 NOT-MEASURED, 0 unrun. The three: `node scripts/check-plugin-teardown-shape.mjs --self-test` (exit 3, its pinned fixture commit is outside this shallow clone), `pnpm check:dual-build-cjs-loads` (exit 3, needs a whole-repo build), `pnpm check:pm-dispatch-gates` (my own `timeout` fired, exit 124, at 560 s alone in the foreground; no verdict). All three are left to CI; this diff touches none of their inputs. - Run beyond the derived set, each exit 0: `node scripts/gen-mcp-ask-skill.mjs --check`, `pnpm check:pm-skill-ratchet`, `pnpm --filter @objectstack/spec run check:skill-examples` (341 examples), `check:skill-refs`, `check:skill-served-sections`, `pnpm --filter @objectstack/skills build`, `node scripts/check-platform-checklist.mjs --changed-from origin/main` (0 anchored files in the change set). ## Verification Read first, by risk: 1. `skills/objectstack-ask/SKILL.md`: the new step 2 row (line 64) and the new step 1 bullet (lines 49-53), against the table above; then the listing instruction's move (line 62 and the paragraph at lines 75-78), which is the deletion the ratchet raise rests on. 2. `scripts/check-skills-token-ratchet.mjs`: the `objectstack-ask` row and its comment, the only row touched. 3. `skills/objectstack-ask/evals/metric-selection-fallback.json`: cases 26 and 27, their `must_contain` and `must_not_contain` tokens. Two-minute check: `node scripts/gen-mcp-ask-skill.mjs --check && node scripts/check-skills-token-ratchet.mjs` prints "is current with skills/objectstack-ask/SKILL.md" and "skills/objectstack-ask/SKILL.md is 2040 tokens (ceiling 2040; headroom 0)". Signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1e1cacb commit 38ab473

5 files changed

Lines changed: 77 additions & 11 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/mcp': patch
4+
---
5+
6+
docs(skills): the `objectstack-ask` skill says a word that names the field a filtered measure aggregates is answered from that field, not asked about
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, now state the rule `list_datasets`' description and the MCP `initialize` selection rule already carry (ADR-0149 D3, the amendment note of 2026-12-01). Step 1: a measure that carries a filter and aggregates a field the word names (the word equals or is inside the field's label or name; the name only where the host reads no field labels) is not offered for that word among `candidates`. A measure with no filter, or over a relationship path, is offered as before, and so is every measure when the word names different fields through different candidates. Step 2 has one new row: for such a word `nextStep.note` names the field, the client does not ask about that measure, answers from the field under the labelled fallback (step 4) and mentions the measure as a narrower declared metric; another measure candidate left for the word is asked about first, and the field then answers only if that question settles nothing.
12+
13+
The instruction to list each candidate's label, its dataset's label and its description was written twice, in the several-measures row and in the paragraph under the table. It now has one home, the row, which also says "as written, one bullet each". `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes.

‎packages/mcp/src/ask-skill.generated.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const ASK_SKILL_DATA_LOOP: string = [
3131
' never by similarity.',
3232
'- A word that matched nothing may have `candidates`: members offered as',
3333
' possible readings. A candidate is not a match.',
34+
'- A measure that carries a filter and aggregates a field the word names (the',
35+
' word equals or is inside the field\'s label or name; the name only where the',
36+
' host reads no field labels) is not offered for that word. A measure with no',
37+
' filter or over a relationship path is offered as before, and so is every',
38+
' measure when the word names different fields through different candidates.',
3439
'- No `list_datasets` among your tools: this environment serves you no governed',
3540
' metrics. Go to step 4.',
3641
'',
@@ -39,8 +44,9 @@ export const ASK_SKILL_DATA_LOOP: string = [
3944
'| What the answer shows | What you do |',
4045
'|:--|:--|',
4146
'| Each word for a thing measured matches exactly one measure | Compute: step 3. Two words with one measure each ("营收和赢单率") are two metrics, not a choice: compute both, with one `query_dataset` per dataset. |',
42-
'| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate\'s label, its dataset\'s label and its description. Do not pick one. |',
47+
'| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate\'s label, its dataset\'s label and its description as written, one bullet each. Do not pick one. |',
4348
'| A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. |',
49+
'| A word that names the field a filtered measure aggregates (`nextStep.note` names the field) | Do not ask about that measure: answer from the field (step 4) and mention the measure as a narrower declared metric. Ask first about another measure candidate left for the word; the field then answers only if the question settles nothing. |',
4450
'| A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. |',
4551
'| No word for a thing measured, only grouping or filter words | A grouping is not a number: ask which number is meant. |',
4652
'| No match and no candidates for the word for a thing measured | Step 4, without asking: a grouping word\'s match, or another word\'s, is no reason to ask. |',
@@ -52,10 +58,9 @@ export const ASK_SKILL_DATA_LOOP: string = [
5258
'one measure and ask about a word, do both.',
5359
'',
5460
'When you only ask, the reply is the question alone: no tool call until the user',
55-
'answers. State no figure of your own in it (no count, total',
56-
'or option number): name each option by its label in a bullet, and quote its',
57-
'description as written. `partial: true` on the answer means the catalogue may',
58-
'be incomplete; `warning` says why, and you repeat it when you fall back.',
61+
'answers. State no figure of your own in it (no count, total or option number).',
62+
'`partial: true` on the answer means the catalogue may be incomplete; `warning`',
63+
'says why, and you repeat it when you fall back.',
5964
'',
6065
'Use an option only once the user picks it: compute it by its exact name',
6166
'(step 3). Another word starts at step 1; if they only pick none, go to step 4.',

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,29 @@ export const CEILINGS = new Map([
29312931
// measurement, shrink-only, no ruling needed. 7516 bytes less the 27-byte
29322932
// stamp line:
29332933
// ceil(($(wc -c < skills/objectstack-ask/SKILL.md) - 27) / 4) == ceil(7489 / 4)
2934-
['skills/objectstack-ask/SKILL.md', 1873], // -2 to the measurement (was 1875)
2934+
// = 1873 (-2, was 1875).
2935+
// 1873 -> 2040, the card that brings steps 1 and 2 to the ADR-0149 D3
2936+
// amendment note of 2026-12-01 (ruling record 7301332152), in the words
2937+
// `list_datasets`' description and the `initialize` selection rule carry: a
2938+
// measure that carries a filter and aggregates a field the word names is not
2939+
// offered for that word, the field answers it (step 4) and the measure is
2940+
// mentioned as a narrower declared metric; and, once each, what is offered
2941+
// as before (no filter, a relationship path, a word naming different fields
2942+
// through different candidates), that another measure candidate left is
2943+
// asked about first, and that a host reading no field labels tests the name
2944+
// only. One step 1 bullet (+385 bytes) and one step 2 row (+337). Raise path
2945+
// the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
2946+
// letter B). PAID DOWN FIRST — the listing instruction was said twice, in the
2947+
// several-measures row ("List each candidate's label, its dataset's label
2948+
// and its description.") and in the paragraph under the table (": name each
2949+
// option by its label in a bullet, and quote its description as written").
2950+
// It keeps one home, the row, which gains " as written, one bullet each"
2951+
// (+28); the paragraph's half is cut (-81). Net +669: 7516 -> 8185 bytes,
2952+
// less the 27-byte stamp line:
2953+
// ceil(($(wc -c < skills/objectstack-ask/SKILL.md) - 27) / 4) == ceil(8158 / 4)
2954+
// = 2040 (+167), the measured remainder only. Pinned AT the measurement, zero
2955+
// headroom; no other row moves.
2956+
['skills/objectstack-ask/SKILL.md', 2040],
29352957

29362958
// ── the objectstack-mcp-build skill joins the catalog — ruling #34691 S3 = A ──
29372959
// (decision record: comment 6943107981 on #34691, "one copy of the shape

‎skills/objectstack-ask/SKILL.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ wrote its business definition) outranks a number you work out yourself.
4646
never by similarity.
4747
- A word that matched nothing may have `candidates`: members offered as
4848
possible readings. A candidate is not a match.
49+
- A measure that carries a filter and aggregates a field the word names (the
50+
word equals or is inside the field's label or name; the name only where the
51+
host reads no field labels) is not offered for that word. A measure with no
52+
filter or over a relationship path is offered as before, and so is every
53+
measure when the word names different fields through different candidates.
4954
- No `list_datasets` among your tools: this environment serves you no governed
5055
metrics. Go to step 4.
5156

@@ -54,8 +59,9 @@ wrote its business definition) outranks a number you work out yourself.
5459
| What the answer shows | What you do |
5560
|:--|:--|
5661
| Each word for a thing measured matches exactly one measure | Compute: step 3. Two words with one measure each ("营收和赢单率") are two metrics, not a choice: compute both, with one `query_dataset` per dataset. |
57-
| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate's label, its dataset's label and its description. Do not pick one. |
62+
| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate's label, its dataset's label and its description as written, one bullet each. Do not pick one. |
5863
| A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. |
64+
| A word that names the field a filtered measure aggregates (`nextStep.note` names the field) | Do not ask about that measure: answer from the field (step 4) and mention the measure as a narrower declared metric. Ask first about another measure candidate left for the word; the field then answers only if the question settles nothing. |
5965
| A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. |
6066
| No word for a thing measured, only grouping or filter words | A grouping is not a number: ask which number is meant. |
6167
| No match and no candidates for the word for a thing measured | Step 4, without asking: a grouping word's match, or another word's, is no reason to ask. |
@@ -67,10 +73,9 @@ word it asks about that you cut from a phrase or reworded is no question: call
6773
one measure and ask about a word, do both.
6874

6975
When you only ask, the reply is the question alone: no tool call until the user
70-
answers. State no figure of your own in it (no count, total
71-
or option number): name each option by its label in a bullet, and quote its
72-
description as written. `partial: true` on the answer means the catalogue may
73-
be incomplete; `warning` says why, and you repeat it when you fall back.
76+
answers. State no figure of your own in it (no count, total or option number).
77+
`partial: true` on the answer means the catalogue may be incomplete; `warning`
78+
says why, and you repeat it when you fall back.
7479

7580
Use an option only once the user picks it: compute it by its exact name
7681
(step 3). Another word starts at step 1; if they only pick none, go to step 4.

‎skills/objectstack-ask/evals/metric-selection-fallback.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,27 @@
250250
"must_contain": ["list_datasets", "number of claims"],
251251
"must_not_contain": ["Do you mean", "do you mean", "describe_object(", "aggregate_records(", "query_records("]
252252
}
253+
},
254+
{
255+
"id": 26,
256+
"prompt": "用户问:「上个月的工时一共多少?」 You called `list_datasets({ terms: ['工时'] })`. The answer lists one dataset, `timesheets` (label 工时分析, `object: 'timesheet'`), with `matches: []`; its one measure is `billable_hours`, labelled 计费工时 and described as \"可计费工时的合计\". The answer has no `candidates`. Its `nextStep` has `decision: 'no_measure'`, `terms: ['工时']` and this `note`: 「工时」指的是字段 工时(对象 \"timesheet\"、字段 \"hours\"):按这个字段回答,不要反问。在回答中提一句 计费工时(数据集:工时分析) 是基于该字段、口径更窄的已声明指标;不要计算它。改用对象查询工具(query_records、aggregate_records)回答,并在回答中注明未使用治理指标(非指标口径)。 `list_objects` shows `timesheet`. What do you do next, and how does the answer open?",
257+
"expected_output": "工时 names the field a filtered measure aggregates: 计费工时 sums the field 工时 (`hours`) under a filter, so it is not offered for the word (the answer has no `candidates`), and the `note` names the field. Nothing is asked: there is no question about whether 计费工时 is meant. The field answers the word under the fallback: calls `describe_object({ objectName: 'timesheet' })` and reads the fields, then `aggregate_records` once for the sum of `hours` over last month, instead of paging `query_records`. Opens the answer, in Chinese, with one line saying it is not from a governed metric (非指标口径) and names the object and the 工时 field it computed from, and states the month it filtered to in words. It mentions 计费工时 (数据集:工时分析) as a narrower declared metric over the same field, so the user can ask for that figure, and does not compute it: no dataset query is made.",
258+
"files": [],
259+
"assertions": {
260+
"must_contain": ["describe_object", "aggregate_records", "非指标口径", "计费工时"],
261+
"must_not_contain": ["query_dataset(", "你是指", "您是指"]
262+
}
263+
},
264+
{
265+
"id": 27,
266+
"prompt": "用户问:「本月销售是多少?」 You called `list_datasets({ terms: ['销售'] })`. The answer lists one dataset, `sales` (label 销售分析, `object: 'sales_order'`), with `matches: []`; its one measure is `sales_amount`, labelled 销售额 and described as \"已赢单订单的金额合计\". The answer carries `candidates: [{ term: '销售', dataset: 'sales', member: 'measures.sales_amount' }]`. Its `nextStep` has `decision: 'candidates_only'`, `terms: ['销售']` and this `note`: 「销售」没有精确匹配任何成员,可能指的是:销售额(数据集:销售分析)。先逐个对照用户的问题:如果某个词是你从用户写的更长词组里截出来的,或是你改写过的,就不要就它提问,改用用户原话里的完整词组(不是整句问题)再调用一次 list_datasets。如果这个词就是用户的原话,先问用户指的是哪一个,列出每一个的名称、所属数据集名称和说明(只有一个时,问是不是它);不要替用户选,也不要把它当作匹配,用户回答前不要计算。 `list_objects` shows `sales_order`. What is your reply?",
267+
"expected_output": "销售 is the user's own word, it matches nothing, and a measure is among its candidates, so it is asked about. The word names no field that measure aggregates (销售额 sums the field 金额, and 销售 is not inside that field's label or name), so the measure is still offered and the `note` names no field: this is not the case where a field answers. The reply is a question and nothing else, in Chinese, asking whether 销售额 is the one meant, naming its label, its dataset's label (销售分析) and its description as written, not its machine name. It does not pick the candidate, states no figure, makes no tool call until the user answers, and does not fall back to the object tools.",
268+
"files": [],
269+
"assertions": {
270+
"must_contain": ["销售额", "销售分析"],
271+
"must_contain_any": [["?", "?"]],
272+
"must_not_contain": ["query_dataset(", "aggregate_records(", "sales_amount", "非指标口径"]
273+
}
253274
}
254275
]
255276
}

0 commit comments

Comments
 (0)