Repository navigation
Description
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Filing gate: ③ a task the maintainer directed. On seat 7's decision card he ruled option B, verbatim: 「删组织时一并删单位」. The ruling's time is in this card's first comment. · Source: maintainer
维护者速读
- 问题:PR feat(units): unitConfig on a number field, and the write path checks the unit code #35805(Units of measure R1: a number field declares its unit (unitConfig) and the write path checks the unit code #35489)上线后,只要组织里有任何自定义单位,这个组织就永远删不掉。
- 原因:删组织前会检查组织名下还有没有数据(单位也算),而单位本身在任何场景下都不允许删除(ADR-0158 待决项 11:单位只能停用,不能删)。
- 你的裁决:删组织时一并删掉它的单位。这是单位不可删规则唯一的例外,其他任何场景照旧拒绝。
- 要你做的:无。
Why (business)
An organization delete is the platform's tenant-offboarding door. After #35805, any organization that ever created a unit is refused with DELETE_RESTRICTED, and the caller has no remedy: the units cannot be deleted first, because the engine refuses every sys_unit delete (405 ERR_UNIT_DELETE_REFUSED). The exemption is sound. Open item 11 forbids re-creating a code with another meaning inside an organization, which a deleted organization can never do.
What to build
- The organization delete's own cascade removes the organization's
sys_unitrows. This is the one exemption fromrefuseOrganizationUnitDelete(PR feat(units): unitConfig on a number field, and the write path checks the unit code #35805,packages/objectql/src/engine-delete-and-aggregate.ts). The engine's cascade claim carries the exemption, never a caller flag or a context bit, so no direct delete of a unit is admitted in any context. refuseOrganizationDeleteWhileOwned/organizationOwnedRowCounts(packages/objectql/src/engine-cascade-planning.ts) stop countingsys_unitas blocking ownership once the cascade removes it.- Pins: a real-stack cell where an organization with units and no other owned rows deletes, and its units are gone. A direct unit delete is still refused (405) under user, system and automation contexts, by id and batched, including a unit of an organization whose delete is in flight.
- ADR-0158 Open item 11 gains a note naming the exemption. This rides the ADR-0158 amendment PR that follows feat(units): unitConfig on a number field, and the write path checks the unit code #35805.
Order
Blocked-by: #35489
Waits on PR #35805, which ships the refusal (option C until this card lands).
Reader: the area:data seat 7, after #35805 lands. Domain set by triage.
Grading: area:data · Task · a maintainer-ruled follow-up of an in-flight build · evidence: os-dev report 7035276751 on #35489 (open question 1); code read on PR #35805's head 91a4947.
Suggested grade: p2 (tenant offboarding is refused, with no remedy, for every organization that created a unit).
Dedupe: repo:objectstack-ai/objectstack is:issue sys_unit organization delete gives 8 hits, all of them the units-of-measure cards and none about the organization delete.
Activity
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Ruling-ref: the maintainer, 2026-11-20T09:18Z, on seat 7's decision card, picked option B: 「删组织时一并删单位」 (the organization delete's own cascade is the one exemption from the sys_unit delete refusal; every other context still refuses). Relayed by seat 7 to the d7-D area thread · 2026-11-20T09:21Z
objectstack-fleet commentedon Nov 20, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server·pm:blocked(behind #35489 / PR #35805); rationale: area:data · Bug · Broken once PR #35805 lands (an organization that ever created a unit can no longer be deleted: the delete is restricted by its units, and units refuse every delete) · admins offboarding tenants, rare but with no remedy → p2 · size S. The maintainer ruled the fix, option B, verbatim: 「删组织时一并删单位」. Land it with or right after PR #35805, so no window ships where an organization cannot be deleted.docs(adr): ADR-0158 amendment states the organization-delete exemptio…
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c
Maintainer ruling · 2026-11-20T18:06Z · release pairing for this card
#35805 is on main and refuses every
sys_unitdelete. Until this card lands, an organization that holds a unit cannot be deleted. The seat asked whether the held release waits for this card. At 2026-11-20T18:06Z Tesla chose 「继续暂缓,先做 #35812」: the Version Packages release stays held until this card merges, and the card is dispatched now. That is an explicit exception to his p1-only dispatch word (2026-11-20T17:07Z); the grade stays p2. Seat 7 hands it to area d7-D (units).objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Claim: PM loop round 3 · card thread d7-D · 2026-11-20T18:08Z
Ordered by: seat 7, 2026-11-20T18:07Z: take this card now; the maintainer chose at 2026-11-20T18:06Z to keep the Version Packages release held until it merges (7046995545), an explicit exception to his p1-only word, grade stays p2
Area: d7-D
Session:
session_01L9qibvMi1U7R2kBd3JbTPuAccount:
os-teslaBranch:
claude/project-thread-dr6px1(the one branch this thread can push). It now carries the ADR-0158 amendment PR #35903, which is waiting for its Tier H approval, so this card is built in its own worktree now and pushed once #35903 has merged and the branch is restarted from main. If #35903 is still waiting when the build is done, the seat is asked for another pushing thread.Worktree:
objectstack-issue-35812Domain:
domain:serverSeat:
repo:objectstack#7File surface:
packages/objectql/src/—engine-delete-and-aggregate.ts(therefuseOrganizationUnitDeletecall),validation/unit-code-membership.ts(the refusal),engine-cascade-planning.tsandengine-delete-cascade.ts(the organization delete's cascade,refuseOrganizationDeleteWhileOwned,organizationOwnedRowCounts),engine.tswhere these are bound, their tests, a real-stack integration pin where an organization delete runs (its package's test dir), and root.changeset/. ⛔ Nodocs/adr/**(the ADR-0158 Open item 11 sentence is amended by a later PR), noui/**. Stop on breach and report.Container & model:
M,mode:subagent,model: default — no path-derived mandate (dispatch-gates --tier); contract (L2) review at CONTRACT_REVIEW_TIER, because this widens a refusal on a delete door,effort: high(seat 7's word, 2026-11-20T18:07Z)Clause-②: yes
Metadata-protocol: none
Responsibility:
introduced-by #35805 (the unconditional sys_unit delete refusal); the maintainer ruled option B before it merged and option C shipped in the meantimeThread-read: 7046995545
Premise: holds — on main at
f44758b21e,refuseOrganizationUnitDelete(object)is unconditional and runs first in the engine'sdelete()(engine-delete-and-aggregate.ts:176), and the organization delete's pre-check countssys_unitrows as blocking ownership, so an organization that holds a unit is refusedDELETE_RESTRICTEDwith no remedy.Serial constraints cleared:
Blocked-by: #35489— the code this card waits on is PR #35805, merged ase1143241de. #35489 stays open only for the ADR-0158 amendment PR #35903, which this card's code does not need.Scope-review: exempt — the route is ruled: option B, 「删组织时一并删单位」 (7035627429). The exemption is carried by the engine's own cascade claim, never by a caller flag or a context bit, so a direct unit delete stays refused in every context.
Pre-claim lane:
area:dataseat 7 (#35557)Pre-claim deps: #35805 merged
Prior rulings read: ADR-0158 Open item 11 note (2026-11-19, a deleted code stays retired) and its amendment on PR #35903; ruling B 7035627429; release hold 7046995545
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvMi1U7R2kBd3JbTPu
Claim amendment: claim 7047043860, the branch, the Clause-② arm and the file surface · 2026-11-20T19:29Z
Branch:
claude/project-thread-thptm0, PR #35930. The c-35872 thread pushes it for this card (seat 7, 2026-11-20T19:26Z), because this thread's own branch carries #35903, which is waiting for Tier H. d7-D keeps the reviews and the landing.Clause-②: yes (widening) — seat 7's ruling (2026-11-20T19:26Z): a delete that was refused is now admitted.
File surface (added):
packages/platform-objects/src/system/sys-unit.object.tsandpackages/plugins/plugin-security/src/objects/default-permission-sets.ts, comment text only (their "refuses in every context" lines now name the organization-delete exemption, seat 7 asked to fold them in);packages/plugins/plugin-security/src/default-permission-sets.unit-of-measure.integration.test.ts(the real-stack pin, the only real ObjectQL + SqlDriver harness with sys_unit and sys_organization);packages/objectql/src/federated-injected-column-readers.test.ts(the seam ledger row the new code owes).