source · Rust

Lib

crates/vak-context/src/lib.rs
Raw
1.7 KB34 linesSnapshot ed4ab258
  1. 1//! vak-context: the context engine (docs/design/68-context-engine.md).
  2. 2//!
  3. 3//! Everything that decides *what one request carries* for the model in
  4. 4//! front of it, as pure functions over the session ledger:
  5. 5//!
  6. 6//! - [`capacity`] — `CapacityProfile`: the measured capacity of one model on
  7. 7//! one provider (window, usable instruction horizon, tokens per char,
  8. 8//! prefill rate, cache behaviour), probed at bind time and revised from
  9. 9//! every receipt. Nothing in a request is sized from a declared number.
  10. 10//! - [`planner`] — `WorkingSetPlanner`: which closed turns ride along at
  11. 11//! `Full`, `Card` or `Packet` fidelity for this request, chosen against
  12. 12//! the measured budget by `max(recency, relevance, anaphora)`. A turn is
  13. 13//! never split; nothing model-visible is cut by a character count.
  14. 14//! - [`assemble`] — the request assembler: the byte-stable prefix and its
  15. 15//! digest, the per-turn tail attached to the last user message, cache
  16. 16//! breakpoints per §10, char accounting that feeds the profile, and the
  17. 17//! summariser request behind a compaction packet.
  18. 18//!
  19. 19//! The ledger itself — `TurnIndex`, `TurnCard`, `derive_with_plan`, the
  20. 20//! range-keyed packets and `recall` — lives in `vak-session`: that is the
  21. 21//! one rich original every projection is computed from, and this crate
  22. 22//! only reads it. The agent loop (`vak-agent`) and the host (`vak-core`)
  23. 23//! own the I/O: probing, the summariser call, and writing what came back.
  24. 24//! Nothing here performs network or disk I/O.
  25. 25
  26. 26pub mod assemble;
  27. 27pub mod capacity;
  28. 28pub mod planner;
  29. 29
  30. 30pub use assemble::TailInput;
  31. 31pub use capacity::{CapacityProfile, ProfileKey};
  32. 32pub use planner::{PlanInput, plan, plan_for_session};
  33. 33pub use vak_session::{Fidelity, WorkingSetPlan};
  34. 34