# Darkoza Existence Possibility Compiler — v0.2

**Scenario-robust capability planning with a persistent option frontier**  
Release date: 2026-11-03  
Runtime: Python 3.10+; standard library only; CPU-only.  
Status: working research prototype. Not production integrated, patent-certified or independently reviewed.

## What changed from v0.1

v0.1 valued direct results and immediate future options using point estimates. v0.2 treats the input as a structured set of plausible stress scenarios and introduces five coupled controls:

1. **Range-valued effects:** every mission effect, externality, risk, confidence and resource cost has low/base/high values.
2. **Scenario-conditioned scoring:** each explicit scenario selects the applicable case for effects, externalities, costs, risk and confidence. No scenario probabilities are invented.
3. **Persistent option frontier:** an immediate next-step action receives option credit only if it becomes feasible in every declared scenario. Its value is the minimum of its scenario-specific net potentials. Options available in only some scenarios are listed as fragile and receive no persistent-option credit.
4. **Minimax-regret selection:** each plan receives scores across the declared scenario set. The decision score is minimum scenario score minus regret_weight × maximum regret, where regret is measured against the best candidate plan within each scenario.
5. **Externality and scarcity accounting:** negative effects are subtracted and can trigger a hard limit; resource consumption is priced using explicit resource shadow prices and also constrained by budgets in every scenario.

## Why this is useful

A project may look attractive in a favourable forecast yet fail under resource scarcity, cost inflation, reduced confidence, greater harm or higher risk. v0.2 makes these assumptions explicit and tests the plan across an unweighted stress-scenario set.

The planner does not say how likely any scenario is. The scenario mean is descriptive only, not an expected value, forecast or probability-weighted mean. "Worst case" means worst among the scenarios the problem author supplied; it is not a mathematical guarantee over all possible worlds.

## Decision model

For plan p and declared scenario s:

- Direct(p,s) = sum of weighted benefit ranges × scenario confidence.
- Harm(p,s) = sum of weighted externality ranges.
- Risk(p,s) = sum of scenario risk ranges.
- ResourceCost(p,s) = sum of resource use × declared resource shadow price.
- ResourceBurden(p,s) = mean fraction of positive resource limits consumed.
- PersistentOptionValue(p) = sum, for actions newly feasible in every scenario, of the minimum scenario value of max(0, weighted benefit − weighted harm) × confidence / (1 + 2 × risk).
- OptionBonus(p) = 2 × ln(1 + PersistentOptionValue(p)).
- Score(p,s) = Direct + OptionBonus + TargetBonus − Harm − 4×Risk − ResourceCost − 1.5×ResourceBurden.
- MaxRegret(p) = maximum, over scenarios, of that scenario's best candidate score minus this plan's score.
- RobustScore(p) = min_s Score(p,s) − regret_weight × MaxRegret(p).

The engine also returns a Pareto set and scenario-specific winners/ranks. The score is a declared prioritisation heuristic; its coefficients are not universal constants or empirically calibrated parameters.

## Feasibility and safety

- Requires 2–12 named scenarios.
- Maximum 16 candidate actions, 8 plan steps and 50,000 search states.
- Budget, per-action risk, cumulative risk and weighted externality limits are enforced in every declared scenario.
- Required observations must be verified and have a source.
- Irreversible or approval-gated actions are blocked by default.
- A permitted approval-gated item remains only a proposal. v0.2 neither authenticates nor obtains human approval.
- It never calls tools, spends money, moves data, mutates production or executes a proposed plan.
- SHA-256 digests protect input/output integrity only; they are not signatures or identity proofs.

## Run

    python3 existence_possibility_compiler_v02.py example_problem_v02.json --now 2026-11-03T12:00:00Z --output example_result_v02.json
    python3 -m unittest -v test_existence_possibility_compiler_v02.py
    python3 benchmark_existence_engine_v02.py

All numeric ranges must be monotonic (low <= base <= high). Resource shadow_price is expressed in the same scoring units as the weighted mission score. Scenario sets and all ranges are supplied by the problem author.

## Demonstration

The included fixture is synthetic. It uses three scenarios: resource squeeze, reference and favourable. Seven candidate actions are supplied. The selected plan is:

    evidence_contract -> isolated_replay_lab -> independent_replication

It reaches the declared target under all three supplied scenarios. The same plan is the scenario winner in each scenario (scenario_rank_stability = 1.0 for this fixture). Two next-step actions remain feasible in all scenarios: independent peer review and reusable-capability packaging. An expensive deep-analysis option is feasible only in reference/favourable scenarios; v0.2 marks it fragile and does not give it persistent-option credit. An unreviewed high-risk publication action is blocked.

## Validation

- Python compilation: PASS.
- Unit tests: **34/34 PASS**.
- The tests cover scenario-dependent ranking, robust selection against a favourable-only winner, persistent versus fragile options, high-case resource/risk constraints, externality thresholds, resource shadow prices, missing evidence, approval/reversibility defaults, conflict constraints, regret and reproducible digests.
- Local microbenchmark: 20 warmups, 300 measured runs, Python 3.14.4; three scenarios, seven actions, four search states; median 1.7399 ms, p95 1.9204 ms, p99 1.9704 ms, max 1.9877 ms. This is in-process CPU latency only, not end-to-end, concurrent, production or decision-quality performance.

## Related work and originality boundary

Robust multi-scenario, multiobjective planning and real-options valuation already have substantial prior art. This release does not claim that those concepts are new:

- Shavazipour & Stewart, *A novel multi-stage multi-scenario multi-objective optimisation framework for adaptive robust decision-making under deep uncertainty*, Omega 138 (January 2026), DOI 10.1016/j.omega.2025.103405: https://www.sciencedirect.com/science/article/pii/S0305048325001318
- Shavazipour, Kwakkel & Miettinen, *Let decision-makers direct the search for robust solutions*, Environmental Modelling & Software 183 (2025), DOI 10.1016/j.envsoft.2024.106233: https://doi.org/10.1016/j.envsoft.2024.106233
- Jin et al., *Multi-stage research and development project appraisal under uncertain composite real options*, Information Sciences 716 (October 2025), DOI 10.1016/j.ins.2025.122252: https://www.sciencedirect.com/science/article/pii/S0020025525003846
- Gotoh, Kim & Lim, *Distributionally Robust Optimization is a Multi-Objective Problem* (2025): https://arxiv.org/abs/2507.11350

The implementation-level distinction claimed here is the coupling of (a) a capability-building option frontier, (b) persistent option credit only for next steps feasible across every declared stress scenario, and (c) regret-adjusted worst-scenario scoring with explicit externality and resource shadow-price constraints. This is a scoped design claim, not proof of global novelty, patentability or scientific priority. Full academic/patent prior-art search and independent evaluation remain outstanding.

## Files

- existence_possibility_compiler_v02.py — engine.
- test_existence_possibility_compiler_v02.py — tests.
- example_problem_v02.json / example_result_v02.json — synthetic input/output.
- benchmark_existence_engine_v02.py / benchmark_results_v02.json — local benchmark.
- test-results-v02.txt — test transcript.
- README_v02.md — method and scope.
- index.html — public release page.
- SHA256SUMS — file integrity manifest.

## Next gates

Calibrate ranges from observed outcome data; add scenario-generation and coverage diagnostics; quantify sensitivity of robust rankings to scenario-set omission; model typed non-fungible externalities and cross-resource dependencies; run adversarial and larger-scale benchmarks; obtain independent academic/software review. Any production integration must remain behind authenticated identity, intent-bound authority, durable approvals/replay protection, sandboxing, least privilege, independent postcondition verification and audit.
