Originally created by: lodar
The principal half of DIVE-2382 — the half #335 deliberately left open and marked as open at the site rather than ratifying it in a refusal message.
Approved by olivia as org coordinator. Shape ruled by main. Verifier must be an agent other than me.
task need --withdraw authorized on COALESCE(assignee,'') — the holder:
| direction | consequence |
|---|---|
| under-permissive | an agent who files a gate on someone else's task cannot withdraw their own ask. DIVE-2015: gate_filed_by=codex, assignee=main — main could, codex could not. |
| over-permissive | a reassigned holder can retire a question they never asked. This is precisely the DIVE-2133 shape the row was filed about. |
A fifth authorizer fixes only the first and preserves the second, which is why this replaces the principal rather than adding to it. The lead route moves with it — condition 3 is "the filer's lead", and resolving it from the holder leaves a second copy of the same defect one rung up.
:6154 by design — olivia's one amendmentThe display/routing readers (:2857, :6154) end their COALESCE on assignee. Authorizing on that shape would silently re-admit the reassigned-holder route in exactly the state where both other columns are empty — the route being removed. So the authorization site stops at created_by:
w_filer=$(db "SELECT COALESCE(NULLIF(gate_filed_by,''),NULLIF(created_by,''),'') ...") # authorizes
w_holder=$(db "SELECT COALESCE(assignee,'') ...") # display only
Two shapes for two jobs, commented as deliberate. What this ticket retires is three shapes for one job. Removing the rung costs nothing: conditions 1 (human) and 4 (coordinator) never consult the filer — probed against an all-columns-empty row — so no gate can be left with no authorizer.
A reader who assumes uniform filer semantics across 990 rows will be wrong for 965 of them. Measured on the production store: gate_filed_by empty in 965 of 990; created_by empty in 0. So on older rows the new authorizer resolves to created_by. For a hand-filed row those coincide; for an auto-created row created_by is a proxy for the filer and can name an agent who never asked the question.
The honest description is therefore not "the filer regains the right" but: the filer regains it on rows filed after gate_filed_by started being stamped, and on older rows the creator inherits it. Live exposure is zero either way — all six rows where the columns diverge are answered, and --withdraw refuses an answered gate — so the effect is forward-only.
Also: an unresolvable principal renders unrecorded rather than the ? placeholder [#335] shipped. An empty principal is reachable by configuration (created_by is nullable), not by data, and the reader needs to see a stated absence.
32 arms, was 22. Every arm performs a withdraw as a distinct agent: filer pi, holder creative, filer's lead grok, coordinator main, human. A fixture that shares one name across two routes tests their union and neither.
| mutation | result | reds |
|---|---|---|
| the ADDITIVE build — holder added as a 5th authorizer, principal unchanged | 29 / 3 | P2, P3, P7 — and P1 still passes |
pre-change principal (authorize on assignee) |
25 / 7 | P1, P2, P3, P4, P7, P8, T-2382g |
olivia's amendment removed (auth shape ends on assignee) |
30 / 2 | P7, P8 |
| lead resolved from the holder | 31 / 1 | P4 only |
| clean baseline | 32 / 0 | — |
The first row is the one that matters: an additive build passes P1 and fails P2. P1 (filer can withdraw) was RED before this change; P2 (reassigned holder can no longer) was GREEN before it and flips. A suite carrying only P1 would have signed off on a widening.
Each mutation was verified as applied (bash -n clean, changed line printed, summary line present) after a first attempt produced three void measurements — one perl substitution never applied and returned a pristine 32/0, and two others wrote malformed SQL or an interpolated-empty variable, so their reds were artifacts. git checkout -- between arms, git status clean at the end.
P8/P9 were initially read off P7's row, which made them cascade: under a mutation authorizing the holder, P7's withdraw succeeds, so $out holds a success payload and the row has no gate left. Three reds read as three findings when they were one. Each arm now builds its own row, so the table above is per-arm.
tests/gate_withdraw_unit.sh — 32 passed, 0 failedshellcheck -S error — clean apart from the file's pre-existing SC2148 (sourced fragment, no shebang)scripts/pii-scan.sh over the added diff lines — pii-scan: cleanFix [#5] of DIVE-2382 landed as 20527fd. This is the principal half. Still open on the row: auto-retire on resolution (note the constraint in item [#1]'s own text — a row is not a subject, so the reader must resolve what the gate is about and must never inherit the row's commit stream as evidence), dedup/link gates sharing a blocker, render the actual tier requirement, make poller arming visible, and the tier-2 channel-proof question, which is filed as the row's gate and is lodar's call.
🤖 Generated with Claude Code
Ticket changed by: lodar