Originally created by: lodar
_push_gate_check authorizes human:* or lead:*. But lead: is minted in exactly one place (cmd_task_answer) and only for approval|manual|access. So a --type=decision gate answered by its own designated routed_reviewer is stamped a bare main, push refuses it, and the refusal reads:
cleared by unauthorized provenance 'main' — delegated push requires a human or a lead-clear (its designated routed reviewer)
...when the designated routed reviewer is exactly who cleared it. Two allowlists written in two places are one contract; when the consumer refuses a state only the producer can mint, the error blames the actor. Same wrong-cause shape as DIVE-1970.
_push_gate_check reads only DB columns — it never consults id -un/$SUDO_UID. sudo -u claude 5dive push cannot move its verdict.routed_reviewer=main AND need_answered_by=main. Control from the same actor minutes earlier: DIVE-1956 is stamped lead:main.The real uid dependency was at ANSWER time — the opposite end of the pipeline from where it was assumed.
1. Push asks the predicate it actually needs — was this authorized by the party it was routed to — as ONE rule at the consumer: human:* OR lead:* OR (decision AND answered by this gate's own routed_reviewer).
Deliberately not widening decision into the lead-clearable set: DIVE-1243 keeping access out is evidence that set is CURATED, and the failure mode if wrong is leads clearing human-only things. Deliberately not forcing push-for-review to file as approval: DIVE-1959's gate offered "cherry-pick | re-file after [#16]", genuinely a choice and correctly a decision.
2. The new acceptance is corroborated, because gby == reviewer alone is caller-writable — task answer --from=<reviewer> writes need_answered_by verbatim. The claim is checked against the stored need_answered_uid (DIVE-756 stamps the real pre-sudo invoker; no flag sets it). Uid maps to a different agent, or to no agent → refused, and the message says which.
3. The more urgent half: _lead_clear authenticated on $(id -un) alone, so even on an approval gate a lead clearing via sudo/root silently lost the stamp. _gate_authenticated_actor resolves the kernel-enforced identity — real process user, or $SUDO_UID only at EUID 0 (DIVE-1413; below root it is a plain env var, which is why DIVE-950 dropped the forgeable --proof). It fails closed: the cost of a false empty is re-filing a gate, the cost of a false identity is a self-authorized push. Not resolvable from task_actor — that returns --from verbatim, which is the whole bug.
4. Every refusal names the stamp REQUIRED and the one FOUND, instead of sending the reader to audit a reviewer who did clear it.
5. LOUD at file time. The old refusal text documented --type=approval for push-for-review, so a filer with real options to offer could not follow the documented path — the tool advertised a route its own semantics punish. task need now warns at filing when an ask is push-for-review shaped AND decision AND unrouted, the one shape push cannot attribute to anybody. Narrow on purpose: the routed branch returns early, so reaching the warning IS unrouted, and a warning that fired on ordinary decisions would be wallpaper (DIVE-1955).
push_unit +7 = 63/0 — reviewer-cleared decision passes; the --from spoof where the uid maps elsewhere is refused naming the mismatch; uid resolving to nobody fails closed; a non-reviewer decision is refused naming what was required; an approval with bare reviewer provenance is still refused, so the carve-out stays decision-only.gate_ship_routing_unit +3 = 62/0 — unrouted eng-ship decision warns; the SAME ask routed does NOT; a non-eng-ship unrouted decision does NOT.build.sh green at v0.15.23.Not repairable by a DB edit: need_answered_by is inside the signed closure, so rewriting main to lead:main fails _gate_closure_verify.
🤖 Generated with Claude Code
Ticket changed by: lodar