Add a best-effort accepted-artifact filesystem cache

This commit is contained in:
2026-11-22 01:52:21 +00:00
parent 37e0753472
commit 3ef55b1cf0
5 changed files with 477 additions and 0 deletions

View File

@@ -1184,6 +1184,22 @@ testing when supported; it is a migration check, not a new release requirement.
## Stage 26: Implement The Small Accepted-Artifact Filesystem Cache
**Status:** Complete. Added a narrow accepted-artifact cache collaborator and
filesystem implementation storing unchanged JSON bytes at the selected root
under the opaque native hash plus `.json`. Construction/lookup create no cache
directories. Auto reads/writes, bypass performs no cache I/O, and refresh skips
lookup and replaces only a newly supplied valid result; failed writes preserve
previous acceptance. Missing entries are ordinary misses, while malformed,
unreadable, non-file, and unsafe entries return diagnostic misses. Caller-owned
typed decoding/usability and best-effort warning handling remain in the next
integration stage. Reused confined atomic process-permission writes without new
permission policy, envelopes, fingerprints, expiry, or legacy data migration.
Real-filesystem tests cover raw-byte identity, exact root/hash placement, modes,
failed refresh, cancellation, concurrent complete replacement, temporary-file
cleanup, narrow paths/symlinks, unchanged legacy records, umask/setgid inheritance,
and unchanged provisioned root permissions. Cache/fileio/contracts tests, vet,
race checks, focused pipeline tests, and `git diff --check` pass.
**Goal:** one best-effort cache facility replaces complex persistent records.
**Inspect/change:** existing `internal/core/fileio` and cache permission/path tests;