What's new
Phase 2 of Argus ships the knowledge graph engine — a pluggable, typed, production-grade graph layer with a NetworkX in-process backend and a Neo4j production backend, parity-tested byte-identical across both. The supply-chain domain pack now maps its four core entities (Order, Supplier, Shipment, EventSignal) into the graph and exposes flagship cascading-risk and subgraph-extraction queries.
Highlights
- KGBackend Protocol with documented merge semantics (per-key property merge, source_refs union, type-mismatch raises)
- NetworkXBackend for in-process use and unit tests
- Neo4jBackend for production, with APOC requirement and clear startup error if missing
- 7 NodeTypes (Supplier, Product, Region, Customer, Order, Shipment, EventSignal) and 10 EdgeTypes with stable-ID helpers
- Flagship queries:
cascading_risk()andsubgraph()— parity-tested across both backends with hand-traced fixture scenarios - SupplyChainKGAdapter with four-rule entity resolution for EventSignal mentions plus an
unresolved_mentionscounter surfaced throughIngestionReport.adapter_counters docs/kg.mdcovering schema, ingestion, queries (Cypher vs NetworkX side-by-side), backend selection, APOC requirement- Coverage gate flipped from report-only to enforced at
fail_under=83
Quality gates
- 396 tests passing locally (45 new from flagship + end-to-end suite)
- mypy strict clean across 64 source files
- ruff + bandit clean
- Integration tests green on real Neo4j 5.20-community + APOC via testcontainers in CI
Roadmap
Phases 3-5 (predictive head with evidential uncertainty, RAG with grounding rubric, human-in-the-loop dashboard) are documented in docs/PROJECT_CONTEXT.md as the next iteration. Phase 6 (multi-cloud Terraform) follows.