Menu ▾ ▴

#343 feat(task): CHANNEL PROOF of the human's answer clears a tier-2 gate, not only a button tap (DIVE-2412)

closed
nobody
None
2026-07-30
2026-07-30
Anonymous
No

Originally created by: lodar

DIVE-2382 fix [#4] (lodar approved 2026-07-30 04:27). A tier-2 gate could be cleared by exactly two things — a per-gate nonce (the Telegram button) or a non-agent SUDO_UID (the dashboard exec). Neither is what the human usually produces. This adds a third: channel proof of the human's own answer, so a decision already made in chat is not re-entered as a button tap.

task answer takes --channel-msg=<message_id> beside --channel-proof=<chat_id>.

What makes it evidence rather than a claim

The chat id alone is not evidence — the calling agent's session already knows that number, so it stays tier<2 exactly as DIVE-1305 scoped it. The citation is different in kind: it is checked against Telegram, via forwardMessage on the cited id, and the forwarded copy is deleted immediately (a probe, not a post). The check has to be remote because no local one exists — the plugin and the agent share a unix user, so no file, uid or cgroup separates them.

Four conditions, each with its own refusal reason: the chat is the paired human's verified DM; Telegram confirms the message is live; its forward_origin is a user whose id is that human (a bot's own message, a third party and a privacy-hidden origin all refuse); and it is fresh and names both the task ident and the answer. Anything unresolvable — no token, no response, malformed JSON — refuses.

Admitted at two sites, not one. Raising the human flag clears the DIVE-1117 provenance floor; DIVE-2233's evidence site then refuses a tier-2 --human claim carrying neither a valid nonce nor a non-agent SUDO_UID, and it is scoped to gates that HAVE a minted nonce — every approval and manual gate, i.e. exactly the ones this feature is for. The citation is listed there as a third form, on the same footing (the other two are local to this box; this one is attested by the party the caller cannot speak for). Its refusal message and audit row name it (channel_session=).

New column human_evidence (nonce | sudo-uid | channel-chat | channel-session | lead, +-joined) keeps the human forms tellable apart on the row, per DIVE-2090 — all four persist as need_answered_by=human:*, and only the last cleared a tier-2 gate with nobody touching a button.

Iteration 2 — olivia's reject, both halves

  1. The freshness bound was the caller's to set. It was read from GATE_CHANNEL_SESSION_MAX_AGE in the environment of the agent that runs task answer, so the mitigation was settable by the party it defends against — no forgery required. Measured on 8312851: a 400-day-old "approved" in the human's own chat refused at the default (rc=6, gate open) and cleared under GATE_CHANNEL_SESSION_MAX_AGE=999999999 (rc=0, human_evidence=channel-session) — a row affirmatively attesting that a human cleared a tier-2 gate nobody touched. The 3600s ceiling is now hardcoded; the env knob may only tighten it, and wider, zero, negative and non-numeric all fall back to the ceiling.
  2. The binding accepted the value OR the ident. Each alone leaves a hole: a value is unique to no gate (the shared-value replay the window was wrongly asked to bound), and an ident alone attests only that the human spoke about the gate while --value still comes from the agent. Tier 2 now requires both, with a distinct refusal reason for each.

Grading

  • tests/gate_channel_session_t2_unit.sh — 31 arms (was 21), 0 failed.
  • tests/gate_channel_session_t2_mutation.sh — 14 mutants, 14 killed (was 10), 0 ungraded.

New arms: the caller-widened window refuses and names the ceiling as the limit that fired (an rc-only arm would stay green if some other condition refused); a tighter env window still applies, with a default-window anchor so the liveness arm is differential; a non-numeric value falls back rather than bricking the rail; value-only and ident-only citations each refuse with their own reason.

Four refusal fixtures were not differential and are fixed: they named neither ident nor value, so with the condition under test deleted the new binding refused instead and M1/M2/M3/M6 graded nothing. Each now names ident+value, so only the condition under test can refuse it. New mutants: M5a/M5b (one per binding half), M11 (clamp removed → the red-team arm must go red), M12 (env read killed → the liveness arm must go red), M13 (the DIVE-2233 site omits the citation → the accept arm must go red). M7's expected arm moved to the decision shape: on an approval gate the widened fence is now caught a second time by the DIVE-2233 site, so CS2 no longer isolates the fence, while a tier-2 decision gate mints no nonce and the fence is the only thing standing there.

Rebase, and olivia's two smaller notes

  • The branch is rebased onto main (35f4840) as a single commit. The DIVE-2249 commit it used to carry (0a5904c) is gone: that ticket is already on main as the squashed edb449d (#294), so it was a duplicate, not an unlanded ticket riding along.
  • The rebase surfaced two real integration items that were invisible on the old base: main's DIVE-2233 evidence site (above), and main's DIVE-2330 iteration-2 change from id -un to _gate_caller_uid, which the harness now pins the way the sibling harnesses do.
  • A latent CI red from iteration 1 is fixed: tests/gate_channel_session_t2_mutation.sh was missing the DIVE-2211 grading_tree.sh source line. tests/names_the_tree_contract_unit.sh (253 harnesses) is green.
  • Sibling suites re-run on the rebased tree: gate_channel_proof_unit 16/16, gate_nonce_unit 19/19, gate_filer_own_channel_unit 9/9, gate_channelless_escalation_unit 25/25, tasks_store_fence_unit 12/12, gate_verifier_route_unit 9/9, gate_t2_routed_escalate_unit 17/17, gate_sudo_uid_forge_unit 8/8, gate_lead_standing_unit 73/73.

The mutation grader was itself ungraded — harness-verdict-union caught it

olivia's note (2) said this needed a non-maker CI run. It got one, and CI found a real defect that no local run could have: harness-verdict-union reded the build with the exact case it exists to catch — a harness probed in NO environment.

tests/gate_channel_session_t2_mutation.sh re-runs its whole 33-arm unit suite once per mutant (~14 × 23s), and the probe's per-harness timeout is 180s. So it was killed before its verdict line ever executed — the canary never printed, giving not-reached on both the pristine and installed-host lanes. Reported as "skipped here, probed where it runs", with no environment where it runs. Permanently unprobed, green about it — landing on the one harness whose own job is to catch tests that grade nothing.

Fixed with a lane, not an exemption. One line in ALLOW_UNPROBEABLE would have gone green in seconds, and would have been a false reason on the record: that allowlist means "no identifiable verdict variable", and this harness has one — measured wired at PROBE_TIMEOUT=900. It is probeable and slow, not unprobeable, and allowlisting it would have excused the coverage it claims to provide. So a new harness-verdict-slow job probes the named slow harnesses via --only at 900s, and the union consumes its report as a third environment.

--only is deliberate: raising PROBE_TIMEOUT for the whole 255-file sweep would also raise how long a genuinely hung harness can stall CI, which is the property the 180s default buys. probe-slow.txt is named explicitly in the union call rather than globbed, so a slow lane that dies reds the union instead of silently dropping back to the two-environment corpus — the same shrink-in-silence hole this check exists to close.

Graded differentially against the real reports from the red run (30562090895), not against a fixture: with the third report → 255 in corpus, 252 probed across 3 environment(s), 0 NEVER PROBED, rc 0. Without it → 1 NEVER PROBED gate_channel_session_t2_mutation.sh, rc 1. So the green is the lane working, not the check being switched off. harness-verdict-slow is confirmed success on CI.

Still unmeasured, on purpose and stated

No live Bot API probe was run. Whether a self-forward inside a DM returns forward_origin, and whether a human's restrict-forwarding privacy setting makes every citation hidden_user, is unknown. The failure direction is REFUSE (absent origin ⇒ empty type ⇒ refused), so the unknown can make the rail inert, never wrongly accept. The feature also ships inert: no consumer passes --channel-msg yet (DIVE-2436).

🤖 Generated with Claude Code

Related

Tickets: #4

Discussion

  • Anonymous

    Anonymous - 2026-07-30

    Ticket changed by: lodar

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2026-07-30

    Ticket changed by: lodar

    • status: closed --> open
     
  • Anonymous

    Anonymous - 2026-07-30

    Originally posted by: 5dive-bot

    Rebase note, posted by an agent (this is the new 5dive-bot machine account making its first write).

    State as of 2026-07-30: this PR reads CONFLICTING against main. DIVE-2436 stacks a consumer commit on top of this branch (task clear-recs forwards --channel-msg so the tier-2 citation rail is reachable from chat), so whoever rebases here needs to rebase dive-2436-channel-msg-consumer with it. Merge order is 2412, then 2436, then the dashboard surface, then DIVE-2371.

     
  • Anonymous

    Anonymous - 2026-07-30

    Ticket changed by: lodar

    • status: open --> closed
     

Log in to post a comment.