MindAttic.Psst/rfc/0001-direct-test-coverage
Appearance
RFC 0001 — Direct-test coverage for the pure helpers
Problem
Several pure, deterministic units (CarrierGateways, PsstViaResolver, ContactBook/ ContactStore, DescribeExitCode) currently have no dedicated test file. Their behavior is only exercised transitively through PsstNotifierTests / PsstConfigurationTests. That leaves documented behaviors marked 🟡 in USER_STORIES.md (B2, D3, A3) even though the code is shipped and working. The headline goal is "every documented behavior has a direct test" (BIBLE §8).
Options compared
- Do nothing — accept transitive coverage. Cheap, but the stories stay 🟡 and a regression in
CarrierGateways.Combine(e.g. dedup ordering) could pass CI silently. - Add focused unit-test files for each pure helper. Pure functions, no I/O — fast, isolated, high signal. Modest effort.
- Add full CLI integration tests that shell out to
psst.exe. Highest fidelity but slow, Windows-/scheduler-coupled, and flaky for the audio/schtaskspaths.
Decision
Adopt Option 2 for the pure helpers, and defer Option 3 (real schtasks/audio round-trips) to a later, Windows-trait-gated integration RFC.
What NOT to do
- Do not test live SMS delivery or real carrier endpoints in unit tests — keep network behind injectable seams (e.g.
ISmsClientstubs inPsstNotifierTests). - Do not assert real audio output or actual Task Scheduler state in the default test run — those stay manual / trait-gated.
- Do not change production code to make it testable beyond what is already injectable.
Phased plan (with risk)
CarrierGatewaysTests— normalize/fanout/combine. Risk: low.PsstViaResolverTests— env var > contact default > Email precedence (inject via theenvVarValueparameter to avoid global env mutation). Risk: low.ContactBookTests+ContactStoreTests— round-trip via a temp roaming root (MINDATTIC_VAULT_ROAMING_ROOT). Risk: low–medium (filesystem temp cleanup).DescribeExitCodemapping test (may require widening visibility tointernal+InternalsVisibleTo, which already exists for the CLI). Risk: low.
Graduates into
- BIBLE §6 (Verified state — upgrade entries to cite the new tests)
- USER_STORIES.md: promotes M.PSST-US-B2, D3, A3 from 🟡 to ✅; closes backlog items M.PSST-US-B6, B7, D5, A4.
Part of MindAttic.Psst.
From MindAttic.Psst/docs/rfc/0001-direct-test-coverage.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.