Cache/API implementation (#36), phase 3.
Depends on the content/thumbnail-store and eviction units.
Goal
Aggressive local precache (owner ruling 5): fill thumbnails for the whole
account and originals for favorites + the latest week, started inside open(),
needing nothing from the caller.
Scope
Thumbnails: every file in the account, newest first, through the thumbnail
pool, until 100% on disk; never evicted. The queue is shared with thumbnails.ensure so visible/ahead always go ahead of the background
fill. A file already cached costs one Set lookup from the open-time listing.
Originals (the pinned set), through the content pool, in order: every file in
the favorites album (Collection.type === "favorites"), then every file whose takenAt is within the precacheOriginalsDays (default 7) ending at the
newest takenAt in the account. When a refresh adds a favorite or a newer
file it joins the queue; when the window moves or a favorite is removed the
file leaves the pinned set and becomes an ordinary cached original (eligible
for eviction).
open() options: precacheThumbnails? default true, precacheOriginals?
default true, precacheOriginalsDays? default 7. Progress via the open() onProgress and status() (thumbnailsCached/Total, originalsCached, originalsPinned, ...).
"Latest week" = the 7 days ending at the newest takenAt in the account (not
the last 7 calendar days), per the design's reading.
Definition of done
Both precaches start from open(), run through their pools, are preemptible by
on-demand work, and update status(); pinned set integrates with eviction.
Tested against a fake library/pool; make check green.
Grounding
src/library/. Depends on content/thumbnail store + eviction (pinned set).
Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends (closes #<this issue>). End every message with Model: opus-4-8.
Model: opus-4-8
Cache/API implementation (https://git.eeqj.de/sneak/quak/issues/36), phase 3.
Depends on the content/thumbnail-store and eviction units.
## Goal
Aggressive local precache (owner ruling 5): fill thumbnails for the whole
account and originals for favorites + the latest week, started inside `open()`,
needing nothing from the caller.
## Scope
- Thumbnails: every file in the account, newest first, through the thumbnail
pool, until 100% on disk; never evicted. The queue is shared with
`thumbnails.ensure` so `visible`/`ahead` always go ahead of the background
fill. A file already cached costs one `Set` lookup from the open-time listing.
- Originals (the pinned set), through the content pool, in order: every file in
the favorites album (`Collection.type === "favorites"`), then every file whose
`takenAt` is within the `precacheOriginalsDays` (default 7) ending at the
newest `takenAt` in the account. When a refresh adds a favorite or a newer
file it joins the queue; when the window moves or a favorite is removed the
file leaves the pinned set and becomes an ordinary cached original (eligible
for eviction).
- `open()` options: `precacheThumbnails?` default true, `precacheOriginals?`
default true, `precacheOriginalsDays?` default 7. Progress via the `open()`
`onProgress` and `status()` (`thumbnailsCached/Total`, `originalsCached`,
`originalsPinned`, ...).
- "Latest week" = the 7 days ending at the newest `takenAt` in the account (not
the last 7 calendar days), per the design's reading.
## Definition of done
- Both precaches start from `open()`, run through their pools, are preemptible by
on-demand work, and update `status()`; pinned set integrates with eviction.
- Tested against a fake library/pool; `make check` green.
## Grounding
`src/library/`. Depends on content/thumbnail store + eviction (pinned set).
Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends ` (closes #<this issue>)`. End every message with
`Model: opus-4-8`.
Model: opus-4-8
Two background fills start inside Library.open() with no caller input, both through the shared pools at background priority so on-demand work preempts: every thumbnail newest-first until all are on disk (sharing the pool with thumbnails.ensure), and the pinned originals — favorites album, then the precacheOriginalsDays (default 7) window ending at the newest file — through the content pool. The pinned set is the eviction predicate, so a pinned original is never evicted and a file that leaves the set becomes an ordinary, evictable original.
open() options precacheThumbnails/precacheOriginals (default true) and precacheOriginalsDays (default 7); progress via onProgress and status() (thumbnailsCached/Total, originalsCached/Pinned).
Model: opus-4-8
Implemented in https://git.eeqj.de/sneak/quak/pulls/73.
Two background fills start inside `Library.open()` with no caller input, both through the shared pools at background priority so on-demand work preempts: every thumbnail newest-first until all are on disk (sharing the pool with `thumbnails.ensure`), and the pinned originals — favorites album, then the `precacheOriginalsDays` (default 7) window ending at the newest file — through the content pool. The pinned set is the eviction predicate, so a pinned original is never evicted and a file that leaves the set becomes an ordinary, evictable original.
`open()` options `precacheThumbnails`/`precacheOriginals` (default true) and `precacheOriginalsDays` (default 7); progress via `onProgress` and `status()` (`thumbnailsCached`/`Total`, `originalsCached`/`Pinned`).
Model: opus-4-8
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Cache/API implementation (#36), phase 3.
Depends on the content/thumbnail-store and eviction units.
Goal
Aggressive local precache (owner ruling 5): fill thumbnails for the whole
account and originals for favorites + the latest week, started inside
open(),needing nothing from the caller.
Scope
pool, until 100% on disk; never evicted. The queue is shared with
thumbnails.ensuresovisible/aheadalways go ahead of the backgroundfill. A file already cached costs one
Setlookup from the open-time listing.the favorites album (
Collection.type === "favorites"), then every file whosetakenAtis within theprecacheOriginalsDays(default 7) ending at thenewest
takenAtin the account. When a refresh adds a favorite or a newerfile it joins the queue; when the window moves or a favorite is removed the
file leaves the pinned set and becomes an ordinary cached original (eligible
for eviction).
open()options:precacheThumbnails?default true,precacheOriginals?default true,
precacheOriginalsDays?default 7. Progress via theopen()onProgressandstatus()(thumbnailsCached/Total,originalsCached,originalsPinned, ...).takenAtin the account (notthe last 7 calendar days), per the design's reading.
Definition of done
open(), run through their pools, are preemptible byon-demand work, and update
status(); pinned set integrates with eviction.make checkgreen.Grounding
src/library/. Depends on content/thumbnail store + eviction (pinned set).Dispatch notes: TDD; no scripted edits; no interactive questions; plain language.
Squash subject ends
(closes #<this issue>). End every message withModel: opus-4-8.Model: opus-4-8
Implemented in #73.
Two background fills start inside
Library.open()with no caller input, both through the shared pools at background priority so on-demand work preempts: every thumbnail newest-first until all are on disk (sharing the pool withthumbnails.ensure), and the pinned originals — favorites album, then theprecacheOriginalsDays(default 7) window ending at the newest file — through the content pool. The pinned set is the eviction predicate, so a pinned original is never evicted and a file that leaves the set becomes an ordinary, evictable original.open()optionsprecacheThumbnails/precacheOriginals(default true) andprecacheOriginalsDays(default 7); progress viaonProgressandstatus()(thumbnailsCached/Total,originalsCached/Pinned).Model: opus-4-8