Coverage · Python / PostgreSQL / FastAPI
Engineering evidence
Complete evidence before current conclusions.
Back to the Coverage case studyCollection and publication
- Synthetic sourcesInventory CSV and nine paginated HTTP APIs
- Bounded collectorsValidate pagination, totals and every record
- Raw records and run historyImmutable payloads, failures and rejections kept
- Transactional publicationComplete generations only; identity resolved or left unresolved
- Deterministic rulesFindings with exact inputs and finding history
- Read-only dashboardFinding → evaluation → raw evidence
Synthetic CSV and paginated HTTP feed a modular Python application. Collectors retain raw payloads and run history, then validate completeness and resolve identity. PostgreSQL publishes accepted observations, source links and run status together. Deterministic rules record their exact input generations and cited evidence; FastAPI and Jinja expose a read-only dashboard and static replay export.
I use a source lock to prevent overlapping publications and a database transaction to prevent partial generations. A failed page, inconsistent pagination or rejected record prevents replacement of the accepted generation. Captured failures remain inspectable.
This favors complete accepted evidence over partial freshness. It also adds raw-record storage and recovery bookkeeping. PostgreSQL provides the transaction and constraint boundary within one application, keeping those guarantees local and testable.
Identity and uncertainty
Matching follows source aliases, explicit inventory keys, unique serials and full scoped hostnames. An ambiguous match stops resolution and records candidate assets. IP addresses and shortened hostnames cannot establish identity.
I accept unresolved coverage rather than merge assets without evidence. Freshness remains separate from health: stale observations cannot confirm current protection. Outages retain open findings; older alert events cannot replace newer accepted state. Event, fetch and evaluation times remain distinct.
Recorded verification
On 17 October 2026, the local suite recorded 420 passed, with no failures, errors or skips, in 52.08 seconds against isolated PostgreSQL 18.6 and real synthetic HTTP. Pure-function tests cover parsing, matching and rules; database tests exercise transactions, constraints and publication.
The suite covers idempotency, incomplete pagination, rejected-record visibility, identity collisions, stale unknowns, monotonic alerts, outage retention and interruption/overlap recovery. Replay checks compare exported snapshots with pipeline results. The packaging checks include 13 tests for artifact integrity and safe bundle assembly.
This is the recorded packaging verification retained in source commit 869a3badb6db6350e96774457f8d56c1ec1993c8. It is separate from verification of later portfolio copy and layout changes.
Measured query work
The original three-source synthetic benchmark uses 5,000 devices, 3,800 endpoints, 500 alerts and 100 domains. Five recorded post-index runs each use a fresh schema, fixed seed and injected UTC clock, with 250-record pages and 5 ms simulated latency per page. One unreported warm-up precedes them; setup, migrations and teardown are excluded.
Median collection was 489.497 ms (488.299–525.451); publication 1,265.574 ms (1,247.980–1,303.303); rule evaluation 223.732 ms (217.270–231.210). The recorded host was an Apple M4 with 24 GB RAM, macOS 26.6.2, Python 3.13.5 and PostgreSQL 18.6, using loopback HTTP and PostgreSQL.
- Before the index
- 1,336.966 ms
- After the index
- 152.419 ms
An EXPLAIN ANALYZE plan showed repeated endpoint scans by asset. I added an index on (run_id, asset_id). The measured bounded Asset Evidence query fell from 1,320.354 to 166.355 ms; its five-run page-query median fell from 1,336.966 to 152.419 ms.
Pre-index commit: 8c8e7dccac9761df73a6694a0225171fd299b764. Post-index commit: e322a89d52ee3dc5f4b9a66377367e75bc9c454b. These measurements predate the later operational sources and finding comparisons. They establish local synthetic performance at those versions, with no production capacity claim.
Replay provenance and limits
The four generated scenarios contain 13 frames for 12 devices and five domains, separate from the benchmark dataset. The replay records its committed generator ec39da8e53a2767a1050ed3c949315a5eb894a8b, input hashes and artifact hashes. Hashes detect drift; they are not signatures.
The project demonstrates local ingestion, reconciliation and evidence-backed findings. Production operations, real connectors, public scanning and automatic remediation remain outside its scope.