Update bug 5 with root cause, repro steps, and expected result

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 15:40:27 +00:00
parent e7c4f31e34
commit bd09add399

View File

@@ -7,21 +7,26 @@ test_plan: pending
## Description ## Description
Pressing "Collect Coverage" in the workflow gates UI produces a large error. The feature expects a vitest `coverage-summary.json` but the project doesn't have coverage tooling configured. Pressing "Collect Coverage" in the workflow gates UI produces a giant stack trace. The API endpoint `POST /workflow/coverage/collect` (`server/src/http/workflow.rs:430`) runs `pnpm run test:coverage` and when it fails, dumps the entire stderr into the error response (line 455). The frontend then renders this raw error.
## Expected Behavior ## Root Cause
Either the coverage collection works end-to-end, or the button is hidden/disabled when coverage tooling is not available. `collect_coverage` in `workflow.rs` returns the full stderr from the failed `pnpm run test:coverage` command as a `bad_request` error. No truncation or sanitization.
## Steps to Reproduce ## How to Reproduce
1. Start the server ```bash
2. Open the frontend curl -s http://localhost:3001/api/workflow/coverage/collect \
3. Navigate to workflow gates -H 'Content-Type: application/json' \
4. Press "Collect Coverage" -d '{"story_id":"any_story","threshold_percent":80}' | python3 -m json.tool
5. Large error is displayed ```
**Actual result:** A giant JSON error response containing the full stderr output from `pnpm run test:coverage` — hundreds of lines of stack traces.
**Expected result:** A short, human-readable error message, e.g. `{"error": "Coverage not configured: no test:coverage script found in frontend/package.json"}` — or if the command exists but fails, a truncated summary (first 500 chars max).
## Acceptance Criteria ## Acceptance Criteria
- [ ] "Collect Coverage" either works or fails gracefully with a clear message - [ ] `collect_coverage` API truncates/sanitizes error output before returning it (e.g. first 500 chars max)
- [ ] No giant error dump shown to the user - [ ] Frontend `GatePanel` renders coverage errors in a contained, non-overflowing way
- [ ] If `test:coverage` script doesn't exist in `package.json`, return a clear "coverage not configured" message instead of running the command