interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / adr / 0031-dual-constraint-pricing.md

305 lines · 29972 bytes Raw Blame History Rendered
1# ADR 0031: DUAL, Constraint Pricing for Soft Resource Budgets
2
3**Status:** Accepted by operator Drake Stapleton, 2026-10-03 (via his "DUAL / Constraint Pricing" brief of that date). The placement in section 9 differs from the strictly serial order in the brief; that difference is an orchestrator engineering call under the operator's standing rule and is stated in section 9.2.
4**Gate:** `DUAL-0` may begin when this ADR is merged to `main`. No DUAL output may influence a production decision before `DUAL-5` passes (section 8).
5**Supersedes:** nothing. **Amends:** nothing. **Extends:** ARCH-0020 (belief / estimation layer: DUAL is a consumer of its estimates, never a producer of observations).
6**Related:** ARCH-0007 (J-Space effect boundary), ARCH-0016 (resident reaction architecture), ARCH-0017 (ARGUS observes, never authorizes), ARCH-0024 (Rust scaffolding, Omega destination), ARCH-0028 (AIEN-TEST receipts), `docs/specs/EVOLUTION_ARENA_SPEC_V1.md`.
7**Workstream:** DUAL-0 to DUAL-5 (section 8); current state and implementation slices in [`docs/plans/dual/DUAL_CURRENT_STATE.md`](../plans/dual/DUAL_CURRENT_STATE.md) (NOT A MASTER PLAN). Sequencing stays in `CURRENT_EXECUTION_PLAN.md` (Lane 8).
8
9Citation note: in this repository "ADR 0031" and ARCH-0031 name the same decision. In other repositories cite it as ARCH-0031.
10
11---
12
13## 1. Context
14
15AIEN already reasons about several resources at once. Omega's capability query keeps separate dimensions and filters to the nondominated (Pareto) set before any ordering (omega `src/runtime/rx_capq.c` `cq_rank`). The Omega cost model predicts latency with calibrated intervals and carries power, verification cost, synthesis cost and code size per arm (`src/runtime/rx_costmodel.h` `RxCostModel`, `RxCmPrediction`). J-Space decides what stays resident by weighing expected work per byte freed against a **hand-set** pressure scalar (`src/runtime/rx_jspace.c` `choose()`; in `enforce_u` the pressure is `1e9` when total residency is over budget, a capacity case, and `1e3` when only the hot arena is over half the budget, a soft case). The legacy serving scheduler uses fixed batch, token and KV-watermark limits (aien-sovereign-core `crates/aien-scheduler/src/lib.rs` `SchedulerConfig`). spark-rsi ranks bottlenecks with fixed weights over hard-coded graph inputs (spark-rsi `src/graph/mod.rs` `rank_bottlenecks`, `src/daemon.rs`).
16
17None of these can answer: **which currently binding resource would give the largest marginal improvement if its budget were relaxed, and by how much?** The scarcity of a resource changes with workload, thermal state and hardware regime, yet every place above encodes it as a constant. Nothing in any of the four repositories computes a shadow price (grep for `shadow price`, `lagrang`, `scarcity`: zero hits; see the current-state document).
18
19Constrained-optimization theory gives a name to the missing quantity: the dual variable, or shadow price, of a constraint. This ADR adopts that idea in a deliberately narrow form.
20
21## 2. Decision
22
23```text
24AIEN ESTIMATES A NONNEGATIVE SHADOW PRICE FOR EACH DECLARED SOFT RESOURCE
25BUDGET, FROM CALIBRATED ESTIMATES WITH EXPLICIT UNCERTAINTY, BOUND TO A
26GENERATION AND AN EVIDENCE ROOT.
27
28PRICES ORDER ALTERNATIVES THAT HAVE ALREADY PASSED EVERY HARD GATE AND
29ALREADY SURVIVED PARETO FILTERING. THEY NEVER DECIDE VALIDITY, ELIGIBILITY,
30PROMOTION OR AUTHORITY.
31```
32
33The four roles stay separate:
34
35```text
36Pareto reasoning decides which alternatives are legitimately competitive.
37DUAL decides what scarce resources are currently worth.
38Verification decides what is valid.
39Authority decides what may act.
40```
41
42```text
43price != truth
44price != permission
45scarcity != correctness
46cheap != valid
47```
48
49### 2.1 What DUAL is not
50
51- Not roadmap M22. M22 `OMEGA_OPTIMIZER` is the sovereign training-optimizer milestone (SGD, Adam, AdamW updating model parameters in shadow state; `doctrine/ROADMAP.md` §3 M22). DUAL updates no model parameter, produces no training step and shares no code path with M22. The name collision ("optimizer") is the only overlap.
52- Not a generic Lagrange-multiplier library, not a solver, not a neural policy. The first realization is a damped, clipped, projected feedback update (section 5) because it is simple, interpretable, measurable and reversible. A more complex controller is admissible only after DUAL-5 evidence shows the simple one is inadequate.
53- Not a second cost model. The Omega cost model stays the one cost model (ARCH-0020 §4); DUAL reads its predictions.
54- Not a second estimator. ESTIMATION (ARCH-0020) produces beliefs and uncertainty; DUAL consumes them.
55- Not a scheduler. Existing schedulers keep every decision until DUAL-5 passes, and afterwards still own the decision; DUAL supplies an input.
56
57## 3. Constraint classes
58
59Every constraint DUAL sees carries exactly one class, declared by the contract that owns the constraint (the capability need, the Arena Evaluation contract, the scheduler configuration). DUAL never assigns or changes a class.
60
61| Class | Examples | Enforcement | Price |
62|---|---|---|---|
63| `INVARIANT` | correctness, semantic validity, security, containment, authority, provenance, verification requirements, AEGIS invariants, typed result contracts (`rc_*`), effect budgets (`RC_E_BUDGET`), sealed-holdout rules | hard gate; failing candidate rejected regardless of any resource figure | **none, ever.** A `DualConstraintState` of this class is refused at construction; it has no lambda field to fill |
64| `CAPACITY` | physical KV pool size, resident-memory ceiling (`JsLimits.max_resident_bytes`), memory bandwidth, device occupancy limits, a caller's hard deadline | hard limit; never exceeded, never relaxed by DUAL | **diagnostic only.** May carry a lambda that states what additional capacity would be worth; that lambda is read-only telemetry (RSI, operator) and is never used to admit an alternative that violates the limit |
65| `SOFT` | latency budget, energy budget, bandwidth share, KV share, compute occupancy target, verification cost, synthesis cost, search/evaluation budget | soft; may be traded against other soft budgets | **priced.** Lambda may order alternatives inside the nondominated set once DUAL-5 passes |
66
67Rules:
68
691. A candidate failing an `INVARIANT` is rejected before DUAL sees it. DUAL receives only candidates that passed every hard gate.
702. The same physical quantity may be `CAPACITY` in one contract and `SOFT` in another (for example a hard KV pool size and a soft KV share target below it). The class belongs to the constraint, not to the resource.
713. Reclassifying a constraint (for example `CAPACITY` to `SOFT`) is a change to the owning contract, made by that contract's owner with its own evidence. DUAL has no path to do it.
724. Existing behavior is recorded, not changed: omega `cq_query_admit` (filter loop at `rx_capq.c:625-645`) treats `latency_budget` and `energy_budget` as hard rejects (`rx_capq.c:639-640`) while also ranking on them; the cost model treats them as soft (`RX_CM_WHY_OVER_BUDGET`); spark-rsi treats `regression_budgets` as hard thresholds. Until an owning contract declares a class explicitly, DUAL treats an existing hard reject as `CAPACITY`. Consequently the latency and energy budgets of a capability need are not priceable at the `cq_rank` site until the need contract declares a SOFT budget beside the hard one.
735. A constraint with no declared class is refused, never defaulted to SOFT. The class declaration is part of the owning contract and is bound into that contract's digest, which `DualConstraintState.budget` cites; a class that does not match the cited contract is refused. DUAL cannot detect an owner that labels a true invariant as SOFT, so the INVARIANT list in this table is normative: a contract that declares any listed invariant as SOFT or CAPACITY is malformed and fails its own review.
74
75## 4. Typed records
76
77DUAL follows ARCH-0020 §2.1 discipline: each record is a separate type with a separate kind byte and a separate digest domain; digests are SHA-256(domain, 0x00, canonical encoding). Field names below are architectural; the realization names them in the house prefix (`RxDual*` / `rx_dual_*` in omega, per the current-state document). The word "shadow" is not used in any type name, because omega already has a `Shadow` structure (`src/runtime/rx_graph.c`) and a recorded ARGUS naming collision (omega `docs/turing/TURING_CURRENT_STATE.md:107-113`).
78
79### 4.1 `DualResource` (registry entry)
80
81| Field | Meaning |
82|---|---|
83| `resource_id` | stable id in the DUAL resource registry |
84| `unit` | declared unit (for example `ps`, `pJ`, `bytes`, `bytes_per_s`, `kv_blocks`, `ppm_occupancy`, `ns_verify`, `ns_synth`) |
85| `scale` | positive normalizer in the same unit, declared per contract; makes pressures dimensionless |
86
87Two values are comparable only if their `unit` strings are identical. Conversion is explicit and recorded; implicit conversion is a refusal.
88
89### 4.2 `DualConstraintState`
90
91| Field | Meaning |
92|---|---|
93| `resource_id`, `unit` | which resource; unit must match the registry and the budget |
94| `class` | `CAPACITY` or `SOFT` (an `INVARIANT` cannot be constructed) |
95| `budget` | value in `unit`, plus the digest of the contract that declared it |
96| `observation_ref` | digest of the ARCH-0020 observation record(s) used, if any; a measured value is never copied into an estimate field |
97| `estimate_ref` | digest of the ARCH-0020 belief or prediction record used |
98| `estimate_kind` | `MEASURED`, `ESTIMATED` or `PREDICTED`, matching the referenced record kind |
99| `estimate`, `uncertainty` | value and standard deviation in `unit`, copied from the referenced record, never computed by DUAL |
100| `calibration_ref` | digest of the EST-3 calibration receipt that covers this signal, or absent; absent means `UNCALIBRATED` |
101| `lambda` | finite, nonnegative; absent for `INVARIANT` (unconstructible) |
102| `lambda_state` | `FRESH`, `STALE`, `FROZEN`, `UNCALIBRATED`, `REFUSED` |
103| `controller_id` | digest of the controller parameters (section 5) that produced `lambda` |
104| `generation` | World generation the estimate is bound to (`RxObjRef` generation, ARCH-0020 EST-4) |
105| `evidence_root` | ARCH-0020 evidence-root chain over every observation that shaped `estimate` and `lambda` |
106| `parent` | digest of the previous `DualConstraintState` for this resource (append-only history) |
107
108### 4.3 `DualPriceVector`
109
110The set of `DualConstraintState` digests for one decision context at one generation, plus the ordered list of resource ids, plus its own digest. A consumer cites one `DualPriceVector` digest per decision.
111
112### 4.4 `DualRecommendation` (advisory)
113
114| Field | Meaning |
115|---|---|
116| `decision_site` | registered site id (section 7.3) |
117| `price_vector` | `DualPriceVector` digest |
118| `candidates` | digests of the nondominated alternatives offered |
119| `actual` | the alternative the production decision-maker chose |
120| `recommended` | the alternative DUAL would have chosen |
121| `predicted` | predicted consequence per resource, with uncertainty and units |
122| `measured` | measured consequence per resource (filled later, from observations) |
123| `error` | measured minus predicted, normalized by stated uncertainty |
124| `authority` | constant `NONE`; a record carrying any other value is malformed |
125
126### 4.5 `DualOutcome`
127
128Binds a `DualRecommendation` to the before and after `DualPriceVector`s, so a later reader can check whether the price of the targeted resource fell (section 7.6).
129
130## 5. Update semantics
131
132### 5.1 Reference update
133
134For each `SOFT` or `CAPACITY` constraint i, at each update tick:
135
136```text
137pressure_i = (estimate_i - budget_i) / scale_i dimensionless
138deadband_i = k_sigma * uncertainty_i / scale_i
139
140if |pressure_i| <= deadband_i: g_i = 0 (inside the noise: no move)
141else: g_i = pressure_i - sign(pressure_i) * deadband_i
142
143lambda_i(t+1) = clip( (1 - rho) * lambda_i(t) + eta * g_i, 0, lambda_max_i )
144```
145
146- `eta` (step), `rho` (leak toward zero, which bounds memory of old scarcity under nonstationarity), `k_sigma` (deadband width), `lambda_max_i` (clip) and the update cadence are controller parameters. Their canonical encoding is hashed into `controller_id`; a change is a new controller.
147- The deadband is the hysteresis: a price moves only when the estimate is outside its own stated uncertainty of the budget, so a noisy measurement cannot drive the price.
148- Lambda is dimensionless because pressure is normalized by `scale_i`. A price-weighted comparison of two alternatives uses `sum_i lambda_i * c_i / scale_i` with every `c_i` in the registry unit; a unit mismatch is a refusal, not a conversion.
149- This is the projected, damped dual-subgradient form. It is the starting point, not a claim of production quality. DUAL-1 measures its behavior on recorded traces; DUAL-5 compares it against simpler baselines.
150
151### 5.2 What the update consumes
152
153- `estimate` and `uncertainty` come from ARCH-0020 records, never from raw counters read by DUAL. Where no calibrated estimator exists for a signal, the state is `UNCALIBRATED` and its lambda may be computed and recorded but may not influence any production decision.
154- An input whose `generation` is older than the controller's declared maximum age, or whose `evidence_root` does not verify, is refused for that tick: lambda is held at its last value and marked `STALE`. A `STALE` lambda is treated by consumers as absent.
155
156### 5.3 Discrete and non-convex reality
157
158AIEN decisions are discrete (which arm, which batch, which victim), the alternative sets are non-convex, observations are delayed and the hardware changes regime. DUAL therefore claims no convergence to a global optimum and no strong duality. It claims only measurable properties, checked at the gates: prices stay finite, nonnegative and bounded; they do not oscillate beyond a declared bound; price-guided choices among valid alternatives beat the declared baselines on pre-registered measures (DUAL-5). A regime change (signalled by persistent out-of-calibration ARCH-0020 innovation, the EST-9 signal; its use as a regime detector is not yet established and must be shown in DUAL-1) resets the affected prices to `FROZEN` until the estimator re-qualifies, rather than letting the controller chase a stale model.
159
160## 6. Ownership and boundaries
161
162| Faculty | Keeps | DUAL's relation |
163|---|---|---|
164| ESTIMATION (ARCH-0020) | beliefs, predictions, uncertainty, calibration | DUAL consumes; never produces an observation or belief |
165| Omega cost model | the one cost model (`RxCostModel`) | DUAL reads predictions; never refits or replaces it |
166| Omega capability query | hard admit, Pareto front, caller order (`cq_rank`) | DUAL may only reorder **inside** the front, after it is built |
167| J-Space | branches, separate score dimensions, residency policy | DUAL may supply the soft hot-arena pressure input to residency choice (replacing the hand-set `1e3`; the over-total-budget `1e9` case is a CAPACITY limit and stays a hard limit) and an allocation preference among nondominated branches; never prunes a nondominated branch, never externalizes |
168| Schedulers | every production decision | advisory input only until DUAL-5; afterwards an input the scheduler may use, never a decision DUAL takes itself |
169| AEGIS | authorization, verification | reads no DUAL output as an authority input |
170| Evolution Arena | candidates, lineage, evaluation, promotion contract | DUAL may allocate search/evaluation budget among verified, nondominated lineages; never ELIGIBLE, never promotion |
171| RSI | proposes and evaluates | reads prices as diagnostic telemetry; holds no authority through them |
172| Promotion right holder | `rx_gen_promote` | DUAL is link-isolated from it |
173
174Security and authority:
175
176- DUAL mints no capability, requests no capability beyond read access to its inputs and write access to its own records, and authorizes no effect. Every DUAL object file passes the existing `nm -u` refusal check used for the cost model and capability query (no `aienos_cap_*`, no `rx_gen_*` admin or promote symbols).
177- No DUAL record may be presented as evidence of correctness, eligibility or authority. A consumer that reads a `DualPriceVector` as a gate input fails its gate.
178- DUAL prices are not secrets but are evidence: they are append-only, digest-bound and replayable.
179
180## 7. Interactions
181
182### 7.1 ESTIMATION
183
184```text
185EST-3 calibration -> EST-4 World belief -> EST-5 uncertainty-aware cost model
186 -> EST-6 predictive evidence -> EST-7 uncertainty-aware J-Space
187 -> DUAL production influence (DUAL-5)
188```
189
190DUAL-0 may be built now. DUAL-1 may run experimentally on recorded traces. No price derived from an uncalibrated estimate may materially control a runtime decision.
191
192### 7.2 Omega and J-Space: the required order
193
194```text
195candidate alternatives
196 -> hard verification (INVARIANT gates, CAPACITY limits)
197 -> separate measurements (no collapse)
198 -> Pareto / nondominance filtering
199 -> DUAL contextual pricing
200 -> preference / allocation among the surviving alternatives
201```
202
203In `cq_rank` the hook is after the front is built and before the caller's order loop. DUAL never adds a dimension that would let a dominated candidate re-enter, and never removes a nondominated one. With DUAL absent, `STALE` or failed, the existing order applies unchanged.
204
205### 7.3 Schedulers (advisory first)
206
207The architecture records two scheduler roles (`doctrine/ARCHITECTURE.md` §2.8): the omega reaction scheduler (`rx_world.c`, semantic; recorded there as the only code that orders faculty work) and physical schedulers (class E), of which the sovereign-core `aien-scheduler` token batcher is the one making batch, admission, chunked-prefill and KV-preemption decisions today. That repository is legacy scaffolding under ARCH-0024; Omega replaces components after conformance. DUAL-3 therefore targets decision sites, not a particular repository:
208
209- each site is registered (`decision_site` id, the decision it makes, its alternatives, its production owner);
210- a site is observed through a read-only tap that records the alternatives the scheduler considered and the choice it made, and changes nothing;
211- the site list for DUAL-3 is in the current-state document; it includes at least one site that makes real admission or preemption decisions on recorded or live workloads.
212
213### 7.4 Evolution Arena
214
215The Arena spec V1 already says: dimensions are measured separately, Pareto filtering precedes ranking, and a scalar fitness may be used for search allocation only, never for ELIGIBLE or promotion (`EVOLUTION_ARENA_SPEC_V1.md` §4.2). DUAL is a principled source of that allocation quantity:
216
217```text
218allocation_value(lineage) = expected_value(lineage) - sum_i lambda_i * c_i(lineage) / scale_i
219```
220
221computed only over verified, nondominated lineages. Because Arena V1 freezes J-Space search policy as outside the mutation surface and requires every automatic decision to be attributable, generation-bound, receipt-producing and recoverable (spec §1, §2.3), a DUAL allocation policy must be declared in the frozen Evaluation contract before candidates are generated, and every allocation emits a causal crumb citing its `DualPriceVector` digest. DUAL answers "which candidate deserves the next experiment"; it never answers "which candidate is valid" or "which candidate is promoted".
222
223### 7.5 RSI
224
225RSI stays off the critical path (`CURRENT_EXECUTION_PLAN.md` §11 H3). When it returns, it reads `DualPriceVector`s as diagnostic telemetry: the resource with the largest fresh, calibrated lambda is the dominant current scarcity, which replaces fixed-weight bottleneck scores built on hard-coded inputs. RSI remains a proposer and evaluator; hard invariants stay in its existing hard layers (spark-rsi `LayerResult.is_hard_invariant`), and DUAL may inform only its soft layers.
226
227### 7.6 The replayable claim DUAL exists to support
228
229> At generation G, resource R was a binding soft constraint with estimated shadow price lambda and uncertainty U, based on evidence root E. AIEN chose action A rather than B because of that scarcity. The predicted consequence was P. The measured consequence was M. After the intervention, lambda changed from X to Y. No hard invariant was relaxed, and all effects remained under existing authority boundaries.
230
231Every field of that sentence maps to a record field: G (`generation`), R (`resource_id`, `class`), lambda and U (`lambda`, `uncertainty`), E (`evidence_root`), A and B (`DualRecommendation.actual` / `recommended` or the post-DUAL-5 decision record), P and M (`predicted`, `measured`), X and Y (`DualOutcome` before and after vectors). DUAL is complete only when this sentence can be produced from replayed evidence by a reader who did not write the code.
232
233## 8. Gates
234
235Every gate is pre-registered: its protocol and thresholds are frozen and digest-bound before evaluation (CAL-0 / EST-3 discipline), a failed run is recorded as FAIL and not retried silently, and receipts follow ARCH-0028. Each gate includes the hostile tests listed; a hostile test that is not killed is a gate failure.
236
237| Stage | Exit token | Prerequisites | Pass condition |
238|---|---|---|---|
239| DUAL-0 | `DUAL_CONSTRAINT_CONTRACT = PASS` | this ADR on `main` | typed records of section 4 with exact canonical serialization round trip, separate kind bytes and digest domains, unit registry, class rules of section 3, staleness detection, property tests; standalone module with zero runtime linkage |
240| DUAL-1 | `DUAL_PRICE_REFERENCE = PASS` | DUAL-0 | reference update of section 5 deterministic and bounded; analytic cases (single binding constraint, slack constraint, two competing constraints) match an independent reference written without reading the implementation; replay on recorded digest-bound traces shows prices finite, nonnegative, within clip, and oscillation within the declared bound; inputs labelled `UNCALIBRATED` where EST-3 has not passed for that signal |
241| DUAL-2 | `DUAL_PARETO_INTEGRATION = PASS` | DUAL-1, EST-5 (cost model inputs), EST-7 (J-Space inputs) | in test builds, DUAL ordering applied only inside the Pareto front; front membership byte-identical with DUAL on and off; with DUAL absent or `STALE`, order identical to the existing order; living build unchanged (DUAL ordering off by default) |
242| DUAL-3 | `DUAL_ADVISORY_SCHEDULER = PASS` | DUAL-1; at least one registered decision site with a read-only tap | over a pre-registered workload set, a `DualRecommendation` is recorded for every decision; production decisions, outputs and timings are identical with the tap on and off within declared measurement noise; recommendation-versus-actual analysis and prediction-error calibration reported; claims of prediction quality are made only for signals with a passing EST-3 receipt |
243| DUAL-4 | `DUAL_ARENA_ALLOCATION = PASS` | DUAL-2, DUAL-3, Arena V1 §0.1 prerequisites closed, DUAL allocation policy frozen in the Arena Evaluation contract | run in observe-and-record Arena runs only (draft Worlds, no real permissions) until DUAL-5 passes; allocation applied only to verified, nondominated lineages; every allocation crumb cites a `DualPriceVector`; DUAL-guided allocation compared against a baseline allocation declared in the same frozen contract, on the same budget; each candidate's ELIGIBLE verdict and promotion requirement are identical with DUAL on and off given identical evidence (DUAL changes which lineages are evaluated next, never the verdict on a lineage) |
244| DUAL-5 | `DUAL_CLOSED_LOOP_QUALIFICATION = PASS` | DUAL-2, DUAL-3, DUAL-4; EST-3, EST-4, EST-5, EST-7 PASS for every signal DUAL consumes | pre-registered comparison against fixed thresholds, fixed weights, priority-only scheduling, the current heuristic scheduler and Pareto-only selection; DUAL must beat the best baseline on the pre-registered primary measure without regressing any pre-registered guard measure (p50/p95/p99 latency, throughput, memory occupancy, energy, KV pressure, preemption count, fairness, budget violations, oscillation, prediction error) beyond its declared margin; the section 7.6 sentence reproduced from replayed evidence by an independent reader. A controller does not pass because it is more sophisticated |
245
246### 8.1 Hostile and negative tests (each must be refused or detected)
247
248| Test | Gate(s) | Expected |
249|---|---|---|
250| construct a `DualConstraintState` of class `INVARIANT` | 0 | refused at construction |
251| hard constraint reaches the price update through any public entry point (record constructor, decoder, update function, price-vector builder) | 0, 1 | refused; gate FAIL if a lambda is produced |
252| `CAPACITY` lambda used to admit an alternative that exceeds the limit | 2, 3, 5 | refused; gate FAIL |
253| reclassify a constraint from inside DUAL | 0 | the exported-symbol list of every DUAL object file is checked against a frozen allow-list; any symbol that writes a class or a contract is a build FAIL |
254| NaN, infinite or negative lambda, estimate, uncertainty, budget or scale | 0, 1 | refused; lambda held, state `REFUSED` |
255| unit mismatch between estimate, budget and scale | 0, 1 | refused; no implicit conversion |
256| stale generation or unverifiable evidence root consumed | 0, 1, 3 | input refused; lambda `STALE`; consumer treats as absent |
257| measured value overwritten by an estimate, or kind byte confusion | 0 | refused (ARCH-0020 kind rule) |
258| oscillation beyond the declared bound on a recorded trace, including a step-change and a square-wave load | 1, 5 | gate FAIL |
259| dominated candidate selected or re-admitted by DUAL ordering | 2, 4 | gate FAIL |
260| nondominated candidate removed by DUAL | 2, 4 | gate FAIL |
261| DUAL recommendation changes a production decision, output or timing during the advisory stage | 3 | gate FAIL |
262| `DualRecommendation.authority` other than `NONE` | 3 | record malformed, refused |
263| DUAL object file links an authority or promotion symbol (`aienos_cap_*`, `rx_gen_promote`, `rx_gen_*` admin) | all | build check FAIL |
264| DUAL attempts to set `proofs_ok`, write Evidence used for ELIGIBLE, or request promotion | 4 | refused; gate FAIL |
265| the ELIGIBLE verdict for the same candidate and the same evidence differs with DUAL on and off | 4 | gate FAIL |
266| uncalibrated estimate materially controls a runtime decision ("materially": the decision differs from the decision taken with every UNCALIBRATED lambda forced to zero) | 2, 3, 4, 5 | gate FAIL |
267| allocation decision without a crumb citing its price vector | 4 | gate FAIL (Arena EA-G1) |
268| controller parameters changed without a new `controller_id` | 1 | digest mismatch detected |
269
270## 9. Placement
271
272### 9.1 Where DUAL sits
273
274```text
275R16 (closed)
276 -> EST-0 .. EST-3 (calibration; EST-3 FAILED on main, v5 in progress)
277 -> EST-4 .. EST-7 (World belief, uncertainty-aware cost model, predictive evidence, uncertainty-aware J-Space)
278 -> DUAL production influence (DUAL-2 needs EST-5 and EST-7; DUAL-5 needs EST-3, EST-4, EST-5, EST-7)
279 -> DUAL-4 inside Evolution Arena (after Arena V1 §0.1 prerequisites)
280 -> later RSI use (H3)
281 -> Physics Zero and later discovery
282```
283
284DUAL-0 and DUAL-1 run now as a standalone module, like EST-0 to EST-3 did: new files only, own build targets, not in `all` or `test`, not included by `src/runtime/`. DUAL-3's advisory tap is read-only and may be built after DUAL-1 without waiting for ESTIMATION, because it has no production authority.
285
286### 9.2 Difference from the brief
287
288The brief proposed a strictly serial order `EST-7 -> DUAL -> EST-8 -> EST-9 -> EST-10`. The live dependencies do not require it: EST-8 (Cortex predictive memory), EST-9 (innovation curiosity signal) and EST-10 (active information gain) consume ESTIMATION, not DUAL, and DUAL does not consume them, except that DUAL uses the EST-9 innovation signal as a regime-change input when it exists (section 5.3) and falls back to freezing prices without it. Making EST-8 to EST-10 wait for DUAL would block Cortex and curiosity work for no technical reason. DUAL is therefore a lane (Lane 8) with dependency edges on EST-5 and EST-7, running beside EST-8 to EST-10, and both must be done before DUAL-4 uses the Arena.
289
290### 9.3 Why not M22
291
292M22 is a milestone row with a fixed meaning (verified SGD, Adam, AdamW realizations; `doctrine/ROADMAP.md`). Folding DUAL into it would change a milestone's meaning by name association, which ADR 0009 ("names state implemented contracts") forbids, and would tie a scheduling and allocation layer to tensor/autodiff prerequisites (M20, M21) it does not need. DUAL is not a milestone; like ESTIMATION it is a workstream with gates.
293
294## 10. Failure behavior
295
296- DUAL failure never blocks work: when DUAL is absent, refuses its inputs, or holds only `STALE`, `FROZEN`, `UNCALIBRATED` or `REFUSED` prices, every consumer uses its existing behavior (Pareto front plus existing order; existing scheduler limits; existing Arena baseline allocation).
297- DUAL failure never weakens a gate: no failure mode changes a hard-gate outcome, a capacity limit, an ELIGIBLE decision or a promotion.
298- Every refusal is recorded with its reason, so the rate of DUAL refusals is itself evidence.
299- A gate failure is recorded as FAIL with its receipt; the controller is not promoted (the EST-3 rule applies).
300
301## 11. Consequences
302
303- AIEN gains a typed, replayable answer to "what is scarce right now and how much would relaxing it be worth", which the hand-set J-Space pressure, fixed scheduler limits and fixed-weight RSI bottleneck scores cannot give.
304- The cost: one new record family, one standalone module, one read-only tap per decision site, and a qualification campaign against honest baselines before any production influence.
305- DUAL may fail DUAL-5. That outcome is acceptable and must be recorded; the simpler baseline then stays in production.