Repository navigation
Commit 68e76fa
docs(skills): objectstack-ask step 2 answers from the records when no candidate's dataset carries the asked grouping (#39328)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg6QH4oAzb3iViTHPkq3LwzC)_
Fixes #39285
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:用 AI
客户端问数的人,问「按某个维度拆分或排名」而候选指标所在的数据集没有这个维度时,以前照着技能会被反问「你指的是哪个指标」,现在直接拿到按记录算出的答案,并被告知哪个指标缺哪个分组。数据读取不完整时仍然照旧先问。
- 为什么做:属于「AI 通过数据集回答业务问题」这条线。平台的行为今天已经改了,对外发布的问数技能还在教「一律反问」,这次补上技能这一半。
- 出错会怎样:最坏是客户端在本该反问时直接去查了记录,答案开头仍会标明「非指标口径」。改的只是技能文字,撤回这个改动即可。
- 要你做什么:审阅并批准这个改动(对外技能包,需人工合入)。
## What changes
`skills/objectstack-ask/SKILL.md`, step 2, gains one table row under the
row for a word with a measure among its `candidates`. It teaches the
step the ruling on #39152 (option P, step 2; ruling record 7363768737)
orders and ADR-0149 D3 records in its grouping note of 2026-12-03, in
the words `list_datasets` writes in `nextStep.note` on `main`
(`groupingCheck` in
`packages/services/service-analytics/src/dataset-next-step.ts`):
> Such a word in a breakdown or ranking, when `nextStep.note` lists its
readings' groupings and no dataset there carries all it is split or
ranked by (a date one keeps its calendar buckets) → Do not ask: step 4,
naming each reading as a declared metric and the grouping its dataset
lacks.
- The grouping is read whole: "all it is split or ranked by". A dataset
that carries one of two asked groupings does not carry it.
- A date dimension keeps its calendar buckets, so "by month" beside a
date is a grouping the dataset can give.
- The row waits for the note's list. A `partial: true` answer carries no
such list (the executor's `groupingSentences` writes nothing there), so
the word is asked about as before. This is finding S1 of the contract
review, fixed in the row's condition.
- "Readings" is the note's word for the measure candidates, so a
dimension candidate is not counted among them.
- The row above it still asks in every other case, and the note's own
"Otherwise:" hands over to that question. No measure is selected in
either case.
`packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill
(`node scripts/gen-mcp-ask-skill.mjs`), so the page at `GET /mcp/skill`
carries the same text.
`skills/objectstack-ask/evals/metric-selection-fallback.json` gains two
cases, each with the `note` taken from a probe run of `list_datasets` on
this branch:
- Case 28: the booked amount by order status and by product category,
beside a dataset that carries order status and a date. The expected
answer asks nothing, reads the records, and says the dataset lacks
product category. Its ask-back literals also refuse the single-candidate
forms ("Did you mean", "the one you mean?").
- Case 29: the same question on a `partial: true` answer, whose note
lists no groupings. The expected reply is the question about the word
and nothing else.
The reference answers of cases 9, 20, 21, 22, 24 and 26 no longer repeat
the reasons cut from the skill.
### The row is paid for inside the file
The ratchet row stays `['skills/objectstack-ask/SKILL.md', 2040]`, and
`scripts/check-skills-token-ratchet.mjs` is not touched.
| Reading | Before (`dc4a2cdb`) | After (`5fbd110b`) |
|:--|--:|--:|
| `skills/objectstack-ask/SKILL.md`, lines | 132 | 130 |
| `skills/objectstack-ask/SKILL.md`, bytes | 8185 | 8187 |
| `skills/objectstack-ask/SKILL.md`, priced tokens | 2040 | 2040 |
| every `SKILL.md` in `skills/`, lines | 2122 | 2120 |
| every `SKILL.md` in `skills/`, bytes | 119434 | 119436 |
The new row is 291 bytes. Five cuts, 289 bytes in all, pay for it, and
the priced bytes land on 8160, which is the 2040 ceiling exactly. No
instruction leaves with the cuts:
| Cut | Bytes | Why nothing is lost |
|:--|--:|:--|
| "You are connected to a live environment through its MCP tools, and
the user asked for a figure or a list from its data." | 120 | It
restated the skill's description and its title. On the served page it
sits under the heading "Answering a business question", in a page about
the environment's tools. |
| "this environment serves you no governed metrics." | 51 | A reason.
The instruction stays: "No `list_datasets` among your tools: go to step
4." |
| "A grouping is not a number:" | 28 | A reason that restated the row's
own left cell. The instruction stays: "Ask which number is meant." |
| ", so the database ranks and cuts the groups" | 45 | A reason. The
instruction stays: pass `orderBy` and `limit: N`. |
| ", so the user can ask for the governed figure" | 45 | A reason. The
instruction stays: add one line naming the dataset and its measures. |
## Tests
At head `5fbd110b`, except where a line names `d8005d20`, the head
before the review round.
- `skill-single-source-34686.test.ts` in `@objectstack/mcp`, which holds
the generated module equal to the skill: 1 file, 3 tests passed.
- `node scripts/gen-mcp-ask-skill.mjs --check`: the module is current
with the skill.
- `node scripts/check-skills-token-ratchet.mjs`:
`skills/objectstack-ask/SKILL.md is 2040 tokens (ceiling 2040; headroom
0)`.
- `skill-evals --skills objectstack-ask --dry-run`: the reader takes the
bundle's 29 behaviour cases and 7 trigger cases, and refuses none.
- At `d8005d20`: `pnpm --filter @objectstack/mcp test`, 89 files, 1662
tests passed; `pnpm --filter @objectstack/mcp typecheck`, exit 0.
Neither was re-run on `5fbd110b`: the round changed skill text, the
generated string and an eval fixture.
- No ablation: the diff changes skill text and an eval fixture, and no
tested behaviour.
### Gates
- At `5fbd110b`, each with exit 0: `node
scripts/check-skills-token-ratchet.mjs` and its `--self-test`, `node
scripts/gen-mcp-ask-skill.mjs --check`, `pnpm --filter @objectstack/spec
run check:skill-docs`, `pnpm check:skill-links`, `pnpm
check:skill-identifier-liveness`, `pnpm check:skill-compatibility`,
`pnpm check:skill-frame-sync`, `pnpm check:nul-bytes`, `pnpm
check:doc-authoring`, `pnpm check:issue-citations`, `pnpm
check:pm-skill-id-lint`, `pnpm check:role-word`.
- At `d8005d20`: `node scripts/pm/dispatch-gates.mjs --ran` read "73
derived famil(ies) accounted for — 71 run, 2 NOT-MEASURED". The 71
exited 0.
- NOT MEASURED: `node scripts/check-plugin-teardown-shape.mjs
--self-test`, exit 3, reason: its fixture commit is outside the shallow
clone. The scan itself exited 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, reason: it
needs a whole-workspace build. CI's `Lint & Repo Gates` runs it.
- NOT MEASURED: the rest of the derived list on `5fbd110b`, reason: a
declared narrowing to the families that read the changed files. CI runs
the farm on this head.
## Live check
`pnpm --filter @objectstack/scenarios skill-evals --case
'objectstack-ask/metric-selection-fallback#28,objectstack-ask/metric-selection-fallback#29'
--model haiku --effort medium --repeats 1`, on `5fbd110b`, subscription
login (`oauth_token`, no API key), served `claude-haiku-5-5`. One
repetition, so it shows whether the behaviour appears and claims no
rate.
| Case | with-skill | no-skill |
|:--|:--|:--|
| 28, a complete answer | pass | fail (asks nothing and reads the
records, but never names `describe_object`) |
| 29, a `partial: true` answer | pass | pass |
Notional cost the CLI reported: $0.01. Nothing was billed.
On the head before the review round (`d8005d20`), case 28 gave the same
two results, and it also passed with the skill on the base text
(`dc4a2cdb`, case copied in). The prompt of each case quotes the
platform's `note`, and the skill says to follow it, so at this model and
one repetition the note alone carries both behaviours: case 29 passes
without the skill too. What the row changes is that the skill no longer
says "ask" where the note says not to, and after the review round it no
longer says "do not ask" where the note asks.
## Review records
- Contract review record 7378813195 on head `d8005d20`: PASS, with S1
(the row acted on a `partial: true` answer) and nits N1 to N4.
- Delta contract review record 7379069601 on head `5fbd110b`: PASS, S1
closed.
## Acceptance notes
- The card's re-check, `grep -rn "ask back\|asks back\|candidates_only"
skills/objectstack-ask/`, still hits the eval file only. The row uses
the words of step 2's other rows ("Do not ask").
- The card asked for one eval case. Case 29 is one more, added in the
review round to pin the partial-answer rule.
- ADR-0149's note says where the client cannot tell, the question is
owed. The row adds no sentence for it: the row above it is still the
default, and `nextStep.note` ends its grouping sentence with
"Otherwise:" before the question.
- The note's four cases under "Not covered" (a measure hit, several
hits, a filter or time window, candidates across datasets of which only
some carry the grouping) keep their rows. The row's "no dataset there"
leaves the fourth to the question, as the note does.
## Verification
- Read first, by risk: `skills/objectstack-ask/SKILL.md` (the new row at
step 2, then the five cuts),
`skills/objectstack-ask/evals/metric-selection-fallback.json` (cases 28
and 29), `.changeset/39285-ask-skill-grouping-lacked.md`.
`packages/mcp/src/ask-skill.generated.ts` is generated.
- Two-minute check: `node scripts/gen-mcp-ask-skill.mjs --check && node
scripts/check-skills-token-ratchet.mjs | grep objectstack-ask/SKILL.md`.
Expected: "is current with" and "2040 tokens (ceiling 2040; headroom
0)".
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZyaZyJWdzKPF2U7EQ)_
<!-- signed: repo:objectstack@os-bill · os-bill ·
session_01Utp6CZyaZyJWdzKPF2U7EQ -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ad4984f commit 68e76fa
4 files changed
Lines changed: 64 additions & 26 deletions
File tree
- .changeset
- packages/mcp/src
- skills/objectstack-ask
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
| 38 | + | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | | - | |
92 | | - | |
| 90 | + | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
| 97 | + | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
55 | | - | |
| 53 | + | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| 62 | + | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
107 | | - | |
| 105 | + | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
114 | | - | |
| 112 | + | |
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
| |||
0 commit comments