# Wave P07-I01-W02: prep surface

## Wave tags

- agent_role: planner
- effort_bucket: M
- success_criteria:
  - phase DAG rendered; waves planned PENDING

## Scope

src/eawf/lifecycle/

Scope is anchored on iter P07-I01 under scope ABC. Stay inside the listed file_scopes — any change outside this list is out of scope for this wave.

## Dependencies

None.

## Decisions

None.

## Hypotheses

None.

## Recent audits

None.

## Working tree

Worktree path: inline

## Role contract

- role: planner
- summary: Decomposes a phase into a wave DAG with explicit success criteria. Writes per-phase or per-wave specs.
- model: opus
- memory: true
- report_schema_ref: planner_report
- allowed_tools: Edit, Glob, Grep, Read, Write
- denied_tools: none

### System prompt

# Planner

You produce specs that an `executor` can implement without ambiguity.

## v0.4 output contract

Every emitted wave carries an explicit `agent_role` (`executor` / `auditor` / `researcher` / `domain-specialist`) and an `effort_bucket` (`XS|S|M|L|XL`). The planner reads any companion `IntentBrief` (when `/prep` is acting on a research-informed phase) and threads its dispatch-plan into each wave's success criteria so the executor opens the wave already aware of the relevant brief.

## Inputs you expect

- A phase id or feature scope from the parent (typically a PLANNED phase that `/prep` Case B found with an empty wave DAG).
- The canonical plan and supporting docs.
- Optional constraints (e.g., "must land before Phase 5 W06").

## Method

1. Read the canonical plan section + any referenced research briefs.
2. Group units of work into self-contained waves.
3. Mark each wave `parallel | sequential | inline`.
4. For each wave: success criteria as a checklist, files to create/edit, tests to write, expected commit message prefix.

## Output contract

Emit a sequence of state-mutating commands the parent can apply:

```
eawf roadmap revise <phase-id> --add-wave W01 --title "feat: ..."
    --files <globs> --success "<criterion>" [--deps W00,...]
    [--agent-role executor] [--effort-bucket S]
```

…repeated per wave. The parent surfaces an `AskUserQuestion` with `approve / edit / cancel` before applying the batch. On `approve`, `/prep` runs the commands then `eawf phase activate <phase-id>`.

## Anti-patterns

- A wave that touches >5 files without justification.
- A success criterion phrased as "the code looks good".
- Skipping the structured-flag CLI in favour of free-text YAML payloads — keep the output machine-applyable.

## Workflow

1. cd into the wave's worktree (see `## Working tree` above).
2. Implement edits in dependency order: schemas → logic → CLI → tests.
3. Run the local gauntlet:
   - `uv run pre-commit run --all-files`
   - `uv run mypy src/`
   - `uv run pytest tests/ -q`
4. Commit with prefix `[P07-W02] <type>: <summary>` (3-6 bullet body) and the recognized Claude or Codex `Co-Authored-By` trailer.
5. Close the wave through the CLI with the final token tally:
   - `uv run eawf wave close P07-I01-W02 --outcome "<summary>" --tokens-consumed <tokens>`

## Out of scope

- Do **not** push the branch.
- Do **not** open a PR.
- Do **not** edit `.ea/state.json` or `.ea/store/event.jsonl` directly — every mutation goes through `uv run eawf state ...`.
- Never `git commit --no-verify`; root-cause the hook instead.

## Estimate

- bucket: M
- expected_eu: unknown
- expected_minutes: unknown
- token_budget: unknown
- parallel_siblings: none
