OpenCredentials/rfc/0001-verification-harness
Appearance
RFC 0001 — A verification harness for the non-retention and disclosure invariants
Problem
OpenCredentials's most important properties — non-retention of secrets (OC-LAW-1), review-before-disclosure (OC-LAW-2), and race-safe concurrency (OC-LAW-5) — were guaranteed only by code structure and reviewer discipline. OpenCredentials.Tests now proves the disclosure stories (auto-inform gate, idempotency, advisory-first routing); non-retention, pattern matching, remediation and concurrency are still unproven, so a refactor could silently regress those guarantees.
Options compared
- No tests, rely on review. Status quo. Cheap, but the prime directive is unprotected and "done" can never be honestly claimed.
- Full end-to-end tests hitting GitHub. Highest fidelity, but slow, rate-limited, non-deterministic, and would require a live PAT in CI — at odds with the project's own ethics.
- Unit/integration tests against a faked
GitHubClient+ in-memory or LocalDB EF context. Deterministic, fast, no network, isolates each invariant. Requires makingGitHubClientsubstitutable (interface or virtual seam) — a source change, so out of scope for the docs migration but the recommended next step.
Decision
Pursue Option 3. Add a OpenCredentials.Tests project that fakes the GitHub boundary and exercises the Shared engine + Scraper directly. Prioritize, in order: non-retention, pattern matching, auto-inform gate, notice idempotency, remediation transitions, concurrency claim.
What NOT to do
- Do not put a real credential (even an expired one) in a fixture. Use synthetic strings shaped to match the regexes.
- Do not call any provider API or open real GitHub issues from tests.
- Do not weaken
Scraper.Fingerprint's drop-after-hash structure to make it more testable; test the observable output (only fingerprints are emitted), not internals that would invite retention.
Phased plan (with risk)
- Seam — done:
GitHubClienthas an internal constructor taking anHttpMessageHandler; tests inject a fake GitHub API. - Harness — done:
v2/Tests/OpenCredentials.Tests.csproj(xUnit + bUnit, in-memory EF). - Invariant tests (medium): auto-inform gate done; non-retention next.
- Coverage (medium): idempotency done; patterns, remediation, concurrency remain.
Graduates into
- BIBLE §6 — Verified state (flip evidence from "build only" to test-cited).
- USER_STORIES.md — promotes OC-US-A1/A2, B1/B3, C1, E3 from 🟡 to ✅ as each test lands.
Part of OpenCredentials.
From OpenCredentials/docs/rfc/0001-verification-harness.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.