# Cache Round 7 Plan

## Summary

Round 7 should improve repeated read performance now that the lifecycle and gateway surfaces are broad enough to justify optimization.

The work is sequenced in this order:

1. identify hot repeated read paths around lifecycle projection and vault scans
2. add lightweight in-process caching where it is safest
3. verify correctness under repeated reads and stale-invalidating cases
4. update handoff status with measured impact

## Key Changes

### Lifecycle projection

- avoid rebuilding the same latest-state projection multiple times inside one process when inputs have not changed
- keep append-only semantics intact
- do not introduce history rewriting or mutable projections

### Retrieval path

- evaluate whether the MCP/CLI retrieval path already gets enough benefit from existing vault snapshot caching
- add only the smallest additional cache that materially reduces repeated work

## Test Plan

- repeated-read tests for lifecycle queues and record lookups
- stale-data protection tests after new ledger appends
- benchmarks or timing notes where a simple measurement is available

## Assumptions

- Round 7 does not change external tool names or payloads
- Round 7 does not add persistent disk-backed caches yet
- Round 7 keeps correctness and freshness ahead of raw speed

## Completion Status

Last checked: `2026-04-12`

Completed in this round:

- added in-process lifecycle projection caching keyed by ledger file fingerprint
- invalidated projection cache on append so fresh reads still observe new events
- added repeated-read and stale-after-append regression tests
- kept retrieval path unchanged because existing vault snapshot caching already covers the current repeated-read case well enough
- verification completed with full test and check passes

Checked for omissions against this plan:

- no missed items inside the scoped implementation baseline
- external tool names and payloads remain unchanged
- disk-backed persistent cache remains intentionally deferred
