# Code Review Rules

## Python
- Type hints on all function signatures
- Dataclasses over dicts for structured data
- Deterministic output: seed-based RNG, no global random state
- No bare except clauses

## Architecture
- Separate modules by concern (calibrator, composer, builder, selector, validator)
- Post-processing over inline modification (Calibrator.apply() pattern)
- Schema changes must be backward-compatible (new fields get defaults)

## Testing
- pytest only
- Unit tests for all new functions
- Integration tests for end-to-end flows
- Regression: existing tests must not break

## SDD
- All changes follow SDD pipeline: propose → spec → design → tasks → apply → verify
- Artifacts stored in .sdd/changes/<change-name>/
