Repository navigation
fix(scenarios): an operation an earlier write would meet runs on a fresh seeded copy of the app, so a one-way state rule no longer leaves later operations unmeasured - #34490
Conversation
…esh seeded copy of the app, not on rows written back through its doors Claude-Session: https://claude.ai/code/session_01ADHkmP1FQBBcaufj5VXUcV Co-authored-by: Claude <noreply@anthropic.com>
… after a transition unmeasured Claude-Session: https://claude.ai/code/session_01ADHkmP1FQBBcaufj5VXUcV Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmP1FQBBcaufj5VXUcV Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 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 a587a72a1f20b8bc8d26ba76e638188a985ddad1 && git checkout a587a72a1f20b8bc8d26ba76e638188a985ddad1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bdd51769ee827b24355fa1328375bb09c05c8d65 69b88800e2ce07d7cf664de8af3c3430a6fd2d19 && git checkout -B drift-repro bdd51769ee827b24355fa1328375bb09c05c8d65 && git merge --no-ff 69b88800e2ce07d7cf664de8af3c3430a6fd2d19
node scripts/docs-audit/affected-docs.mjs --json bdd51769ee827b24355fa1328375bb09c05c8d65
|
…he write-back Claude-Session: https://claude.ai/code/session_01ADHkmP1FQBBcaufj5VXUcV Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Final head for review · 2026-11-16T23:30ZFinal head:
|
|
repo:objectstack#2 · os-steve · session_01ADHkmSmxJiAWk7fuq3Q1Sf 席位核对L1 verdict: REWORK (2 items, both about PR text and card bookkeeping, not code) · card #34448 · area o2-C · first review · read at 2026-11-16T23:33Z The code, tests and evidence pass L1 as they stand at this head. Neither rework item needs a push. Both are a body edit or a card filing, so the head stays where it is, and the delta read is the body only. Rework items
Checklist readings (pass)
L2 owed: yes, at Landing tier. |
|
repo:objectstack#2 · os-steve · session_01ADHkmSmxJiAWk7fuq3Q1Sf 席位核对L1 verdict: ACCEPT · card #34448 · area o2-C · delta on REWORK 6932638502 · read at 2026-11-16T23:38Z Delta, read on GitHub:
Gates at this head. PR-body guards re-ran after the body edit: L2 owed: yes, Landing tier. Not governed per |
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Contract-review-claim: session_01ADHkmRH4UCX1tvddXMS7cq · head 69b8880 · 2026-11-16T23:41Z Area o2-C (repo:objectstack#2) takes the |
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Contract reviewServed-tier: Face: declaration only. The PR body and the changeset carry ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Landing · 2026-11-16T23:42ZHead
It goes ready and auto-merge through the ordinary queue. The card stays open ( |
Requested by Steve · project thread
Part of #34448
Clause-②: yes (widening)
Metadata-protocol: none
The widening is through
./runner: the new exported typeFreshCopy, the new optional last parameterfreshofrunHalf, and the new optional fieldRowRestore.freshCopy(orchestrate.ts). Nothing removed or narrowed;./score,./score/full,./exportand.untouched. The claim was amended to match (its Clause-② amendment on #34448, 23:01Z).维护者速读
packages/qa/scenarios/src/runner/orchestrate.ts的runHalf(moveToFreshCopy与操作循环开头的分支)、seedDifference、withInstalledBuild里 ask 模式的fresh。pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts -t 34448,预期 3 个用例全过。What changes
bootDevspawnsobjectstack dev --fresh;HttpAppis the whole harness). The seed load the card names as "privileged, system-context" is the same admin data door the restore uses (HttpApp.insertRow→POST /api/v1/data/:objectwith the admin session;seedApp), so there is no privileged seed path to reuse. The platform takes an object's declared controls off a write only forExecutionContext.isSystem === true, and an HTTP request is assembled withisSystem: false: the import doors refuserunAutomations: false/treatAsHistorical: truefor every signed-in caller, administrators included (importControlOptOutRefusal,packages/rest/src/import-prepare.ts), and the import undo writes under the controls (importUndoWriteContext,packages/rest/src/data-action-routes.ts). Delete-and-reinsert through the data door runs the app's delete and create hooks and record-triggered flows, so it cannot promise "no flow runs". Opening a door past the controls would weaken the platform, which the card rules out. So this PR takes Ask 2: isolation.orchestrate.ts).runHalftakes an optional last parameterfresh(FreshCopy: boot another copy of the same app with the same build installed the same way). Before each operation it reads the seeded objects (seedDrift, only reads; the read looprestoreSeededRowsalready had, now shared). Nothing moved ⇒ nothing happens. Something moved ⇒moveToFreshCopy: boot the copy, sign the admin in, create every persona with its permission set, mint the admin key, load the seed by the sameseedApp, compare the copy's seed with the run's (seedDifference: rows loaded, rows refused with code and fields, permission sets assigned), read the copy's seeded state, then switch the half to it (accounts, keys and seeded state included) and stop the copy it replaces. The half's last copy is stopped in afinally; the booted app stays withwithApp, as before. The operation recordsrestored: { freshCopy: [object/id, …] }, the rows that had moved.ops.boot(dir)on the same project (freshBoot). Ask mode:withInstalledBuildboots the same blank host again and installs the same manifest through the unmanaged door; a refused install fails that copy. Template mode passes none: its app holds the agent's iterate, made live through the app's doors, which a host booted again would not hold, so it keeps writing rows back throughrestoreSeededRows(comment at the call).restore: no fresh copy of the app could be seeded for it (REASON); what had moved: DRIFT. It is not asked, and never graded on other rows. A half that has nofreshkeeps today's write-back and today'srestore: the rows could not be restored …reason.pending_confirmationoperation's ask and confirmation run back to back on the same app. The scorecard'sN started from restored rowsstill counts every operation that started from the seeded rows, now including the ones on a copy (scorecard.tsuntouched)..changeset/34448-scenario-fresh-copy-restore.md(patch;@objectstack/scenariospublishes).Why
#34338, the change for #34294, restored the seeded rows by writing them back through the app's data door as the admin. On
asset_lifecycle(#34448's measured run, objectstack maina121e29c),manager_approves_scrapmoved DR-0006submitted→approved; the write-back tosubmittedmet the app's one-way status rule, 400VALIDATION_FAILED, anddispose_scrapped_asset,employee_approves_own_scrapandcheck_out_asset_in_repairread NOT MEASURED in both halves. A rule like that is what a well-built app declares, so a restore the app must accept cannot undo a legitimate transition, and a restore it accepts can still fire its flows.Tests
test/runner/orchestrate.test.ts, a new top-level describe (#34448, 3 cases) on theasset_lifecyclecard with an app double that carries the card's one-way rule (a decided scrap request never goes back tosubmitted, 400VALIDATION_FAILED, the issue's own message):manager_approves_scrapwrote once,dispose_scrapped_assetrecordsrestored: { freshCopy: ['demoasset_disposal_request/dr06'] }; the rule refused nothing on any app; the booted app took exactly the seed's inserts and the seed's own second-pass updates and no delete; every boot was stopped by the end.dispose_scrapped_assetis NOT MEASURED withdemoasset_disposal_request: 1 changed (dr06: status, decided_on)and the refusalupdate demoasset_disposal_request dr06: 400 VALIDATION_FAILED …named, not asked, not graded.the copy's seed did not load as the run's did: it loaded N rows, the run M; it refused demoasset_employee/e05 VALIDATION_FAILED, the run nothingand what had moved; not asked; every refused copy was released. A copy whose boot throws saysobjectstack dev exited before it was ready.Tests forced to change, each because the scratch half now runs an operation after a write on a copy instead of writing the rows back (assertions read the new truth, none loosened):
runCard — the seed against a build whose owner field is a user lookup›loads all 8 rows…: the booted app now keepsnew-add_contact(nothing is written back to it); added that there are 4 apps (the booted one and the copies formove_eli,remove_ben,contact_bad_email) and that every copy's owners equal the booted app's.runCard — the card's own namespace, demo + code›scaffolds the project as democrm…: the template host is the last app booted, no longerapps[1].runCard — the validation operation is probed…›sends the declared write once…: the two probes are read across every app (each went to the app its operation ran on); same two calls, same keys. ›an agent that catches the bad value…:partner_edits_accountrecords{ freshCopy: ['democrm_contact/probe-5'] }(was{ deleted: [...] }), and the copy it ran on holds no probe row.runHalf — each operation starts from the seeded rows… (#34294): the cascade case reads{ freshCopy: ['democrm_contact/new-add_contact', 'democrm_contact/ct5'] }(was deleted + reinserted), still passes on its own merits; the confirmation-interplay case readsfreshCopyforremove_benandcontact_bad_email; the refused-restore case (403 delete, and a harness with nodeleteRow) now runs the Run half with no fresh copy, as template mode does, and pins the same reasons verbatim.Acceptance notes
asset_lifecyclerun) is NOT MEASURED, reason: this container holds no model credential (checked by presence only); per the order no credential was sought. The seat schedules the live run (the daily gallery task).moveToFreshCopy, the error path releases the new copy as well; left for a later change so the head does not move.objectstack dev --freshwaits up to 180 s for health), the persona sign-ins and one seed load per operation that follows a write; up to three servers live for a moment (the booted app, the copy being replaced, the new copy). The crm card's clean run pays three copies per half.packages/qa/scenarios/README.md's bullet Each operation starts from the seeded rows now names both paths (scratch and ask on a fresh copy, template writing back), after the claim amendment added it to the file surface.Verification
Ablation
node scripts/ablation-replace.mjson the committed head (orchestrate.tsblobf92b76b517ff), scratch mode's Run half given no fresh copy (…, opts.promptChoice, freshBoot(ops, dir))→…, opts.promptChoice, undefined)): anchor 1 → 0, blobf92b76b517ff→5cdc7e332873. The tests importsrc, so there is no build leg.-t 34448: 2 failed / 1 passed. The first case reads exactly the issue's failure:dispose_scrapped_assetNOT MEASUREDrestore: the rows could not be restored to the seeded state: demoasset_disposal_request: 1 changed (dr06: status, decided_on) (refused: update demoasset_disposal_request dr06: 400 VALIDATION_FAILED That status change is not allowed: …), and two more after it. The copy case finds no NOT MEASURED where a copy was refused. Restored: blob == HEAD (f92b76b517ff),git diff HEADempty.Local gates
69b88800(after mergingorigin/mainonce atdc265d44; the merge touched nothing underpackages/qa/scenarios;69b88800adds only the README paragraph).pnpm --filter '@objectstack/scenarios^...' build:: exit 0 (lock VERDICT command-exit 0, 2m59s).pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test:: exit 0 (lock VERDICT command-exit 0) ondc265d44and again on69b88800: Test Files 35 passed (35), Tests 991 passed (991). On the same source,pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios testpassed its typecheck leg (its test leg then asked for the package's owndist/, which the run above built).eslint --no-inline-configon the two touched TS files :: exit 0.69b88800(dispatch-gates --commands --repo objectstack-ai/objectstack, 4 paths, 62 families, the same set as ondc265d44), each with stdin from/dev/null: 62 exit 0.--ran: "62 derived famil(ies) accounted for — 62 run, 0 NOT-MEASURED".dc265d44, read 60 exit 0 and 2 exit 3:check-plugin-teardown-shape --self-testbefore its pinned fixture commit was fetched (a rerun aftergit fetch --depth=1 origin 621a4876…exited 0, "48 cases pass"), andpnpm check:dual-build-cjs-loadsbefore every package'sdist/was built. Both records are in the project files.packages/spec,src/score/**,scorecard.ts, card JSONs andsrc/export/**untouched.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.