Skip to content

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

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H

Filing gate: ① prior dev report. Found in #25579's dev report 6442152067 and restated by the #33795 decision thread (ruling record 6928862195). ⛔ Not a claim. Not re-measured today.

维护者速读

Where

Done when

Dedupe words: createMany parent predicate summary, multi-row insert parent roll-up accumulate, field-level parent predicate batch.

Activity

  1. added
    priority:p2
    pm:queue
    domain:server
    on Nov 16, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → p2 (confirmed) · theme: performance and security (roll-up correctness) · 2026-11-17T00:33Z

    ⛔ Not a claim.

    A multi-row insert does not accumulate earlier rows into a parent summary that a field-level parent. predicate reads. This is the sibling of #34465 from the same #33795 thread: p2, confirmed.

  3. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmSLi1reMd27fT62jJ3

    Claim · #34466 · 2026-11-17T01:51Z

    Claim: PM loop, area o2-E of seat repo:objectstack#2 (seat post #34478). A large card: the fix can refuse a later row of a multi-row insert that is admitted today, a narrowing of #25579's batch arm (PR #26680 declared that arm narrowing), so it owes the full dogfood battery (rule card #34424). Built in one card thread the seat opens for this card and its sibling #34465, serially, this card first; the area holds the lease, sends L1 and L2, and lands
    Session: session_01ADHkmSLi1reMd27fT62jJ3
    Thread session: the card thread the seat opens (named in a follow-up line on this card)
    Account: os-steve
    Branch: the card thread's branch (named in the follow-up line)
    Worktree: objectstack (the card thread's own container)
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/objectql/src/engine-insert.ts (the multi-row validation arm around resolvePredicateRelated, ~1300-1360), packages/objectql/src/summary-batch-accumulation.ts and packages/objectql/src/engine-master-detail-related.ts (feeding accumulated summaries into the parent a field-level parent. predicate reads), their tests, the validation-rules page under content/docs/** for the limit if the predicate analysis cannot name the field it reads, one changeset (stop on breach; explain in the report)
    Container & model: L, mode:thread, model: default, effort: high. Narrowing: the PR declares it and carries the full dogfood battery pinned to its head
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack platform: packages/objectql/src/engine-insert.ts, the multi-row insert resolves each row's parent as it was before the batch, so a field-level parent.<summary> predicate never sees the earlier rows of the same batch | none | any app with a field-level parent.<summary> predicate and a multi-row insert under one parent (none found in hotcrm or the objectstack examples)
    Pre-claim lane: repo:objectstack area o2-E — the fix lands in packages/objectql (domain:server)
    Pre-claim deps: #34439 merged 2026-11-17T01:19Z (a2bb7d5), the order the seat set for this pair; triage first touch on both cards (6933862587, 6933871177). In-flight surface: PR #34503 (#34412, this area, landing after its battery) edits engine-insert.ts and engine-update.ts; the card thread starts from main after #34503 merges, or checks its hunks with git merge-tree before the PR. No other open PR touches these files (64 open PRs read in this act)
    Prior rulings read: objectql,multi-row,insert,accumulate,earlier,rows,parent,summary,field-level,predicate,reads → 206 hits; ADR-0144 D6, ADR-0035 Decision §5, ADR-0061 D2, ADR-0139 D4, ADR-0146 D11; thread: none; the #25579 ruling (batch equals one by one) and the #33795 ruling record 6928862195 (B: 「被规则读到的合计不延后」)
    Ruling-ref: 6928862195
    Thread-read: 6933871177
    Premise: holds (read on origin/main 1e4656d: engine-insert.ts ~1308 resolves resolvePredicateRelated once for rows before the batch accumulator runs)
    Serial constraints cleared: #34465 (same card thread, after this card); #34503 (this area, same files, lands first)

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  5. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmPgdzD1Rp6LuxSPNpk

    Claim follow-up · #34466 · 2026-11-17T01:57Z

    The card thread the area opened for #34466 and #34465 (serially, #34466 first) reported in; the area's claim 6935415757 stands, and these two lines complete it.
    Thread session: session_01ADHkmPgdzD1Rp6LuxSPNpk
    Branch: claude/project-thread-tbysd1

  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmPgdzD1Rp6LuxSPNpk

    Claim follow-up · #34466 · 2026-11-17T02:04Z

    File surface (added): packages/objectql/src/engine-validate.ts — the multi-row insert preview's parent binding, changed with the write the same way, because #25579 changed the preview and the write together (the area checked the open PRs: none touches this file). Also content/docs/data-modeling/fields.mdx, one sentence in the bulk-create paragraph #25579 wrote, naming the field-level parent. case.

  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmPgdzD1Rp6LuxSPNpk
    os-dev-report

    {
      "issue": 34466,
      "status": "done",
      "branch": "claude/project-thread-tbysd1",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34612",
      "session": "session_01ADHkmPgdzD1Rp6LuxSPNpk",
      "premise_still_valid": true,
      "summary": "A multi-row insert now overlays the batch's earlier admitted rows on the master-detail header a field-level parent. predicate (requiredWhen) reads, as #25579 already did for the related binding a rule reads through a reference. New BatchSummaryAccumulator.overlayRow(object, row) in summary-batch-accumulation.ts (overlay() shares its per-row body); engine-insert.ts binds parent through insertParentOf; engine-validate.ts does the same for the multi-row insert preview (file surface added by the area, comment 6935662127). The Done-when fork: summary-rule-reads.ts (class ii, #34439) names the field read, so the insert is made equal to one-by-one; no docs limit. Narrowing: a batch that one-by-one would refuse a row of is now refused there too; patch changeset with Clause-② no (narrowing), Metadata-protocol none, FROM/TO, ADR-0087 not-required.",
      "tests": "Final head 3b8da3ef (origin/main merged): pnpm --filter @objectstack/objectql test → Test Files 605 passed (605), Tests 13569 passed (13569). At 978472fc: same counts; objectql typecheck exit 0; pin files summary-rollup.test.ts + summary-batch-accumulation.test.ts 86/86. Ablation (scripts/ablation-replace.mjs, source imports so no rebuild): overlayRow return replaced by `return row;`, anchor x1→x0, blob 6d5e97b4ab77→e61da8f1f2ce → Tests 4 failed | 82 passed (86): insert(array), insertMany, preview, overlayRow unit pin red; one-by-one, refused-row, two-headers, CONTROL parent.status and the leaves-as-it-was pin green, as predicted. Restore blob == HEAD 6d5e97b4ab77, git diff HEAD empty.",
      "gates": "Local, final head 3b8da3ef: dispatch-gates --commands 97 families, each run with exit recorded; check:type-check-debt first exited 3 (queued behind the battery on the lock) and was re-run: exit 0. --ran: 97 run, 0 NOT-MEASURED. File: objectstack-seat2/34466-gates-ran.txt. CI on 3b8da3ef: 53 check-runs, 38 success, 15 skipped, 0 failed (Lint & Repo Gates, Build Core, Test Core 1-8/8, Dogfood Regression Gate, Live E2E UI, Test UI, Build Docs success).",
      "dogfood_battery": "3b8da3efc · os-verify-lock VERDICT command-exit 0 (2333s) · Test Files 478 passed | 3 skipped (481) · Tests 4054 passed | 68 skipped (4122) · no failures. Same reading at 978472fc before the main merge.",
      "mcp_calls": "6 — mcp__github__issue_read x4 (34466 get, 34466 get_comments, 34465 get, 34465 get_comments), mcp__github__pull_request_read x2 (34503 get, 34612 get_check_runs). No write tool.",
      "api_writes": "5 relay strokes — post-stamped claim follow-ups on #34466 (6935526150) and #34465 (6935534469), the file-surface line on #34466 (6935662127), fleet-write pr_create #34612 (draft + assignee os-steve, read-back 8919 bytes identical, run 44008361538), and this os-dev-report comment. Plus 2 git pushes (not REST).",
      "files_changed": [
        ".changeset/34466-batch-insert-parent-summary-predicate.md",
        "content/docs/data-modeling/fields.mdx",
        "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"
      ],
      "line_budget": "n/a — no skills/** or governed surface touched",
      "deviations": [
        "engine-validate.ts and one sentence of content/docs/data-modeling/fields.mdx are outside the original claim surface; both added by the area (comment 6935662127)",
        "PR body readings name 978472fc for local runs; final-head readings are in this report",
        "The session's requested review call on the PR (a GitHub MCP write) was not made: the standard order forbids MCP writes; the assignee was set by pr_create"
      ],
      "open_questions": [
        {
          "question": "Contract-tier L2 review needed (declared narrowing): head 3b8da3efcece663102807c87c3fc38c876e236f1",
          "options": [
            "route to the L2 review seat"
          ],
          "recommendation": "route to the L2 review seat on this account"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #34465 · noted, not filed: the predicate update (multi: true) has the same pre-batch header and related binding; next in this card thread"
      ]
    }

    Stamped 2026-11-17T04:09Z.

  8. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions