Fragility Discovery Engine v0.5.0 · AgenticOps

Algorithms and provenance

This document lists every algorithm the Fragility Discovery Engine uses, who invented it, and where you can find the implementation in this repository. The engine has two runtime dependenciesnumpy and networkx — so everything below is hand-rolled on top of NumPy unless noted.

For the formal evidence vocabulary (schedules, rollouts, Δ⁻/Δ⁺ attribution, schema IDs), see Fragility Evidence Language (FEL).

NotationMeaning
OriginalFirst implementation; framing introduced by this project.
StandardTextbook algorithm we re-implemented from first principles (no external library).
LibraryProvided by a third-party package we depend on.

1. What we created (named, in one place)

These are the algorithms, frameworks, and physics kernels originated by this project. Each is fully documented in the section linked from the table; this is a single index so the contribution is visible at a glance.

Explanation and attribution methods

NameWhat it doesWhere to readCode
Schedule-mask counterfactualRe-run a simulator with selected shock timesteps deterministically zeroed and diff the rollouts to attribute outcome change to those steps. Builds on Pearl's do-calculus framing; the schedule-mask + replay-diff pipeline is ours.§3.1src/fragility_engine/explain/counterfactual.py
Greedy shock-set minimization for collapsePosition-greedy reduction of an attacker schedule to the smallest subset of shocks that still drives the world to collapse, with pinned rollout seeds throughout. Applies the delta-debugging idea (Zeller & Hildebrandt 2002) to adversarial simulation schedules; the specific algorithm is greedy-by-timestep.§3.2src/fragility_engine/explain/minimal_collapse.py
Mutation-chain path traceApply discrete world-physics mutations one at a time in a chosen order; record Δ integral_instability and Δ attack_cost at every step. Analogous in spirit to integrated gradients / SHAP but defined directly over a discrete simulator.§3.3src/fragility_engine/explain/counterfactual_chain*.py
Star-merge attribution graphMerge several single-branch counterfactual bundles that share one baseline into one graph (root = baseline, leaves = branches, edges carry Δ-metrics and intervention labels), with strict baseline-equality checking. Schema attribution-merge-v1.§3.4src/fragility_engine/explain/merge_attribution.py
Fragility Evidence Language (FEL)Formal vocabulary for worlds, schedules, rollouts, attack Pareto order, Δ⁻ counterfactual vs Δ⁺ path attribution, and evidence schema IDs — not new physics.FELsrc/fragility_engine/fel/
Schedule-minimization explanation DAGCompact DAG (explanation-dag-v1) over a minimization report: baseline → minimized with the kept events on the edge. Machine-readable "why did it still collapse?" record.§3.5src/fragility_engine/explain/explanation_dag.py
Institutional compositeRun the same attacker schedule through several decoupled physics kernels and emit a side-by-side scorecard JSON (fragility-institutional-composite-v1…v4). Kernels never exchange state inside a step.§4.7src/fragility_engine/benchmarks/institutional_composite.py

Reproducibility framework

NameWhat it doesWhere to readCode
Frozen-benchmark golden-metric harnessBenchmark suite where each bundle pins (genome_seed, rollout_seed) and asserts scalar metrics on every CI run. Conceptually similar to MLPerf, but for adversarial search rather than model training.§5.1src/fragility_engine/benchmarks/suite.py, scripts/run_benchmark_suite.py
Manifest digest pinningSHA-256 over the benchmark inventory; CI fails if the digest drifts without an explicit bump. Standard hash, original workflow.§5.2src/fragility_engine/benchmarks/manifest.py, scripts/check_manifest_digest.py
Fragility certificateSingle JSON that bundles a flagship replay + Pareto front + environment fingerprint into one signed, citeable artifact — paper-appendix or audit attachment. Schema fragility-certificate-v1.§5.3src/fragility_engine/benchmarks/certificate.py

Physics kernels (deliberately simplified; not calibrated to any real institution)

NameWhat it doesWhere to readCode
Aggregate peg kernelScalar reserves/supply with panic + redemption coupling.§4.1src/fragility_engine/world/stablecoin_peg.py
Two-layer resource-cascade kernelCoupled headrooms (h₀, h₁) with a shared overload state; reduces a Motter–Lai cascade to its smallest still-interesting form.§4.3src/fragility_engine/world/resource_cascade.py
Service-backlog kernelBacklog grows with demand, shrinks with process rate; collapse on sustained over-threshold backlog.§4.4src/fragility_engine/world/service_backlog.py
Liquidity-ladder kernelMargin utilization vs funding-ladder depth with deleveraging on haircut breach; reproduces the margin-call spiral mechanic in 4 state variables.§4.5src/fragility_engine/world/liquidity_ladder.py
Inventory-buffer kernelStock level under demand spikes and fulfillment erosion; sixth reference domain shipped in v0.5.§4.6src/fragility_engine/world/inventory_buffer.py

All kernels share one schedule encoding (src/fragility_engine/adversary/encoding.py), so any attack found by search transfers across kernels unchanged — itself an intentional design choice of this project.

Everything else listed in §2–§6 is textbook or library; we cite the original sources for those below.


2. Adversary search

2.1 Monte Carlo random search — Standard

Draws samples random genomes, evaluates fitness, keeps the best.

2.2 Genetic algorithm (real-valued) — Standard

Population of real-valued genomes, elitist selection, single-point crossover, Gaussian mutation with per-gene mask.

- Genome encoding: adversary/encoding.py (shape (horizon, 2)[0,1]², decoded to (shock_kind, magnitude) per timestep).

- Operators: mutate_genome, crossover_genome in encoding.py.

- Search loop: adversary/search.py::genetic_search (and genetic_vector_search for defender genomes).

2.3 Pareto archive (2-objective dominance) — Standard

Maintains the non-dominated set across (severity, attack_cost); severity maximized, attack_cost minimized.

2.4 Two-dimensional hypervolume — Standard

Closed-form rectangular sweep for two minimized objectives relative to a reference point.

2.5 Alternating attacker / defender co-evolution — Standard

Rounds of (a) attacker GA finds worst schedules against frozen defender, then (b) defender GA finds best parameter vector against frozen attacker; repeat.


3. Explanation / attribution

3.1 Counterfactual remove-steps — Original framing

Re-run the simulation with selected shock timesteps zeroed; compare metrics.

3.2 Greedy schedule minimization (delta-debugging-style) — Standard idea, original application

Greedy removal of shock timesteps while preserving the collapsed outcome — finds the minimal shock set that still breaks the world.

3.3 Mutation-chain path traces — Original

Apply discrete world-physics mutations (e.g. raise base_panic, perturb neighbor edges, change capacity) one at a time in a chosen order; record Δ integral_instability and Δ attack_cost at every step.

3.4 Star-merge attribution — Original

Aggregate several counterfactual bundles that share one baseline into a single graph (baseline → branch₁, baseline → branch₂, …) with Δ-metrics on edges.

3.5 Explanation DAG (schedule + minimization) — Original

Tiny DAG over a minimization report: baseline → minimized, with the minimal event set on the edge.


4. Simulation worlds (physics kernels)

All six worlds are deliberately simplified models. They are not calibrated to any real institution, market, or infrastructure system. Each is original to this project; the underlying mechanisms draw on well-known theory.

4.1 Aggregate stablecoin peg — Original kernel

Scalar pool: reserves drain on redemption shocks; panic decays with a fixed time constant; collapse if price < threshold.

4.2 Network contagion — Standard diffusion on `networkx` graphs

Per-node panic updates by pᵢ' ← (1-β) pᵢ + β · mean(pⱼ for j ∈ N(i)).

4.3 Resource cascade — Original kernel

Two coupled capacity headrooms (h₀, h₁) with a shared overload state. Overload feeds back into headroom; rumor shocks raise overload; reserve hits drop headroom.

4.4 Service backlog — Original kernel

Queue length grows with demand, shrinks with process rate; collapse when backlog crosses threshold for too long.

4.5 Liquidity ladder — Original kernel

Margin utilization vs funding-ladder depth; reserve losses and rumor shocks erode runway; deleveraging mechanic when margin breaches haircut thresholds.

4.6 Inventory buffer — Original kernel

Normalized stock level S and fulfillment capacity F (both in [0,1]). reserve_loss shocks drain stock (demand spikes); rumor shocks erode fulfillment (supplier / logistics trust). Collapse when stock falls below stockout_collapse threshold or fulfillment falls below fulfillment_floor_collapse. Distinct from service backlog (queue depth) and peg worlds.

4.7 Institutional composite — Original framing

Runs the same attacker schedule through several decoupled physics kernels (any subset of aggregate / network / resource_cascade / service_backlog / liquidity_ladder) and emits a side-by-side scorecard JSON. Kernels never exchange state inside a step() — this is a multi-kernel audit, not a multi-physics coupling.


5. Benchmark and reproducibility

5.1 Frozen-benchmark golden-metric harness — Original framework

Six bundles with pinned (genome_seed, rollout_seed) and asserted scalar metrics (within tolerance bands).

5.2 Manifest digest pinning — Standard hash, original workflow

SHA-256 digest of the benchmark inventory; CI fails if digest drifts without an explicit bump.

5.3 Fragility certificate — Original

Bundles a flagship replay + Pareto front + environment fingerprint into a single signed JSON, intended as a paper-appendix or audit attachment.


6. Third-party libraries (provenance for transitive algorithms)

LibraryAlgorithms we rely onCitation
NumPyRNG (PCG64 default), vector ops, linear algebraHarris et al., 2020, *Nature*. PCG: O'Neill 2014.
networkxErdős–Rényi (gnp_random_graph), Watts–Strogatz (watts_strogatz_graph), graph traversalHagberg, Schult, Swart 2008.
numba *(optional, accelerate extra)*JIT compilation of the resource-cascade hot loopLam, Pitrou, Seibert 2015.
matplotlib *(optional, viz extra)*Static plots in the analysis notebooksHunter 2007.

We do not use scipy, pymoo, DEAP, cma, optuna, or any other optimization library — every search, archive, and explanation algorithm above is implemented in this repository.


7. How to cite this work

If you build on the engine, please cite the project alongside the underlying algorithms above:

```bibtex

@software{fragility_discovery_engine_2026,

title = {Fragility Discovery Engine},

author = {AgenticOp},

year = {2026},

url = {https://github.com/AgenticOp-io/fragility-discovery-engine},

version = {v0.5.0}

}

```


8. Where to read the code

You want…Start here
The end-to-end rollout loopsrc/fragility_engine/runner.py
Search loops (MC / GA / Pareto)src/fragility_engine/adversary/search.py
Counterfactual primitivessrc/fragility_engine/explain/counterfactual.py
Mutation chainssrc/fragility_engine/explain/counterfactual_chain*.py
World physics (any domain)src/fragility_engine/world/{stablecoin_peg, stablecoin_network, resource_cascade, service_backlog, liquidity_ladder, inventory_buffer}.py
Benchmark / certificate / hypervolumesrc/fragility_engine/benchmarks/
Frozen JSON schemas (every export)docs/REFERENCE.md schema index