Bruno Test Improvement Loop
warning
This page is a retained loop design. The Bruno test-improvement template/prompt
is not currently tracked under .agents/tasks. The supported one-off command is
npm run bruno:test:ci; it is not evidence that this autonomous loop is
installed.
Overview
The Bruno test improvement loop fixes and enhances assertions in .bru request files. It focuses on eliminating false-pass tests, adding missing error-path coverage, and validating response body structure.
For detailed assertion patterns and examples, see the Bruno Testing section.
Story Breakdown
| ID | Title | Depends On | Output |
|---|---|---|---|
| P00 | Preflight: load scope and lock test targets | -- | .ralph/test-scope.md |
| P01 | Baseline: run Bruno and capture results | P00 | .ralph/test-findings.md |
| P02 | Analyze: profile assertion gaps | P00 | .ralph/test-gaps.md |
| P03 | Triage: merge findings/gaps into prioritized plan | P01, P02 | .ralph/test-plan.md |
| P04 | Remediate: fix tests and add coverage | P03 | Modified .bru files |
| P05 | Verify: re-run Bruno and compare before/after | P04 | .ralph/test-verification.md |
| P06 | Report: publish test improvement summary | P05 | .ralph/test-report.md |
Dependency Graph
Quality Gates
- Never modify requests outside the selected scope.
- Preserve existing passing tests unless the endpoint contract changed.
- Error-path tests must assert the exact expected status code.
- Happy-path tests must assert exact status code and at least one body property.
- Use write-gate mode for endpoints with external side effects.
Verification
Run the smallest relevant Bruno folder:
node bruno/scripts/run-bruno-suite.mjs --env local --folder 20-agents-k12
For CI-shaped verification:
npm run bruno:test:ci
Artifacts
| Artifact | Written By | Purpose |
|---|---|---|
.ralph/test-scope.md | P00 | Target folders and runner commands |
.ralph/test-findings.md | P01 | Bruno failures and suspected false passes |
.ralph/test-gaps.md | P02 | Coverage gaps by category and priority |
.ralph/test-plan.md | P03 | Prioritized remediation batches |
.ralph/test-verification.md | P05 | Before/after comparison |
.ralph/test-report.md | P06 | Summary, metrics, remaining gaps |