Fills in `image_cache`, which the previous commit's "On this device" filter read but nothing wrote. Also carries in-flight work that shared these files: the Android TLS root store, the settings page, and a regenerated traceability report. # Two populations, deliberately separate An original is kept here for one of two reasons, and conflating them produces the exact failure the feature exists to prevent. **Pinned** originals were asked for. Pinning a collection before a trip is a promise, so pinned rows are never evicted and never counted against the budget — a cap that could silently delete a pinned trip would make pinning worthless, because it could not be relied on without checking. **Passively cached** originals are a side effect of working: develop already downloads the whole file, so keeping it costs no bandwidth and saves the entire transfer next time. This population is what the budget bounds, evicted least-recently-used, because it otherwise grows until a day of culling fills a disk. Sharing one budget would let a large pin starve the passive cache, or let browsing evict a pin. They are separate. # What was built `dr_catalog::cache` owns the bookkeeping — held tier, size, last use, pinned — and writes the bytes; deciding to download stays with the caller, which is what keeps a crate with no network out of the network's business. Files are written to a temporary and renamed, so a dropped connection cannot leave a truncated file recorded as a complete original. They are named by image id, not filename: `Photos/IMG_0001.CR2` and `Trips/IMG_0001.CR2` are different photographs, and a flat cache keyed on the name would serve one for the other. `spawn_full_fetch` became read-through. A hit is a disk read; a miss stores what it downloads and enforces the budget. A cache that cannot be opened is a miss, not a failure to open the photograph. Pinning writes intent — `tier_desired` — without downloading, so the button responds immediately, and `spawn_pin_fetch` fills it in sequentially afterwards. Sequential because these are tens of megabytes each: the lanes that make the thumbnail sweep fast buy little against one connection's bandwidth and cost a great deal of memory. A pin interrupted by a lost connection resumes from where it stopped. Schema v5 adds `pinned` and `path`. `pinned` is a column rather than something inferred from `pinned_by_rule`, which is ON DELETE SET NULL and so cannot answer for an image whose rule was deleted. A v4 catalog migrates in place; existing rows default to unpinned, the safe direction. The budget and "keep opened originals" come from the settings page rather than a constant, and are applied at startup rather than only on change — a cache capped at 2 GB last session would otherwise spend this one filling to the default. Turning off keeping leaves what is already cached readable: those bytes are paid for, and refusing them would re-download images sitting right there, including pinned ones. Also removes a doubled `#[test]` introduced in the previous commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 KiB
17 KiB
Requirements traceability matrix
Denominators are parsed from requirements.md at run time, never hardcoded. Coverage is the intersection of tagged and defined IDs over defined IDs, so it cannot exceed 100%.
Summary
| Metric | Value |
|---|---|
| Source files scanned | 92 |
| TRACES tags found | 130 |
| Requirements defined | 149 |
| Requirements covered | 69 |
| Coverage | 46.3% (69/149) |
By type
| Type | Covered | Defined |
|---|---|---|
| FR | 53 | 95 |
| NFR | 14 | 48 |
| R | 2 | 6 |
Orphan tags
A tag naming an ID requirements.md does not define — what renumbering produces, and what a typo produces.
FR-CAT-15
Tagged requirements
Not yet tagged
80 of 149 requirements have no implementation tag. Expected while the codebase is young; each should gain one as it is built.
Show untagged requirements
- FR-CAT-10
- FR-CAT-13
- FR-CAT-14
- FR-CULL-10
- FR-CULL-11
- FR-CULL-12
- FR-CULL-3
- FR-CULL-5
- FR-CULL-6
- FR-CULL-7
- FR-CULL-8
- FR-CULL-9
- FR-DEV-1
- FR-DEV-2
- FR-DEV-3f
- FR-DEV-3g
- FR-DEV-5
- FR-DEV-6
- FR-DEV-7
- FR-DEV-8
- FR-DSP-2
- FR-DSP-3
- FR-DSP-4
- FR-DSP-5
- FR-DSP-6
- FR-DSP-7
- FR-DSP-8
- FR-EXP-7
- FR-NC-10
- FR-NC-11
- FR-NC-6
- FR-NC-6b
- FR-PLAT-AND-2
- FR-PLAT-AND-4
- FR-PLAT-AND-5
- FR-PLAT-AND-6
- FR-PLAT-LIN-2
- FR-PLAT-LIN-3
- FR-RAW-2
- FR-UI-4
- FR-UI-6
- FR-UI-7
- NFR-A11Y-1
- NFR-A11Y-2
- NFR-A11Y-3
- NFR-ARCH-1
- NFR-ARCH-3
- NFR-COMPAT-1
- NFR-COMPAT-2
- NFR-OPS-2
- NFR-OPS-3
- NFR-OPS-4
- NFR-P10
- NFR-P11
- NFR-P12
- NFR-P14
- NFR-P15
- NFR-P2
- NFR-P3
- NFR-P4
- NFR-P5
- NFR-P6
- NFR-P7
- NFR-P8
- NFR-PORT-1
- NFR-PORT-2
- NFR-PORT-3
- NFR-R3
- NFR-R4
- NFR-R6
- NFR-RES-2
- NFR-RES-3
- NFR-SEC-2
- NFR-SEC-3
- NFR-SEC-4
- NFR-SEC-5
- R2
- R3
- R5
- R6