# RULES - how the agent should behave
# Read by AI coding agents (via AGENTS.md or pasted into the system prompt).

## 1) Decision discipline (the FORK RULE)
Log a decision when reversing it would cost time, or when you actively
considered an alternative and picked one. Use:
    python check_decisions.py --decide

## 2) Never repeat exploration
Before re-deciding something, check decisions.txt - if it is LOCKED, honor
it unless the context has genuinely changed (then log a REVISED entry).

## 3) Boot recall
Run `python start.py` at session start. It prints the last decisions and
anything still OPEN. Start from that state instead of re-exploring.

## 4) Resolve OPEN decisions
Anything STATUS: OPEN is a debt carried into the next session. Settle it
early, or say explicitly why it stays deferred.

## 5) Corrections are append-only
Never edit a past decision. If a decision changes, append a REVISED entry
with SUPERSEDES: <timestamp> pointing back at the old one.

## 6) Non-negotiables
- Never use `git commit --no-verify` to skip a hook (this repo's sibling
  agent-error-log gates commits server-side; keep the discipline here too).

## 7) LESSONS LEARNED (proposed drafts)
================================================================================
Distilled from the decision log by: python check_decisions.py --review [--apply]
Generated: 2026-08-09  |  source: 28 decision(s).

1. config.yaml
   2 reversal(s) - decisions on 'config.yaml' were LOCKED then changed
   (supersedes on 2026-08-12 09:00, 2026-08-13 10:15)
   Why it kept changing:
   - 2026-08-12 09:00: typed values and no tag soup; CI templates already use it
   - 2026-08-13 10:15: team convention and the internal tooling reads YAML natively
   Proposal: default to the most recent decision on config.yaml unless the
   context genuinely changed; when it does, log a REVISED entry that says why.
2. parser.py
   3 reversal(s) - decisions on 'parser.py' were LOCKED then changed
   (supersedes on 2026-08-10 09:15, 2026-08-11 10:00, 2026-08-12 11:30)
   Why it kept changing:
   - 2026-08-10 09:15: file grew past 200 lines; regex became unmaintainable
   - 2026-08-11 10:00: parser file shrank to 40 lines after cleanup; AST setup felt like overhead
   - 2026-08-12 11:30: refactor split the parser; regex state scattered across five functions
   Proposal: default to the most recent decision on parser.py unless the
   context genuinely changed; when it does, log a REVISED entry that says why.
