Story Crater Bot
bcb4e30ec2
feat: M3.8.2 cache aligner integration — metrics + headers (3 tests)
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)
2026-08-28 10:05:45 -07:00
..
2026-08-23 09:42:09 -07:00
2026-08-28 07:47:26 -07:00
2026-08-28 10:05:45 -07:00
2026-08-26 13:55:37 -07:00
2026-08-27 20:36:57 -07:00
2026-08-27 21:35:07 -07:00