Skip to main content

default_finish_gate

Function default_finish_gate 

Source
pub fn default_finish_gate(ctx: VerifyGateContext) -> FinishGate
Expand description

Build the default verify-before-finish gate: scans the SAME loop’s own transcript for both the trigger and the verification.

Why: This is the shape a delegated engineer’s sub-agent loop needs — its own bash calls land directly in its own Transcript, so no external state is required. What: Returns a FinishGate closure that is inert unless [seed_text] of the transcript names_test_command and [transcript_ran_test_command] finds no match. Past that (#8206) it rejects ONLY when the agent’s registry carries bash AND detect_test_command finds a runnable suite for ctx’s project root; otherwise it accepts the finish with an [unverified_finish_note], because no refusal the agent could act on exists. Test: tests::default_gate_trips_when_named_and_unrun, tests::default_gate_inert_when_not_named, tests::default_gate_satisfied_when_run, tests::default_gate_accepts_without_bash_tool, tests::default_gate_accepts_on_empty_project_root, agent_loop::tests::finish_gate_trips_and_recovers.