Skip to content

fix(scenarios): scorer and card defects from the 18.6.0 gallery refresh - #36320

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-36206-gallery-refresh-scorer-card-defects
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-36206-gallery-refresh-scorer-card-defects

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
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

Item 1 ablation (orchestrate.ts, fix committed first)

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 f58c0772bd62 to c72e3bd35891); the new not-measured case failed (1 failed, 14 passed); restored, blob == HEAD, git diff HEAD empty.

Item 2 ablation (scenario-run-grade.ts)

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 9a3cb9e8247e to 78d0020365c7); the sum and difference cases failed (2 failed, 3 passed); restored, blob == HEAD, git diff HEAD empty.

Items 4-6 reverse verification (base card data)

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.

Package suite and derived gates at c621cbb
  • 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.
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

Generated by Claude Code

… met 428 no_confirmation_service and the confirm turn did not retry

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…ce of two served figures it also writes

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…cided steps on or before asOf, and move TK-0091 off the 30-day boundary

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…ue its Build half grades

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
…d path, where no record-triggered flow fires

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

7 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 3f7fdd002130a34ce24f735733c2642538914af9 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 17c97b013eab68c5fc529aa18911b7c396e2dbfe — the merge of head 101b30bb3518941c8c696c6b6e29f0a8974c2489 into base 3f7fdd002130a34ce24f735733c2642538914af9, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 17c97b013eab68c5fc529aa18911b7c396e2dbfe && git checkout 17c97b013eab68c5fc529aa18911b7c396e2dbfe
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f7fdd002130a34ce24f735733c2642538914af9 101b30bb3518941c8c696c6b6e29f0a8974c2489 && git checkout -B drift-repro 3f7fdd002130a34ce24f735733c2642538914af9 && git merge --no-ff 101b30bb3518941c8c696c6b6e29f0a8974c2489

node scripts/docs-audit/affected-docs.mjs --json 3f7fdd002130a34ce24f735733c2642538914af9

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 101b30bb3518941c8c696c6b6e29f0a8974c2489
Local-runs: none
Scope: packages/qa/scenarios/src/runner/orchestrate.ts, packages/qa/scenarios/src/runner/prompts.ts, packages/qa/scenarios/src/runner/index.ts (re-exports), packages/qa/scenarios/src/score/scenario-run-grade.ts
Security-touching: no

Owed on the Clause-②: yes (widening) declaration alone (no packages/spec/src/**, no governed path): the lane seat's in-seat review at TIER_DEFAULT. The declaration was no at c621cbb; the seat's L1 corrected it (head 101b30b changes the changeset line only; the PR body was patched by the seat).

① Derived judgments

  • Public surface widened, as now declared. Right. Through ./runner (src/runner/index.ts re-exports ./orchestrate.js and ./prompts.js): confirmTurnMetNoConfirmationService(firstMet, turn, object) and SEED_POSTURE. supportedNumbers in scenario-run-grade.ts is module-private. No export removed or renamed.
  • Grading accept set: one widening, bounded. Right. An unanswerable decline may now state the sum or difference of two figures the turn's tool outputs carry, only when the reply writes both operands; one step only; no products, ratios, derived-of-derived, or a zero from two equal figures. The pinned "⛔ an amount summed from the rows still fails: a sum is not a count" still holds (column totals stay refused; that half is in the decision inbox on Scenario scorer and card defects from the 18.6.0 gallery refresh (2026-11-21) #36206).
  • Not-measured widening, bounded. Right. confirmTurnMetNoConfirmationService adds exactly one case: first turn met 428 … no_confirmation_service AND the confirm turn sent no write on the object. A confirm turn that writes is graded as before; ablation of the new disjunct turns its test red (1 failed / 14 passed).
  • Seed contract is text, behaviour unchanged. Right. SEED_POSTURE describes the existing seed path (seedApp); no seeding code changed.

② Semver level

.changeset/36206-gallery-refresh-scorer-card-defects.md: @objectstack/scenarios patch; Metadata-protocol: none takes patch — matches. Clause-②: yes (widening) and Metadata-protocol: none are line-initial in body and changeset.

③ Boundary flags

open_questions (item 3, item 2's column totals) are in the decision inbox on #36206 (7075224602), not taken here. The PAY-0044 same-family position is folded into #36206. The PR is Part of #36206.

Implemented-by: claude/issue-36206-gallery-refresh-scorer-card-defects
Reviewed-by: session_01ADHkmRY38EZf38Yy3zthbY

No must-fix, no should-fix.

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

席位核对

L1 verdict: ACCEPT at head 101b30bb35 (seat repo:objectstack#2, reviewer of record). First L1 at c621cbb was REWORK on one item (the Clause-② declaration); the delta 101b30b changes that changeset line only.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 06:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

Landing note: landing-k.mjs read K = 18 (≥ 15, merge main first) only after the arming stroke; the seat's pr_update_branch (expected head 101b30b) was refused because the PR had already entered the merge queue (06:58:47Z). It stays queued: the queue's merge_group build runs on the current main. If the queue kicks it, the seat merges main and re-arms after a green re-run.

247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…ugh (via) (objectstack-ai#36503)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_
Part of objectstack-ai#36206 (item 3 and the PAY-0044 position land here; the
column-total half of item 2 waits on the eval seat's re-score and stays
open on the card).

Clause-②: yes (widening)
Metadata-protocol: none
Ruling-ref: 7077801044 (item 3 C, PAY-0044 folded)

## 维护者速读

-
用户能看到什么变化:评测席位跑场景卡时,经理通过卡片自带的审批动作做决定的那一步,搭建分不再因经理没有直接改审批记录的权限而被扣,改记为“未测”;其余用户无感。
- 为什么做:场景库专题(画廊刷新)里请假余额和采购到收货两张卡,搭建正确却被扣分;顺带修正订单到回款卡上一笔付款落在“近 30
天”边界日、导致卡片答案与平台口径不一致的问题。
- 出错会怎样:最坏是某张卡的这一项授权检查被记为“未测”而不是“失败”,只影响评测分数,改动可直接撤回。
- 要你做什么:无。

## What changes

Against `origin/main` 59392ed.

| Part | Change |
|:--|:--|
| Card schema | An operation may carry `via`: the card's own agent
action the write is designed to go through. Optional; a card without it
reads exactly as before. |
| Loader | Refuses a `via` that is not one of the card's
`run.agentActions` on the operation's object (the ruled check), and a
`via` on a `refused` operation (a refused write has no route; without
this the key would be accepted and do nothing). |
| Grant grading (`gradePersonaGrants`) |
`persona-grant:PERSONA:OBJECT:VERB` is **not measured, never a pass**,
when the set withholds the verb AND every operation that needs it has a
designed route the build declares: its `via` action, or (unchanged) the
card's confirm-gated action for a `pending_confirmation` write. A set
that grants the verb still passes. An operation without `via` is graded
as today, so one unrouted applied write of the same verb keeps the check
measured. The existing confirm-gated branch and its detail text are
unchanged; the `no designed route` pin (`start_qa`, non-confirm action,
no `via`) stays green. |
| Cards | `via: decide_approval_step` on leave_balances
`manager_approves_step_one`, requisition_to_receipt
`manager_approves_level_one` and travel_expense
`manager_approves_step_one`. Not tagged (no measured run yet):
asset_lifecycle `manager_approves_scrap`, order_to_cash
`approve_discount`. A library pin lists exactly the three tagged
operations. |
| PAY-0044 | order_to_cash's PAY-0044 moves from 2026-10-01 to
2026-10-02 (bank reference `ACH-1002-058`), the same one-day move PR
objectstack-ai#36320 gave TK-0091, and the seed rule names the exception. The library
pin of last-N-days truths that change under the platform's preset flips
to `[]`. `collected_by_team_last_30_days` west becomes 58300 (was 53500;
the payment now falls inside the card's 30-day window too). The only
other reader of `payment_date` is the collection-call automation check
(paid by due + 15 days), which reads the same for INV-1058 either way. |

`Clause-②: yes (widening)` reading: `src/index.ts` does `export * from
'./schema.js'`, so `OperationSchema` and `ScenarioCardSchema` are on the
package's `.` entry (`package.json` `exports["."]` maps to
`dist/index.*`); `PersonaGrantNeed` (gains `routedVia`) is on `./score`
via `export * from './scenario-tags.js'`.

**Read first (by risk):**
1. `packages/qa/scenarios/src/score/scenario-tags.ts`: `designedRoutes`
and the new branch at the top of `gradePersonaGrants`'s needed path; the
old confirm branch must read unchanged when no operation names `via`.
2. `packages/qa/scenarios/src/loader.ts`: the `via` block in the
operations loop.
3. `docs/qa/scenarios/order_to_cash.json`: PAY-0044 row and the
seed-rule sentence.

**Two-minute check:** `pnpm --filter @objectstack/scenarios exec vitest
run test/score/scenario-tags.test.ts test/refusals.test.ts
test/library.test.ts`, expect all green, including the new `an applied
write the card routes through its own action` case.

## Tests

- New `scenario-tags.test.ts` case: with the read-only contractor and
`start_qa` routed `via set_task_status`, the update check is not
measured with the named detail and counts in neither figure; a granting
set still passes; a build without the action keeps it measured (fails);
the card without `via` fails as before; a second unrouted update keeps
it measured.
- Three new `refusals.test.ts` rows: an undeclared action, the card's
action on another object, a `via` on a refused write.
- `library.test.ts`: the tagged-operations pin; the last-N-days pin
flipped to `[]`.
- `order-to-cash.test.ts`: the `collected_by_team_last_30_days` truth
updated to west 58300.

<details><summary>Package suite and typecheck (head bb187ca, merged
main)</summary>

```text
pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2
 Test Files  42 passed (42)
      Tests  1310 passed (1310)
os-verify-lock: VERDICT command-exit 0
```
The package's `typecheck` includes `test/**`. The commit after that one
adds only the changeset.
</details>

<details><summary>Ablations (one-time, restored to HEAD; not left in the
tree)</summary>

```text
grading: scenario-tags.ts `const via = n.routedVia.filter(...)` -> `const via: string[] = [];`
  ablation-replace: ok mutation landed: anchor 1 -> 0, blob 7ae784e -> 77cf0c9a74ac
  x an applied write the card routes through its own action (`via`) ...
  Tests  1 failed | 101 passed (102)   (the confirm-gated / no-designed-route pin stays green)
  ablation-replace: ok restored: blob == HEAD (7ae784e) and `git diff HEAD` is empty
loader: `if (op.via !== undefined) {` -> `if (op.via !== undefined && false) {`
  ablation-replace: ok mutation landed: anchor 1 -> 0, blob 2d93286 -> 8a1456983646
  Tests  3 failed | 118 passed (121)   (the three new refusal rows)
  ablation-replace: ok restored: blob == HEAD (2d93286) and `git diff HEAD` is empty
```
Both subjects resolve from `src/` (relative imports), so no rebuild sat
between mutation and run.
</details>

<details><summary>Derived gate families (head 8eb5896): 68 derived, 66
exit 0, 2 NOT MEASURED</summary>

`node scripts/pm/dispatch-gates.mjs --commands` (merge base 59392ed),
each run with its exit captured before any pipe, then `--ran` with the
codes: "68 derived famil(ies) accounted for — 66 run, 2 NOT-MEASURED (2
DERIVED from a recorded exit 3)".

- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: PREREQUISITE
NOT MET (reads built output of every package; this worktree built only
the scenarios closure). CI's `Lint & Repo Gates` runs it.
- NOT MEASURED: `pnpm check:type-check-debt`, reason: its closure build
never got a turn on the shared verify lock (queue-timeout, held by
another session's dogfood run). The diff touches no tsconfig or
typecheck script; the scenarios package typecheck is green above. CI's
`Lint & Repo Gates` runs it.
- Every other derived family exited 0, including `check:nul-bytes`,
`check:cross-package-test-inputs`, `check:published-files`,
`check:doc-authoring`, `check:issue-citations` and
`check:adr-0087-registration`.
- Full dogfood battery: not run (no `!` in the title, no `(narrowing)`
arm).
</details>

## Acceptance notes

- The loader's refusal of `via` on a `refused` operation goes one step
past the ruled text (which names only the not-an-action refusal).
Reason: grading reads `via` only on writes that need a grant, so on a
refused write the key would be accepted and ignored. It is a refusal on
a key that is new in this PR; no card writes it.
- Not tagged, by the ruling: asset_lifecycle `manager_approves_scrap`
(`decide_scrap_request`) and order_to_cash `approve_discount`
(`decide_discount_approval`) have the same decide-through-action shape,
but no measured run shows the grant check failing there yet.
- Item 2b (a decline stating a whole-column total) is not in this PR; it
waits on the eval seat's re-score of `september_commission`.

## Verification

Item 3 is graded on the next gallery refresh: leave_balances and
requisition_to_receipt Build and Iterate should read
`persona-grant:dept_manager:approval_step:update` as not measured when
the build routes the decision through `decide_approval_step` without
granting the update, and as passed when it grants it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY

<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRY38EZf38Yy3zthbY -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants