Deterministic Autonomous Problem Solving
CACode implements a deterministic ReAct (Reason + Act) autonomous cycle designed to prevent hallucinations and ungrounded code modifications.
The 4-Stage ReAct Cycle:
- Thought (Reasoning): The agent analyzes the prompt, evaluates current project state, identifies missing dependencies, and outlines an architectural hypothesis.
- Action (Tool Call): CACode dispatches a precise, structured tool request (e.g. searching regex patterns or reading specific line ranges).
- Observation (Environment Feedback): The agent ingests stdout, stderr, compiler diagnostics, and test exit codes produced by the tool execution.
- Refinement / Self-Correction: If a build fails or tests report errors, the agent inspects the stack trace, adjusts its hypothesis, and applies correcting patches iteratively until the suite passes.
User Approval Gates & Blast Shields
You remain in full control. CACode enforces configurable safety boundaries:
- Autonomous Read-Only: Exploration, grep, and symbol indexing run automatically without interrupting you.
- Interactive Modification Gate: File writes, unified diffs, and shell commands require explicit
[Y/n]confirmation by default (can be toggled with--yesin trusted CI scripts). - Atomic Git Stashing: Before applying any multi-file change, CACode creates a transient Git stash snapshot, allowing instant rollbacks via
/undoif you are unsatisfied with the result.