Repository navigation
feat(scenarios): a card names the agent action an operation goes through (via) - #36503
Conversation
…ugh (via) The Build grant check leaves a write the persona's set withholds to the run, never a pass, when the operation names the card's agent action as its route and the build declares that action. The loader refuses a via that is not one of the card's agent actions on the operation's object, and a via on a refused write. leave_balances, requisition_to_receipt and travel_expense name decide_approval_step on the manager's approval. PAY-0044 moves off 2026-10-01 so the card's last-30-days window and the platform's preset agree. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check9 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
Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 54a1b42b0d9830d60758381ecf978b8b6485d29d && git checkout 54a1b42b0d9830d60758381ecf978b8b6485d29d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9abc732132a2f723627d585b049e2cc10869db19 8eb5896ba5786b2c104de77c70291760f5608875 && git checkout -B drift-repro 9abc732132a2f723627d585b049e2cc10869db19 && git merge --no-ff 8eb5896ba5786b2c104de77c70291760f5608875
node scripts/docs-audit/affected-docs.mjs --json 9abc732132a2f723627d585b049e2cc10869db19 |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Contract-review-claim: Taking the review (declaration face, TIER_DEFAULT; returned to the lane by l2-review#4). |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Contract reviewServed-tier: Face: declaration ( ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 席位核对L1 verdict: ACCEPT at head
|
…d; run --template warns on a stale cardSha256 (objectstack-ai#37339) Fixes objectstack-ai#36491 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:只影响内部场景评测工具,差旅报销的已验证构建记录改成指向现在这张卡,评测跑在不匹配的记录上时会先提示一句。 - 属于场景卡评测的固定样本维护,替每日问数评测解决"记录指向旧卡"的问题。 - 出错时只是多一行或少一行提示,评测照常打分;改动可直接撤回。 - 无 ## What changes - `docs/qa/scenarios/builds/travel_expense.provenance.json`: `cardSha256` `29162eef…` -> `212abedb6b59a5ac0c6921c25bdcc4dc057cbc25e866a9cd2ed962920368a00d`, the sha256 of the raw bytes of `docs/qa/scenarios/travel_expense.json` on `dbc1765a24`. That is the hash the loader computes (`loader.ts` `fileSha256`, `createHash('sha256').update(bytes)`) and every run record stamps (`CardStamp`); there is no canonical form. The issue body names `a8a67be3…`; the card moved again since (objectstack-ai#36503 to `68eb89a9…`, objectstack-ai#36617 to `212abedb…`). - `packages/qa/scenarios/src/runner/cli.ts`: `templateProvenanceWarning(path, card)` reads `F.provenance.json` beside the `--template F` file; when it names the same card with another `cardSha256` (or none, or is not JSON), `run` prints a `warning: template provenance:` line before the card runs. It never refuses; a missing provenance or one for another card says nothing. It lives in the CLI entry, not the `./runner` export, so the published import surface is unchanged. - `packages/qa/scenarios/README.md`: one sentence under "Template and ask modes". - Changeset: `@objectstack/scenarios` patch. ## Acceptance notes - **Provenance honesty.** The build was authored from card `9d0c7dad…` (the card when objectstack-ai#35222 committed it). Practice since objectstack-ai#35764 and objectstack-ai#36065 has been to refresh `cardSha256` on a card edit with the build untouched, so the field reads as "the card this fixture is current against", while objectstack-ai#36617's body reads it as "the card at build time". This PR follows the practice. Measured to back it: between `9d0c7dad…` and `212abedb…` only the card's `prompt` and `run` keys differ; `expect` and `iterate` are byte-identical (top-level `JSON.stringify` compare). A scratch `scoreGraph(artifactToEvalGraph(build), expect)` re-score gives 61/61 on both the `29162eef…` card and the current one. So the `verified` scores still hold for the current card, but `built`/`author` describe a run made against an older prompt (the step-two routing prose from objectstack-ai#35098 and the record-triggered flow prose from objectstack-ai#36617 are not in it). The provenance still does not record that, and this PR does not add a field for it. - **Other provenances.** `builds/` holds one provenance, so there are no others to refresh. - **Not in this PR: a fixture pin.** I wrote a test that reads `docs/qa/scenarios/builds/` and holds each `cardSha256` equal to its card. That turns the next stale card edit into a red CI run, not only a run-time warning. `check:cross-package-test-inputs` refused it because the radius is undeclared, and declaring it means editing `scripts/cross-package-test-inputs.mjs` and the root `turbo.json`, both outside this card's file surface. I left it out. - **Open PR objectstack-ai#37314** changes `docs/qa/scenarios/builds/travel_expense.json` (`protocol ^18 -> ^19`) without touching the provenance. Once it lands, the provenance's `sha256` (`4ab7e603…`) no longer matches the build file, and no `amended` entry records the change. That PR does not overlap these files. ## Verification First read (by risk): 1. `packages/qa/scenarios/src/runner/cli.ts`, `templateProvenanceWarning`: when it stays silent and when it warns. 2. `docs/qa/scenarios/builds/travel_expense.provenance.json`: the one-line hash change. Two-minute check: `sha256sum docs/qa/scenarios/travel_expense.json` prints `212abedb6b59a5ac…`, the same value the provenance now holds. <details><summary>Tests and gates (head 0d4f42e)</summary> - `os-verify-lock.sh -c "pnpm --filter @objectstack/scenarios build && … typecheck && … test"` on `af13a9a6a5` (the test/src tree of the final head): VERDICT command-exit 0; Test Files 43 passed (43), Tests 1342 passed (1342). - Ablation (committed first, restored with `git checkout HEAD --`, `git diff HEAD` empty, blob hash matched): `scripts/ablation-replace.mjs` replaced `if (provenance.cardSha256 === card.sha256) return undefined;` with `return undefined;` (anchor 1 -> 0). `test/runner/template-provenance.test.ts` then went 2 failed / 4 passed, the two warning cases red. - `node scripts/pm/dispatch-gates.mjs --commands` on `af13a9a6a5`: 65 commands, all run; `--ran` reconciliation: 65 derived, 65 run, 0 UNRUN. Non-zero: `check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (needs a whole-workspace build, so NOT MEASURED locally; CI runs it). `check:dts-closure` exit 1 in the batch because `plugin-audit` dist was half-built in this shared tree; after `pnpm --filter @objectstack/plugin-audit build` it exits 0. On `0d4f42ec49` (changeset declaration lines only) the changeset family ran again: `check-changeset-no-major`, `check-empty-changeset`, `check-adr-0087-registration`, `check:changeset-gate-self-tests` and `check:nul-bytes` all exit 0. - `scripts/pm/overlap-check.mjs`: VERDICT clean exit 0. objectstack-ai#37314's file list does not intersect this diff. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr --------- Co-authored-by: Claude <noreply@anthropic.com>
…igure (objectstack-ai#37624) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuRFAatVcx79d6cbkTpzPfYU)_ Part of objectstack-ai#36206 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:评测场景卡的评分器不再把回复里用排版连字符写的日期(如 2026‑09‑01)当成三个数字扣分,普通短横写法不变。 - 属于「评测与场景卡」专题,修画廊重跑里报出的一处误判:正确的拒答被判成「说了数据支撑不了的数」。 - 只影响评测打分,不碰平台运行时;出错最多是某轮评测分数读偏,撤回这个 PR 即恢复原样。 - 无。 ## What changes - `packages/qa/scenarios/src/score/scenario-run-grade.ts`: `ISO_DATE`, the pattern `readingsIn` blanks before it reads a reply's figures, now joins a date's parts by the ASCII hyphen or by the two Unicode hyphens a typeset reply writes in its place (U+2010 hyphen, U+2011 non-breaking hyphen). Before, only the ASCII hyphen matched, so a date written as `2026`-U+2011-`09`-U+2011-`01` was read as the figures 2026, 9 and 1. - One pin in the existing ISO-date block of `test/score/scenario-run-grade.test.ts`: both hyphens read as a date, and a figure range joined by U+2011 (`12`-U+2011-`15`) still reads as two figures. - One changeset, `@objectstack/scenarios` patch. ## Why The 18.6.0 gallery re-run comment on the card (2026-11-22 22:56Z, item 2b evidence, "Minor") reports a reply that wrote `2026-09-01` with U+2011 non-breaking hyphens, so `ISO_DATE` missed it and 9, 1 and 30 were read as figures. A correct decline is then graded "stated a figure the data cannot support". The premise held at `origin/main` 54d6726 (`scenario-run-grade.ts:123`, pattern ASCII hyphen only). Every other item of the card landed earlier: items 1, 2 (operands shown) and 4-8 in objectstack-ai#36320; item 3 and PAY-0044 in objectstack-ai#36503 and objectstack-ai#37047; item 2b is answered by the maintainer ruling recorded on the card (read C, no grader change). This PR widens no total and does not touch that ruling: it only keeps a date from being read as figures. ## Tests <details><summary>Package suite, typecheck, ablation (head 0eb6af3)</summary> - Through `os-verify-lock`: `pnpm --filter @objectstack/scenarios build && … typecheck && … exec vitest run --maxWorkers=2` → `VERDICT command-exit 0`; Test Files 43 passed (43), Tests 1345 passed (1345). - Ablation (`scripts/ablation-replace.mjs`, the test imports `src` by relative path, so no dist leg): `ISO_DATE`'s two hyphen classes put back to the ASCII `-`, anchor 1 → 0, blob `1854ffadf399` → `1ed8647e5c30`; `test/score/scenario-run-grade.test.ts`: 1 failed | 88 passed, the failing case being the new pin; restored blob `1854ffadf399` equals HEAD, `git diff HEAD` empty. A first attempt was an anchor miss the tool refused before running anything (the shell had turned the escape spelling in the anchor into the characters), so it measured nothing; the counted run built the anchor in a script. </details> ## Acceptance notes - `IDENTIFIER_TOKEN` still joins an identifier's parts by the ASCII `-` and `_` only, so an id written with U+2011 (`INV`-U+2011-`003`) would read its digits as a figure. No run has shown it; noted, not changed. - The other observations on the card's re-run comments stay as they are, with zero measured pull: the `via` on the two same-shaped decide operations (asset_lifecycle `manager_approves_scrap`, order_to_cash `approve_discount`), the asset_lifecycle 23/6 count (the card holds no second source: its 30 laptops are 24 in use, 5 in stock, 1 in repair), and per-group totals (the ruling refuses that widening). - The card's done-when is a gallery re-run on 18.6.0, which belongs to the eval lane; this PR does not close the card. ## Verification - Two minutes: `pnpm --filter @objectstack/scenarios exec vitest run test/score/scenario-run-grade.test.ts -t "Unicode hyphen"` → 1 passed. - Read first: the `ISO_DATE` line in `scenario-run-grade.ts` (the only behaviour change). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (no new names) - [x] 3. No formatter ran; `pnpm lint` passes. (CI) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgTESANUPsJKDqEn4zY)_ Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Part of #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)
维护者速读
What changes
Against
origin/main59392ed.via: the card's own agent action the write is designed to go through. Optional; a card without it reads exactly as before.viathat is not one of the card'srun.agentActionson the operation's object (the ruled check), and aviaon arefusedoperation (a refused write has no route; without this the key would be accepted and do nothing).gradePersonaGrants)persona-grant:PERSONA:OBJECT:VERBis not measured, never a pass, when the set withholds the verb AND every operation that needs it has a designed route the build declares: itsviaaction, or (unchanged) the card's confirm-gated action for apending_confirmationwrite. A set that grants the verb still passes. An operation withoutviais 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; theno designed routepin (start_qa, non-confirm action, novia) stays green.via: decide_approval_stepon leave_balancesmanager_approves_step_one, requisition_to_receiptmanager_approves_level_oneand travel_expensemanager_approves_step_one. Not tagged (no measured run yet): asset_lifecyclemanager_approves_scrap, order_to_cashapprove_discount. A library pin lists exactly the three tagged operations.ACH-1002-058), the same one-day move PR #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_dayswest becomes 58300 (was 53500; the payment now falls inside the card's 30-day window too). The only other reader ofpayment_dateis 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.tsdoesexport * from './schema.js', soOperationSchemaandScenarioCardSchemaare on the package's.entry (package.jsonexports["."]maps todist/index.*);PersonaGrantNeed(gainsroutedVia) is on./scoreviaexport * from './scenario-tags.js'.Read first (by risk):
packages/qa/scenarios/src/score/scenario-tags.ts:designedRoutesand the new branch at the top ofgradePersonaGrants's needed path; the old confirm branch must read unchanged when no operation namesvia.packages/qa/scenarios/src/loader.ts: theviablock in the operations loop.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 newan applied write the card routes through its own actioncase.Tests
scenario-tags.test.tscase: with the read-only contractor andstart_qaroutedvia 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 withoutviafails as before; a second unrouted update keeps it measured.refusals.test.tsrows: an undeclared action, the card's action on another object, aviaon a refused write.library.test.ts: the tagged-operations pin; the last-N-days pin flipped to[].order-to-cash.test.ts: thecollected_by_team_last_30_daystruth updated to west 58300.Package suite and typecheck (head bb187ca, merged main)
The package's
typecheckincludestest/**. The commit after that one adds only the changeset.Ablations (one-time, restored to HEAD; not left in the tree)
Both subjects resolve from
src/(relative imports), so no rebuild sat between mutation and run.Derived gate families (head 8eb5896): 68 derived, 66 exit 0, 2 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commands(merge base 59392ed), each run with its exit captured before any pipe, then--ranwith the codes: "68 derived famil(ies) accounted for — 66 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".pnpm check:dual-build-cjs-loads, reason: PREREQUISITE NOT MET (reads built output of every package; this worktree built only the scenarios closure). CI'sLint & Repo Gatesruns it.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'sLint & Repo Gatesruns it.check:nul-bytes,check:cross-package-test-inputs,check:published-files,check:doc-authoring,check:issue-citationsandcheck:adr-0087-registration.!in the title, no(narrowing)arm).Acceptance notes
viaon arefusedoperation goes one step past the ruled text (which names only the not-an-action refusal). Reason: grading readsviaonly 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.manager_approves_scrap(decide_scrap_request) and order_to_cashapprove_discount(decide_discount_approval) have the same decide-through-action shape, but no measured run shows the grant check failing there yet.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:updateas not measured when the build routes the decision throughdecide_approval_stepwithout granting the update, and as passed when it grants it.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY