0%

Cross-Plan Coordination

Goal

Prevent plans/native-backend from cloning LLVM wiring or target/ABI policy, and freeze the separate compiled-codegen versus runtime-execution selector axes used by plans/bytecode-vm.

Context

At plan creation, plans/native-backend proposed mirroring oric’s LLVM wiring with compile_to_native_* twins, while plans/bytecode-vm proposed a competing BackendChoice name for execution selection. Those source contracts are now amended: native-backend consumes the shared codegen interface, and bytecode-vm owns the separate ExecutionBackend axis. This section preserves the mechanical dependency and pins those resolved decisions so later execution cannot regress to the historical forks.

Implementation sketch

  1. Via the sanctioned plan-corpus API (never a raw metadata edit), verify or add a cross_plan_needs entry on plans/native-backend’s driver-integration section referencing this plan’s s-90024726 section. The owning orchestrator executes the structural mutation.
  2. Keep plans/native-backend’s driver integration on ori_codegen::CodegenBackend over explicit ExecutableProgram + TargetSpec + CompiledLayoutPlan. Backend-private BIR/MIR remains internal; typed native-object or complete-WASM finalization returns the common EmittedArtifact, so oric does not grow native-specific orchestration.
  3. Require plans/bytecode-vm to use ExecutionBackend { Vm, Compiled(CodegenBackendChoice) } for run/test routing. CodegenBackendChoice { Llvm, Native } remains scoped to compiled codegen, and the VM never implements it.

Spec references

.claude/rules/routing.md §5 (cross-plan ordering primitives); state-discipline.md §5 (plan-altering changes edited same-turn as the decision).

Work items

  • Verify the sanctioned cross_plan_needs edge on native-backend driver integration and pin its explicit input plus typed artifact-finalization conformance to ori_codegen::CodegenBackend; reject orchestration, layout, ABI, or post-codegen artifact forks.
  • Freeze the ExecutionBackend versus CodegenBackendChoice ownership split in plans/bytecode-vm and add an architecture pin proving VM is not accepted by compiled-codegen dispatch.