Skip to main content

Crate franken_kernel

Crate franken_kernel 

Source
Expand description

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);

Structs§

Budget
Time budget in the tropical semiring (min, +).
Cx
Capability context threaded through all FrankenSuite operations.
DecisionId
128-bit identifier linking a runtime decision to its EvidenceLedger entry.
NoCaps
An empty capability set for contexts that carry no capabilities.
ParseIdError
Error returned when parsing a hex identifier string fails.
ParseVersionError
Error returned when parsing a semantic version string fails.
PolicyId
Identifies a decision policy (e.g. scheduler, cancellation, budget).
SchemaVersion
Semantic version (major.minor.patch) with compatibility checking.
TraceId
128-bit unique trace identifier.

Traits§

CapabilitySet
Trait for capability sets carried by Cx.