kcode-k1-kmap-loader 0.7.0

Stateless access-filtered attention loader for K1 Kmaps
Documentation
1
2
3
4
5
6
7
8
9
10
# Public API

Reexports `kcode_k1_kmap_format::{Node, NodeId}` and defines `PREVIEW_COST` (0.3), `NARRATIVE_COST` (1.0), `OpenMode::{Full, NavigationOnly}`, `LoadedNode`, and `OpenResult`; `open_node(node_id, budget, temperature, mode, load_node, candidate_filter)` is synchronous.
The filter receives source-ordered batches of unresolved target IDs and returns an allowed `Result<Vec<NodeId>, String>` subset; IDs must be unique and requested, omissions deny, empty batches are skipped, decisions are cached, and errors retain the complete callback message.
The root is caller-authorized. Denied targets are removed before reads, costs, scoring, and RNG.
Each `LoadedNode` exposes pull-in provenance: the traversal root has `source: None`, while every non-root output has `source: Some(parent_node_id)` for the exact connection occurrence that first inserted it. Opening a preview preserves that source.
Visible duplicate paths remain separate weighted tickets carrying cumulative path strength: the root inherits 1.0, each child occurrence multiplies its edge weight by its parent's inherited strength, and only finite-positive tickets are eligible.
`Full` returns the root narrative and uses free root Navigation previews plus two-hit preview/narrative loading, propagating the selected ticket's strength when a preview is opened.
`NavigationOnly` returns no narratives and atomically loads selected nodes with visible unseen Navigation children, which inherit their incoming-edge strengths; its first unaffordable bundle stops without resampling.
Budget and temperature must be finite and nonnegative. Missing visible nodes, callback/entropy failures, malformed filter results, and arithmetic overflow return errors; caller-owned reads, filtering, and entropy provide no finite wall-clock bound.