Skip to content

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

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-hxpuvn-35654
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-hxpuvn-35654

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #35654

Clause-②: no
Metadata-protocol: none

维护者速读

  • 是什么:评测跑器往应用里灌示例数据时,不再写入「自动汇总」类字段的值(比如发票的已付金额,它本该由付款记录加出来),改由平台按付款自己算。
  • 为什么:订单回款这张评测卡把每张发票的已付金额终态直接写进去。一个做得很对的应用(已付金额 = 付款合计,并且付款不得超过未付余额)在灌数据时就会把已付清发票的 66 笔付款当成超付拒掉,评测因此冤枉正确的应用。
  • 评测卡本身和上一个 PR 入库的验证构建都没改;只有把这类字段做成自动汇总的应用才受影响,做成普通数字字段的照旧收到卡上的值。发票号、订单号这类自动编号照样写入,因为问题里会引用它们。
  • 出错会怎样:只影响评测跑器灌数据这一步,最坏是某张卡的汇总字段起始值不对,可直接撤回。
  • 要你做的:无。

What changes

packages/qa/scenarios/src/runner/seed.ts gains rollupFields(artifact): the fields a built artifact declares type: 'summary', per object, read through the scorer's artifact reader (the same shape as derivedFields).

packages/qa/scenarios/src/runner/orchestrate.ts:

  • seedRowBody takes the object's roll-ups and leaves their card values out of the row, returning them as leftOut (object.field).
  • seedApp takes rollups (per object) after required, and records the left-out columns in the run record's seed.leftOut (new optional field on RunHalf['seed'], absent when nothing was left out, so a card with no roll-up keeps its record's bytes).
  • Both seed calls in the run half (first seed and the fresh-copy reseed) pass rollupFields(built); restoreSeededRows re-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):

The card is unchanged: every one of its 95 invoices states amount_paid equal to the sum of its payments (asserted in the new test), and every sales order's total_amount equals the sum of its lines. So its cardSha256 and the committed build from #37911 are untouched, and a build that stores amount_paid as a plain number is still sent the card's value.

Tests

packages/qa/scenarios/test/runner/orchestrate.test.ts gains 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_paid a roll-up of payments, a payment capped at the invoice's open balance, a roll-up value sent stored as written.

  • the committed build's invoice roll-up is amount_paid (and derivedFields also lists the autonumber name, which stays sent); the card states each invoice's amount_paid as the sum of its payments;
  • with the build's roll-ups, all 72 payments load, seed.leftOut is demoorder_invoice.amount_paid and demoorder_sales_order.total_amount, every invoice ends at the card's amount_paid, and INV-1058 keeps its name;
  • control: sent the end state, the cap refuses 66 payments, all on demoorder_payment, with the rule's message;
  • restoreSeededRows re-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 (in packages/qa/scenarios): 180 passed.
  • Whole package: 1384 passed, 14 skipped, 1 failed: test/runner/packages.test.ts "every install ran the workspace's pinned pnpm" — fails identically on main f926dfa in this container (the stash run), so not this change. test/build/* passed after pnpm --filter @objectstack/scenarios build.
  • npx tsc --noEmit -p . in packages/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-test did not reach its verdict here; check:dual-build-cjs-loads needs every package built). Left to CI.

Verification

Two-minute check: cd packages/qa/scenarios && npx vitest run test/runner/orchestrate.test.ts -t 35654 prints 4 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTDPAaiTGidYohtQcg

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

6 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
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 39fafc0dfeed129ce7f37e444f39e04dc670aa0b → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8b409ce2e772899b866a4482b6a8abe7277c302a — the merge of head 5a1c59a948569eaa4f53baade9b8d6924eb3295f into base 39fafc0dfeed129ce7f37e444f39e04dc670aa0b, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 5a1c59a · card #35654 · area s2-eval · 2026-11-27T13:11Z

L1 checklist (no review face on this file list: this record is the review of record)

  • Shape and checks. 34 success, 18 expected skip, 0 failed on the head; Check Changeset is still running, and auto-merge waits for it; 146 changed lines in packages/qa/scenarios and a changeset, not governed.
  • The fix is in the runner, not the card. seedApp, seedRowBody and the restore path leave out a column the build declares a roll-up (rollupFields, new in seed.ts) and name it in seed.leftOut; the platform derives it from the child rows the seed does send. The screenshot export passes the same set. The card and the committed order_to_cash build are untouched, so their cardSha256 and provenance stand.
  • Decision, accepted. Only roll-ups are left out, not the whole derivedFields set: the committed build makes name an autonumber that the card's questions quote (INV-1058), and the first version, which dropped every derived field, was caught by the tests.
  • Tests. On the real order_to_cash card, its committed build and a balance-capped payment rule, all 72 payments load (the control refuses 66); reverting the src change turns the three new tests red.
  • Declarations. Clause-②: no, Metadata-protocol: none, @objectstack/scenarios patch. Fixes #35654 is right.

Tier: S. Landing: ready and auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 13:11
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 355fe3c Nov 27, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-hxpuvn-35654 branch November 27, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants