franken-kernel 0.2.9

Suite-wide type substrate for FrankenSuite: TraceId, DecisionId, PolicyId, SchemaVersion.
Documentation

Suite-wide type substrate for FrankenSuite (bd-1usdh.1, bd-1usdh.2).

Canonical identifier, version, and context types used across all FrankenSuite projects for cross-project tracing, decision logging, capability management, and schema compatibility.

Identifiers

All identifier types are 128-bit, Copy, Send + Sync, and zero-cost abstractions over [u8; 16].

Capability Context

[Cx] is the core context type threaded through all operations. It carries a [TraceId], a [Budget] (tropical semiring), and a capability set generic parameter. Child contexts inherit the parent's trace and enforce budget monotonicity.

use franken_kernel::{Cx, Budget, NoCaps, TraceId};

let trace = TraceId::from_parts(1_700_000_000_000, 42);
let cx = Cx::new(trace, Budget::new(5000), NoCaps);
assert_eq!(cx.budget().remaining_ms(), 5000);

let child = cx.child(NoCaps, Budget::new(3000));
assert_eq!(child.budget().remaining_ms(), 3000);
assert_eq!(child.depth(), 1);