You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(ai): have the coverage tool write COVERAGE.md instead of writing it by hand #1270
The coverage ratchet measures with the build MCP's coverage tool, but then writes COVERAGE.md by hand. P5 of the AI Coverage Phase Decision Procedure (ai/global/coverage-ratchet.instructions.md) says to "have Code Writer (docs only) write or overwrite COVERAGE.md", and P3 doesn't say which write_report value to use. In practice every coverage run passes write_report: false, and the table is assembled by hand from the job result.
That has two costs:
The orchestrating session sometimes tries to write the file itself through a shell heredoc, which is refused, before it delegates the write. That's one denial and an extra sub-agent per ratchet pass.
A hand-assembled table can drift from the tool's own format: row order, n/a rows, rounding.
The build MCP already knows how to write the file. Its coverage tool takes write_report, and the server owns the COVERAGE.md format (section order, per-language rows, Overall row).
Proposed change
P3: measure with write_report: false, as now, so a failed ratchet leaves COVERAGE.md untouched.
P5, on success: regenerate the file with the tool by calling coverage again with write_report: true. Don't hand-write it, and drop "have Code Writer write COVERAGE.md". Rerunning a full coverage job is slow, so the better option, if the tool supports it, is a write_report mode that writes the last measured result. Check which the build MCP offers before wording it.
Say explicitly that COVERAGE.md is never written with Bash or by hand.
Acceptance criteria
The decision procedure names the coverage tool and the write_report value for both measuring and writing.
No transcript shows COVERAGE.md written by a heredoc or an Edit/Write tool after the change reaches the agents.
Checked the build MCP: coverage with project: all and write_report: true writes the figures into COVERAGE.md at the repository root when the run succeeds (CoverageTool.cs, WriteReportProperty). The default is false, and the ratchet runs all pass false. So no second job is needed. The simplest procedure:
P3: measure once with project: all and write_report: true.
P4 fail: git restore COVERAGE.md, so the branch keeps main's baseline, then go on to P6 as now.
P5 pass: commit the COVERAGE.md the tool wrote. Nothing is assembled or written by hand.
What this issue's change should cover in the instructions:
Drop every write_report mention, and let the tool write COVERAGE.md. On a ratchet pass, commit the file. On a fail, git restore COVERAGE.md.
Update the format example under "Committed Coverage File" to the four columns, with Overall counts as the sum of the rows.
State that the gate reads only the Line Coverage percentage on the Overall row; the counts exist so one component's row can be updated.
Say that a single-project or single-package run updates its own row and Overall. When older rows have no counts, Overall is left unchanged and the job result's coverageReportNote says so; the next full run fills the counts in.
Optionally note that n/a rows count as 0/0.
Wait for a build MCP release that includes both PRs before rolling this out.
P3: measure once with the build MCP coverage tool on every component (project: all for .NET, package: all for Node). The run writes that language's section of COVERAGE.md itself.
P4 fail: git restore COVERAGE.md so the branch keeps main's baseline, then P6 as now.
P5 pass: commit the COVERAGE.md the tool wrote. Drop "have Code Writer (docs only) write or overwrite". Never write or edit the file by hand, with Bash, or with Edit/Write.
Same file, "Committed Coverage File": four-column format example (Line Coverage | Covered | Coverable, Overall counts are the sum of the rows, Node uses Package). The gate reads only the Line Coverage percentage on the Overall row; the counts let one component's row be updated. Describe single-project/single-package row updates, old files without counts (Overall unchanged, coverageReportNote says why, the next full run fills them in), and n/a rows counting as 0/0. The Overall extraction still reads column 2.
Bootstrap, rebase-conflict and the .NET/Node extraction text: the tool writes the file. A coverage run outside the AI Coverage phase that rewrote COVERAGE.md is restored, not committed.
Other files that describe writing COVERAGE.md (git.instructions.md Pre-Work Baseline Check, dotnet.instructions.md Code Coverage, agent-roles.instructions.md Code Tester): align them. Keep every anchor other files link to. No write_report mention anywhere.
Activity
steward-warden commentedon Nov 24, 2026
Checked the build MCP:
coveragewithproject: allandwrite_report: truewrites the figures intoCOVERAGE.mdat the repository root when the run succeeds (CoverageTool.cs,WriteReportProperty). The default isfalse, and the ratchet runs all passfalse. So no second job is needed. The simplest procedure:project: allandwrite_report: true.git restore COVERAGE.md, so the branch keeps main's baseline, then go on to P6 as now.COVERAGE.mdthe tool wrote. Nothing is assembled or written by hand.steward-warden commentedon Nov 24, 2026
Two build MCP changes now cover the tool side:
coveragerun always writesCOVERAGE.md.write_reportis removed; there is no option to skip writing.New layout. The first two columns are unchanged, so the Overall extraction keeps reading column 2 of the
**Overall (<Language>)**row:What this issue's change should cover in the instructions:
write_reportmention, and let the tool writeCOVERAGE.md. On a ratchet pass, commit the file. On a fail,git restore COVERAGE.md.coverageReportNotesays so; the next full run fills the counts in.n/arows count as 0/0.Wait for a build MCP release that includes both PRs before rolling this out.
steward-warden commentedon Nov 24, 2026
Implementation Plan
Build MCP 0.0.10.211 is released with both coverage changes, so the instructions can now rely on the tool writing
COVERAGE.md.ai/global/coverage-ratchet.instructions.md, decision procedure:coveragetool on every component (project: allfor .NET,package: allfor Node). The run writes that language's section ofCOVERAGE.mditself.git restore COVERAGE.mdso the branch keeps main's baseline, then P6 as now.COVERAGE.mdthe tool wrote. Drop "have Code Writer (docs only) write or overwrite". Never write or edit the file by hand, with Bash, or with Edit/Write.Line Coverage | Covered | Coverable, Overall counts are the sum of the rows, Node usesPackage). The gate reads only the Line Coverage percentage on the Overall row; the counts let one component's row be updated. Describe single-project/single-package row updates, old files without counts (Overall unchanged,coverageReportNotesays why, the next full run fills them in), andn/arows counting as 0/0. The Overall extraction still reads column 2.COVERAGE.mdis restored, not committed.COVERAGE.md(git.instructions.mdPre-Work Baseline Check,dotnet.instructions.mdCode Coverage,agent-roles.instructions.mdCode Tester): align them. Keep every anchor other files link to. Nowrite_reportmention anywhere.No CHANGELOG entry (template repository).