Skip to main content

Module loopcheck

Module loopcheck 

Source
Expand description

fno-agents loop-check verb (Task 1.1, ab-d0337fbc).

Single entry-point decision-maker for the target stop hook. Reads external state (manifest, transcript, git, gh, events, ledger) and returns a JSON decision object. The manifest is NEVER mutated; the only write surface is append-only event logs.

Module name starts with “loop” to match the LOC-ratchet glob crates/fno-agents/src/loop*.

Enums§

TerminationReason
Why the loop terminated. Serialized as the exact string enum the spec names.

Functions§

decide
Core decision logic. Returns (exit_code, json_output). Exit 0 always for allow/block; non-zero only for internal/CLI errors.
run_loop_check
Entry point called from bin/client.rs direct dispatch. Prints JSON to stdout, returns exit code.
run_loop_check_capture
Test-friendly variant that returns (exit_code, json_string) without printing. Used by integration tests in tests/loop_check.rs.