Production Eval Architecture Contract
Goal
- Freeze the clean production destination before prototype code can become architecture by inertia.
- Use pure typed transformations, one owner per transform, explicit state/effect boundaries, and one closed program.
- Keep the tree-walker independent and require absolute evaluator/VM/LLVM/AOT/
ori_backendparity.
Deliver a decision record plus enforcement tests, never a feature implementation. The vertical artifact spine already exists and is hot; the horizontal physical-plan split is prose. Name-freeze precedes every other item here.
| Contract half | Grounded state | Consequence for this section |
|---|---|---|
Vertical spine CanonProgram -> realize_closed_program -> ExecutableProgram::validate -> BytecodeProgram -> VerifiedProgram -> PhysicalVmPlan | exists, tested, carries the repo’s #1/#3 hotspots | pin and narrow it; do not rebuild it |
Horizontal split VmLayoutPlan | CompiledLayoutPlan(TargetSpec) | zero definitions in tree | the ADR coins it, or adopts a sibling plan’s coinage |
Dependency direction (no oric/ori_llvm/ori_backend edge from ori_vm) | already true; zero phase-order crate cycles | pin what already holds, first and independently |
- Land the dependency/impurity architectural tests before the ADR; they are unblocked today and depend on no naming decision.
- Treat every remaining item as blocked on the name freeze.
Destination Dataflow
source/module graph
|
v
oric frontend queries: parse -> typecheck -> canonicalize
|
+-------------------- CanonProgram ---------------------> ori_eval
| |
v v
oric::realization (one owner; no backend callbacks) EvalOutcome
|
v
ori_repr::ExecutableProgram::validate()
closed callable inventory + post-AIMS ARC + ReprEvidence + AIMS carriers
|
+--------------------------+--------------------------------------+
| |
v v
ori_vm::plan_layout ori_target::TargetSpec
| |
v v
BytecodeProgram -> verify -> VerifiedProgram ori_repr::CompiledLayoutPlan
| / \
v v v
VmSession::execute ori_llvm adapter ori_backend
| LLVM artifact BIR/MIR/emit
v | |
VmOutcome v v
LlvmOutcome BackendOutcome
machine artifact or
complete WebAssembly module
| | |
+--------------------------+-----------------------------+--------------------+
|
normalized ExecutionOutcome
|
oric presentation/diagnostic boundary
Names are illustrative until the architecture decision record is locked; ownership and dependency direction are normative.
- Keep the tree-walker as an independent semantic oracle over canonical IR.
- Never force the tree-walker to consume post-AIMS ARC.
- Derive
CanonProgramandExecutableProgramfrom one immutable frontend snapshot with shared provenance. - Feed the exact validated
ExecutableProgramidentity and callable inventory to VM, LLVM, andori_backend. - Emit WebAssembly directly through
ori_backend; excludeori_evalandori_vmfrom its code generation.
Crate and Module Ownership
| Owner | Production responsibility | Forbidden responsibility/dependency |
|---|---|---|
oric | File/module orchestration, frontend queries, import closure, one realization call, command-valid execution/codegen selection, CLI/test isolation, outcome presentation, diagnostic conversion. | No VM opcode/value/runtime semantics; no duplicate ARC/AIMS/derive/impl discovery per backend. |
ori_eval | Canonical-IR tree-walker, const-evaluation engine, and representation-abstract semantic oracle. | No bytecode fallback service, WASM deployment mode, or VM/compiled representation policy. |
ori_arc | ARC lowering, CFG/ownership/AIMS analysis, and verified post-AIMS operations. | No backend dispatch, bytecode encoding, LLVM ABI, or CLI state. |
ori_target | Backend-neutral target identity, data model, endianness, calling-convention descriptors, and compiled/WASM ABI identity. | No LLVM TargetMachine, BIR/MIR, object writer, linker, sysroot discovery, or compiler-session state. |
ori_repr | Backend-neutral ExecutableProgram, stable callable/runtime identities, neutral ReprEvidence, logical facts, validation, and pure VM/compiled physical planners. | No dependency on oric, ori_vm, ori_llvm, or ori_backend; no backend handles, executor callback, or process state. |
ori_codegen | Pure compiled-backend interface: validated CodegenInput, backend-private-module compile/finalize trait, typed artifact request/result, and backend-neutral error taxonomy. | No semantic analysis, layout/ABI computation, concrete backend, linker/sysroot policy, VM storage, or process state. |
ori_vm | Pure executable-program-to-bytecode compilation, bytecode verification, safe VM values/frames, dispatch, per-run runtime context, and typed VM errors. | No dependency on oric or ori_llvm; no parsing/typechecking/canonicalization/ARC policy; no global mutable evaluator state; no tree-walker/native fallback. |
ori_llvm | ori_codegen::CodegenBackend implementation: LLVM IR/attribute adaptation and typed native-object/complete-WASM finalization from the shared executable, explicit target, and compiled-layout plan. | No independent callable discovery, representation/layout/ABI classification, derive emission path, ARC/AIMS orchestration, or VM ABI leakage. |
ori_backend | ori_codegen::CodegenBackend implementation: Ori BIR/MIR lowering, instruction selection, register allocation, and typed target finalization for x86-64, aarch64, riscv64, s390x, and complete WebAssembly modules; later JIT tier. | No independent semantic discovery, representation/layout/ABI classification, ARC policy, LLVM dependency, or VM-private storage dependency. |
ori_rt | Compiled-runtime primitives that faithfully implement validated layout/drop/COW plans through explicit runtime-call identities or narrow adapters. | No logical AIMS policy, compiler session, backend selection, or VM dispatch policy. |
This table states the destination, not the build graph. Ground every row before the ADR cites it:
| Row | Grounded state at HEAD | ADR obligation |
|---|---|---|
ori_target | crate does not exist (24 crates in compiler/) | coin or drop the owner; do not cite it as current |
ori_backend | crate does not exist | express as a contract clause plus a pointer to native-backend#s-4fa1f7d2 |
ori_llvm implements ori_codegen::CodegenBackend | FALSE as written: the sole production impl is oric/src/commands/backend.rs:69 (LlvmBackend); ori_llvm/Cargo.toml declares no ori_codegen dependency | decide whether the impl moves into ori_llvm or the row is rewritten to name oric as adapter owner; coordinate with backend-boundary#s-90024726, which owns the wiring |
ori_codegen seam is enforced | partially: oric/tests/backend_stub_conformance.rs pins the trait with two outside-crate implementors | keep the conformance gate; it is the seam’s only cross-crate proof |
ori_vm forbidden deps | holds: deps are {ori_arc, ori_ir, ori_registry, ori_repr, ori_types} | pin it as an architectural test, not a convention |
ori_repr forbidden deps | holds: deps are {ori_ir, ori_registry, ori_types, ori_arc} | pin it; note ori_repr -> ori_target below is unrealizable until the crate exists |
-
Allow
oric -> {ori_eval, ori_vm, ori_codegen, ori_llvm, ori_backend}andori_vm -> ori_repr. -
Allow
{ori_llvm, ori_backend} -> {ori_codegen, ori_repr, ori_target}andori_codegen -> {ori_repr, ori_target}. -
Allow
ori_repr -> {ori_target, ori_arc, ori_types, ori_ir}and executor/runtime adapters ->ori_rt. -
Forbid dependencies among
ori_vm,ori_llvm, andori_backend; reject reverse/lateral edges in tests. -
Compute shared semantic facts, legality, proofs, identities, runtime contracts, and eligibility once upstream.
-
AIMS is not an LLVM-specific phase and LLVM is not its terminal consumer. VM, LLVM/native, compiled-WebAssembly, and JIT are sibling physical projections of the same exact logical fact identities.
-
Maintain exactly one kernel-checked AIMS calculus and one post-AIMS semantic ownership plan for VM, LLVM,
ori_backend, and later JIT tiers. Backend validation proves encoding fidelity; it never re-derives ownership policy. -
Keep the evaluator outside the physical AIMS branch as the representation-abstract behavioral oracle. Observable parity with the evaluator never means duplicating or simulating the ownership calculus inside
ori_eval. -
Enforce proof-first chronology at the seam: compiled Lean theorem -> conforming Rust realization -> validated typed carrier -> backend-private encoding. A prototype cannot self-fund, weaken, or reinterpret ownership evidence.
-
Compute compiled layout, enum encoding, calling ABI, header shape, and runtime declarations in
CompiledLayoutPlan. -
Keep VM storage in the VM; keep IR mapping, selection, allocation, relocation, and emission in compiled backends.
-
Treat VM frame/arena recycling and compiled target layout as physical lifetime mechanisms below the shared ownership seam. Neither may add, suppress, or reclassify a calculus-owned transfer, retain, release, COW, drop, or unwind event.
-
Treat a repeated backend match/analysis as a seam defect and move it upstream before promotion.
-
Close ordinary functions, impl methods, derives, intrinsics, and registry-owned bodyless runtime calls in the same executable inventory. Direct LLVM derive synthesis or method-spelling dispatch blocks VM production promotion.
Pure Seam Contracts
Each seam accepts immutable explicit inputs and returns owned/borrowed data or a typed error. Hidden reads, callbacks, logging, environment access, global mutation, and backend-specific handles are forbidden inside the transformation.
| Seam | Input -> output | Purity/state rule |
|---|---|---|
| Frontend snapshot | source/module inputs -> parse/type/canonical facts plus stable provenance | Salsa/session caching stays behind oric; downstream artifacts never carry CompilerDb. |
| Realization | explicit frontend/import facts -> validated closed ExecutableProgram | One owner, deterministic for the same inputs, no backend callback, no I/O, no runtime state. |
| VM layout/lowering | &ExecutableProgram + explicit VM options -> VmLayoutPlan + BytecodeProgram | Pure and deterministic; exhaustive matches consume post-AIMS ARC without changing ownership policy. |
| Verification | BytecodeProgram -> VerifiedProgram | Total over malformed input; no panic, allocation bomb, runtime call, or partial acceptance. Validity is carried by the output type. |
| Physical VM planning | &VerifiedProgram + explicit physical options -> immutable PhysicalVmPlan | Pure, deterministic, reconstructible, and disposable. It may choose register bindings, immediates, handler layout, and proved regions, but cannot change canonical operations, PCs, effects, ownership, errors, or resource accounting. |
| VM execution | &PhysicalVmPlan + owned VmSession/limits/services -> VmOutcome | All effects enter through injected per-run runtime services; no process-global mutable state. An identity plan is the generic reference lane; execution never falls back between plans. |
| Compiled layout | &ExecutableProgram + &TargetSpec -> CompiledLayoutPlan | Pure, deterministic, and shared by LLVM/ori_backend; no backend handles or local fallback. |
| Compiled codegen | validated CodegenInput { program, target, layout } + typed ArtifactRequest -> EmittedArtifact | One closed dispatch; backend-private IR stays inside its implementation; result is a relocatable native object or complete WASM module with typed metadata. |
| LLVM lowering | CodegenInput + explicit LLVM options -> private LLVM module -> EmittedArtifact | LLVM context/target-machine state stays in ori_llvm and cannot flow backward. |
| Ori backend lowering | CodegenInput + explicit tier options -> private BIR/MIR -> EmittedArtifact | BIR/MIR/emitter state stays in ori_backend; WASM output is a complete compiled module. |
| Presentation | typed realization/compile/verify/runtime result -> CLI/test diagnostic/output | User text is formatted once at the outer oric boundary; inner layers remain stringly-error free. |
Pure means referentially transparent at the boundary: profiling counters may observe a stage from outside it, but a stage cannot alter semantics, inspect a comparator, or choose a different result because profiling is enabled.
Grounded seam facts the ADR pins rather than assumes:
ori_arc::pipeline::realize_closed_programhas exactly two admitted production callers, both inoric(realization/program/aims.rs,commands/emit_aims_state/mod.rs). Pin caller-crate =oricon that exact function.- The one-owner realization invariant is protected by convention today; only an architectural test makes it load-bearing.
- Verification’s fail-closed totality is the seam most exposed to malformed input; pin positive and negative cases on it before the ADR closes.
ExecutableProgram::validateandprogram_freeze::validateare the repo’s #1 and #3 hotspots. Any re-shaping of the admissibility gate re-shapes both at once; sequence it behind the architectural pins.
AIMS Calculus and Physical-Projection Boundary
AIMS must answer semantic obligations and admissibility questions, never select a backend mechanism. AIMS is not an LLVM calculus; the shipped implementation’s LLVM-shaped carriers and backend-local call sites are migration debt, not its architectural scope.
Replace the transitional physical-strategy fields embedded in the current RL-14..RL-21 carrier implementation with a neutral fact product whose stable identity is bound into ExecutableProgram; compose representation-owned neutral extent evidence beside it:
| Neutral fact | Owner | Meaning | Explicitly not encoded |
|---|---|---|---|
LifetimeBound | AIMS | shortest proved scope that contains every normal and exceptional use: block, function, caller/callee call extent, escaping, or unknown | stack slot, arena index, bump pointer, heap allocator |
ExtentClass | representation evidence | statically bounded shape versus runtime-sized payload, with logical type/storage-site identity | byte size, alignment, field offset, host word count |
OwnerBound | AIMS | finite simultaneous-owner upper bound or unbounded ownership | RC-header presence, integer width, tag bits |
OwnershipObservationFacts | AIMS | exact stable identities for sharing-observation, additional-credit, and release events plus whether owner multiplicity is externally observable, or explicit Unknown | counter, IsShared branch, copy routine, header address, side table, atomic operation, opcode, or runtime object geometry |
CleanupObligation | AIMS | exact logical drop traversal, transfer, normal-edge, unwind-edge, and lifetime-end obligations | region teardown, landing pad, VM handler, destructor symbol, free routine |
ThreadReachability | AIMS | proved thread-confined or potentially shared | atomic opcode, lock, CAS width, memory ordering implementation |
ExternalVisibility | AIMS | whether value identity/representation crosses a declared external or separately compiled boundary | target ABI class, sret, calling convention, C struct layout |
Each physical planner returns both a plan and a validation witness against the exact fact identity:
plan_vm(program, vm_options) -> ValidatedVmLayoutPlanmay select registers, generation-checked handles, typed arenas, regions, packed fields, or VM-owned counters.plan_compiled(program, target) -> ValidatedCompiledLayoutPlanmay select stack, caller storage, regions, heap, exact header width, offsets, ABI classes, and compiled runtime adapters.- A plan may conservatively choose a longer-lived or wider-capacity representation. It may not choose shorter lifetime, insufficient sharing capacity, weaker cleanup, weaker synchronization, or externally incompatible layout.
- Validation proves
satisfies(plan, facts)and exact program/fact identity; it does not rerun AIMS. Missing, stale, mismatched, or malformed facts fail closed. - LLVM, native, direct WebAssembly, VM, and JIT lowering consume only validated plans. Any local test of source type, name, RC value, LLVM type, VM tag, or target layout that changes an AIMS-owned event is an architecture violation.
- Physical event elision is legal only when the bound AIMS artifact already carries the corresponding discharge/eligibility fact. A backend cannot create a new proof from layout or runtime state.
This split keeps one calculus while permitting different physical winners. For example, the VM may satisfy a function-lifetime fact with a traced session arena while compiled code uses an alloca or region; both preserve the same transfer/drop/unwind contract without sharing representation.
Physical vocabulary already sits inside the neutral crate. Name the disposition of each site in the ADR:
RcStrategyis defined twice:ori_arc/src/ir/repr.rs:128(the ARC IR carrier scheduled for retirement) andori_repr/src/plan/query.rs:60(inside the crate this contract designates backend-neutral).RcAtomicityis defined atori_arc/src/ir/repr.rs:181.- Decide which definition dies and which becomes a
CompiledLayoutPlan-private field; a physical count-strategy enum living inori_repris the exact fork this boundary forbids. - Make the no-physical-vocabulary gate an architectural test, not a review convention. It is the single most load-bearing clause in this contract: every remaining anti-pattern collapses the neutral facts and the physical plans into one another.
Enforce the one-declaration principle by exhaustive closed matching, never by code generation:
- Author each operation’s contract once as declarative data and require every consumer to match it exhaustively, so a new declaration fails to compile until every executor handles it.
- Reject whole-tier code generation from one instruction DSL. The tiers deliberately do not share a value representation, so generation either leaks physical vocabulary into the neutral declaration or emits only dispatch shells while the hand-written bodies drift.
- Reject promoting the tree-walker to the specification. The written spec is SSOT over every implementation including the evaluator; the evaluator is a consumer of the definition, never the definition.
Closed Executable Program
The validated artifact must contain or reference, with stable identities and deterministic ordering:
-
the source/module/frontend provenance needed to correlate all executors;
-
every reachable ordinary function, lambda, monomorphization, import, impl method, derive/intrinsic, and built-in target;
-
post-AIMS
ArcFunctionCFGs and exact logical ownership-event kind, bound fact/drop-plan identity, operand, multiplicity, order, transfer edge, cleanup, and provenance identity; -
typed primitive-operation semantic descriptors, including result ownership, provenance, operand use, and logical allocation effects, plus optimization eligibility facts consumed identically by VM, LLVM, and
ori_backend; -
entry points and a closed direct/indirect call-target census;
-
neutral
ReprEvidence, typed AIMS carriers, type/constant metadata, and backend-neutral runtime-call descriptors from which VM and compiled call contracts are projected; -
backend-neutral AIMS freshness, effect/access, disjointness, transfer, thread-reachability, unwind, and logical drop-plan facts. Atomic instructions, LLVM attributes, and metadata are projections of these facts, never artifact vocabulary or an AIMS-specific destination;
-
an artifact/schema version and all inputs needed for a deterministic cache fingerprint.
-
Fail construction on a missing callable, runtime descriptor, representation fact, ownership provenance, or version.
-
Forbid VM, LLVM, and
ori_backendfrom lazily discovering or synthesizing missing semantic items. -
Represent derives as realized bodies or closed typed intrinsic descriptors; forbid backend-only semantic callbacks.
Validity carried by the type requires one gate and one fingerprint. Ship them together:
- Name
ori_repr::executable::ExecutableProgram::validate(executable/mod.rs:217) the sole fail-closed admissibility gate; demoteprogram_freeze::validate,validation.rschecks, andexternal::validate_external_callables(external.rs:369) to its private internal stages. - Forbid any consumer from re-checking what the validated type already proves.
- Treat the deterministic artifact fingerprint as part of the validated-type deliverable, not a follow-on. Validity scoped to an ambient type pool, interner, and registry is a validated artifact plus an unwritten precondition; the prototype’s pool-address-identity guard is migration evidence, not the contract.
- Bind every fact identity to function and site so a fact cannot be replayed across functions or forged by a caller.
Add the remaining fact families through one indexed fact table, never an N+1 accessor pair:
ExecutableProgramexposes parallel per-FunctionIdaccessors that differ only in the fact type they index:function_effects(mod.rs:313),fresh_return_facts(:319),param_disjointness(:331),callable_facts(:337). Confirmed at source, not a stale nomination.- Index newtypes re-derive the same
index/from_indexboilerplate atmod.rs:50/:54,mod.rs:82, andexternal.rs:53/:57. Collapse them behind one shared index definition; this is the lowest-risk cleanup in scope. - Keep the
external_function/external_functionspair; a lookup plus an iterator is legitimate. - Confirm
function_family_lambdas(mod.rs:256) adds behavior beyond forwarding toFunctionFamilyTopology::lambdasbefore retaining it.
VM Artifact and Runtime Boundaries
- Lower and prepare through explicit readiness types:
ExecutableProgram -> BytecodeProgram -> VerifiedProgram -> PhysicalVmPlan. Only a plan bound to one immutable verified-program identity is executable; the identity plan preserves the unfused generic reference lane. - Use the selected safe verified VM slot model and logical
VmCallSig; compiledFunctionAbiis shared by LLVM andori_backendbut does not define VM frames. Notransmute, native-frame aliasing, or raw native-layout slot is assumed. - Bytecode contains stable function/constant/type/runtime-call indices,
explicit control-flow targets, and references to exact logical
ValueSemanticsId/ExecutableDropPlanIdfacts. Physical count strategy, header, synchronization, or helper operands belong to the validatedVmLayoutPlanadapter, not the shared ISA contract. Encoding version and verifier limits are mandatory. - Verification checks opcode shape, operand/register/constant/function/type indices, branch targets, call signatures, entry points, ownership operands, resource ceilings, and reachable fallthrough before dispatch.
PhysicalVmPlanis an overlay, not another semantic instruction language. It carries canonical-PC maps, logical-to-physical bindings, plan-owned metadata/footprint metrics, and verifier-derived proofs; generic, fused, and later JIT execution reuse the same primitive semantic contracts and exact AIMS order.- Treat canonical-plus-physical retention as measured memory, never as free preparation state. A production physical plan retains the verified identity and only cold expansion/source/state data that execution or diagnostics require; duplicated operand/proof tables must earn their bytes, and the optimized run may release reconstructible canonical storage once its selected plan is self-sufficient. Differential testing constructs separate reference and candidate plans rather than forcing every production session to retain both executor images.
- Physical preparation cannot mutate or specialize
VerifiedProgramin place, consult benchmark/profile identity implicitly, or introduce a mid-run fallback. Interpreter-only runs disable tier creation; a separately labeled tier service consumes explicit region/state maps without makingori_vmdepend on LLVM or compiled ABI frames. - Each physical entry owns an ordered, nonempty canonical-PC span. A canonical-PC-indexed reverse map records the owning physical entry, offset, ordered read/write bindings, state roots, and normal/exceptional continuation facts. Construction rejects gaps, overlap, out-of-order spans, out-of-bounds bindings, and failed round trips.
- Every canonical operation remains one logical step. With probes enabled or insufficient remaining fuel for a span, the same physical plan enters per-PC progress mode and stops at the exact canonical prefix. An infallible, effect-free span may batch its count only when fuel covers the complete span and probes are disabled.
- Synchronize canonical PC and committed step count before every fallible arithmetic site, allocation, runtime call, RC operation, effect, call, return, panic, unwind, or cleanup boundary. A failing optimized site reports the same error, PC, logical-step count, roots, output prefix, and ownership state as its retained canonical expansion.
- Select profiled versus unprofiled execution once at entry. Profiled physical spans emit one event per canonical PC in source order; opcode, pair, region, and quota-prefix records must equal the canonical reference path exactly.
VmSessionowns registers/frames, heap/handle tables, runtime services, limits/fuel, panic state, output capture, counters, and leak accounting for exactly one execution. A test gets a fresh session; parallelism is enabled only after isolation and race stress pass.- Runtime services are a narrow injected capability surface. Production printing, panic construction, time/random/environment access, and other effects cannot be reached through ambient globals.
- Logical ownership and alias-isolation obligations execute in exact post-AIMS order. A physical planner may realize them with counters, tracing, copying, recycling, regions, or a proved no-op only when its validated satisfaction witness permits that choice; prototype no-op event tracing is evidence tooling only and is forbidden in production.
Backend Selection and Fallback Policy
-
Keep codegen choice and execution choice as separate axes.
-
Use
CodegenBackendChoice { Llvm, Native }only at the compiled boundary used byori build. -
Use
ExecutionBackend { Vm, Compiled(CodegenBackendChoice) }forori runandori test. -
Flatten execution choices to the user-facing
--backend=vm|llvm|nativevalues. -
Treat
EvalMode::Constas a compiler mode andTargetSpec::Wasm32*as a compiled target. -
Keep the enums closed and exhaustively matched; Ori has no out-of-tree backend requirement.
-
ori run --backend=vmandori test --backend=vmeither execute wholly in the VM or return a typed unsupported/compile/verify/runtime diagnostic. They never silently callori_evalor LLVM. -
Const evaluation explicitly uses
ori_eval. Direct WASM build/run usesCodegenBackendChoice::Nativeplus a WASMTargetSpec, emits a complete module, and uses an explicit WASM runtime/host adapter when execution is requested. No tree-walker or bytecode path is involved. -
--dualis an explicit diagnostic request that independently runs selected executors from the same frontend provenance and compares outcomes. It is never invoked implicitly in production. -
Prototype harnesses must report
entered_vm,fell_back,unsupported, andfailedseparately. Fallback results do not count toward VM coverage or performance.
Absolute Parity Contract
For every applicable accepted program, evaluator, VM, LLVM debug/release/AOT, and admitted ori_backend targets must agree on:
-
result value and type, stdout bytes/order, exit status, and test outcome;
-
panic versus success, panic/stack-overflow class, and source attribution;
-
evaluation/effect order and externally visible runtime calls;
-
deterministic diagnostic identity/class for equivalent failures;
-
ownership/cleanup outcome, leak counters, and required RC trace correspondence.
-
Allow only a frozen, reviewed normalizer for inherently nondeterministic presentation fields.
-
Forbid value rewrites, output reordering, diagnostic merging, panic suppression, and leak/ownership concealment.
-
Treat a mismatch as a correctness failure at the owning phase.
-
Invalidate the corresponding performance sample and block production adoption.
The evaluator oracle is necessary and provably insufficient. Ownership divergence is below observable behavior:
- An arena versus an
allocais unobservable, so an output diff against the evaluator cannot detect an ownership-trace divergence until it leaks or double-frees. - Treat the ownership-event-trace equality obligation as a second, separate check: every tier erases to the identical logical event trace while its mechanism differs.
- That check has no instrument today. The two-build RC diff compares two compiled builds, not a VM against a compiled build. Build the cross-tier ownership-event-trace comparison before any parity claim here counts as evidence.
- Make the oracle relation a gate over the frozen denominator, not a report.
RC and ownership evidence is admissible only from the burden-sole path:
- Cite only readings taken under
ORI_DISABLE_PREDICATE_STACK_RC=1 ORI_VERIFY_ARC=1 ORI_VERIFY_EACH=1. - Treat a default-path RC count as false-green and inadmissible as an ADR fact.
- Rank surviving counter actions by their named non-discharge cause; each survivor names the AIMS dimension whose proof was insufficient, and a survivor concentrated in a top hotspot is where a backend-local shortcut is most tempting.
Errors, Limits, and Cache Lifetime
- Use typed
RealizationError, bytecode compile/verify errors, andVmError/resource-limit outcomes internally; convert to user diagnostics once inoric. Do not propagateStringas the architectural error contract. - User-controlled recursion, frames, registers, bytecode, constants, aggregate sizes, iterator steps, and verifier work carry checked limits/overflow handling. Malformed input never panics or reaches a runtime call.
- Start with an explicit session-local cache keyed by executable-program fingerprint, VM encoding version, target-independent options, and all representation inputs. Cache values are immutable verified programs.
- Salsa/persistent caching is deferred until deterministic equality/hash/serialization and invalidation tests exist for every transitive input. No cache holds
CompilerDb, LLVM contexts, runtime services, or per-run state.
Prototype-to-Production Decision Rule
- Judge prototype components individually.
- Retain production-shaped code in its final owner only after every API, seam, test, parity, safety, and hygiene gate.
- Treat example code, duplicates, fallback, semantic shortcuts, no-op RC, and comparator-specific paths as disposable.
- record measured decisions and rejected alternatives in the architecture decision record;
- classify each component as retain, harden in owner, replace, or delete, with a named invariant/test for every retain decision;
- keep production-owned APIs in place when they already implement the destination seam, and port only behavior justified by parity, safety, and profiling evidence from disposable harnesses;
- delete the prototype harness and every duplicate opcode/value/dispatch definition before the production section can close;
- reject any retained backend implementation that re-derives a semantic fact available to another backend instead of consuming one shared fact.
Evidence admissibility for the architecture decision record:
- Verify every graph-sourced claim against source before recording it; the code-intelligence embedding, insights, sibling-divergence, co-change, test-topology, rc-remarks, and aims-state facets are stale.
- Never read a zero-caller result on an
implmethod as dead code; method-call resolution is systematically under-resolved, and the artifact validate/freeze pair reports zero callers while ranking as a top hotspot. - Treat a zero-row hygiene or co-change result as unknown, never as clean.
- Treat the reference-VM corpus as name-navigable only. Cross-repo semantic search is unavailable for the six ingested VM repositories, and the north-star interpreter’s bytecode handlers are assembly the extractor does not index.
- Read the peer projects’ interpreter-relocation and interpreter-dispatch defect history before writing the ADR’s evaluator-boundary clause. A peer relocating its interpreter onto a lower shared IR is currently fixing dispatch and closure-capture defects while doing so; a peer with a shipped ownership model carries an order of magnitude more ownership-verifier issues than any other repository in the corpus. Both raise this contract’s bar.
- Derive Ori’s design independently from typed ARC/AIMS contracts; peer source study informs design pressure only.
Live Prototype Evidence Ledger
The 2026-07-14 worktree prototype is intentionally landing candidate production seams directly in their proposed owners while retaining a thin example only for measurement.
| Component | Current evidence | Production disposition still required |
|---|---|---|
ori_repr::ExecutableProgram | Owns immutable symbol storage, type pool, deterministically ordered post-AIMS functions, stable function IDs, a closed call-site target table, entry point, ReprPlan, TypeRegistry, schema version, and typed validation errors. Focused tests and clippy -D warnings pass. | Add import/derive/intrinsic/indirect-call closure, provenance/fingerprint fields, exhaustive runtime descriptors, malformed/property coverage, and prove VM/LLVM/ori_backend consume the identical artifact. |
oric::realization | Accepts explicit parse/type/canonical facts, owned pool/interner, and explicit narrowing policy; performs ordinary/mono/impl realization, representation planning, one whole-batch AIMS run, and executable validation without carrying CompilerDb across the seam. Backend-neutral monomorphization and call-target rewriting moved from ori_llvm to ori_repr. Public single-function/out-of-batch entry points were deleted in favor of realize_closed_program plus its observer variant. The retired immediate-emission impl-contract repair is now test-only and has no production export. | Close remaining import/derive/intrinsic/associated-function inventory gaps with exact artifact coverage rather than adding an escape hatch, and keep every diagnostic observer read-only over the same closed batch. |
| Backend-neutral AIMS authority | The production AOT and JIT paths construct, validate, and bind the same closed ExecutableProgram before LLVM body emission. LLVM-local compute_aims_contracts, every run_arc_pipeline*/internal single-batch fallback, stale type-registry/impl-contract mutable state, and mono pre-lowering helper were deleted rather than hidden. FunctionCompiler::new no longer accepts a contract map; its private projection map starts empty and can be populated only by binding the validated artifact. The old per-impl repair helpers are absent from production builds and exports. A static source pin rejects AIMS entry from nine LLVM physical-executor files. cargo check -p oric, the static seam pin 1/1, legacy repair characterization 5/5, closed-batch IC-1 pin 1/1, full AIMS snapshot corpus 1/1, VM typed/untyped closed-artifact list-concat pin 1/1, JIT runner pin 1/1, and exact AOT user-drop pin 1/1 are green. | Require every ordinary, derived, intrinsic, closure, wrapper, import, and test root to appear in the exact validated artifact inventory. Extend the static guard to every future LLVM/native/compiled-WebAssembly/JIT adapter and pin identical artifact identity plus normal/unwind event parity. Delete the test-only retired repair implementation once no migration archaeology depends on its characterization. |
| Public contract and roadmap ownership | The language memory model and Annex E now name AIMS as the backend-neutral logical ownership calculus; the historical AIMS expansion, ori_arc/ArcFunction, and Rc* theorem/carrier names are explicitly nonnormative and do not require LLVM, counters, heap placement, headers, or atomic instructions. CLAUDE.md, arc.md, aims-rules.md, canon.md, codegen-rules.md, compiler.md, and impl-hygiene PHASE-33/PHASE-62 agree that evaluator branches at canonical IR and VM/LLVM/native/compiled-WebAssembly/JIT are sibling physical consumers. The LLVM, native-backend, semantic-optimization, repr-opt, iterator ownership, FFI safety, index-assignment, type-inference, Rosetta, UI, vectorization, and Clang-ARC plans have been audited or explicitly quarantined so physical storage/vector/counter claims no longer become AIMS authority. /sync-aims-spec --check reports exact TF/CN/IC/PL/RL/VF agreement with no missing, extra, or internal-only rule leakage. | Keep every roadmap owner and public clause aligned as new executors land. A plan may use LLVM as a parity or projection gate but cannot assign ori_arc, ori_repr, canonical semantics, vector instruction selection, or the shared artifact to the LLVM backend. Retain structural review gates that reject a normative counter/atomic/heap/layout/helper/opcode requirement outside an explicitly physical plan, and rerun the spec/rule drift check whenever the calculus changes. |
| Executable user-drop identity | ExecutableDropPlan now freezes user-drop callable identity and structural child order before backend selection. The bound AOT path consumes that plan rather than scanning CodegenContext.method_functions; an exact test passes 1/1 and observes user Resource.drop before fields b then a. JIT binds the same closed artifact, while malformed or absent binding fails closed. | Extend the same identity/order proof through every unwind edge, imported/derived wrapper, cache round trip, VM execution, and future native/direct-WASM/JIT adapter. Validate complete reachable drop-plan coverage and reject missing/stale callable identities; no backend-local method scan may return. |
| Backend-neutral burden vocabulary migration | BuiltinBurdenSpec and UserBurdenSpec now expose self_owned_identity and drop_operation; the old self_heap_alloc and compiled_drop tokens are absent across compiler, proof, and public-document surfaces. Shared closure composition no longer describes an LLVM environment header or drop_gen.rs layout as an AIMS contract. The current FnSym-backed cleanup identity remains transitional evidence rather than a complete executable-drop table. | Replace the transitional cleanup identity with a closed stable ExecutableDropPlanId table. Keep environment placement, headers, counter mechanics, offsets, and helper bodies solely in VmLayoutPlan or CompiledLayoutPlan. Add a structural gate rejecting physical terms or backend symbols in neutral burden schemas, plus VM/LLVM/native/compiled-WASM projection and drop-order parity pins. |
| AIMS source-schema neutrality | The live audit found and removed an unused byte-derived SizeClass from the AIMS lattice and its death/allocation events; byte capacity can now enter only a target-owned physical planner. The shared type predicate is has_managed_ownership_obligation, not needs_rc; AIMS state queries are needs_ownership_events and is_event_pair_elision_eligible; and the sparse locality event is PlacementEligibilityCandidate, which freezes a bounded-lifetime fact without choosing stack, arena, region, or heap storage. Public/spec/design text now uses logical owner-credit/release/cleanup and explicitly marks Rc*, ArcFunction, count, IsShared, and Reset/Reuse spellings transitional. cargo check -p oric passes the cross-crate rename and seam deletion batch. | Finish evacuating mechanism-shaped formal vocabulary: the Lean/checker calculus must state logical ownership events, sharing-observation/isolation obligations, donor/recipient eligibility, and projection satisfaction directly. Retain historical theorem/carrier identifiers only through explicit compatibility mappings; move counter motion, branch/copy/recycle selection, and operation-count metrics to post-layout projection refinements. Pin a source/proof structural scan so size/layout/counter/opcode types cannot re-enter the AIMS public schema. |
| Closure entry and result ownership certificate | The entry side freezes each residual closure parameter’s exact type plus full-ParamContract demand as Borrow, WholeValue, or ProjectedField, with stable generic retain-plan identities for structural duplication. For results, the pre-review Lean/checker T4 model froze one owned result fact and its source-selection rows; it did not prove function-total return-site coverage, license an ownerless row, bind fact identity to function/site, or prove exact relation/demand field topology. An initial Rust experiment added a public total Owned/NoOwner transport layer and passed focused 4/4 + 4/4 tests, but adversarial review falsified its authority: callers could forge both premises and expected rows, and the positive fixture itself returned a UNIT variable from a declared STR function. The experiment was therefore rejected and the entire ori_repr totality/transport layer deleted before integration. The retained ori_arc candidate is only an opaque backend-neutral single-owned-result carrier plus AIMS-internal source-selection kernel; raw IDs, evidence, and freeze are sealed, and the module explicitly marks topology/function binding as unproved. Nothing is wired into VM/LLVM. | Lean/checker first: prove a function-total normal-return plan, ownerless-row authority, exact source/target partition compatibility, and function/site/ledger-bound fact identity. Then expose only an opaque AIMS-produced ClosedAimsProgram, carry its validated per-function plan in ExecutableProgram, and give VM/LLVM/native/compiled-WASM/JIT read-only actions. Decoded DTOs remain private and validate against artifact fingerprint plus the sealed fact registry. Add the exact formal row matrix plus missing/extra/duplicate functions/sites, ownerless/owned swaps, source-only/action-only tampering, invalid param/field/site IDs, nonexistent/cross-function replayed facts, topology mismatch, and a structurally valid multi-return full-artifact fixture. Only then wire physical execution and delete every backend-local inference/fallback. |
| For-yield physical-layout leak | Live ori_arc::lower::control_flow::type_layout recursively computes the shipped LLVM/runtime ABI store size, including LLVM enum slots, tag widths, and padding. Both iterator and Option for-yield lowerers embed that byte count as an SSA integer and intern ori_list_new / ori_list_push / ori_list_take helper spellings into shared ARC calls. The transitional RuntimeCall carrier therefore exposes LLVM-C-ABI-shaped arities (new(capacity, elem_size), push(builder, value, elem_size)) even though the VM ignores the size operands. The comments correctly label this transitional, but the architecture still lets a physical compiled layout enter the backend-neutral lowering/AIMS branch and would force every executor to understand one adapter’s dummy operands. | Replace literal byte sizes and helper spellings with typed list-builder/runtime-operation identities carrying logical element type, ownership, and storage-site identity. The neutral signatures are builder semantics, not C ABI: create from logical element type plus capacity policy, append builder/value, finish builder. AIMS analyzes only their neutral contracts. VmLayoutPlan chooses VM element encoding; CompiledLayoutPlan supplies target size/alignment and the LLVM/native/direct-WASM adapter expands the neutral operation to its helper or inline sequence. Delete ori_arc::lower::control_flow::type_layout, dummy size SSA values, and cross-copy agreement tests; replace them with one layout-planner SSOT plus malformed-signature, projection, evaluator/VM/compiled parity, and ownership-event pins. |
| Backend-neutral placement calculus | Kernel-checked Realization.lean now freezes neutral lifetime/locality, cleanup/unwind, sharing/additional-credit/release observation, external-visibility, and thread-reachability facts, with separate satisfaction obligations for VM and compiled physical plans. The full dual-discharge gate is 130/130; section 08 reports 40 proofs, including 18 shipped-neutral conformance rows and 20 target-only rows; the exact VM profile is 1/1. Storage, header width, counters, and synchronization are no longer AIMS theorem outputs. | Wire production Rust fact producers to the neutral theorem vocabulary, bind exact fact identities into ExecutableProgram, and implement VmLayoutPlan/CompiledLayoutPlan validators that fail closed on insufficient lifetime, capacity, cleanup, ABI, or thread-safety mechanisms. Add malformed-plan and cross-projection parity pins before calling the seam production-clean. |
| Logical/physical ownership coalescing seam | A backend-neutrality audit found that the Phase-7 AIMS peephole grouped RcInc/RcDec by transitional RcStrategy but recreated every survivor with default atomicity. The prototype now preserves both physical fields exactly and treats either mismatch as a coalescing fence. A non-atomic preservation pin and an incompatible-mode no-merge/no-cancel pin are green (ori_arc coalescer: 8/8). This prevents silent corruption while the transitional carrier exists and confirms the repr-opt §10 fence is load-bearing. | For production, AIMS coalesces only stable logical ownership-event identities before layout selection. A VM or compiled physical optimizer may combine the resulting adapter actions only after VmLayoutPlan/CompiledLayoutPlan selection and must include the exact synchronization/mechanism identity in its key. Remove RcStrategy and RcAtomicity from shared ARC/AIMS IR; this retirement and a structural no-physical-vocabulary gate block production close. |
| Class-ledger funding projection leak | Live source inspection found aims::class_ledger::hazard::funding::collect_extraction_seeds deciding whether a logical extraction credit is fundable from ValueRepr::FatValue or a registry burden whose current BurdenInc lowering produces a counter action. The fail-closed decline avoids a present miscompile, but the decision proves that current logical credit admission still depends on one physical adapter. The compatibility comment now labels this debt explicitly rather than presenting refcountability as an AIMS property. | Give every logical credit/release/cleanup event a stable identity independent of ValueRepr, burden helper, counter, or destructor mechanism. Require VmLayoutPlan and CompiledLayoutPlan to return an exhaustive event-satisfaction mapping: a concrete action, a structural cleanup edge, a region/lifetime discharge, or a proof-backed no-op. A logical event may not vanish because one adapter has no counter helper. Replace this gate, pin iterator/user-drop/str/closure/generic-project cases across both plans, and reject missing or double physical satisfaction. |
ori_vm crate | Has one-way dependencies on ori_repr/ori_arc/ori_ir; exposes ExecutableProgram -> BytecodeProgram -> VerifiedProgram -> ExecutionOutcome; uses the artifact’s typed call-site targets; verifier checks indices/targets/arities/entry; execution state and panic state are session-local under explicit quotas; crate passes clippy -D warnings. | Add ownership-op completeness, closures/indirect calls, remaining values/collections/runtime effects, verifier ownership/reachability checks, parity/property/fuzz/leak tests, and evidence-backed dispatch optimizations. |
| Frozen executable applicability | A deterministic sweep over 194 frontend-valid existing programs records 47 evaluator-correct full-VM runs (24.2268041237%), one wrong result, 122 realization/unsupported cases, 21 post-entry runtime failures, three timeouts, zero verifier failures, and zero fallback. Unresolved runtime operations first-block 94 programs (length masks 45); aggregate/heap projection mismatches block 14. | Preserve the denominator and reason identities. Reach at least 98 evaluator-correct programs by closing shared RuntimeCallSpec/constructor/value-semantics families rather than VM-only name tables; fix every parity mismatch before counting coverage, then rerun evaluator/VM/LLVM debug/release/AOT and leak gates. |
| Prototype CLI | The former 2,100-line example-owned VM was deleted. The remaining example only performs source I/O, calls production-shaped realization/compile/verify/execute APIs, writes captured output, and prints explicit VM-entry counters. | Delete after equivalent ori run --backend=vm, ori test --backend=vm, and benchmark harness routing exists. |
| Builtin method realization | The first closed-artifact run exposed that List.set was LLVM-private semantic dispatch. Runtime-call resolution is being moved to typed receiver-aware executable realization, with a regression pin, before VM lowering. | Generalize over the complete registry method surface and require exhaustive backend consumers; no backend may rediscover builtin method identity. |
| Shared primitive-operation classification | The prototype removed LLVM’s private builtin type/operator strategy table. Type checking, ori_repr, LLVM, and VM consume one registry-field mapper; Pool::builtin_type_tag is the shared pool bridge, and ori_repr owns executable-backend special cases. Focused type/repr/LLVM bridge tests pass. | Store stable per-operation classifications or proofs in ExecutableProgram, migrate LLVM fully to that artifact, add exhaustive cross-consumer tests, and reject any backend-local semantic rediscovery. |
| Debug/release primitive-fact closure | The first broad release benchmark stopped before timing an aggregate case because resolve_sites populated PrimitiveFacts inside debug_assert!(resolved.insert(...).is_none()); optimized builds erased the assertion and therefore erased the producer mutation, while debug tests passed. The mutation now executes unconditionally and only the duplicate check remains debug-only. A source-to-ExecutableProgram regression compiles scalar/output/aggregate programs sequentially and passes under cargo test --release; the pre-fix release run deterministically failed at PrimOp v4 with an empty frozen table. | Retain the regression in both debug and release CI, and mechanically forbid side effects inside debug_assert!/assert! predicates throughout shared fact production and artifact closure. Performance evidence is invalid until the same optimized binary has first closed every primitive descriptor and passed the full semantic corpus; never treat debug-only success as AIMS or executor parity. |
| Backend-neutral realization seam | The prototype replaced the eight-argument whole-program entry with one typed ArcPipelineContext. Its fields are limited to the logical classifier, interner, type pool, builtin facts, type registry, verification policy, and producer-frozen external contracts; the context cannot carry an LLVM handle, VM layout, opcode table, target ABI, runtime counter, or executor callback. External contract inputs and closure-plan freezing are generic over the map hasher rather than exposing FxHashMap as public policy. The batch implementation now separates per-function execution, coherence checking, current compiled-counter observation, and artifact freezing, and the warning-denied ori_vm dependency sweep is being driven to zero before another performance specialization. | Retain this context (or an equivalently narrow immutable input product) as the production AIMS entry. Add compile-time dependency/API tests that reject physical-plan types at the seam, bind its inputs and output into the executable identity, and keep current Rc* counting explicitly below the logical-calculus boundary. No lint suppression may hide oversized orchestration, fail-open table pairing, backend-local policy, or a public concrete-hasher dependency. |
| Borrowed runtime-result independence | A combined string benchmark exposed that heap to_uppercase/to_lowercase dynamically mutated and returned an unretained unique receiver despite their borrowed, independent-result registry contract. The runtime now returns independent storage; focused runtime tests, source-value independence, a 100-iteration rebinding regression, and leak-checked evaluator/LLVM debug/release/AOT execution pass. | Encode result aliasing/independence in RuntimeCallSpec. If profiling justifies in-place case conversion, add an explicit shared-fact consume-and-COW variant rather than rediscovering liveness from RC or weakening the borrowed contract. |
| Unfused production-shaped baseline | The closed artifact and standalone compile/verify/execute path completed 100-doors with entered_vm=1, zero fallback, 2 functions, 155 bytecode instructions, 3,940,018 interpreted steps, 2-frame peak, and 1-object heap peak. Fifteen whole-process runs measured 36.9 ms ± 2.6 ms versus Python 3.12.3 at 18.1 ms ± 0.6 ms; Python was 2.04× faster. | Treat this as the optimization baseline. Add a separate verified bytecode optimization pass and require at least a 4.1× improvement from this reading to clear the 2×-Python floor; retain no optimization without unfused-vs-optimized behavior parity and macro evidence. |
| Pinned interpreter north star | Official LuaJIT source is available read-only at ${REFERENCE_REPOS_ROOT}/lang_repos/luajit, revision 3c4f9fe2052b8d08a917ac0d5f38563f0297b5a3. An out-of-tree build of LuaJIT 2.1.1783773675 ran the output-checked 100-doors comparator under -joff in 2.1 ms ± 0.2 ms over thirty shell-free whole-process runs, versus Python 3.12.3 at 18.0 ms ± 1.0 ms. | Freeze the comparator sources/environment in benchmark infrastructure, record semantic differences, repeat at sufficient duration, and use the result as a completion target. Source study may influence design pressures only; Ori code remains independently derived from typed ARC/AIMS contracts. |
| Allocation-free parallel block moves | The first isolated real-VM experiment removed two steady-state clones from every loop back-edge while retaining frame-local simultaneous-move scratch. On the output-checked 100-doors comparator, 30 shell-free runs improved median whole-process time from 44.24 ms to 40.93 ms (7.5%); output, instruction count, executed steps, VM-entry counters, and fallback counters were unchanged. | Retain/harden candidate because it is a general verified-SSA mechanism rather than benchmark recognition. Add parallel-cycle tests, reserve scratch from verified maximum move width, run the parity corpus, and complete hygiene review before production promotion. |
| Resident hot dispatch loop | Forcing the verified opcode match into the execution loop improved the allocation-free parent median from 40.93 ms to 31.55 ms (22.9%) over 30 shell-free runs. Host instructions fell about 12% and cycles about 23%; text grew only 928 bytes. Output and all VM-entry/step/bytecode counters were unchanged. | Promote the structural finding, not a bare annotation: production work must factor cold typed failures/runtime services away from the compact loop, pin generated assembly and code size, and prove the behavior across the corpus and supported targets. |
| Failure-preserving VM memory report | execute_report returns the materialized result/error, captured output, and metrics on success, runtime failure, and quota exit while execute remains the compatibility wrapper. Metrics cover cumulative heap traffic, exit/final/peak live state, heap-table capacity, frame/register/ownership-scratch capacity, value storage, and output capacity; focused cleanup tests pass, while the expanded fifteen-case registry rejects logical exit-live objects before teardown. | Retain the API shape and centralized mutation accounting. Add immutable program/chunk/metadata bytes, allocator-backed process/RSS lanes, repeated-run growth slopes, panic/unwind coverage, and production CLI reporting. Keep profile/tier-owned memory separate from core execution metrics. |
| Allocation-free user-call transfer | The verifier-backed call path now resets or creates the child frame, then copies arguments directly from disjoint caller registers to verified child parameter registers. It removes the argument-value allocation and parameter-table clone without changing bytecode, call semantics, or dependencies. The existing recursion benchmark improved from 20.687 s ± 1.764 to 17.579 s ± 0.466 across three shell-free runs; raw RSS stayed at 10,520/10,512 KiB parent/candidate and smaller workloads were noise-neutral. | Retain and harden with repeated-run isolation, aggregate/heap argument matrices, malformed-artifact verifier pins, and broad mixed-program parity. Keep the verifier as the sole bounds/arity authority; do not add call-site validation or a second calling convention. |
| Generation-safe dynamic aggregate identity | Two evaluator/LLVM-pinned programs expose the invalid static destination-register identity used by saved parents, which return 99 instead of 37 and 73. A first append-only session arena repairs identity but fills 1,000,000 entries and consumes 83,886,080 measured bytes. The revised trace/sweep arena completes 952,600,025-step 100-doors with 5,250,001 allocations, 1,030 peak live/physical slots, 193,472 peak arena bytes, exact output, and zero exit-live heap state. The focused escape-loop and nested-escape cases return exact 37/73 in both generic VM modes with heap exit/final 0/0; their measured arena occupancy is respectively 5 entries/5 slots/704 bytes and 8/8/704 at exit, then 0/0/0 after session teardown. Evaluator and fresh LLVM debug/release AOT results match; plain and leak-instrumented Valgrind report no real leak or error. | Retain slot+generation handles and session ownership. Harden root completeness for active physical lanes, return/error temporaries, unwind, closures, user drop, and future region/JIT state; add generational/property/fuzz tests and scale-slope gates. Identity and tracing consume shared executable value/drop semantics rather than rediscovering layouts in the VM. Treat occupied arena entries at exit as measured session memory, not as RC-live heap state; teardown must still reach zero on every outcome. |
| Executable ownership semantics | Post-AIMS bytecode now carries the transitional RcStrategy and RcAtomicity enums; compile and verification fail closed on unsupported or representation-incoherent combinations. Central runtime retain/release follows supported self-describing aggregates, lists, builders, strings, iterator-owned values, and COW replacement paths. Three nested ownership fixtures pin exact results 61, 67, and 71 across evaluator, LLVM AOT, typed VM, and untyped VM with zero exit-live heap objects. These enum names remain physical LLVM-era vocabulary and are evidence of behavior, not the production seam. | Replace backend strategy interpretation with one backend-neutral ExecutableDropPlan/ValueSemanticsId table derived once from DropInfo, neutral AIMS facts, and the type registry. Freeze thread reachability rather than an atomic opcode. The VM and compiled backends combine those facts with their independent layout plans to choose field traversal, atomic mechanics, and glue without rediscovering logical drop order. Extend the parity matrix through errors, panic/unwind, closures, user drop, inline enums, and direct compiled WASM. |
| Empty-tuple/Unit semantic canonicalization | The breadth sweep found one mismatch: ARC lowered source () as Construct Tuple [], the VM materialized an empty aggregate, and evaluator/LLVM produced Unit. Canonicalizing empty tuples to LitValue::Unit in ori_arc makes typed/untyped VM return exact Unit with zero arena allocations. Evaluator, LLVM debug/release, AOT, leak checks, 1,587 ARC tests, and 33 VM tests pass. | Retain the shared ARC fix and source-to-VM regression. Keep LLVM’s defensive handling until the full canonical-input contract proves it redundant; never add a VM-only empty-aggregate normalization. This is the model for parity repair at the owning semantic seam. |
| Logical sum projection | ARC exposes sums through a backend-neutral logical view: Project .0 is the discriminant and Project .1..N are payload fields, even when CompiledLayoutPlan selects a niche or tagged-pointer layout. AIMS mutation keeps payload Set zero-based and changes the discriminant through SetTag. The VM now records product versus variant identity beside its existing separate tag/payload storage and applies those two operation contracts directly. Two source-level pins cover string-payload and recursive multi-field sums in typed/untyped modes; the full 17-program failure family returns exact Int(0) with zero fallback and final heap/arena state. The 100,000-iteration representative also returns zero through the evaluator and fresh LLVM debug/release AOT; both AOT profiles pass full definite/indirect Valgrind checks. | Retain the logical view as executable semantics and keep physical realization backend-owned. Derive future VM packed-sum schemas and native/direct-WASM offsets from the same validated sum descriptor; never import LLVM GEP indices into VM bytecode or infer a tag from VmValue kind. Add malformed Set/SetTag pins, variant-width limits, user-drop/partial-move coverage, and the frozen broad sweep before promotion. |
| Validated executable RC metadata | ArcFunction now carries an explicit Unrealized / RepresentationsReady / Realized lifecycle, so repr-only lowering, a completed zero-variable function, and absent metadata are distinct. Lowering publishes the representation table; AIMS compares it with freshly computed expectations and fails unchanged on disagreement instead of silently repairing it, then performs only a legal forward transition to cached RC strategies. Subsequent transforms preserve every ready table, and rewrite sites carrying a second type use a release-checked typed-alias allocator. ExecutableProgram::validate rejects unrealized state, length/shape errors, or strategy incoherence before backend selection. Zero-variable downgrade, corrupt-ready-table, and mismatched-alias negative pins plus the full 1,596-pass/1-ignored ARC suite are green. | Retain the state machine and no-repair rule. The prototype still exposes the four underlying fields publicly, so the production seam must encapsulate them in one state-carrying metadata object/enum with read-only views and owner-only transitions before it is called clean. Extend the invariant with provenance and future ExecutableDropPlan identities, add cache round-trip lifecycle pins, and keep evaluator/VM/LLVM debug/release/AOT plus leak gates on every transform that adds variables. Consumers may check structure but cannot pad, default, or recompute policy. |
| Registry-owned method runtime identity | The frozen sweep’s largest first blocker was 45 calls spelled length. Each runtime-capable MethodDef now carries one explicit backend-neutral MethodRuntime; List/Str/Map/Set len and length definitions select Length, while persistent List operations select their concrete List identities. Executable realization maps that identity to RuntimeCall without trait-name matching, VM aliases, or a source-spelling fallback; registry-wide pins require the mapping in both directions. An authoritative 106-run typed/untyped replay of all 53 affected first-blocker paths produced identical classifications, 23 full-VM paths per mode, zero fallback, and zero final heap/arena state for every success; unsupported Map operations remain distinct. | Retain the registry as semantic-identity owner and keep List/Str value execution distinct from fail-closed Map/Set execution. Rerun the frozen denominator, add malformed/signature drift pins, and evolve MethodRuntime plus executable call facts into the complete shared RuntimeCallSpec signature/ownership/aliasing table before production. Every backend consumer must be exhaustive; names and traits are diagnostics, never dispatch keys. |
| Persistent List mutation runtime | List.push/insert/prepend/remove/set and updated resolve through registry identity to one VM mutation owner. The runtime consumes post-AIMS CallArgument ownership, mutates an owned unique receiver in place, otherwise allocates a persistent copy, retains only borrowed or copied children, transfers owned arguments exactly once, and transactionally preflights quota/release work before mutation. A combined source fixture preserves the original snapshot while exercising all operations and exact length/index observations in typed and untyped modes; focused unique/shared/nested/error pins and the affected-path replay finish with clean heap/arena state. | Retain one registry-to-executable identity seam and one VM mutation owner; do not add spelling switches or separate updated semantics. Complete evaluator and fresh LLVM debug/release/AOT/leak parity for the combined fixture, add aliasing/property/fuzz and capacity-growth failure pins, and derive future physical/JIT handlers from the same call signature and ownership contract. Map/Set operations remain separate representation work and must never coerce through List storage. |
UTF-8 Len semantic parity | Registry closure exposed a pre-existing backend split on non-ASCII strings. The language contract defines str.len() as UTF-8 byte count (09-properties-of-types.md and annex C); LLVM’s ori_str_len and normal evaluator method dispatch already return bytes, while evaluator hash-length and the first VM implementation counted codepoints. Evaluator hash-length now returns bytes. A combined constant "café" plus allocated-uppercase fixture returns exact 37 through the evaluator, typed and untyped generic VM, and fresh LLVM debug/release AOT; both VM modes report zero heap and value-arena state at exit and after teardown. Plain Valgrind reports every block freed with zero errors for both AOT profiles, while ORI_CHECK_LEAKS=1 reports zero definite/indirect leaks and zero errors. | Make the shared runtime-call contract name byte-count semantics explicitly and add the physical-plan result before promotion; retain separate codepoint APIs rather than overloading Len. |
| Iterator source and ownership seam | The original combined 10,000-door failure at step 2,534,418 exposed two erased facts: iterator source identity and post-AIMS argument ownership. RuntimeCall::Iter now carries a shared six-way IteratorSource; realization rejects incomplete Apply/Invoke ownership; bytecode stores an 8-byte CallArgument { register, ownership } in a dedicated call table; and lowering fails closed for source kinds whose execution is not implemented. Range and list iterator states are distinct, owned list sources transfer one existing obligation without an extra retain, borrowed sources never retain/release, and a general IteratorStep carrier preserves yielded VmValue kinds. The repaired typed and untyped VM both complete the bounded 10,000-door program as Int(100) after 2,714,457 steps with zero fallback/unsupported and zero exit/final heap or arena state; evaluator plus LLVM debug/release AOT also return 100. A real Invoke/unwind pin releases an owned list source. Filtering scalar children from the release worklist reduces ownership scratch from 160,096 B to 160 B, exactly 1000.6× smaller (99.9000599640%). VM 67/67, executable-representation 16/16, warning-denied checks, and package formatting pass. | Retain the source descriptor, complete ownership table, fail-closed lowering, exact transfer rule, and typed step carrier as shared seams. Extend the matrix through every source kind admitted by lowering, managed/nested yielded values, unique/shared aliases, borrowed early exit, double-drop/idempotence, error and panic paths, evaluator/VM/LLVM/AOT, and Valgrind before production promotion. Generate call ownership/storage metadata from one declaration so Invoke, verifier, physical planning, and a future JIT cannot fork it. Runtime tag guessing, Heap-to-Aggregate coercion, retain-on-borrow, and hidden fallback remain forbidden. |
| Representation-plan integration audit | The live VM does not yet consume ExecutableProgram.repr_plan; bytecode lowering reclassifies registers from type tags into coarse Int / Bool / String / Other classes. Frames retain one 16-byte tagged VmValue per logical register and fill/reset the whole register file, typed scalar operations still recheck tags, list storage remains Vec<VmValue>, and general arena entries reserve four tagged aggregate fields. The generation-safe session arena has already removed the older per-register aggregate/iterator side arrays and must remain the baseline. | Consume immutable backend-neutral representation evidence plus typed AIMS carriers, never LLVM-shaped layout or a VM-local reanalysis. Prototype hybrid untagged banks, schema-packed arena entries, storage-site-complete typed collection stores, and schema-specialized ownership independently before combining them. VmLayoutPlan owns safe VM encoding; CompiledLayoutPlan owns LLVM/native/direct-WASM layout; the evaluator remains layout-abstract. Each experiment must gate malformed artifacts, evaluator/VM/LLVM/AOT parity, exact cleanup, frame/heap/collection bytes, preparation memory, RSS, and broad mixed speed. |
| Validated identity physical execution | The sparse plan now drives a real physical executor without calling the generic executor or falling back. Two post-review same-binary sweeps each emitted the complete 209-record JSONL contract for the frozen 207-case manifest. Historical-48 completed in 47.79 s with 13,808 KiB outer-process maximum RSS; all-frontend-valid completed in 89.33 s with 35,512 KiB. Generic and physical plans were equal on all 207 cases in both sweeps across classification, evaluator-parity record, result, exact output artifact, bytecode metrics, execution metrics, and typed error; every difference list was empty. Each plan entered execution on 91 cases, every entry retained its exact vm_execute or physical_execute phase and requested/executed-plan provenance, 91 physical records published prepared-plan metrics, and fallback remained zero. All 182 execution reports had zero final heap objects/bytes and zero final value-arena entries/slots/bytes. The eight timed-out VM-plan processes in each sweep were typed timed_out; bounded group termination and reap completed with kill_error: null. Every spawned process published the explicitly named sampled-RSS lower bound; historical medians were 9,014 KiB generic and 8,974 KiB physical, which are observation lower bounds rather than allocator peaks or a memory win. The 91 physical plans retained a median 2,852 B of plan-owned tables and 4,416 B including canonical operations, with maxima 37,716 B and 56,852 B; planning and validation scratch returned current payload to zero. The all-frontend-valid gate initially found three absolute evaluator-parity blockers. Two were evaluator module-registration defects rather than VM defects: function-environment snapshots were captured before local sum constructors replaced same-spelled Prelude variants, so aims_fip_interprocedural.ori and aims_h_fip_reuse.ori raised NotCallable/E6032. One shared ori_eval::module_registration helper now installs variant/newtype constructors before top-level functions are captured; both programs exit successfully through a freshly built debug oric, and a focused collision pin covers local Stream.Left/Stream.Right over Prelude names. The remaining blocker is cow_list_concat.ori: evaluator returns Int(0), while both VM plans fail after seven steps with type_mismatch. Investigation shows this is not merely missing VM dispatch: TF-2a classifies every PrimOp as scalar while shipped AIMS separately infers heap-result birth and operand consumption from physical ValueRepr, so list concatenation exposes a calculus/carrier mismatch. | Retain the identity executor, strict provenance/no-fallback protocol, typed supervision, leak gate, and generic-versus-physical differential oracle as grounded architecture evidence only. Close list concatenation through a total registry-owned primitive descriptor that separates semantic result ownership/provenance, operand use, and allocation effect; AIMS must produce the ownership events once, and each executor must consume them without ValueRepr-based policy. Reject malformed or missing descriptors. Then rerun the full 207-case sweep and require zero evaluator/generic/physical blockers before any speed result counts. Revalidate and brand the physical plan once so execution performs zero planning/validation work, then measure generic versus physical execution and preparation separately across the full mixed corpus. AIMS facts and policy remain backend-neutral; the physical plan/layout/executor is a VM-private projection. LLVM debug/release/AOT behavior and leak parity remain a separate mandatory promotion matrix: this VM breadth run does not prove them. |
| Full-run dispatch profile | A checked 50,000-iteration 100-doors run completed with exact output after 952,600,025 canonical steps. The ten largest opcode populations were IntBinary 229,590,001, Copy 180,890,003, Binary 145,500,000, Const 105,090,009, Project 94,040,003, Call 69,440,003, Branch 54,300,001, Jump 44,300,001, BoolNot 24,150,000, and Construct 5,150,001. One general range-membership boolean region at function 1 PCs 74..88 received 29,100,000 entries and 407,400,000 dispatches, 42.76% of the complete run. It consists of projection, a constant, six typed comparisons, five boolean combinations, and a branch; it is not a benchmark-name special case. | Use this as the first proof-backed tracelet candidate only after the lower-risk operand-boundary experiment. A portable region may collapse dispatch overhead but must retain an ordered canonical expansion, exact PC/fuel/profile progress, typed-error and fallibility boundaries, state roots, and the identical frozen AIMS event/cleanup trace. Profiles enabled or insufficient fuel force canonical-prefix execution. Measure the same region across the mixed corpus and reject it if code/metadata/preparation memory or combined-program behavior regresses. |
| Session-specialized operand boundary | The generic and physical executors retain one opcode match and one handler set, but select canonical versus validated physical storage once at session entry and monomorphize only OperandAccess; the former per-read/write/copy/finish Option<PhysicalPcView> branch is gone. All 123 VM unit tests pass, including exact generic/physical reports, malformed-plan rejection, every quota prefix, unwind/output behavior, and final heap/value-arena cleanup. The complete seventeen-case Criterion matrix admitted every source and exact result before measurement. A controlled compile-time A/B kept handlers and semantics identical and alternated two longer 20-sample rounds over combined workloads: specialization improved doors by 11.73% generic / 9.68% physical, strings by 8.27% / 2.23%, file-pipeline by 2.93% / 4.79%, and physical JSON by 3.35%; generic JSON regressed 3.20%. The sixteen paired observations’ geometric mean improved 5.08%. The shorter all-34-observation sweep improved 1.68% by unweighted geometric mean and 5.40% by summed median runtime, but remains secondary evidence because tiny cases were noisy. The benchmark executable grew 24,952 bytes (0.1986%); text grew 20,764 bytes (0.2213%), with no per-session storage or execution-metric change. The dynamic A/B policy is removed after measurement. | Retain session-level storage specialization as the production pattern “one semantic handler set, multiple storage policies.” Pin representative canonical and physical macro benchmarks plus text-size budget in the registry; investigate the isolated generic-JSON loss without adding semantic forks. Continue with verifier-proved tracelets only from the same shared handlers and canonical expansion contract. This physical specialization consumes a validated VmLayoutPlan; it neither reruns AIMS nor changes, suppresses, or reorders a logical ownership event. |
- Treat the earlier fused example’s 88.4 ms versus Python’s 777.2 ms reading as strategy evidence only.
- Reject it as a production result because the operations were example-owned and production gates were not met.
- Measure the production-shaped baseline and every explicit bytecode optimization pass separately.
Cross-Plan Contract
- Extends
backend-boundary#s-30e3c9a6; that plan owns extracting shared pre-codegen orchestration. - Coordinates artifact identity and translation with
native-backend#s-4fa1f7d2andnative-backend#s-4148408dwithout importing BIR, compiled ABI, or target layout into the VM;repr-opt#13owns the sharedTargetSpec/CompiledLayoutPlancorrection used by both compiled backends. - Treats direct compiled WASM as a
plans/native-backenddeliverable and explicitly excludes evaluator-hosted or VM-hosted WASM execution from this plan. - This section is the architectural prerequisite for value ABI, walking skeleton, ISA, compiler, dispatch, integration, parity, and performance work.
Coordinate with the owning plans; do not absorb their deliverables. This section owns the decision and the enforcement:
| Surface | Owner | This section’s move |
|---|---|---|
ori_codegen::CodegenBackend wiring | backend-boundary#s-90024726 | decide the disposition, coordinate the change set |
| shared pre-codegen orchestration | backend-boundary#s-30e3c9a6 | extends it |
ori_backend, BIR/MIR, direct compiled WASM | native-backend#s-4fa1f7d2, #s-4148408d, #s-3caa36e9 | contract clause plus a concrete blocking anchor |
TargetSpec / CompiledLayoutPlan | repr-opt#13, placement at repr-opt#08 | inherit or supply the coinage in one change set |
ExecutableProgram artifact contract | bytecode-vm#s-ba8f2041 | read its dossier before authoring the ADR |
| class-ledger placement, predicate-stack retirement | aims-provenance-ledger | consume; never re-decide |
| enum layout SSOT | enum-layout-ssot#s-0f9158ab | CompiledLayoutPlan consumes it |
- Coordinate any
ExecutableProgramrename withbackend-boundaryandnative-backendin one change set; the name is referenced by 12 plans.PhysicalVmPlanis VM-private and renameable unilaterally. - Express the
ori_backendparity requirement as a contract clause plus a blocking pointer tonative-backend#s-4fa1f7d2, or narrow it to evaluator/VM/LLVM with the deferred half carrying a concrete anchor. It is not completable inside this section.
Layer Coverage
| Layer | Disposition |
|---|---|
| L1 | N/A: no grammar change. |
| L2 | N/A: no type-system change; typed frontend facts are immutable inputs. |
| L3 | Covered by same-frontend-provenance and independent evaluator-oracle fixtures. |
| L4 | Covered by shared executable-program identity, closed callable census, and exact ARC/AIMS provenance. |
| L5 | Covered by absolute evaluator/VM behavior parity. |
| L6 | Covered by absolute evaluator/VM/LLVM-debug parity. |
| L7 | Covered by absolute evaluator/VM/LLVM-release parity. |
| L8 | Covered by absolute evaluator/VM/LLVM-AOT parity. Admitted ori_backend and direct compiled WASM are not covered here; the crate does not exist and the coverage carries a blocking pointer to native-backend#s-4fa1f7d2. |
| L9 | NOT YET COVERED. Executor parity fixtures across ori_vm, ori_llvm, and ori_repr hand-construct ori_repr::plan::ReprPlan::new inputs rather than consuming production realization output. Re-root the fixtures on realize_closed_program -> ExecutableProgram::validate output, then re-assert. |
| L10 | PARTIALLY COVERED. Per-run state isolation, malformed-input safety, and leak gates hold. The ownership/RC-trace correspondence half is not covered: the cross-tier ownership-event-trace instrument does not exist, and only burden-sole readings are admissible. |
| L11 | Covered by callable/effect/error/resource fixture matrices. |
| L12 | NOT YET COVERED. The production entry point is exercised through hand-built artifact inputs, not the real CLI routing path end to end. Assert only after the L9 re-rooting lands. |
- Treat the L9, L10, and L12 rows as close-blocking until their stated gates hold; do not restore a bare
Covered. - Re-verify each row against the two-dimension executor requirement: cross-executor parity and resource/ownership leak-freedom are separate legs, and neither alone satisfies the backend dimension.
Work Items
- Prove forbidden dependency and impurity constraints with architectural tests, including no
oric,ori_llvm, orori_backenddependency fromori_vm; no backend callback during realization; one shared compiled layout/ABI classification; and no mutable process-global execution state. - Freeze the production eval dataflow, module ownership, dependency direction, pure seam APIs, typed error boundaries, state lifetime, and no-fallback invariants in an architecture decision record informed by prototype evidence. The ADR MUST explicitly decide and record: (1) the name-freeze order for
VmLayoutPlan,CompiledLayoutPlan(TargetSpec),TargetSpec, andRuntimeCallSpec— none of which exist in the tree today — coordinated in the same change set withrepr-opt#13andnative-backend#s-4fa1f7d2/#s-4148408dso a name is not picked in isolation and then contradicted by a sibling plan; (2)ori_codegen’s disposition — either commitori_llvmto depend on it and implementCodegenBackend(coordinated withbackend-boundary#s-90024726, which owns that wiring) or explicitly recordori_codegenas target-only/not-yet-wired — rather than let the crate-ownership table describe an intention as if it were the current build graph; (3) which single validator (ori_repr::executable::ExecutableProgram::validate,program_freeze::validate, or one of thevalidation.rsfunctions) is the sole fail-closed admissibility gate, demoting the remaining near-duplicate validators to its private internal stages. - Implement the shared immutable executable-program realization and fixed execution/codegen routing so tree-walker, VM, LLVM debug/release/AOT, and admitted
ori_backendtargets preserve absolute observable parity — including the ownership/cleanup event trace and RC-trace correspondence required by the Absolute Parity Contract, not merely output/value behavior — without duplicated semantic discovery. Re-root every differential/parity fixture ontorealize_closed_program()->ExecutableProgram::validate()production output rather than hand-constructedori_repr::plan::ReprPlan::new()inputs (the current pattern inori_vm/ori_llvmtest fixtures), and build or wire the cross-tier ownership-event-trace comparison instrument this requires, before any parity claim in this section’s Layer Coverage table counts.
Intel dossier — pointer and tier disposition
Dossier: production-eval-architecture-contract--s-429b48fe.intel.md (this section’s content/intel/ sidecar)
Read that dossier from line 1 through EOF before acting on this section. This block is a pointer and an audit record, never a substitute: not the BLUF, not a summary, not selected tiers.
| Dossier tier | Title | Lines | Disposition | Where / why |
|---|---|---|---|---|
| 0 | 0. Bottom line up front | 33 | integrated | ## Goal — added the contract-half status table (vertical spine grounded vs horizontal physical-plan split absent vs already-true dependency direction) plus the ordering rule that the dependency/impurity architectural tests land first and every other item is blocked on the name freeze. |
| 1 | 1. The target, verbatim | 53 | integrated | ## Goal — recorded the CONTRACT-FREEZE verdict explicitly: the deliverable is a decision record plus enforcement tests, never a feature implementation. |
| 2 | 2. Terrain — the symbols the contract names, grounded | 64 | integrated | ## Crate and Module Ownership — new grounded-state table marking ori_target and ori_backend as non-existent crates and rewriting the ori_llvm/ori_codegen row against the verified build graph; ## AIMS Calculus and Physical-Projection Boundary — named both RcStrategy definition sites (ori_arc/src/ir/repr.rs:128, ori_repr/src/plan/query.rs:60) and RcAtomicity (ori_arc/src/ir/repr.rs:181) with a required ADR disposition. |
| 3 | 3. Code-graph recon | 179 | integrated | ## Pure Seam Contracts — added grounded seam facts: realize_closed_program’s two admitted oric callers to pin, the convention-only one-owner invariant, and the hotspot warning that re-shaping the admissibility gate re-shapes the repo’s #1/#3 hotspots at once; ## Closed Executable Program — named ExecutableProgram::validate the sole admissibility gate and demoted the sibling validators; ## Layer Coverage — L9/L12 downgraded over the hand-constructed ReprPlan::new fixture finding. |
| 3D | 3D. Diagnostic / observability surface | 27 | integrated | ## Absolute Parity Contract — new admissibility rule that RC and ownership evidence counts only from the burden-sole path (ORI_DISABLE_PREDICATE_STACK_RC=1 ORI_VERIFY_ARC=1 ORI_VERIFY_EACH=1), that a default-path count is false-green and inadmissible as an ADR fact, and that survivors rank by named non-discharge cause against the hotspot list. |
| 3H | 3H. Hygiene constraints the recommended design inherits | 30 | integrated | ## AIMS Calculus and Physical-Projection Boundary — made the no-physical-vocabulary structural gate an architectural test rather than a review convention and named it the contract’s most load-bearing clause; ## Closed Executable Program — indexed fact table required so a new fact family is not an N+1 accessor duplication; ## Absolute Parity Contract and ## Layer Coverage carry the seam-injected-coverage and layer-gap consequences. |
| 4 | 4. Cluster / family — the sibling sections | 40 | integrated | ## Cross-Plan Contract — new owner table covering backend-boundary s-90024726/s-30e3c9a6, native-backend, repr-opt, bytecode-vm s-ba8f2041, aims-provenance-ledger, and enum-layout-ssot, plus the rename-coordination rule (ExecutableProgram spans 12 plans and needs one change set; PhysicalVmPlan is VM-private and renameable unilaterally). |
| 5 | 5. Conformance audit | 27 | integrated | ## Closed Executable Program — recorded the source-confirmed four-way per-FunctionId accessor cluster (function_effects, fresh_return_facts, param_disjointness, callable_facts) and the duplicated index/from_index newtype boilerplate as the collapse targets, while explicitly retaining the external_function/external_functions pair and requiring confirmation before retaining function_family_lambdas. |
| 6 | 6. Plan ownership — who owns this code now | 26 | integrated | ## Cross-Plan Contract — coordinate-with-do-not-absorb owner table plus the explicit rule that the ori_backend parity requirement is not completable inside this section and must carry a contract clause with a blocking pointer to native-backend#s-4fa1f7d2 or a narrowed scope with a concrete anchor. |
| 7 | 7. Prior art — in-graph (cross-repo) | 46 | integrated | ## Prototype-to-Production Decision Rule — evidence-admissibility clause recording that the reference-VM corpus is name-navigable only, that cross-repo semantic search is unavailable for the six ingested VM repositories, that the north-star interpreter’s bytecode handlers are unindexed assembly, and that Ori’s design stays independently derived with peer source informing design pressure only. |
| 7B | 7B. External prior art (web) — the problem class, interrogated | 107 | integrated | ## AIMS Calculus and Physical-Projection Boundary — one-declaration principle enforced by exhaustive closed matching with whole-tier code generation and interpreter-as-specification both explicitly rejected; ## Closed Executable Program — validity-by-type kept and the deterministic fingerprint bound to it as one deliverable with function/site-bound fact identity; ## Absolute Parity Contract — the oracle recorded as necessary and provably insufficient, with the ownership-event-trace equality obligation and its missing cross-tier instrument named. |
| 8 | 8. Sentiment — community heat around the terrain | 16 | integrated | ## Prototype-to-Production Decision Rule — requirement to read the peer projects’ interpreter-relocation and interpreter-dispatch defect history before writing the ADR’s evaluator-boundary clause, recording that both peer signals raise this contract’s bar rather than lower it. |
| 9 | 9. Coverage gaps — what is dark and why | 28 | integrated | ## Prototype-to-Production Decision Rule — evidence-admissibility clause requiring source verification of every graph-sourced claim over stale facets, banning the zero-caller-means-dead-code reading on impl methods, and treating a zero-row hygiene or co-change result as unknown rather than clean. |
| 10 | 10. Recon entry points — the ordered read path | 20 | integrated | ## Cross-Plan Contract — the read-order obligation to read bytecode-vm#s-ba8f2041’s dossier before authoring the ADR; ## Pure Seam Contracts and ## Closed Executable Program carry the ordered entry points (realize_closed_program callers, the validate/freeze hotspot pair, the single admissibility gate) as grounded file:line anchors. |