Repository navigation
fix(objectql): an organization delete removes its units of measure - #35930
Conversation
The organization delete's own cascade removes the organization's sys_unit rows, retired ones included, once the delete is admitted: the one exemption from the sys_unit delete refusal (ruling 7035627429, option B). The exemption is the engine's own cascade token, issued only by the removal and claimed by the delete it names, so every other unit delete is still refused 405 ERR_UNIT_DELETE_REFUSED, for a user, a system writer and an automation run, by id and batched, a hook's delete during the removal included. Units no longer count as records that keep an organization from being deleted. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
📓 Docs Drift CheckThis PR changes 3 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 34 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 76aa9bba50fd93a6c5a2654ebc7a5199203fa5eb && git checkout 76aa9bba50fd93a6c5a2654ebc7a5199203fa5eb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4609c48962b94289fe0ceeb7dd0076e2b02b0790 5ebea45947f3aa30f0c874a2f361345598f81f27 && git checkout -B drift-repro 4609c48962b94289fe0ceeb7dd0076e2b02b0790 && git merge --no-ff 5ebea45947f3aa30f0c874a2f361345598f81f27
node scripts/docs-audit/affected-docs.mjs --json 4609c48962b94289fe0ceeb7dd0076e2b02b0790
|
…tion in the unit comments Clause-② is `yes (widening)`, as the seat ruled: a delete that was refused is now admitted. The sys_unit object header and the default permission set comment now say the engine refuses a DIRECT unit delete in every context, and that the organization's own delete removes its units. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvMi1U7R2kBd3JbTPu
|
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu Contract-review-claim: session_01L9qibvMi1U7R2kBd3JbTPu · head 5ebea45 · 2026-11-20T19:30Z |
|
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu Contract review brief — PR #35930 @
|
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH L1: ACCEPT at
|
|
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu Contract reviewServed-tier:
Inputs read: card #35812 body and its five comments (ruling 7035627429, triage 7035666130, release pairing 7046995545, claim 7047043860, amendment 7048707723); PR #35930 body and its 11 files; the net diff against Check-runs on the head, read twice, the last at about 2026-11-20T19:50Z. None has failed. CI had not finished.
① Derived judgments
② Semver level
③ Boundary flagsSeat point 1 — unit deletes run with system authority. Accepted.
Seat point 2 — provenance a caller cannot forge. Holds.
Seat point 3 — atomicity. Holds for refusals; one declared degrade.
SQL push-down. Dev flags and open questions.
④ Design judgmentNo must-fix, no should-fix.
Nits, none affecting correctness or the contract:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu Landing #35930 at
State change: ready for review, then auto-merge. This is the PR the maintainer is holding the Version Packages release for (7046995545). |
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Fixes #35812
Requested by Tesla · project thread
Pushed by the c-35872 card thread on the seat's order (2026-11-20T19:26Z), because d7-D's one pushable branch carries #35903 awaiting Tier H. Built by d7-D's os-dev (local commit 065efab358 on f44758b); applied here with
git amonto main 4609c48 as ac14915 (samegit patch-id --stable442c55d28b), then one text round 5ebea45 (patch-id 9f40a93a20: the(widening)arm and the two comments). d7-D owns review and landing.维护者速读
DELETE_RESTRICTED(指向sys_unit)拒绝,而单位本身又一律不许删(405)。sys_unit删除拒绝的唯一例外,其他任何删单位的请求仍是 405。What changes
packages/objectql/src/engine-cascade-planning.ts,engine-delete-and-aggregate.ts,engine.ts(6853 lines, under the 6854 ceiling): once an organization's delete is admitted, its cascade removes everysys_unitrow of that organization, retired ones included, each through the engine's delete under a cascade token that only that removal issues and the named delete claims.packages/objectql/src/validation/unit-code-membership.ts: the unit delete refusal recognises that token and nothing else; every other unit delete is still 405ERR_UNIT_DELETE_REFUSED(user, system writer, automation run; by id and batched; a hook's delete during the removal included).organizationOwnedRowCountsand the engine's own refusal no longer count units as records that block the organization delete.packages/platform-objects/src/system/sys-unit.object.tsandpackages/plugins/plugin-security/src/objects/default-permission-sets.ts: comments only. Their "refuses in every context" lines now say a direct unit delete is refused and name the organization-delete exemption (claim amendment 7048707723, at the seat's ask)..changeset/35812-org-delete-removes-units.md: objectql patch, plus platform-objects and plugin-security patch for their shipped comment bytes.Why
Ruling 7035627429 (option B): an organization delete cascades its units. Tesla 2026-11-20T18:06Z keeps the release held until this merges.
Verification
dispatch-gates --ran: 76 derived, 76 run, 0 NOT-MEASURED, all exit 0;check-changeset-no-majorexit 0.scripts/ablation-replace.mjs, restored blob-equal): a1 exemption removed → org-delete pins fail (objectql 2, security 1); a2 any caller → objectql 8, security 9 fail; a3 every system ctx → objectql 5, security 6 fail; a4 claim-only, no provenance → exactly the forged-token pin fails.overlap-checkat ac14915: merges cleanly with origin/main and with fix(objectql)!: a multi-row insert reads a parent's formula fields over the roll-ups its rows move; fold follow-ups #35773 / fix(audit): a search the server widens never names a column the caller may not query #34817 (both shareengine.ts).Clause-②: yes (widening)
A refused delete is now admitted: deleting an organization that holds units and no other record succeeds and removes its units. An organization that owns any other record is still refused, and none of its units is removed.
Metadata-protocol: none
Acceptance notes
removeOrganizationAuthStructure. Dev recommends accept.sys_unitrow of that organization, retired ones included, each through the engine's delete under a cascade token that only that removal issues; units no longer count as records that block the delete, and every other delete of a unit, a hook's during that cascade included, is still refused 405ERR_UNIT_DELETE_REFUSED."sys-unit.object.ts,default-permission-sets.ts) are folded in at5ebea45947; nothing is left out of scope.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: n/a, not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz