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
2 changes: 1 addition & 1 deletion ai/global/agent-roles.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ Invoked by: Code Writer, Code Fixer, Code Reviewer, CI Debugger.
- 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. 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.
- Every successful `coverage` run rewrites `COVERAGE.md`. Restore it with `git -C <dir> restore COVERAGE.md` after reading the figures outside the AI Coverage phase, and in that phase when the Orchestrator reports that the ratchet failed ([decision procedure's P4](coverage-ratchet.instructions.md#ai-coverage-phase-decision-procedure-mandatory)), because only the [coverage ratchet](coverage-ratchet.instructions.md#committed-coverage-file-mandatory) commits it, and only after a pass.
- 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
2 changes: 1 addition & 1 deletion ai/global/coverage-ratchet.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Run this only when the Workflow board is at **AI Coverage** (see [agent-roles.in
- **P2.** <a id="coverage-decision-fetch-compare"></a>`git -C <repodir> fetch origin main` (always fresh; do not rely on a fetch from earlier in the session). Read `origin/main`'s `COVERAGE.md` without checking it out: `git -C <repodir> show origin/main:COVERAGE.md`. If it does not exist, this is the [bootstrap case](#committed-coverage-file-mandatory): there is no baseline to compare against, so treat the gate as passed and go to P5.
- **P3.** <a id="coverage-decision-measure"></a>Have Code Tester measure: for each language with a real Overall row in that file (not `n/a` or `excluded`), it runs the [extraction procedure](#per-language-overall-coverage-extraction) once against the branch's current (already checked out) working tree, with the build MCP `coverage` tool over every component (`project: all` on `build-dotnet` for .NET, `package: all` on `build-node` for Node), and reports both the per-component rows and the Overall figure for each language back. Each successful `coverage` run writes its language's section of `COVERAGE.md` itself; Code Tester leaves the file uncommitted. The measurement has to run in Code Tester, not in the Orchestrator, because the Orchestrator's session is not granted the build MCP tools and the raw coverage commands are denied ([build-dotnet MCP Tools](dotnet.instructions.md#build-dotnet-mcp-tools-mandatory) P2). The Orchestrator never runs a build, test or coverage command itself; it only compares the reported figures and decides. If any test failed, Code Tester reports the measurement as [void](#failing-tests-void-the-measurement-mandatory), with the failing tests, instead of figures; the Orchestrator then treats it as a Development-phase fix, moves the board back to **Development** and stops, without going to P4. A void measurement is not a coverage-gap round and does not count towards the P6 round cap.
- **P4.** Compare branch vs. baseline **Overall** per language (component rows are recorded but never gate, per [Overview](#overview)):
- Any language where branch Overall **<** baseline Overall: the ratchet fails. Run `git -C <repodir> restore COVERAGE.md`, so the branch keeps `main`'s baseline rather than the figures the failed round wrote, then go to P6.
- Any language where branch Overall **<** baseline Overall: the ratchet fails. Have Code Tester run `git -C <repodir> restore COVERAGE.md`, so the branch keeps `main`'s baseline rather than the figures the failed round wrote (Code Tester ran the measurement, and the Orchestrator never edits files), then go to P6.
- All present languages branch Overall **>=** baseline Overall: the ratchet passes. Continue to P5.
- **P5.** <a id="coverage-decision-on-success"></a>**On success** (reached only from a measured pass in P4 or the bootstrap case in P2, never from the P1 non-code-only skip): commit the `COVERAGE.md` the `coverage` tool wrote in [P3](#coverage-decision-measure) (in the bootstrap case, have Code Tester measure as in P3 first, which writes it). Never write or edit the tool-written sections by hand, with a shell command, or with an edit or write tool; only a Python section, which no tool writes, is updated by Code Writer (docs only) with the figures just measured, per [Committed Coverage File](#committed-coverage-file-mandatory). Send the change through the [review-fix route](task-workflow.instructions.md#review-fix-route) without Code Tester or Changelog (correction), starting at Committer when no Python section changed, resuming at Phase E, because the Orchestrator never measures, edits or commits itself, the coverage was measured moments ago, and a coverage figure is not a change the changelog records. Never commit `COVERAGE.md` from a [void](#failing-tests-void-the-measurement-mandatory) measurement. Move the board to **Human Review**, post a one-line status comment (`Coverage ratchet passed - advancing to Human Review`), and stop. This is why the board must not re-enter AI Coverage on the resulting CI run: the phase has already advanced past it.
- **P6.** <a id="coverage-decision-on-failure"></a>**On failure**, check the round cap first, then judge the round-over-round trend:
Expand Down
Loading