Loading...
Loading...
Deterministic guardrailed agent-loop driver — wrap any step with propose → deterministic-verify → (critique → revise) and enforce hard termination guards (max_iter, wall-clock budget, no-progress via state-hash, escalate-to-human). The control loop + guards + progress detection are deterministic; the LLM critique/revise step is the one quarantined adapter. Trigger when an agent fix-loop must not spin forever and must not be able to argue its way around a failing test.
npx skill4agent add rheinmir/setup loop-runnerdisable-model-invocation: truePROPOSE (workspace state) → VERIFY (shell exit code) → GUARDS (max_iter · budget_seconds · no_progress_k · escalate_after_iter) → REFLEXION (lesson line) → CRITIQUE → REVISE (quarantined adapter) → repeatharness/scripts/loop-runner.pyverified: falseharness/loop-runner.config.yaml| Field | Required? | Ý nghĩa | |
|---|---|---|---|
| In | | có | shell cmd; exit 0 = pass |
| In | | không | guard defaults ( |
| In | | không | shell cmd or real LLM-revise adapter; default no-op stub |
| In | | không | glob for state-hash; without it |
| In | | không | run-log path |
| Out | Run-log JSON | có | iterations, verdicts, termination reason at |
| Out | Episodic lessons | on failure | appended to |
| Out | exit code | có | 0 SUCCESS · 2 MAX_ITER · 3 TIMEOUT · 4 NO_PROGRESS · 5 ESCALATE |
verified: falsemax_iterbudget_secondsescalate_after_iter| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | deterministic | — | | green | red → fix runner first, stop |
| W02 | deterministic | workspace | PROPOSE — current workspace state | state | → W03 |
| W03 | deterministic | | VERIFY — run shell cmd | exit 0 → SUCCESS | non-zero → W04 |
| W04 | deterministic | counters, state-hash, clock | GUARDS — max_iter, budget_seconds, no_progress_k, escalate_after_iter | continue or terminal code 2/3/4/5 | terminal → write run-log, stop |
| W05 | effect | verdict | REFLEXION — append one lesson line to episodic page | lesson | → W06 |
| W06 | judgment | failure output | CRITIQUE → REVISE via quarantined adapter (LLM, stub or shell cmd) | new workspace state | → W02 |
# self-test — 5 deterministic guard scenarios, no LLM, no deps
python3 harness/scripts/loop-runner.py selftest
# real loop around a verify command (config supplies the guard defaults)
python3 harness/scripts/loop-runner.py run \
--config harness/loop-runner.config.yaml \
--verify "pytest -q" \
--revise "<shell cmd, or the real LLM-revise adapter>" \
--state "src/**" --log harness/out/loop-runner-run.jsonmax_iterbudget_secondsno_progress_kstate_pathsescalate_after_iterrun_log.pathreflexion.episodic_memory_page## Origin| ID | Kind | Guard | Hành vi | Skip / failure | Rejoin |
|---|---|---|---|---|---|
| B01 | capability_optional | | enable | absent → guard off | W04 |
| B02 | user_optional | | enforce wall-clock budget / human escalation | 0 → off ( | W04 |
| B03 | capability_optional | real LLM-revise adapter wired | W06 uses the LLM; | not wired → no-op / shell stub | W02 |
max_iterrun --verify "pytest -q" --state "src/**"src/**no_progress_k=2