mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
Adds idx/expires_at/<padded_exp>-<id> hardlinks for events with an expiration tag, an injectable clock so tests can drive time deterministically, and the deleteExpiredEvents() sweep. - FsLayout: idxExpiresAt + expirationEntry path helper. - FsIndexer.pathsFor: emits the expiration entry whenever event.expiration() > 0, so insert / delete maintain it alongside the kind / author / owner / tag indexes. - FsEventStore: pre-insert guard rejects events with exp <= now (SQLite parity: trigger uses inclusive <=). Constructor takes a clock function defaulting to TimeUtils.now(). deleteExpiredEvents walks idx/expires_at, parses filenames, and deletes anything with exp < now (strict <, matching SQLite's sweep query). Tests: 8 new in FsExpirationTest — future expiration accepted + indexed, already-expired-on-insert rejected, exp==now rejected on insert but kept by sweep, non-positive exp ignored, sweep removes canonical + index entries, plain events untouched. 59 fs tests green.