-
Notifications
You must be signed in to change notification settings - Fork 20
[TEST/FEAT] Heuristic Fallback Fault Tolerance: In-Memory DB Infrastructure & Mock-Isolated Regression Suite #4
Description
Summary
BLT-Preflight's heuristic fallback — the regex-based scanner that activates when the upstream LLM API is unavailable — constitutes the tool's last line of defense for security risk detection. This fallback path currently has zero test coverage, representing measurable technical debt in a security-critical pipeline. This issue proposes a scoped, two-part remediation: introducing SQLite --memory support to enable stateless testing infrastructure, then leveraging that infrastructure to build a defensive mock-isolated regression suite that validates fallback fault tolerance end-to-end.
Problem Statement: Unverified Fault Tolerance is a Security Risk
In a security-focused tool, an untested code path is not a cosmetic deficiency — it is a liability. The current state presents two compounding risks:
1. Silent Fallback Failures: If the heuristic scanner contains a regression (e.g., a broken regex, a missed pattern class), no automated gate will catch it. A developer relying on Preflight for pre-commit risk detection could receive a false-negative result during an LLM outage with zero indication of degraded coverage.
2. Non-Deterministic Test State: Without in-memory DB support, any test that touches persistence must manage on-disk fixture files, creating cross-platform fragility (LF/CRLF path handling, teardown race conditions, CI environment variance). This makes the heuristic path harder to test reliably.
These two gaps are causally linked and should be resolved together. I have a technical implementation plan ready and would like to begin work on this.