Add Rule #3: tests observe, they don't shape
CI / core (pull_request) Successful in 1m44s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0192He3BEKJ9v922udzup4Qn
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-11-25 10:30:10 +01:00
1 parent 544bcfbb86
commit 2605611aad
1 file changed
+7
+7
View File
@@ -18,6 +18,13 @@ When adding behavior or tests would grow a Rust file and leave it above 500 line
- Group integration tests by behavior in the package's top-level `tests/` directory and exercise the public API.
- When documenting a runnable API example, use a Rust code block in the item's `///` comments so `cargo test` checks it.
## Rule #3: tests observe, they don't shape
Production code does not exist to satisfy a test. Tests go through the same paths production uses; when a test needs a way in, that is a design seam with a production meaning (an injected clock, a trait with a real implementation), not a test hook.
- No `cfg(test)` / `cfg!(test)` branches inside production logic, no flags or parameters only tests set, no visibility widened only for tests.
- Exception: passive instrumentation under `#[cfg(test)]` (counters, recorded events) that guards a Rule #1 structural test, never read by production code and never changing its behaviour.
## Agent skills
### Issue tracker