Project Aegis: Autonomous Stochastic Supply Chain Orchestrator
An enterprise multi-echelon inventory allocation, dynamic pricing, and spatial fulfillment routing engine calibrated on 100,000+ Brazilian Olist e-commerce orders.
1.55M Records
Empirical Spine
K=5 Geodesic Hubs
Fulfillment Topology
p95 Stockout ≤ 3.5%
Primary Risk SLA
PFA · CFA · VFA · DLA
Policy Tournament
Executive Summary
Modern multi-echelon e-commerce networks lose millions of dollars annually to three compounding pathologies: myopic nearest-warehouse routing (which prematurely depletes regional hubs and forces expensive long-zone split shipments), stockout-censored demand blindness, and uncalibrated safety stock buffers.
Project Aegis is an enterprise-grade autonomous sequential decision orchestrator grounded in 1.55 million empirical records (100,000+ customer orders) from the Brazilian Olist e-commerce ecosystem. Built on Warren Powell’s Universal Modeling Framework (UMF) and a strict Hexagonal (Ports & Adapters) Python architecture, Aegis benchmarks all four canonical policy meta-classes directly against GAAP ASC 606 Net Contribution Margin.
Architectural & Mathematical Foundations
- Alexis King’s “Parse, Don’t Validate” Perimeter & DuckDB OLAP Spine:
All 9 raw Olist relational tables (1,550,922 records) are validated at the ingestion boundary into frozen domain dataclasses and materialized into a zero-latency 76.76 MB DuckDB analytical spine (
v_orders_clean,v_order_lines,v_customer_locations,v_seller_locations) in 0.05 seconds with 100% coordinate resolution across 99,441 customers and 3,095 sellers. - Spatial Hub Derivation & Detrended Innovation Covariance: Geodesic Haversine clustering synthesizes fulfillment corridors across Brazil, computing the exact distance tensor in 0.156 seconds. Cross-category demand co-movement is modeled on detrended stationary residuals via spectral PCA decomposition and a Kronecker-separable Dynamic Spatio-Temporal Model (DSTM).
- Lohr Finite Survey Sampling & Epistemic Censored Demand Probing: To correct for São Paulo’s 47% platform volume skew during national expansion stress tests, Aegis applies Horvitz-Thompson inverse-probability weighting () anchored to IBGE demographic frames. When regional stockouts right-censor observed sales (), Bayesian Optimal Experimental Design (BOED) and Sequential Monte Carlo (SMC) particle filters actively probe latent demand intensities.
- Fault-Tolerant Distributed Sagas & Bit-for-Bit Replay Determinism:
State transitions execute through orthogonal Harel statecharts and Garcia-Molina Compensating Sagas (
VerifyAuthHold -> ReserveStock -> BookCarrier -> DispatchAndSettleASC606), guaranteeing zero zombie inventory locks without distributed 2PC bottlenecks.
The 4-Policy Meta-Class Tournament
Every historical and synthetic shock trajectory is benchmarked across Powell’s four universal policy classes under identical counter-based PRNG seeds:
- Class 1 — PFA (Greedy Geodesic Nearest-Neighbor + Replenishment): Baseline operational heuristic.
- Class 2 — CFA (Parameterized Buffer MILP Tuned via Knowledge Gradient): Maximizes immediate ASC 606 contribution plus concave safety buffer valuation .
- Class 3 — VFA (Post-Decision Bellman State + CAVE Dual Shadow Prices): Eliminates the expectation operator inside the by maintaining piecewise-linear concave marginal inventory value slopes .
- Class 4 — DLA (Rolling-Horizon Lookahead + Spatio-Temporal Graph Convolutional Rollout): Predicts multi-step network congestion and transit delay propagation over the inter-hub adjacency matrix .
System Modules
6 architectural components · Click any to launch
Ch. 1 · 24:00
src/infrastructure/duckdb_adapter.pyHexagonal Ingestion Gate & DuckDB Spatial Spine
Alexis King Parse Don't Validate boundary proofs, DuckDB OLAP materialization, and Geodesic K-Means hub synthesis
Ch. 1 · 29:00
src/domain/spatio_temporal.pySpatio-Temporal Covariance & Lohr Survey De-Biasing
Detrended spectral PCA, Kronecker-separable DSTM transitions, and Horvitz-Thompson geographic bias correction
Ch. 1 · 31:00
src/domain/umf_model.pyPowell's 5 Canonical Elements & GAAP ASC 606 Objective
State vector (Rt, It, Bt), SMC particle filtering for censored demand, and time-weighted contribution margin
Ch. 2 · 27:00
src/application/saga_coordinator.pyHarel Statecharts, Event Sourcing & Distributed Sagas
Bit-for-bit replay determinism via counter-based PRNG keys, Petrov OCC, and Garcia-Molina compensating transactions
Ch. 2 · 34:00
src/policies/tournament.pyThe 4-Policy Meta-Class Tournament & Shadow Deployment
Benchmarking PFA, Knowledge-Gradient CFA, CAVE Dual Shadow-Price VFA, and ST-GCN Lookahead DLA
Ch. 2 · 23:00
src/infrastructure/chaos_verifier.pyExtreme Value Chaos Corpus & High-Cardinality Observability
Aggarwal EVT anomaly synthesis, Hypothesis invariant proofs, and Charity Majors wide structured telemetry
Complete System Breakdown by Chapter
Chapter 1: Mathematical Formulation, Digital Twin & Policy Engine
3 components
Chapter 1: Mathematical Formulation, Digital Twin & Policy Engine
3 components
Hexagonal Ingestion Gate & DuckDB Spatial Spine
Alexis King Parse Don't Validate boundary proofs, DuckDB OLAP materialization, and Geodesic K-Means hub synthesis
Spatio-Temporal Covariance & Lohr Survey De-Biasing
Detrended spectral PCA, Kronecker-separable DSTM transitions, and Horvitz-Thompson geographic bias correction
Powell's 5 Canonical Elements & GAAP ASC 606 Objective
State vector (Rt, It, Bt), SMC particle filtering for censored demand, and time-weighted contribution margin
Chapter 2: Production API, Zero-Trust Security & MLOps
3 components
Chapter 2: Production API, Zero-Trust Security & MLOps
3 components
Harel Statecharts, Event Sourcing & Distributed Sagas
Bit-for-bit replay determinism via counter-based PRNG keys, Petrov OCC, and Garcia-Molina compensating transactions
The 4-Policy Meta-Class Tournament & Shadow Deployment
Benchmarking PFA, Knowledge-Gradient CFA, CAVE Dual Shadow-Price VFA, and ST-GCN Lookahead DLA
Extreme Value Chaos Corpus & High-Cardinality Observability
Aggarwal EVT anomaly synthesis, Hypothesis invariant proofs, and Charity Majors wide structured telemetry
Production Deployment & Architecture Advisory