gitcad / docs / adr / 0006

ADR-0006: Agent feedback loop — autonomy tiers and circuit breakers

Status: accepted

Context

The self-healing loop (users' agents file bugs, our agents fix them) is the

product's engine and its biggest risk. Unbounded, it floods issues, auto-merges

subtle geometry regressions, and special-cases the kernel into ossified mush.

Decision

Tiered autonomy — never one global "auto-fix" switch:

TierScopeGate
0File issue only, no codeautomatic
1Propose patch as PRhuman review required
2Auto-mergeonly docs / added tests / dep bumps, full green CI
NeverKernel semantics, identity logic, document formathuman sign-off always

Hard rule: anything that changes geometric output is never auto-merged,

regardless of test status (ties to geometric semver, ADR-0004).

Dedup at the source: every failure is fingerprinted (gitcad.report);

identical fingerprints increment an occurrence counter — one issue, not 10,000.

Occurrence count is the priority signal.

Circuit breakers: hard quotas on issues/hour, open auto-PRs, and agent spend.

Exceeding a threshold halts and pages a human — a runaway loop fails loud.

Anti-symptom-fixing: every fix PR must name the root cause and the violated

invariant, add a failing test first, and respect a complexity budget (special-case

count in kernel adapters) that alarms on growth.

Security consequences (must-haves, not later)

untrusted code. Sandbox hard: container, no network, no secrets, CPU/mem caps,

ephemeral.

vector aimed at an agent with commit access. Report content is *data, never

instructions*; the Tier-1 human gate is the backstop.

patch the code being replaced.