CacheMetrics struct (40 LOC): - stable_prefix_bytes, dynamic_tail_bytes - drift_metric (0.0-1.0 ratio) - cache_eligible flag (drift < 0.3) - compression_ratio() and header_* methods PromptBuilder::cache_metrics() (40 LOC): - Calculates cache alignment metrics for query+chunk pairs - Integrates CacheAligner output - Gets compression ratio from ContextOptimizer - Used for HTTP headers and observability HTTP headers ready for client integration: - X-Cache-Stable-Bytes - X-Cache-Drift - X-Cache-Eligible - X-Compression-Ratio 3 new tests: - test_cache_metrics_stable_query - test_cache_metrics_compression_ratio - test_cache_metrics_header_drift Total: 117 mem-core tests (114 before + 3 new)
24 lines
849 B
Rust
24 lines
849 B
Rust
pub mod domain;
|
|
pub mod lesson;
|
|
pub mod symptom_projection;
|
|
pub mod query;
|
|
pub mod prompt;
|
|
pub mod gate_parser;
|
|
pub mod gated_loop;
|
|
pub mod query_executor;
|
|
pub mod optimizer;
|
|
|
|
pub use gate_parser::{GateResponse, ParseError, parse_gate_response};
|
|
|
|
pub use domain::{
|
|
Chunk, Level, MemoryNode, Provenance, Record, Role, ProjectId, QueryId, RunId, Sha256Hash,
|
|
};
|
|
pub use lesson::{
|
|
derive_lessons, extract, lookup, normalise, render_injection, render_skill, similarity,
|
|
tool_of_cmd, Confidence, Event, Hit, Lesson, Signature, Tier,
|
|
};
|
|
pub use query::{Query, QuerySet, SynthesisQuery};
|
|
pub use prompt::{PromptBuilder, PromptMessages, CacheMetrics};
|
|
pub use symptom_projection::{project_symptom, SymptomVector};
|
|
pub use optimizer::{ContextOptimizer, ContextOptimizerConfig, ContentType, OptimizedChunk, CacheAligner, AlignedContent, CcrStore};
|