Skip to content

Deterministic paths

For: contributors changing the harness loop, notes or stall guard. After this page you know which code path fires on which trigger, what the model is shown, and which end-to-end scenario locks it.

Rule 3 and Rule 5 of AGENTS.md list the behaviour the harness decides without the model: it ends sessions, appends notes to observations and stops repeats. Each row below is one such path. Each one has a scripted end-to-end scenario, so a change to the path shows up as a failing test rather than as a benchmark that moved. Scripted scenarios need no model: the proxy plays the model and the assertions read what tether sent and recorded.

Some paths are locked by an older scenario that this table points to. A path whose scenario is marked xfail is a known product bug, linked to its issue in the test's reason.

path trigger what the model sees test
explore nudge 12 quiet steps (reads, lookups) with no change (AD-20) [NUDGE] No file changes in 12 steps. ... on the 12th tool output, rule tell:explore integration/test_paths_notes.py::test_explore_nudge_after_twelve_reads_with_bash (also integration/test_limits.py)
explore nudge, no edit tool same, with only mem on (#127) [NUDGE] 12 lookups and no answer yet. Call done ... integration/test_paths_notes.py::test_explore_nudge_without_bash_or_edit_asks_for_the_answer
green nudge first passing test run after a change (#177) [NUDGE] Tests pass after your last change. ..., rule tell:green integration/test_paths_notes.py::test_green_run_after_a_change_asks_for_done
failing test source a recognised test command fails (#173) [failing test source] with the failing test's body, at most 1,500 chars integration/test_paths_notes.py::test_failing_test_run_appends_the_failing_test_source
unchanged comment rewrite edit write changes only comments or spacing (#173) [NUDGE] m.py: only comments or spacing changed, the code is the same. integration/test_notes.py
unchanged identical rewrite edit write writes the same bytes (#173) [NUDGE] m.py unchanged: what you wrote is what was there. integration/test_paths_notes.py::test_identical_rewrite_is_named_as_unchanged
bash cd to a missing directory cd <missing> && cmd (#79) [cd skipped: no such directory; commands run in the workspace] then the output of cmd integration/test_paths_notes.py::test_bash_cd_to_a_missing_directory_runs_in_the_workspace
[REVERTED] unparsable .py a bash command leaves a workspace .py unparsable (F5) [REVERTED] line quoting the parser's line, old bytes restored integration/test_revert_quotes_line.py
[HINT] cannot import name cannot import name X from m, m.py in the workspace (AD-52) one [HINT] line naming where X is defined integration/test_import_hint.py
done with stdin done with stdin text (Rule 3) nothing (the session ends) integration/test_paths_finish.py::test_done_with_stdin_completes_with_that_text
bare done done with no answer and no stdin (#169) nothing; the result is Done. integration/test_paths_finish.py::test_bare_done_completes_with_done
verify gate fails a --verify gate exits non-zero after done (Rule 3) [VERIFICATION GATE FAILED: ...] ... Fix the reported issues before calling done again., event gate_fail integration/test_paths_finish.py::test_failing_gate_is_named_in_the_next_turn_and_sent_back
three gate failures 3 consecutive gate failures session FAILED, failure.kind gate integration/test_paths_finish.py::test_three_consecutive_gate_failures_fail_the_session
gate precheck and gate error an empty, unparsable or missing gate program, or exit 124/126/127 (#82) session FAILED as gate_error before any model call integration/test_lifecycle.py::test_broken_gate_fails_at_once_as_gate_error (also integration/test_gate_precheck.py)
finished by the harness, gates a change, every gate passes, then only repeats (#163) session COMPLETED, result Finished by the harness integration/test_paths_finish.py::test_stall_after_a_change_with_passing_gate_is_finished_by_the_harness
finished by the harness, implicit gate a change, the model's own green test run, then stalls (#177) session COMPLETED, result Finished by the harness integration/test_paths_finish.py::test_stall_after_a_green_test_run_is_finished_by_the_implicit_gate
prose reply plain text of 80+ characters with no act (#173) nudge event, then the next turn; not a completion integration/test_paths_finish.py::test_plain_reply_of_80_chars_gets_a_nudge_not_a_completion
never confirmed reply out of steps, the final-answer call gives no answer, last prose reply kept (#173) result has The model's last reply, never confirmed with \done`:and the reply |integration/test_paths_finish.py::test_out_of_steps_keeps_the_last_prose_reply_marked_unconfirmed`
done --ask done --ask with a question (#169) nothing; session WAITING_INPUT, exit 2, result is the question; send resumes integration/test_paths_finish.py::test_done_ask_pauses_with_the_question_and_send_resumes (also integration/test_lifecycle.py)
identical repeat the same command with the same input as the last one (AD-21) [LOOP]cmdran again ..., the command is not run; event loop_stall integration/test_paths_stuck.py::test_identical_repeat_is_skipped_and_named_as_a_loop
cycle a 2- to 4-command cycle with no change (AD-21) [LOOP] You keep repeating ... and nothing changes.; event cycle_stall integration/test_paths_stuck.py::test_two_command_cycle_is_named_as_a_cycle
read range 7 reads of one file in a row, no edit (AD-21) [LOOP] 7 reads ofa.txtin a row and no edit. integration/test_paths_stuck.py::test_seven_reads_of_one_file_in_a_row_are_named
wrap-up, re-reading 4 stall warnings, no change (#92) one [WRAP UP] You keep re-reading. ..., rule tell:wrapup integration/test_paths_stuck.py::test_four_warnings_without_a_change_wrap_up_as_a_re_read
wrap-up, repeating 4 stall warnings after a change (AD-56) one [WRAP UP] You keep repeating a command. ...; the next turn is sent without tools integration/test_paths_stuck.py::test_four_warnings_after_a_change_wrap_up_as_a_repeat (also integration/test_quirks.py)
final answer the steps run out without done (H1) a [FINAL ANSWER] user turn; the call has no tools (ollama); a command in its reply is not run integration/test_paths_stuck.py::test_out_of_steps_asks_for_a_final_answer_without_tools (also integration/test_final_answer.py)
restart and hand-back the same check fails 3 times with an edit between (AD-21) a restart turn; after 2 restarts, WAITING_INPUT with a [STUCK result integration/test_paths_stuck.py::test_third_failing_check_restarts_and_the_third_restart_hands_back (also integration/test_restart.py, integration/test_restart_to_best.py)
token budget --max-tokens is reached (Rule 3) [TOKEN BUDGET] used N of M tokens; session WAITING_INPUT integration/test_token_budget.py
monitor off no --monitor (AD-67) the usual notes; no monitor request is sent integration/test_monitor.py::test_no_monitor_sends_no_monitor_request
monitor note a stall or the explore nudge fires and the monitor answers note (AD-67) the stall's fact plus the monitor's line, or [CHECK] <note>; rule monitor:note integration/test_monitor.py::test_a_note_verdict_is_the_stall_advice
monitor continue same, continue (AD-67) the stall's fact only; the explore nudge is dropped integration/test_monitor.py::test_a_continue_verdict_keeps_the_fact_only
monitor escalate same, escalate (AD-67) nothing more; session WAITING_INPUT, result [MONITOR] <note> integration/test_monitor.py::test_an_escalate_verdict_hands_the_session_back
monitor reply unusable not one of the verdicts, or a provider error (AD-67) treated as continue integration/test_monitor.py::test_a_malformed_reply_fails_open_to_continue
skill posture a skill sets max_steps, context_tokens, fold_after, params, monitor, fold_rules (AD-65) the skill's budget and settings, unless the caller set them integration/test_skill_posture.py, integration/test_skill_monitor.py, integration/test_swe_skill.py
fold rule keep_live a fold_rules entry with keep_live: true matches the command (AD-66) the latest matching observation is whole while older ones fold by age; the control without the rule folds it integration/test_fold_rules.py::test_keep_live_keeps_the_big_read_whole_while_older_reads_fold
fold rule fold_after a fold_rules entry with fold_after: N matches the command (AD-66) the matching observation folds after N turns, while an equally old one without a rule stays whole integration/test_fold_rules.py::test_fold_after_folds_the_matched_read_one_turn_after_it_runs
bad fold rule an unknown key or a non-boolean flag in fold_rules (AD-66) session FAILED (exit 5, worker error) naming fold_rules; no model request integration/test_fold_rules.py::test_a_bad_fold_rule_fails_the_session_before_any_model_call

Adding a path

A new path needs a row here, a scripted scenario in integration/ that asserts on the recorded turns, and a line in the release notes. A notice gets a fixed [TAG] what happened. what to do form (AD-64) and a character cap, so this table stays the single list of what the model is told without asking it.