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.
Ruled: option B · the maintainer (Steedos) on the seat thread decision card (2026-11-15T10:39Z), answering the decision request 6892463174. Chosen option, verbatim as the card read: 「B: batch through the existing path」.
As it binds this card: each cascading relation goes through the existing predicate-delete arm (one scoped id read, per-row hooks kept, DELETE … WHERE id IN (…) in batches of 500), plus c1 (the engine merges its three identical reads).
The four points the request named are executed as no observable change (restoring the invariant, not a new product choice): (1) realtime keeps per-row events; (2) a refused child rolls back the whole cascade, never skipped; (3) no new refusal for a large cascade (the bulk hook ceiling must not refuse what deletes today); (4) record hooks still run per row. Premise for the dev to measure first: all four hold on the predicate arm. ⛔ If any one cannot hold, stop and report it as a fork back to this card; do not build around it and do not fall back to C silently.
Split per the request: an A4 engine card (cascade through the predicate arm + c1) and an A2 security-parity pin card, each claimed and reviewed on its own. The statement counts are estimates until the first card measures them.
State: needs-user-decision → pm:queue (area S2 splits and re-claims).
Claim: PM loop round 2 (area S2, #33751 §2; after ruling 6893104201, option B)
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/engine-delete-and-aggregate.ts (the predicate-delete arm) · packages/objectql/src/recycle-bin/** · tests beside them (stop on breach; explain in the report)
Container & model: L, mode:subagent, model: TIER_DEFAULT (no path-derived mandate), effort: high (L engine change under a fresh ruling)
Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6893104201
Premise: corrected 6892420600 (the "no per-row hooks" gate never opens; batched capture already exists) → ruling 6893104201: the four points must hold on the predicate arm, measured first; a fork goes back to this card
Serial constraints cleared: #33782 (A2 security-parity pins, carries item 2 of this card, S1) — pins only, plugin-security / plugin-sharing tests, no shared file; #33652 (os-elon-musk, engine-find.ts / engine-query-lowering.ts / relation-*.ts) — not touched; #33698 (engine-delete-and-aggregate.ts) is released, not in flight
Claim surface amendment (claim 6893132964, same branch claude/area-A4-33699): File surface adds packages/objectql/src/engine-top-level.ts and packages/objectql/src/engine-middleware-and-context.ts (~15 lines: the cascade-issued delete token gains an optional id set, so a cascade-issued predicate delete keeps the HookContext.referentialCascadeDelete marker on every per-row context — ruling 6893104201 point (4)). Neither file is held by another in-flight PR named in the claim.
{
"issue": 33699,
"status": "needs_decision",
"branch": "claude/area-A4-33699",
"pr": null,
"session": "session_01QsR2jRmmALkM1ftZxdVatQ",
"premise_still_valid": false,
"summary": "Fork back to this card per ruling 6893104201: measured the four points on the predicate-delete arm before building, then the area's two follow-up bars (a) dispatch.mode and (b) before/after interleave. Points (1)-(3) hold; (4) holds only with the approved token-set edit; but (a) and (b) cannot both hold, and nothing was built. Root cause: today each cascaded child is its own by-id write, so its hooks see dispatch.mode 'record', input.options {where:{id}} and the interleave before_1, grandchildren_1, DELETE_1, after_1, before_2 ... A set-based DELETE per 500 children forces every child's before-hook to run before any child row is gone, so either the context keeps the by-id shape (mode 'record', by-id options) and a shipped guard that reads sibling state gives a different verdict, or the context takes the predicate shape the shipped guards were written for (mode 'per-row', options multi) and the published dispatch.mode value changes. Evidence in open_questions. No code, no PR; worktree removed clean; claim branch left at origin/main b76df9a6.",
"tests": "No code changed. Measurements are code readings on origin/main b76df9a6 plus the bench readings already on this card (comment 6892420600: 155 statements, SQLite p50 142 ms, PG p50 178 ms, tree d7e1a5aa; no engine change since on the seam). Point (1) realtime: holds - a cascade-issued predicate delete can publish one data.record.deleted per doomed row with organizationRow = that row (engine.ts:2478 publishDataEvent contract) instead of publishBulkDataEvent. Point (2) refusal: holds - the sharing middleware answers a by-id delete with 403 FORBIDDEN (plugin-sharing sharing-plugin.ts:1560-1584, admitsByIdWrite incl. the authored-RLS widener) but NARROWS a predicate delete with buildWriteFilter (:1673-1691), so an out-of-scope child would be skipped; the arm can detect any requested child id missing from its caller-scoped doomed read and throw an internal sentinel before any hook or write, and the walk then runs today's by-id deletes for that chunk, reproducing today's envelope and rollback. Point (3) ceilings: holds - chunks of 500 (REFERENCE_PROBE_BATCH, engine.ts:5024) sit under MAX_BULK_PER_ROW_HOOK_ROWS = 10,000 (spec bulk-write-hook-conformance.ts:282) and plugin-security's PREDICATE_WRITE_READABLE_ID_CAP = the same 10,000 (security-plugin.ts:926). Point (4) marker: holds with the approved edit (CascadeIssuedDelete gains an id set; claimReferentialCascadeDelete matches a predicate delete whose where.id.$in is that set). Bar (a): dispatch.mode is published (spec data/hook.zod.ts:1361, 'record' = the caller's whole write, 'per-row' = one of N) and marshalled into sandboxed bodies (runtime sandbox/body-runner.ts:1456-1472); shipped readers: plugin-sharing record-share-cascade.ts:347, rule-hooks.ts:248, bulk-recompute.ts:298 (stash host = dispatch.scope), service-storage file-reference-lifecycle.ts:466-468, plugin-audit comment-access-hooks.ts:429. Bar (b) census of shipped delete-side hooks: sibling-independent (key on the row's own id or previous): plugin-audit writeAudit (audit-writers.ts:2533), record-share-cascade, rule-hooks, file-reference-lifecycle (ownership index), identity-write-guard (identity-write-guard.ts:274), plugin-approvals afterDelete (lifecycle-hooks.ts:713), attachment access/lifecycle, membership-ended-session, service-account-owner-leaves. Sibling-READING: plugin-auth last-admin-guard beforeDelete on sys_member / sys_user_permission_set (last-admin-guard.ts:2260/2270, enforceStanding :1923 simulates the org's remaining administrators against current rows), reachable through the cascade sys_user -> sys_member.user_id (deleteBehavior 'cascade', platform-objects sys-member.object.ts:397); plugin-sharing primary-bu-projection afterDelete on sys_business_unit_member recomputes from the user's remaining memberships (primary-bu-projection.ts:105-122; final state equal, intermediate projection writes differ). App-authored hooks (object-scoped or object '*', hook.zod.ts:639) can read siblings through ctx.api; none is censusable.",
"gates": "No diff: nothing to derive or run (branch = origin/main b76df9a6). No PR, no check-runs.",
"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 recreated claim branch claude/area-A4-33699 at origin/main b76df9a6 (not a REST write).",
"files_changed": [],
"line_budget": "n/a - no diff",
"surface_amendment": "Approved by the area mid-task and posted on this card: engine-top-level.ts (CascadeIssuedDelete id set) and engine-middleware-and-context.ts (claimReferentialCascadeDelete matching it). Not used: stopped before the first edit.",
"deviations": [
"No PR: stopped as a fork, as ruling 6893104201 and the area's bars (a)/(b) order when a point cannot hold.",
"Worktree /home/claude/wt/area-A4-33699 removed clean (no commits, nothing uncommitted) before this hand-back, because the hand-back ends the run."
],
"open_questions": [
{
"question": "Bars (a) and (b) cannot both hold for a set-based cascade: which context shape do cascaded children's hooks get?",
"options": [
"F1 - Predicate shape, as the arm already gives a root predicate delete (#26871): dispatch.mode 'per-row' with a shared dispatch.scope, input.options carrying the chunk predicate (multi: true), all before-hooks of a chunk before its DELETE. Every shipped delete-side hook is written for this shape: last-admin-guard reads options.multi and judges the WHOLE chunk's targets (last-admin-guard.ts:1735-1748), so a chunk that would remove an org's last administrator is refused whole and the cascade rolls back, the same outcome as today's refusal at the last row; sharing and storage do their work once per write at index 0. Observable change, to be declared in the changeset: the published dispatch.mode value for a cascaded child moves 'record' -> 'per-row', input.options moves {where:{id}} -> the chunk predicate, and an app-authored hook that reads sibling rows sees them not yet deleted. Real need: the measured case (155 statements, est. ~50, per-child 13 -> ~2). Long-term: one dispatch shape for every multi-row delete, the shape ADR-0058 Addendum II already defines; no new surface. AI-error: an app author already has to handle 'per-row' for predicate deletes; a cascade stops being a third shape. Startup focus: no new capability or gate. Effort L, as ruled.",
"F2 - Keep 'record' and today's interleave wherever an observer could notice: run the set-based arm only for a child whose every delete-side hook is a censused platform global (writeAudit, record-share-cascade, file-reference-lifecycle, identity-write-guard, approvals), and today's by-id path for any child with an object-scoped or wildcard app hook or a platform object guard (sys_member's last-admin-guard). Still changes dispatch.mode for those platform hooks (they serve both), so (a) holds only for app hooks. Needs a hook-registry question the engine does not expose (object-scoped vs global, by packageId) in engine.ts / the hooks facet, outside the surface, and the census is an allowlist that goes stale silently when a platform plugin adds a global delete hook. Real need: still serves the bench (line items carry only global hooks). Long-term: two delete paths chosen by who registered a hook - the shape the first round's option A was rejected for. AI-error: an author adding one hook silently moves the object back to the slow path. Effort L+.",
"F3 - Option C explicitly, no observable change at all: c1 (the engine reuses the collection walk's probe for probes made before the walk's first write, and the recycle-bin snapshot reuses the collected child rows) plus the A2 per-cascade memo of controlled-by-parent authorization reads. Est. 155 -> ~105, still linear. Effort S + M.",
"F4 - Stop R7 here; record the census on the epic."
],
"recommendation": "F1, because it is the only shape that keeps the shipped guards correct while batching (last-admin-guard is correct under the predicate shape and wrong under a 'record' shape with batched befores), it reuses ADR-0058 Addendum II's per-row contract instead of inventing a cascade-only one, and long-term weight leads. It does reverse the ruling's 'no observable change' on two published context values, so it needs the maintainer's word; F3 is the no-change fallback if the answer is no."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none - noted, not filed: a by-id delete and a predicate delete of the same rows meet different sharing answers - by-id refuses 403 FORBIDDEN, predicate narrows by buildWriteFilter and skips (sharing-plugin.ts:1560-1691); by-id also consults the authored-RLS widener (admitsByIdWrite -> probeAuthoredRowWrite), predicate does not visibly. Whether the two scopes are equal is #33782's (A2) pin question; no wrong answer reproduced here."
],
"report_comment": "posted on #33699 (id in the hand-back)",
"head_sha": "b76df9a6 (branch = origin/main, no commits)"
}
Release: claim 6893132964 (session session_01QsR2jRmmALkM1ftZxdVatQ, branch claude/area-A4-33699) is withdrawn pending this decision. Nothing landed: the branch equals origin/main b76df9a, no PR.
Governing text: ruling 6893104201 (option B; four points as "no observable change"; ⛔ fork back if any cannot hold).
Evidence: os-dev-report 6893257535 (code readings at b76df9a; bench 6892420600).
Ruled: option F1 · the maintainer (Steedos) on the seat thread decision card (2026-11-15T11:30Z), answering decision request 6893273591 after an independent Fable review. Chosen option, verbatim as the card read: 「F1 接受批量方式并声明」 (accept the batch hook shape and declare it).
This replaces point 4 of record 6893104201. That record compressed the request's four points into "no observable change", which the request itself did not say, and the fork came from that. Points 1–3 stand.
Ruling as it binds this card:
A cascaded child batch runs every child's before-hooks, then one set delete, then the after-hooks. Cascaded children carry dispatch.mode: 'per-row' with options.multi set. The shipped last-admin guard is correct under this shape: the whole batch is judged together.
Declare it: the changeset and release note name the dispatch.mode change for cascaded children. They also name the one real behaviour flip: a before-delete hook that counts remaining siblings now sees them all present, and should use options.multi / referentialCascadeDelete. And they note that a batch falling back to per-id deletes keeps today's shape, so one cascade can show both.
Clause-②: the published hook dispatch contract changes for cascaded children, so the contract review is owed on the narrowing/rules face.
Claim: PM loop round 3 (area S2, #33751 §2; after ruling 6893661036, option F1)
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/engine-delete-and-aggregate.ts (the predicate-delete arm) · packages/objectql/src/engine-top-level.ts + engine-middleware-and-context.ts (cascade token id set, amendment 6893212568) · packages/objectql/src/recycle-bin/** · tests beside them · .changeset/** · the hook docs naming dispatch.mode, if any (stop on breach; explain in the report). Bench legs of packages/qa/dogfood/bench/sql-perf are run for the measured count; a bench file edit only if the 10-line-item opportunity leg is missing
Container & model: L, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high
Clause-②: no (narrowing) — the published hook dispatch shape for cascaded children changes (dispatch.mode 'record' → 'per-row', options.multi, before-hooks run before the set delete); BREAKING banner + ADR-0087 disposition in the changeset; one CONTRACT_REVIEW_TIER review owed before the queue
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6893661036
Premise: corrected 6892420600 → ruling 6893104201 points 1–3, point 4 replaced by ruling 6893661036 (F1: accept the batch hook shape and declare it)
Serial constraints cleared: #33782 (A2 parity pins, S1, pm:queue) — no shared file; ruling 6893661036 precondition (1): it merges before or together with this PR, so landing waits on it; #33795 (A4) stays serial behind this card; #33652 (engine-find.ts / engine-query-lowering.ts / relation-*.ts) not touched; no open PR touches the file surface (55 open PRs read)
{
"issue": 33699,
"status": "done",
"branch": "claude/area-A4-33699",
"pr": "https://github.com/objectstack-ai/objectstack/pull/33887",
"head": "89dff98f61dd45bc47bef8b17d358db26676a759",
"session": "session_01QsR2jRmmALkM1ftZxdVatQ",
"premise_still_valid": true,
"summary": "Ruling 6893661036 (F1) implemented. The cascade walk collects each cascade relation's dependents over the whole root set and deletes them as ONE predicate delete per chunk of 500 (where id $in chunk, multi: true) through the public delete(): every child's beforeDelete (per-row), one deleteMany, every child's afterDelete; grandchildren join the set through the predicate arm's existing cascadeDeleteRelations. The cascade token carries an optional id set, so referentialCascadeDelete is true on every per-row context in both phases. Point 2 parity: a claimed batch always reads its doomed rows through the middleware-composed AST; a missing requested child throws the engine-internal CascadeBatchNarrowed before any hook or write, and the walk falls back to today's by-id deletes for that chunk (same 403 envelope, whole cascade rolls back, 'record' shape kept). Realtime stays one data.record.deleted per child. A driver with no deleteMany keeps the by-id path. Changeset is patch with the verbatim Clause-② and Metadata-protocol lines, BREAKING banner, one adr-0087 not-required marker, and names the dispatch.mode change, the sibling-count flip and the fallback shape. Landing waits on #33782; the CONTRACT_REVIEW_TIER review was not requested by me.",
"tests": "objectql: new src/engine-cascade-delete-batch.test.ts, 10 cases green (order before xN, one deleteMany, after xN; per-row shape, index, multi, previous, marker; sibling count [3,3,3]; grandchildren; 501 children = deletes [500,1]; realtime per-row; rollback on before- and after-phase refusal; narrowed-chunk fallback 403 with nothing deleted; allowed fallback showing both shapes; no deleteMany keeps by-id). engine-cascade-summary-rollback.test.ts retriaged one expectation (['l2'] to [], non-rollback runtime). Full objectql suite at 89dff98f6 under the lock: 598 files, 13168 tests passed, VERDICT 0. plugin-auth: last-admin-guard.test.ts new [F1] describe on a real SQLite engine, each case on the batch and the by-id leg: both admin memberships cascaded = 403 PERMISSION_DENIED object sys_member, nothing deleted, on both legs; another admin spared = allowed on both legs. plugin-auth full suite at a1e04815b: 277 files, 5472 passed, 10 skipped; at 89dff98f6 last-admin-guard + remove-user-atomicity 120 passed. Typecheck objectql and plugin-auth: exit 0. Ablations, each committed-then-mutated via ablation-replace.mjs with trap restore and git diff HEAD empty after: (1) remove the CascadeBatchNarrowed throw, 2/10 red; (2) claim never matches an id set, 5/10 red; (3) bulk realtime event for the batch, 1/10 red; (4) cascade batch without multi, objectql rebuilt, guard batch-refusal case red (promise resolved true); restore leg dist preflight --absent ok, 4/4 green. Bench (my own runs, packages/qa/dogfood/bench/sql-perf/bench.mjs --scale 100000 --only cascade_delete_opportunity, 5 deletes, one opportunity with 10 line items): SQLite statements 155 (166 cold) to 57 (68 cold), p50/p95 131.2/169.7 ms to 66.4/115.2 and 76.1/148.5; PostgreSQL 16 private cluster statements 155 (166 cold) to 57 (68 cold), p50/p95 243.0/312.5 ms to 89.5/166.3 and 85.3/145.3. Milliseconds indicative (shared box), statement counts exact.",
"gates": "dispatch-gates --commands derived 96 families at cb2cafef6: 94 exit 0; check:query-options-erasure first red (test surface 236 to 237 from as-any casts), casts removed, rerun exit 0; check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET = NOT MEASURED, left to CI; --ran reconciliation 96/96. Changeset/body gates at the final body: adr-0087-registration, changeset-no-major, closing-keyword-parity, empty-changeset, partof all exit 0. eslint over touched files exit 0. CI at head 89dff98f6: Test Core (3/8) failure, triaged as not this PR's: job 132828337437's only failure is @objectstack/mcp src/mcp-file-tools.test.ts, case 'read_file ... out of CPU budget on the worker', expected content text received none (line 950), a CPU-time-budget timing case; the file imports only vitest, node built-ins, @objectstack/spec/ai and mcp internals with a fake data bridge, zero delete/cascade references, and the diff reaches packages/mcp only through merged CHANGELOG/package.json; locally at 89dff98f6 under the lock mcp-file-tools.test.ts 47/47 passed. No fix pushed; head unchanged. Remaining check-runs in_progress or as GitHub reports them at report time.",
"dogfood_battery": "89dff98f6 · closure build VERDICT 0 · pnpm --filter @objectstack/dogfood test VERDICT command-exit 0 · Test Files 467 passed, 3 skipped (470) · Tests 3959 passed, 42 skipped (4001) · no failures",
"mcp_calls": "0",
"api_writes": "2 — POST pulls via relay pr_create (PR #33887, draft); POST issues/33699/comments (this report via post-stamped). git push is not a REST write.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: ruling 6893104201 c1 follow-up (seat) · the walk's collect probe, re-probe and recycle-bin snapshot still read the same child rows (statements 22, 24, 25 of the capture); behaviour-neutral · noted, not filed",
"carrier: #33782 · 'never more rows' (a predicate scope admitting a child the by-id gate refuses) is not detectable by the missing-id check; that direction is #33782's pin · noted, not filed"
],
"deviations": [
"packages/plugins/plugin-auth/src/last-admin-guard.test.ts is outside the claim's objectql file surface; the dispatch's proof list orders the guard verdict test and objectql cannot import plugin-auth",
"lint run over touched files only; repo-wide pnpm lint left to CI",
"of objectql's downstream consumers only plugin-auth's suite ran locally; the rest declared to CI",
"ablation 4 mutation-leg dist preflight read red while the file was mutated (tree check); the red test is the evidence, the restore-leg --absent preflight passed",
"the bench result's commit stamp reads the branch commit on the 'before' run, which used base 1e65a389e objectql source built into the same tree",
"the changeset Clause-② line was first written short and corrected to the claim's verbatim line before pr_create"
]
}
M1 · the batch drops the read scope the by-id child delete enforces
fixed (read-door proof per chunk, by-id fallback; pinned on both legs on a real plugin-security stack; ablated)
S1 · a cascade into sys_organization newly refused 409
fixed (excluded from the batch; pinned; ablated)
N1 · dispatch.mode fallbacks
fixed (TSDoc)
N2 · stale "ctx.input identical"
fixed (TSDoc)
N3 · changeset FROM to TO omits ctx.result
fixed (changeset)
N4 · "the caller's scope"
fixed (comment)
c1
not done, carried: Part of #33699, c1 stays open
The head stays red on 4 of 8 #33927 parity cases until #33928 merges, after which this branch merges main. Root cause: plugin-sharing inferTargetId (sharing-plugin.ts line 1776) returns options.where.id even when it is the operator object { $in: [...] }. The batch delete is then judged as a by-id write of the id [object Object] and refused 403 FORBIDDEN. The same 4 cases are red with the read-door proof ablated.
{
"issue": 33699,
"status": "done",
"branch": "claude/area-A4-33699",
"pr": "https://github.com/objectstack-ai/objectstack/pull/33887",
"head": "616735ceb8",
"session": "session_01QsR2jUg7BKfRBcTPyMxbLh",
"premise_still_valid": true,
"summary": "Fix round for CONTRACT_REVIEW_TIER review 6896079092 (FAIL) and review-b 6896089195. M1: before a chunk of cascaded children is deleted in one batch, the walk now asks the caller's read door (find with id $in chunk, fields id, the walk's context) and deletes the chunk by id when any id is missing or the door refuses with a declared 4xx, so the batch never deletes a child the by-id path would refuse; a store fault propagates. S1: sys_organization is excluded from the batch (by id, 'record'). N1-N4 are TSDoc and changeset text only; the changeset FROM to TO now names ctx.result, and dispatch.mode is stated as the code sets it, 'per-row'. c1 is not done: the closing keyword is now 'Part of #33699' and the body says c1 stays open. The head is red on 4 of 8 #33927 parity cases until #33928 merges; after that this branch merges main. Root cause, measured: plugin-sharing sharing-plugin.ts inferTargetId (line 1776) returns options.where.id even when it is the operator object {$in: [...]}, so the batch delete of a private + owner_id child is judged as a by-id write of the id '[object Object]' and refused 403 FORBIDDEN ('You do not have access to change or delete this record'). The same 4 cases are red with the read-door proof ablated, so the M1 fix does not cause them.",
"findings": {
"M1": "fixed: the pin is red on the batch leg at 89dff98f (landed, hidden child deleted) and 403 on the by-id leg; at HEAD both legs give 403 PERMISSION_DENIED and nothing is deleted",
"S1": "fixed: childName !== ORGANIZATION_OBJECT in batchable, pinned in objectql; no other predicate-only refusal of the same one-term shape (list in the PR update's Acceptance notes)",
"N1": "fixed: dispatch.mode TSDoc names the four by-id cases, and that the before-hooks run before the set delete per chunk of 500 within one relation",
"N2": "fixed: ctx.user/ctx.session identical, ctx.input/ctx.dispatch tell nothing apart",
"N3": "fixed: changeset FROM to TO bullet for ctx.result (absent; read ctx.previous)",
"N4": "fixed: engine-delete-and-aggregate.ts comment says the doomed read is the caller's WRITE scope; the read scope is proven by the walk",
"c1": "not done, carried: Part of #33699, c1 stays open on the card"
},
"tests": "plugin-security src/cascade-batch-read-scope.test.ts (new; real ObjectQL + SqlDriver + SecurityPlugin; batch leg and by-id leg with deleteMany hidden): 4/4 green. objectql src/engine-cascade-delete-batch.test.ts: 4 new cases, 14/14 green. Ablation 1 (read-door proof removed, via scripts/ablation-replace.mjs, anchor 1 to 0, blob e80908231 to 0c3d9ff28): plugin-security 1 failed / 3 passed (the [batch] case answers {kind:'landed'}), objectql 2 failed / 12 passed; restored, blob equals HEAD, git diff HEAD empty. Ablation 2 (organization exclusion removed): objectql 1 failed / 13 passed with organizationPredicateDeleteRefusal ('Organizations are deleted one at a time, by id'); restored, blob equals HEAD. No rebuild leg: plugin-security's vitest config aliases @objectstack/objectql to source. Suites at 7d2730a95 under the verify lock: objectql 599 files, 13255 passed, typecheck exit 0; plugin-security 270 files, 6705 passed, 45 skipped, 4 failed (the #33927 parity cases, carried by #33928), typecheck exit 0; plugin-auth 277 files, 5499 passed, 10 skipped, typecheck exit 0.",
"gates": "dispatch-gates --commands derived 98 at 7d2730a95; 98 ran with exit 0 (96 in the sweep; check:type-check-debt 'OK, 0 raw tsc errors' and check:dual-build-cjs-loads '123 entry points load' under the lock). dispatch-gates --ran: '98 derived, 98 run, 0 NOT-MEASURED, 0 UNRUN', exit 0. dispatch-gates --tier exit 0. The two CI reds of 4029ca241: check-durability-degradation-log-level exit 0, and objectql typecheck exit 0 (TS2345, the walk's Pick lacked 'find'), fixed in bb5e34b56. pnpm lint exit 0 at eab93bab0. Body gates on the patched body: changeset-no-major, closing-keyword-parity, adr-0087-registration, empty-changeset, partof-closing-keyword all exit 0. CI check-runs at 616735ceb are not cited here: the report is delivered without waiting for CI; Test Core is expected red on the 4 parity cases until #33928.",
"dogfood_battery": "tree of 616735ceb (its only commit after 7d2730a95 changes the changeset) · os-verify-lock: VERDICT command-exit 0 · Test Files 467 passed, 3 skipped (470) · Tests 3959 passed, 42 skipped (4001) · no failure",
"bench": "packages/qa/dogfood/bench/sql-perf at 7d2730a95: statements 155 before, 58 after (57 to 58: one read-door read per chunk); SQLite 58 (69 cold), p50/p95 100.0/177.4 ms; PostgreSQL 16 (private cluster, fsync off) 58 (69 cold), 135.2/236.4 ms",
"mcp_calls": "0",
"api_writes": "2 by REST relay: PATCH /repos/objectstack-ai/objectstack/issues/33887 (PR body, fleet-write issue_patch, run 43746834553, read-back 19414 bytes identical); POST /repos/objectstack-ai/objectstack/issues/33699/comments (this report, post-stamped). git push (not REST): 4029ca241, bb5e34b56, eab93bab0, 7d2730a95, 616735ceb to claude/area-A4-33699, no force.",
"files_changed": [
"packages/objectql/src/engine-cascade-planning.ts",
"packages/objectql/src/engine-delete-and-aggregate.ts",
"packages/objectql/src/engine-cascade-delete-batch.test.ts",
"packages/plugins/plugin-security/src/cascade-batch-read-scope.test.ts (new, test-only)",
"packages/spec/src/data/hook.zod.ts (TSDoc only)",
".changeset/33699-cascade-delete-batch.md"
],
"deviations": [
"A plugin-sharing inferTargetId fix was committed locally and reset away on the PM's order; it was never pushed.",
"pnpm lint ran at eab93bab0, not the final head. The sweep ran at 7d2730a95; the final head 616735ceb only changes the changeset, and the changeset and body gates ran again on it.",
"origin/main moved 30 commits after the 7d2730a95 merge (now 63db7240a). I did not merge again, because the PM's land order has this branch merge main after #33928. dispatch-gates --ran says gate scripts are stale against origin/main.",
"The verify lock queue timed out with exit 99 several times; I queued again with the same slot each time."
],
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: #33928 (area S1, branch claude/area-A2-33928) · plugin-sharing inferTargetId (sharing-plugin.ts line 1776) reads where.id = {$in} as a by-id target '[object Object]', 403 FORBIDDEN on a nested predicate delete of a private + owner_id child; it is red on 4 of 8 #33927 parity cases at this head, and red with the read-door proof ablated · noted, not filed",
"carrier: #33699 · c1 (collect probe, re-probe and recycle-bin snapshot read the same child rows) not done; the card stays open · noted, not filed",
"carrier: none · the dogfood battery log shows 20 'Schema sync FAILED' lines for showcase_invoice: sqlite-wasm refuses 'alter table add column invoice_date date default (strftime(...))', 'Cannot add a column with non-constant default'. These are log lines, not a failed test. Not measured at a public door; noted, not filed"
]
}
Fix round on #33887 (record 6899834361), reported 2026-11-16T06:12Z. Head 5ed247661, L2 delta PASS (6908865874). M1 closed by #34033 plus the main merge (parity 8/8), S1 and S2 fixed and pinned, N1 read. The replacement PR body is with the seat.
{
"issue": 33699,
"status": "done",
"branch": "claude/area-A4-33699",
"pr": "https://github.com/objectstack-ai/objectstack/pull/33887",
"session": "session_01QsR2jUg7BKfRBcTPyMxbLh",
"premise_still_valid": true,
"head": "5ed2476610bd5cca57ca8a00412215da52354a77",
"summary": "Fix round for record 6899834361 at 616735ce. Merged origin/main at 31eb2aed (128 commits, no conflict, remerge-diff empty, merge commit amended to carry the trailer pair; the PR's own changed lines are identical before and after). M1 closed by #34033 plus the merge: the 8 #33927 parity cases are green, and a one-off shape probe shows the 4 landed cases batched and the 4 refused cases refused at the by-id door. S1: two changeset FROM-TO rows (.changeset/33699-cascade-delete-batch.md lines 21-22) with the remedy, and pin (a) on both shapes (engine-cascade-delete-batch.test.ts line 199). S2: the batch takes only cascadeSet.members, and a non-member goes by id with its own recycle-bin entry (engine-cascade-planning.ts lines 1461-1462, docblock 1440); pinned in recycle-bin/capture.test.ts line 544. N1: no code; the r2/f_e parity cases are the narrowed fallback crossing the real chain, and they are green.",
"tests": "At 5ed247661, under the verify lock (VERDICT command-exit 0): objectql 600 files / 13369 tests passed; objectql typecheck exit 0 (test layer 39 files / 233 errors held); plugin-security 272 files, 6724 passed, 45 skipped; plugin-sharing 75 files, 1581 passed; plugin-auth last-admin-guard 114 passed; parity file 8/8. S2 pin red before the fix ('expected [account/acc1] to deeply equal [account/acc1, note/n9]'), then green. Ablations via ablation-replace, each restored to the HEAD blob (daa43fc8a) with git diff HEAD empty: S2 term (members = chunk) red 1/43, and the batch off (if (false && ...)) turns pin (a) red ('expected 3 to be 1'). No rebuild leg: objectql tests import source, and plugin-security aliases objectql to source.",
"gates": "dispatch-gates --commands at 5ed247661 derived 99: 80 non-spec all exit 0; 17 spec families all exit 0; spec check:generated 13/14 current, and its check:test-typecheck tsc died with no diagnostics while dogfood ran, with a re-run that hit lock queue-timeout 99: NOT MEASURED locally, read from CI (TypeScript Type Check success). check:type-check-debt and check:dual-build-cjs-loads: NOT MEASURED, CI's. eslint on the three touched files exit 0. CI on 5ed24766: 67 check-runs, 56 success, 11 skipped, 0 failed (Test Core 1-8/8, Lint & Repo Gates, TypeScript Type Check, Build Core, Governed Surface Queue Guard success).",
"dogfood_battery": "5ed247661 · VERDICT command-exit 0 · Test Files 471 passed, 3 skipped (474) · Tests 3988 passed, 42 skipped (4030) · no failure",
"mcp_calls": "0",
"api_writes": "1 (this comment: POST issues/33699/comments via post-stamped.mjs); plus 2 git pushes (321a8668f; then 74ef4e4bc and 5ed247661 together); PR body not edited, replacement at scratchpad issue-33699/pr-body-next.md",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": ["carrier: none · noted, not filed: record 6908865874 N1 (hook.zod.ts dispatch.mode TSDoc lacks the fifth by-id case) and N2 (S2 pin has no by-id leg) kept as accepted nits per the coordinator, so the PASS head stands"]
}
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_01QsR2jRsWwTRkuRCyQwvpAG
Ruled: option B · the maintainer (Steedos) on the seat thread decision card (2026-11-15T10:39Z), answering the decision request 6892463174. Chosen option, verbatim as the card read: 「B: batch through the existing path」.
As it binds this card: each cascading relation goes through the existing predicate-delete arm (one scoped id read, per-row hooks kept,
DELETE … WHERE id IN (…)in batches of 500), plus c1 (the engine merges its three identical reads).The four points the request named are executed as no observable change (restoring the invariant, not a new product choice): (1) realtime keeps per-row events; (2) a refused child rolls back the whole cascade, never skipped; (3) no new refusal for a large cascade (the bulk hook ceiling must not refuse what deletes today); (4) record hooks still run per row. Premise for the dev to measure first: all four hold on the predicate arm. ⛔ If any one cannot hold, stop and report it as a fork back to this card; do not build around it and do not fall back to C silently.
Split per the request: an A4 engine card (cascade through the predicate arm + c1) and an A2 security-parity pin card, each claimed and reviewed on its own. The statement counts are estimates until the first card measures them.
State:
needs-user-decision→pm:queue(area S2 splits and re-claims).Generated by Claude Code
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
Claim: PM loop round 2 (area S2, #33751 §2; after ruling 6893104201, option B)
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/engine-delete-and-aggregate.ts (the predicate-delete arm) · packages/objectql/src/recycle-bin/** · tests beside them(stop on breach; explain in the report)Container & model:
L,mode:subagent,model: TIER_DEFAULT(no path-derived mandate),effort: high(L engine change under a fresh ruling)Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6893104201
Premise: corrected 6892420600 (the "no per-row hooks" gate never opens; batched capture already exists) → ruling 6893104201: the four points must hold on the predicate arm, measured first; a fork goes back to this card
Serial constraints cleared: #33782 (A2 security-parity pins, carries item 2 of this card, S1) — pins only, plugin-security / plugin-sharing tests, no shared file; #33652 (os-elon-musk, engine-find.ts / engine-query-lowering.ts / relation-*.ts) — not touched; #33698 (engine-delete-and-aggregate.ts) is released, not in flight
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
Claim surface amendment (claim 6893132964, same branch
claude/area-A4-33699): File surface addspackages/objectql/src/engine-top-level.tsandpackages/objectql/src/engine-middleware-and-context.ts(~15 lines: the cascade-issued delete token gains an optional id set, so a cascade-issued predicate delete keeps theHookContext.referentialCascadeDeletemarker on every per-row context — ruling 6893104201 point (4)). Neither file is held by another in-flight PR named in the claim.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": "Fork back to this card per ruling 6893104201: measured the four points on the predicate-delete arm before building, then the area's two follow-up bars (a) dispatch.mode and (b) before/after interleave. Points (1)-(3) hold; (4) holds only with the approved token-set edit; but (a) and (b) cannot both hold, and nothing was built. Root cause: today each cascaded child is its own by-id write, so its hooks see dispatch.mode 'record', input.options {where:{id}} and the interleave before_1, grandchildren_1, DELETE_1, after_1, before_2 ... A set-based DELETE per 500 children forces every child's before-hook to run before any child row is gone, so either the context keeps the by-id shape (mode 'record', by-id options) and a shipped guard that reads sibling state gives a different verdict, or the context takes the predicate shape the shipped guards were written for (mode 'per-row', options multi) and the published dispatch.mode value changes. Evidence in open_questions. No code, no PR; worktree removed clean; claim branch left at origin/main b76df9a6.", "tests": "No code changed. Measurements are code readings on origin/main b76df9a6 plus the bench readings already on this card (comment 6892420600: 155 statements, SQLite p50 142 ms, PG p50 178 ms, tree d7e1a5aa; no engine change since on the seam). Point (1) realtime: holds - a cascade-issued predicate delete can publish one data.record.deleted per doomed row with organizationRow = that row (engine.ts:2478 publishDataEvent contract) instead of publishBulkDataEvent. Point (2) refusal: holds - the sharing middleware answers a by-id delete with 403 FORBIDDEN (plugin-sharing sharing-plugin.ts:1560-1584, admitsByIdWrite incl. the authored-RLS widener) but NARROWS a predicate delete with buildWriteFilter (:1673-1691), so an out-of-scope child would be skipped; the arm can detect any requested child id missing from its caller-scoped doomed read and throw an internal sentinel before any hook or write, and the walk then runs today's by-id deletes for that chunk, reproducing today's envelope and rollback. Point (3) ceilings: holds - chunks of 500 (REFERENCE_PROBE_BATCH, engine.ts:5024) sit under MAX_BULK_PER_ROW_HOOK_ROWS = 10,000 (spec bulk-write-hook-conformance.ts:282) and plugin-security's PREDICATE_WRITE_READABLE_ID_CAP = the same 10,000 (security-plugin.ts:926). Point (4) marker: holds with the approved edit (CascadeIssuedDelete gains an id set; claimReferentialCascadeDelete matches a predicate delete whose where.id.$in is that set). Bar (a): dispatch.mode is published (spec data/hook.zod.ts:1361, 'record' = the caller's whole write, 'per-row' = one of N) and marshalled into sandboxed bodies (runtime sandbox/body-runner.ts:1456-1472); shipped readers: plugin-sharing record-share-cascade.ts:347, rule-hooks.ts:248, bulk-recompute.ts:298 (stash host = dispatch.scope), service-storage file-reference-lifecycle.ts:466-468, plugin-audit comment-access-hooks.ts:429. Bar (b) census of shipped delete-side hooks: sibling-independent (key on the row's own id or previous): plugin-audit writeAudit (audit-writers.ts:2533), record-share-cascade, rule-hooks, file-reference-lifecycle (ownership index), identity-write-guard (identity-write-guard.ts:274), plugin-approvals afterDelete (lifecycle-hooks.ts:713), attachment access/lifecycle, membership-ended-session, service-account-owner-leaves. Sibling-READING: plugin-auth last-admin-guard beforeDelete on sys_member / sys_user_permission_set (last-admin-guard.ts:2260/2270, enforceStanding :1923 simulates the org's remaining administrators against current rows), reachable through the cascade sys_user -> sys_member.user_id (deleteBehavior 'cascade', platform-objects sys-member.object.ts:397); plugin-sharing primary-bu-projection afterDelete on sys_business_unit_member recomputes from the user's remaining memberships (primary-bu-projection.ts:105-122; final state equal, intermediate projection writes differ). App-authored hooks (object-scoped or object '*', hook.zod.ts:639) can read siblings through ctx.api; none is censusable.", "gates": "No diff: nothing to derive or run (branch = origin/main b76df9a6). No PR, no check-runs.", "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 recreated claim branch claude/area-A4-33699 at origin/main b76df9a6 (not a REST write).", "files_changed": [], "line_budget": "n/a - no diff", "surface_amendment": "Approved by the area mid-task and posted on this card: engine-top-level.ts (CascadeIssuedDelete id set) and engine-middleware-and-context.ts (claimReferentialCascadeDelete matching it). Not used: stopped before the first edit.", "deviations": [ "No PR: stopped as a fork, as ruling 6893104201 and the area's bars (a)/(b) order when a point cannot hold.", "Worktree /home/claude/wt/area-A4-33699 removed clean (no commits, nothing uncommitted) before this hand-back, because the hand-back ends the run." ], "open_questions": [ { "question": "Bars (a) and (b) cannot both hold for a set-based cascade: which context shape do cascaded children's hooks get?", "options": [ "F1 - Predicate shape, as the arm already gives a root predicate delete (#26871): dispatch.mode 'per-row' with a shared dispatch.scope, input.options carrying the chunk predicate (multi: true), all before-hooks of a chunk before its DELETE. Every shipped delete-side hook is written for this shape: last-admin-guard reads options.multi and judges the WHOLE chunk's targets (last-admin-guard.ts:1735-1748), so a chunk that would remove an org's last administrator is refused whole and the cascade rolls back, the same outcome as today's refusal at the last row; sharing and storage do their work once per write at index 0. Observable change, to be declared in the changeset: the published dispatch.mode value for a cascaded child moves 'record' -> 'per-row', input.options moves {where:{id}} -> the chunk predicate, and an app-authored hook that reads sibling rows sees them not yet deleted. Real need: the measured case (155 statements, est. ~50, per-child 13 -> ~2). Long-term: one dispatch shape for every multi-row delete, the shape ADR-0058 Addendum II already defines; no new surface. AI-error: an app author already has to handle 'per-row' for predicate deletes; a cascade stops being a third shape. Startup focus: no new capability or gate. Effort L, as ruled.", "F2 - Keep 'record' and today's interleave wherever an observer could notice: run the set-based arm only for a child whose every delete-side hook is a censused platform global (writeAudit, record-share-cascade, file-reference-lifecycle, identity-write-guard, approvals), and today's by-id path for any child with an object-scoped or wildcard app hook or a platform object guard (sys_member's last-admin-guard). Still changes dispatch.mode for those platform hooks (they serve both), so (a) holds only for app hooks. Needs a hook-registry question the engine does not expose (object-scoped vs global, by packageId) in engine.ts / the hooks facet, outside the surface, and the census is an allowlist that goes stale silently when a platform plugin adds a global delete hook. Real need: still serves the bench (line items carry only global hooks). Long-term: two delete paths chosen by who registered a hook - the shape the first round's option A was rejected for. AI-error: an author adding one hook silently moves the object back to the slow path. Effort L+.", "F3 - Option C explicitly, no observable change at all: c1 (the engine reuses the collection walk's probe for probes made before the walk's first write, and the recycle-bin snapshot reuses the collected child rows) plus the A2 per-cascade memo of controlled-by-parent authorization reads. Est. 155 -> ~105, still linear. Effort S + M.", "F4 - Stop R7 here; record the census on the epic." ], "recommendation": "F1, because it is the only shape that keeps the shipped guards correct while batching (last-admin-guard is correct under the predicate shape and wrong under a 'record' shape with batched befores), it reuses ADR-0058 Addendum II's per-row contract instead of inventing a cascade-only one, and long-term weight leads. It does reverse the ruling's 'no observable change' on two published context values, so it needs the maintainer's word; F3 is the no-change fallback if the answer is no." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none - noted, not filed: a by-id delete and a predicate delete of the same rows meet different sharing answers - by-id refuses 403 FORBIDDEN, predicate narrows by buildWriteFilter and skips (sharing-plugin.ts:1560-1691); by-id also consults the authored-RLS widener (admitsByIdWrite -> probeAuthoredRowWrite), predicate does not visibly. Whether the two scopes are equal is #33782's (A2) pin question; no wrong answer reproduced here." ], "report_comment": "posted on #33699 (id in the hand-back)", "head_sha": "b76df9a6 (branch = origin/main, no commits)" }objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
决策请求 · #33699 第二轮:批量级联删除时,子记录的 hook 看到哪种上下文
Release: claim 6893132964 (session
session_01QsR2jRmmALkM1ftZxdVatQ, branchclaude/area-A4-33699) is withdrawn pending this decision. Nothing landed: the branch equals origin/main b76df9a, no PR.Governing text: ruling 6893104201 (option B; four points as "no observable change"; ⛔ fork back if any cannot hold).
Evidence: os-dev-report 6893257535 (code readings at b76df9a; bench 6892420600).
实测结论(按裁决要求回卡): 裁决的四点里 (1) 实时逐行事件、(2) 被拒即整体回滚、(3) 不新增大级联拒绝都能保持;(4) 级联标记在一处 ~15 行的小改后也能保持。但「无可观察变化」在一点上做不到:批量删除时,一批子记录的 before-hook 会在任何一行被删之前全部跑完。今天每个子记录是 before → 删除 → after 依次交错。要么沿用今天的上下文形状(
dispatch.mode: 'record'),那么读取兄弟记录状态的已发布守卫会给出不同结论(plugin-auth 的 last-admin-guard,经 sys_user → sys_member 级联可达);要么用谓词删除已有的形状(dispatch.mode: 'per-row',options 带整批谓词),守卫照常正确,但已发布的dispatch.mode值对级联子记录从 'record' 变为 'per-row'。dispatch.mode'record' → 'per-row'、input.options变为整批谓词、应用自写 hook 读兄弟记录时它们尚未删除;须在 changeset 声明。last-admin-guard 按整批判断,结果与今天一致。L 级os-decision-facets
① 项目长远合理性:F1 让所有多行删除只有一种派发形状(已有的 per-row 契约),不新增级联专用形状;F2 引入按注册者切换的第二路径。
② 实际业务拉动:删除带几百行明细的订单今天线性 155 条;F1 降幅最大,F3 约降三分之一。
③ 防 AI 犯错:F1 下作者只需处理已存在的 'per-row' 一种多行形状;F2 下加一个 hook 就会静默退回慢路径。
④ 创业阶段不扩散:F1/F3 都不新增能力位或门禁;F2 新增需维护的白名单。
Prior rulings read: ruling 6893104201; ADR-0058 Addendum II (per-row dispatch);
dispatch.modein spec data/hook.zod.ts:1361; thread: 6893104201.推荐 F1,但它推翻了上轮裁决中「无可观察变化」对两个已发布上下文值的要求,需要维护者明确同意;若不同意,退回 F3。只看①选 F1;②③④ 是否翻转:否。
裁后执行: 选 F1 ⇒ 区域按 F1 重新认领 #33699,changeset 声明两处可观察变化,#33782 的安全等价钉子同时守护。选 F3 ⇒ c1 留在 #33699(A4),c2 另立 A2 卡。选 F4 ⇒ 在 #33631 记普查后关闭本卡。
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG
Ruled: option F1 · the maintainer (Steedos) on the seat thread decision card (2026-11-15T11:30Z), answering decision request 6893273591 after an independent Fable review. Chosen option, verbatim as the card read: 「F1 接受批量方式并声明」 (accept the batch hook shape and declare it).
This replaces point 4 of record 6893104201. That record compressed the request's four points into "no observable change", which the request itself did not say, and the fork came from that. Points 1–3 stand.
Ruling as it binds this card:
dispatch.mode: 'per-row'withoptions.multiset. The shipped last-admin guard is correct under this shape: the whole batch is judged together.dispatch.modechange for cascaded children. They also name the one real behaviour flip: a before-delete hook that counts remaining siblings now sees them all present, and should useoptions.multi/referentialCascadeDelete. And they note that a batch falling back to per-id deletes keeps today's shape, so one cascade can show both.State:
needs-user-decision→pm:queue(area S2 re-claims; #33795 stays serial behind it).objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
Claim: PM loop round 3 (area S2, #33751 §2; after ruling 6893661036, option F1)
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/engine-delete-and-aggregate.ts (the predicate-delete arm) · packages/objectql/src/engine-top-level.ts + engine-middleware-and-context.ts (cascade token id set, amendment 6893212568) · packages/objectql/src/recycle-bin/** · tests beside them · .changeset/** · the hook docs naming dispatch.mode, if any (stop on breach; explain in the report). Bench legs of packages/qa/dogfood/bench/sql-perf are run for the measured count; a bench file edit only if the 10-line-item opportunity leg is missingContainer & model:
L,mode:subagent,model: TIER_DEFAULT(dispatch-gates --tier: no path-derived mandate),effort: highClause-②: no (narrowing) — the published hook dispatch shape for cascaded children changes (
dispatch.mode'record' → 'per-row',options.multi, before-hooks run before the set delete); BREAKING banner + ADR-0087 disposition in the changeset; one CONTRACT_REVIEW_TIER review owed before the queueMetadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 6893661036
Premise: corrected 6892420600 → ruling 6893104201 points 1–3, point 4 replaced by ruling 6893661036 (F1: accept the batch hook shape and declare it)
Serial constraints cleared: #33782 (A2 parity pins, S1, pm:queue) — no shared file; ruling 6893661036 precondition (1): it merges before or together with this PR, so landing waits on it; #33795 (A4) stays serial behind this card; #33652 (engine-find.ts / engine-query-lowering.ts / relation-*.ts) not touched; no open PR touches the file surface (55 open PRs read)
objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jRmmALkM1ftZxdVatQ
os-dev-report
{ "issue": 33699, "status": "done", "branch": "claude/area-A4-33699", "pr": "https://github.com/objectstack-ai/objectstack/pull/33887", "head": "89dff98f61dd45bc47bef8b17d358db26676a759", "session": "session_01QsR2jRmmALkM1ftZxdVatQ", "premise_still_valid": true, "summary": "Ruling 6893661036 (F1) implemented. The cascade walk collects each cascade relation's dependents over the whole root set and deletes them as ONE predicate delete per chunk of 500 (where id $in chunk, multi: true) through the public delete(): every child's beforeDelete (per-row), one deleteMany, every child's afterDelete; grandchildren join the set through the predicate arm's existing cascadeDeleteRelations. The cascade token carries an optional id set, so referentialCascadeDelete is true on every per-row context in both phases. Point 2 parity: a claimed batch always reads its doomed rows through the middleware-composed AST; a missing requested child throws the engine-internal CascadeBatchNarrowed before any hook or write, and the walk falls back to today's by-id deletes for that chunk (same 403 envelope, whole cascade rolls back, 'record' shape kept). Realtime stays one data.record.deleted per child. A driver with no deleteMany keeps the by-id path. Changeset is patch with the verbatim Clause-② and Metadata-protocol lines, BREAKING banner, one adr-0087 not-required marker, and names the dispatch.mode change, the sibling-count flip and the fallback shape. Landing waits on #33782; the CONTRACT_REVIEW_TIER review was not requested by me.", "tests": "objectql: new src/engine-cascade-delete-batch.test.ts, 10 cases green (order before xN, one deleteMany, after xN; per-row shape, index, multi, previous, marker; sibling count [3,3,3]; grandchildren; 501 children = deletes [500,1]; realtime per-row; rollback on before- and after-phase refusal; narrowed-chunk fallback 403 with nothing deleted; allowed fallback showing both shapes; no deleteMany keeps by-id). engine-cascade-summary-rollback.test.ts retriaged one expectation (['l2'] to [], non-rollback runtime). Full objectql suite at 89dff98f6 under the lock: 598 files, 13168 tests passed, VERDICT 0. plugin-auth: last-admin-guard.test.ts new [F1] describe on a real SQLite engine, each case on the batch and the by-id leg: both admin memberships cascaded = 403 PERMISSION_DENIED object sys_member, nothing deleted, on both legs; another admin spared = allowed on both legs. plugin-auth full suite at a1e04815b: 277 files, 5472 passed, 10 skipped; at 89dff98f6 last-admin-guard + remove-user-atomicity 120 passed. Typecheck objectql and plugin-auth: exit 0. Ablations, each committed-then-mutated via ablation-replace.mjs with trap restore and git diff HEAD empty after: (1) remove the CascadeBatchNarrowed throw, 2/10 red; (2) claim never matches an id set, 5/10 red; (3) bulk realtime event for the batch, 1/10 red; (4) cascade batch without multi, objectql rebuilt, guard batch-refusal case red (promise resolved true); restore leg dist preflight --absent ok, 4/4 green. Bench (my own runs, packages/qa/dogfood/bench/sql-perf/bench.mjs --scale 100000 --only cascade_delete_opportunity, 5 deletes, one opportunity with 10 line items): SQLite statements 155 (166 cold) to 57 (68 cold), p50/p95 131.2/169.7 ms to 66.4/115.2 and 76.1/148.5; PostgreSQL 16 private cluster statements 155 (166 cold) to 57 (68 cold), p50/p95 243.0/312.5 ms to 89.5/166.3 and 85.3/145.3. Milliseconds indicative (shared box), statement counts exact.", "gates": "dispatch-gates --commands derived 96 families at cb2cafef6: 94 exit 0; check:query-options-erasure first red (test surface 236 to 237 from as-any casts), casts removed, rerun exit 0; check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET = NOT MEASURED, left to CI; --ran reconciliation 96/96. Changeset/body gates at the final body: adr-0087-registration, changeset-no-major, closing-keyword-parity, empty-changeset, partof all exit 0. eslint over touched files exit 0. CI at head 89dff98f6: Test Core (3/8) failure, triaged as not this PR's: job 132828337437's only failure is @objectstack/mcp src/mcp-file-tools.test.ts, case 'read_file ... out of CPU budget on the worker', expected content text received none (line 950), a CPU-time-budget timing case; the file imports only vitest, node built-ins, @objectstack/spec/ai and mcp internals with a fake data bridge, zero delete/cascade references, and the diff reaches packages/mcp only through merged CHANGELOG/package.json; locally at 89dff98f6 under the lock mcp-file-tools.test.ts 47/47 passed. No fix pushed; head unchanged. Remaining check-runs in_progress or as GitHub reports them at report time.", "dogfood_battery": "89dff98f6 · closure build VERDICT 0 · pnpm --filter @objectstack/dogfood test VERDICT command-exit 0 · Test Files 467 passed, 3 skipped (470) · Tests 3959 passed, 42 skipped (4001) · no failures", "mcp_calls": "0", "api_writes": "2 — POST pulls via relay pr_create (PR #33887, draft); POST issues/33699/comments (this report via post-stamped). git push is not a REST write.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: ruling 6893104201 c1 follow-up (seat) · the walk's collect probe, re-probe and recycle-bin snapshot still read the same child rows (statements 22, 24, 25 of the capture); behaviour-neutral · noted, not filed", "carrier: #33782 · 'never more rows' (a predicate scope admitting a child the by-id gate refuses) is not detectable by the missing-id check; that direction is #33782's pin · noted, not filed" ], "deviations": [ "packages/plugins/plugin-auth/src/last-admin-guard.test.ts is outside the claim's objectql file surface; the dispatch's proof list orders the guard verdict test and objectql cannot import plugin-auth", "lint run over touched files only; repo-wide pnpm lint left to CI", "of objectql's downstream consumers only plugin-auth's suite ran locally; the rest declared to CI", "ablation 4 mutation-leg dist preflight read red while the file was mutated (tree check); the red test is the evidence, the restore-leg --absent preflight passed", "the bench result's commit stamp reads the branch commit on the 'before' run, which used base 1e65a389e objectql source built into the same tree", "the changeset Clause-② line was first written short and corrected to the claim's verbatim line before pr_create" ] }objectstack-fleet commentedon Nov 15, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh
os-dev-report
Fix round on #33887, reported 2026-11-15T18:30Z.
sys_organizationnewly refused 409dispatch.modefallbacksctx.resultPart of #33699, c1 stays openThe head stays red on 4 of 8 #33927 parity cases until #33928 merges, after which this branch merges main. Root cause: plugin-sharing
inferTargetId(sharing-plugin.tsline 1776) returnsoptions.where.ideven when it is the operator object{ $in: [...] }. The batch delete is then judged as a by-id write of the id[object Object]and refused 403FORBIDDEN. The same 4 cases are red with the read-door proof ablated.{ "issue": 33699, "status": "done", "branch": "claude/area-A4-33699", "pr": "https://github.com/objectstack-ai/objectstack/pull/33887", "head": "616735ceb8", "session": "session_01QsR2jUg7BKfRBcTPyMxbLh", "premise_still_valid": true, "summary": "Fix round for CONTRACT_REVIEW_TIER review 6896079092 (FAIL) and review-b 6896089195. M1: before a chunk of cascaded children is deleted in one batch, the walk now asks the caller's read door (find with id $in chunk, fields id, the walk's context) and deletes the chunk by id when any id is missing or the door refuses with a declared 4xx, so the batch never deletes a child the by-id path would refuse; a store fault propagates. S1: sys_organization is excluded from the batch (by id, 'record'). N1-N4 are TSDoc and changeset text only; the changeset FROM to TO now names ctx.result, and dispatch.mode is stated as the code sets it, 'per-row'. c1 is not done: the closing keyword is now 'Part of #33699' and the body says c1 stays open. The head is red on 4 of 8 #33927 parity cases until #33928 merges; after that this branch merges main. Root cause, measured: plugin-sharing sharing-plugin.ts inferTargetId (line 1776) returns options.where.id even when it is the operator object {$in: [...]}, so the batch delete of a private + owner_id child is judged as a by-id write of the id '[object Object]' and refused 403 FORBIDDEN ('You do not have access to change or delete this record'). The same 4 cases are red with the read-door proof ablated, so the M1 fix does not cause them.", "findings": { "M1": "fixed: the pin is red on the batch leg at 89dff98f (landed, hidden child deleted) and 403 on the by-id leg; at HEAD both legs give 403 PERMISSION_DENIED and nothing is deleted", "S1": "fixed: childName !== ORGANIZATION_OBJECT in batchable, pinned in objectql; no other predicate-only refusal of the same one-term shape (list in the PR update's Acceptance notes)", "N1": "fixed: dispatch.mode TSDoc names the four by-id cases, and that the before-hooks run before the set delete per chunk of 500 within one relation", "N2": "fixed: ctx.user/ctx.session identical, ctx.input/ctx.dispatch tell nothing apart", "N3": "fixed: changeset FROM to TO bullet for ctx.result (absent; read ctx.previous)", "N4": "fixed: engine-delete-and-aggregate.ts comment says the doomed read is the caller's WRITE scope; the read scope is proven by the walk", "c1": "not done, carried: Part of #33699, c1 stays open on the card" }, "tests": "plugin-security src/cascade-batch-read-scope.test.ts (new; real ObjectQL + SqlDriver + SecurityPlugin; batch leg and by-id leg with deleteMany hidden): 4/4 green. objectql src/engine-cascade-delete-batch.test.ts: 4 new cases, 14/14 green. Ablation 1 (read-door proof removed, via scripts/ablation-replace.mjs, anchor 1 to 0, blob e80908231 to 0c3d9ff28): plugin-security 1 failed / 3 passed (the [batch] case answers {kind:'landed'}), objectql 2 failed / 12 passed; restored, blob equals HEAD, git diff HEAD empty. Ablation 2 (organization exclusion removed): objectql 1 failed / 13 passed with organizationPredicateDeleteRefusal ('Organizations are deleted one at a time, by id'); restored, blob equals HEAD. No rebuild leg: plugin-security's vitest config aliases @objectstack/objectql to source. Suites at 7d2730a95 under the verify lock: objectql 599 files, 13255 passed, typecheck exit 0; plugin-security 270 files, 6705 passed, 45 skipped, 4 failed (the #33927 parity cases, carried by #33928), typecheck exit 0; plugin-auth 277 files, 5499 passed, 10 skipped, typecheck exit 0.", "gates": "dispatch-gates --commands derived 98 at 7d2730a95; 98 ran with exit 0 (96 in the sweep; check:type-check-debt 'OK, 0 raw tsc errors' and check:dual-build-cjs-loads '123 entry points load' under the lock). dispatch-gates --ran: '98 derived, 98 run, 0 NOT-MEASURED, 0 UNRUN', exit 0. dispatch-gates --tier exit 0. The two CI reds of 4029ca241: check-durability-degradation-log-level exit 0, and objectql typecheck exit 0 (TS2345, the walk's Pick lacked 'find'), fixed in bb5e34b56. pnpm lint exit 0 at eab93bab0. Body gates on the patched body: changeset-no-major, closing-keyword-parity, adr-0087-registration, empty-changeset, partof-closing-keyword all exit 0. CI check-runs at 616735ceb are not cited here: the report is delivered without waiting for CI; Test Core is expected red on the 4 parity cases until #33928.", "dogfood_battery": "tree of 616735ceb (its only commit after 7d2730a95 changes the changeset) · os-verify-lock: VERDICT command-exit 0 · Test Files 467 passed, 3 skipped (470) · Tests 3959 passed, 42 skipped (4001) · no failure", "bench": "packages/qa/dogfood/bench/sql-perf at 7d2730a95: statements 155 before, 58 after (57 to 58: one read-door read per chunk); SQLite 58 (69 cold), p50/p95 100.0/177.4 ms; PostgreSQL 16 (private cluster, fsync off) 58 (69 cold), 135.2/236.4 ms", "mcp_calls": "0", "api_writes": "2 by REST relay: PATCH /repos/objectstack-ai/objectstack/issues/33887 (PR body, fleet-write issue_patch, run 43746834553, read-back 19414 bytes identical); POST /repos/objectstack-ai/objectstack/issues/33699/comments (this report, post-stamped). git push (not REST): 4029ca241, bb5e34b56, eab93bab0, 7d2730a95, 616735ceb to claude/area-A4-33699, no force.", "files_changed": [ "packages/objectql/src/engine-cascade-planning.ts", "packages/objectql/src/engine-delete-and-aggregate.ts", "packages/objectql/src/engine-cascade-delete-batch.test.ts", "packages/plugins/plugin-security/src/cascade-batch-read-scope.test.ts (new, test-only)", "packages/spec/src/data/hook.zod.ts (TSDoc only)", ".changeset/33699-cascade-delete-batch.md" ], "deviations": [ "A plugin-sharing inferTargetId fix was committed locally and reset away on the PM's order; it was never pushed.", "pnpm lint ran at eab93bab0, not the final head. The sweep ran at 7d2730a95; the final head 616735ceb only changes the changeset, and the changeset and body gates ran again on it.", "origin/main moved 30 commits after the 7d2730a95 merge (now 63db7240a). I did not merge again, because the PM's land order has this branch merge main after #33928. dispatch-gates --ran says gate scripts are stale against origin/main.", "The verify lock queue timed out with exit 99 several times; I queued again with the same slot each time." ], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: #33928 (area S1, branch claude/area-A2-33928) · plugin-sharing inferTargetId (sharing-plugin.ts line 1776) reads where.id = {$in} as a by-id target '[object Object]', 403 FORBIDDEN on a nested predicate delete of a private + owner_id child; it is red on 4 of 8 #33927 parity cases at this head, and red with the read-door proof ablated · noted, not filed", "carrier: #33699 · c1 (collect probe, re-probe and recycle-bin snapshot read the same child rows) not done; the card stays open · noted, not filed", "carrier: none · the dogfood battery log shows 20 'Schema sync FAILED' lines for showcase_invoice: sqlite-wasm refuses 'alter table add column invoice_date date default (strftime(...))', 'Cannot add a column with non-constant default'. These are log lines, not a failed test. Not measured at a public door; noted, not filed" ] }Generated by Claude Code
test(plugin-security): security-parity pins for cascade delete across…
objectstack-fleet commentedon Nov 16, 2026
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh
os-dev-report
Fix round on #33887 (record 6899834361), reported 2026-11-16T06:12Z. Head
5ed247661, L2 delta PASS (6908865874). M1 closed by #34033 plus the main merge (parity 8/8), S1 and S2 fixed and pinned, N1 read. The replacement PR body is with the seat.{ "issue": 33699, "status": "done", "branch": "claude/area-A4-33699", "pr": "https://github.com/objectstack-ai/objectstack/pull/33887", "session": "session_01QsR2jUg7BKfRBcTPyMxbLh", "premise_still_valid": true, "head": "5ed2476610bd5cca57ca8a00412215da52354a77", "summary": "Fix round for record 6899834361 at 616735ce. Merged origin/main at 31eb2aed (128 commits, no conflict, remerge-diff empty, merge commit amended to carry the trailer pair; the PR's own changed lines are identical before and after). M1 closed by #34033 plus the merge: the 8 #33927 parity cases are green, and a one-off shape probe shows the 4 landed cases batched and the 4 refused cases refused at the by-id door. S1: two changeset FROM-TO rows (.changeset/33699-cascade-delete-batch.md lines 21-22) with the remedy, and pin (a) on both shapes (engine-cascade-delete-batch.test.ts line 199). S2: the batch takes only cascadeSet.members, and a non-member goes by id with its own recycle-bin entry (engine-cascade-planning.ts lines 1461-1462, docblock 1440); pinned in recycle-bin/capture.test.ts line 544. N1: no code; the r2/f_e parity cases are the narrowed fallback crossing the real chain, and they are green.", "tests": "At 5ed247661, under the verify lock (VERDICT command-exit 0): objectql 600 files / 13369 tests passed; objectql typecheck exit 0 (test layer 39 files / 233 errors held); plugin-security 272 files, 6724 passed, 45 skipped; plugin-sharing 75 files, 1581 passed; plugin-auth last-admin-guard 114 passed; parity file 8/8. S2 pin red before the fix ('expected [account/acc1] to deeply equal [account/acc1, note/n9]'), then green. Ablations via ablation-replace, each restored to the HEAD blob (daa43fc8a) with git diff HEAD empty: S2 term (members = chunk) red 1/43, and the batch off (if (false && ...)) turns pin (a) red ('expected 3 to be 1'). No rebuild leg: objectql tests import source, and plugin-security aliases objectql to source.", "gates": "dispatch-gates --commands at 5ed247661 derived 99: 80 non-spec all exit 0; 17 spec families all exit 0; spec check:generated 13/14 current, and its check:test-typecheck tsc died with no diagnostics while dogfood ran, with a re-run that hit lock queue-timeout 99: NOT MEASURED locally, read from CI (TypeScript Type Check success). check:type-check-debt and check:dual-build-cjs-loads: NOT MEASURED, CI's. eslint on the three touched files exit 0. CI on 5ed24766: 67 check-runs, 56 success, 11 skipped, 0 failed (Test Core 1-8/8, Lint & Repo Gates, TypeScript Type Check, Build Core, Governed Surface Queue Guard success).", "dogfood_battery": "5ed247661 · VERDICT command-exit 0 · Test Files 471 passed, 3 skipped (474) · Tests 3988 passed, 42 skipped (4030) · no failure", "mcp_calls": "0", "api_writes": "1 (this comment: POST issues/33699/comments via post-stamped.mjs); plus 2 git pushes (321a8668f; then 74ef4e4bc and 5ed247661 together); PR body not edited, replacement at scratchpad issue-33699/pr-body-next.md", "open_questions": [], "security_findings": "none", "out_of_scope_findings": ["carrier: none · noted, not filed: record 6908865874 N1 (hook.zod.ts dispatch.mode TSDoc lacks the fifth by-id case) and N2 (S2 pin has no by-id leg) kept as accepted nits per the coordinator, so the PASS head stands"] }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.