Test Suite and Architectural Guardrails

Test Suite and Architectural Guardrails An architecture diagram generated by Archify. Static Pins · imports · module size · Architecture component Static Pins imports · module size Wire Contract · positional shapes · Architecture component Wire Contract positional shapes src/notebooklm · system under test · Architecture component src/notebooklm system under test Guardrails · tests/_guardrails/ · Architecture component · invariant pins Guardrails tests/_guardrails/ invariant pins Unit Tests · tests/unit/ · Architecture component · no network Unit Tests tests/unit/ no network Integration · tests/integration/ · Architecture component · VCR replay Integration tests/integration/ VCR replay E2E Tests · real API · marked · Architecture component E2E Tests real API · marked Golden Coverage · decode coverage pin · Architecture component Golden Coverage decode coverage pin Server Tests · tests/server/ · Architecture component · in-process ASGI Server Tests tests/server/ in-process ASGI FakeSession · constructor injection · Architecture component · ADR-0007 FakeSession constructor injection ADR-0007 Cassettes · tests/cassettes/ · Architecture component Cassettes tests/cassettes/ Scrubber · ADR-0006 · Architecture component Scrubber ADR-0006 inspects import rules decode pins coverage pin same run then replay opt-in injects REST surface replays recorded via Legend Backend Database Security External

Four execution scopes

  • • Unit tests decode and encode with no network at all
  • • Server tests exercise the FastAPI adapter in-process
  • • Integration replays scrubbed VCR cassettes; e2e is excluded by default

Replay matching

  • • Cassettes match on method, scheme, host, port, path, rpcids and the decoded form body
  • • Because host is matched, replay is pinned to the host a cassette was recorded against

Pinned invariants

  • • Boundary gates reject forbidden imports per adapter and per backend
  • • Changing chain order or a Protocol without updating its pin is a bug