You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: cascade delete runs one id read + one set-based DELETE/UPDATE per relation instead of a full engine write per dependent (epic #33631 R7) #33699
Filing gate: ④ child of epic #33631 (SQL performance). Item R7 of the M0 ranked list (#33633): #33631 (comment) (corrected 6889939163). Maintainer's pick (seat decision card, 2026-11-15T06:44Z): 「R1 R7 R12 各一张+测量卡」.
Today
Cascade delete is one full engine delete/update per dependent (engine-cascade-planning.ts ~1085–1171), each with its hooks, recycle-bin capture and probes: 155 statements to delete one opportunity with 10 line items (~15 per child), p50 121–237 ms, linear in children.
Target
Per relation: one id read + one DELETE … WHERE fk = ? (or UPDATE … SET fk = NULL) + one batched recycle-bin capture, when the child has no per-row hooks. Children with per-row hooks keep today's path. Not yet measured as SQL: the batched capture shape comes first.
Business reason
Deleting a parent with many children (an order with hundreds of lines) is linear in statements and slow today.
Reader
domain:server#5 area A4 (engine) with A3 (trash / recycle bin); next account; size M–L.
Claim: PM loop round 1 (area S2, #33751 §2)
Session: session_01QsR2jRmmALkM1ftZxdVatQ
Account: zhuangjianguo
Branch: claude/area-A4-33699
Worktree: /home/claude/wt/area-A4-33699
Domain: domain:server
Seat: domain:server#5
File surface: packages/objectql/src/engine-cascade-planning.ts · packages/objectql/src/recycle-bin/** · packages/drivers/driver-sql/src/** (set-based delete/update only if a driver face is needed) · tests beside them (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier at bd96ec9: no path-derived mandate), effort: high (M, epic #33631 child)
Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: none
Premise: holds (M0 bench, merged PR #33662; ranked list 6889544281, corrected 6889939163; no commit on the seam since)
Serial constraints cleared: #33652 (os-elon-musk, engine-find.ts / engine-query-lowering.ts / relation-*.ts) and #33570 (seed-loader.ts) — not touched by this card
{
"issue": 33699,
"status": "needs_decision",
"branch": "claude/area-A4-33699",
"pr": null,
"session": "session_01QsR2jRmmALkM1ftZxdVatQ",
"premise_still_valid": false,
"summary": "Measured, did not build (dispatch: stop when the census needs a ruling). Two premises of the card do not hold on origin/main d7e1a5aa. (1) The fast path's gate, 'the child has no per-row hooks', is false for every object on any kernel that loads the stock plugins: plugin-audit writeAudit (afterDelete, every object minus AUDIT_EXCLUDED_OBJECTS, audit-writers.ts:2533), plugin-sharing record-share-cascade (before+afterDelete, object-less, record-share-cascade.ts:327/338), service-storage file-reference-lifecycle (before+afterDelete, object-less, file-reference-lifecycle.ts:1291/1310), plugin-auth identity-write-guard (beforeDelete, object-less, identity-write-guard.ts:274), plugin-approvals (afterDelete, object-less, lifecycle-hooks.ts:713). The bench's own server shows it: every cascaded line item writes sys_audit_log + sys_activity and runs 4 sharing-cleanup statements. So the card's target would leave the bench at 155 -> 155 and fire only on a bare embedder. (2) 'The batched capture shape comes first' is already done: the recycle bin takes ONE snapshot read `select * from bench_line_item where id in (?, x10)` and ONE `insert into sys_recycle_bin` per root (recycle-bin/capture.ts:202-258, ADR-0148 D1); restore already restores that one entry. H4/H5 confirmed as today's behaviour (children deleted inside the parent's BEGIN..COMMIT; grandchildren via each child's joined walk). The real per-child cost is 13 statements: 5 caller-authorization reads (plugin-security CBP write gate + sharing canDelete: child row, opportunity x2, account x2 - the same parent rows re-read for every child), 1 engine pre-image, 1 DELETE, 2 audit inserts, 4 sharing statements. Every route that moves the bench number changes an observable per-row behaviour or the security gate shape, so it needs a ruling: options in open_questions.",
"tests": "No code changed, no tests owed. Bench readings (merged M0 bench packages/qa/dogfood/bench/sql-perf/bench.mjs, run by me, --only cascade_delete_opportunity --scale 100000, 9 deletes, engine tree d7e1a5aa stamped in the result files, shared 4-core box): SQLite p50 142.4 ms / p95 211.5 ms / server p50 139 ms, statements 166 (cold first) then 155 x8; PostgreSQL 16 (private cluster, port 54399, fsync=off, stopped and removed) p50 178.2 ms / p95 282.5 ms / server p50 175.8 ms, statements 166 then 155 x8. Statement-by-statement capture: X-OS-Debug-Timing json caps the list at 20 (DETAIL_MAX_QUERIES, hono-plugin.ts:196), so the full list was taken from the driver's own log (DEBUG=knex:query) on SQLite, warm delete: identity 8 | parent authorization 5 | BEGIN | collect probe `select * from bench_line_item where opportunity = ?`, root snapshot `select * from bench_opportunity where id = ?`, child snapshot `select * from bench_line_item where id in (10)`, walk re-probe `select * from bench_line_item where opportunity = ?` (4) | 10 x 13 per child (`select * from bench_line_item where id = ? limit ?`, `select id, owner_id, queue, organization_id from bench_opportunity where id = ?`, `select * from bench_opportunity where id = ? limit ?`, `select id, owner_id, queue, organization_id from bench_account where id = ?`, `select id, owner_id from bench_account where id = ?`, `select * from bench_line_item where id = ? limit ?`, `delete from bench_line_item where id = ?`, insert sys_audit_log, insert sys_activity, select+delete sys_record_share, select+delete sys_share_link) | insert sys_recycle_bin | `delete from bench_opportunity where id = ?` | COMMIT | parent afterDelete outside the unit: audit, activity, 4 sharing = 6. 8+5+4+130+1+1+6 = 155. Ablations: none (no tested behaviour changed).",
"gates": "No diff: dispatch-gates --commands not run (it derives from the change set, which is empty: the branch equals origin/main d7e1a5aa). Local commands run: build of the CLI closure `pnpm --workspace-concurrency=2 --filter '@objectstack/cli...' build` under os-verify-lock, VERDICT command-exit 0; bench SQLite VERDICT command-exit 0 (twice: one plain, one with knex query logging); bench PG VERDICT command-exit 0. No PR, so no check-runs to cite.",
"dogfood_battery": "n/a - no PR, no `!` title, no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "1 - POST issues/33699/comments (this report, via scripts/pm/post-stamped.mjs). Plus one git push of the empty claim branch claude/area-A4-33699 (not a REST write).",
"files_changed": [],
"line_budget": "n/a - no diff",
"deviations": [
"No PR, no changeset: stopped after measuring as the dispatch orders when the census needs a ruling.",
"PostgreSQL cluster data dir lived in /tmp/os-pg-33699, not the scratchpad: the postgres user cannot traverse the scratchpad's parent; stopped and removed after the run.",
"The bench was run from a temporary copy (zz-scratch-bench.mjs, deleted, never committed) that adds X-OS-Debug-Timing to the first cascade delete; the timing path is unchanged.",
"The claim branch claude/area-A4-33699 is pushed empty (equals origin/main d7e1a5aa) and left for the area to reuse or delete."
],
"open_questions": [
{
"question": "Which shape should R7 take, given that the card's 'no per-row hooks' gate never opens on a stock kernel and the recycle-bin capture is already one read + one insert per root?",
"options": [
"A - Build the card as written: a set-based `DELETE ... WHERE fk = ?` / `UPDATE ... SET fk = NULL` only when the child has no delete-side hook, no roll-up, no secret column. Real business need: none measured - the bench stays 155 -> 155, and it fires only on a kernel with none of plugin-audit / plugin-sharing / service-storage / plugin-auth / plugin-approvals. Long-term: a second delete path whose use flips silently when a plugin loads, kept in parity with the first forever. AI-error: an author cannot see from metadata which path runs. Startup focus: new surface with zero pull. Effort M.",
"B - Route each cascading relation through the predicate-delete arm that already exists (#26871/#27004): one scoped id read, per-row before/after hook dispatch from those rows (audit, sharing, storage keep running), one `DELETE ... WHERE id IN (...)` per 500 ids, recycle bin unchanged. Needs four rulings: realtime (today one `data.record.deleted` per child; the arm publishes one `data.records.deleted` per write - keep per-row events or accept the bulk event), security parity (today each child runs the caller's by-id CBP write gate + sharing canDelete and any refusal rolls the whole cascade back; the arm composes a row scope and would skip an out-of-scope child silently - must refuse when scoped matches differ from probed children, A2 review), the D6 bulk per-row hook ceiling (would newly refuse a big cascade), and hook dispatch.mode 'record' -> 'per-row' plus the referentialCascadeDelete marker on each per-row context. Real need: the card's order-with-hundreds-of-lines case; estimate (not measured) ~50 statements instead of 155 on the bench, per-child cost 13 -> ~2. Long-term: the SQL-first set shape, reusing a proven arm, no new surface. AI-error: one delete arm for every multi-row delete instead of two. Startup focus: no new capability, no gate. Effort L; touches engine-delete-and-aggregate.ts (outside this claim) and plugin-security parity tests.",
"C - Keep every per-row behaviour, remove only the repeated reads: (c1, engine, this surface) the collect probe, the walk re-probe and the recycle-bin snapshot read the same child rows three times per relation -> one read, 155 -> 153; (c2, A2 security) memoise the controlled-by-parent authorization reads within one cascade (the same opportunity and account rows are re-read for every child) and share the child pre-image between plugin-security and the engine, estimate 155 -> ~105. Real need: same case, smaller gain, still linear at 8 per child. Long-term: a per-transaction authorization memo needs an invalidation rule (a hook may write the master mid-cascade). AI-error: no author-visible change. Startup focus: no new surface. Effort S (c1) + M (c2).",
"D - Close R7 as measured: record the census and the per-child breakdown on the epic, file nothing. Real need is then unserved for large orders; nothing to maintain."
],
"recommendation": "B, with c1 folded in, split into an engine card (A4) and a security-parity card (A2) once the maintainer rules the four points. Long-term axis first: B is the set-based shape the epic asks for and it reuses the predicate arm instead of adding a hook-gated second path (A), so it serves a stock kernel where A never fires; C is the fallback if the realtime or security-parity rulings go against B, and c1 alone is not worth a PR (2 of 155 statements)."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none - noted, not filed: X-OS-Debug-Timing json lists at most 20 statements (DETAIL_MAX_QUERIES = 20, plugin-hono-server hono-plugin.ts:196), so a 155-statement write cannot be captured through the documented door; the bench README's SQL-text path names admin scenarios only. Observation, no defect class.",
"carrier: none - noted, not filed: the parent's afterDelete chain (audit, activity, sharing cleanup) runs after COMMIT, outside the unit, while each cascaded child's runs inside it. Observation of today's behaviour, no repro of a wrong answer."
]
}
Release: claim 6892276015 (session session_01QsR2jRmmALkM1ftZxdVatQ, branch claude/area-A4-33699) is withdrawn pending this decision. Nothing landed: the branch is empty at origin/main d7e1a5a, no PR.
Governing text: epic #33631 ranked list 6889544281 row R7 (corrected 6889939163); maintainer pick 「R1 R7 R12 各一张+测量卡」.
Evidence: os-dev-report 6892420600 (bench run on SQLite + PostgreSQL at d7e1a5a, statement-by-statement log).
PR #33887 (Part of #33699) merged on 2026-11-16 at 07:26Z.
Item
State
Cascaded child deletes in batches: collected members only, read-door question first, five by-id fallbacks
Landed in #33887. L2 PASS 6908865874, L1 PASS 6909011347
Ruling 6893104201 c1: the walk's collect probe, re-probe and recycle-bin snapshot read the same child rows
Open. It is behaviour-neutral and stays on this card
L2 N1 (dispatch.mode TSDoc lists four of the five by-id cases), N2 (the S2 pin has no by-id leg)
Accepted nits, recorded in the PR body
The card goes back to pm:queue for c1. Under the maintainer's 06:57Z rule (new claims p0/p1 only), this p2 waits until the rule lifts or c1 is shown to block a p1.
Claim: area o2-F round 1 (repo:objectstack#2 area lease; item c1 of ruling 6893104201, left open by 6910204907)
Session: session_01ADHkmQAXHSQEgnYyx9tstb
Account: os-steve
Branch: claude/project-thread-wlvkf3
Worktree: /home/user/objectstack-issue-33699
Domain: domain:server
Seat: repo:objectstack#2
File surface: packages/objectql/src/engine-cascade-planning.ts · packages/objectql/src/engine-delete-cascade.ts (collectCascadeDeleteSet) · packages/objectql/src/recycle-bin/capture.ts · packages/objectql/src/engine-delete-and-aggregate.ts (only the lines that hand the collected rows to the capture) · tests beside them · .changeset/ — engine.ts and engine-summaries-and-expansion.ts are NOT in the surface (open PR #34439 holds them); a need to touch either is a stop (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier at e8cba8f: no path-derived mandate), effort: high (M engine change, behaviour-neutral)
Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6910204907
Premise: holds — c1 (the walk's collect probe, re-probe and recycle-bin snapshot read the same child rows; 155 → 153 per ruling 6893104201 estimate) is open per 6910204907; the dev re-measures on the M0 bench before building and reports premise_still_valid: false if the three reads are no longer identical at origin/main
Serial constraints cleared: #34439 (#33795, seat 1, engine.ts + engine-summaries-and-expansion.ts + metadata-protocol batch) — no shared file; #34373 (engine predicate delete) is unclaimed and held by the seat behind #34405; o2-E area (#34465/#34466 summary recompute) — engine-summaries files, no shared file; no other open PR touches packages/objectql (47 open PRs read 2026-11-16T22:12Z)
Pre-claim lane: domain:server — packages/objectql/** (engine); repo:objectstack#2 area o2-F
Pre-claim deps: no Blocked-by:; #33887 (the batch this optimises) MERGED 2026-11-16T07:26Z; hot files engine-cascade-planning.ts / recycle-bin/capture.ts idle (no open PR touches them)
Prior rulings read: ruling 6893104201 (B + c1; c1 behaviour-neutral) and 6893661036 (F1; point 4 replaced); ADR-0148 D1 (one snapshot read + one recycle-bin insert per root) kept; check-prior-rulings --card 33699 → 314 hits, ADR-0029 D9.7, ADR-0035 §5, ADR-0055 §3, ADR-0092 D2, ADR-0103 D2/D3, ADR-0119 D1 named, none answers c1's question; thread: 6893104201, 6893661036, 6910204907
Claim surface amendment (claim 6930974430, same branch claude/project-thread-wlvkf3): File surface adds packages/services/service-automation/src/builtin/delete-record-predicate-walk-batched.integration.test.ts — a forced expectation change only: the pin counted the duplicate master_detail read that c1 removes (6 → 3 for a 3-batch multi delete). PR #34507 head 0f8d050e075d93896acea7039db972f7647f591a. No open PR holds that file.
Activity
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
Claim: PM loop round 1 (area S2, #33751 §2)
Session:
session_01QsR2jRmmALkM1ftZxdVatQAccount:
zhuangjianguoBranch:
claude/area-A4-33699Worktree:
/home/claude/wt/area-A4-33699Domain:
domain:serverSeat:
domain:server#5File surface:
packages/objectql/src/engine-cascade-planning.ts · packages/objectql/src/recycle-bin/** · packages/drivers/driver-sql/src/** (set-based delete/update only if a driver face is needed) · tests beside them(stop on breach; explain in the report)Container & model:
M,mode:subagent,model: TIER_DEFAULT(dispatch-gates --tier at bd96ec9: no path-derived mandate),effort: high(M, epic #33631 child)Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: none
Premise: holds (M0 bench, merged PR #33662; ranked list 6889544281, corrected 6889939163; no commit on the seam since)
Serial constraints cleared: #33652 (os-elon-musk, engine-find.ts / engine-query-lowering.ts / relation-*.ts) and #33570 (seed-loader.ts) — not touched by this card
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
os-dev-report
{ "issue": 33699, "status": "needs_decision", "branch": "claude/area-A4-33699", "pr": null, "session": "session_01QsR2jRmmALkM1ftZxdVatQ", "premise_still_valid": false, "summary": "Measured, did not build (dispatch: stop when the census needs a ruling). Two premises of the card do not hold on origin/main d7e1a5aa. (1) The fast path's gate, 'the child has no per-row hooks', is false for every object on any kernel that loads the stock plugins: plugin-audit writeAudit (afterDelete, every object minus AUDIT_EXCLUDED_OBJECTS, audit-writers.ts:2533), plugin-sharing record-share-cascade (before+afterDelete, object-less, record-share-cascade.ts:327/338), service-storage file-reference-lifecycle (before+afterDelete, object-less, file-reference-lifecycle.ts:1291/1310), plugin-auth identity-write-guard (beforeDelete, object-less, identity-write-guard.ts:274), plugin-approvals (afterDelete, object-less, lifecycle-hooks.ts:713). The bench's own server shows it: every cascaded line item writes sys_audit_log + sys_activity and runs 4 sharing-cleanup statements. So the card's target would leave the bench at 155 -> 155 and fire only on a bare embedder. (2) 'The batched capture shape comes first' is already done: the recycle bin takes ONE snapshot read `select * from bench_line_item where id in (?, x10)` and ONE `insert into sys_recycle_bin` per root (recycle-bin/capture.ts:202-258, ADR-0148 D1); restore already restores that one entry. H4/H5 confirmed as today's behaviour (children deleted inside the parent's BEGIN..COMMIT; grandchildren via each child's joined walk). The real per-child cost is 13 statements: 5 caller-authorization reads (plugin-security CBP write gate + sharing canDelete: child row, opportunity x2, account x2 - the same parent rows re-read for every child), 1 engine pre-image, 1 DELETE, 2 audit inserts, 4 sharing statements. Every route that moves the bench number changes an observable per-row behaviour or the security gate shape, so it needs a ruling: options in open_questions.", "tests": "No code changed, no tests owed. Bench readings (merged M0 bench packages/qa/dogfood/bench/sql-perf/bench.mjs, run by me, --only cascade_delete_opportunity --scale 100000, 9 deletes, engine tree d7e1a5aa stamped in the result files, shared 4-core box): SQLite p50 142.4 ms / p95 211.5 ms / server p50 139 ms, statements 166 (cold first) then 155 x8; PostgreSQL 16 (private cluster, port 54399, fsync=off, stopped and removed) p50 178.2 ms / p95 282.5 ms / server p50 175.8 ms, statements 166 then 155 x8. Statement-by-statement capture: X-OS-Debug-Timing json caps the list at 20 (DETAIL_MAX_QUERIES, hono-plugin.ts:196), so the full list was taken from the driver's own log (DEBUG=knex:query) on SQLite, warm delete: identity 8 | parent authorization 5 | BEGIN | collect probe `select * from bench_line_item where opportunity = ?`, root snapshot `select * from bench_opportunity where id = ?`, child snapshot `select * from bench_line_item where id in (10)`, walk re-probe `select * from bench_line_item where opportunity = ?` (4) | 10 x 13 per child (`select * from bench_line_item where id = ? limit ?`, `select id, owner_id, queue, organization_id from bench_opportunity where id = ?`, `select * from bench_opportunity where id = ? limit ?`, `select id, owner_id, queue, organization_id from bench_account where id = ?`, `select id, owner_id from bench_account where id = ?`, `select * from bench_line_item where id = ? limit ?`, `delete from bench_line_item where id = ?`, insert sys_audit_log, insert sys_activity, select+delete sys_record_share, select+delete sys_share_link) | insert sys_recycle_bin | `delete from bench_opportunity where id = ?` | COMMIT | parent afterDelete outside the unit: audit, activity, 4 sharing = 6. 8+5+4+130+1+1+6 = 155. Ablations: none (no tested behaviour changed).", "gates": "No diff: dispatch-gates --commands not run (it derives from the change set, which is empty: the branch equals origin/main d7e1a5aa). Local commands run: build of the CLI closure `pnpm --workspace-concurrency=2 --filter '@objectstack/cli...' build` under os-verify-lock, VERDICT command-exit 0; bench SQLite VERDICT command-exit 0 (twice: one plain, one with knex query logging); bench PG VERDICT command-exit 0. No PR, so no check-runs to cite.", "dogfood_battery": "n/a - no PR, no `!` title, no (narrowing) arm", "mcp_calls": "0", "api_writes": "1 - POST issues/33699/comments (this report, via scripts/pm/post-stamped.mjs). Plus one git push of the empty claim branch claude/area-A4-33699 (not a REST write).", "files_changed": [], "line_budget": "n/a - no diff", "deviations": [ "No PR, no changeset: stopped after measuring as the dispatch orders when the census needs a ruling.", "PostgreSQL cluster data dir lived in /tmp/os-pg-33699, not the scratchpad: the postgres user cannot traverse the scratchpad's parent; stopped and removed after the run.", "The bench was run from a temporary copy (zz-scratch-bench.mjs, deleted, never committed) that adds X-OS-Debug-Timing to the first cascade delete; the timing path is unchanged.", "The claim branch claude/area-A4-33699 is pushed empty (equals origin/main d7e1a5aa) and left for the area to reuse or delete." ], "open_questions": [ { "question": "Which shape should R7 take, given that the card's 'no per-row hooks' gate never opens on a stock kernel and the recycle-bin capture is already one read + one insert per root?", "options": [ "A - Build the card as written: a set-based `DELETE ... WHERE fk = ?` / `UPDATE ... SET fk = NULL` only when the child has no delete-side hook, no roll-up, no secret column. Real business need: none measured - the bench stays 155 -> 155, and it fires only on a kernel with none of plugin-audit / plugin-sharing / service-storage / plugin-auth / plugin-approvals. Long-term: a second delete path whose use flips silently when a plugin loads, kept in parity with the first forever. AI-error: an author cannot see from metadata which path runs. Startup focus: new surface with zero pull. Effort M.", "B - Route each cascading relation through the predicate-delete arm that already exists (#26871/#27004): one scoped id read, per-row before/after hook dispatch from those rows (audit, sharing, storage keep running), one `DELETE ... WHERE id IN (...)` per 500 ids, recycle bin unchanged. Needs four rulings: realtime (today one `data.record.deleted` per child; the arm publishes one `data.records.deleted` per write - keep per-row events or accept the bulk event), security parity (today each child runs the caller's by-id CBP write gate + sharing canDelete and any refusal rolls the whole cascade back; the arm composes a row scope and would skip an out-of-scope child silently - must refuse when scoped matches differ from probed children, A2 review), the D6 bulk per-row hook ceiling (would newly refuse a big cascade), and hook dispatch.mode 'record' -> 'per-row' plus the referentialCascadeDelete marker on each per-row context. Real need: the card's order-with-hundreds-of-lines case; estimate (not measured) ~50 statements instead of 155 on the bench, per-child cost 13 -> ~2. Long-term: the SQL-first set shape, reusing a proven arm, no new surface. AI-error: one delete arm for every multi-row delete instead of two. Startup focus: no new capability, no gate. Effort L; touches engine-delete-and-aggregate.ts (outside this claim) and plugin-security parity tests.", "C - Keep every per-row behaviour, remove only the repeated reads: (c1, engine, this surface) the collect probe, the walk re-probe and the recycle-bin snapshot read the same child rows three times per relation -> one read, 155 -> 153; (c2, A2 security) memoise the controlled-by-parent authorization reads within one cascade (the same opportunity and account rows are re-read for every child) and share the child pre-image between plugin-security and the engine, estimate 155 -> ~105. Real need: same case, smaller gain, still linear at 8 per child. Long-term: a per-transaction authorization memo needs an invalidation rule (a hook may write the master mid-cascade). AI-error: no author-visible change. Startup focus: no new surface. Effort S (c1) + M (c2).", "D - Close R7 as measured: record the census and the per-child breakdown on the epic, file nothing. Real need is then unserved for large orders; nothing to maintain." ], "recommendation": "B, with c1 folded in, split into an engine card (A4) and a security-parity card (A2) once the maintainer rules the four points. Long-term axis first: B is the set-based shape the epic asks for and it reuses the predicate arm instead of adding a hook-gated second path (A), so it serves a stock kernel where A never fires; C is the fallback if the realtime or security-parity rulings go against B, and c1 alone is not worth a PR (2 of 155 statements)." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none - noted, not filed: X-OS-Debug-Timing json lists at most 20 statements (DETAIL_MAX_QUERIES = 20, plugin-hono-server hono-plugin.ts:196), so a 155-statement write cannot be captured through the documented door; the bench README's SQL-text path names admin scenarios only. Observation, no defect class.", "carrier: none - noted, not filed: the parent's afterDelete chain (audit, activity, sharing cleanup) runs after COMMIT, outside the unit, while each cascaded child's runs inside it. Observation of today's behaviour, no repro of a wrong answer." ] }objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
决策请求 · #33699 级联删除(epic #33631 R7)走哪种形状
Release: claim 6892276015 (session
session_01QsR2jRmmALkM1ftZxdVatQ, branchclaude/area-A4-33699) is withdrawn pending this decision. Nothing landed: the branch is empty at origin/main d7e1a5a, no PR.Governing text: epic #33631 ranked list 6889544281 row R7 (corrected 6889939163); maintainer pick 「R1 R7 R12 各一张+测量卡」.
Evidence: os-dev-report 6892420600 (bench run on SQLite + PostgreSQL at d7e1a5a, statement-by-statement log).
实测结论(卡片前提不成立): 卡片的快路径条件「子对象没有逐行 hook」在标准内核上永远不成立。plugin-audit、plugin-sharing、service-storage、plugin-auth、plugin-approvals 都给每个对象的删除挂了 hook,所以按卡片原样实现,基准仍是 155 → 155 条 SQL。回收站的批量快照也早已实现(每个根一次读 + 一次写,ADR-0148 D1)。真正的成本是每个子记录 13 条 SQL:5 条权限读(每个子记录都把同一批父记录重读一遍)、1 条前像、1 条 DELETE、2 条审计、4 条共享清理。
DELETE … WHERE id IN (…)每 500 条一批os-decision-facets
① 项目长远合理性:B 复用已验证的谓词删除通道,是 epic 要的集合式形状,不新增第二条删除路径;A 新增一条随插件静默切换的路径,长期要双份维护。
② 实际业务拉动:删除带几百行明细的订单今天是线性 SQL;A 在标准内核上零收益,B/C 才真正减少语句。
③ 防 AI 犯错:B 要求被拒的子记录响亮拒绝并回滚整个级联,而非静默跳过;A 让作者从元数据看不出走哪条路径。
④ 创业阶段不扩散:B 不新增能力位、不新增门禁;A 新增永久维护的第二路径。
Prior rulings read:
cascade,referentialCascadeDelete,predicate delete, ADR-0148 in engine-cascade-planning.ts / recycle-bin/capture.ts → in-file rulings kept by every option; ADR-0148 D1; thread: none.推荐 B(并入 c1)。只看①选 B;②③④ 是否翻转:否。若实时事件或安全等价两点裁定不利于 B,退回 C。
置信缺口:B 的约 50 条是估计,未实测;第一张实施卡先测。
裁后执行: 选 B ⇒ 区域按四点裁决拆两张卡(A4 引擎:级联走谓词删除通道 + c1;A2 安全等价:拒绝即回滚的等价钉子),各自走认领与复审。选 C ⇒ c1 + c2 一张 A4 卡、一张 A2 卡。选 D ⇒ 在 #33631 记普查后关闭本卡。
24 remaining items
objectstack-fleet commentedon Nov 16, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh
PR #33887 (
Part of #33699) merged on 2026-11-16 at 07:26Z.dispatch.modeTSDoc lists four of the five by-id cases), N2 (the S2 pin has no by-id leg)The card goes back to
pm:queuefor c1. Under the maintainer's 06:57Z rule (new claims p0/p1 only), this p2 waits until the rule lifts or c1 is shown to block a p1.objectstack-fleet commentedon Nov 16, 2026
repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb
Claim: area o2-F round 1 (repo:objectstack#2 area lease; item c1 of ruling 6893104201, left open by 6910204907)
Session:
session_01ADHkmQAXHSQEgnYyx9tstbAccount:
os-steveBranch:
claude/project-thread-wlvkf3Worktree:
/home/user/objectstack-issue-33699Domain:
domain:serverSeat:
repo:objectstack#2File surface:
packages/objectql/src/engine-cascade-planning.ts · packages/objectql/src/engine-delete-cascade.ts (collectCascadeDeleteSet) · packages/objectql/src/recycle-bin/capture.ts · packages/objectql/src/engine-delete-and-aggregate.ts (only the lines that hand the collected rows to the capture) · tests beside them · .changeset/— engine.ts and engine-summaries-and-expansion.ts are NOT in the surface (open PR #34439 holds them); a need to touch either is a stop (stop on breach; explain in the report)Container & model:
M,mode:subagent,model: TIER_DEFAULT(dispatch-gates --tier at e8cba8f: no path-derived mandate),effort: high(M engine change, behaviour-neutral)Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6910204907
Premise: holds — c1 (the walk's collect probe, re-probe and recycle-bin snapshot read the same child rows; 155 → 153 per ruling 6893104201 estimate) is open per 6910204907; the dev re-measures on the M0 bench before building and reports
premise_still_valid: falseif the three reads are no longer identical at origin/mainSerial constraints cleared: #34439 (#33795, seat 1, engine.ts + engine-summaries-and-expansion.ts + metadata-protocol batch) — no shared file; #34373 (engine predicate delete) is unclaimed and held by the seat behind #34405; o2-E area (#34465/#34466 summary recompute) — engine-summaries files, no shared file; no other open PR touches packages/objectql (47 open PRs read 2026-11-16T22:12Z)
Pre-claim lane:
domain:server— packages/objectql/** (engine); repo:objectstack#2 area o2-FPre-claim deps: no
Blocked-by:; #33887 (the batch this optimises) MERGED 2026-11-16T07:26Z; hot files engine-cascade-planning.ts / recycle-bin/capture.ts idle (no open PR touches them)Prior rulings read: ruling 6893104201 (B + c1; c1 behaviour-neutral) and 6893661036 (F1; point 4 replaced); ADR-0148 D1 (one snapshot read + one recycle-bin insert per root) kept; check-prior-rulings --card 33699 → 314 hits, ADR-0029 D9.7, ADR-0035 §5, ADR-0055 §3, ADR-0092 D2, ADR-0103 D2/D3, ADR-0119 D1 named, none answers c1's question; thread: 6893104201, 6893661036, 6910204907
objectstack-fleet commentedon Nov 16, 2026
repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb
os-dev-report
{ "issue": 33699, "pr": "https://github.com/objectstack-ai/objectstack/pull/34507", "head": "4cc3e8b5c04be092989b0e7607a59d1fdf792c5b", "gates": { "derived": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 4cc3e8b5: 69 families", "ran": [ "node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0", "node scripts/check-adr-0087-registration.mjs --self-test :: exit 0", "node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0", "node scripts/check-closing-keyword-parity.mjs :: exit 0", "node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0", "node scripts/check-comment-mask-adoption.mjs :: exit 0", "node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0", "node scripts/check-comment-mask-corpus.mjs :: exit 0", "node scripts/check-dts-emitted.mjs --self-test :: exit 0", "node scripts/check-empty-changeset.mjs --base origin/main :: exit 0", "node scripts/check-empty-changeset.mjs --self-test :: exit 0", "node scripts/check-engine-split-ratio.mjs --self-test :: exit 0", "node scripts/check-issue-citations.mjs :: exit 0", "node scripts/check-plugin-teardown-shape.mjs :: exit 0", "node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0", "node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0", "node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0", "node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0", "node scripts/ci/snapshot-next.mjs --self-test :: exit 0", "node scripts/docs-audit/check-affected-docs.mjs :: exit 0", "node scripts/docs-audit/check-drift-comment.mjs :: exit 0", "node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0", "node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0", "node scripts/release-pending-publish.mjs --self-test :: exit 0", "pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0", "pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0", "pnpm check:adr-anchors :: exit 0", "pnpm check:adr-symbol-anchors :: exit 0", "pnpm check:changeset-gate-self-tests :: exit 0", "pnpm check:ci-filter-parity :: exit 0", "pnpm check:closed-ceremony-text :: exit 0", "pnpm check:cross-package-test-inputs :: exit 0", "pnpm check:dispatcher-error-vocabulary :: exit 0", "pnpm check:doc-authoring :: exit 0", "pnpm check:driver-memory-census :: exit 0", "pnpm check:durability-log-level :: exit 0", "pnpm check:engine-double-contract :: exit 0", "pnpm check:error-status-conformance :: exit 0", "pnpm check:gitlink-declared :: exit 0", "pnpm check:issue-citations :: exit 0", "pnpm check:keyed-text-bounds :: exit 0", "pnpm check:lean-entry-closure :: exit 0", "pnpm check:logger-receiver-detach :: exit 0", "pnpm check:nul-bytes :: exit 0", "pnpm check:object-def-param-keys :: exit 0", "pnpm check:objectql-double-limit :: exit 0", "pnpm check:optional-error-sink :: exit 0", "pnpm check:org-identifier :: exit 0", "pnpm check:page-declaration-shape :: exit 0", "pnpm check:platform-object-tenancy-census :: exit 0", "pnpm check:published-files :: exit 0", "pnpm check:query-options-erasure :: exit 0", "pnpm check:refd-timer-probe :: exit 0", "pnpm check:registry-log-declared :: exit 0", "pnpm check:rest-log-spy-declared :: exit 0", "pnpm check:settings-bind-window :: exit 0", "pnpm check:sourcemap-no-sources-content :: exit 0", "pnpm check:system-context-census :: exit 0", "pnpm check:test-source-alias :: exit 0", "pnpm check:tier-file-adoption :: exit 0", "pnpm check:undeclared-dep-imports :: exit 0", "pnpm check:vouch-for-reference-callers :: exit 0", "pnpm check:watch-hint-literal :: exit 0", "pnpm check:where-matcher :: exit 0", "pnpm check:slot-lookup :: exit 0", "pnpm check:dts-closure :: exit 1", "pnpm check:dual-build-cjs-loads :: exit 3", "pnpm check:type-check-coverage :: exit 0", "pnpm check:type-check-debt :: exit 0" ], "reconciliation": "dispatch-gates --repo objectstack-ai/objectstack --ran: 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN, exit 0", "not_measured_locally": [ "pnpm check:dual-build-cjs-loads (exit 3 PREREQUISITE NOT MET: packages with no dist/ in this tree)", "pnpm check:dts-closure (exit 1: 50 packages built without declarations in this shared tree; reads build state, not the diff)" ], "notes": [ "check-plugin-teardown-shape --self-test first exit 3 (shallow clone), pinned fixture commit 621a4876 fetched, rerun exit 0", "objectql vitest at 2d58ed7e under the verify lock: 605 files / 13511 tests passed", "objectql typecheck after a declaration build of its dependency closure: VERDICT command-exit 0", "eslint on the 3 touched source files: exit 0" ], "ci": "check-runs in_progress at report time (23 listed at 23:19Z); not waited on" }, "line_budget": "n/a: no ledgered line budget touched (no skills/** or governed file)", "files_changed": [ ".changeset/33699-cascade-probe-read-once.md", "packages/objectql/src/engine-cascade-delete-batch.test.ts", "packages/objectql/src/engine-cascade-planning.ts", "packages/objectql/src/engine-delete-cascade.ts" ], "deviations": [ "Two of the three reads merge (collect probe + walk re-probe), not three: the recycle-bin snapshot is a raw driver read while the probe goes through engine find() (formula values, file references, afterFind hooks), so handing it the probe's rows would change what the entry stores. Bench 58 -> 57, not 153 of 155 / 57 -> 56.", "The objectql pin counts driver reads on the file's fake driver (objectql cannot import driver-sql); the SQL statement counts are from the M0 bench, SQLite and PostgreSQL 16.", "PostgreSQL before leg: base objectql sources built into this tree, so its result file is stamped with the branch commit; dist checked free of the change (ablation-dist-preflight --absent) and rebuilt at HEAD after.", "First objectql typecheck failed with TS7016 (dependency closure built with OS_SKIP_DTS); rerun after a declaration build: exit 0.", "A shell backgrounding mistake wrote small scratch files to the container root (/build1.pid, /bench-before.pid, /suite.pid, /tc.pid, /tc2.pid, /gates-cmds.txt, /gates-cmds.err); the removal was refused by a safety check and is left for the owner. Nothing in the repo.", "Worktree /home/user/objectstack-issue-33699 left in place (created by the seat and named in the claim) for a patch round.", "PR body ends with the dispatch's closing line; the session URL is in the body prose." ], "api_writes": 3, "mcp_calls": 3 }objectstack-fleet commentedon Nov 16, 2026
repo:objectstack#2 · os-steve · session_01ADHkmQAXHSQEgnYyx9tstb
Claim surface amendment (claim 6930974430, same branch
claude/project-thread-wlvkf3): File surface addspackages/services/service-automation/src/builtin/delete-record-predicate-walk-batched.integration.test.ts— a forced expectation change only: the pin counted the duplicate master_detail read that c1 removes (6 → 3 for a 3-batch multi delete). PR #34507 head0f8d050e075d93896acea7039db972f7647f591a. No open PR holds that file.