You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: home/AGENTS.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,24 @@ Avoid these patterns unless explicitly approved:
75
75
- Before running a remote or container batch, verify every required executable in that environment. Do not assume host tools or the host `PATH` exist there; stop and report missing requirements.
76
76
- Use the supported tool-discovery mechanism when capability availability is unclear.
77
77
78
+
## Test Value
79
+
80
+
Before adding or materially expanding a test, inspect the relevant code and existing tests, then identify:
81
+
82
+
1. The observable behavior, regression, boundary, failure mode, or cross-component contract the test protects.
83
+
2. A plausible real-world defect that would make the test fail.
84
+
3. The gap in existing tests that leaves that defect unprotected.
85
+
86
+
If you cannot identify all three, do not add the test.
87
+
88
+
- Exercise the narrowest stable boundary that exposes the defect. Name the test for the behavior it actually exercises.
89
+
- Assert an observable output, state transition, persisted or emitted effect, or specific error.
90
+
- Do not use successful execution or shallow proxies—such as type or non-empty checks, inheritance, constructibility, signatures, source-text presence, snapshots, or mock calls—as the sole evidence unless that fact or interaction is itself the contract.
91
+
- Prefer real collaborators or lightweight fakes. Mock external or nondeterministic boundaries only when needed; assert interactions only when they are the contract.
92
+
- Do not duplicate the same branch and outcome at another layer unless the added test proves a distinct integration risk.
93
+
- Do not add tests only to increase coverage, mirror production files, or preserve implementation structure.
94
+
- Apply the deletion test before finishing; remove the test if its absence would not materially weaken regression protection.
95
+
78
96
## Verification
79
97
80
98
- Turn the request into a verifiable result and define the smallest relevant checks before editing.
0 commit comments