Repository navigation
fix(scenarios): load the card seed through the platform's seed path - #34985
objectstack-fleet[bot] merged 7 commits into
Conversation
The runner wrote every seed row through the data API, a user write, so a build's state_machine with initialStates refused every mid-lifecycle row and cascaded its children. The seed now goes in as a data-only package's data[] through the managed install door, which the platform's seed loader writes under its seed posture; restores re-insert the same way. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…ed door Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…no record-triggered flow Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…not a code field A refused seed package refuses every row with the door's status, code and message in one sentence, so no helper stamps a code it cannot name as a literal. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
📓 Docs Drift CheckThis PR changes 1 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
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 54ee6c2f6e123d131b66f401946b60a188a16a2f && git checkout 54ee6c2f6e123d131b66f401946b60a188a16a2f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa b88c632b10cf415af60c1258ccc755562cf97a73 && git checkout -B drift-repro 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa && git merge --no-ff b88c632b10cf415af60c1258ccc755562cf97a73
node scripts/docs-audit/affected-docs.mjs --json 6d2db1d7efebc2a00cb87454d66bb6c2570e6dfa
|
…ookups The seed package carries persona user ids as sent, so the second pass no longer re-patches them: that would bring user-door update triggers and hooks back onto seed rows. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT · 2026-11-17T22:01ZHead-sha: 81b6323 席位核对PR shape.
This stays inside the claim's file surface: nothing touches CI. It was still running when I read it (16 pending, 14 success, nothing failed). This verdict holds on the condition that (1) The door.
Condition 1, ids kept as lookup targets: met. The report's M1, measured before any code: 757 inserted, ids kept, and lookups resolve to the card ids. The re-run record agrees: (2) Refusals with no code: a scorecard shape change I accept. (3) Persona ids in the load, PATCH only for cycle lookups. The seat has ruled this A since the report, on the condition that the README and the PR body state it and why. I read the code as built. (4) Condition 2, the trigger note: met. The README's Seed paragraph and the changeset both say seed rows fire no record-triggered flow. They name the four cards that ask for such flows and say each seeds the flow's values itself (a ticket's group, SLA policy and breach flag, a line's over-standard flag, the statuses). They also say an operation's own write still goes through the agent's door. (5) Condition 3, the re-run: met. In Tests and ablation. The double (
The ablation legs are each red on the half they revert: 4 of 5 for the seed loop, and the restore test alone for the restore. Must-fixNone. Should-fix
Notes
Next: the README and body push for the seat's ruling A, and the S1 test, then an L1-c delta read. Then o3-G lands once the three aggregates are green. No seat L2 is owed: the seat already ruled route A, and the deviation is ruled too. |
The seed door double can now drop a reference from a row it writes, as the real loader reports one it could not resolve. One test pins the refusal's fields, the tally, the deferred cycle patch, a row also refused on write counting once, and a restore counting the written row back. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (delta) · 2026-11-17T22:24ZHead-sha: 1c5dbc3 席位核对Delta. Two commits on top of my ACCEPTed head, three paths, +71/-4. No
S1: closed. The new test covers each point I asked for:
The S1 ablation ( CI. The report says the first head's red on Must-fixNone. Should-fixNone. Notes
Next: o3-G lands once the three aggregates are green. No seat L2 is owed. A later push owes an L1-c delta read. |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (merge-only hop) · 2026-11-17T23:44ZHead-sha: b88c632 席位核对One merge commit. Its first parent is CI. This verdict holds on the condition that Must-fixNone. Should-fixNone. NotesNone. Next: o3-G lands on green. No seat L2 is owed. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Landing · 2026-11-18T00:08Z
Ready + auto-merge into the queue. Area o3-G (repo:objectstack#3) watches it to MERGED and closes out #34897. |
main's #34985 brought in loadSeedRows, which declared `mode: 'insert'` on every card dataset. This PR retires that mode, and the install door refuses a dataset declaring it, so no card seed (and no restore) would load. Drop the mode so the default `ignore` loads them, make the test seed door judge `mode` with SeedMode as the real door does, and pin that the seed and restore packages carry no retired mode. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
Requested by Yibo Wang · project thread
Fixes #34897
Clause-②: no
Metadata-protocol: none
维护者速读
data[]的包,经托管安装门交给平台自己的种子加载器写入;恢复已删除种子行也走同一条路。initialStates: ['draft']的状态机,数据 API 属于用户写入,于是 travel_expense 卡 120 张报销单中 114 张(已付款/已提交等)被拒,其下 470 条明细与审批步骤连带被拒,584/757 行丢失,问数轮次在错误的数据上进行。packages/qa/scenarios/src/runner/orchestrate.ts的loadSeedRows与seedApp(风险最高:错误清单到拒收记录的映射);同文件restoreSeededRows第 2 步;packages/qa/scenarios/test/runner/orchestrate.test.ts新增的TravelRulesApp一组用例。pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts -t "past its entry state",预期 6 个用例全部通过。What changes
seedAppbuilds one dataset per object in its existing load order (the card's ownidon each row; persona user ids,owner_idand rewritten handles as before; deferred cycle lookups still left out) and hands them to a new module-privateloadSeedRows.loadSeedRowsinstalls a data-only package (data[],externalId: 'id',mode: 'insert', its own namespace per load) through the harness's existinginstallManageddoor. The platform's seed loader writes package data underSEED_WRITE_EXECUTION_CONTEXT: thestate_machinerule is skipped, every other rule and hook still runs, and record-change flows are suppressed. It maps the answer'sdata.seeded.errorListinto the sameseed.refusedrecords: one per row the loader could not write, plusfieldsfor a written row whose reference did not resolve. A refused package, a harness with no managed door, or a load that did not run inline refuses every row, with the reason.restoreSeededRowsstep 2 re-inserts the round's missing seeded rows as one load through the same path.installManageddoc comment and the door table inapp.tssay the seed loads through it.FakeApps give the managed door the measured answer shape (test/runner/seed-door.ts).Route A, and one place the mechanism moved
The seat ruled route A: load the rows as declared
data[]under the seed posture, and keep the PATCH pass for runtime-id fields. I measured that assumption before building (condition 1, below).data[]carries runtime user ids as sent:owner_idand theuserfield landed, and the persona read its own 10 claims (M3). The seat then ruled on that deviation (A, 21:58Z): persona ids ride in the load, and the PATCH pass now sets only the deferred cycle lookups. Re-patching the persona ids would put a user-door update, with its update triggers and hooks, back on every persona-owned seed row, and the seed posture exists to avoid exactly that. The README's Seed paragraph says the same.Tests
seedApp — a card row already past its entry state loads through the seed path…, run on the travel_expense card with a double of the kept build's rules (TravelRulesApp):seedApp, all 757 rows load: 114 non-draft claims, andln_001_hotel/as_001_1holdclaim: 'c001';end_after_startis refused with the loader's message and no code, and its claim, two lines and two steps go with it (751 inserted);restoreSeededRowsputs a removed paid claim back;errorListentry whosefieldis the lookup): the row is refused withfields: ['parent'],inserteddrops by one (755), and its deferredmanagerpatch still runs (secondPass3); a row with both a write entry and a reference entry counts once, withoutfields; and a restore counts the written row as reinserted. The double (test/runner/seed-door.ts) can now drop a reference from a row it writes, as the real loader reports one (referencesDropped).UnmanagedOnlynow drops the managed door explicitly.Gates and test runs (head 1c5dbc3)
pnpm --filter @objectstack/scenarios build && … test && … typecheck, under the verify lock:Test Files 39 passed (39),Tests 1092 passed (1092), typecheck clean,VERDICT command-exit 0.check-plugin-teardown-shape --self-testandcheck:dual-build-cjs-loads, both exit 3).overlap-check: VERDICT clean exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsgives 67 families at 81b6323. That is the same list as on the earlier head. The reconciliation (--ranwith each exit code captured before any pipe) reads67 derived, 65 run, 2 NOT-MEASURED, 0 UNRUN.pnpm check:dispatcher-error-vocabularywas red on the first head. It flagged a refusal helper that took acodeparameter it could not name as a literal. 81b6323 removes it: a refused seed package now puts the door's code in the message. The gate was re-run on that tree and exited 0.node scripts/check-plugin-teardown-shape.mjs --self-test. It exited 3 because the shallow clone lacks the commit it needs ("Deepen the clone"). The scan itself,node scripts/check-plugin-teardown-shape.mjs, exited 0.pnpm check:dual-build-cjs-loads. It exited 3 withPREREQUISITE NOT MET: other packages have nodist/in this worktree. CI builds them and runs it.test:repoand the repo-wide scans. Both belong to CI.Derived families, exit codes
Ablation: the seed path and the restore path, one leg each
The scenarios tests import the runner from
src/by relative path, so neither leg needs a dist rebuild. Each leg was written withnode scripts/ablation-replace.mjsfrom the HEAD bloba8c96bc92dd1oforchestrate.tsand restored the same way. After each restore, the blob equalled HEAD andgit diff HEADwas empty.a8c96bc92dd1 -> 1ff43a1b3708, anchor 1 -> 0). 4 of the 5 new tests go red: all 757 load, the control, the restore (its seed already failed) and the missing-door case. The user-door test stays green, as it should.a8c96bc92dd1 -> 0aaa6d7a3034). Only the restore test goes red:failed: … demotravel_expense_claim: 1 missing (c001) (refused: insert demotravel_expense_claim c001: This status change is not allowed; a paid claim cannot be changed.).unheld.set(key, held)replaced byvoid held, blob004bb0c7c0f6 -> 21619f29c539, anchor 1 -> 0). Only the S1 test goes red (expected { inserted: 756 } to deeply equal { inserted: 755 }), 5 pass. Restored: blob == HEAD004bb0c7c0f6,git diff HEADempty.Acceptance notes
Failed to write OBJECT record #N (id=ID): …) and nocode, because the door'serrorListnames none.seedDifferenceand the scorecard read them unchanged.Run-问数 3/13andRun-operations 2/6. Those answers were recorded over the old 173-row seed and are now graded against the full truth. This is not a regression: the old round had 8 turns not measured, and those turns are now asked.restoreSeededRows). Ask mode took the fresh-copy route, whose copy seeded alike. The write-back restore is covered by the unit test and its ablation.Verification
Condition 1 asked whether
data[]keeps the card's ids as lookup targets. I measured it before writing code, on a blank 18.5.0 host with the kepttemplate.jsoninstalled, throughPOST /api/v1/marketplace/install-local(installMode: 'managed'):data[](externalId: 'id',mode: 'insert'):seeded.mode inline, inserted 757, errors 0. The ids are kept:c001exists,ln_001_hotel.claim = c001,dep_eng.manager = e05.t001broken (end before start):inserted 751, errors 11. The trip is refused with the rule's message, and its claim, two lines and two steps go with it (two entries per dependent row: write plus lookup).owner_idand theuserfield carry persona user ids as sent, and the employee persona reads its own 10 claims. A second data-only package with its own namespace installs. The same namespace again is refused with 422.Condition 3 is the re-run on the round's kept build. That is
template.json, sha256b7ab31a715d4e83c…, in ask mode with the round's recorded ask turns (--driver recorded:…/issue-34687/ask-round-2026-11-17/proof-managed/ask.rec.json,--create-version 18.5.0). The record is on the project mount:issue-34897/rerun-replay/(rerun.sh,run.log,started,exit,out/2026-11-17-scenario-travel_expense.json).EXIT=0at 21:22:39Z.installMode managed, after the unmanaged attempt was refused422 UNMANAGED_INSTALL_UNCOPYABLE.inserted 757, refused [], secondPass {demotravel_department.manager: 4}. The scorecard readsseed {inserted 757, total 757, refused 0}.Generated by Claude Code