Skip to content

sadpig70/failfutures

Repository files navigation

FailureFutures infographic

FailureFutures

CI License: MIT

FailureFutures turns physical fragility into a cleared, tradable instrument. The most fragile (most likely-to-fail) asset issues the most futures; a clearinghouse pools them, holds margin, and sells an aggregate index to (re)insurers. One engine (fragility → mint → clear → index) runs over two thin domain adapters:

Given a portfolio of fragile assets, which ones can mint instruments, how much can each issue under a moral-hazard cap, and does the pool clear into a sellable index?

It prices and gates each asset's fragility, mints instruments under a bounded rule, pools and clears them, and emits a posture verdict: clearable, partial, or blocked.

The Insight

One L7_FailureAsFeature → L11_DomainTransplant → L19_Aggregation move, applied to two domains that are structural twins:

  • DroughtDesk (IDEA-003): water/power curtailment-failure spoils immunology product in cold chains. Make that failure the asset, sell curtailment futures, and aggregate sites into a spoilage index for reinsurers.
  • OrphanX (IDEA-004): substrate-abandonment strands autonomous robot field fleets. Make that failure the asset, mint orphaning credits, and sell salvage-rights / abandonment indices to insurers and recyclers.

The thesis: both are the same engine wrapped around one domain adapter each. Build the engine once; isolate every domain difference behind a single contract, the FragilitySignal. A third vertical is then just one more adapter.

Moral Hazard, Forced into Code

"The more fragile, the more issuance" rewards neglecting fragility. Three mechanisms in the mint rule counter it (DESIGN R2):

  1. Verification gate — an unverified fragility mints nothing (blocked). You cannot issue against a number nobody measured.
  2. Issuance cap — issued notional ≤ max_issuance_fraction × real exposure. You can never over-issue beyond the genuine loss exposed.
  3. Remediation credit — a verified reduction in fragility vs the prior baseline earns a credit that offsets cleared exposure. Improving pays; neglecting does not — even an asset that improved its way below the mint threshold still earns the reward.

Quickstart

python -m failfutures sample --adapter drought --output examples/drought_sample.json
python -m failfutures clear  --input examples/drought_sample.json
python -m failfutures report --input examples/drought_sample.json --output examples/drought_report.md

python -m failfutures sample --adapter orphan --output examples/orphan_sample.json
python -m failfutures clear  --input examples/orphan_sample.json

Portfolio Spec

The portfolio declares its adapter, a policy, and raw domain assets. The CLI runs the named adapter, then the one core engine.

{
  "adapter": "drought",
  "policy": {
    "min_fragility": 0.05, "require_verification": true, "max_issuance_fraction": 0.5,
    "remediation_rate": 0.25, "min_pool_instruments": 2, "min_verified_fraction": 0.5
  },
  "assets": [
    { "asset_id": "cc-nordic", "water_curtailment_prob": 0.4, "power_failure_prob": 0.2,
      "cooling_redundancy": 0.3, "product_value_at_risk": 8000000.0,
      "curtailment_verified": true, "baseline_fragility": 0.6 }
  ]
}

How It Works

adapter:  raw domain measurements ---> FragilitySignal(fragility, exposure, verified, baseline)
                                        (the only thing the engine sees)

engine (same for every domain):
  oracle   : verification gate + priced_exposure = fragility × exposure
  mint     : notional = priced_exposure × MINT_RATE
             issued   = min(notional, exposure × max_issuance_fraction)        # R2 cap
             remediation = max(0, baseline − fragility) × exposure × rate       # R2 reward (verified only)
             outcome:
               fragility < min_fragility            -> blocked
               require_verification & not verified   -> blocked
               notional > cap (clamped)              -> conditional
               otherwise                             -> realizable
  clear    : pool clears iff #mintable ≥ min_pool_instruments
             AND verified_fraction ≥ min_verified_fraction
  index    : index_value = Σ priced_exposure ; premium = index_value × PREMIUM_RATE

The portfolio posture aggregates:

  • pool clears and index sellable → clearable
  • any asset mints → partial
  • nothing mints → blocked (exit 1)

Domain fragility formulas (isolated in the adapter)

Adapter Fragility
drought clamp( (1 − (1−water)(1−power)) × (1 − cooling_redundancy) )
orphan clamp( stranding × retrieval_cost_ratio × (1 − salvage_recovery) )

An unknown field, a negative magnitude, or a fragility outside [0, 1] is a blocking issue with a nonzero exit, never a stack trace.

MVP Scope

FailureFutures produces a clearing-readiness appraisal and indicative issuance under a declared policy, not a regulated securities offering, an insurance contract, or a settlement of funds. It prices, gates, and flags; it does not transact.

Provenance

FailureFutures is the concrete beachhead of two IdeaFirst ideas unified as one unit: IDEA-003 (DroughtDesk) and IDEA-004 (OrphanX), both reached via the L7_FailureAsFeature → L11_DomainTransplant → L19_Aggregation lens stack (CIX-20260607-001 ← IDX-20260607-001 ← TCX-20260606-001). It is a sibling of WasteStack, RoboTrace, InferMesh, CertMesh, SettleMesh, SpendMesh, ReleaseMesh, ClimateMesh, SovMesh, FlowMesh, and SignalMesh.

License

MIT — see LICENSE.

About

Price physical fragility, mint moral-hazard-bounded instruments, and clear them into a tradable index — one engine, two domain adapters (cold-chain curtailment + robot-fleet orphaning).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages