bb_ir/version.rs
1//! Framework-wide version constants.
2//!
3//! Four orthogonal version axes are checked at the install seam
4//! between DSL → Compiler → Runtime, per
5//! `docs-plan/CORRECTED_ARCHITECTURE.md` §Versioning:
6//!
7//! 1. [`FRAMEWORK_IR_VERSION`] — stamped by DSL into
8//! `ModelProto.metadata_props["ai.bytesandbrains.ir_version"]`;
9//! checked once at `Compiler::with_target_version` entry.
10//! 2. `WireEnvelope.schema_version` — lives on the wire envelope
11//! (`bb-runtime`); checked by `EnvelopeCodec::decode_capped`.
12//! 3. `NodeSnapshot.spec_version` — lives on the snapshot
13//! (`bb-runtime`); checked by `Node::restore`.
14//! 4. [`crate::syscall_ids::SYSCALL_OPSET_VERSION`] (and sibling
15//! domain-versioned opsets) — stamped into
16//! `GraphProto.opset_import`; the runtime registers
17//! `atomic_dispatch` keyed by `(domain, op_type, version)`.
18
19/// The current framework IR contract version. Bump when the
20/// `ModelProto` invariants the compiler depends on change in a way
21/// that older DSL emits cannot satisfy.
22///
23/// Stamped by `Module::build` into the canonical key
24/// `"ai.bytesandbrains.ir_version"` on `ModelProto.metadata_props`.
25pub const FRAMEWORK_IR_VERSION: u32 = 1;
26
27/// Canonical metadata-props key under which
28/// [`FRAMEWORK_IR_VERSION`] is stamped on each `ModelProto`.
29pub const FRAMEWORK_IR_VERSION_KEY: &str = "ai.bytesandbrains.ir_version";