Skip to content

Commit 3b4ffb2

Browse files
docs(skills): objectstack-ask iteration 2: trigger on every records question, ask back with no figure of its own, whole terms, hidden record kinds declined (#35038)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_ Part of #34996 Clause-②: no Metadata-protocol: none Served-tier: TIER_DEFAULT ## 维护者速读 - 改了什么:`objectstack-ask` 技能(及由它生成的 `GET /mcp/skill` 页面)四处措辞:凡用应用记录回答的问题都先加载本技能(含「一共」「so far」);术语按用户原名词短语整段传;反问不写自己的数字(计数、合计、选项编号),选项按标签列出、描述原文引用;看不到的记录类型直接说明看不到,不拿关联对象顶替。 - 为什么改:问数迭代环第一组「保留」改动,travel_expense 问数轮实测 datasets 17/25 → 25/25,问数 25/25 不变,泄漏 0。 - 风险与回滚:只动发布技能文本与其生成副本,无代码路径变化;token 天花板按裁决「A:先削重复,余额按实测提高」先削两句重复再按实测抬 1491 → 1740;回滚即 revert 本 PR。 - 先看:`skills/objectstack-ask/SKILL.md`(第 2 步表格下的反问段与第 4 步首条)、`scripts/check-skills-token-ratchet.mjs`(抬升行与注释)、`skills/objectstack-ask/evals/metric-selection-fallback.json`(新增 10、11 号用例)。 - 两分钟验证:`node scripts/check-skills-token-ratchet.mjs && node scripts/gen-mcp-ask-skill.mjs --check`,预期两者均以 0 退出,ask 技能读数 1740 / 1740。 - 需要你做的:Tier H 落地需维护者批准(或 GOVERNED_APPROVERS 的 APPROVED 审核)后由席位落地。 ## What changes `skills/objectstack-ask/SKILL.md` takes the measured iteration-2 text (`/mnt/project-files/issue-34869/skill-iter/iter2/SKILL.v2.md`), applied as its diff onto current `main` (the file is byte-identical to its state at `99bd2203`, so the patch applied unchanged; the result was byte-identical to `SKILL.v2.md` before the cuts below): - (a) The description triggers on EVERY question answered from the app's records, before the first data tool call, even one that names no metric: "what has been claimed, spent, sold or paid so far", with "how much", "so far" and 「一共」 added to the trigger words. - (b) An asked-back reply states no figure of its own (no count, total or option number): each option is named by its label in a bullet and its description is quoted as written; it asks only about matches or candidates for the user's own words, and a word with no match and no candidates goes to step 4 instead. (L1 should-fix S1, head `b431dc04`: the measured text said "without any numerals at all ... leave out counts, dates and years", which forbade quoting a description that carries a date or a number; narrowed to the figure the reply would add, measured as iteration 6 below, same token count. Follow-up `32ba36e0` (L1 S1′) brings the changeset, eval 10's expected output and the ceiling comment (6979 / 6959 bytes) in line; no skill or ceiling change.) - (c) A `list_datasets` term is the user's noun phrase kept whole ("travel budget", not "travel" and "budget") and without verbs, time words and question words ("trip days", not "trip days requested"). - (d) Step 4 opens with: a record kind no listed object or dataset shows is declined (it may be hidden), never answered from a different object that merely links to it. Token ratchet, raise path the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN FIRST, two restatements cut from step 2's `candidates` row, each keeping its other home: | Cut | Surviving home | |:--|:--| | ", and never treat a candidate as a match" | step 1: "A candidate is not a match." | | "Compute nothing yet." | the paragraph under the table: "no figure, and no tool call until the user answers" | These two cuts are the only wording outside the measured text, forced by the ratchet. The area measured the text with the cuts as iteration 5: same scores as v2's rounds (the candidates row the cuts touch is the one `dq_claimed_so_far` exercises, 5/5). Arithmetic in priced bytes (20-byte stamp line excluded): the text adds 1057 bytes, the cuts remove 61, and the reviewed narrowing of the ask-back sentence (S1, `b431dc04`) adds 2: 5961 -> 6959 priced bytes (file 6979 bytes), `ceil(6959 / 4) = 1740`; the row moves 1491 -> 1740 (+249), the measured remainder only, pinned AT the measurement, zero headroom; no other row moves. Also in the diff: - `packages/mcp/src/ask-skill.generated.ts` regenerated with `node scripts/gen-mcp-ask-skill.mjs` (never hand-edited); `content/docs/ai/skills-reference.mdx` regenerated with `pnpm --filter @objectstack/spec gen:skill-docs`. - Two eval cases in the file's existing shape: id 10, "What has been claimed so far?" (asked back on a lone candidate, with no figure of its own and the description quoted as written), and id 11, a trip-request count where no listed object is a trip request (declined, not counted through the `trip_request` lookup on `expense_claim`). - `.changeset/34996-ask-skill-iter-2.md`: `@objectstack/skills` and `@objectstack/mcp` patch, as the earlier ask-skill PRs did. ## Measurements travel_expense ask mode, with-skill only, 5 reps, template `b7ab31a7`, the model and medium effort the round record names, subscription login, `--packages workspace` at main `99bd2203` (the published 18.5.0 door serves no `list_datasets` `candidates`), grader before the ordinal/date grader change of #34997. Records under `/mnt/project-files/issue-34869/skill-iter/`, logged on #34869. | Iteration | Text | 问数 | datasets | metric-selected | asked-back | fallback-labelled | ops runnable | leaks | |:--|:--|:--|:--|:--|:--|:--|:--|:--| | 0 | main skill unchanged | 25/25 | 17/25 | 10/10 | 3/10 | 4/5 | 2/3 | 0 | | 1 | a-d, whole-phrase wording | 25/25 | 24/25 | 9/10 | 10/10 | 5/5 | 2/3 | 0 | | 2 | v2 (measured text, before the ratchet cuts) | 25/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/3 | 0 | | 3 | v2 again (noise check) | 24/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/3 | 0 | | 5 | v2 with the two ratchet cuts (head `7f6156c2`) | 24/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/3 | 0 | | 6 | **this PR's exact text** (head `b431dc04`: iteration 5 with the narrowed ask-back sentence), grader rev 2 (live run on #35023's head `090a48eb`, the merged code) | 25/25 | 24/25 | 10/10 | 9/10 | 5/5 | 2/3 | 0 | Iteration 6 ran live on #35023's head `090a48eb`, the code that merged as `339c2f42`, so its graders are rev 2; the score equals iteration 5 overall. Its one datasets miss is `dq_travel_spend` rep 3: the reply asks back correctly (lists both spend measures, no figure, 「…我不替你选,请确认你要哪一个:」) but `asked-back:asks` accepts `请确认` only at the start of the text or after `.。!!` or a newline, not after a full-width comma, so it reads as not asking. That is a grader false negative, filed as #35058, not a skill miss. **Regraded on grader rev 2.** Every recording above replayed on main's grader after #35023 merged (`--driver recorded:`, same turns and same replies, only the grade changes; build worktree `090a48eb`, records under `iterN/regrade-rev2/`): | Iteration | 问数 | datasets | metric-selected | asked-back rev 2 | fallback-labelled | ops (replay) | |:--|:--|:--|:--|:--|:--|:--| | 0 | 25/25 | 19/25 | 10/10 | 5/10 | 4/5 | 2/2 measured, 4 not measured | | 1 | 25/25 | 24/25 | 9/10 | 10/10 | 5/5 | 2/2 measured, 4 not measured | | 2 | 25/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/2 measured, 4 not measured | | 3 | 24/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/2 measured, 4 not measured | | 4 (v3, not kept) | 25/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/2 measured, 4 not measured | | 5 | 24/25 | 25/25 | 10/10 | 10/10 | 5/5 | 2/2 measured, 4 not measured | | 6 (live, rev 2) | 25/25 | 24/25 | 10/10 | 9/10 (#35058) | 5/5 | live 2/3 | On rev 2 the baseline's asked-back reads 5/10 (was 3/10: `dq_claimed_so_far` rep 2 and `dq_travel_spend` rep 1 were failed only for option numbers, "1" and "1, 2, 3", which the old grader counted as figures), so the kept change set moves datasets 19/25 -> 25/25 and asked-back 5/10 -> 10/10. Iteration 4's v3 regrades from 24/25 to 25/25, a tie with v2, so it stays not kept. The replay's operation column counts only the operations whose recorded writes replay; a filing's later turns name a row the replay created, which #35048 fixes, so the live column (2/3, the submit defect below) stays the operation score. The operation miss is `file_and_submit_from_text`: on workspace packages the filing applies, then the build's own `demotravel_submit_claim` answers HOOK_ABORTED (it passes `status` as an update option); it is fixed with the fresh verified build (#34920 / #34896), and #35025 changes the card's line-shape check. Iteration 3's 问数 miss (`department_budgets` as dept_manager: never described Department) and iteration 5's (as employee: `travel_budget` is withheld, the reply said "no budget field") are left for the next text batch (#35004). Seed 173/757 (#34897, PR #34985): 8 questions and 3 operations are unmeasured. ## Tests <details><summary>Readings (head 7f6156c; re-run at b431dc0 where marked)</summary> - `pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/skill-single-source-34686.test.ts`: Test Files 1 passed (1), Tests 3 passed (3); re-run at `b431dc04`: 3 passed (3). - `pnpm --filter @objectstack/mcp test`: Tests 1252 passed (1252); `pnpm --filter @objectstack/mcp typecheck`: exit 0 (`check:test-typecheck: OK`). - Eval assertions checked by script: every `must_contain` is in `expected_output`, no `must_not_contain` is in it, ids 1-11 distinct; `loadSkillEvalCatalog('skills')` from `packages/qa/scenarios` loads 11 `objectstack-ask` cases with no refusals. - No ablation: the diff changes skill text, a generated module, an eval file and a ratchet row, and no tested behaviour. </details> ## Verification <details><summary>Gates (head 7f6156c)</summary> - Closure build under the verify lock: `pnpm --workspace-concurrency=2 --filter '@objectstack/lint...' --filter '@objectstack/client-react...' --filter '@objectstack/mcp...' build`, VERDICT command-exit 0. - `node scripts/pm/dispatch-gates.mjs --commands`: 112 derived families, all run; `--ran` with exit codes: 110 run, 2 NOT MEASURED (exit 3), 0 unrun. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: needs a full `pnpm build`; `node scripts/check-plugin-teardown-shape.mjs --self-test`, reason: shallow checkout cannot read its pinned positive-control commit. Both left to CI. - `node scripts/check-skills-token-ratchet.mjs`: exit 0, `skills/objectstack-ask/SKILL.md is 1740 tokens (ceiling 1740; headroom 0)`; `--self-test` exit 0. Re-run at `b431dc04`: still 1740 / 1740, headroom 0. - `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0; `check:skill-refs`: in sync; `node scripts/gen-mcp-ask-skill.mjs --check`: clean; all three re-run at `b431dc04`: in sync, clean. - `node scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean (origin/main merges cleanly; the Version Packages PR shares the skill file and merges cleanly). - `node scripts/pm/check-governed-merges.mjs --branch claude/issue-34996-ask-skill-iter-2`: GOVERNED, Tier H (`skills/**` x2). </details> <details><summary>Size readings</summary> - `skills/objectstack-ask/SKILL.md`: 101 -> 115 lines; 1491 -> 1740 tokens. - All 12 published `SKILL.md`: 4730 -> 4744 lines. - Ratcheted authored total: 191184 -> 191433 tokens (+249). Eval file: 95 -> 115 lines, 3071 -> 3693 tokens (unpriced). </details> ## Acceptance notes - One line of the measured text runs past the file's usual wrap (step 2's paragraph, "instead of asking about some other word's matches. `partial: true` ..."); it is kept as measured rather than re-wrapped. - The first measurement table is on the grader before #34997, except iteration 6; the regraded table is on rev 2 (merged as `339c2f42`). The replay operation counts stay labelled as such until #35048 lands. <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziH9rnXEpD9ne7yFhD --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 301b7c1 commit 3b4ffb2

6 files changed

Lines changed: 94 additions & 12 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/mcp': patch
4+
---
5+
6+
docs(skills): the `objectstack-ask` skill loads for every question about the app's records, asks back without a figure of its own, keeps terms whole and declines a record kind it cannot see
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 tell a connected client:
12+
13+
- The skill is for every question answered from the app's records, before the first data tool call, even one that names no metric: what has been claimed, spent, sold or paid so far, as well as a number, a total, a ranking, a breakdown, a trend or a list ("how much", "so far", 「一共」 join the trigger words).
14+
- A term sent to `list_datasets` is the user's noun phrase for the thing, kept whole ("travel budget", not "travel" and "budget") and without the verbs, time words and question words around it ("trip days", not "trip days requested").
15+
- A reply that asks the user back states no figure of its own (no count, total or option number): each option is named by its label in a bullet, and its description is quoted as written. It asks only about matches or candidates for words the user wrote; a word with no match and no candidates goes to the object fallback instead of a question about another word's matches.
16+
- The object fallback opens with one rule: when the question names a kind of record that no listed object or dataset is, the client says it cannot see those records here (they may be hidden from it) and stops, and never answers from a different object that merely links to them.
17+
18+
Two sentences in the `candidates` row of step 2 that restated step 1 and the paragraph under the table are removed. The skill's eval cases add a question about what has been claimed so far and a question about a record kind no listed object shows. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes.

‎content/docs/ai/skills-reference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Do not use to author new metadata (the domain skills cover that), or to reconcil
212212

213213
Answer a business question over a live ObjectStack environment through its MCP tools (list_datasets, query_dataset, list_objects, describe_object, query_records, aggregate_records): find the governed metric the question names, compute it and cite its source, or fall back to an object query and say so.
214214

215-
Use when the user asks for a number, a ranking, a breakdown, a trend or a list from the app's data, in any language ("how many", "total", "top 10", "by stage", "this quarter"; "多少", "总额", "排名", "占比", "趋势", "按阶段统计", "列出").
215+
Use for EVERY question answered from the app's records, before the first data tool call, even when it names no metric: a number, a total, what has been claimed, spent, sold or paid so far, a ranking, a breakdown, a trend or a list, in any language ("how many", "how much", "total", "so far", "top 10", "by stage", "this quarter"; "多少", "一共", "总额", "排名", "占比", "趋势", "按阶段统计", "列出").
216216

217217
Do not use for building or changing metadata (the domain skills cover that), or for writing a query in application code (see objectstack-query).
218218

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export const ASK_SKILL_DATA_LOOP: string = [
2020
' "商机数") and what it is grouped or filtered by ("by stage", "按行业").',
2121
'- Call `list_datasets({ terms })` with those words, as the user wrote them and',
2222
' in the user\'s language. Do not translate or reword a term: a match on a word',
23-
' you supplied is your reading, not the user\'s.',
23+
' you supplied is your reading, not the user\'s. A term is the noun phrase for',
24+
' the thing, kept whole ("travel budget", not "travel" and "budget": a',
25+
' fragment\'s matches are not the user\'s) and without the verbs, time words',
26+
' and question words around it ("trip days", not "trip days requested";',
27+
' "报销金额", not "报销金额合计是多少").',
2428
'- Each dataset in the answer carries `matches`: one entry per hit, with the',
2529
' `term`, the `member` it names (`measures.<name>` or `dimensions.<name>`) and',
2630
' `matchedOn`. A word matches only when it equals a member\'s name, label or',
@@ -38,12 +42,16 @@ export const ASK_SKILL_DATA_LOOP: string = [
3842
'| 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. |',
3943
'| 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. |',
4044
'| Only a dimension matches | That is a grouping ("by stage"), not a number. You still need a measure match; without one, ask which number is meant. |',
41-
'| A word matches nothing, and `candidates` lists members for it, one or several | Ask the user which one they mean, listing each candidate\'s label, its dataset\'s label and its description; with one candidate, ask whether it is the one meant. Do not pick one, and never treat a candidate as a match. Compute nothing yet. |',
45+
'| A word matches nothing, and `candidates` lists members for it, one or several | Ask the user which one they mean, listing each candidate\'s label, its dataset\'s label and its description; with one candidate, ask whether it is the one meant. Do not pick one. |',
4246
'| No match and no candidates for the word for a thing measured | Step 4, and say in the answer that no governed metric was used. |',
4347
'| `membersWithheld: true` on a dataset | Say that it has members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist. |',
4448
'',
4549
'When you ask, the reply is the question alone: no figure, and no tool call',
46-
'until the user answers. `partial: true` on the answer means the catalogue may',
50+
'until the user answers. State no figure of your own in it (no count, total',
51+
'or option number): name each option by its label in a bullet, and quote its',
52+
'description as written. Ask only about matches or candidates for words the user',
53+
'wrote; when their word matched nothing and has no candidates, go to step 4',
54+
'instead of asking about some other word\'s matches. `partial: true` on the answer means the catalogue may',
4755
'be incomplete; `warning` says why, and you repeat it when you fall back.',
4856
'',
4957
'## 3. Compute a governed metric',
@@ -61,6 +69,10 @@ export const ASK_SKILL_DATA_LOOP: string = [
6169
'',
6270
'## 4. Fallback: object queries',
6371
'',
72+
'- The question names a kind of record (trip requests, invoices) and no listed',
73+
' object or dataset is that kind: say you cannot see those records here (they',
74+
' may be hidden from you) and stop. Never answer from a different object that',
75+
' merely links to it.',
6476
'- `list_objects`, then `describe_object({ objectName })` on the object you will',
6577
' read. Read its fields before you filter: a field with `options` is filtered',
6678
' by the option\'s `value`, never its label.',

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,25 @@ export const CEILINGS = new Map([
17371737
// read it. 6105 -> 5981 bytes (-124), less the 20-byte stamp line:
17381738
// ceil(($(wc -c < skills/objectstack-ask/SKILL.md) - 20) / 4) == ceil(5961 / 4)
17391739
// = 1491 (-31). Pinned AT the measurement, zero headroom; no other row moves.
1740-
['skills/objectstack-ask/SKILL.md', 1491],
1740+
// 1491 -> 1740, the ask-skill iteration loop's first kept change set
1741+
// (Part of #34996), measured on the travel_expense ask round before it was
1742+
// kept: the description triggers on every question answered from the app's
1743+
// records ("so far", 「一共」); a term is the user's noun phrase kept whole; an
1744+
// asked-back reply states no figure of its own, quotes each description as
1745+
// written and asks only about the user's own words; step 4 declines a record kind no listed object shows instead of
1746+
// answering from a linked one. Raise path the standing ruling
1747+
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN
1748+
// FIRST — two restatements cut from step 2's `candidates` row, each keeping
1749+
// its other home: ", and never treat a candidate as a match" (step 1's "A
1750+
// candidate is not a match.") and "Compute nothing yet." (the paragraph under
1751+
// the table: "no figure, and no tool call until the user answers"). Text
1752+
// +1057 bytes, cuts -61, the reviewed narrowing of the ask-back sentence +2
1753+
// (re-measured before it was kept): 5981 -> 6979 bytes, less the 20-byte
1754+
// stamp line:
1755+
// ceil(($(wc -c < skills/objectstack-ask/SKILL.md) - 20) / 4) == ceil(6959 / 4)
1756+
// = 1740 (+249), the measured remainder only. Pinned AT the measurement, zero
1757+
// headroom; no other row moves.
1758+
['skills/objectstack-ask/SKILL.md', 1740],
17411759
]);
17421760

17431761
/**

‎skills/objectstack-ask/SKILL.md‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ description: >
55
MCP tools (list_datasets, query_dataset, list_objects, describe_object,
66
query_records, aggregate_records): find the governed metric the question
77
names, compute it and cite its source, or fall back to an object query and
8-
say so. Use when the user asks for a number, a ranking, a breakdown, a trend
9-
or a list from the app's data, in any language ("how many", "total", "top
10-
10", "by stage", "this quarter"; "多少", "总额", "排名", "占比", "趋势",
11-
"按阶段统计", "列出"). Do not use for building or changing metadata (the
8+
say so. Use for EVERY question answered from the app's records, before the
9+
first data tool call, even when it names no metric: a number, a total, what
10+
has been claimed, spent, sold or paid so far, a ranking, a breakdown, a trend
11+
or a list, in any language ("how many", "how much", "total", "so far", "top
12+
10", "by stage", "this quarter"; "多少", "一共", "总额", "排名", "占比",
13+
"趋势", "按阶段统计", "列出"). Do not use for building or changing metadata (the
1214
domain skills cover that), or for writing a query in application code (see
1315
objectstack-query).
1416
license: Apache-2.0
@@ -33,7 +35,11 @@ wrote its business definition) outranks a number you work out yourself.
3335
"商机数") and what it is grouped or filtered by ("by stage", "按行业").
3436
- Call `list_datasets({ terms })` with those words, as the user wrote them and
3537
in the user's language. Do not translate or reword a term: a match on a word
36-
you supplied is your reading, not the user's.
38+
you supplied is your reading, not the user's. A term is the noun phrase for
39+
the thing, kept whole ("travel budget", not "travel" and "budget": a
40+
fragment's matches are not the user's) and without the verbs, time words
41+
and question words around it ("trip days", not "trip days requested";
42+
"报销金额", not "报销金额合计是多少").
3743
- Each dataset in the answer carries `matches`: one entry per hit, with the
3844
`term`, the `member` it names (`measures.<name>` or `dimensions.<name>`) and
3945
`matchedOn`. A word matches only when it equals a member's name, label or
@@ -51,12 +57,16 @@ wrote its business definition) outranks a number you work out yourself.
5157
| 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. |
5258
| 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. |
5359
| Only a dimension matches | That is a grouping ("by stage"), not a number. You still need a measure match; without one, ask which number is meant. |
54-
| A word matches nothing, and `candidates` lists members for it, one or several | Ask the user which one they mean, listing each candidate's label, its dataset's label and its description; with one candidate, ask whether it is the one meant. Do not pick one, and never treat a candidate as a match. Compute nothing yet. |
60+
| A word matches nothing, and `candidates` lists members for it, one or several | Ask the user which one they mean, listing each candidate's label, its dataset's label and its description; with one candidate, ask whether it is the one meant. Do not pick one. |
5561
| No match and no candidates for the word for a thing measured | Step 4, and say in the answer that no governed metric was used. |
5662
| `membersWithheld: true` on a dataset | Say that it has members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist. |
5763

5864
When you ask, the reply is the question alone: no figure, and no tool call
59-
until the user answers. `partial: true` on the answer means the catalogue may
65+
until the user answers. State no figure of your own in it (no count, total
66+
or option number): name each option by its label in a bullet, and quote its
67+
description as written. Ask only about matches or candidates for words the user
68+
wrote; when their word matched nothing and has no candidates, go to step 4
69+
instead of asking about some other word's matches. `partial: true` on the answer means the catalogue may
6070
be incomplete; `warning` says why, and you repeat it when you fall back.
6171

6272
## 3. Compute a governed metric
@@ -74,6 +84,10 @@ be incomplete; `warning` says why, and you repeat it when you fall back.
7484

7585
## 4. Fallback: object queries
7686

87+
- The question names a kind of record (trip requests, invoices) and no listed
88+
object or dataset is that kind: say you cannot see those records here (they
89+
may be hidden from you) and stop. Never answer from a different object that
90+
merely links to it.
7791
- `list_objects`, then `describe_object({ objectName })` on the object you will
7892
read. Read its fields before you filter: a field with `options` is filtered
7993
by the option's `value`, never its label.

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,26 @@
9090
"must_contain": ["describe_object", "aggregate_records", "非指标口径", "销售分析", "赢单金额"],
9191
"must_not_contain": ["query_dataset", "provenance"]
9292
}
93+
},
94+
{
95+
"id": 10,
96+
"prompt": "The user asks: \"What has been claimed so far?\" It names no metric. You called `list_datasets({ terms: ['claimed'] })`. The answer lists one dataset, `expense_analysis` (label Expense Analysis), with `matches: []`; its measures are `total_claimed`, labelled Claimed Amount and described as \"Sum of submitted expense claim amounts\", and `claim_count`, labelled Claims. The answer also carries `candidates: [{ term: 'claimed', dataset: 'expense_analysis', member: 'measures.total_claimed' }]`. What is your reply?",
97+
"expected_output": "A question about what has been claimed is answered from the app's records, so this skill applies before the first data call even though no metric is named. The word matches nothing and `candidates` lists one member for it, so the reply is a question and nothing else, asking whether that candidate is the one meant, such as \"Do you mean Claimed Amount (in Expense Analysis: sum of submitted expense claim amounts)?\", with the option named by its label in a bullet. It states no figure of its own: no total, no count of claims and no numbered option, and the candidate's description is quoted as written. It makes no tool call until the user answers.",
98+
"files": [],
99+
"assertions": {
100+
"must_contain": ["Claimed Amount", "Expense Analysis", "?"],
101+
"must_not_contain": ["query_dataset", "aggregate_records", "total_claimed", "1."]
102+
}
103+
},
104+
{
105+
"id": 11,
106+
"prompt": "The user asks: \"How many trip requests were approved this month?\" `list_datasets({ terms: ['trip requests'] })` answers one dataset, `expense_analysis` (label Expense Analysis, `object: 'expense_claim'`), with `matches: []` and no `candidates`. `list_objects` shows `expense_claim` and `employee`; `expense_claim` has a lookup field `trip_request`, and no listed object is a trip request. What do you do?",
107+
"expected_output": "No listed object or dataset is a trip request, so the records asked about cannot be seen here. The reply says, in the user's language, that it cannot see trip requests in this environment (they may be hidden from it) and stops. It does not count expense claims that link to a trip request through the `trip_request` lookup as an answer, and it gives no figure.",
108+
"files": [],
109+
"assertions": {
110+
"must_contain": ["trip request"],
111+
"must_not_contain": ["aggregate_records", "query_records", "query_dataset", "非指标口径"]
112+
}
93113
}
94114
]
95115
}

0 commit comments

Comments
 (0)