Skip to main content

Module policy_kernel

Module policy_kernel 

Source
Expand description

POLICY_KERNEL – persistent routing policy store (H2.5).

Stores IntelligentRouter routing policies and cost records to disk so they survive agent restarts. The default location is ~/.clawft/agents/<id>/policy_kernel.json, falling back to ~/.clawft/memory/policy_kernel.json when no agent ID is set.

The store is loaded on startup and saved on every policy change. Format is intentionally JSON for debuggability.

This module is gated behind the vector-memory feature flag.

Structs§

PersistedCostRecord
A persisted cost record.
PolicyEntry
A persisted routing policy entry.
PolicyKernel
Persistent routing policy store.
PolicyKernelState
The full persisted state of the policy kernel.

Enums§

PolicyKernelError
Errors from policy kernel persistence.

Functions§

load_policy_kernel
Try to load a policy kernel for a specific agent, falling back to the global kernel, and finally to a fresh empty kernel at the global path.