Repository navigation
fix(scenarios): the seed leaves out the card values of the build's roll-ups, so a payment capped at its invoice's open balance loads - #37950
Conversation
…ll-ups, so a payment capped at its invoice's open balance loads Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTDPAaiTGidYohtQcg
📓 Docs Drift Check6 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. 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 8b409ce2e772899b866a4482b6a8abe7277c302a && git checkout 8b409ce2e772899b866a4482b6a8abe7277c302a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 39fafc0dfeed129ce7f37e444f39e04dc670aa0b 5a1c59a948569eaa4f53baade9b8d6924eb3295f && git checkout -B drift-repro 39fafc0dfeed129ce7f37e444f39e04dc670aa0b && git merge --no-ff 5a1c59a948569eaa4f53baade9b8d6924eb3295f
node scripts/docs-audit/affected-docs.mjs --json 39fafc0dfeed129ce7f37e444f39e04dc670aa0b |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 5a1c59a · card #35654 · area s2-eval · 2026-11-27T13:11ZL1 checklist (no review face on this file list: this record is the review of record)
Tier: S. Landing: ready and auto-merge in this stroke. |
Requested by Sales · project thread
Fixes #35654
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/qa/scenarios/src/runner/seed.tsgainsrollupFields(artifact): the fields a built artifact declarestype: 'summary', per object, read through the scorer's artifact reader (the same shape asderivedFields).packages/qa/scenarios/src/runner/orchestrate.ts:seedRowBodytakes the object's roll-ups and leaves their card values out of the row, returning them asleftOut(object.field).seedApptakesrollups(per object) afterrequired, and records the left-out columns in the run record'sseed.leftOut(new optional field onRunHalf['seed'], absent when nothing was left out, so a card with no roll-up keeps its record's bytes).rollupFields(built);restoreSeededRowsre-inserts a seeded row with the same body.packages/qa/scenarios/src/export/screenshots.ts: the gallery screenshot boot passes the artifact's roll-ups too, so it seeds the same rows the run does.Why only roll-ups, not every computed type (
derivedFields: formula, summary, autonumber):count/sumroll-up starts at 0 on insert (packages/objectql/src/engine-insert.ts, Field.summary 的 count 汇总:从未有过子记录的父行停在 NULL,删光子记录才变 0 —— 同一个「零」两种值,筛选 = 0 静默漏行 #5749 / objectql: a Field.summary roll-up withoutreadonly: trueaccepts a person's write — REST PATCH and import store the typed value until the next recompute #34672) and each admitted child adds to it, also inside one batch (summary-batch-accumulation.ts), so the parent ends at the card's value.namean autonumber (INV-{YYYY}-{0000}), and the card's questions citeINV-1058. A first cut that left out everyderivedFieldscolumn also droppednameon invoices, payments and orders; the test caught it.expression(the committed build'sbalance,status,amount) is recomputed by the engine from the row anyway, so it needs nothing here.The card is unchanged: every one of its 95 invoices states
amount_paidequal to the sum of its payments (asserted in the new test), and every sales order'stotal_amountequals the sum of its lines. So itscardSha256and the committed build from #37911 are untouched, and a build that storesamount_paidas a plain number is still sent the card's value.Tests
packages/qa/scenarios/test/runner/orchestrate.test.tsgains a[#35654]block against the real card and the committed build (docs/qa/scenarios/builds/order_to_cash.json), with a double that runs the build shape the card names:amount_paida roll-up of payments, a payment capped at the invoice's open balance, a roll-up value sent stored as written.amount_paid(andderivedFieldsalso lists the autonumbername, which stays sent); the card states each invoice'samount_paidas the sum of its payments;seed.leftOutisdemoorder_invoice.amount_paidanddemoorder_sales_order.total_amount, every invoice ends at the card'samount_paid, andINV-1058keeps its name;demoorder_payment, with the rule's message;restoreSeededRowsre-inserts a removed invoice without its roll-up value.Ablation: with the
src/change stashed, the three new behaviour tests fail and the control passes.runs
npx vitest run test/runner/orchestrate.test.ts(inpackages/qa/scenarios): 180 passed.test/runner/packages.test.ts"every install ran the workspace's pinned pnpm" — fails identically onmainf926dfa in this container (the stash run), so not this change.test/build/*passed afterpnpm --filter @objectstack/scenarios build.npx tsc --noEmit -p .inpackages/qa/scenarios: clean.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 64 derived, 62 exit 0, 2 exit 3 NOT MEASURED (check-plugin-teardown-shape.mjs --self-testdid not reach its verdict here;check:dual-build-cjs-loadsneeds every package built). Left to CI.Verification
Two-minute check:
cd packages/qa/scenarios && npx vitest run test/runner/orchestrate.test.ts -t 35654prints 4 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTDPAaiTGidYohtQcg