# Testing and quality ## Principles - Determinism is a contract: identical inputs must yield identical outputs. - Offline-first: tests should pass without network access. - Evidence-first: assertions cover evidence chains, not only verdicts. ## Test layers - Unit and property tests for core libraries. - Integration tests with PostgreSQL and Valkey. - Contract tests for OpenAPI and schemas. - End-to-end tests for scan, policy, and offline workflows. - Replay verification against golden corpora. ## Quality gates - Determinism checks on replay outputs. - Interop checks against external tooling formats. - Offline E2E runs as a release gate. - Policy and schema validation in CI.