Repository navigation
fix(objectql): insert and delete open their after-abort unit inside the middleware chain, as update does - #35386
Conversation
…he middleware chain Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…rialise writers behind the gate on SQLite Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
… body Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…any's this.insert The delete control matched no call site once delete stopped re-entering itself. Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…it-inside-middleware
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7dc027acd3cdf310c971678266c8f4e34da97ec7 && git checkout 7dc027acd3cdf310c971678266c8f4e34da97ec7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6d833b50fbb64ae3f0c83607cfdcaaefd260db77 30f5259bc6e7fa7657838f5d7cff85e7b5996f19 && git checkout -B drift-repro 6d833b50fbb64ae3f0c83607cfdcaaefd260db77 && git merge --no-ff 30f5259bc6e7fa7657838f5d7cff85e7b5996f19
node scripts/docs-audit/affected-docs.mjs --json 6d833b50fbb64ae3f0c83607cfdcaaefd260db77
|
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Seat judgment: Test Core (7/10) on 155c9e5 is a slow-runner timeout, not this PR. Re-running the failed jobs once (2026-11-19T08:16Z)
|
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Test Core (7/10): the re-run failed again. Measured: not this PR (2026-11-19T09:04Z) The re-run (attempt 2) timed out on the same file,
The case reaches 4.5–4.7 s without this change whenever the shard is loaded. The fix belongs to the test's time budget, not to this diff. Follow-up card: see the next comment on #35167. No timeout is raised in this PR and no test is skipped. |
Brings in the posture-test split (#35452) so this PR's Test Core shard can go green. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a: ACCEPT · head Scope of this record. The relay asked for a merge-only delta over an earlier verdict on Merge delta. Code (9 files, +408/−36).
Pins.
Ablation per verb, with the engine file restored from base: 2 failed / 2 passed, the hooked cells "still waiting", and the controls green throughout. objectql 13878 tests pass. Declaration: agreed. Routing. Not governed ( |
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Landing · area data-1 · 2026-11-19T11:19Z
State: draft → ready + auto-merge (merge queue). #35167 closes on merge via |
Fixes #35167
Clause-②: no
Metadata-protocol: none
维护者速读
席位核对
What changes
insert(packages/objectql/src/engine-insert.ts) anddelete(packages/objectql/src/engine-delete-and-aggregate.ts) no longer re-enter their own door insideinAfterAbortUnit. Each computesopensAfterAbortUnitonce at the door and wraps only the executor it handsexecuteWithMiddleware(inOwnUnit), the shapeengine-update.tshas used since fix(objectql): the loser of a concurrent update answers 409 again on an object with a metadata beforeUpdate hook #35165. The middleware chain (the authorization gate's reads, and any post-next()work) runs outside the unit; thebefore*hooks'ctx.apiwrites, the row and theafter*chain run inside it. Nothing between the door and the executor writes (insert: normalisation andopCtx; delete: option folding,withResolvedWhere, and the in-memory cascade claim).'insert'/'delete'members leave the two facets'thisPicks.engine-hook-dispatch.ts(inAfterAbortUnitdocblock),engine-top-level.ts(the four paths that open a unit around theafter*dispatch),engine-middleware-and-context.ts(claimReferentialCascadeDelete: nodelete()re-enters itself).scripts/measure-durability-swallow-family.mjs: the resolution control pinned on the delete door'sthis.delete(...)re-entry matched no call site once that re-entry was gone (check:swallow-census-controlsred, "A control that matches nothing passes VACUOUSLY"). It is re-pointed at the same facet-stub shape oninsertMany'sthis.insert(...)inInsertFacet. This file is outside the claim's file surface; see Acceptance notes.@objectstack/objectqlpatch.Not changed: the delete loser's
falsevsRECORD_NOT_FOUNDanswer and what fires on a driverfalse(the follow-up card that lands after this PR);after*stays inside the write's unit (#7477).Tests
Two new files in
packages/plugins/plugin-security/src/(shape ofownership-claim-race-sqlite.test.ts:ObjectQL+SqlDriveron better-sqlite3:memory:+SecurityPlugin; that package's vitest config aliases@objectstack/objectqland@objectstack/driver-sqlto source):insert-unit-inside-middleware-sqlite.test.ts,delete-unit-inside-middleware-sqlite.test.ts. Cells per verb: no metadata hook, a metadatabefore*hook, only a blockingafter*hook. A test middleware parks user A's write after the security gate and beforenext(); user B's write on another row must settle within 2 s while A is parked. Control per verb: a throwingafter*hook (asserted by identity) leaves no inserted row / leaves the deleted row stored.Ablation, per verb (fix committed first; mutation = the file restored from base 24cc61f, then `git checkout HEAD --` and hash match)
engine-insert.tsat base (door re-entry count 1,inOwnUnit0):Tests 2 failed | 2 passed (4); both hooked cellsExpected: "fulfilled" Received: "still waiting"; no-hook cell and control green. Restored: hash match,git diff HEADempty.engine-delete-and-aggregate.tsat base:Tests 2 failed | 2 passed (4), same two cells red with the same reading; restored, hash match.scripts/ablation-replace.mjs(resolvesIn: 'InsertFacet'to'UpdateFacet', anchor x1 to x0): self-test red,resolution control moved: … expected UpdateFacet, got InsertFacet@307, InsertFacet@1760; restored, hash match.Suites (final head 155c9e5, after merging origin/main)
pnpm --filter @objectstack/objectql typecheckthentest:Test Files 614 passed (614),Tests 13878 passed (13878).ownership-claim-race-sqlite.test.ts:Test Files 3 passed (3),Tests 15 passed (15).@objectstack/plugin-securitytypecheck exit 0 andtest:Test Files 281 passed (281),Tests 6993 passed | 45 skipped.Acceptance notes
scripts/measure-durability-swallow-family.mjs. Necessary because the change made its control vacuous; the re-point keeps the same resolution shape live rather than deleting the control.engine-transactions-section.ts:161,hook-wrappers.ts:533andunit-detach.ts:21call it "the door's own unit". They name the write's own unit and say nothing about where it opens, so they stay true.next()on a hooked object no longer rolls the insert or delete back. That already held forupdateand for every unhooked object; the changeset says so.Verification
Local gates
node scripts/pm/dispatch-gates.mjs --commands(94 families after the script edit), all run with exit codes captured before any pipe;--ran:94 derived famil(ies) accounted for — 93 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).node scripts/check-plugin-teardown-shape.mjs --self-testexit 3 (fixture pinned to a commit this clone cannot reach even after--deepen=3000; checker-health only, untouched script).check:dual-build-cjs-loads,check:i18n,check:type-check-debt(run under the verify lock).check:swallow-census-controlsexit 1 at first (the vacuous control above), exit 0 after the re-point.check:swallow-census-controls,check:nul-bytes,check:type-check-coverage,check:test-source-alias,check:cross-package-test-inputs,check-empty-changeset,check-adr-0087-registration,check:issue-citations: all exit 0.overlap-check --branch=HEAD:VERDICT clean exit 0(origin/main and fix(audit): a search the server widens never names a column the caller may not query #34817 merge cleanly).test:repoand the rest of the farm are left to CI.Generated by Claude Code