Repository navigation
feat(scenarios): restore the seeded rows before each operation, so one failed write does not cascade into the next - #34338
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxMxTCsjCeHw2vP5qU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxMxTCsjCeHw2vP5qU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxMxTCsjCeHw2vP5qU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxMxTCsjCeHw2vP5qU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxMxTCsjCeHw2vP5qU
📓 Docs Drift CheckThis PR changes 1 package(s): 41 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 13 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 548cdefae1c9c768b2b22b4ed3d7e685ab28c730 && git checkout 548cdefae1c9c768b2b22b4ed3d7e685ab28c730
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8436f67a2d522e0c700c37b69b22a083a30ce4b9 88929ff3a795fc24ae6fa1b4232c3a5e90c4416c && git checkout -B drift-repro 8436f67a2d522e0c700c37b69b22a083a30ce4b9 && git merge --no-ff 88929ff3a795fc24ae6fa1b4232c3a5e90c4416c
node scripts/docs-audit/affected-docs.mjs --json 8436f67a2d522e0c700c37b69b22a083a30ce4b9
|
|
epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY Contract reviewServed-tier: ① Derived judgmentsThe
The answer that moves is the one the line names: an operation after an earlier turn's write now starts from the seeded rows. The order's five design points are each settled in the PR body:
② Semver levelPatch, as the changeset bumps it. ③ Boundary flagsNone:
Implemented-by: VERDICT: PASS |
|
epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY 席位核对 · ACCEPT · PR #34338 (#34294) · 2026-11-16T08:13ZHead-sha:
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43829693775 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY Queue ejection triage · re-queue once · 2026-11-16T08:37ZQueue build 43829693775 (triage comment 6911493551) went red. The only failure is Dogfood Regression Gate 1/3, This PR is an inherited bystander, not the cause:
Head |
Requested by Tesla · project thread
epic:#33595#1 · os-tesla · session_01L9qibxMxTCsjCeHw2vP5qU
Clause-②: yes (widening) — through
./runner: new exportsrestoreObjects,seededRows,restoreSeededRowsand typesSeededRows/RowRestore(orchestrate.ts);derivedFields,rowDrift,driftText,RESTORE_UNCOMPARED,RESTORE_UNWRITTENand typesHeldRow/RowDrift(seed.ts); the new optional memberAppHarness.deleteRowand the methodHttpApp.deleteRow(app.ts); the new optional fieldsOperationResult.restored(orchestrate.ts) andHalfScores.operations.restored(scorecard.ts). No export entry moves;./score,./score/full,./exportand.are untouched. Operation grades after an earlier turn's write move: an operation that used to start from the rows the turn before it left now starts from the seeded rows.Metadata-protocol: none
Fixes #34294
维护者速读
packages/qa/scenarios/src/runner/orchestrate.ts的restoreSeededRows(三轮恢复与失败判定)和runHalf操作循环开头的调用;src/runner/seed.ts的rowDrift(比较哪些列)。pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts -t 34294,预期 7 个用例全过。What changes
orchestrate.tsrestoreObjects/seededRows/restoreSeededRows,seed.tsrowDrift): right after the seed loads, the runner reads, as the admin, the rows of every seeded object and of every object an operation writes or its outcome reads that the seed does not name. That read is the seeded state: the app's own answer to the seed, so a row the app refused, or one it made itself while seeding, is held exactly as the operations would have met it before this change. This is a superset of "the objects the operation and its outcome read": the agent's turn may read any seeded object (it looks an account up by name before it creates a contact), and the cost is one list per object per operation, against an agent turn that takes minutes. Before each operation the runner reads them again and compares by id, every column exceptcreated_at,updated_at,updated_by(stamped anew by every write, the restore's own included) and the fields the build computes (COMPUTED_VALUE_TYPESfrom@objectstack/spec/data: formula, summary, autonumber, read from the built artifact through the scorer's one reader). When something moved it puts it back, as the admin, through the seed path: a row a turn added is deleted (newDELETE /api/v1/data/:object/:id,HttpApp.deleteRow); a seeded row a turn removed is inserted again with the very body the seed sent (seedRowBody, now shared byseedApp), or, for a row the app made itself while seeding, the row as read less the platform's stamps; a changed column is set back to the value the seed left. A lookup to a row still missing waits for the next round. Up to three rounds of writes, so a cascade settles (a delete that takes a child, a reference set back before a delete is allowed).restore: the rows could not be restored to the seeded state: OBJECT: 1 added (ID), … (refused: VERB OBJECT ID: STATUS CODE MESSAGE), each refusal named once. The operation is not asked, so no turn, observation or grade is recorded, and it counts in neither passed nor total. A list the app refuses during the restore fails it the same way. A harness withoutdeleteRow(it is optional, so an existing harness keeps compiling) fails a restore that needs a delete, and says so.pending_confirmationoperation's ask and confirmation (Scenario runner: a pending_confirmation operation runs as two turns, ask then confirm, so the confirmed write is graded too #34293) run back to back on the same rows, and the confirmed delete is undone before the next operation (pinned). Questions are unchanged: they all run before any operation, at every--ask-repeatsask, and the seeded state is read before them. Ask mode runs the same Run half, so it restores the same way. A replay re-sends each operation's recorded writes against the restored rows (RecordedDriver, Scenario runner: a recorded replay re-sends no MCP write, so every applied operation fails on replay #33737); where a later operation leaned on an earlier one's write, it reads NOT MEASURED (the replay is not faithful), never a fail.restored: { deleted?, reinserted?, setBack? }(eachobject/id;setBackmaps a row to the columns set back), absent otherwise. TheRun-operationscell, and the run record'srun-operationsnote, add· N started from restored rows(measured operations only) when N > 0.Each operation starts from the seeded rows; changeset34294-scenario-restore-seeded-rows.md(patch).Design point 5, measured on eval#1's records
Read-only over the 138 run records under
/mnt/project-files/eval/runs(2026-11-14 through the 2026-11-16 M2 close-out; 258 Run halves; 1,290 operations that ran):answer,no-write,agent,confirmed-by-agent,platform): asking first, refusing, withholding. They would grade the same on restored rows unless the agent behaved differently on them, which no record can tell.2026-11-15-replay-m1/high/opus,invoice_with_line_items, iterate Run,send_invoice(state: demoinvoice_invoice#i3.status read "draft",audit-actor), afteradd_line's runner probe stored a line oni3. That is the one grade the restore can plausibly move.What the records do not allow: they keep each operation's post-state rows and write counts, not the rows it started from, so an exact count of moved grades needs a replay of the recordings on this branch (booted apps per card); this PR did not run one. The scripts and outputs are in the project files beside the PR's other evidence (
out-34294/measure*.mjs,out*.txt).Tests
test/runner/orchestrate.test.ts, a new top-level describe (Scenario runner: restore the seeded rows an operation reads before it runs, so one failed write does not cascade into the next #34294, 5 cases) and one for the pure helpers (2 cases):add_contact's turn also deletes Eli (ct5), the rowmove_eliacts on;move_elipasses withrestored: { deleted: [new-add_contact], reinserted: [ct5] }, andadd_contact, the first operation, restores nothing;remove_bensets backct5.account, its confirmed delete still grades on the rows its ask saw;contact_bad_emailreinsertsct2; the validation operation wrote nothing, so the next restores nothing);restoredand norestored rows;deleteRow);restoreSeededRowsdirectly: the clock and a computed field moving restore nothing and write nothing; a changed name is set back; a removed seeded row goes back with the seed's body;rowDrift(clock and last writer not compared,null= absent) andderivedFields(formula/summary/autonumber; nothing from an unreadable artifact).test/runner/app.test.ts(+1):HttpApp.deleteRowsendsDELETE /api/v1/data/OBJECT/IDwith no body and reads a refusal's code.restored: 3(move_eli,remove_ben,contact_bad_email); the probe that a broken app stores is deleted beforepartner_edits_account(restored: 4); eval#1's haiku replay deletesreplayed-0beforemove_eli, and reinsertsct2after a replay whose app applied the delete. Their grades are unchanged.test/export/fixture.ts: itsFakeAppgainsdeleteRow.Acceptance notes
add_contactpassed in the cascade pin although its turn also deletedct5: the grader reads the declared post-state, and an extra removal on the same object is not charged to that turn. That is the grader's existing reading (src/score/**, outside this card); noted, not filed.listRows), as every read of the runner does; the largest seeded object in the library holds 307.HttpApp.deleteRow's route is read frompackages/rest/src/crud-routes.ts, not yet measured live, like the seed's second-pass PATCH beside it; a live run's first restore is that measurement, and a refusal there reads NOT MEASURED with the code.created_atand any autonumber are new. Neither is compared; a card that declares an autonumber value would see the difference in its own post-state check.orchestrate.test.tsrecord-note and cell pins that read5/5now read5/5 · 3 started from restored rows.Verification
Ablation
node scripts/ablation-replace.mjson the committed head of the time (orchestrate.tsblobbc4bc9f62aa2; the laterdcbc4425changes only how a failed restore names its refusals), the restore call inrunHalfreplaced by "nothing restored"; the tests importsrc, so there is no build leg. Restored each time withgit diff HEADempty and the blob equal to HEAD.move_elireads"Cannot convert undefined or null to object"(the row it acts on is gone) instead of a pass.Local gates
dcbc4425:pnpm --filter '@objectstack/scenarios^...' build:: exit 0 (lock VERDICT command-exit 0);pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios test:: exit 0 (lock VERDICT command-exit 0): Test Files 35 passed (35), Tests 985 passed (985).eslint --no-inline-configon the seven touched TS files :: exit 0.dispatch-gates --commands --repo objectstack-ai/objectstackatdcbc4425, 9 paths, 67 families), each run with stdin from/dev/null: 65 exit 0, and 2 exit 3 (PREREQUISITE NOT MET):check-plugin-teardown-shape --self-testcould not read its pinned fixture commit in the shallow clone; aftergit fetch origin 621a4876…, a rerun exited 0 ("48 cases pass"), recorded on its own line; the first-run record is kept as it was.pnpm check:dual-build-cjs-loadsis NOT MEASURED locally: it needs every package'sdist/. CI runs it.--ranon the first-run record: "67 derived famil(ies) accounted for — 65 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".951eceee→c9346317, the objectql cascade-delete batch, perf(objectql)!: a cascade delete removes a relation's children as one predicate delete per chunk #33887) was merged once before opening (88929ff3); it touched nothing underpackages/qa/scenarios. After the merge, on88929ff3:pnpm install --frozen-lockfile && pnpm --filter '@objectstack/scenarios^...' build && pnpm --filter @objectstack/scenarios build && … typecheck && … test:: exit 0 (lock VERDICT command-exit 0), Test Files 35 passed (35), Tests 985 passed (985);packages/specmoved on main's side, sopnpm --filter @objectstack/spec check:generated:: exit 0. The derived-gate record is the one ondcbc4425, whose diff the merge leaves as it was.packages/spec,src/score/**,src/schema.ts, card JSONs andsrc/export/**untouched (the export test fixture gainsdeleteRow).Generated by Claude Code