docs(#2810): add patch coverage verification guidance for agents - #6138
Conversation
Code and fix agents treated `make go-test` exit 0 as sufficient verification for Go changes, but make go-test does not enforce the 80% Codecov patch coverage threshold. This led to frequent codecov/patch failures on first push, requiring human-initiated /fs-fix rounds. Changes: - AGENTS.md: Add a "Go coverage gate" bullet in the always-read "How to work in this repo" section, directing agents to verify approximate patch coverage before considering Go work done. - docs/contributing/go-code.md: Replace the advisory coverage note with actionable instructions and a new "Verifying patch coverage locally" section with step-by-step commands (go test -coverprofile, go tool cover -func, threshold assessment). - skills/check-patch-coverage/SKILL.md: New discoverable skill with the full coverage self-check procedure, including when to use/skip, the approximation model, and threshold reference. Note: make lint could not run in sandbox (pre-commit failed due to network restrictions on git fetch). The post-script runs an authoritative pre-commit check on the runner. Closes #2810
|
🤖 Finished Review · ✅ Success · Started 9:49 AM UTC · Completed 10:05 AM UTC Commit: |
Site previewPreview: https://0d18e447-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Previous runReviewFindingsMedium
Low
Labels: PR modifies docs/contributing/go-code.md alongside agent guidance files Previous run (2)ReviewFindingsMedium
Low
Labels: PR adds Go coverage verification guidance and a new skill file under skills/ |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 11:26 AM UTC · Completed 11:32 AM UTC Commit: |
- Remove bold emphasis from 80% threshold value in AGENTS.md to match existing style convention (bold for imperatives only) - Document staging requirement before running coverage check in SKILL.md so newly created files are not silently skipped - Replace basename grep with git-relative path grep in SKILL.md to avoid false matches on same-named files across packages Addresses review feedback on #6138
🔧 Fix agent — iteration 1 (human-triggered)Addressed 3 of 4 review findings with code fixes. Disagreed with 1 (protected-path is informational, no code action needed). Changes: removed bold emphasis from threshold value in AGENTS.md, documented staging requirement and fixed basename grep precision in SKILL.md. Fixed (3):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:34 AM UTC · Completed 11:49 AM UTC Commit: |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 1:35 PM UTC · Completed 1:40 PM UTC Commit: |
Revert the expanded label "Coverage — patch threshold (80%):" back to "Coverage:" to match the short one-or-two-word bold labels used by its sibling list items (Unit tests, Vet, E2E tests). The threshold details are already explained in the body text. Addresses review feedback on #6138
🔧 Fix agent — iteration 2 (human-triggered)Addressed 1 of 2 review findings with a code fix. Disagreed with 1 (informational protected-path finding requiring no code change). Shortened the verbose coverage list label to match sibling style. Fixed (1):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 1:41 PM UTC · Completed 1:56 PM UTC Commit: |
|
🤖 Finished Retro · ✅ Success · Started 5:31 AM UTC · Completed 5:50 AM UTC Commit: |
Retro: PR #6138 — patch coverage verification guidanceWorkflow: issue #2810 → triage → code → 3 reviews × 2 fix iterations → human approval → merge. Timeline: Code agent produced solid docs across 3 files in ~7 minutes (AGENTS.md, go-code.md, SKILL.md). Three review/fix cycles followed over ~4 hours of agent time (with ~5 hours of human wait time between triggers). The PR was merged ~20 hours after opening. What went well
What could go better
Cost7 agent runs total (1 code, 3 review, 2 fix, 1 retro). The two fix cycles were human-triggered with ~1.5–2 hour gaps each, adding wall-clock latency. For a docs-only PR, one fix cycle would have been sufficient if the review agent had been more complete on the first pass and the fix agent had generalized across files. Proposals filed
|
Summary
Add agent-visible guidance so code and fix agents verify approximate Go patch coverage against the 80% Codecov threshold before committing, instead of treating
make go-testexit 0 as sufficient. This addresses frequentcodecov/patchfailures on first push that required human-initiated/fs-fixrounds.Related Issue
Changes
go test -coverprofile,go tool cover -func, threshold assessment).codecov.ymlTesting
make lintcould not run in sandbox (pre-commit network restriction) — post-script validatesChecklist
!for breaking changes)Closes #2810
Post-script verification
agent/2810-patch-coverage-guidance)55bd9f61ce57f9f2151a29d59a04d42b664110cf..HEAD)