Improvements
Test writing
Understand how focused tests can be added incrementally through a reviewable change.
Goal and eligibility
Test writing adds a small set of focused tests for one valuable, currently testable behavior. It works within the repository’s existing test stack. It does not bootstrap a missing framework, add dependencies, change runner configuration, or modify production code to make a test possible.
Select a useful gap
Guard first discovers the native test commands and establishes a passing or honestly limited baseline. It then looks for behavior with clear expected outcomes: an uncovered regression boundary, validation rule, edge case, failure path, or stable unit or integration seam. The plan states the behavior, why it matters, exact files, assertions, fixtures, and verification command before any edit.
The goal is behavioral evidence, not a target number of files or lines.
Test-only change
In issue-only mode, Guard creates or reuses one issue with the suggested scenarios and does not edit the repository. In issue-plus-review-request mode, it may add tests and test-only helpers or fixtures. It does not refactor, rename, move, rewrite, or delete existing tests, and it cannot alter production files, manifests, lockfiles, CI, or test-runner configuration.
New tests must avoid network dependence, uncontrolled time, randomness, shared mutable state, and other known flakiness sources.
Verification
Guard runs the new targeted test, then the relevant existing suite or closest usable baseline. A pre-existing environment failure is reported separately from a regression caused by the new test. If the runnable baseline cannot be preserved or verification is not credible, the run does not push or open a review request.
The PR/MR remains open for human review and is never merged automatically.
Outcomes and rerun
Outcomes include issue-only, review request opened, no valuable test candidate, existing work, verification failed, or needs human review. After merge, rerun Test quality to see whether the new evidence protects a primary surface or criterion rather than merely increasing test count.
Enji Guard