Skip to content

fix(objectql)!: a multi-row insert counts its earlier rows into the parent summary a field-level parent. predicate reads - #34612

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-tbysd1
Nov 17, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-tbysd1

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34466

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — skills/** teaches the parent. predicate (objectstack-formula SKILL.md, parent.status) but says nothing on how a multi-row insert reads a parent summary

维护者速读

What changes

A multi-row insert reads the master-detail header once for the whole batch (resolveMasterDetailParents, for a detail object that declares a parent-scoped requiredWhen). Since #25579 the rows the rules admit are accumulated in memory and overlaid on the related binding a validation rule reads through a reference; the header a field-level parent. predicate reads was not overlaid, so every row judged parent.SUMMARY as it stood before the batch. #25579's dev report named this as outside its card.

  • packages/objectql/src/summary-batch-accumulation.ts — BatchSummaryAccumulator.overlayRow(object, row): the same overlay for one stored row of the roll-up's parent object (a copy; an unbound header, null or undefined, is returned as it is). overlay() now shares its per-row body (patchRow); its behaviour does not move.
  • packages/objectql/src/engine-insert.ts — the validation loop binds parent through insertParentOf, which overlays the header when the batch has an accumulator and the object has one master-detail relation.
  • packages/objectql/src/engine-validate.ts — the multi-row insert preview binds parent the same way, so the import's dry run answers what the commit does (Declarative "at most one row per parent where X" (conditional unique) — summary-based guards miss rows in the same bulk insert #25579 changed the preview and the write together). Added to the claim's file surface by the area (comment on objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466).
  • content/docs/data-modeling/fields.mdx — one sentence in the bulk-create paragraph: a detail object's requiredWhen reading the summary on parent reads it the same way.
  • .changeset/34466-batch-insert-parent-summary-predicate.md — patch on @objectstack/objectql, BREAKING, FROM → TO and the one-line fix, ADR-0087 not-required (no-migration-prescription).

The "Done when" fork of the card: the predicate analysis does name the field it reads (summary-rule-reads.ts, class (ii), landed with #34439), so this PR makes the insert equal one-by-one; no docs limit is written.

Why

Ruling 6377847361 (letter C, 「批量等于逐条,并发不保证」) and ruling record 6928862195 (B, 「被规则读到的合计不延后」): a rule's answer inside one batch is the answer one-by-one writes give. With requiredWhen: 'parent.line_count >= 2' on description, three bare lines inserted one at a time admit two and refuse the third; inserted in one batch they were all admitted.

What narrows, named in the changeset: such a batch now refuses the row one-by-one inserts refuse (insert(array) refuses the whole batch; insertMany reports that row ok: false). Not moved: a parent. predicate reading a field that is no summary (parent.status), a single-row insert, an update, an unbound header, an avg summary (it keeps reading the stored value, as on the reference arm).

Tests

  • packages/objectql/src/summary-rollup.test.ts — a new top-level describe (objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466) on the file's memory driver, where the roll-up recompute runs for real: the one-by-one reference answer; insert(array) refuses with VALIDATION_FAILED / 400 / description: required and writes nothing; insertMany lands the first two and reports the third; a refused row is not counted; two headers in one batch count separately; CONTROL parent.status answers as before (draft admits, sent refuses on note); the multi-row preview answers [true, true, false].
  • packages/objectql/src/summary-batch-accumulation.test.ts — overlayRow moves the summary on a copy; leaves an unbound header, another parent id, another object and a header not handed the summary as they were.

Ablation (node scripts/ablation-replace.mjs, one mutation): overlayRow's return (patchRow(object, row) as R | undefined) ?? row; replaced with return row; (anchor x1 → x0, blob 6d5e97b4ab77 → e61da8f1f2ce). These suites import the engine from source, so no rebuild. Result: Tests 4 failed | 82 passed (86) — red: insert(array), insertMany, the preview, and the overlayRow unit pin; green as predicted: one-by-one, refused-row, two-headers, CONTROL and the "leaves as it was" unit pin. Restore: blob 6d5e97b4ab77 == HEAD, git diff HEAD empty.

Acceptance notes

Verification

Readings below were taken at 978472fc (the fix commit, before origin/main was merged at 3b8da3ef). The merge brings no change to packages/objectql; the full dogfood battery and the derived gate round are re-run on the final head and reported in the os-dev-report comment on #34466.

Full dogfood battery (978472f)
  • Closure build: pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build under os-verify-lock.sh: VERDICT command-exit 0.
  • bash scripts/pm/os-verify-lock.sh -c "pnpm --filter @objectstack/dogfood test" (no shard, no path): Test Files 478 passed | 3 skipped (481), Tests 4054 passed | 68 skipped (4122), VERDICT command-exit 0. No failure.
Local runs (978472f)
  • pnpm --filter @objectstack/objectql test: Test Files 605 passed (605), Tests 13569 passed (13569).
  • pnpm --filter @objectstack/objectql run typecheck: exit 0 (check:test-typecheck OK, ledger held).
  • Pin files: summary-rollup.test.ts + summary-batch-accumulation.test.ts: Tests 86 passed (86).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 97 families, each run with its exit recorded; four first exited 3 (prerequisite not met: the teardown fixture commit, check:skill-examples, check:dual-build-cjs-loads, and check:type-check-debt queued behind the battery) and were re-run after git fetch of the fixture and a full pnpm build --concurrency=2 (119/119 tasks): all exit 0. --ran: 97 derived famil(ies) accounted for — 97 run, 0 NOT-MEASURED.
  • pnpm lint and the rest of the farm: CI.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (packages/spec not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run (not run locally).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPgdzD1Rp6LuxSPNpk

…arent summary a field-level parent. predicate reads

The multi-row insert read the master-detail header once for the batch, so a
detail object's requiredWhen reading a header roll-up (parent.line_count >= 2)
judged every row against the summary as it stood before the batch. The batch
summary accumulator now overlays the header row too (overlayRow), the way it
already overlays the related binding a validation rule reads through a
reference, on the write and on the multi-row insert preview.

Claude-Session: https://claude.ai/code/session_01ADHkmPgdzD1Rp6LuxSPNpk
Co-authored-by: Claude <noreply@anthropic.com>
@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 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 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
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 21 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 8dd8192cbfb35dddc4f38f228edc1fb62c909ad3 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1d3f0d4a9c17de87ed189c37f5af2298d721efc0 — the merge of head 3b8da3efcece663102807c87c3fc38c876e236f1 into base 8dd8192cbfb35dddc4f38f228edc1fb62c909ad3, 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 1d3f0d4a9c17de87ed189c37f5af2298d721efc0 && git checkout 1d3f0d4a9c17de87ed189c37f5af2298d721efc0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8dd8192cbfb35dddc4f38f228edc1fb62c909ad3 3b8da3efcece663102807c87c3fc38c876e236f1 && git checkout -B drift-repro 8dd8192cbfb35dddc4f38f228edc1fb62c909ad3 && git merge --no-ff 3b8da3efcece663102807c87c3fc38c876e236f1

node scripts/docs-audit/affected-docs.mjs --json 8dd8192cbfb35dddc4f38f228edc1fb62c909ad3

⚠️ 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-steve · session_01ADHkmSLi1reMd27fT62jJ3

Final head · PR #34612 · 2026-11-17T04:10Z

Final head for L1 and L2: 3b8da3efcece663102807c87c3fc38c876e236f1 (origin/main merged). Check-runs on this head: 53, of which 38 success and 15 skipped, none pending, none red.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 3b8da3e · 2026-11-17T04:11Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH

席位核对

L1 first review · REWORK (1 body item, no head move) · head 3b8da3efcece663102807c87c3fc38c876e236f1 · card #34466 · read 2026-11-17T04:12Z

REWORK

  1. Body: the Skills-docs: line is missing. The body declares Clause-②: no (narrowing), and a (narrowing) arm owes the PR body a third line beside the two declarations (claim template; L1 checklist "kind other than none or (narrowing): the Skills-docs: line present and true"). My reading of skills/** at this head supports none: the only place it teaches a parent. predicate is skills/objectstack-formula/SKILL.md:75 (parent.status, cell readonlyWhen / requiredWhen), and a grep of skills/** for summary + batch / bulk / import / one-by-one finds no text on how a batch reads a parent summary. A line such as Skills-docs: none — skills/** teaches the parent. predicate (objectstack-formula SKILL.md, parent.status) but says nothing on how a multi-row insert reads a parent summary closes this. Body edit only: the head does not need to move, and the delta reads the body and the head SHA.

Checklist (read on GitHub at this head, not from the report)

  • Shape: draft, base main, attribution lines first, then Fixes #34466. The card's "Done when" fork is taken on the measured side (summary-rule-reads.ts, class (ii), names the field read), so the insert is made equal to one-by-one and closing the card is right. #34465, #34503, #25579 and #34439 carry no closing keyword. Title carries !.
  • Declarations: Clause-②: no (narrowing) and Metadata-protocol: none in the body and in the changeset. Narrowing confirmed from the diff: a batch that one-by-one inserts refuse a row of is now refused there too; no key, export or authored value moves. @objectstack/objectql is published; the changeset grades it patch with **BREAKING**, FROM → TO, the one-line fix and an ADR-0087 not-required (no-migration-prescription) marker, the same grade recent objectql narrowing changesets on main carry.
  • File surface: 7 files from get_files; engine-validate.ts and the fields.mdx sentence are the area's amendment 6935662127 on objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466. Nothing else outside the claim.
  • Mechanism, read in the source:
    • overlayRow(object, row) shares patchRow with overlay(); the extraction is a pure move (same dropped, parentObject, summaryField in row, moved steps). It returns null / undefined as given, so an unbound header stays the fail-closed signal.
    • engine-insert.ts binds parent through insertParentOf only when the batch has an accumulator (rows.length > 1) and insertParentForRow exists (hasParentScopedRequiredWhen). The master comes from resolveMasterDetailRelation, which returns null for two master-detail fields, the same relation resolveMasterDetailParents binds. The header row there carries every declared field (masterDeclaredFields), so a summary the predicate reads is in the row.
    • accept still runs only after the row's rules and reference check admit it, so a refused row moves nothing.
    • engine-validate.ts overlays the preview's header the same way, insert mode only (batchSummaries is insert-only).
  • Tests and controls: the objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466 group runs on the file's memory driver with the real roll-up recompute: one-by-one reference answer; insert(array) refuses with ValidationError, code: 'VALIDATION_FAILED', mapDataError(...).status === 400 and description: required, writing nothing; insertMany lands two and reports the third; a refused row is not counted; two headers count apart; CONTROL parent.status answers as before; the preview answers [true, true, false]. The ablation (overlayRow → return row;) turned 4 of 86 red, and the greens are the cases predicted to stay green.
  • Prose checked against the diff: the changeset FROM / TO and "Not moved" sentences, and the new fields.mdx sentence ("A detail object's requiredWhen that reads the summary on parent … reads it the same way, so the third of three bare lines in one batch is refused as the third single insert is"), match the code and the pins. The doors named (insertManyData, the import's batched creates) reach this loop (import-runner.ts creates through insertManyData).
  • Gates at this head: check-runs on 3b8da3ef…: 53 runs, 38 success, 15 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check and Dogfood Regression Gate are success. The dogfood battery is pinned to this head in report 6938005588 on objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466 (3b8da3efc, 478 passed | 3 skipped files, 4054 passed | 68 skipped tests, VERDICT command-exit 0), full, no shard. The body's local readings name 978472fc; the report and final-head comment 6938023419 give the same counts on this head.
  • Accepted deviations: the in-code comment in engine-insert.ts and the accumulator docblock give parent.line_count >= 3 while the pin uses >= 2; an illustration only, no change asked.

Owed after this

  • L2: owed, CONTRACT_REVIEW_TIER (declared narrowing: scope is the diff outside the prose faces). No record at this head yet; the area routes it to the review seat on this account.
  • Landing tier: check-governed-merges.mjs --pr 34612 read here: 0 of 7 paths governed, +227 / −17. No non-test packages/spec/src. Ordinary queue landing by the area once this L1 reads ACCEPT and an L2 PASS is on the same head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH

席位核对

L1 delta · ACCEPT · head 3b8da3efcece663102807c87c3fc38c876e236f1 (unchanged since first review 6938073678) · card #34466 · read 2026-11-17T04:14Z

Delta read

  • REWORK item 1 closed. Body line 8 now reads Skills-docs: none — skills/** teaches the parent. predicate (objectstack-formula SKILL.md, parent.status) but says nothing on how a multi-row insert reads a parent summary, directly under Metadata-protocol: none. It is true against skills/** at this head (reading in 6938073678).
  • Closing keywords: a whole-body scan has one hit, Fixes #34466 on line 4, which is right for this card.
  • Head: did not move, so the gate and battery readings in 6938073678 stand: 53 check-runs, 38 success, 15 skipped, 0 failed; dogfood battery pinned to this head (report 6938005588 on objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466).

Owed after this

  • L2: owed, CONTRACT_REVIEW_TIER (declared narrowing). The area reports it sent to the review seat; no record at this head yet.
  • Landing tier: narrowing, handed to the seat for Tier H. This corrects the landing line in 6938073678: from the seat's rule of 2026-11-17 04:14Z, a declared narrowing goes to Tier H even without governed or packages/spec/src paths. check-governed-merges.mjs --pr 34612 still reads 0 of 7 paths governed, +227 / −17. With L1 ACCEPT and an L2 PASS on the same head, the area hands the PR, the full SHA and both ids to the seat. The seat's final pass should also correct the 维护者速读 line 「需要你做的:无,席位落地」, since this now waits on a human approval.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3b8da3efcece663102807c87c3fc38c876e236f1
Local-runs: none
Scope: packages/objectql/src/engine-insert.ts, packages/objectql/src/engine-validate.ts, packages/objectql/src/summary-batch-accumulation.ts, packages/objectql/src/summary-batch-accumulation.test.ts, packages/objectql/src/summary-rollup.test.ts + read in the cited code, not reviewed: packages/objectql/src/master-detail.ts (resolveMasterDetailRelation), packages/objectql/src/engine-references-and-master-detail.ts (resolveMasterDetailParents, materializeParentHeader), packages/objectql/src/engine-master-detail-related.ts (resolvePreviewParents, resolvePredicateRelated), packages/objectql/src/engine-top-level.ts (masterIdOf), packages/objectql/src/engine-summaries-and-expansion.ts (descriptor construction), packages/objectql/src/summary-rule-reads.ts, packages/spec/src/data/field.zod.ts and content/docs/data-modeling/fields.mdx on main. Prose faces not reviewed: content/docs/data-modeling/fields.mdx, .changeset/34466-batch-insert-parent-summary-predicate.md (read for ② only).

Inputs read: card #34466 body and all 5 comments; PR #34612 body, 7-file list, 3 comments and the net diff against merge-base 8dd8192c; ruling record 6928862195 on #33795 in full; #25579 body and all 4 comments (ruling 6377847361 letter C as restated there, dev report 6442152067); the 53 check-runs on this head.

① Derived judgments

  • Accept-set, the narrowing (right, and it is the only one). Subject: a detail object with exactly one master_detail relation, a field-level requiredWhen that reads parent.SUMMARY, where SUMMARY is a roll-up of the header over that detail object with function count, or sum / min / max over number values, and a filter that names no dotted path. Writes: insert(object, rows[]) and insertMany with more than one row (so the generic batch create and the import's batched creates). Before: every row of the batch judged the header as read once before the batch, so a later row was admitted without the field the predicate requires. Now: each row judges the stored summary moved by the earlier rows of the same batch that passed the whole admit step, so the row one-by-one inserts refuse is refused: insert(array) rejects the whole batch with VALIDATION_FAILED (field, required), insertMany answers that row ok: false and writes the others. The opposite direction also exists and is right for the same reason: a predicate that turns false as the summary grows (for example required only while the header has no line) now stops requiring the field on later rows, as one by one does. That is a widening of what one batch admits; it follows from the same rule and needs no second declaration, but the changeset names only the refusing direction (nit N4).
  • Accept-set, the preview (right). validate with mode: 'insert' and more than one row answers the same per-row verdicts as the write, for the same subject. Not moved in update mode: the accumulator is created for mode === 'insert' only.
  • Not moved, checked in the code and each right: a single-row insert (no accumulator under rows.length of 1); an update; a parent. predicate reading a header field that is no summary (the patch touches only desc.summaryField); an unbound header (null / undefined returned as is, so the fail-closed signal of an unreadable or missing header survives); an object with two masters (resolveMasterDetailRelation answers null, no header is bound at all, as before); avg, a non-number value, a dotted-path filter (dropped by the accumulator, the stored value stands); a header of another id or another object.
  • Refactor, overlay() (right). Its per-row body moved to patchRow unchanged: same descriptor filter (dropped, parentObject), same key test (summaryField in row), same moved arithmetic, same copy-on-write. The reference arm of Declarative "at most one row per parent where X" (conditional unique) — summary-based guards miss rows in the same bulk insert #25579 does not move. Its 11 existing unit pins and the Declarative "at most one row per parent where X" (conditional unique) — summary-based guards miss rows in the same bulk insert #25579 engine pins are in the green Test Core shards.
  • Public surface: BatchSummaryAccumulator gains overlayRow. The module is engine-internal (imported by engine-insert.ts and engine-validate.ts only); no export of @objectstack/objectql, no schema, no contract member, no error code changes shape. The refusal is the existing ValidationError envelope.
  • Order and authority (right, nothing skipped or reordered). The diff adds no await and no read. The header is still read by resolveMasterDetailParents: the caller's read door first, then the tenant-kept elevated read for the headers that door returned. insertParentOf only wraps the per-row lookup in a synchronous copy. The reference check still runs before the rules for a non-system write and after them for a system write, and accept still runs after both, so a row refused for a reference the caller cannot read, for its shape, for its currency code, or by a rule is never counted. The value added to the header is derived from the caller's own batch rows alone; no stored value reaches a caller that did not already feed this predicate.

② Semver level

  • patch on @objectstack/objectql is the right level: Metadata-protocol: none is right (no key, accepted value or requirement on what a metadata author can write changes; what moves is a runtime verdict on data rows), and AGENTS.md ships a non-protocol breaking change as patch with its BREAKING banner. Same level and shape as the precedent PR fix(objectql)!: a child rule reading a parent summary counts the earlier admitted rows of the same bulk create #26680.
  • The changeset carries both declaration lines, the BREAKING banner, FROM and TO, the one-line fix for a caller, and one ADR-0087 marker (not-required (no-migration-prescription)), which fits: no stored row or authored value is rewritten. Check Changeset and Governed Surface Queue Guard conclude success on this head.
  • Clause-②: no (narrowing). Agreed: nothing published widens in shape, and a batch admitted before can now be refused. The PR body and the changeset carry the same line.

③ Boundary flags

④ Design judgment

The narrowing makes the published rule real; it takes no declared capability away. The spec on main declares the header as parent for a field-level predicate (field.zod.ts), and the published docs on main state "A bulk create equals one-by-one creates" under ruling 6377847361, which ruling record 6928862195 restates and lists this exact case as the open gap ("A multi-row insert does not accumulate for a field-level parent. predicate that reads a parent summary"). No published line promises that a batch reads the pre-batch header for a rule; the one such promise on main is for hooks and flow steps, which this diff leaves alone. summary-rule-reads.ts class (ii) already names the field such a predicate reads, so the card's first Done-when arm applies and the docs-limit arm is correctly not taken.

Attempts to break it, each read in the code at this head:

  • Mixed parents in one batch: deltas are keyed per descriptor and per parent id, and the header lookup is per row; masterIdOf and singleId reduce a string or number key to the same string. Holds; pinned (two headers, two lines each).
  • A row refused mid-batch: a row culled before the loop is skipped, and a row that throws anywhere in the admit step never reaches accept. Holds; pinned (second row refused, third reads one earlier line).
  • Filtered summary: the filter is judged on the new row by the aggregation's own walker before the row is counted, unchanged code shared with the reference arm. Holds.
  • A row whose header the caller cannot read: the header binds null, overlayRow returns it as is, and the reference check refuses the row before it can be counted. Holds.
  • A rule that reads the same summary through the reference and a requiredWhen that reads it on parent: both arms read one accumulator, so they agree within a row. Holds.
  • Deferred recompute scope around an insert: class (ii) keeps a summary this predicate reads out of the deferral, so the stored base is current between calls. Holds.
  • Nested summaries and derived header fields: see N1.
  • A row admitted and then lost: see N2.
  • The preview on a withheld column: see N3.

Tests against the card: the Done-when asks for a pinned case plus a CONTROL reading a non-summary header field. The engine pins use three rows where the third is the first one refused, on the real engine and recompute, with the one-by-one reference answer beside them, the atomic and per-row doors, the preview, the per-header split and the parent.status CONTROL; the unit pins cover the copy and the four leave-as-is cases. The ablation the dev reports (four red, the rest green) is the lane's account; the pins as written would behave so.

Findings:

  • N1 (nit) — follow-up card, no change on this head. The overlay moves the summary field only. A header field derived from it (a formula, or a stored expression field such as "is full when line_count is at least 2") still reads its pre-batch value inside one batch, where one by one it is re-derived after each recompute; the same holds for a summary of a summary one level up. The docs and changeset claim only the direct parent.SUMMARY read, so nothing published is false, and the card's scope is that read. The bulk-update arm already closes this by its read closure; the bulk-create arm (reference and parent alike) does not, and no card carries it.
  • N2 (nit) — accepted deviation, inherited from Declarative "at most one row per parent where X" (conditional unique) — summary-based guards miss rows in the same bulk insert #25579. accept runs when the rules admit a row. Under insertMany a row that is then lost to a later step of the same write (an autonumber issue failure) stays counted for later rows, so a later row can be refused where one by one would admit it. Declarative "at most one row per parent where X" (conditional unique) — summary-based guards miss rows in the same bulk insert #25579's report 6442152067 noted the same for the reference arm, "not filed"; the published sentence says "rows the rules admitted", which the code matches. A driver write failure rejects the whole batch, so it leaves no survivor to misjudge.
  • N3 (nit) — accepted deviation or one prose sentence. In the preview a header column the read door withheld from the caller reads null, and moved treats null as the empty set, so later rows of the preview read the batch's own count (0 plus the batch) where the write reads stored plus the batch. No stored value flows to the caller, and it agrees with the preview's standing rule that a withheld column is judged as empty; the preview and the write already differed on such a column before this diff.
  • N4 (nit) — prose face only. The changeset's BREAKING block describes the refusing direction; a predicate that relaxes as the summary grows now admits later rows it used to refuse in one batch. One sentence in the changeset would name it.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-tbysd1
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Seat record · 2026-11-17T04:20Z · Head-sha: 3b8da3e

维护者速读

席位意见:同意合并。这是 #25579 裁决「批量等于逐条」的同族新支,按继承元规则不另开决策卡;收窄方向就是把逐条插入会拒的行在批量里也拒掉,实测拉动为 0(无应用写此类条件),失败方向是响亮拒绝而不是静默放过。

席位核对

  1. 形态:7 个文件,+227/−17,Fixes #34466;Clause-②: no (narrowing),Metadata-protocol: none,Skills-docs: none(skills/** 只教 parent.status 这类谓词,不讲批量插入如何读父汇总)。收窄按席位 04:14Z 规则交人(Tier H)。
  2. 前提实测:卡线程在本 head 上跑了修复前后对照:objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads #34466 一组 7 条,去掉修复后 3 条变红。
  3. 门禁 check-runs:head 3b8da3ef 上 57 条,40 绿、17 跳、0 红。dogfood 分片按 PR 事件跳过;全电池在本 head 本地锁下跑过:478 过/3 跳,4054 过/68 跳,VERDICT 0(dev 终报 6938005588)。席位按 feat(metadata-protocol, spec, lint)!: a post-publish probe finding carries the sentence for the person who published, in their language #34513 先例认可本地全电池满足收窄欠的全电池。
  4. 接受的偏差:无。L1-b2 ACCEPT 6938105855;契约复审 PASS 6938149533,无 must-fix/should-fix。
  5. 范围外去向:复审 N1(由汇总派生的父字段、汇总的汇总在同批内仍读批前值)另立跟进卡,交分诊定级;N4(changeset 补一句放宽方向)是散文,不挡本 PR。
  6. 落地条款:授权批准在案后,席位翻 ready,经合并队列落地;Fixes #34466 合并即关卡。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 17, 2026 04:28
@os-zhuang
os-zhuang enabled auto-merge November 17, 2026 04:29
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit b91cefa Nov 17, 2026
63 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-tbysd1 branch November 17, 2026 05:22
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
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

Development

Successfully merging this pull request may close these issues.

objectql: a multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads

3 participants