worktree-definition-of-done #7

Merged
schaefera merged 2 commits from worktree-definition-of-done into main 2026-09-03 17:20:39 +00:00
Showing only changes of commit 4846ab3bd6 - Show all commits

View file

@ -24,9 +24,16 @@ A change is done when all of the following hold, not just when it compiles.
## Testing
- New logic in `core` (scoring, affinity math) ships with unit tests —
that crate is the one place pure functions make this cheap, and it's
already the pattern (`crates/core/src/affinity.rs`).
- All non-trivial logic ships with unit tests wherever practical — not
just `core`'s pure functions (scoring, affinity math — the existing
pattern in `crates/core/src/affinity.rs`), but query/filter logic in
`db` and non-passthrough logic in `web`'s `server::services`. "Non-trivial"
excludes thin wrappers (a `#[server]` fn or service function that's just
`db.some_query(args).await?` with no branching of its own) and glue code
whose only failure mode is a compiler error.
- When a DB/network dependency makes a case genuinely impractical to unit
test (e.g. a Diesel query's SQL correctness), say so in the PR rather
than silently skipping it — that's a real gap to track, not a pass.
- Test rationale goes in a `///` doc comment above `#[test] fn`, not
inline in the body.
- A bug fix includes a regression test that fails on the old code.