feat(token-economics): filesystem cache, eviction, and integration hardening #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/token-economics-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
FileObservationCachebacked by SQLite (migration 017) with content-addressed deduplication, LRU/stale-entry eviction, and byte-budget enforcementeviction.rsmodule to stay within 400-line file guidelineread_file,list_directory) with RBAC permission enforcement and cache integrationdocs/MCP_TOOLS.mdanddocs/RUNNING.mdfor new filesystem tools and cache confignotes/evaluation-260417/)Test Plan
cargo test --workspacecargo clippy -- -D warningscargo fmt --checkfile_cache_roundtrip,token_economics_replay,file_tools_mcp,rbac_enforcementSelf-Review Checklist
unwrap()in library codeprintln!/dbg!On filesystems not in the short-circuit allowlist (tmpfs and Docker overlay2 on CI runners), the server downgrades COGNIX_MCP_FILE_CACHE_MODE from short_circuit to shadow. In shadow mode the second Read returns the full file content instead of a compact {"cache_hit":true,...} payload, so all three round-trip tests were panicking with a JSON parse error. Add is_cache_hit_json() helper to detect the downgrade: if the second read is not a cache-hit payload, assert the full content was returned and skip short-circuit-specific assertions. This mirrors the existing pattern in token_economics_replay.rs (test_te6_read_heavy_replay_...).