task: the org lead's STANDING authority to clear ENGINEERING approval gates (DIVE-2099)#225
Conversation
|
Design question for the reviewer, flagged rather than silently decided: The ticket says "the org lead (main)". I implemented the holder of the authority as The consequence is broader than the literal wording: a gate filed by a marketing report resolves its lead to If "narrowly" should mean "main and only main", say so and I will add the narrowing. I did not want to pick between a brittle name check and a broader-than-stated grant on my own. |
92c8667 to
0555b30
Compare
|
Do not merge this before DIVE-2089 lands. Recording the constraint here because until now it existed only in ticket bodies, and whoever merges this will be looking at the PR, not at DIVE-2099's body. DIVE-2099's own design note 4: without 2089 merged first, engineering approval gates keep arriving pinned at tier-2, which is exactly where this ticket's new standing authority cannot reach them. Merged first, this ships inert — a landed diff that changes no runtime behaviour, which is the worst kind of green. Current state: DIVE-2089 is verified PASS by olivia (45/45, 4/4 load-bearing mutants red, 249 regression assertions green) but its branch is not pushed — the push is behind a tier-2 human approval that only lodar can clear, floored by the ticket's own title containing the word this ticket exists to stop floring on. Nothing mechanical enforces this ordering today. If you are about to merge and 2089 is still unlanded, stop. |
… gates (DIVE-2099)
lodar granted it 2026-07-26 ("agreed"); main filed rather than implemented it
because the requester is the beneficiary. The boundary is narrow, the predicate
fails closed, and the clear is audited distinctly from a human tap.
Before, the only lead-clear path (DIVE-1182/1243) required the gate to have been
ROUTED to the lead at filing time. An engineering approval that reached the human
WITHOUT routing was human-only forever — three of the 14 gates in lodar's inbox
that day were that shape.
_gate_lead_standing_eligible grants the same clearance with no routing, as a
CONJUNCTION: authenticated (kernel) caller IS the org lead, type is exactly
`approval`, tier is exactly 1, the text positively classifies as engineering, and
it trips neither the true-human T2 floor nor the ticket's explicit out-of-scope
list (customer boxes, our public/marketing surfaces, brand/strategic calls, fleet
privilege changes). Vocabulary can only REMOVE authority here; what grants it is
structural — the DIVE-2089 trap is a false NEGATIVE machine in this direction.
Audited distinctly: the persisted provenance is `lead:standing:<actor>`, keeping
the `lead:` prefix so every existing consumer is unchanged while the `standing:`
infix is a new additive fact that no human tap can wear. `need_answered_by` is
inside the DIVE-756 signed closure, so the marker is tamper-evident. The
authoritative audit row is emitted AFTER the write and reads the provenance back
out of the row — per DIVE-2090, a pre-check row is not an audit of the write.
Does NOT pierce the tier-2 floor: an engineering gate floored to 2 by DIVE-2089's
subject-matter misread stays human-only until 2089 fixes the floor itself.
tests/gate_lead_standing_unit.sh — 41 assertions, mostly boundary (non-lead
caller, --from spoof, non-engineering ask, empty ask, tier 2, legacy NULL tier,
the other four gate types, ten out-of-scope asks, an unresolvable org chart) with
in-scope and downstream-push arms for non-vacuity.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…D agent, not the org chart (DIVE-2099)
Iteration 2. olivia rejected iteration 1 for resolving the authority holder live at
clear time from `agents_org.reports_to`; lodar answered the tier-2 decision gate
`anchor-to-named-agent` on 2026-07-27 (the strictly more restrictive of the two
options offered).
WHY THE CHART CANNOT BE THE SOURCE: DIVE-2124 put `require_root` on `org set`/`org rm`,
but every agent on this host holds (ALL) NOPASSWD:ALL, so `sudo 5dive org set` stays
reachable and the column recording who wrote the row (`by_claimed`) is caller-supplied
and explicitly non-evidence (residual DIVE-2131). Deriving the authority from a table
the beneficiary can rewrite is a self-grant path on the very authority being granted:
rewrite the chart to become somebody's lead, then clear their gate as their lead.
THE ANCHOR: `authority.eng_approval_lead` in the constitution, trusted ONLY while the
on-disk file still matches the digest sealed into the council lineage — the DIVE-1695
precedent already load-bearing for the tier-2 hard-gate floor. An agent CAN sudo a new
name in; the moment it does, the live sha256 stops matching the sealed one,
`_council_constitution_drifted` says DRIFTED, and the resolver denies EVERYONE including
the name that was there before. Re-sealing is a constitutional-class motion (2/3 + full
quorum + founder veto), which no agent convenes against itself. The write is not
prevented — it is made self-defeating and tamper-evident, which is the property
`require_root` alone does not have on a NOPASSWD:ALL host.
`_gate_standing_lead` fails closed at every unknown: no council loader in scope, no
sealed digest (a bare constitution.yaml is as writable as the chart was), drift, a
missing file, no key, an empty value, or a value that is not a plain agent name -> no
authority for anyone. Absence of a name is never "everyone" and never a fallback.
The field is a first-class part of the constitution schema, not a squatted key: the
normalizer validates it (unknown sub-keys and non-name values are hard errors, so an
invalid grant is refused at amend time rather than silently ignored at enforcement
time), `constitution set --json` still refuses it as a governance key (it goes through
`council amend`), and `renderConstitutionV0` seeds it EMPTY with the reasoning inline.
Without registering it, `unknownTop` would have made any constitution carrying it
INVALID, which fails closed to shipped defaults — the feature would have been
unreachable and it would have taken the hard-gate floor down with it.
The org chart is still read for ROUTING, unchanged, and the resolved filer is still in
the audit row — but neither is an input to AUTHORITY any more. The audit row now carries
`authority_source=` and `standing_lead=` so an anchored clear is distinguishable from
the iteration-1 chart-derived one without diffing the binary. Design note 3
(`lead:standing:<actor>` inside the DIVE-756 signed closure) is unchanged; olivia ACKed
it as sound.
TESTS — tests/gate_lead_standing_unit.sh, 73 assertions (was 54). The harness now sources
cmd_council.sh in production order and writes a REAL sealed constitution, so the arms
exercise the actual `_council_*` chain rather than stubs:
· S11 is the test olivia required and all 54 prior assertions could not have caught,
because every one of them treated the chart as trusted ground truth: mutate the chart
AFTER filing so the attacker becomes the filer's lead, assert the clear is REFUSED and
mints no provenance and no audit row.
· S12 is its non-vacuity partner — the constitution-named agent clears while ABSENT from
the chart entirely, so "the chart is ignored" is proven in both directions.
· S13 drift denies the injected name AND revokes the legitimate holder.
· S14 an unsealed file grants nobody; re-sealing the SAME bytes restores it, so the seal
is demonstrably the variable under test.
· S15 absent/empty/non-name/misplaced values all deny, with a non-vacuity arm.
S8 INVERTS deliberately: an unresolvable chart used to deny, and now cannot, because the
chart is not an input. Asserting the old outcome would have quietly re-coupled the two.
Rebased off 92c8667 (was 31 behind) and the bundled 5dive + 5dive.sha256 are rebuilt
against the tip, both per olivia's non-blocking notes. No version bump: assignment is at
merge, by merge order.
Green: gate_lead_standing_unit 73/0, council_constitution_unit 41/0, council_engine_unit
195/0, council_cli_contract 64/0, constitution_gate_floor 19/0, constitution_init_e2e
23/0, constitution_set_e2e 20/0, constitution_set_json_e2e 33/0, constitution_show_e2e
29/0, constitution_legacy_migration 13/0, council_amend_e2e 17/0, push_unit 65/0,
gate_ship_routing 62/0, gate_precedent 69/0 and the rest of the gate_* suites.
gate_verifier_route_unit exits 5 on clean origin/main too (checked via git archive) —
pre-existing, not this change.
SEQUENCING UNCHANGED: DIVE-2089 is still todo. Until the tier floor stops reading subject
matter as risk, engineering gates keep arriving pinned at tier-2 where this authority does
not reach, so this ships INERT if it goes first. Land 2089 before this merges.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0555b30 to
fa4f24a
Compare
Rebased for merge —
|
What
lodar granted the org lead standing authority to clear ENGINEERING approval gates on 2026-07-26. main filed DIVE-2099 rather than implementing it, because the requester is the beneficiary — so the boundary here is deliberately narrow, the predicate fails closed, and the clear is audited distinctly from a human tap.
Before: the only lead-clear path (DIVE-1182/1243) required the gate to have been ROUTED to the lead at filing time (
routed_reviewer == the authenticated caller). An engineering approval that reached the human WITHOUT routing — pref off, filer-is-lead, a re-route that NULLed the reviewer, a pre-routing row — was human-only forever, even though its whole content was a judgement the lead can make. Three of the 14 gates in lodar's inbox that day were that shape.After:
_gate_lead_standing_eligiblegrants the same clearance with no routing required, as a conjunction — every guard must hold:_gate_authenticated_actor, never--from(DIVE-2004)_gate_route_reviewer(filer)approvalDesign note 1 on the ticket warns against "another keyword match", because in this direction a false negative means the lead self-clears something that should have gone to the human. So vocabulary is never sufficient here — it can only ever REMOVE authority. What GRANTS it is structural (identity, type, tier).
Audited distinctly (design note 3)
Persisted provenance is
lead:standing:<actor>. Thelead:prefix is kept deliberately so every existing consumer is unchanged (cmd_push's delegated-push predicate, the digest's human-touch count, the proof ledger); thestanding:infix is the new additive fact, and no human tap can ever wear it.need_answered_byis inside the DIVE-756 signed closure, so a raw DB edit that downgrades the marker failsgate-proof verify.The authoritative audit row is emitted after the write and reads
need_answered_byback out of the row — per DIVE-2090 (cited on the ticket), a pre-check row is not an audit of the write; the two diverge in both directions.Sequencing with DIVE-2089
The ticket warns this "lands inert" without 2089. Precisely: it is not inert for unrouted tier-1 engineering approvals (the three misrouted gates it measured), and it is inert for engineering gates the floor pinned at tier 2 — deliberately, because piercing the floor is 2089's job, not this one's.
Tests
tests/gate_lead_standing_unit.sh— 54 assertions, mostly boundary. Non-lead caller, a spoofed--from, a non-engineering ask, an empty ask, tier 2, a legacy NULL tier, the other four gate types, ten out-of-scope asks, a stale tier-1 row with floor text, an unresolvable org chart, an unidentified caller. In-scope and downstream-push arms carry non-vacuity, so a predicate that always denied would fail too.Mutation-graded against the committed tree — 9 mutations, all caught:
lead:instead oflead:standing:The "bare coordinator" mutation is a defect this change actually had mid-review: our org chart has no literal
role='coordinator', so_task_resolve_coordinatorreturns the single root — olivia, the CEO — while every builder's actual lead is main. Resolving the lead that way would have granted this authority to the wrong agent and withheld it from the one lodar named.S11rebuilds the production chart shape and pins both directions.Siblings re-run green:
gate_ship_routing_unit,gate_t2_routed_escalate_unit,gate_approval_routing_unit,push_unit,audit_task_store_{fence,classification}_unit.Known residual
The eng-ship classifier is broad (
\bpr\b,ci\b,\bdiff\b). A tier-1 approval that merely mentions those and is really a business call would classify as engineering; the T2 floor plus the out-of-scope denylist are what stop it, andpublic relations|pr (agency|firm|retainer)was added to the denylist for the most plausible false positive. Worth a second pair of eyes on the regex breadth.No version bump — per the 0.16.20 changelog entry, the version is assigned at merge, by merge order.
DIVE-2099. Reviewer: Marcus / agent-main, who is also the beneficiary of the grant — flagging that explicitly rather than leaving it to trust, which is the same reason main filed instead of implementing.
🤖 Generated with Claude Code