Skip to content

fix(scenarios): a recorded replay re-sends each turn's recorded writes before the read-back - #33764

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-kv3s20
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-kv3s20

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Clause-②: yes (widening) — new export ReplayNotFaithfulError and new optional field AskTask.callTool, both reached through ./runner (src/runner/index.ts re-exports driver.ts)
Metadata-protocol: none

Fixes #33737

维护者速读

  • 改了什么:录制重放(--driver recorded:)现在会把录制里每个回合的写入(新建/修改/删除/调用动作)按原顺序、以同一角色重新发给新启动的应用,再读回结果;读操作不重发。
  • 为什么改:以前重放只回放模型的回答、不发写入,所以「应当成功」的操作在重放里一律读不到数据、判失败(haiku crm 实跑 3/5,重放 1/4),操作分无法重评。
  • 风险与回滚:只影响重放驱动,实跑驱动不变;重放时若应用的回答与录制不同(被拒的码不同、成功变失败等),该题/操作记为「未测量」并写明是哪个调用,绝不判失败。回滚即还原本 PR。
  • 先看:packages/qa/scenarios/src/runner/driver.ts 的 RecordedDriver.ask(重发与比对),src/runner/orchestrate.ts 的 runHalf(把应用的 MCP 门交给驱动、接住不一致)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run test/runner/orchestrate.test.ts,应见 55 项全过,其中新的 eval#1 重放组 8 项。
  • 需要你做的:无,席位落地。

What changes

  • RecordedDriver.ask re-sends the recorded turn's write calls (create_record, update_record, delete_record, run_action) to the booted app, in recorded order, through the new optional AskTask.callTool (the runner's own MCP door as the turn's persona), before it hands the turn back, so the runner's read-back finds what the recorded run wrote. Reads are never re-sent.
  • A recorded refused write is re-sent too and must meet the same refusal (same code; a flow refusal stays a flow refusal; an uncoded error stays uncoded).
  • A row the recorded run created gets a new id in the replayed app; a later recorded write naming the recorded id, in the same turn or a later one, is sent with the new id.
  • The replay is not faithful, and the turn measures nothing (ReplayNotFaithfulError), when the app answers a re-sent write otherwise than the recorded run did, or when a recorded write has no recorded answer (the turn was cut short; nothing of that turn is re-sent). runHalf records the question or operation NOT MEASURED with the reason naming each call, keeps the recorded turn summary, and never grades it a fail.
  • runHalf gives every question and operation turn the door (callTool bound to the persona's key through AppHarness.callTool). Live drivers ignore it; a caller that only re-reads a recording (no door) gets the turn back and nothing is sent.
  • README: one sentence on the replay in the runner's Driver paragraph. Changeset 33737-replay-resends-recorded-writes.md (patch).

Measurement (read-only, before the change)

  • Recordings: all 79 *.rec.json under the eval seat's runs (/mnt/project-files/eval/runs/, 2026-11-14/15): 533 recorded write calls, every one in an operation turn, every one with its recorded answer (0 without), 0 turns mixing answered and unanswered writes. Each call carries the tool name and its input, and the step key names the persona, so a faithful re-send is possible for every call. 2 writes name a row created earlier in the same turn (create then update), which the id remap covers.
  • eval#1's reading reproduced on main 53f5a4c9: haiku crm_account_with_contacts replay, Run-operations 1/4 · 1 not measured; add_contact "0 row(s) read back", move_eli read "ac3", declared "ac1", audit actor "admin".
  • Same recording on this branch (5bdadc88): Run-operations 3/4 · 1 not measured, Iterate the same; add_contact and move_eli pass, as in the live run. contact_bad_email stays the existing build-denial NOT MEASURED, as on main. Build 27/27, 问数 8/9 unchanged.

Tests

  • New top-level describe in test/runner/orchestrate.test.ts replaying the verbatim eval#1 turns (fixture test/runner/fixtures/eval-haiku-crm-replay.recording.json, four operation turns of the haiku crm recording, reads included) through runHalf against a fake MCP door that behaves as that build: add_contact reads its row back and passes, move_eli passes with its audit actor; the app receives exactly the recorded writes in order, each as its persona, and no read; a recorded refused delete and create are re-sent and refused again; an app that answers otherwise makes the operation NOT MEASURED naming the call, with no grade and no error. Driver-level: the created-id remap (same turn and later turn), the unanswered-write turn (nothing sent, not faithful), a door that throws, and a turn read without a door.
  • The four eval-r1 build-denial replay tests now see the replay's re-sent writes beside the runner's probes; their fake app answers the re-sends as that build did, and their grades are unchanged.

Acceptance notes

  • move_eli on main read the audit actor as "admin": the replay's app had only the seed's writes. With the re-send the audit actor is the persona again.
  • A question turn's recorded writes are re-sent as well (the driver cannot tell a question from an operation, and re-sending keeps the app state later turns read the same as the live run's); the 79 recordings hold none.
  • Two local replays of the branch scaffolded a project whose install did not complete (npx objectstack 404, "no project was installed"); the scaffold precedes every driver call, and the third run with --work on a fixed directory completed. Not investigated further; noted in case it recurs.

Verification

Package and gates on 58da7e9 (re-run after the main merge on 20d149c)
  • pnpm --filter @objectstack/scenarios build, typecheck, test: exit 0, Test Files 32 passed, Tests 790 passed (after the merge: typecheck + test exit 0, 790/790).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 62 derived families, all run, each exit 0 (check-plugin-teardown-shape --self-test after fetching its fixture commit; check:dual-build-cjs-loads after turbo run build --filter=./packages/**); --ran reconciliation: 62 derived, 62 run, 0 NOT-MEASURED, 0 UNRUN.
  • eslint on the three changed sources: exit 0.
Ablation (one, on the re-send)

node scripts/ablation-replace.mjs replaced the re-send guard in RecordedDriver.ask with an unconditional return turn (anchor 1 → 0, blob e66c5893 → 32a70041): orchestrate.test.ts went red, 10 failed (the 7 new replay tests that send, and 3 of the 4 build-denial tests). Restored by the tool; git diff HEAD empty afterwards.


Generated by Claude Code

@github-actions github-actions Bot added size/l 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 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/scenarios, touching 14 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

12 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/actions-as-tools.mdx (via create_record (literal, a string literal in ask))
  • content/docs/ai/connect-mcp.mdx (via create_record (literal, a string literal in ask))
  • content/docs/api/index.mdx (via create_record (literal, a string literal in ask))
  • content/docs/automation/flows.mdx (via create_record (literal, a string literal in ask))
  • content/docs/automation/hook-bodies.mdx (via create_record (literal, a string literal in ask))
  • content/docs/automation/jobs.mdx (via create_record (literal, a string literal in ask))
  • content/docs/concepts/architecture.mdx (via create_record (literal, a string literal in ask))
  • content/docs/data-modeling/fields.mdx (via create_record (literal, a string literal in ask))
  • content/docs/deployment/cli.mdx (via create_record (literal, a string literal in ask))
  • content/docs/deployment/validating-metadata.mdx (via create_record (literal, a string literal in ask))
  • content/docs/getting-started/build-with-claude-code.mdx (via create_record (literal, a string literal in ask))
  • content/docs/permissions/system-context.mdx (via create_record (literal, a string literal in ask))

⛔ 5 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via create_record (literal, a string literal in ask))
  • content/docs/releases/v17/17-4.mdx (via create_record (literal, a string literal in ask))
  • content/docs/releases/v17/17-5.mdx (via create_record (literal, a string literal in ask))
  • content/docs/releases/v17/17-7.mdx (via create_record (literal, a string literal in ask))
  • content/docs/releases/v18/18-0.mdx (via create_record (literal, a string literal in ask))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md) — pages documenting those are invisible to this run
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 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 a557fa386bc3119379b1525bade763d00578396d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from ba2440b7417eb2e21ac987bcf1c81dedcc502c39 — the merge of head 20d149c6e88cce887bec9f7b7a3192d5771fd5df into base a557fa386bc3119379b1525bade763d00578396d, 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 ba2440b7417eb2e21ac987bcf1c81dedcc502c39 && git checkout ba2440b7417eb2e21ac987bcf1c81dedcc502c39
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a557fa386bc3119379b1525bade763d00578396d 20d149c6e88cce887bec9f7b7a3192d5771fd5df && git checkout -B drift-repro a557fa386bc3119379b1525bade763d00578396d && git merge --no-ff 20d149c6e88cce887bec9f7b7a3192d5771fd5df

node scripts/docs-audit/affected-docs.mjs --json a557fa386bc3119379b1525bade763d00578396d

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs a557fa386bc3119379b1525bade763d00578396d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 20d149c6e88cce887bec9f7b7a3192d5771fd5df
Local-runs: none

① Derived judgments

The Clause-②: yes (widening) line on the PR body and changeset is true and complete against the diff. ReplayNotFaithfulError (src/runner/driver.ts, re-exported by ./runner through export * from './driver.js') is the only new exported name, and AskTask.callTool is the only new field on an exported type. Both are additive: the field is optional, a live driver ignores it, and a RecordedDriver given no callTool returns the recorded turn and sends nothing, exactly as before. runHalf and QuestionResult / OperationResult keep their shapes; notMeasured gains a third documented cause. The answer that moves is declared in the changeset: a --driver recorded:FILE replay now re-sends a question or operation turn's recorded writes (create_record, update_record, delete_record, run_action) to the booted app, in recorded order, as the turn's persona, so an applied operation reads back what the run wrote instead of a false "0 row(s) read back" fail. Reads are never re-sent, a recorded refusal must meet the same refusal (code, flow refusal, or codeless error), a created row's recorded id is remapped to the replay's id, and every divergence or unanswered recorded write throws ReplayNotFaithfulError, which runHalf records as NOT MEASURED naming the call, never a fail.

② Semver level

Patch, as the changeset bumps it. Metadata-protocol: none holds: nothing a metadata author writes (spec, app metadata) is added, narrowed or changed in meaning; the widening is an additive export and an optional field of the evaluation package @objectstack/scenarios, and no existing export is removed, renamed or narrowed in type.

③ Boundary flags

None. No packages/spec/src/**, no governed path, no runtime or security behaviour of the platform. The re-sent writes go only to the replay's own freshly booted app, through the runner's MCP door with the persona's key, so they meet the same permission checks the recorded run met; a replay cannot write as anyone the recording did not act as. Live drivers are unchanged. The grader stays deterministic (cloud#3600 cost ruling).

Implemented-by: claude/project-thread-kv3s20
Reviewed-by: session_01L9qiby1cctpVpRbJzjccvY

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY

席位核对 · ACCEPT · PR #33764 (#33737) · 2026-11-15T10:06Z

Head-sha: 20d149c6e88cce887bec9f7b7a3192d5771fd5df · report 6892508964 · claim 6892278375 · design accepted by the seat 09:45Z (given to the card thread; recorded here)

  • Form: draft → main, body carries the Clause-②: yes (widening) line naming ReplayNotFaithfulError and AskTask.callTool (both ./runner), Metadata-protocol: none and Fixes #33737; no closing keyword beside another open card. 6 files, all inside the claimed surface as the seat widened it: src/runner/driver.ts, src/runner/orchestrate.ts, their test and a verbatim recording fixture, the one runner README sentence on replay (seat widened the surface to that line, 09:45Z), and .changeset/33737-replay-resends-recorded-writes.md. Off-limits files untouched; live drivers unchanged.
  • Diff read (seat): ① RecordedDriver.ask re-sends a question or operation turn's recorded create_record / update_record / delete_record / run_action calls in recorded order through the new optional AskTask.callTool, which runHalf binds to app.callTool with the persona's key; reads are never re-sent; ② each re-sent answer is compared by outcome (applied, refused <code>, refused by its flow, refused without a code), so a recorded refusal must meet the same refusal; ③ an applied create's recorded id is remapped to the replay's id for later writes; ④ any divergence, or a recorded write with no recorded answer (nothing of that turn re-sent), throws ReplayNotFaithfulError, which runHalf records as notMeasured naming the call, never a fail; ⑤ no callTool ⇒ the turn is returned as before.
  • Measured (thread): 79 recordings, 533 recorded MCP writes, every one in an operation turn, 0 without a recorded answer, 0 mixed turns. eval#1 haiku crm replay: main ops 1/4 + 1 not measured (add_contact "0 row(s) read back"); branch ops 3/4 + 1 not measured, add_contact and move_eli pass as they did live.
  • Gates: check-runs at this head: 49 — 33 success, 16 skipped, 0 other (read this act); mergeable_state clean. Local (thread): package 790/790, derived gates 62/62, one ablation (re-send guard → unconditional return) ⇒ 10 red, restored.
  • Contract review: declaration face, seat review VERDICT PASS at this head (comment 6892520817).
  • Changeset read sentence by sentence against the diff: the summary line; the false-fail story (matches RecordedDriver.ask on main returning the turn and sending nothing); the re-send paragraph (matches ①–③); "When the app answers a re-sent write otherwise … never a fail. Live drivers are unchanged." (matches ④ and the untouched ClaudeCodeDriver / external / codex paths). All hold.
  • Landing: K = 4 (git rev-list --count --first-parent a557fa38..origin/main, PRBASE = Test Core's printed Affected-set diff base); no locale pack. Landed on the maintainer's standing word 「按 pm-dispatch 审过的pr你可以自主落地」 (2026-10-30 14:20Z, spec seat 2 thread): pr_ready + automerge_enable in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 10:07
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit b76df9a Nov 15, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-kv3s20 branch November 15, 2026 10:29
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…") as no figure (objectstack-ai#33797)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X9GF8q7Br6jm5Yk5d7UFpR1)_

domain:devx#4 · os-project-manager · session_01FEkQ5nw3MDkRymEzv6FDJs

Fixes objectstack-ai#33754

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:场景评分器读数字时,除了 ISO 日期,现在也跳过回复里写出来的日历日期(`31 Dec`、`Dec 31,
2026`、`December 2026`、`31/12/2026`、`12月31日`),日期里的数字不再当成「数据」。
- 为什么改:`asset_lifecycle` 的 `laptop_warranty_expiring`(无法回答的问题)里,agent
正确拒答,顺带说「36 个月折旧期到 31 Dec 结束的笔记本可以列给你」;36 有工具输出佐证,但 `31 Dec` 里的 31
被当成没有依据的数字,判「stated a figure the data cannot support」,挡住了 gallery 导出。
- 风险与回滚:只扩了数字读取器的日期跳过;月份名只认首字母大写(`may` 是动词)、斜杠日期必须带年(`3/4`
是分数)、不挨着月份的数字照读,所以编造的数量或金额(「about 12 laptops」「$4,200 due by 31
Dec」)仍然判失败。回滚即还原本 PR。
- 先看:`packages/qa/scenarios/src/score/scenario-run-grade.ts` 的
`WRITTEN_DATE`(L136)和 `readingsIn` 里的跳过(L208)。
- 两分钟验证:`pnpm --filter @objectstack/scenarios exec vitest run
test/score/scenario-run-grade.test.ts
test/runner/mid-tier-run-readings.test.ts`,预期 109 条全绿。
- 需要你做的:无,席位落地。

## Ask 1: which number failed

Replayed the card's quoted sentences ("The Laptop category gives a
36-month useful life", "… whose 36-month depreciation life ends by 31
Dec") through `numbersIn` (the reader `writtenNumbers` uses) against an
output carrying `"useful_life_months": 36`, read by `jsonNumbers` as
`carriedNumbers` does:

```text
written: [36, 36, 31]    carried: {36, …}    unsupported: [31]
```

So **the `31` of "31 Dec" failed**; `36` was carried (`36-month` reads
36, and the JSON number reads 36). No year was in the quoted reply. The
carried side is unchanged.

## What changes

`packages/qa/scenarios/src/score/scenario-run-grade.ts`:

- `WRITTEN_DATE` (L136, with `MONTH` L122 and `DAY` L124) is a calendar
date written out:
- a day and a month name in either order (`31 Dec`, `31st of December
2026`, `Dec 31, 2026`, `Dec. 31`);
  - a month name with its year (`December 2026`, `Sept 2026`);
  - a slash date with its year (`31/12/2026`, `12/31/26`, `2026/12/31`);
  - a Chinese date (`12月31日`, `2026年12月`, `2026年12月31号`).
- `readingsIn` (L205) blanks it the way it already blanks `ISO_DATE`
(L208), so none of its parts is read. `numbersIn` and `writtenNumbers`
read through it. The docblocks say so.
- What stays a figure: a month name only reads capitalised (`you may 3`
reads 3), a slash pair with no year (`3/4`, `12/31`) is not a date, a
number beside no month name is still read, and a month count
(`36-month`, `36 months`, `36个月`) is a figure. No small integer is
skipped by size.

The unanswerable branch itself (L716, `supported =
writtenNumbers(...).every(...)`) is unchanged. objectstack-ai#33763's decline reader
is not touched.

## Tests

- `test/score/scenario-run-grade.test.ts`, new `describe` (L546), on
`PersonaRunInput` with an unanswerable truth and a `query_records
demoasset_asset_category` output carrying `"useful_life_months":36`:
- **the card's reply** reads `[36, 36]` and grades `correct: true,
problems: []` (L560);
- **written dates** (L565): each of the 15 forms above reads no number;
- **not a date** (L574): `3/4 of them, 12/31, you may 3` reads `[3, 4,
12, 31, 3]`; `a 36-month life, 36 months, 36个月, 共3台` reads `[36, 36, 36,
3]`; `Rows 12-15 of 120, about 12 laptops` reads `[12, 15, 120, 12]`;
- **an invented count or amount still fails** (L580): "There are about
12 laptops.", "there are 7 expiring", "$4,200 is due by 31 Dec.", "7
expire by Dec 31, 2026." each grade `correct: false, problems: ['stated
a figure the data cannot support']`.
- `test/runner/mid-tier-run-readings.test.ts`, new `describe` R5 (L955):
the re-grade below.

**Ablation** (head `30089f51`, `scripts/ablation-replace.mjs`, anchor
`.replace(WRITTEN_DATE, (d) => ' '.repeat(d.length))` in `readingsIn`
deleted, anchor 1 → 0, blob `1318c6902e1c` → `e65a2bd754e3`; tests
import `src/`):

<details><summary>Ablated: 3 failed | 103 passed (106); restored: 106
passed</summary>

```text
× the 31 of "31 Dec" was the unsupported figure; the 36 is carried
× a written calendar date states no figure: none of its parts is read
× the recorded turn replays and grades correct; the same decline inventing a count still fails
Test Files  2 failed (2) · Tests  3 failed | 103 passed (106)
ablation-replace: ok restored: blob == HEAD (1318c69) and `git diff HEAD` is empty
```

</details>

The negatives stay green under the ablation, as they should: they pin
that the skip does not reach a count or an amount.

## Ask 3: re-grade (fixture, not the recording)

The 08:3xZ refresh's recording is not in this repository or the
project's shared files, so a one-turn recorded-driver fixture replays
the turn:
`test/runner/fixtures/asset-lifecycle-warranty-unanswerable.recording.json`,
key `asset_lifecycle/scratch/run/laptop_warranty_expiring/-` (no persona
scopes the question, so run-ask asks it as the admin).

- **What is recorded and what is written here.** The reply carries the
card's two quoted sentences; its other sentences are written here from
the card's account. The one tool call is `query_records
demoasset_asset_category`, whose output is the card's four seeded
categories, so it carries `"useful_life_months": 36` as the card says.
- **The grade.** R5 replays it with `RecordedDriver.fromFile` and grades
it with `gradeCardAnswer(namespacedScenario(asset_lifecycle), {
question, turn })`, as `orchestrate.ts` run-ask does. It now reads
`correct: true, declined: true, problems: []`, and was a fail (ablated:
the 31 unsupported).
- **Control.** The same turn with "About 12 laptops are likely to run
out by 31 Dec." appended still fails.
- **Not done.** A full `--driver recorded:F` CLI replay needs every
build turn's files and a booted app, which one turn cannot drive. The
card says the question failed "in both halves"; the Iterate half's turn
is not on the card, so the fixture replays the Run half only.

## Acceptance notes

- **Observed, not changed: "Mar 12 assets".** A capitalised month name
followed by a number now reads as a date, so a reply that writes "In
March 12 assets were checked out" reads no 12. That is the order's "day
+ month name in either order" taken as written; such wording is rare and
ambiguous for a reader too. class: observation · reach: none · carrier:
none.
- **Observed, not changed: the slash rule.** A slash date with no year
(`12/31`) still reads both numbers, because the same shape is a fraction
(`3/4`). class: observation · reach: none (no recorded reply writes one)
· carrier: none.
- **The shared reader.** `readingsIn` serves the answerable grades and
the leak readings too, so a written date's parts are no longer read
there either: a date is not a count or an amount in any of them, as for
ISO dates today.
- **objectstack-ai#33763 landed first.** It edits the decline reader in the same file,
away from these lines; `origin/main` was merged in (never rebased) at
`e1d2a7dd`. The only conflict was both PRs appending a `describe` at the
end of `scenario-run-grade.test.ts`; both are kept. The gates were rerun
on the merged head. A later main commit (objectstack-ai#33764, the recorded driver's
writes) merges cleanly; a trial merge ran the two touched test files
green (109) and was aborted, so it is not in this branch.

## Verification

On head `e1d2a7dd` (branch `claude/project-thread-rl158j`, `origin/main`
merged in at `25c1d3c7`), each exit code captured before any pipe:

- `pnpm --filter @objectstack/scenarios test`: exit 0, Test Files 32
passed (32), Tests 790 passed (790).
- `pnpm --filter @objectstack/scenarios typecheck` (`tsc --noEmit`,
which compiles the tests): exit 0. `pnpm --filter @objectstack/scenarios
build`: exit 0.
- `node --stack-size=4000 node_modules/eslint/bin/eslint.js
packages/qa/scenarios --no-inline-config`: exit 0 (the package has no
`lint` script).
- Derived gates (`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`, 62 families): all 62 exit 0,
`check:dual-build-cjs-loads` included. `--ran`: "62 derived famil(ies)
accounted for — 62 run, 0 NOT-MEASURED". The first run, on `abf2659c`
before the merge, read 61 exit 0 and `check:dual-build-cjs-loads` exit 3
(NOT MEASURED).
- `dispatch-gates --tier`: no path-derived mandate. 143 changed lines,
under the 3000 threshold. No governed surface.
- Changeset `.changeset/33754-scenario-grader-written-date.md` (file
name unique to this card; objectstack-ai#33735's changeset is a different file).
- CI families are read from this PR's check-runs, not re-run here.

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

https://claude.ai/code/session_01FEkQ5nw3MDkRymEzv6FDJs

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…o the question's object (objectstack-ai#33807)

epic:objectstack-ai#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao7PYMrKCycfdrHCqYPB5Wjh)_

epic:objectstack-ai#33595#1 · os-tesla · session_01L9qibwuGbgR6z7HFZEqvw8

Clause-②: yes (widening)
Metadata-protocol: none

Fixes objectstack-ai#33744

## 维护者速读

- 改了什么:「此人看不到」(`withheld`)的计数题,回复里出现与全量计数相同的数字时,评分器现在只在这个数字被绑到题目对象上(「3
个账户」「Open tasks: 3」「3 of them」)时才判泄露;数的是别的对象(「3 个项目」「3 条记录」「Total:
3」、表格单元格)不再算泄露;某一行可读记录自己字段里的数(「Website relaunch: 3 tasks」来自项目的可读
task_count)也不算。求和、平均等非计数数字照旧出现即泄露。
- 为什么改:eval#1 的 79 份录制里 65 条 `withheld` 回复被判「泄露了 3」,其中 38
条只是数了客户可读的项目或用户,把隐私违规错记在问数模型头上;泄露数在三模型对比的 persona 维度里权重很高。
- 风险与回滚:录制实测 65 → 27,其余判定(对错、婉拒、问题)0 条变化。留下的 27 条:11 条「There are 3
accounts」(席位裁定:按题目对象报数即泄露)、15 条「联系人指向 3 个不同账户,所以至少有 3 个账户」(席位裁定
Q2-i:仍是泄露)、1 条已知误报「User accounts: 3 (sys_user)」(带了题目名词,席位接受的代价)。回滚即还原本
PR。
- 先看:`packages/qa/scenarios/src/score/scenario-run-grade.ts` 的
`tiedToObject` 与 `readableRowFigure`,以及 `gradePersonaRun` 的 withheld
分支;再看 `src/loader.ts` 新增的 `LoadedScenario.readableRows`。
- 两分钟验证:`pnpm --filter @objectstack/scenarios exec vitest run
--maxWorkers=2 test/score/scenario-run-grade.test.ts`,预期 52 个用例全过,其中末尾
"a withheld count leaks only where the reply ties it" 一组 4 个。
- 需要你做的:无,席位落地(Clause-② widening,席位安排契约复审)。

## What changes

On a `withheld` question `gradePersonaRun` used to flag every reply
number equal to an all-rows figure. A count of 3 coincides with any
other small count, so a client who may not read tasks was charged for
"Of the 3 projects, 2 are not done". The withheld arm now reads a count
figure differently from any other figure (seat ruling,
`/mnt/project-files/epic-33595-1/r2026-11-15-m2/ruling-33744.md`, option
C on the measured fork):

- **A count figure** (`FigureReading.count`, which `figureReadingOf`
sets for a `count` question and a ranking of groups by a count) leaks
only where the reply ties the number to the question's object
(`tiedToObject`): the object's noun (machine name with underscores read
as spaces, its labels, the English plural) follows it on its line with
at most two words between ("3 accounts", "**3** different accounts", "3
open tasks", "3个客户"); or leads up to a number that counts no word of its
own ("Open tasks: 3", "the task count is 3", but not "accounts, there
are 3 users"); or is the antecedent of "of them" in the number's
sentence.
- **Row attribution rests on data**: a tied number is still no leak when
its line names a row the persona may read (its `name`) and that row
holds the number in a field the persona may read (`readableRowFigure`;
"Website relaunch: 3 tasks" off `project.task_count`). A line that names
a row without that value attributes nothing; the tie decides.
- **Any other withheld figure** (a sum, an average) still leaks wherever
it appears.

The readable rows reach the grader on the loaded card:
`LoadedScenario.readableRows` (persona id → rows, each its readable
`name` and readable numbers), computed by the loader beside
`scopeFigures`, so the scorer entries import nothing new at runtime.
`gradeCardAnswer` passes them as `PersonaRunInput.readableRows`. The
non-withheld arm ("a figure outside the persona's scope") is unchanged.

Widening, all additive (`Clause-②: yes (widening)`): the optional
`LoadedScenario.readableRows` (entry `.`; the loader always sets it, and
a card built without it attributes no number to a row, the tie alone
deciding); the exported type `ReadableRow`,
`PersonaRunInput.readableRows` and `FigureReading.count` (entries
`./score` and `./score/full`, through `scenario-run-grade.ts`). A caller
that builds `PersonaRunInput` by hand without `reading.count` keeps the
old reading.

## Tests

`test/score/scenario-run-grade.test.ts`, new describe "eval#1 records
(2026-11-15): a withheld count leaks only where the reply ties it to the
question", graded through `gradeCardAnswer` on the real
`crm_account_with_contacts` and `project_with_tasks` cards:

- no leak: the "3 projects" shape, "Of the 3 records", "Total: 3", a
status table, and "there are **3 users**" (recorded sentences);
- the roll-up row "Website relaunch (active): 3 tasks" and "Website
relaunch: project status Active, 3 tasks" (recorded) are no leak; the
control "Mobile app (planned): 3 tasks not done" (that row holds no 3)
is a leak;
- leaks: G "There are **3 accounts**, counted as user accounts" and Q
"**3 different accounts** … at least 3 accounts exist" (recorded), the
card's guard "There are 3 tasks not done yet", "There are **3** open
tasks", "Open tasks: 3", "The open task count is **3**", "… but there
are 3 of them";
- a non-count withheld figure (38) leaks untied; the same number read as
a count does not.

Existing pins are unchanged, including "Accounts are off limits, but
there are 3 of them" (a hand-built input with no count reading).

## Acceptance notes

- Known false leak kept, accepted by the seat: "**User accounts:** 3
(`sys_user`)" on the `account` question counts the platform's users but
is written with the question's noun, so it is tied.
- The 15 opus declines that infer "at least 3 accounts" from the
contacts' account links stay leaks (ruling Q2-i). They are all
`declined: true`, so their `correct` is unchanged.
- The same coincidence exists on the non-withheld arm: a scoped persona
(the sdr sees 2 of 3 accounts) who says "3 contacts" is flagged "a
figure outside the persona's scope (3)". It is outside this card's
surface (withheld arm only); the records hold no such flag today (0 on
main). A seat note, not filed.
- The scorer prose in `docs/qa/scenarios/README.md` now states the tie
rule and the readable-row exception (surface widened by the seat at
review). `packages/qa/scenarios/README.md` is unchanged: it does not
describe the withheld leak reading.
- Row names come from a seed row's `name` field only; a row named by
`title` or `full_name` is never attributed, and the tie decides.

## Verification

<details><summary>Measurement over eval#1 records (before /
after)</summary>

- Corpus: every `*.rec.json` under `/mnt/project-files/eval/runs/` (79
recordings, 1570 question turns, 542 persona turns, 212 `withheld`),
graded with `gradeCardAnswer` on the open cards. Before = `origin/main`
`25c1d3c7`; after = merge head `b49253f6` (head `db7ac1ac` changes no
grading path the records reach). Script, fork table and every flagged
sentence: `/mnt/project-files/epic-33595-1/r2026-11-15-m2/out-33744/`.
- Withheld reply-figure leaks: **65 → 27** (open_tasks/client_viewer 37
→ 0; account_count/partner_user 28 → 27).
- Removed 38: 35 counts of another readable object, 2 readable roll-up
rows, 1 platform-user count ("3 users").
- Kept 27: 11 "There are 3 accounts" (guard), 15 "3 different accounts
linked from contacts" (Q2-i), 1 "User accounts: 3" (accepted cost).
- Verdicts outside the withheld leak axis: **0** changes (`correct`,
`declined`, `problems` identical on all 1570 turns; no other leak line
moved).
- The fork measured before the ruling: (a) tie rule alone −36, (b) scope
over every readable object −37 but loses the guard ("there are 3 tasks
not done" stops leaking because 3 equals the project count).
</details>

<details><summary>Ablation</summary>

- `node scripts/ablation-replace.mjs` replacing `&&
!readableRowFigure(…)` with `&& !false` (row attribution off): **1
failed** ("a readable row's own figure is no leak"), 51 passed.
- Replacing `input.reading?.count === true` with `false` (tie rule off):
**3 failed** (the no-leak shapes, the roll-up row, the count half of the
non-count pin), 49 passed.
- Tests import `src`, so no build leg. Restore verified: blob `feeb34fe`
equals HEAD's, `git diff HEAD` empty.
</details>

<details><summary>Local gates</summary>

- On head `db7ac1ac`: package `typecheck` exit 0; `pnpm --filter
@objectstack/scenarios build && test` under the verify lock: exit 0,
Test Files 32 passed (32), Tests 797 passed (797). `eslint
--no-inline-config` on the touched TS files: exit 0.
- Derived gates (`dispatch-gates --commands --repo
objectstack-ai/objectstack`, 65 families on `db7ac1ac`): 64 exit 0; NOT
MEASURED locally, CI runs it: `pnpm check:dual-build-cjs-loads` (exit 3,
PREREQUISITE NOT MET, needs every package's `dist/`). The 62 families of
`b49253f6` ran there; the 3 the README edit adds (`check-adr-links` and
its self-test, `check:doc-formula-expressions`) and the docs, changeset
and ratchet families were rerun on `db7ac1ac`.
`check-plugin-teardown-shape --self-test` exit 0 after fetching its
pinned fixture commit. `--ran`: "65 derived famil(ies) accounted for —
64 run, 1 NOT-MEASURED". Record: `out-33744/gates-ran-db7ac1ac.list`.
- Merged `origin/main` once before opening (`b49253f6`); the incoming
objectstack-ai#33764 touched `src/runner/**` of this package only, so the package was
rebuilt and its typecheck and tests rerun, and the records regraded
(still 27).
- 256 changed lines (+247/−9), 6 files, no governed surface.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibwuGbgR6z7HFZEqvw8)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…al-run record (objectstack-ai#34006)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9J4aPx8N1Kyneqy3VTTtNSY)_

Fixes objectstack-ai#33923
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:新增内部技能
`.claude/skills/scenario-eval/SKILL.md`(评测席跑一轮场景卡的方法:排卡、模型与 effort 配置、5
次重复与噪声、录制回放、`eval-run` 记录格式、发现去向);`lanes/eval.md` 改三处:产出加上场景卡照技能跑、立
`eval-run` 记录(其它评测仍每轮一份评分卡)、定时归本席自控、「不对外发布准确率数字」对场景卡记录豁免。
- 为什么改:你的令「技能应该进仓库,测试卡也应该进仓库,参考 qa」与 "objectstack 公开仓,像
qa-run";今天跑一轮的方法只在一个席位的笔记里,换席就没法重复或审计。
- 风险与回滚:只是内部 agent 文本,不发布、不碰代码;回滚 = revert 本 PR。
- 先看:`.claude/skills/scenario-eval/SKILL.md` §5(记录格式)与
§2(配置);`lanes/eval.md` 边界节两行(准确率数字的豁免只给场景卡记录,问数基线 ② 照旧不发)。
- 两分钟验证:`node scripts/pm/check-skill-line-ratchet.mjs`,预期 `lanes/eval.md
is 45 lines (ceiling 45; headroom 0)` 且退出 0。
- 需要你做的:无,席位落地(Tier S,席位跑达档复审后入队)。

## What changes

- New `.claude/skills/scenario-eval/SKILL.md` (`metadata.internal:
true`), modelled on `checklist-test`. It points at
`packages/qa/scenarios/README.md` for runner mechanics (flags, modes,
the cloud-session settings, grading) and copies none of them. Sections:
- §0 environment (subscription login, no API variables, dependencies
built first, `claude --version` recorded, the runner sha pinned for the
whole round);
- §1 round plan (control cards every round, read off the card files by
`tier`; starter cards scratch-only, one per command under the 2-hour
background cap, at most two in parallel; `--packages published` with
`--create-version` pinned across the round);
- §2 configs (tracked = the hosted default, today `--model haiku
--effort medium`, current value in the seat post; reference = `--model
opus --effort low`; `--model` and `--effort` always explicit;
served-model mismatches kept out of the mean);
- §3 repetitions and noise (5 per config for a model or effort decision;
a single run's Ask moves about ±4 of 58 on the control cards, so one
round reports a trend; mean and min–max, method stated; no silent
re-rolls or dropped outliers);
- §4 recording and replay, with a command block a fresh session can run
for a control-card round;
- §5 the `eval-run` record: title shape, label `eval-run` only, body
sections Environment / Scope / Results / Reading / Findings filed from
this run / Records, writes through the pm-dispatch write gate, close
when every finding has a destination;
- §6 findings routing (grader misreads to the scorer owner, product
defects through the filing gate, skill text as a `domain:skills`
finding, leaks and any security lead only per
`references/security-findings.md`, pointer only).
- `.claude/skills/pm-dispatch/references/lanes/eval.md`:
- 〈座位与唤醒〉: the "Routines are set by the maintainer; the seat never
creates or changes them" line is replaced by the maintainer's order that
the seat runs its own schedule (2026-11-14 「你自己控制定时可以吗?」), merged with
the suggested cadence line. The words are quoted on card objectstack-ai#33923 (its
body, filed by the eval seat) from the eval seat's thread, 2026-11-14;
the seat reads them as a hand-over to their addressee, eval#1.
- 〈产出〉: one line now reads 「场景卡每轮照 `scenario-eval` 跑并立 `eval-run`
记录;他项每轮一份评分卡;皆附上轮趋势对比。」 It names the skill and the record and keeps
main's general rule (「每轮一份评分卡,附与上一轮的趋势对比」) for every other scope, so
〈边界〉's 「评分卡」 keeps its definition. Nothing in 〈产出〉 is deleted (fix round
1, M1).
- 〈边界〉: 「⛔ 不对外发布准确率数字」 now exempts scenario-card `eval-run` records only
(ruling on the eval seat's decision card "eval 测试记录卡放哪个仓?": "objectstack
公开仓,像 qa-run"); the ask-accuracy baseline ② keeps the line.

## Why

The qa seat runs from a repository skill and leaves one `qa-run` record
per round; the eval seat had only its charter, and its round method
lived in one seat's notes. The maintainer directed 「技能应该进仓库,测试卡也应该进仓库,参考
qa」.

## Acceptance notes

- **Premise drift, card items 2 and 4.** The card and its dispatch said
effort goes by `CLAUDE_CODE_EFFORT_LEVEL` until the runner's effort flag
lands, and that replay cannot score operations until the replay fix
lands. Both landed before this PR: objectstack-ai#33739 (closed by objectstack-ai#33767, `--effort`
/ `--author-effort` / `--ask-effort`) and objectstack-ai#33737 (closed by objectstack-ai#33764,
replay re-sends recorded writes). Read on origin/main `b8ac0e24`:
`packages/qa/scenarios/src/runner/cli.ts` documents the three effort
flags, and the package README's Driver bullet says a replay re-sends
each turn's recorded writes. So the skill teaches the landed behaviour:
always pass `--effort`, and replay re-scores Build, Ask and operations,
with a write that cannot be re-sent read as not measured. It cites
neither card as open.
- **How the first record, objectstack-ai#33920, differs from the skill's shape.** Its
sections and title match the skill's (Environment / Scope / Results /
Reading / Findings filed / Records; `Eval run · SCOPE × N configs × R
reps · SHA8 · DATE`). Where it differs:
1. effort was set by `CLAUDE_CODE_EFFORT_LEVEL`; the skill requires
`--effort` on the command line;
  2. its Environment names no `claude --version`;
3. its Scope gives no per-command exit codes or not-measured halves. It
says "all exit 0", which covers the first; the second is not stated;
4. it does not say how the means were computed (pooled counts or the
mean of per-rep percentages);
5. it was closed three minutes after filing. Under the skill that is
right only when every finding already has a destination, which its
Findings section shows;
6. its Results heading carries a suffix, and its Build column has no
min–max;
7. one of its configs ran at the CLI default effort, which §2 now
forbids (`--effort` is always explicit).
- **No ceiling row for the new skill.** `check:pm-skill-ratchet` covers
an enumerated map, not a glob, and no derived gate named a row for a new
`.claude/skills/*` directory, so none was added (file surface: only rows
a gate names). The new file is 127 lines; several prose lines run past
120 bytes, which only ceilinged files are held to. Adding a ceiling row
is the seat's call.
- `lanes/eval.md` stays at its 45-line ceiling with headroom 0. What was
deleted: (a) 「节奏由维护者在 Routines 设定;⛔ 本席不自建、不改频率」, reversed by the
schedule order; (b) the cadence line as a separate line, its content
merged into the schedule line. What was kept: 〈产出〉's general scorecard
rule (see above). The one line this PR adds (the ask-accuracy baseline
line in 〈边界〉) is paid for by (b). No line was gained by re-wrapping.
- **Fix round 1 (contract review 6897354155).** M1: the 〈产出〉 line above.
S2: §5 quotes the record-location ruling verbatim ("objectstack 公开仓,像
qa-run") and keeps 「带全分」 outside the quote as the derived rule. S1: §5
says the triage sweeps do not yet know the `eval-run` label (their
exclusion lists name `qa-run` only), so until they do the record closes
in the round it is filed, or triage is told it is a record; the sweep
change itself is the seat's follow-up card. S3: the schedule words'
source is stated above. N1: the §4 block marks its control-card list as
the list at the time of writing. N4: a security lead's Findings line is
the fixed line of `security-findings.md` §4, nothing more (and §6's row
says the same). N2: differences 6 and 7 above. N3 not taken (no line to
spare in `eval.md`).
- Forced test edits: none.

## Verification

At head `7d9600e4` (fix round 1), in the card worktree:

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 17 commands. All 17 ran and exited
0. The run reconciles: `--ran` reports "17 derived famil(ies) accounted
for — 17 run, 0 NOT-MEASURED (a DERIVED zero — all 17 recorded an exit
code and none of them is 3)".
- On the first head `3d9dedb1`, `check:doc-formula-expressions` first
exited 3 (prerequisite not met: `@objectstack/lint` and
`@objectstack/formula` not built). After `pnpm exec turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint` under
`os-verify-lock` (VERDICT command-exit 0), it exited 0.
- `pnpm check:pm-skill-ratchet` exited 0 on both heads: `lanes/eval.md
is 45 lines (ceiling 45; headroom 0)`. `pnpm check:pm-skill-id-lint`,
`pnpm check:skill-frame-sync`, `pnpm check:nul-bytes` and `pnpm
check:pm-governed-merges` also exited 0.
- `pnpm --filter create-objectstack exec vitest run --maxWorkers=2
src/template-consistency.test.ts` passed: Test Files 1 passed (1), Tests
41 passed (41). That covers the `metadata.internal` marker on every
SKILL.md outside `skills/`.
- No changeset: the diff is `.claude/**` only and publishes nothing
(`skip-changeset`).
- Governed surface, Tier S (`.claude/**`). This PR stays draft until the
owning seat's contract-review record.

<!-- signed: domain:skills#2 · os-steve ·
session_01ADHkmSzqTCJc8NsdLvgbyw -->

---------

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/l 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.

Scenario runner: a recorded replay re-sends no MCP write, so every applied operation fails on replay

2 participants