# Darkoza Existence Possibility Compiler (EPC) v0.1

**A deterministic, bounded planner for increasing future capability without sacrificing continuity.**  
Release date: 2026-11-03  
Runtime: Python 3.10+; standard library only.  
Status: working research prototype; not integrated into production agents; not a patent or global-priority claim.

## The invention

Most project plans score the immediate payoff of an action. EPC adds a second, explicit quantity: **new option value** — the value of immediately available future actions unlocked by the proposed experiment.

An intervention is scored not only for what it accomplishes, but also for what it makes possible next. The planner searches dependency-compatible action sequences under declared resource budgets, evidence prerequisites, risk limits, reversibility rules and approval constraints. It then exposes a Pareto set rather than hiding every trade-off behind a single rank.

This is a Darkoza research synthesis and software implementation. It is not a claim that option-value planning, dependency graphs, multi-criteria optimisation, or evidence-gated agents are new worldwide. Related work is listed below.

## Core mechanism

1. **State:** declare capabilities already present, target capabilities, sourced observations, resource budgets and the Discover / Create / Preserve / Evolve weights.
2. **Interventions:** describe candidate actions with required/provided capabilities, measured or estimated effects, confidence, risk, resource cost, evidence requirements, reversibility, preconditions, success metrics, verification and rollback.
3. **Bounded search:** enumerate dependency-valid action sequences up to the chosen step limit (maximum 8) and hard state limit (50,000). Each declared action set is considered at most once.
4. **Counterfactual option frontier:** compare the immediately feasible next actions after a plan with those already available before it. Only newly unlocked next-step actions receive option value. Deeper opportunity chains are not inferred.
5. **Decision:** rank plans using direct mission value, newly unlocked option value, target progress, declared risk, uncertainty, budget use, reversibility and approval requirements. Return Pareto alternatives.
6. **Proof contract:** emit per-action preconditions, required observations, success metrics, verification steps and rollback instructions. Bind the output to SHA-256 digests of the exact input and decision.

The search is deterministic for a fixed input and clock. It is bounded and transparent rather than an opaque model judgement.

## Scoring model

Let a be an action and w_d the normalized weight for each mission dimension d.

- Weighted effect: I(a) = sum over d of w_d × declared_effect(a,d).
- Direct plan value: sum over selected actions of I(a) × declared_confidence(a).
- New option value: sum over newly available next actions of I(a) × confidence(a) / (1 + 2 × risk(a)).
- Option bonus: 2 × ln(1 + new_option_value).
- Risk penalty: 4 × sum of declared action risk.
- Uncertainty penalty: 1.5 × sum of I(a) × (1 - confidence(a)).
- Resource penalty: 1.5 × mean fraction of declared resource budgets consumed.
- Target bonus: 4 × fraction of target capabilities reached.
- Irreversibility penalty: 3 per irreversible action; approval penalty: 1 per approval-gated action.

The final score is a transparent prioritisation heuristic, **not** a probability, market valuation, scientific measurement or guarantee. Confidence, effects, risk and costs are supplied by the problem author. Evidence grade is displayed but does not automatically certify the evidence.

## Safety boundary

- **Plan only.** EPC never executes tools, writes to target systems, transfers data, spends money, authorizes users, changes permissions or deploys software.
- Unverified required observations fail closed.
- Reversibility is required by default; high-risk/irreversible proposals are blocked unless the problem explicitly allows approval-gated proposals.
- A proposal marked approval-required remains a proposal; approval is not generated by EPC.
- The SHA-256 decision digest is an integrity checksum, not a digital signature, identity proof or non-repudiation.
- A downstream execution service would still need authenticated identity, intent-bound authority, durable replay protection, sandboxing, least privilege, explicit approval, independent postcondition checks and tamper-evident audit.
- The score is only as good as the input estimates and observation provenance. A malicious or careless author can supply misleading values.

## Run it

```bash
python3 existence_possibility_compiler.py example_problem.json \
  --now 2026-11-03T12:00:00Z --output example_result.json

python3 -m unittest -v test_existence_possibility_compiler.py
```

Use a fresh timestamp for a live run or supply `--now` for reproducibility. All costs must use the units defined by `resource_budget`. Candidate action count is limited to 16 in v0.1.

## Demonstration

The included fixture is synthetic and does not represent Darkoza production measurements. Under its declared budget, the engine finds:

`evidence_contract → isolated_replay_lab → independent_replication`

The target capability is reached. The plan immediately opens two next-step choices: independent peer review and reusable-capability packaging. An unreviewed, irreversible public-claim action is blocked by the risk, reversibility and approval rules.

## Reproducibility and files

- `existence_possibility_compiler.py` — engine and CLI.
- `test_existence_possibility_compiler.py` — adversarial and functional unit tests.
- `example_problem.json` — synthetic input fixture.
- `example_result.json` — reproducible example decision.
- `benchmark_existence_engine.py` and `benchmark_results.json` — local microbenchmark (not a production workload benchmark).
- `README.md` — method, use and limitations.
- `index.html` — public release note.

## Related work and scope of originality

This prototype is informed by, and deliberately distinguished from, prior work:

- Kadyrbek & Mansurova, *Proof carrying agent actions enable verifiable licensing of language model tool use*, Scientific Reports, published 13 October 2026: https://doi.org/10.1038/s41598-026-74900-x. PCAA checks whether an action carries typed support for a governed invocation; EPC instead ranks capability-building plans by their newly unlocked next-step option frontier.
- Li et al., *XFlow: An Executable Protocol Programming System for Reliable Multi-Agent Workflows*, arXiv:2606.14790 (11 June 2026): https://arxiv.org/abs/2606.14790. XFlow compiles workflow commitments into an executable protocol; EPC is a bounded proposal/portfolio planner and does not orchestrate agents.
- United Nations University, *Engineering and Governing the Agent Harness* (2026): https://unu.edu/publication/engineering-and-governing-agent-harness-technology-and-policy-framework-runtime-layer-agentic-ai. The report discusses interruptible, resumable and reversible agent execution and approval boundaries.

The implementation's distinctive contribution is the explicit use of the **newly unlocked immediate option frontier** as a score component, combined with resource-bounded dependency search, reversibility/evidence constraints, Pareto alternatives and an inspectable experiment contract. This is a design claim about this implementation, not proof of global novelty, patentability, or priority. A full academic/patent prior-art search and independent review have not been completed.

## Roadmap

v0.2 should add calibrated uncertainty ranges, typed negative externalities, dependency explanations and scenario sensitivity. A later integration must consume verified telemetry rather than trust manually supplied resource figures. Production execution, cross-tenant identity, durable approvals, independent replication and field evaluation are separate gates.
