kcode-k1-kmap-loader 0.3.0

Stateless access-filtered attention loader for K1 Kmaps
Documentation
Reexports `kcode_k1_kmap_format::{Node, NodeId}`.
Defines `PREVIEW_COST: f64 = 0.3`, `NARRATIVE_COST: f64 = 1.0`, and `DEPTH_DECAY: f64 = 0.7`.
`OpenMode { Full, NavigationOnly }` implements `Clone + Copy + Debug + Eq + PartialEq`.
`LoadedNode` exposes `node_id: NodeId`, `title: String`, `navigation_hint: String`, and
`narrative: Option<String>`; it implements `Clone + Debug + PartialEq`.
`OpenResult` exposes `nodes: Vec<LoadedNode>` and `automatic_attention_spent: f64`;
it implements `Clone + Debug + PartialEq`.
`pub fn open_node<L, A>(node_id: NodeId, budget: f64, temperature: f64, mode: OpenMode,`
`load_node: L, access_filter: A) -> Result<OpenResult, String>`, where
`L: FnMut(NodeId) -> Result<Option<Node>, String>` and `A: FnMut(NodeId) -> bool`.

The root is assumed authorized, and target access decisions are memoized before reads or selection.
Denied metadata is omitted, duplicate connection occurrences remain weighted tickets, and each
occurrence scores as `weight.value * DEPTH_DECAY.powf(depth)`.
Budget and temperature must be finite and nonnegative; missing allowed nodes, callback or entropy
failures, attention overflow, and depth overflow return errors. Calls are synchronous and have no
finite wall-clock bound because node reads are caller supplied.

`Full` returns the root narrative and provides accessible root `Navigation` previews free.
An unseen target's first selected hit costs `PREVIEW_COST`; its next selected hit costs
`NARRATIVE_COST` plus all newly guaranteed `Navigation` previews. Only affordable candidates are
selected; guarantees retain source order, opened nodes leave selection, and narrative upgrades
preserve first-visible output order.

`NavigationOnly` never returns narratives. The root is free, and its complete accessible unseen
`Navigation` bundle costs `PREVIEW_COST` per node atomically. Each later selected target and its
unseen accessible `Navigation` children form another atomic preview bundle. Loaded navigation
children push their outgoing occurrences one extra depth forward; the first unaffordable selected
bundle stops traversal without partial output or resampling. Only preview charges count as automatic
attention, exact budget equality fits within floating-point tolerance, and operating-system
randomness supplies selection without a seeded mode.