Fragility Discovery Engine v0.5.0 · AgenticOps

Reference: modes, CLIs, environment, schemas

Quick lookup for all command-line flags, output formats, and script names. Step-by-step tutorials are in How to Use.


BYOW CLI (`fragility`, v0.6.0+)

CommandPurpose
fragility search --example capacity-pool\|token-bucketGA/MC on installable tutorial world
fragility minimize --example …Greedy minimal failing schedule
fragility replay PATHValidate replay JSON schema keys
fragility check-world --example …Determinism smoke on example world
fragility certifyFlagship certificate bundle
fragility falsify search --example ranked-storePredicate-violation search (Phase S)
fragility examplesList tutorial example ids

Module surface: fragility_engine.byow, fragility_engine.falsify. Tutorial worlds: fragility_engine.byow.examples.*.


Simulation modes

--modeGA demo scriptPrimary counterfactual interventionsε-sweep axesFixed horizon
aggregaterun_ga_demo.pyremove_stepsinitial_panicNo
networkrun_network_demo.pyremove_steps, base_panic_shift, contagion_beta_shift, edge weightsbase_panic, contagion_beta, edge_weightNo
resource_cascaderun_resource_cascade_ga_demo.pyremove_steps, initial_overload_shift, cascade_coupling_shiftinitial_overload18
service_backlogrun_service_backlog_ga_demo.pyremove_steps, initial_backlog_shift, process_rate_shiftinitial_backlog, process_rate18
liquidity_ladderrun_liquidity_ladder_ga_demo.pyremove_steps, initial_margin_shift, delever_rate_shiftinitial_margin, delever_rate18
inventory_bufferrun_inventory_buffer_ga_demo.pyremove_steps, initial_stock_shiftinitial_stock18

Flags shared across most scripts:


Scripts by task

TaskScript
Smoke testweek1_smoke.py
Export one replayexport_replay.py --mode …
MC searchrun_mc_demo.py --mode …
GA search (aggregate)run_ga_demo.py
GA search (network)run_network_demo.py
GA search (resource cascade)run_resource_cascade_ga_demo.py
GA search (service backlog)run_service_backlog_ga_demo.py
GA search (liquidity ladder)run_liquidity_ladder_ga_demo.py
GA search (inventory buffer)run_inventory_buffer_ga_demo.py
Pareto frontexport_pareto_front.py --mode …
Co-evolution (all modes)run_coevolution.py --mode …
Counterfactual pairexport_counterfactual.py
ε-sweepcounterfactual_epsilon_sweep.py
Mutation chain (aggregate)export_aggregate_counterfactual_chain.py
Mutation chain (resource cascade)export_resource_cascade_counterfactual_chain.py
Mutation chain (service backlog)export_service_backlog_counterfactual_chain.py
Mutation chain (liquidity ladder)export_liquidity_ladder_counterfactual_chain.py
Generic mutation chainexport_counterfactual_chain.py
Joint attribution (resource cascade)export_resource_cascade_joint_attribution.py
Joint attribution (service backlog)export_service_backlog_joint_attribution.py
Joint attribution (liquidity ladder)export_liquidity_ladder_joint_attribution.py
Triple attributionexport_resource_cascade_triple_attribution.py
Merge branchesmerge_counterfactual_attribution.py
Explanation DAGexport_explanation_dag.py
Minimized replayexport_minimized_replay.py
Robustness sweepfragility_robustness_sweep.py
Robustness stretch presetsfragility_robustness_stretch.py --preset small or medium or large
Fragility surface CSVfragility_surface.py --mode … --axis1 … --axis2 …
Find cheapest collapsefind_cheap_collapse.py --mode … --samples …
Compare two replayscompare_replays.py baseline.json counterfactual.json
Mechanism design sweepmechanism_design_policy_sweep.py
Institutional compositeinstitutional_composite_demo.py --triple or --quad
Coevolution Pareto exportexport_coevolution_pareto.py
Frozen benchmarksrun_benchmark_suite.py --validate
Wall-clock timingbenchmark_rollout.py --bundle … --mode …
Certificateexport_fragility_certificate.py
Flagship demo bundlerun_flagship_demo.py
Narrationnarrate_frozen_json.py
LLM prompt bundleexport_llm_narration_prompt.py --bundle <name>
Plot replayplot_replay_timeline.py
Plot Paretoplot_pareto_front.py
Plot counterfactual barsplot_counterfactual_bars.py
Plot ε-sweepplot_epsilon_sweep.py
Plot fragility surfaceplot_fragility_surface_csv.py
Plot composite barsplot_institutional_composite_bars.py
Summarize attribution mergesummarize_attribution_merge.py
Validate viewer presetsvalidate_viewer_presets.py
Check manifest digestcheck_manifest_digest.py
Check manifest inventorycheck_manifest_inventory.py
Check manifest summarycheck_manifest_summary.py
Check bundled artifactscheck_bundled_artifacts.py
Check bundled Pareto HVcheck_bundled_pareto_hypervolume.py
Check flagship bundlecheck_flagship_bundled.py
Frozen JSON digestfrozen_json_digest.py
Regenerate viewer samplesregenerate_bundled_viewer_samples.py
GCE workbench publishgce_publish_workbench.sh
GCE run servergce_run_server.py (systemd service on GCE)
GCE write statusgce_write_workbench_status.py
Static dashboard exportexport_static_dashboard.py
Inventory buffer counterfactualexport_inventory_buffer_counterfactual_chain.py
Inventory buffer mutation chainexport_inventory_buffer_mutation_chain.py
Local CI parityci_local.sh / ci_local.ps1

One-line descriptions for every script: root README.md scripts table.


export_static_dashboard.py — local viewer index

Generates a minimal HTML index at artifacts/dashboard/index.html that links all four bundled viewers (Replay, Pareto, Attribution, Composite) using relative paths. Designed for local use — serve from the repository root with python -m http.server and open in a browser. Not needed on the GCE workbench (the hosted site already provides the same navigation).

```bash

Generate the dashboard index

python scripts/export_static_dashboard.py

Serve locally (open http://localhost:8765/artifacts/dashboard/index.html)

python -m http.server 8765

```

Flags:

FlagDefaultDescription
--out PATHartifacts/dashboard/index.htmlOutput file path
--manifest PATHnoneOptional benchmark_manifest.json to embed a link in the page

When to use it: after running a local batch of scripts that produce artifacts in artifacts/, run export_static_dashboard.py once to get a single clickable entry point to all viewers without needing to remember their paths. The GCE workbench provides the same experience for hosted runs.


export_inventory_buffer_counterfactual_chain.py — inventory buffer counterfactual

Compares a baseline inventory-buffer rollout against a variant with one of three intervention types: remove shock steps, shift initial stock, or shift demand-spike gain.

```bash

Remove first 3 shock timesteps (default)

python scripts/export_inventory_buffer_counterfactual_chain.py --out cf.json

Shift initial stock from 0.88 to 0.60 (low-stock variant)

python scripts/export_inventory_buffer_counterfactual_chain.py \

--variant-initial-stock 0.60 --out cf_stock.json

Shift demand-spike gain (more aggressive demand)

python scripts/export_inventory_buffer_counterfactual_chain.py \

--variant-demand-spike-gain 0.95 --out cf_demand.json

Export baseline and counterfactual as replay JSON files

python scripts/export_inventory_buffer_counterfactual_chain.py \

--variant-initial-stock 0.50 --export-replay-dir ./cf_replays

```

Flags:

FlagDefaultDescription
--out PATHcounterfactual_inventory_buffer.jsonOutput attribution JSON
--seed INT424244Rollout RNG seed
--genome-seed INT7Genome generation seed
--horizon INT18Attacker schedule length
--initial-stock FLOAT0.88Baseline normalized stock at reset
--remove-timesteps LISTfirst 3 stepsComma-separated 0-based indices to zero out
--variant-initial-stock FLOATnoneCounterfactual reset stock (initial_stock_shift intervention)
--variant-demand-spike-gain FLOATnoneCounterfactual demand-spike gain (demand_spike_shift intervention)
--continue-after-collapseoffKeep stepping after stockout for recovery metrics
--max-steps INT40World horizon cap
--export-replay-dir PATHnoneWrite baseline.json and counterfactual.json replay files here

Supply at most one of --variant-initial-stock / --variant-demand-spike-gain. If neither is supplied the script uses remove_steps. Output is an attribution-merge-v1-compatible JSON readable by the Attribution viewer.


export_inventory_buffer_mutation_chain.py — inventory buffer mutation chain

Applies an ordered list of physics mutations cumulatively on an inventory-buffer template, then compares baseline vs final clone. Optional path trace emits one rollout per cumulative prefix (Attribution viewer).

```bash

python scripts/export_inventory_buffer_mutation_chain.py \

--chain-json tests/fixtures/chains/inventory_buffer_demand_fulfillment_chain.json \

--emit-path-trace --out cf_ib_chain.json

```

Chain spec schema: inventory-buffer-mutation-chain-spec-v1. Step kinds include demand_spike_gain, fulfillment_erosion, replenish_rate, stock_recovery, stockout_collapse, fulfillment_floor_collapse, recovery_stock, max_steps.


Frozen reference bundles

Each bundle has pinned seeds and known-good metric values that are checked on every CI run.

bundle_idDomain
aggregate_rollout_v1Aggregate peg
network_er_rollout_v1Network (synthetic ER graph)
network_neighbor_list_rollout_v1Network (neighbor-list topology)
resource_cascade_rollout_v1Resource cascade
service_backlog_rollout_v1Service backlog
liquidity_ladder_rollout_v1Liquidity ladder
inventory_buffer_rollout_v1Inventory buffer

Pinned seeds and golden metrics: src/fragility_engine/benchmarks/suite.py. Validate with:

```bash

python scripts/run_benchmark_suite.py --validate

```


Environment variables

VariableDefaultEffect
FRAGILITY_PERF_GATEunset (off locally)When 1, enables slow benchmark perf test in pytest
FRAGILITY_PERF_GATE_MS240000 in CIWall-clock ceiling for perf gate (ms)
FRAGILITY_RESOURCE_CASCADE_BACKENDnumpynumpy or numba for resource cascade rollouts
FRAGILITY_CI_LOCAL_BUILDunsetWhen 1, ci_local also runs python -m build
FRAGILITY_GCE_INSTANCEVM name for gce_sync_vm.ps1
FRAGILITY_GCE_ZONEGCE zone for sync scripts
FRAGILITY_GCE_PROJECTGCP project id
FRAGILITY_DEPLOY_DIR~/fragility-discovery-engineGCE clone path
FRAGILITY_REPO_URLGitHub SSH URLGCE git remote when deploy key present

Common JSON schemas

Schema idProduced byConsumed by
Replay (schema_version e.g. 0.4.0)rollout_to_replay_dictReplay viewer, narration
pareto-front-v1export_pareto_front, coevolutionPareto viewer
fragility-certificate-v1export_fragility_certificatePapers, audit
benchmark-manifest-v2run_benchmark_suite.py --manifest-outCI artifact, appendix
attribution-merge-v1merge / joint export scriptsAttribution viewer
counterfactual-epsilon-sweep-v1counterfactual_epsilon_sweep.pyPlots, narration
explanation-dag-v1export_explanation_dag.pyNarration
narration-summary-v1narrate_frozen_json.py --json-outExternal reports
fragility-institutional-composite-v1v3institutional_composite_demo.pyComposite viewer
llm-prompt-bundle-v1export_llm_narration_prompt.pyExternal LLM only

Note: composite, sweep, and trade-off chart (Pareto) files are not replay timelines. The replay viewer only accepts replay files — loading other types will show an error.


Repository layout

```

fragility-discovery-engine/

src/fragility_engine/ Library code (worlds, search, explanation, benchmarks)

scripts/ Command-line tools

tests/ Test suite (400+ tests)

benchmarks/ Benchmark documentation and reference bundle definitions

artifacts/ Bundled demo JSON files and browser-based viewers

docs/ This documentation set

pyproject.toml Package definition; extras: dev, viz, accelerate

```

Install with pip install -e ".[dev]". Import name: fragility_engine.