# ADR 0007 — Agent-native engineering: plan, evidence and approval

**Status:** accepted. **Date:** 2026-12-03.

## Context
Agents must be able to discover, plan, execute and verify tasks without implicit
knowledge and without depending on an AI provider, and no task may be declared done just because the code was written.

## Decision
- **The framework does not call models.** Planning is the agent's job; the framework provides context (`context --pack`),
  a plan schema and its validation (`task:check`). It works with any agent and model.
- **Evidence comes from verifiable facts**: a baseline of file hashes and of the contract surface is recorded at
  `task:new`; `task:evidence` compares it with the current state, runs the validator, type checker and tests, and only marks a criterion
  as verified when the tests it names exist and pass.
- **Required approvals are derived from the actual change** (destructive migrations, access changes, roles, the `accounts`
  module), not from what the agent declares. Each approval stores a digest of the approved content.
- `fellow approve` requires an interactive terminal and is excluded from MCP. It is a process control and an audit trail,
  not a security boundary.
- **MCP through the official SDK**, with narrowly scoped tools that run the CLI in a subprocess (stdout is reserved
  for the protocol) and log every call.
- **BM25 lexical search** with stemming and Portuguese↔English synonyms. Semantic search via embeddings sits behind the same
  interface, with no mandatory provider.
- **Skills** are versioned files in the CLI package; `docs:check --framework` ensures, in Fellow's test suite,
  that they only cite commands, options, diagnostics and APIs that exist.

## Consequences
- The benchmark (`benchmarks/agent`) measures real agents under the same rules; the reference solution validates the workflow itself.
- The baseline is per task: changes made before `task:new` do not appear in the report.
- Entitlement changes are not yet detected automatically.

## Evidence
`packages/cli/tests/agent.test.ts`, `packages/cli/tests/mcp.test.ts` and the benchmark's reference run (3/3 tasks,
`complete` evidence, zero out-of-scope changes). The benchmark revealed, and led to fixing, a real defect:
a POST without a body on a route with an optional body schema responded 415.
