Skip to main content

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

IDTitleDepends OnOutput
P00Preflight: load scope and lock test targets--.ralph/test-scope.md
P01Baseline: run Bruno and capture resultsP00.ralph/test-findings.md
P02Analyze: profile assertion gapsP00.ralph/test-gaps.md
P03Triage: merge findings/gaps into prioritized planP01, P02.ralph/test-plan.md
P04Remediate: fix tests and add coverageP03Modified .bru files
P05Verify: re-run Bruno and compare before/afterP04.ralph/test-verification.md
P06Report: publish test improvement summaryP05.ralph/test-report.md

Dependency Graph

Quality Gates

  1. Never modify requests outside the selected scope.
  2. Preserve existing passing tests unless the endpoint contract changed.
  3. Error-path tests must assert the exact expected status code.
  4. Happy-path tests must assert exact status code and at least one body property.
  5. 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

ArtifactWritten ByPurpose
.ralph/test-scope.mdP00Target folders and runner commands
.ralph/test-findings.mdP01Bruno failures and suspected false passes
.ralph/test-gaps.mdP02Coverage gaps by category and priority
.ralph/test-plan.mdP03Prioritized remediation batches
.ralph/test-verification.mdP05Before/after comparison
.ralph/test-report.mdP06Summary, metrics, remaining gaps