Repository navigation
Commit bd22740
fix(scenarios): scorer and card defects from the 18.6.0 gallery refresh (#36320)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_
Part of #36206 (items 1, 4, 5, 6, 7, 8 and the operand-shown half of
item 2 land here; item 3 and the column-total half of item 2 wait on a
decision, see Acceptance notes).
Clause-②: yes (widening) — new exports
`confirmTurnMetNoConfirmationService` and `SEED_POSTURE` on the
`./runner` entry
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:评测席位跑场景卡时,三类本不该扣的分不再扣,四张卡的数据和提示词更正,其余用户无感。
- 为什么做:场景库专题(画廊刷新)中,模型做对了却被判错或被判"无法测量",分数里混进了评分器和卡片自己的错。
- 出错会怎样:最坏是某次评测把一个本该判错的回答判成"未测"或判对,只影响评测分数,改动可直接撤回。
- 要你做什么:审批步骤走卡片自带动作时是否算作有效授权,以及拒答里能否写出某一列的合计,两件需要你拍板。
## What changes
One commit per item; each conclusion below is against `origin/main`
4ab1218.
| Item | Conclusion |
|:--|:--|
| 1. confirm turn after a first-turn `428 no_confirmation_service` |
**changed** — `confirmTurnMetNoConfirmationService`
(`src/runner/orchestrate.ts`): the confirmed write is not measured when
the confirm turn's own write met that 428 (as before) OR the first
turn's write met it and the confirm turn sent no write on the object. A
confirm turn that does write is graded as any other. PR #36140 (merged
for #35907) covered only the first leg: its diff marks not-measured from
`writeCallsOn(second, ...)` alone. |
| 2. decline graded "a figure the data cannot support" for derived
numbers | **changed, half** — `supportedNumbers`
(`src/score/scenario-run-grade.ts`): a number in an `unanswerable`
decline is supported when it is the sum or difference of two OTHER
numbers the reply writes that the turn's outputs carry (54.5 = 45.5 + 9;
229 = 249 - 20). Operands must stand in the reply, one step only, a zero
from two equal figures supports nothing. The column-total half
($125,190) is **not** changed: it contradicts a pinned case in the same
suite ("an amount summed from the rows still fails: a sum is not a
count"), so it is an open question. |
| 3. `persona-grant:dept_manager:*_approval_step:update` vs the card's
own `decide_approval_step` | **not changed — needs a decision.** The
check treats only a card action with `confirm: true` as a designed
route; the suite pins the opposite case on purpose ("The card's action
without `confirm` is no designed route: the check is measured", and
`start_qa` stays measured beside `set_task_status`). Accepting
`decide_approval_step` reverses that pin. |
| 4. requisition_to_receipt `supplier.rating` seeded `A`/`B`/`C` |
**changed** — seeded `grade_a`/`grade_b`/`grade_c` (no truth reads the
field). New library guard: every seed value of a card's `selectFields`
field parses as a `SelectOptionSchema` value. |
| 5. travel_expense `as_118_2.decided_on` after `asOf` | **changed** —
`2026-11-02` to `2026-10-31` (no truth reads step dates). New library
guard: per card, the seed fields dated after `asOf` are pinned (all are
plans: due, start, end, expected). |
| 6. service_desk `urgent_high_last_30_days` off by one | **changed
(card data)** — TK-0091 and its three comments move one day later, so no
urgent or high ticket sits on 2026-10-01, the day the platform's
`last_30_days` preset (`['30_days_ago', 'tomorrow')`,
`packages/core/src/utils/analytics-date-range.ts`) counts and the card's
30-day window does not; truth 8 to 9, seed rule `$comment` names the
exception. The card's `last_days` semantics are untouched. New library
guard: no `last_days` truth changes when its window is widened by the
preset's extra day. |
| 7. service_desk Build two checks short | **changed** — the detailed
prompt (en + zh) now asks for a report of tickets by agent group and
priority, and names a computed value (days to resolve, from the opened
and resolved dates). New library guard: every card tagged
`dashboards.report` asks for a report in both languages. |
| 8. data contract says rows load "through the data API" | **changed
(contract text only)** — `SEED_POSTURE` in `src/runner/prompts.ts`: rows
load through the platform's seed path as established facts, no
record-triggered flow fires, so a derived field must be a formula or a
write-time expression; a loaded row is already counted in stored totals.
Seeding behaviour is unchanged. |
Read first (by risk): `src/score/scenario-run-grade.ts`
`supportedNumbers` (the grader widening), `src/runner/orchestrate.ts`
`confirmTurnMetNoConfirmationService`,
`docs/qa/scenarios/service_desk.json` (seed move + prompt).
Two-minute check: `pnpm --filter @objectstack/scenarios exec vitest run
--maxWorkers=2 test/library.test.ts` shows 19 passed, including the four
new guards.
## Tests
- New: item 1, three cases in `test/runner/orchestrate.test.ts`
(first-turn 428 + no write: not measured; + a write: graded;
other-reason 428 + no write: measured fail). Item 2, five cases in
`test/score/scenario-run-grade.test.ts`. Items 4-7, four guards in
`test/library.test.ts`. Item 8, one case in `test/runner/units.test.ts`.
Item 6, the service_desk truth pin 8 to 9.
- Whole package at the final head: `typecheck` clean, `test` 42/42 files
and 1293 tests passing across two runs (the first run's 14 skips are the
two build files' tests, which pass once the package is built) — see
Verification.
## Acceptance notes
- **Item 2, column totals (open question).** Options: (A) accept a
whole-column sum of one returned list as served, and rewrite the pinned
"a sum is not a count" case; (B) keep it refused and have the cards say
a decline may only quote figures as served; (C) leave both. The recorded
replies are not in the repository, so whether the three flagged replies
wrote their operands (and so pass under this change) is NOT MEASURED;
the tests use replies modeled on the card's description.
- **Item 3 (open question).** Options: (A) any card-declared agent
action on the object routes an `applied` write too (reverses the pinned
`confirm`-only rule); (B) keep the rule, and the leave_balances /
requisition_to_receipt prompts tell the build to grant the manager
`update` on `approval_step`; (C) a card-schema opt-in naming the
operation's route action, so only operations the card designs through an
action leave the check to the run.
- **Same family as item 6, outside this card's files:** order_to_cash
`collected_by_team_last_30_days` has PAY-0044 on 2026-10-01. The new
guard enumerates it as the one remaining position, so fixing it turns
that pin red by design.
## Verification
<details><summary>Item 1 ablation (orchestrate.ts, fix committed
first)</summary>
`node scripts/ablation-replace.mjs --file
packages/qa/scenarios/src/runner/orchestrate.ts --anchor ' || (firstMet
&& writes.length === 0)' --delete -- ... vitest run
test/runner/orchestrate.test.ts -t 'two turns'`: mutation landed (anchor
1 to 0, blob f58c077 to c72e3bd35891); the new not-measured case
failed (1 failed, 14 passed); restored, blob == HEAD, `git diff HEAD`
empty.
</details>
<details><summary>Item 2 ablation (scenario-run-grade.ts)</summary>
First attempt was a no-op refused by the tool (replacement text was a
substring of the anchor, rise 0); rerun with `--anchor ' ||
values.some((n) => derived(n, at))' --delete`: mutation landed (blob
9a3cb9e to 78d0020365c7); the sum and difference cases failed (2
failed, 3 passed); restored, blob == HEAD, `git diff HEAD` empty.
</details>
<details><summary>Items 4-6 reverse verification (base card
data)</summary>
With the three cards restored from 4ab1218 (tree only),
`test/library.test.ts`: 3 failed, 15 passed — the select-value guard
listed six `supplier.rating` values, the asOf guard and the window guard
(`service_desk/urgent_high_last_30_days`) went red; `git checkout HEAD
-- docs/qa/scenarios/` then `git diff HEAD` empty and status clean.
</details>
<details><summary>Package suite and derived gates at c621cbb</summary>
- `pnpm --filter @objectstack/scenarios typecheck`: clean. `pnpm
--filter @objectstack/scenarios test`: 40/42 files on the first run, the
two `test/build/*` files refusing for a missing own `dist/`; after `pnpm
--filter @objectstack/scenarios build` both pass (2/2 files, 14 tests).
Total 42/42 files, 1279 + 14 = 1293 tests passed.
- `node scripts/pm/dispatch-gates.mjs --commands` derived 69 commands;
all run, exit codes captured before any pipe; `--ran` reconciliation: 69
accounted, 67 run, 2 NOT MEASURED (exit 3, prerequisite):
`check-plugin-teardown-shape.mjs --self-test` (positive control pinned
to a commit this shallow checkout cannot reach) and
`check:dual-build-cjs-loads` (needs every package's `dist/`). Both are
left to CI.
- `test:repo` and the full lint farm are CI's.
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 3
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY)_
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRY38EZf38Yy3zthbY -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2b57044 commit bd22740
12 files changed
Lines changed: 260 additions & 26 deletions
File tree
- .changeset
- docs/qa/scenarios
- packages/qa/scenarios
- src
- runner
- score
- test
- runner
- score
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
870 | | - | |
| 870 | + | |
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
467 | 486 | | |
468 | 487 | | |
469 | 488 | | |
| |||
1967 | 1986 | | |
1968 | 1987 | | |
1969 | 1988 | | |
1970 | | - | |
| 1989 | + | |
1971 | 1990 | | |
1972 | 1991 | | |
1973 | 1992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
446 | 465 | | |
447 | 466 | | |
448 | 467 | | |
449 | 468 | | |
450 | 469 | | |
451 | 470 | | |
452 | | - | |
| 471 | + | |
453 | 472 | | |
454 | 473 | | |
455 | 474 | | |
456 | 475 | | |
| 476 | + | |
| 477 | + | |
457 | 478 | | |
458 | 479 | | |
459 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
346 | 369 | | |
347 | 370 | | |
348 | 371 | | |
| |||
949 | 972 | | |
950 | 973 | | |
951 | 974 | | |
952 | | - | |
953 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
954 | 979 | | |
955 | | - | |
| 980 | + | |
956 | 981 | | |
957 | 982 | | |
958 | 983 | | |
| |||
1008 | 1033 | | |
1009 | 1034 | | |
1010 | 1035 | | |
1011 | | - | |
| 1036 | + | |
1012 | 1037 | | |
1013 | 1038 | | |
1014 | 1039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
163 | 242 | | |
164 | 243 | | |
165 | 244 | | |
| |||
0 commit comments