Repository navigation
fix(scenarios): template mode's iterate Run half runs an operation after a write on a fresh copy of the served app - #35291
Conversation
…f the served app The copy is a blank host with what the app serves after the iterate installed the same way (iteratedManifest: the run's install manifest, each served collection replaced by the items served now, read decorations stripped), so an operation an earlier write would meet runs on it instead of writing the rows back through the app's doors. Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude <noreply@anthropic.com>
…set_lifecycle operations on served copies Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude <noreply@anthropic.com>
…h copy; iteratedManifest stays module-private Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude <noreply@anthropic.com>
…mplate-fresh-copy
📓 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:
⛔ 3 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 e1f09c33e8f464e340b2a01aa6e807ae598fad43 && git checkout e1f09c33e8f464e340b2a01aa6e807ae598fad43
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f848e3739f36fdfadc58cb4ce07defda6e624cba 89ea8b117537c20adec815f2004625523e16c4f0 && git checkout -B drift-repro f848e3739f36fdfadc58cb4ce07defda6e624cba && git merge --no-ff 89ea8b117537c20adec815f2004625523e16c4f0
node scripts/docs-audit/affected-docs.mjs --json f848e3739f36fdfadc58cb4ce07defda6e624cba
|
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CazXu8zyYD5PC6J2u7 Landing · ACCEPT (L1-a) → PR #35291 comment 6998338858 · head
Area ai-1 landing armed (ready + auto-merge); #34497 close-out on MERGED. |
Requested by Bill · project thread
Fixes #34497
Clause-②: no
Metadata-protocol: none
维护者速读
packages/qa/scenarios/src/runner/orchestrate.ts中的iteratedManifest和withInstalledBuild的copyOf;再看test/runner/orchestrate.test.ts里 Scenario runner: restoring seeded rows through the app's write door is refused by its own state rules (VALIDATION_FAILED), so later operations go unmeasured (regression from #34338) #34448 describe 的 template 用例。pnpm --filter @objectstack/scenarios exec vitest run test/runner/orchestrate.test.ts -t 34497,预期 1 passed。What changes
templateModenow gives its iterate Run half aFreshCopy(orchestrate.ts). The copy is the same blank host, booted again, with the iterated app installed unmanaged the way the run's own install landed. Before, template mode wrote moved rows back through the app's doors (restoreSeededRows), and an app's one-way state rule refused that write-back.iteratedManifest(module-private) builds what the copy installs: the manifest the run's install sent, with each served collection replaced by the items the host serves after the iterate. Each item goes throughstripReadDecorations(@objectstack/spec/kernel) first. The spec says a served body is no valid input to its own schema until its read decorations are removed, and the unmanaged install door refuses a served flow carrying_diagnostics(measured below).withInstalledBuildnow handsusebothcopyOf(manifest)andmanifest.freshiscopyOf(landed.manifest), as before. Ask mode is unchanged.@objectstack/scenariospatch.Premise measurement (the card's gate, run before any change)
This was a live measurement on blank hosts scaffolded with
create-objectstack@18.6.0. No model ran. Host A installeddocs/qa/scenarios/builds/travel_expense.jsonunmanaged and then took an iterate throughPUT /api/v1/meta/object/NAME: a new objectdemotravel_travel_advancewith astate_machinevalidation, plus a new lookup fieldadvanceondemotravel_expense_claim. Host B was a fresh boot of the same project with A's served metadata installed unmanaged. Both then got the card's personas and seed.Readings
metadataAsArtifactreturns them: B's install answered422 INVALID_METADATA, refusing 3 flows forunrecognized_keys: _diagnostics.stripReadDecorationsapplied: B's install answered 200 (copiedCount31). All 11 collections had the same names on A and B (objects 8/8 including the iterate's new object, apps 1, views 6, dashboards 1, reports 1, datasets 3, actions 4, flows 3, permissions 3, skills 1, hooks 1). The per-item deep diff (fields, validations, actions) found 0 differences. The only difference isobjects/demotravel_travel_advance._packageId, which readssys_metadataon A andcom.example.demotravel-copyon B. That is the protection envelope, not the item.seedDifferenceempty.Tests
#34448describe: the case "without a fresh copy the same rule refuses the write-back" is now "template mode: the iterate Run half measures all six operations…". It runsrunCardwithmodes: ['template']onasset_lifecycle. All six operations are asked and measured.dispose_scrapped_assetcarriesrestored: { freshCopy: ['demoasset_disposal_request/dr06'] }. No rule refusal happens, and the iterated host took only its seed's writes. Every copy installed the same objects as the iterated host, including the scripted iterate's object. Every boot stopped.OneWayApp) now serves_diagnosticson metadata reads, and its unmanaged install door refuses an item carrying it, as the real door does.#34294case "with no fresh copy (template mode)" is retitled "(a Run half given none)". It still pins the write-back path, which door mode uses.Ablations (scripts/ablation-replace.mjs; tests import src, no build leg)
…opts.promptChoice, fresh);changed to…opts.promptChoice);intemplateMode, blob b3da89cb to ac741fb0). The first attempt was refused with ANCHOR AMBIGUOUS (x2) and wrote nothing. Rerun with a longer anchor:-t 34497gave 1 failed, with 3 operations NOT MEASURED:restore: the rows could not be restored to the seeded state: demoasset_disposal_request: 1 changed (dr06: status, decided_on) (refused: update … 400 VALIDATION_FAILED …). Restored blob equals HEAD, andgit diff HEADis empty.items.map(stripReadDecorations)changed toitems, blob to fad3c78b): 1 failed, with 5 operations NOT MEASURED:restore: no fresh copy of the app could be seeded for it (unmanaged install refused: 422 INVALID_METADATA …). Restored blob equals HEAD, andgit diff HEADis empty.Verification
At head 89ea8b1 (after merging origin/main 0c047d0)
pnpm --filter '@objectstack/scenarios...' build, thenpnpm --filter @objectstack/scenarios test: Test Files 40/40, Tests 1182/1182.typecheck(tsc --noEmit) exit 0. Lock VERDICT command-exit 0.dispatch-gates --commands --repo objectstack-ai/objectstackderived 63 families. 61 exited 0 and 2 exited 3.check-plugin-teardown-shape --self-testneeded a shallow fixture; aftergit fetch --depth=1of 621a487 the rerun exited 0 with 48 cases.check:dual-build-cjs-loadsneeds every package's dist, and CI runs it.--ranreconciliation: 63 derived, 61 run, 2 NOT-MEASURED, 0 UNRUN.overlap-check --branch=HEAD --pr=35267: clean.check-nul-bytesexit 0.Acceptance notes
collections). An iterate that adds an item of a metadata type the template had none of is neither scored nor copied. That gap already existed and is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7