Evidence-Based Agent Loops: Inside aiFetchly /goal and /loop
The Mirage of Self-Declared Agent Success
A persistent flaw in autonomous agent development is the “premature victory” problem. When conversational models execute multi-turn workflows—refactoring code, migrating schemas, or running scraper pipelines—they frequently hallucinate task completion. The assistant asserts: “I have successfully fixed the bug and verified all tests,” when in reality the script crashed silently or left edge cases unhandled.
Prompt-only loops lack ground-truth verification. When autonomous agents operate without deterministic stopping criteria, they either loop indefinitely, burn tokens, or claim victory based on their own unverified assumptions.
AI Fetchly solves this architectural challenge in AI Chat V2 through its paired commands: /goal and /loop. By decoupling task execution from verification, aiFetchly enforces an evidence-based contract where completion requires fresh, checkable proof.
How /goal Establishes Verifiable Objectives
Typing /goal <objective> in the AI Chat composer shifts the assistant into Plan Mode. Rather than executing speculative tools immediately, the assistant decomposes the goal into explicit, testable Acceptance Criteria.
Crucially, each acceptance criterion must bind to one of four concrete verification engines:
| Verification Method | Validation Mechanism | Typical Production Use Case |
|---|---|---|
command | Shell command exits with status code 0 or matches a stdout pattern | npm test, pytest, linter passes |
file | File existence, size threshold, or content hash mutation | Output CSV generated, migration file created |
manual | Loop pauses and explicitly requests developer review | Visual UI verification, credential entry |
llm | Independent verifier evaluates gathered evidence | Complex semantic evaluation, tone review |
An objective is never complete simply because the generative model declares it. The system marks a goal complete only when every required criterion passes with newly gathered evidence generated after the latest action.
The Bounded Autonomy Cycle: /loop
Once a goal is established, developers invoke autonomous iterations via /loop <maxIterations> (bounded between 1 and 10 turns).
Every cycle follows a strict, four-stage state machine:
- Observe: Inspect current workspace state, Git diffs, and previous execution traces.
- Act: Propose and execute a single bounded tool call (e.g., modifying a file or running a build).
- Verify: Collect fresh artifacts. Run deterministic checks (
command,file) first, followed by independent verifiers. - Evaluate: Determine if all required criteria pass. If satisfied, the loop terminates with a success audit ledger. If unfulfilled, the loop advances to the next turn or pauses for human input.
Fail-Safe Stopping Conditions
aiFetchly guarantees that goal loops never run unchecked. A loop halts immediately if:
- Maximum iteration count or time limit is reached.
- The user clicks the native Stop button.
- Consecutive repeated errors flag the goal as
BLOCKED. - A tool requires elevated human authorization.
Deterministic Engineering for Autonomous Desktop AI
By pairing explicit acceptance criteria with bounded iterations, aiFetchly’s /goal and /loop primitives eliminate agent hallucinations and deliver verifiable software engineering results.
Explore the complete syntax and scheduled loop options in the AI Fetchly Docs.
Visual Generation Prompts
Hero Image Prompt:Modern dark-mode developer UI showing aiFetchly AI Chat V2 with an active /goal card (‘Refactor SQLite Session Pool’), displaying verifiable acceptance criteria checklist with green checkmarks (‘npm test exits 0’, ‘file exists’), a live /loop iteration progress counter (Cycle 3/5), and an evidence inspection drawer, sleek isometric 3D perspective, cyan and emerald glow.Body Image Prompt:High-resolution technical pipeline flowchart illustrating the aiFetchly /goal and /loop state machine: goal formulation in Plan Mode, observe-act-verify iteration cycles (bounded 1-10 turns), four-tier verification routing (command, file, manual, LLM verifier), and evidence-based completion gating, clean slate vector styling.