Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ai/global/agent-roles.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ If a change proposed by `/simplify` (Phase A) or a finding raised by `/code-revi
#### Phase D: AI Coverage (up to `MAX_COVERAGE_ITERATIONS` rounds)

- **P1.** Update Workflow board to **AI Coverage** (if the repo has a Workflow board).
- **P2.** Run the [AI Coverage Phase Decision Procedure](coverage-ratchet.instructions.md#ai-coverage-phase-decision-procedure-mandatory) from [coverage-ratchet.instructions.md](coverage-ratchet.instructions.md): compare the branch's live per-language coverage against the Overall figures in `COVERAGE.md` on `origin/main`. Have Code Tester measure the branch's coverage and report the per-language figures, as the procedure's [P3](coverage-ratchet.instructions.md#coverage-decision-measure) requires, and only compare and decide yourself, because measuring runs build and test commands, which the Orchestrator never runs. Non-code-only branches (dependency bumps, workflow/SQL/shell/Docker/docs-only changes) skip the ratchet entirely, without reading or writing `COVERAGE.md`: the procedure posts `Non-code change: coverage ratchet skipped`, moves the board to **Human Review**, and stops (see that file's [Non-Code-Only Branches](coverage-ratchet.instructions.md#non-code-only-branches-skip-dont-measure)). A missing `COVERAGE.md` on `origin/main` is the separate bootstrap case: it skips the comparison and passes automatically, but still goes through the procedure's [On success](coverage-ratchet.instructions.md#coverage-decision-on-success) step to write `COVERAGE.md`.
- **P2.** Run the [AI Coverage Phase Decision Procedure](coverage-ratchet.instructions.md#ai-coverage-phase-decision-procedure-mandatory) from [coverage-ratchet.instructions.md](coverage-ratchet.instructions.md): compare the branch's live per-language coverage against the Overall figures in `COVERAGE.md` on `origin/main`. Have Code Tester measure the branch's coverage and report the per-language figures, as the procedure's [P3](coverage-ratchet.instructions.md#coverage-decision-measure) requires, and only compare and decide yourself, because measuring runs build and test commands, which the Orchestrator never runs. Non-code-only branches (dependency bumps, workflow/SQL/shell/Docker/docs-only changes) skip the ratchet entirely, without reading or writing `COVERAGE.md`: the procedure posts `Non-code change: coverage ratchet skipped`, moves the board to **Human Review**, and stops (see that file's [Non-Code-Only Branches](coverage-ratchet.instructions.md#non-code-only-branches-skip-dont-measure)). A missing `COVERAGE.md` on `origin/main` is the separate bootstrap case: it skips the comparison and passes automatically, but still goes through the procedure's [On success](coverage-ratchet.instructions.md#coverage-decision-on-success) step to commit the `COVERAGE.md` the `coverage` tool writes.
- **P3.** <a id="phase-d-on-failure"></a>On failure (any language's branch coverage below its baseline): the procedure judges the round cap and the round-over-round trend itself and acts accordingly (full branching, including the round-cap `Blocked` exit and the judged-unlikely-to-close `Blocked` exit, is at the decision procedure's [P6](coverage-ratchet.instructions.md#coverage-decision-on-failure)), unlike Phase B/C's findings-based judgment, because coverage has a natural numeric signal to trend on. **STOP** after the procedure's status/`Blocked` comment either way; a status-comment outcome means the next cycle picks the resulting Development work back up, a `Blocked` outcome needs a human.
- **P4.** On success: the procedure moves the board to **Human Review** and posts a status comment; proceed to Phase E.

Expand Down Expand Up @@ -454,7 +454,8 @@ Invoked by: Code Writer, Code Fixer, Code Reviewer, CI Debugger.
- Run build and all tests after Code Writer or Code Fixer finishes.
- In a .NET repository, run the build, tests, coverage and checks through the [build-dotnet MCP tools](dotnet.instructions.md#build-dotnet-mcp-tools-mandatory) and never with the raw `dotnet` commands, which the agent container denies, and wait for each job with `job_result`, never by polling `job_status`. When the server is not connected, stop and report it as that section's P3 says, rather than run a raw command. The same applies to every other role that builds, tests or measures coverage in a .NET repository (Code Writer, Code Fixer, Code Reviewer, CI Debugger, Committer, Rebase Agent, Dependency Updater, Repo Auditor).
- Check coverage against `git -C <dir> diff origin/main...HEAD`.
- In the AI Coverage phase, measure the branch's whole-repo coverage for the Orchestrator as the [decision procedure's P3](coverage-ratchet.instructions.md#coverage-decision-measure) describes, and report the per-component rows and the Overall figure for each measured language. Do not compare them with `COVERAGE.md` or judge the gate; the Orchestrator does that.
- In the AI Coverage phase, measure the branch's whole-repo coverage for the Orchestrator as the [decision procedure's P3](coverage-ratchet.instructions.md#coverage-decision-measure) describes, and report the per-component rows and the Overall figure for each measured language. Do not compare them with `COVERAGE.md` or judge the gate; the Orchestrator does that. Leave the `COVERAGE.md` the tool wrote uncommitted for the Orchestrator's decision.
- Every successful `coverage` run rewrites `COVERAGE.md`. Outside the AI Coverage phase, restore it with `git -C <dir> restore COVERAGE.md` after reading the figures, because only the [coverage ratchet](coverage-ratchet.instructions.md#committed-coverage-file-mandatory) commits it.
- Apply [IDE MCP Code Analysis](code-quality.instructions.md#ide-mcp-code-analysis-mandatory) to the changed files.
- On build failure, test failure, or uncovered code: report file paths/line ranges to the calling agent; stop, do not proceed.
- Loop with Code Writer until build passes, all tests pass, and all new/changed code is covered.
Expand Down
Loading
Loading