Expand description
Context Bundle v1 (GH-932): versioned request/plan/bundle/audit contract.
remem’s callers should face a policy-aware context compiler instead of “several search tools plus one pre-rendered text blob”. This module holds the v1 internal Rust contract:
plan(request)builds a deterministicContextPlanwith a stable plan hash (no timestamps or randomness enter the hash);execute(plan, inputs)selects caller-provided candidates by reusing the existing SessionStart relevance policy, enforces per-section and total token budgets, and returns aContextBundlewhoseContextAuditrecords every considered/selected/dropped candidate with a machine-readable reason and a degraded mode (full / canonical_only / blocked).
v1 is an experimental internal API. MCP/REST endpoints, DB-backed executor wiring, rerank/graph channels, doctor plan summaries, and benchmark artifact hashes are follow-up work on GH-932.
Structs§
- Audit
Entry - Context
Audit - Context
Bundle - Context
Filters - Context
Item - One candidate or selected context item.
stable_keyfollows the SessionStart identity convention (memory:<id>,session_summary:<id>). - Context
Plan - Context
Request - Executor
Inputs - Candidate inputs for one execution.
enrichment_available = falsedegrades the bundle tocanonical_only: generated and graph-derived candidates are dropped instead of being served without their backing enrichment stack. - Planned
Channel - Project
Ref - Section
Budgets - Per-section token budgets plus the total request budget.
Enums§
- Agent
Role - Channel
Kind - The retrieval channels the v1 planner knows about; they mirror the SessionStart sections.
- Context
Intent - Degraded
Mode - Bounded degradation contract: enrichment/vector/rerank incompatibility
may degrade to
CanonicalOnly; only canonical schema or scope-safety failures produceBlocked. - Item
Validity - Risk
Class - Source
Kind - Where an item’s text came from. Generated or graph-derived projections explain “why it was found” and must never masquerade as canonical memory.
- Trust
Class
Constants§
- CONTEXT_
BUNDLE_ POLICY_ VERSION - Bump when planner/executor selection or budget policy changes.
- CONTEXT_
BUNDLE_ SCHEMA_ VERSION - Version of the request/plan/bundle/audit JSON shapes.