fix(cache): report eviction only after store deletion succeeds

Merged
RU
5d ago
+72-5

A rejected custom cache-store deletion currently leaves the entry in place while the step report claims write: evicted. This reports eviction only after deletion resolves in both the direct eviction and settlement paths, preserving the existing best-effort behavior on a rejected store operation.

Regressions reproduce false eviction claims on the unchanged baseline, verify the retained cache bytes, and check that subsequent confirmed writes still proceed. All 79 cache tests passed without filtering, and full pnpm check passed on the final revision. Separate agent review passed for that exact revision. The ADR, changeset and cache guide update are included. Related cache-outcome reporting discussion: #939. No browser or model calls were needed.

The default FileCacheStore now suppresses only ENOENT on unlink: other failures remain observable to the best-effort eviction caller. A real non-root POSIX permission-denied regression failed on the previous revision and passes on this correction; retained bytes and absent eviction outcome are asserted, with a missing-entry control. Candidate: 80 cache tests and full pnpm check pass. Renewed separate review independently ran 124 impacted tests without failures or skips. The permission test skips Windows/root and restores permissions in finally. ADR updated in the same reviewed revision.