# Convention memories (scope: project and user)
### [learned-pattern] TDD is mandatory (scope: project)
Every change is written test-first: watch it fail for the expected reason, write minimal code, watch it pass, then refactor. This was applied to every feature (stderr forwarding, req_bytes, redaction, p50, schema violations, prune). Ran successfully on a mid-tier session model — keep doing it.
### [learned-pattern] Commit and branch conventions (scope: project)
Conventional commits only: `feat:`, `fix:`, `docs:`, `chore:`. History is linear on `main` with a single contributor (`bigwalkdoe`); no feature branches or PRs were used for this project — work was committed directly to `main` and pushed. Tags follow `vX.Y.Z` and trigger the release workflow.
### [learned-pattern] Test layout (scope: project)
Pure unit tests live inline in the module they test. Protocol behavior lives in `tests/proxy_tests.rs` and spawns the compiled `target/debug/mcpspy` binary with piped stdio. Mock server is `tests/mock_mcp_server.py` and needs `python3`. When writing an inline echo child for tests, use `python3 -u` or explicit `flush()` — a list comprehension like `[write(l) or flush() for l in sys.stdin]` never flushes and hangs the test.
### [learned-pattern] Docs and changelog are part of the change (scope: project)
User-visible changes require a `CHANGELOG.md` entry under `Unreleased` and updates to the relevant `docs/*.md` guide (usage, architecture, mcp, troubleshooting). README features and docs links are kept in sync.
### [preference] Terse communication (scope: user)
User prefers concise responses with no special rules beyond the repo conventions. Avoid long explanations unless asked; report results and concrete evidence.
### [learned-pattern] Release sequence that worked (scope: project)
Commit + push to `main` → `git tag -a vX.Y.Z` + push tag → CI builds four target artifacts and publishes the GitHub Release → `cargo publish` to crates.io → verify with `cargo install <crate> --version X.Y.Z`. For RUSTSEC findings, regrade by effect, fix in one TDD pass, and never fix deferred minors.