Repository navigation
fix(scenarios): a replay maps the row a recorded run_action created to its live id - #35064
Conversation
…o its live id
The RecordedDriver read a created row's id only from a create_record answer's
top-level id. run_action answers what the action body returned under
result ({ok, action, objectName, result: {id}}), so a row an action created
kept its recorded id on replay and the later write naming it was refused
RECORD_NOT_FOUND. createdIdOf now reads result.id on a run_action answer, and
the remap runs for applied run_action calls as well as create_record.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziH9rnXEpD9ne7yFhD
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziH9rnXEpD9ne7yFhD
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 443fa7aab24953334c61b6fbdae07bed4115da28 && git checkout 443fa7aab24953334c61b6fbdae07bed4115da28
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin eb7b09d4d28ea0a878dea993d2fa5cc9226bc92f 4aa292ec54eba99d90e6700717ea31361ed41426 && git checkout -B drift-repro eb7b09d4d28ea0a878dea993d2fa5cc9226bc92f && git merge --no-ff 4aa292ec54eba99d90e6700717ea31361ed41426
node scripts/docs-audit/affected-docs.mjs --json eb7b09d4d28ea0a878dea993d2fa5cc9226bc92f
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT · 2026-11-18T01:06ZHead-sha: 4aa292e 席位核对PR shape.
Not governed. CI. It was still running when I read it (15 pending, nothing failed). This verdict holds on the condition that The holder matches the real answer. The guard. The remap runs only for a
Pins and ablation.
Live replay. On the iteration-2 recording, Run-operations goes from 2/2 with 4 not measured to 2/3 with 3 not measured. Must-fixNone. Should-fixNone. Notes
Next: o3-F (2) lands once the three aggregates are green. No seat L2 is owed. A later push owes an L1-c delta read. |
|
repo:objectstack#3 · os-support-ai · session_01WGufziH9rnXEpD9ne7yFhD Landing · area o3-F · 2026-11-18T01:25Z · #35048 replay remaps an action-created row
State change: ready for review + auto-merge (merge queue). #35048 closes on merge via |
Requested by Yibo Wang · project thread
Fixes #35048
Clause-②: no
Metadata-protocol: none
维护者速读
--driver recorded:F)现在会把录制里run_action新建出来的记录 id(答案里的result.id)映射到回放应用给的新 id,原来只认create_record顶层id。file_and_submit_from_text由动作建单、再按 id 提交;回放时提交带着旧 id 被拒 RECORD_NOT_FOUND,这道操作题每次回放都读成「未测」,问数技能迭代只能离线评分。packages/qa/scenarios/src/runner/driver.ts(createdIdOf与CREATING_TOOLS判断);packages/qa/scenarios/test/runner/orchestrate.test.ts(新增两条回放用例)。pnpm --filter @objectstack/scenarios exec vitest run test/runner/orchestrate.test.ts -t "replay re-sends",预期 10 条全绿。What changes
RecordedDriverre-sends a replayed turn's recorded writes and, for a row the recorded run created, sends later writes with the id the replayed app gave that row. It learned that id only fromcreate_recordanswers (top-levelid).run_actionanswers what the action body returned underresult({ ok, action, objectName, result: { id } }), so a row an action created kept its recorded id, and the follow-up write naming it was refusedRECORD_NOT_FOUNDon replay. That made the turn not faithful, and the operation read NOT MEASURED.createdIdOf(tool, output)readsresult.idon arun_actionanswer and the top-levelidon acreate_recordanswer, as before.CREATING_TOOLS), and still only for an applied one.result.record.id) is read: nothing in the package knows such a shape.createdIdOfandCREATING_TOOLSare module-private, so no published export changes (Clause-②: no). Changeset: patch@objectstack/scenarios.Tests
Two cases go into the existing driver block of
test/runner/orchestrate.test.ts(therunHalfreplay describe), using a stand-in door modelled on the travel_expense build. Filing creates a claim. Submitting it is refusedHOOK_ABORTED, orRECORD_NOT_FOUNDfor an id the app never gave.run_actionfiles a claim (result.id=cl-rec), the live app givescl-live-0, and the recordedrun_action submit_claim(same turn) plus a later turn'supdate_recordnamingcl-recare re-sent namingcl-live-0.create_recordrow is still remapped from its top-level id into a laterupdate_recordand a laterrun_action.Ablation (
scripts/ablation-replace.mjs, fix committed first, test importssrc/directly so no build sits between): each of the fix's two halves, ablated on its own, turns the pin red with the live failure text. The control stays green. Both restores are proven: blob equals HEAD andgit diff HEADis empty.Acceptance notes
file_and_submit_from_textand fails it only onstatus(read "draft", declared "submitted"). The build's owndemotravel_submit_claimanswersHOOK_ABORTED(update('demotravel_expense_claim') does not recognise option 'status') in the recording as on replay. That is the authored action's defect, which the score now measures. It is not the replay's.c.name === 'create_record', which leftCREATING_TOOLSunused, so the workspace build's DTS step refused (TS6133) before anything ran. It was redone with a compile-clean mutation (CREATING_TOOLS=['create_record']), which is the pre-fix behaviour on this path.node scripts/check-plugin-teardown-shape.mjs --self-testexited 3 locally (PREREQUISITE NOT MET: its positive-control commit is not in this shallow clone). That is NOT MEASURED locally and is CI's to read. It is unrelated to this diff.Verification
All readings were taken on head
4aa292ec.Live replay, before and after (travel_expense, ask, iter2 recording, --packages workspace)
Command:
run-scenarios --only travel_expense --modes ask --template /mnt/project-files/issue-34687/ask-round-2026-11-17/build/travel_expense/template.json --ask-repeats 5 --packages workspace --driver recorded:/mnt/project-files/issue-34869/skill-iter/iter2/ask.rec.json(scratch--work/--out), under the shared verify lock.file_and_submit_from_textCREATING_TOOLSablated tocreate_record;workspace @ 4aa292ec + uncommitted changes)run_actionwas refused HOOK_ABORTED in the recorded run and refused RECORD_NOT_FOUND on replay (x2)workspace @ 4aa292ec)state:demotravel_expense_claim[trip="t121"].statusread "draft", declared "submitted" (the only failed check)The other five operations are the same in both runs:
fix_meal_dayspass,over_standard_without_reasonpass, and three NOT MEASURED because the seed refused their rows. Run-问数 is 25/25 · 40 not measured in both.Unit tests, typecheck, ablation
pnpm --filter @objectstack/scenarios typecheck, thenvitest run --maxWorkers=2: VERDICT command-exit 0, Test Files 39 passed (39), Tests 1095 passed (1095).tsc --listFilesincludestest/runner/orchestrate.test.ts.-t "replay re-sends"): Tests 10 passed | 127 skipped.const holder = tool === 'run_action' ? answer.result : answer;was replaced withconst holder = answer;(anchor 1 to 0, blob 8051b98b to 474a9f0f). Result: Tests 1 failed | 9 passed. The pin fails with ReplayNotFaithfulError: "run_actionwas refused HOOK_ABORTED in the recorded run and refused RECORD_NOT_FOUND on replay". Restored to blob 8051b98b == HEAD.if (CREATING_TOOLS.includes(c.name) && recorded === 'applied') {was replaced withif (c.name === 'create_record' ...(blob 8051b98b to b7f4e29d). Result: Tests 1 failed | 9 passed, with the same failure. Restored to blob 8051b98b == HEAD.Gates
pnpm --filter '@objectstack/scenarios^...' build: VERDICT command-exit 0.dispatch-gates --commandsderived 64 commands. Each was run with its exit captured before any pipe. 63 exited 0 andcheck-plugin-teardown-shape.mjs --self-testexited 3 (shallow clone).dispatch-gates --ran: "64 derived famil(ies) accounted for — 63 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".overlap-check:origin/mainmerges cleanly, and no open PR head shares a file. VERDICT clean exit 0.Generated by Claude Code