diff --git a/CURRENT_EXECUTION_PLAN.md b/CURRENT_EXECUTION_PLAN.md index 47dc650..2652b42 100644 --- a/CURRENT_EXECUTION_PLAN.md +++ b/CURRENT_EXECUTION_PLAN.md @@ -141,6 +141,8 @@ PHYSICS ZERO GENERAL AIEN + SUCCESSION ``` +DUAL constraint pricing (ADR 0031, Lane 8) is not a step on this path. It consumes the BELIEF / ESTIMATION FOUNDATION (production influence waits on EST-4, EST-5 and EST-7), feeds J-Space, the schedulers and Evolution Arena, and runs beside EST-8 to EST-10, not in front of them. It is not roadmap M22 `OMEGA_OPTIMIZER`. + ## 4. Phase A — Project control and architecture cleanup ### A1. Consolidate plan authority @@ -680,6 +682,14 @@ The release campaign must include destructive/adversarial recovery tests: stale - Status 2026-10-01: three frozen calibration attempts FAILED and are recorded (v1 `aien-dev/omega#105`, v2 `#118`, v3 `#129` `d78fd11`); v4: INCONCLUSIVE (omega#153 merged 2026-10-01); v5 in progress (omega#170, open). EST-4/EST-5 stay blocked on a passing calibration. - Status 2026-10-01, Lane 33: v4: INCONCLUSIVE (omega#153 merged 2026-10-01); v5 in progress (omega#170, open). All three attempts VOID, no verdict. EST-3 remains FAILED on main. +**Lane 8 - DUAL constraint pricing (ADR 0031):** DUAL-0 to DUAL-5; current state and slices in [`docs/plans/dual/DUAL_CURRENT_STATE.md`](docs/plans/dual/DUAL_CURRENT_STATE.md). + +- Shadow prices for declared SOFT resource budgets only. INVARIANT constraints (correctness, security, containment, authority, semantic validity, provenance, verification) are never priced; CAPACITY limits are never relaxed and carry diagnostic prices only. +- Order: hard gates, separate measurements, Pareto filtering, then DUAL pricing among the survivors. DUAL never decides validity, eligibility, promotion or authority, and is link-isolated from `rx_gen_*` and `aienos_cap_*`. +- DUAL-0 and DUAL-1 may run now as a standalone module (new files under `omega/src/dual/` and `omega/tests/dual/`, own `mk/dual.mk` targets, not in `all` or `test`, not included by `omega/src/runtime/`). DUAL-3 (advisory scheduler: read-only tap, zero production authority) may follow DUAL-1. +- DUAL-2 waits on EST-5 and EST-7; DUAL-4 waits on DUAL-2, DUAL-3, the Evolution Arena V1 activation hold and an allocation policy frozen in the Arena Evaluation contract, and runs in observe-and-record Arena runs only; DUAL-5 (the only stage that grants production influence) waits on DUAL-2, DUAL-3, DUAL-4 and on EST-3, EST-4, EST-5 and EST-7 for every consumed signal, and must beat simpler baselines. +- Status 2026-10-03: ADR 0031 recorded; no DUAL code exists. EST-3 remains FAILED on main, so no price may influence production. + These lanes converge before AIEN_0 is promoted into the live runtime. ## 17. Immediate next gates @@ -697,6 +707,8 @@ The ADR 0018 workstream runs as Lane 6 and does not reorder these gates. The ADR 0020 workstream runs as Lane 7 and does not reorder these gates; its EST-4 and later stages follow R16 closure. +The ADR 0031 workstream runs as Lane 8 and does not reorder these gates; its production influence follows EST-4, EST-5 and EST-7. + ## Addendum 2026-10-01: language course correction (ADR 0024) By operator decision of 2026-10-01, [ADR 0024](docs/adr/0024-rust-scaffolding-omega-destination.md) supersedes the Rust-to-C migration plan. Rust is scaffolding, Omega is the destination, and C stays only where hardware, boot, ABI or freestanding-kernel reasons justify it. Wherever this plan says the "Rust-to-C port" or "no new Rust", read it as superseded by that ADR. No merged work is reverted; the C kernel and its gates stay. This addendum changes no gate order. diff --git a/docs/adr/0031-dual-constraint-pricing.md b/docs/adr/0031-dual-constraint-pricing.md new file mode 100644 index 0000000..5d6c1d4 --- /dev/null +++ b/docs/adr/0031-dual-constraint-pricing.md @@ -0,0 +1,305 @@ +# ADR 0031: DUAL, Constraint Pricing for Soft Resource Budgets + +**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. +**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). +**Supersedes:** nothing. **Amends:** nothing. **Extends:** ARCH-0020 (belief / estimation layer: DUAL is a consumer of its estimates, never a producer of observations). +**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`. +**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). + +Citation note: in this repository "ADR 0031" and ARCH-0031 name the same decision. In other repositories cite it as ARCH-0031. + +--- + +## 1. Context + +AIEN 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`). + +None 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). + +Constrained-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. + +## 2. Decision + +```text +AIEN ESTIMATES A NONNEGATIVE SHADOW PRICE FOR EACH DECLARED SOFT RESOURCE +BUDGET, FROM CALIBRATED ESTIMATES WITH EXPLICIT UNCERTAINTY, BOUND TO A +GENERATION AND AN EVIDENCE ROOT. + +PRICES ORDER ALTERNATIVES THAT HAVE ALREADY PASSED EVERY HARD GATE AND +ALREADY SURVIVED PARETO FILTERING. THEY NEVER DECIDE VALIDITY, ELIGIBILITY, +PROMOTION OR AUTHORITY. +``` + +The four roles stay separate: + +```text +Pareto reasoning decides which alternatives are legitimately competitive. +DUAL decides what scarce resources are currently worth. +Verification decides what is valid. +Authority decides what may act. +``` + +```text +price != truth +price != permission +scarcity != correctness +cheap != valid +``` + +### 2.1 What DUAL is not + +- 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. +- 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. +- Not a second cost model. The Omega cost model stays the one cost model (ARCH-0020 §4); DUAL reads its predictions. +- Not a second estimator. ESTIMATION (ARCH-0020) produces beliefs and uncertainty; DUAL consumes them. +- Not a scheduler. Existing schedulers keep every decision until DUAL-5 passes, and afterwards still own the decision; DUAL supplies an input. + +## 3. Constraint classes + +Every 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. + +| Class | Examples | Enforcement | Price | +|---|---|---|---| +| `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 | +| `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 | +| `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 | + +Rules: + +1. A candidate failing an `INVARIANT` is rejected before DUAL sees it. DUAL receives only candidates that passed every hard gate. +2. 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. +3. 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. +4. 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. +5. 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. + +## 4. Typed records + +DUAL 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`). + +### 4.1 `DualResource` (registry entry) + +| Field | Meaning | +|---|---| +| `resource_id` | stable id in the DUAL resource registry | +| `unit` | declared unit (for example `ps`, `pJ`, `bytes`, `bytes_per_s`, `kv_blocks`, `ppm_occupancy`, `ns_verify`, `ns_synth`) | +| `scale` | positive normalizer in the same unit, declared per contract; makes pressures dimensionless | + +Two values are comparable only if their `unit` strings are identical. Conversion is explicit and recorded; implicit conversion is a refusal. + +### 4.2 `DualConstraintState` + +| Field | Meaning | +|---|---| +| `resource_id`, `unit` | which resource; unit must match the registry and the budget | +| `class` | `CAPACITY` or `SOFT` (an `INVARIANT` cannot be constructed) | +| `budget` | value in `unit`, plus the digest of the contract that declared it | +| `observation_ref` | digest of the ARCH-0020 observation record(s) used, if any; a measured value is never copied into an estimate field | +| `estimate_ref` | digest of the ARCH-0020 belief or prediction record used | +| `estimate_kind` | `MEASURED`, `ESTIMATED` or `PREDICTED`, matching the referenced record kind | +| `estimate`, `uncertainty` | value and standard deviation in `unit`, copied from the referenced record, never computed by DUAL | +| `calibration_ref` | digest of the EST-3 calibration receipt that covers this signal, or absent; absent means `UNCALIBRATED` | +| `lambda` | finite, nonnegative; absent for `INVARIANT` (unconstructible) | +| `lambda_state` | `FRESH`, `STALE`, `FROZEN`, `UNCALIBRATED`, `REFUSED` | +| `controller_id` | digest of the controller parameters (section 5) that produced `lambda` | +| `generation` | World generation the estimate is bound to (`RxObjRef` generation, ARCH-0020 EST-4) | +| `evidence_root` | ARCH-0020 evidence-root chain over every observation that shaped `estimate` and `lambda` | +| `parent` | digest of the previous `DualConstraintState` for this resource (append-only history) | + +### 4.3 `DualPriceVector` + +The 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. + +### 4.4 `DualRecommendation` (advisory) + +| Field | Meaning | +|---|---| +| `decision_site` | registered site id (section 7.3) | +| `price_vector` | `DualPriceVector` digest | +| `candidates` | digests of the nondominated alternatives offered | +| `actual` | the alternative the production decision-maker chose | +| `recommended` | the alternative DUAL would have chosen | +| `predicted` | predicted consequence per resource, with uncertainty and units | +| `measured` | measured consequence per resource (filled later, from observations) | +| `error` | measured minus predicted, normalized by stated uncertainty | +| `authority` | constant `NONE`; a record carrying any other value is malformed | + +### 4.5 `DualOutcome` + +Binds 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). + +## 5. Update semantics + +### 5.1 Reference update + +For each `SOFT` or `CAPACITY` constraint i, at each update tick: + +```text +pressure_i = (estimate_i - budget_i) / scale_i dimensionless +deadband_i = k_sigma * uncertainty_i / scale_i + +if |pressure_i| <= deadband_i: g_i = 0 (inside the noise: no move) +else: g_i = pressure_i - sign(pressure_i) * deadband_i + +lambda_i(t+1) = clip( (1 - rho) * lambda_i(t) + eta * g_i, 0, lambda_max_i ) +``` + +- `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. +- 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. +- 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. +- 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. + +### 5.2 What the update consumes + +- `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. +- 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. + +### 5.3 Discrete and non-convex reality + +AIEN 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. + +## 6. Ownership and boundaries + +| Faculty | Keeps | DUAL's relation | +|---|---|---| +| ESTIMATION (ARCH-0020) | beliefs, predictions, uncertainty, calibration | DUAL consumes; never produces an observation or belief | +| Omega cost model | the one cost model (`RxCostModel`) | DUAL reads predictions; never refits or replaces it | +| Omega capability query | hard admit, Pareto front, caller order (`cq_rank`) | DUAL may only reorder **inside** the front, after it is built | +| 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 | +| Schedulers | every production decision | advisory input only until DUAL-5; afterwards an input the scheduler may use, never a decision DUAL takes itself | +| AEGIS | authorization, verification | reads no DUAL output as an authority input | +| Evolution Arena | candidates, lineage, evaluation, promotion contract | DUAL may allocate search/evaluation budget among verified, nondominated lineages; never ELIGIBLE, never promotion | +| RSI | proposes and evaluates | reads prices as diagnostic telemetry; holds no authority through them | +| Promotion right holder | `rx_gen_promote` | DUAL is link-isolated from it | + +Security and authority: + +- 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). +- 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. +- DUAL prices are not secrets but are evidence: they are append-only, digest-bound and replayable. + +## 7. Interactions + +### 7.1 ESTIMATION + +```text +EST-3 calibration -> EST-4 World belief -> EST-5 uncertainty-aware cost model + -> EST-6 predictive evidence -> EST-7 uncertainty-aware J-Space + -> DUAL production influence (DUAL-5) +``` + +DUAL-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. + +### 7.2 Omega and J-Space: the required order + +```text +candidate alternatives + -> hard verification (INVARIANT gates, CAPACITY limits) + -> separate measurements (no collapse) + -> Pareto / nondominance filtering + -> DUAL contextual pricing + -> preference / allocation among the surviving alternatives +``` + +In `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. + +### 7.3 Schedulers (advisory first) + +The 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: + +- each site is registered (`decision_site` id, the decision it makes, its alternatives, its production owner); +- a site is observed through a read-only tap that records the alternatives the scheduler considered and the choice it made, and changes nothing; +- 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. + +### 7.4 Evolution Arena + +The 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: + +```text +allocation_value(lineage) = expected_value(lineage) - sum_i lambda_i * c_i(lineage) / scale_i +``` + +computed 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". + +### 7.5 RSI + +RSI 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. + +### 7.6 The replayable claim DUAL exists to support + +> 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. + +Every 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. + +## 8. Gates + +Every 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. + +| Stage | Exit token | Prerequisites | Pass condition | +|---|---|---|---| +| 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 | +| 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 | +| 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) | +| 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 | +| 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) | +| 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 | + +### 8.1 Hostile and negative tests (each must be refused or detected) + +| Test | Gate(s) | Expected | +|---|---|---| +| construct a `DualConstraintState` of class `INVARIANT` | 0 | refused at construction | +| 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 | +| `CAPACITY` lambda used to admit an alternative that exceeds the limit | 2, 3, 5 | refused; gate FAIL | +| 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 | +| NaN, infinite or negative lambda, estimate, uncertainty, budget or scale | 0, 1 | refused; lambda held, state `REFUSED` | +| unit mismatch between estimate, budget and scale | 0, 1 | refused; no implicit conversion | +| stale generation or unverifiable evidence root consumed | 0, 1, 3 | input refused; lambda `STALE`; consumer treats as absent | +| measured value overwritten by an estimate, or kind byte confusion | 0 | refused (ARCH-0020 kind rule) | +| oscillation beyond the declared bound on a recorded trace, including a step-change and a square-wave load | 1, 5 | gate FAIL | +| dominated candidate selected or re-admitted by DUAL ordering | 2, 4 | gate FAIL | +| nondominated candidate removed by DUAL | 2, 4 | gate FAIL | +| DUAL recommendation changes a production decision, output or timing during the advisory stage | 3 | gate FAIL | +| `DualRecommendation.authority` other than `NONE` | 3 | record malformed, refused | +| DUAL object file links an authority or promotion symbol (`aienos_cap_*`, `rx_gen_promote`, `rx_gen_*` admin) | all | build check FAIL | +| DUAL attempts to set `proofs_ok`, write Evidence used for ELIGIBLE, or request promotion | 4 | refused; gate FAIL | +| the ELIGIBLE verdict for the same candidate and the same evidence differs with DUAL on and off | 4 | gate FAIL | +| 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 | +| allocation decision without a crumb citing its price vector | 4 | gate FAIL (Arena EA-G1) | +| controller parameters changed without a new `controller_id` | 1 | digest mismatch detected | + +## 9. Placement + +### 9.1 Where DUAL sits + +```text +R16 (closed) + -> EST-0 .. EST-3 (calibration; EST-3 FAILED on main, v5 in progress) + -> EST-4 .. EST-7 (World belief, uncertainty-aware cost model, predictive evidence, uncertainty-aware J-Space) + -> DUAL production influence (DUAL-2 needs EST-5 and EST-7; DUAL-5 needs EST-3, EST-4, EST-5, EST-7) + -> DUAL-4 inside Evolution Arena (after Arena V1 §0.1 prerequisites) + -> later RSI use (H3) + -> Physics Zero and later discovery +``` + +DUAL-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. + +### 9.2 Difference from the brief + +The 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. + +### 9.3 Why not M22 + +M22 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. + +## 10. Failure behavior + +- 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). +- DUAL failure never weakens a gate: no failure mode changes a hard-gate outcome, a capacity limit, an ELIGIBLE decision or a promotion. +- Every refusal is recorded with its reason, so the rate of DUAL refusals is itself evidence. +- A gate failure is recorded as FAIL with its receipt; the controller is not promoted (the EST-3 rule applies). + +## 11. Consequences + +- 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. +- 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. +- DUAL may fail DUAL-5. That outcome is acceptable and must be recorded; the simpler baseline then stays in production. diff --git a/docs/adr/README.md b/docs/adr/README.md index b8ec237..32cb606 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -41,3 +41,4 @@ Current ADRs: - [0028 - AIEN-TEST: manifest v1, EvidenceReceiptV1, verdict set, resource pools, incremental digests, Omega-native successor](0028-aien-test-runner-and-evidence-contract.md) - Accepted by operator Drake Stapleton, 2026-10-02 (via his approved `aien-test` spec) - [0029 - Verified Crumbs: Omega's verified library is the only dependency resolver](0029-verified-crumbs-single-dependency-resolver.md) - Accepted by operator Drake Stapleton, 2026-10-02 (via his approved Verified Crumb plan); amends ARCH-0028 Decision 4 (receipt contract) - [0030 - Switchboard: one typed router over our own AI accounts](0030-switchboard-ai-account-router.md) - PROPOSED 2026-10-03 +- [0031 - DUAL: constraint pricing for soft resource budgets; hard gates are never priced](0031-dual-constraint-pricing.md) - Accepted by operator Drake Stapleton, 2026-10-03 (via his "DUAL / Constraint Pricing" brief) diff --git a/docs/plans/dual/DUAL_CURRENT_STATE.md b/docs/plans/dual/DUAL_CURRENT_STATE.md new file mode 100644 index 0000000..19e8cec --- /dev/null +++ b/docs/plans/dual/DUAL_CURRENT_STATE.md @@ -0,0 +1,78 @@ +# DUAL Constraint Pricing - Current State and Slices + +**NOT A MASTER PLAN.** This is a finite workstream document for ADR 0031 (ARCH-0031), DUAL constraint pricing. `CURRENT_EXECUTION_PLAN.md` owns sequencing (Lane 8) and `doctrine/ROADMAP.md` owns milestone status. Nothing in this document is a milestone. + +**Written:** 2026-10-03, before any DUAL code existed. Facts come from read-only audits of the commits below; code was read, README and spec claims were not taken as evidence, and every claim used by ADR 0031 was re-checked by hand against the cited lines. + +| Repository | Commit (GitHub `main`) | +|---|---| +| aien-dev/aien-architecture | `b31d6f7` | +| aien-dev/omega | `6d85a16` | +| aien-dev/aien-sovereign-core | `5fdab70` | +| aien-dev/spark-rsi | `f5f1ca2` | + +Status words: IMPLEMENTED, PARTIAL, PLANNED, MISSING. + +## 1. Headline + +- No shadow price, dual variable or scarcity estimate exists in any of the four repositories (case-insensitive grep for `shadow price`, `lagrang`, `scarcity`, `budget pressure`: zero hits). In omega, `lambda` appears only as the cost model's ridge prior precision (`RxCostModel.lambda`). +- Every place that encodes scarcity today encodes it as a constant: J-Space residency pressure, scheduler limits, RSI bottleneck weights. +- The hard-before-soft and Pareto-before-ranking discipline DUAL needs already exists in omega's capability query and in the Arena spec. DUAL must reuse it, not shadow it. +- ESTIMATION is not ready to feed production prices: EST-3 is FAILED on `main` (v1 `aien-dev/omega#105`, v2 `#118`, v3 `#129`); v4 INCONCLUSIVE (`#153`); v5 `#170` is open and interim. EST-4 onward is blocked. + +## 2. Concept inventory + +| Concept | Status | Where | Note | +|---|---|---|---| +| Pareto filtering before ordering | IMPLEMENTED (one site) | omega `src/runtime/rx_capq.c` `cq_rank`, `dominates()`; spec `spec/capability-query-ir.md` | hard admit chain in `cq_query_admit` (filter loop at `rx_capq.c:625-645`: liveness, types, effects, authority ceiling, latency, energy, reliability, evidence, max cost, min confidence) runs first; then the front; then a lexicographic caller order with `CqTradeoffs.tolerance_ppm` bands. No weighted sum. Natural DUAL hook: after the front, before the order loop | +| Ranked alternatives for routing | IMPLEMENTED | omega `rx_skillroute.h` `sr_route_alternatives` | reuses the `rx_capq` order | +| Cognitive routing | IMPLEMENTED, not Pareto | omega `spec/cognitive-routing.md` | feasibility, then least expected energy (time if energy unmetered); unsatisfiable requirement refused | +| Empirical optimizer | IMPLEMENTED, scalar | omega `rx_costmodel.c` `rx_cm_decide` | best `mean_log2_ps` among arms whose upper bound meets the budgets; if none, best overall flagged `RX_CM_WHY_OVER_BUDGET` (budgets act soft here, hard in `cq_query_admit`) | +| Cost model fields | IMPLEMENTED | omega `src/runtime/rx_costmodel.h` | `RxCmPrediction` (`mean_log2_ps`, `sd_log2`, `dof`, `energy_pj`, `fail_p`); `RxCostModel` (`power_mw`, `verify_ns`, `synth_ns`, `code_bytes`, `sd_scale` from `rx_cm_calibrate`); `RxCmFeatures` (`latency_budget_ps`, `energy_budget_pj`, `pressure` bucket) | +| Capability-query cost fields | IMPLEMENTED (advertised or estimated) | omega `rx_capq.h` `CqEntry` / `CqCandidate` | cost (abstract units), latency (us), energy (uJ), confidence and reliability (ppm), evidence level | +| KV capacity or bandwidth budget fields | MISSING | omega | `JS_REAL_KV_STATE` is a realization type only | +| Price-like quantity | PARTIAL (hand-set) | omega `rx_jspace.c` `choose()` and `enforce_u` | keeps bytes resident if best action cost `>= pressure * retain_ns_per_byte`; pressure is `1e9` when total residency is over budget (a CAPACITY case, stays hard) and `1e3` when only the hot arena is over half the budget (soft). The `1e3` case is the first candidate for a DUAL-supplied price | +| J-Space hard limits | IMPLEMENTED | omega `rx_jspace.h` `JsLimits` | `max_resident_bytes`, `max_spill_bytes`, etc. return `JS_ERR_FULL`: `CAPACITY` class | +| Typed result contracts | IMPLEMENTED, orthogonal to cost | omega `src/runtime/rx_contract.h` (`rc_*`, `RC_E_BUDGET`) | hard gates; `INVARIANT` class | +| Estimation records | IMPLEMENTED (standalone), not qualified | omega `src/estimation/est_types.h` (`est_observation`, `est_belief` with `evidence_root`, `est_prediction`, `est_innovation`) | DUAL inputs must reference these records | +| Serving scheduler | IMPLEMENTED (legacy scaffolding, class E) | aien-sovereign-core `crates/aien-scheduler/src/lib.rs` `AienScheduler`, `SchedulerConfig` | defaults `max_batch_size` 64, `max_batch_tokens` 4096, `max_prefill_tokens` 2048, `prefill_chunk_size` 512, `watermark_blocks` 4 (daemon overrides 256 / 16384 / 8192 / 128 / 64); watermark preemption evicts the lowest `Priority`, recompute not swap; admission FIFO, preempted queue first | +| Scheduler metrics | PARTIAL | `SchedulerMetrics` (`lib.rs:55`), `StepMetrics` (aien-abi-core) | running-mean step latency only; no p50/p95/p99; no energy in the scheduler (bench reads power separately) | +| Scheduler observer hook | MISSING | | the considered alternatives (preemption candidates, admission shortfall, budget clamps) are locals inside `build_scheduled_batch`; a read-only tap must expose them | +| RSI hard / soft split | IMPLEMENTED | spark-rsi `src/evaluator/layers/mod.rs` `LayerResult.is_hard_invariant`; `src/evaluator/mod.rs` | hard: correctness, security, style, longitudinal replay; soft: performance, resource efficiency; `admitted = hard && statistical` | +| RSI soft budgets | IMPLEMENTED, fixed thresholds | spark-rsi `src/isolation/manifest.rs` `regression_budgets` | p95/p99 degradation 1.0%, RSS growth 2.0% | +| RSI bottleneck ranking | PARTIAL (placeholder inputs) | spark-rsi `src/graph/mod.rs` `rank_bottlenecks` (0.4 centrality + 0.4 latency ratio + 0.2 error) | graph nodes fed literal constants in `src/daemon.rs`; ranking targets hypotheses only, never admission | +| RSI promotion authority | IMPLEMENTED as proposer-only | spark-rsi `src/ratify.rs` (human merges), `src/actor/judge.rs` `BlindJudge` | | +| Arena allocation rule | PLANNED (spec only) | `docs/specs/EVOLUTION_ARENA_SPEC_V1.md` §4.2, §1, §2.3 | Pareto before ranking; scalar fitness for search allocation only; J-Space search policy outside the V1 mutation surface; every automatic decision accountable | + +## 3. Discrepancies with the brief + +1. **The scheduler the brief describes is legacy.** Fixed batch budgets, KV watermark and preemption live in aien-sovereign-core, which its README calls legacy Linux-hosted scaffolding and `doctrine/ARCHITECTURE.md` §2.8 classes as a physical scheduler (class E), not on the reaction path. The semantic scheduler recorded as authoritative in §2.8 is omega `rx_world.c`, which orders reactions; no batch or KV policy was found there (UNVERIFIED beyond a grep). ADR 0031 therefore targets registered decision sites, not a repository. +2. **Budgets are both hard and soft today.** `cq_query_admit` rejects over-budget latency and energy; `rx_cm_decide` runs them flagged; RSI thresholds reject. ADR 0031 §3 rule 4 treats an existing hard reject as `CAPACITY` until the owning contract declares a class. +3. **Serial placement is not required.** EST-8 to EST-10 do not depend on DUAL (ADR 0031 §9.2). +4. **Name collision.** omega already has a `Shadow` structure (`rx_graph.c`) with an ARGUS collision recorded in omega `docs/turing/TURING_CURRENT_STATE.md:107-113`; the brief's "Shadow Scheduler" is named the advisory scheduler (`DUAL_ADVISORY_SCHEDULER`). +5. **Arena spec header is stale** (still PROPOSED, still calls omega #68 a draft), as already recorded in the belief-estimation current-state document. Not changed here. + +## 4. Decision sites for DUAL-3 (initial list) + +| Site id | Decision | Alternatives | Production owner | +|---|---|---|---| +| `jspace.residency` | keep, move, compress, spill or evict a branch realization | `choose()` actions | omega `rx_jspace.c` | +| `capq.front_order` | order inside the capability-query Pareto front | front members | omega `rx_capq.c` (advisory only: its latency and energy budgets are hard rejects today, so they are CAPACITY and unpriced until a need contract declares a SOFT budget; ADR 0031 §3 rule 4) | +| `costmodel.arm` | realization arm per call | eligible arms | omega `rx_costmodel.c` | +| `serve.admit_preempt` | admission, preemption victim, prefill chunk allocation | waiting/preempted queue heads, running sequences | aien-sovereign-core `aien-scheduler` (scaffolding; moves with its Omega replacement under ARCH-0024) | + +## 5. Implementation slices, in dependency order + +Each slice is one small pull request with its own receipt. None touches `omega/src/runtime/` until slice 5. + +1. **DUAL-0a, records and registry (omega, standalone).** `src/dual/` and `tests/dual/`, own `mk/dual.mk` targets, not in `all` or `test`, not included by `src/runtime/`. Section 4 records, kind bytes, digest domains, unit registry, class rules, canonical encoding round trip, `nm -u` refusal check. Hostile tests for `INVARIANT` construction, NaN/negative/unit mismatch, kind confusion. +2. **DUAL-0b, staleness and evidence binding.** Generation and maximum-age checks; evidence-root verification reusing `est_evidence_root_extend`; references to `est_*` records, never copies of raw observations. Exit `DUAL_CONSTRAINT_CONTRACT = PASS`. +3. **DUAL-1a, reference update.** Section 5.1 update as a pure function of (state, input, controller parameters); `controller_id` digest; analytic cases plus an independent reference written without reading the implementation. +4. **DUAL-1b, replay on recorded traces.** Digest-bound traces already on disk (for example the R15 machine-state series used by EST-2) plus synthetic step-change and square-wave loads; oscillation bound pre-registered; inputs labelled `UNCALIBRATED`. Exit `DUAL_PRICE_REFERENCE = PASS`. +5. **DUAL-3a, read-only tap at one site.** Start with `jspace.residency` (omega, smallest blast radius, already has a price-shaped input) or `serve.admit_preempt` (real batch decisions). Tap records alternatives and the actual choice; a with/without comparison proves identical decisions. This is the first change under `src/runtime/` and must stay clean of the R16 loop-inventory patterns. +6. **DUAL-3b, advisory campaign.** Pre-registered workloads, `DualRecommendation` for every decision, prediction-error report. Exit `DUAL_ADVISORY_SCHEDULER = PASS`. +7. **DUAL-2, Pareto integration (test builds).** Waits on EST-5 and EST-7. Exit `DUAL_PARETO_INTEGRATION = PASS`. +8. **DUAL-4, Arena allocation.** Waits on DUAL-2, DUAL-3, the Arena V1 activation hold and a DUAL allocation policy frozen in the Arena Evaluation contract; observe-and-record Arena runs only until DUAL-5. Exit `DUAL_ARENA_ALLOCATION = PASS`. +9. **DUAL-5, closed-loop qualification.** Waits on DUAL-2, DUAL-3, DUAL-4 and on EST-3, EST-4, EST-5, EST-7 for every consumed signal. Exit `DUAL_CLOSED_LOOP_QUALIFICATION = PASS`. + +Slices 1 to 4 are permitted now by the same rule that let EST-0 to EST-3 run as a standalone module. Slices 5 and 6 need no ESTIMATION gate because they have no production authority. Slices 7 to 9 wait as stated. diff --git a/doctrine/ARCHITECTURE.md b/doctrine/ARCHITECTURE.md index 42f5281..88eb1a6 100644 --- a/doctrine/ARCHITECTURE.md +++ b/doctrine/ARCHITECTURE.md @@ -235,6 +235,7 @@ This table names, for each runtime concept, the one implementation that is autho | Evidence | omega `src/omega_evidence.{h,c}` (digest-named `evidence//.json`) guarded by `.github/workflows/evidence-immutable.yml`; `rx_world.c` causal crumbs; aienos `native/argus/` event ingest | Pre-R fixed-name receipts for M4-M19: historical records, kept unchanged. Not classified by the R16 map | No shared cross-repo evidence schema exists. The R16 map lists "duplicate causal state" as open: the R4 causal-trace target is not yet named | | Cortex | omega `src/runtime/rx_cortex.{c,h}` by [ADR 0022](../docs/adr/0022-canonical-cortex-owner.md): contract, single writer (`cx_claim_writer`, exclusive journal lock) and journal; World execution enters only through `rx_cortex_record.c` | sovereign-core `crates/cortex-rs` (live Linux LLM-stack Cortex): legacy, retire not port. aienos `crates/aienos-cortex` (Rust epistemic store): legacy, retire not port. Records enter the canonical store only as `CX_K_IMPORTED` claims | Host only, one in-memory tier plus journal, L1/L2/L3 tiers not implemented, not in the R13 living-system build (built in the state-projection test and `test-cortex`), no Fabric or remote Cortex. Not in the R16 map. Owner recorded 2026-09-30 from `aien-dev/omega#114` (`43dcb04`) | | J-Space | No authoritative owner recorded | omega `src/runtime/rx_jspace.{c,h}` host reference, built at the re-check only into the `rx_branch_reuse` test target, since omega#116 also in `test-jspace-prod` (evidence `evidence/BRANCH_REUSE`), not in the R13 living-system build. aienos `JSpaceWorld`: legacy | Missing on the production reaction path (EST-7 planned). 2026-09-30: production local-only `rx_jspace` merged (`aien-dev/omega#116`, `529ebfa`, own CI test target); remote operations return `JS_ERR_REMOTE`; still not in the R13 living-system build | +| Resource scarcity pricing (DUAL) | No owner yet: ADR 0031 records the contract; planned home omega `src/dual/` (standalone) then `src/runtime/rx_dual.{c,h}` | none. Price-like inputs today are constants: omega `rx_jspace.c` residency pressure (`1e9` / `1e3`), sovereign-core `aien-scheduler` `SchedulerConfig` limits (E), spark-rsi fixed-weight `rank_bottlenecks` | Missing. DUAL prices SOFT budgets only, never INVARIANT constraints; it orders survivors of hard gates and Pareto filtering and holds no authority (ADR 0031) | A concept moves to a new owner only through an accepted ADR or an R16 gate result recorded in `ROADMAP.md`. diff --git a/doctrine/ROADMAP.md b/doctrine/ROADMAP.md index f8244ec..788cb42 100644 --- a/doctrine/ROADMAP.md +++ b/doctrine/ROADMAP.md @@ -321,6 +321,7 @@ Status 2026-10-01: R16 is closed (`aien-dev/omega#112` `3dd5eaa`), so EST-4 and ### M22 — `OMEGA_OPTIMIZER` Omega-native semantics for SGD, Adam, and AdamW, with verified CPU reference realizations and optional accelerator-fused realizations. - Status 2026-10-01: table status stays PLANNED; no exit gate is met. Discrepancy recorded: substrate work has started although the vocabulary row reads "Not started". `aien-dev/omega#140` (`54826a3`) merged a shadow-state optimizer substrate with one atomic generation switch, E5 two-tier provenance and a float32 SGD path; receipt omega `evidence/M22/receipts/eaa0cdeae9f348b19b80377baaeb5e5dea6a6577e9385e7a2a3c15caab24c5c8.json` records substrate tests PASS and "M22 NOT QUALIFIED: optimizer substrate + SGD path only; no tensor/autodiff integration (waits M20/M21)". Adam/AdamW are not implemented. +- Scope note 2026-10-03: M22 means training optimizers that update model parameters (SGD, Adam, AdamW). Adaptive pricing of soft machine resource budgets (DUAL, ADR 0031, `CURRENT_EXECUTION_PLAN.md` Lane 8) is a separate workstream with its own gates; it is not part of M22, and no M22 status changes because of it. ### M23: `OMEGA_SEARCH_GUIDE_TRAINING` - Status 2026-10-01: table status stays PLANNED; no exit gate is met (training NOT_RUN, waits on M22). Discrepancy recorded: the corpus prerequisite exists. G1 search-trace corpus capture PASS (`aien-dev/omega#122` `ce7821d`; receipt omega `evidence/M23/receipts/m23-corpus-ee4982119af7244086187c9b643cb9c1823c6b0a2b796f861d2d4077edb5256d.json`); G3 sealed-holdout commitment format PASS, format only, nothing sealed (`#122`), commitment owner signature with TEST keys (`#130` `7fb59d3`). Sealing and real owner signing are BLOCKED_OPERATOR.