kcode-kweb-context 0.2.8

Typed Kweb node context and Chatend box projection policy
Documentation
# API and behavior

Node types, legacy JSON decoding, and full-node body formatting are delegated
to `kcode-kweb-context-node` and re-exported from this crate. `Context` retains
explicitly loaded nodes. Its optional compatibility mode also retains their
fixed connections as full nodes; explicitly loaded nodes take precedence over
that fixed role.

`Context::apply_load` accepts one fetched node. In compatibility mode it also
requires the full nodes fetched for that node's fixed connections.
`Context::restore` reconstructs the same mode-specific state from stored nodes
and the ordered IDs established by prior `LoadNodes` invocations. Fetching,
authorization, root selection, Kweb persistence, and commit boundaries remain
caller-owned.

## Box-free projection

`Context::projection` returns effect-free provider-facing sections with stable
logical keys, names, and text. Full nodes and individual connection map markers
are independently replaceable. It never opens or changes Session History.

Fresh terminology is **connection map marker**. New aggregate canonical text is
headed `Connection map markers`; the exact legacy heading
`Connection summaries` remains readable. Compatibility identifiers such as
`connection-summaries`, `kwebConnectionSummaryIds`, and role
`connection-summary` remain unchanged.

## Mutable staged reconciliation

`Context::sync_chatend` preserves the staged Kweb reconciliation behavior. It
may update existing names and canonical content, normalize the accepted legacy
heading to current terminology, retire removed full-node slots, and change the
Kweb tool layout to the current projection. Connection boxes retain membership,
new markers use fresh boxes of at most eight entries, and caller-selected
summarized or dehydrated representations survive canonical updates.

## Cache-safe LoadNodes reconciliation

`Context::sync_load_chatend` is the separate LoadNodes path. It validates a
complete plan before mutation, scans every Kweb tool slot, and uses ordinary
Session History `apply_tool_slots` without a layout. Existing slot order, names,
retirement, layout, visible representations, and occurrence history stay exact.
An existing active full-node or connection box whose latest canonical content
changed receives a cache-preserving canonical advance; the returned IDs are
only those pre-existing active boxes, in existing-slot order, for caller-owned
stale notification.

Historical, retired, and duplicate boxes are never resurrected or migrated.
Unseen full nodes and connection IDs are appended in fresh ordinary boxes after
all existing slots; old partial and empty connection boxes are never filled.
Connection membership is globally deduplicated across active and retired slots,
and fresh boxes contain at most eight entries. If no connection box has ever
existed, an empty projection still creates one fresh empty box for source
compatibility. A later explicit `HydrateBox` reveals the latest canonical.

Post-tool hydration or dehydration is runtime/caller-owned. Both synchronization
methods require an already-open Session History handle and do not fetch Kweb,
open persistence, authorize data, commit a Kweb transaction, or notify a model.