| 1 |
--- |
| 2 |
name: test-intent-ledger |
| 3 |
description: Use before adding or reviewing clnkr tests to keep generated tests integration-oriented, behavior-focused, and low-slop. |
| 4 |
--- |
| 5 |
|
| 6 |
# Test Intent Ledger |
| 7 |
|
| 8 |
Use this before adding or accepting new tests in clnkr. |
| 9 |
|
| 10 |
## Ledger |
| 11 |
|
| 12 |
For each new test or fixture, record: |
| 13 |
|
| 14 |
- Behavior under test: user-visible behavior, protocol contract, or persistence contract. |
| 15 |
- Real boundary exercised: CLI, clnkrd JSONL adapter, shell executor, provider adapter, session store, or agent loop. |
| 16 |
- Dependency realism: `real`, `fixture`, `fake`, or `mock`. |
| 17 |
- Fake/mock reason: why a real dependency or fixture is not suitable. |
| 18 |
- Failure proof: command, sabotage patch, or reason fail-before/pass-after is impractical. |
| 19 |
- Refactor tolerance: implementation detail that should be able to change without breaking the test. |
| 20 |
|
| 21 |
## clnkr Defaults |
| 22 |
|
| 23 |
- Prefer real shell, temp filesystem, `httptest.Server`, subprocess helpers, and JSONL transcript fixtures over isolated helper tests when practical. |
| 24 |
- Keep WET test cases when repeated protocol examples make behavior clearer. |
| 25 |
- Use provider fakes only at the model/API boundary; do not fake the behavior being claimed. |
| 26 |
- Add helpers only when they remove incidental setup noise, not when they hide behavior. |
| 27 |
|
| 28 |
## Review Rules |
| 29 |
|
| 30 |
Flag tests that: |
| 31 |
|
| 32 |
- assert private implementation shape without checking agent, CLI, provider, or transcript behavior |
| 33 |
- duplicate an existing scenario without a new behavior claim |
| 34 |
- use fake/mock terminology without explaining why a real boundary is unsuitable |
| 35 |
- update protocol fixtures without explaining the user-visible or provider contract that changed |
| 36 |
- cannot be made to fail by sabotaging the intended behavior |