# Changelog

All notable changes to `agentreflect` will be documented here.

## [0.3.0] - 2026-03-11

### Added
- **GitHub Action** (`action.yml`): Use agentreflect directly in CI workflows with inputs for `mode`, `from-pytest`, `from-git`, `threshold`, and `output-format`. Outputs `rules-generated` count and `suggestions-path`.
- **CI mode** (`--ci` flag on `generate`): Writes machine-readable JSON to stdout, summary to stderr. Enables programmatic consumption of rule suggestions in pipelines.
- **Fail-on threshold** (`--fail-on N`): Exit code 1 if `rules_generated >= N`. Enables PR gates that block on too many new rule suggestions.
- **Combined quartet pipeline** (`.github/workflows/examples/agent-quality-pipeline.yml`): Full MEASURE → GENERATE → GUARD → LEARN workflow running agentlint, agentmd, coderace, and agentreflect in sequence on pull requests.
- 32 new tests covering CI mode, action.yml structure, and pipeline workflow YAML validation.

## [0.2.0] - 2026-03-11

### Changed
- Notes mode now prefers AGENTS-style operational rules over generic QA advice when the failure note clearly describes an operating mistake.
- Added targeted heuristics for four operational failure classes:
  - exact facts before fuzzy retrieval
  - downstream state verification after irreversible actions
  - blocked-on-human queue consolidation
  - exact routing target instead of inferred recipient
- Generic fallback suggestions are now phrased as source-of-truth / precondition / verification / routing rules rather than boilerplate "add tests" / "add logging" advice.

### Added
- Operational note fixtures and generator tests to lock the new rule shapes in place.

## [0.1.0] - 2026-03-11

### Added
- `agentreflect generate` command with three input modes:
  - `--from-pytest <file>`: parse pytest output for failure patterns
  - `--from-git`: analyze git log for fix/bug/revert commits
  - `--from-notes "text"`: parse plain text failure descriptions
- Pattern-based analysis engine (no API key required)
  - Maps 15+ exception types to targeted rule suggestions
  - Confidence scoring for each suggestion
- LLM-enhanced mode (`--llm`) using `claude-3-5-haiku-latest`
  - Requires `ANTHROPIC_API_KEY`
  - Graceful fallback to pattern mode if key not set
- Three output formats:
  - Markdown (default): formatted suggestion report
  - Diff (`--format diff`): unified diff ready to apply
  - Apply (`--apply <file>`): direct AGENTS.md modification
- `--yes` flag to skip confirmation on file apply
- `--min-confidence` threshold filtering
- 40+ tests covering parsers, generators, output, and CLI integration

[0.2.0]: https://github.com/mikiships/agentreflect/releases/tag/v0.2.0
[0.1.0]: https://github.com/mikiships/agentreflect/releases/tag/v0.1.0
