Skip to content

Commit 09f0a8c

Browse files
feat(scenarios): dataset-card questions name their ask kind, and a round counts every kind (#36065)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D7UBkcmf1Qy7iEMxarYt8wU)_ Fixes #35113 Fixes #35098 Clause-②: yes (widening) — new optional card key `askKind` on `QuestionSchema` and `DatasetQuestionSchema`; new exports `ASK_KINDS`, `AskKind`, `AskKindSchema`, `questionTurnKind`, `checkAskKinds`, `askTurns`, `askKindCounts` and `AskTurn` (package root); `kindTally`, `kindCell` and `KindTally` (`./runner`); new optional fields `QuestionResult.askKind`, `DatasetQuestionResult.askKind` and `HalfScores.kinds` (`./runner`) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;开源评测里两张问数场景卡(订单到回款、差旅报销)的每道题都标明了题型,每轮问数评测的记录按十种题型分别计数,另外差旅报销卡的建应用说明写清了第二步由哪位财务审批。 - 为什么做:「MCP 二期与问数」专项要求开源卡覆盖托管问数集的十种题型,让问数退化当天在开源仓、零成本被发现;差旅卡那句话含糊,让部分构建把第二步审批派给了财务经理。 - 出错会怎样:只影响评测卡的打分与评测报告,不碰产品代码,可直接撤回;两张卡的指纹变了,评测日序列在此处分段。 - 要你做什么:无 ## What changes **Card one: the ten ask kinds.** Each question and dataset question of the two open dataset cards (`order_to_cash`, `travel_expense`) now names its ask kind (`askKind`), one of the ten kinds the hosted ask set asks: `count`, `group_sum`, `top_n`, `time_range`, `join`, `owner_latest`, `business_term`, `ambiguous`, `forbidden`, `unanswerable` (D6 = A on #34659: the kinds, never the hosted fixture; no hosted question is copied). - Premise reading: the card counted only the five dataset questions per card. The ten ordinary questions per card already ask the figure kinds, the `forbidden` leak reading as a member persona, and `unanswerable`. Counted per turn (a question once per persona it lists, as the runner asks it), the two cards already ask every kind at least twice. So no question is added: the change names the kinds, holds them to the cards, and makes a round report them. Adding figure questions also risks the near-miss trap #35544 hit (a lifted word that near-misses a dataset measure). - Per turn, `forbidden` is read off the card: a turn asked as a persona whose truth is `withheld` is a `forbidden` ask whatever kind the question names. - The loader (`checkAskKinds`, `packages/qa/scenarios/src/ask-kinds.ts`) refuses a kind its question contradicts, at `askKind`: `top_n` needs a `topN` truth, `time_range` an `in_window` filter, `join` a relation path, `group_sum` a `groupBy`, `count` none, `owner_latest` a `groupBy` ending on a person field (a declared lookup to an object a persona's `record` names, such as `employee`, or a declared user-handle field), `business_term` exactly the `metric_selected` dataset questions, `ambiguous` exactly the `asked_back` ones, `unanswerable` exactly the `unanswerable` truths, and a declared `forbidden` only on a question withheld from every persona it lists. A card that names one kind names the kind of every question and dataset question, all or none. A card that names no kind loads as it did before kinds existed, with dataset questions or without, so no card the released loader accepted is refused. - The runner stamps each turn's kind on its result (`askKind` on every question and dataset-question result). The scorecard counts the asks kind by kind (`HalfScores.kinds`) and adds `Run · kinds` / `Iterate · Run · kinds`, all ten kinds in order, a kind not asked shown as `0 asked`. `summary` sums the row. A card that names no kind, and an older record, show no row. - `docs/qa/scenarios/README.md` gains an "Ask kinds" section: the ten kinds with the rule each is held to, and the per-card count table (no kind at zero). A test holds the cards to the table's figures. It keeps them as a literal, because reading the README from the package's tests would be an undeclared cross-package input (`check:cross-package-test-inputs`). | Kind | `order_to_cash` | `travel_expense` | Total | |:---|---:|---:|---:| | `count` | 3 | 3 | 6 | | `group_sum` | 2 | 3 | 5 | | `top_n` | 1 | 1 | 2 | | `time_range` | 1 | 1 | 2 | | `join` | 2 | 2 | 4 | | `owner_latest` | 2 | 1 | 3 | | `business_term` | 2 | 2 | 4 | | `ambiguous` | 2 | 2 | 4 | | `forbidden` | 1 | 2 | 3 | | `unanswerable` | 1 | 1 | 2 | **Card two (folded in): the step-2 approver in the `travel_expense` prose.** The detailed prompt said "the department manager first (a manager's own claim goes to the finance manager), then Finance". Finance has two members, and the same sentence names one of them the finance manager, so builds could route step 2 to that manager (e14). Every seeded step-2 row and the persona name the Finance officer (e13). The prose now reads "then a Finance officer (Finance staff other than the finance manager)", and the Chinese text says the same. The expected approver, the seed rows, the `$comment` and the `manager_approves_step_one` operation are unchanged. This follows the reading on that card (comment 7061940514, option B), in its own commit. ## Tests - New top-level describes in the existing harnesses: - `test/dataset-cards.test.ts`: every question of both cards names a kind; across the cards no kind is asked fewer than twice; `department_budgets` is `forbidden` as `employee` and `group_sum` as `dept_manager`; each card's per-kind count equals the README table's figures; 18 refusal cases, each at its `askKind` path, including `owner_latest` on a status (`orders_by_status`) and on a product category across a lookup (`booked_by_category`); `owner_latest` across a lookup to a person (`overdue_by_owner`, `account.owner`) loads; a declared `forbidden` withheld from every listed persona loads; a card without dataset questions may name no kinds; a card with dataset questions that names no kind loads (the released card shape). The two missing-kind refusal cases aim at a card that names exactly one kind: a question left without one when only a dataset question names one, and a dataset question left without one when only a question names one. - `test/runner/orchestrate.test.ts`: the offline ask round below; the `Run · kinds` row and the record's tally on a hand-built half; a card that names no kinds has no kinds tally and no row. <details><summary>Package suite, typecheck (head 580727e)</summary> - `pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2` under the verify lock at 580727e: `VERDICT command-exit 0`, Test Files 40 passed (40), Tests 1236 passed (1236). The same command, after a package build, at 1748bfc: 40/40, 1236/1236. - Dependency closure first: `pnpm --workspace-concurrency=2 --filter '@objectstack/scenarios^...' build`, `VERDICT command-exit 0`. </details> <details><summary>Contract fix round at a6052bd (F1 of contract record 7063179133, fix (a); S1 stays fixed)</summary> - `checkAskKinds` now sets `required` from the card's own declarations: true when any question or dataset question names an `askKind`. Before, it was `card.run.datasetQuestions !== undefined`, which refused a released card with dataset questions and no kinds. The dataset-question branch now refuses a missing kind only when `required` holds, as the question branch already did. The loader message reads "a card that names one ask kind names the kind of every question it asks". `groupsByPerson` stays module-private (cf467bf). - Texts aligned with the rule: the loader message, the `askKind` TSDoc on `QuestionSchema` and `DatasetQuestionSchema`, the card README row 4, the "Ask kinds" opening sentence and the sentence under its table, the package README bullet, and the 35113 changeset sentence. - Tests: the dependency closure built (`VERDICT command-exit 0`), then `pnpm --filter @objectstack/scenarios build && … typecheck && … exec vitest run --maxWorkers=2` under the verify lock at a6052bd: `VERDICT command-exit 0`, Test Files 40 passed (40), Tests 1240 passed (1240). - Ablation 1, `required` set to `false` through `scripts/ablation-replace.mjs`: mutation landed (anchor 1 to 0, blob e4ae344 to 8622ef5f5761). `test/dataset-cards.test.ts`: 2 failed, 48 passed. The 2 are the re-aimed missing-kind cases. Restored, blob equal to HEAD, `git diff HEAD` empty. - Ablation 2, `required` set back to the old rule (`card.run.datasetQuestions !== undefined`): mutation landed (blob e4ae344 to e1ddde9972e2); 1 failed, 49 passed. The 1 is the new case for a card with dataset questions and no kind. Restored, blob equal to HEAD, `git diff HEAD` empty. - The subject resolves to `src/` (the suite imports `../src/index.js`), so no rebuild was needed between the legs. - Gates at a6052bd: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 70 families (merge base 8145424). Each ran once, with its exit code captured before any pipe: 68 exited 0. `node scripts/check-plugin-teardown-shape.mjs --self-test` and `pnpm check:dual-build-cjs-loads` exited 3 (a shallow clone, and no full build), as in the earlier round. Both are NOT MEASURED locally and run in CI. `dispatch-gates --ran` (with exit codes): 70 derived, 68 run, 2 NOT-MEASURED, 0 UNRUN. - `node scripts/pm/overlap-check.mjs --branch=HEAD` before the push: VERDICT clean. It merges cleanly with origin/main (30b0987) and with #36092, which shares the package README. </details> <details><summary>Ablations (each restored, blob equal to HEAD, git diff HEAD empty)</summary> - `node scripts/ablation-replace.mjs --file packages/qa/scenarios/src/loader.ts --anchor ' checkAskKinds(card, personaTruths, refuse);' --delete -- … vitest run test/dataset-cards.test.ts`: mutation landed (anchor 1 to 0, blob 4a0967e to bd8e244d0a16); 15 failed, 31 passed. The 15 are the refusal cases the check owns. The closed-set case stays green, as it should, because the schema refuses it. - `ask-kinds.ts`, the per-turn `forbidden` reading replaced by the declared kind: mutation landed (blob 6fe408d to 46cad08937e0); 4 failed (the offline round, no kind under two, the per-turn `forbidden` case, the README table). - `ask-kinds.ts`, the `owner_latest` person check reduced to "any `groupBy`" (head 436ed39): mutation landed (blob 7da9b01 to 9e6a2cf23b43); 2 failed, 47 passed, the two non-person `owner_latest` cases. The first attempt used a replacement that is a substring of the anchor. The tool refused it before running anything because the count did not rise, so that attempt measured nothing. It was redone with a distinct replacement. - The subject resolves to `src/`: the suites import `../src/…`, not a built `dist/`, so no rebuild was needed between the legs. </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` (merge base 8145424): 70 families, each run once with its exit code captured before any pipe. 67 exited 0. - `pnpm check:cross-package-test-inputs` exited 1 on the first pass. The test read the card README from outside the package. The test now holds a literal instead, and the rerun at 580727e exits 0. - `node scripts/check-plugin-teardown-shape.mjs --self-test` exits 3, because its fixture is pinned to a commit this shallow clone cannot reach. `pnpm check:dual-build-cjs-loads` exits 3, because it reads every package's build. Both are NOT MEASURED locally and run in CI. - Rerun at 580727e after the test-only commit: `check:test-source-alias`, `check:type-check-coverage`, `check:type-check-debt`, `check:issue-citations`, `check:nul-bytes`, `check:doc-authoring` and `check:closed-ceremony-text` all exit 0. The derived list is unchanged. - `dispatch-gates --ran`: 70 derived, 68 run, 2 NOT-MEASURED (exit 3), 0 UNRUN. - `node scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean. It merges cleanly with origin/main and with #35886, which shares the package README. - L1 fix round at 436ed39: `check-adr-0087-registration`, `check-changeset-no-major` and `check-empty-changeset` (all with `--base origin/main`), `check:nul-bytes`, `check:doc-authoring`, `check:issue-citations`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:type-check-debt`, `check-affected-docs` and `check-drift-comment` all exit 0. `overlap-check`: VERDICT clean, merging cleanly with origin/main, #36077 and #36066. - L1 fix round tests at 436ed39: the dependency closure was built, then `pnpm --filter @objectstack/scenarios typecheck && … vitest run test/dataset-cards.test.ts test/runner/orchestrate.test.ts` gave `VERDICT command-exit 0`, Test Files 2 passed (2), Tests 213 passed (213). </details> ## Acceptance notes - **Done-when, the round:** no live model round ran in this container. The live driver needs a permission mode other than Auto (packages README, "Permission mode"). The offline path ran instead: `runHalf` over each dataset card on the in-memory app, with a driver that answers questions from the computed truth and dataset questions with no route. Every turn's result carries its kind. `kindTally` matches the README counts, and `Run · kinds` names all ten kinds with a measured count on each card. The first live round on the verified build will show the row. - **The FLS "not visible to you" question (comments 6971648229 and 6979780844):** #35179 shipped the framework half. `query_records` / `get_record` now name the withheld field for a caller served the whole schema (ADR-0106 D4) or on a deployment with masking off (D8). The open runner's personas are plain members (`create-user` with `role: 'user'`) on a default `objectstack dev` host, so the ruled caller cannot be asked on the open cards today. The existing `withheld` grader already passes "not visible to you" and fails "blank". What is missing is the caller: a schema-exempt persona, or a recorded masking-off round. That runner choice is not in this PR; the seat routes it as its own card. The README says no open card asks it yet. The `forbidden` turns here are the member leak reading under default masking. - `docs/qa/scenarios/builds/travel_expense.provenance.json` records the card's new sha256 (`abe91b8f…` to `29162eef…`), following #35764. The build file is unchanged. - The verified build `builds/travel_expense.json` was authored against the pre-#35098 prompt, which said "then Finance". Ask rounds install that build and do not re-author it, so the prose change reaches only scratch and door builds. - Ask-round records split at both cards' new hashes (`summary` refuses to mix card hashes). ## Verification - Read first: `packages/qa/scenarios/src/ask-kinds.ts` (`questionKindProblem`, `questionTurnKind`), then `kindTally` / `kindCell` in `packages/qa/scenarios/src/runner/scorecard.ts`, then the two cards' `askKind` lines. - Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run test/dataset-cards.test.ts -t kind`. Expect 31 passed, 19 skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cypybwgoxE3ZMZy8kt <!-- signed: repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f98f18c commit 09f0a8c

16 files changed

Lines changed: 660 additions & 21 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
fix(scenarios): the `travel_expense` build prompt names who approves a claim's second step
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The detailed prompt said a claim goes to "the department manager first (a manager's own claim goes to the finance manager), then Finance". Finance has two members, and the same sentence calls one of them the finance manager, so a build could route the second step to that manager, while every seeded step-2 row and the `manager_approves_step_one` operation name the Finance officer. The prompt now says the second step goes to a Finance officer (Finance staff other than the finance manager), in English and Chinese. The expected approver, the seed rows and the operation are unchanged.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): every question of a dataset card names its ask kind, and a round's record counts every kind
6+
7+
Clause-②: yes (widening) — new optional card key `askKind` on `QuestionSchema` and `DatasetQuestionSchema`; new exports `ASK_KINDS`, `AskKind`, `AskKindSchema`, `questionTurnKind`, `checkAskKinds`, `askTurns`, `askKindCounts` and `AskTurn` (package root); `kindTally`, `kindCell` and `KindTally` (`./runner`); new optional fields `QuestionResult.askKind`, `DatasetQuestionResult.askKind` (`./runner`) and `HalfScores.kinds` (`scorecard.ts`, `./runner`)
8+
Metadata-protocol: none
9+
10+
The open dataset cards (`order_to_cash`, `travel_expense`) stated no kind of question for their ordinary questions, so a round could not show which of the ten ask kinds it measured. A question and a dataset question now name one (`askKind`): `count`, `group_sum`, `top_n`, `time_range`, `join`, `owner_latest`, `business_term`, `ambiguous`, `forbidden` or `unanswerable`. A card that names one kind names the kind of every question and dataset question it asks, all or none, so a card that names no kind loads as before; the loader refuses a kind its question's truth or route contradicts (a `top_n` that does not rank, an `owner_latest` that does not group by a person field, a `business_term` that is not a `metric_selected` dataset question, an `unanswerable` the seed answers), at the question's `askKind`. A turn asked as a persona its truth is withheld from is a `forbidden` ask.
11+
12+
The runner stamps each turn's kind on its result (`askKind` on every question and dataset-question result), the scorecard counts the asks kind by kind (`HalfScores.kinds`, new `Run · kinds` and `Iterate · Run · kinds` rows naming all ten kinds), and `summary` sums the row. A card that names no kind, and a record written before turns carried one, show no such row. New exports: `ASK_KINDS`, `AskKind`, `AskKindSchema`, `questionTurnKind`, `checkAskKinds`, `askTurns`, `askKindCounts` and `AskTurn` from the package root; `kindTally`, `kindCell` and `KindTally` from the runner.
13+
14+
The two cards ask every kind at least twice per round, a table in `docs/qa/scenarios/README.md` states the counts, and a test holds it equal to the cards. `order_to_cash` changes only by the added `askKind` keys, and `travel_expense` also by the step-2 approver line of its build prompt (the changeset beside this one), so both cards' sha256 move and ask-round records split at these card hashes.

‎docs/qa/scenarios/README.md‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ question's computed truth; a card that does not load is red in CI.
3535
| 1 | `prompt` | `{ short, detailed }`, each `{ zh?, en? }` with at least one language. |
3636
| 2 | `expect` | The structural expectation the deterministic scorer reads, field for field: `objects`, `minFieldsPerObject?`, `selectFields?` (`{ object, field, minOptions }`), `lookups?` (`{ object, field, to }`), `dashboards?`, `appNavTargets?`, `datasets?` (`{ name, label, description, object, measures, dimensions? }`, each member `{ name, label, synonyms?, description? }`; see [Dataset questions](#dataset-questions)). The runner's build prompt states every row by name ([Build checks trace to the prompt](#build-checks-trace-to-the-prompt)). |
3737
| 3 | `capabilities`, `businessFunctions` | Tags `<area>.<name>`, where `<area>` is a closed set: the basenames of `docs/qa/platform-checklist/areas/*.json`, read from the tree. `businessFunctions` is the marketplace taxonomy's business-function facet, read from `@objectstack/spec/marketplace` (`MarketplaceBusinessFunctionsSchema`, defined once in `packages/spec/src/marketplace/taxonomy.zod.ts`): 1-3 distinct values, the primary one first — the card is classified the way the template it graduates into will be listed. |
38-
| 4 | `run.seed`, `run.userHandleFields?`, `run.questions`, `run.personas` | Seed rows per object, and which seed fields hold a user handle; at least five read-only questions, each with a **declarative** truth spec; at least two personas, each a role, the objects or fields it must NOT see, and optionally a row `scope` and the person `record` it is. |
38+
| 4 | `run.seed`, `run.userHandleFields?`, `run.questions`, `run.personas` | Seed rows per object, and which seed fields hold a user handle; at least five read-only questions, each with a **declarative** truth spec and optionally its [ask kind](#ask-kinds) (`askKind`: a card that names one names it on every question and dataset question); at least two personas, each a role, the objects or fields it must NOT see, and optionally a row `scope` and the person `record` it is. |
3939
| 5 | `run.operations`, `run.guardrails`, `run.agentActions?`, `run.datasetQuestions?` | At least two writes, each acting as a persona and declaring its `outcome`; the five guardrail checks; optionally the agent-callable business actions and the dataset questions. |
4040
| 6 | `iterate` | A one-sentence change request plus the `expectDelta` it should add to `expect`. |
4141

@@ -362,6 +362,69 @@ states the datasets by name, with every synonym and description, and the Build h
362362
them (`dataset:NAME`, `dataset-measure:NAME.MEMBER`, `dataset-dimension:NAME.MEMBER`).
363363
`order_to_cash` and `travel_expense` carry them today.
364364

365+
## Ask kinds
366+
367+
A question or dataset question may name its **ask kind** (`askKind`), and a card that names one
368+
names it on every question and dataset question, all or none. There are ten: the kinds of question
369+
an ask round asks, borrowed from the hosted ask set's categories (D6 = A on #34659: the kinds,
370+
never its fixture). ⛔ No question here is copied from the hosted set: its held-out questions stay
371+
private so they keep measuring. A round counts
372+
**turns** as the runner asks them: a question once per persona it lists (once as the admin when
373+
it lists none), a dataset question once as the admin. A turn whose persona truth is `withheld`
374+
is a `forbidden` ask whatever kind its question names: the same question asked as a persona who
375+
may see it is the kind it names.
376+
377+
The loader holds each declaration to what the card states, and refuses one that does not fit,
378+
at the question's `askKind`:
379+
380+
| `askKind` | The question asks | Held to |
381+
|:---|:---|:---|
382+
| `count` | one figure over the matching rows: how many, how much | a count, sum, average, minimum or maximum with no `groupBy` |
383+
| `group_sum` | a figure per value of a field | a count, sum, average, minimum or maximum with a `groupBy` |
384+
| `top_n` | a ranking: the first N rows or groups by a measure | a `topN` truth |
385+
| `time_range` | a figure over a time window | a filter with `in_window` |
386+
| `join` | a figure that reads across a lookup | a filter or `groupBy` on a relation path (`order.status`) |
387+
| `owner_latest` | who holds a row or acted on it: an owner, an approver, a follow-up | a `groupBy` ending on a person field: a declared lookup to an object a persona's `record` names, or a declared user-handle field |
388+
| `business_term` | a business word that names exactly one governed metric | a `metric_selected` dataset question |
389+
| `ambiguous` | a word that names more than one metric, or none exactly | an `asked_back` dataset question |
390+
| `forbidden` | asked as a persona who may not see what it reads | declared only when every persona it lists is withheld from it; any withheld turn counts |
391+
| `unanswerable` | what the data cannot answer | exactly the questions whose truth is `unanswerable` |
392+
393+
A `fallback_labelled` dataset question names the figure kind it asks (`count`, `group_sum`,
394+
`top_n`, `time_range`, `join` or `owner_latest`). A card that names no kind loads as it did before
395+
kinds existed, with dataset questions or without; the open dataset cards name every one.
396+
397+
**What the open dataset cards ask, per kind** (turns of one round, each asked once;
398+
`packages/qa/scenarios/test/dataset-cards.test.ts` holds the cards to these figures, so a card edit
399+
that moves one changes the test and this table together):
400+
401+
| Kind | `order_to_cash` | `travel_expense` | Total |
402+
|:---|---:|---:|---:|
403+
| `count` | 3 | 3 | 6 |
404+
| `group_sum` | 2 | 3 | 5 |
405+
| `top_n` | 1 | 1 | 2 |
406+
| `time_range` | 1 | 1 | 2 |
407+
| `join` | 2 | 2 | 4 |
408+
| `owner_latest` | 2 | 1 | 3 |
409+
| `business_term` | 2 | 2 | 4 |
410+
| `ambiguous` | 2 | 2 | 4 |
411+
| `forbidden` | 1 | 2 | 3 |
412+
| `unanswerable` | 1 | 1 | 2 |
413+
414+
Every kind is asked at least twice, every question in Chinese and English. The `forbidden` turns
415+
are the leak reading: `collected_by_team_last_30_days` as `sales_rep` and `department_budgets` as
416+
`employee` (members whose field or object the card hides), and `trips_by_status` as
417+
`finance_officer`. Each runs under the platform's default object-schema masking (ADR-0106 D8), so
418+
for these personas the hidden field or object does not exist in their schema, and a correct reply
419+
declines without stating a withheld figure. The question that a field-level-security withheld
420+
field is said to be "not visible to you" rather than blank needs a caller who is served the whole
421+
schema (ADR-0106 D4) or a deployment with masking off (D8); the runner's personas are plain
422+
members on a default deployment, so no open card asks it yet.
423+
424+
The run record carries each turn's kind (`askKind` on every question and dataset-question
425+
result), and the scorecard counts the round kind by kind (`Run · kinds`,
426+
[the package README](../../../packages/qa/scenarios/README.md#running-the-cards--objectstackscenariosrunner)).
427+
365428
## Verified builds
366429

367430
The ask round measures the MCP door, not authoring, so it runs every day on the same build: each

‎docs/qa/scenarios/builds/travel_expense.provenance.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"card": "travel_expense",
3-
"cardSha256": "abe91b8f794f19d88ff72c8cda58e314f69e3c5d77992a01cecea501303d4f28",
3+
"cardSha256": "29162eefb46055941a0263686c2853246b4c408d41acb90c6abe22f68886a768",
44
"build": "travel_expense.json",
55
"sha256": "5fe6f452d36fe56a0ecf0f8c782394076953baeb99ef2499763991e119a29989",
66
"runner": "ec227fc7",

‎docs/qa/scenarios/order_to_cash.json‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@
735735
{
736736
"id": "open_receivables",
737737
"ask": {"zh": "目前应收账款还有多少没收回来?", "en": "How much is still outstanding on open and partially paid invoices?"},
738+
"askKind": "count",
738739
"object": "invoice",
739740
"truth": {
740741
"kind": "sum",
@@ -746,6 +747,7 @@
746747
{
747748
"id": "receivables_aging",
748749
"ask": {"zh": "未收余额按账龄分段各有多少?", "en": "How does the outstanding balance break down by aging bucket?"},
750+
"askKind": "group_sum",
749751
"object": "invoice",
750752
"truth": {
751753
"kind": "sum",
@@ -758,13 +760,15 @@
758760
{
759761
"id": "orders_by_status",
760762
"ask": {"zh": "各个状态的销售订单各有多少张?", "en": "How many sales orders are in each status?"},
763+
"askKind": "group_sum",
761764
"object": "sales_order",
762765
"truth": {"kind": "count", "groupBy": "status"},
763766
"personas": ["sales_rep"]
764767
},
765768
{
766769
"id": "top_accounts_billed",
767770
"ask": {"zh": "开票金额最多的三个客户是哪几个?", "en": "Which three accounts have been invoiced the most?"},
771+
"askKind": "top_n",
768772
"object": "invoice",
769773
"truth": {
770774
"kind": "topN",
@@ -781,6 +785,7 @@
781785
"zh": "最近 30 天的回款按客户负责人所在的销售团队各是多少?",
782786
"en": "How much has been collected in the last 30 days, per sales team of the account owner?"
783787
},
788+
"askKind": "time_range",
784789
"object": "payment",
785790
"truth": {
786791
"kind": "sum",
@@ -796,6 +801,7 @@
796801
"zh": "已确认和已履约订单的明细金额按产品类别各是多少?",
797802
"en": "On confirmed and fulfilled orders, how much has been booked per product category?"
798803
},
804+
"askKind": "join",
799805
"object": "order_line",
800806
"truth": {
801807
"kind": "sum",
@@ -810,6 +816,7 @@
810816
"zh": "逾期未收的余额分别在哪位销售代表的客户名下,各多少?",
811817
"en": "Whose accounts hold the overdue balance, and how much each?"
812818
},
819+
"askKind": "join",
813820
"object": "invoice",
814821
"truth": {
815822
"kind": "sum",
@@ -826,6 +833,7 @@
826833
{
827834
"id": "so_0120_waiting_on",
828835
"ask": {"zh": "订单 SO-0120 现在在等谁审批?", "en": "Who is order SO-0120 waiting on for approval?"},
836+
"askKind": "owner_latest",
829837
"object": "sales_order",
830838
"truth": {
831839
"kind": "count",
@@ -842,6 +850,7 @@
842850
"zh": "最近两周谁跟进过 Harbor Foods,各跟进了几次?",
843851
"en": "Who has followed up with Harbor Foods in the last two weeks, and how many times each?"
844852
},
853+
"askKind": "owner_latest",
845854
"object": "activity",
846855
"truth": {
847856
"kind": "count",
@@ -855,6 +864,7 @@
855864
{
856865
"id": "september_commission",
857866
"ask": {"zh": "九月份的订单销售代表一共能拿多少提成?", "en": "How much commission do the reps earn on September's orders?"},
867+
"askKind": "unanswerable",
858868
"object": "sales_order",
859869
"truth": {
860870
"kind": "unanswerable",
@@ -1068,11 +1078,11 @@
10681078
}
10691079
],
10701080
"datasetQuestions": [
1071-
{"id": "dq_bookings", "ask": {"zh": "我们的订单金额合计是多少?", "en": "What do our bookings add up to?"}, "words": ["bookings", "订单金额"], "expect": {"kind": "metric_selected", "dataset": "order_book", "measure": "booked_amount"}},
1072-
{"id": "dq_receivables", "ask": {"zh": "我们的应收账款还有多少?", "en": "How much do we have in receivables?"}, "words": ["receivables", "应收账款"], "expect": {"kind": "metric_selected", "dataset": "billing", "measure": "open_balance"}},
1073-
{"id": "dq_revenue", "ask": {"zh": "我们的总营收是多少?", "en": "What is our total revenue?"}, "words": ["revenue", "营收"], "expect": {"kind": "asked_back", "reason": "ambiguous", "candidates": [{"dataset": "order_book", "measure": "booked_amount"}, {"dataset": "billing", "measure": "billed_amount"}]}},
1074-
{"id": "dq_booking_total", "ask": {"zh": "我们的成交合计是多少?", "en": "What is our booking total?"}, "words": ["booking", "成交"], "expect": {"kind": "asked_back", "reason": "near_miss", "candidates": [{"dataset": "order_book", "measure": "booked_amount"}]}},
1075-
{"id": "dq_payment_count", "ask": {"zh": "我们一共收到了多少笔付款?", "en": "How many payments have we received?"}, "words": ["payments", "付款"], "expect": {"kind": "fallback_labelled", "object": "payment"}}
1081+
{"id": "dq_bookings", "ask": {"zh": "我们的订单金额合计是多少?", "en": "What do our bookings add up to?"}, "askKind": "business_term", "words": ["bookings", "订单金额"], "expect": {"kind": "metric_selected", "dataset": "order_book", "measure": "booked_amount"}},
1082+
{"id": "dq_receivables", "ask": {"zh": "我们的应收账款还有多少?", "en": "How much do we have in receivables?"}, "askKind": "business_term", "words": ["receivables", "应收账款"], "expect": {"kind": "metric_selected", "dataset": "billing", "measure": "open_balance"}},
1083+
{"id": "dq_revenue", "ask": {"zh": "我们的总营收是多少?", "en": "What is our total revenue?"}, "askKind": "ambiguous", "words": ["revenue", "营收"], "expect": {"kind": "asked_back", "reason": "ambiguous", "candidates": [{"dataset": "order_book", "measure": "booked_amount"}, {"dataset": "billing", "measure": "billed_amount"}]}},
1084+
{"id": "dq_booking_total", "ask": {"zh": "我们的成交合计是多少?", "en": "What is our booking total?"}, "askKind": "ambiguous", "words": ["booking", "成交"], "expect": {"kind": "asked_back", "reason": "near_miss", "candidates": [{"dataset": "order_book", "measure": "booked_amount"}]}},
1085+
{"id": "dq_payment_count", "ask": {"zh": "我们一共收到了多少笔付款?", "en": "How many payments have we received?"}, "askKind": "count", "words": ["payments", "付款"], "expect": {"kind": "fallback_labelled", "object": "payment"}}
10761086
]
10771087
},
10781088
"iterate": {

0 commit comments

Comments
 (0)