Repository navigation
feat(cache): say how warm the cache is before a run starts - #359
Merged
Merged
Conversation
Opening the cache now returns an `Opened` summary: where the database came from (existing, new, rebuilt after corruption, or in memory), each kind of entry the prune dropped because this build keys it differently and how many, what eviction dropped, what is left, and how long since the cache was last opened (a one-row `opened` table, migration 017). The CLI prints it as one stderr line before a lookup, run, apply or tui batch, and the server logs it at start, so a cold run is expected before it is slow.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 2ea47bf | Commit Preview URL Branch Preview URL |
Nov 22 2026, 07:42 PM |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every run now starts by saying whether its cache is cold or warm, how cold, and why, so a slow cold run is expected before it starts.
What changed
Cache::opened()returns anOpenedsummary from opening the cache:Existing,Created,Rebuiltafter corruption,Memory);DELETE … RETURNING;openedtable for that last-open time. The HTTP timestamps can't be used: they sit after each body, so reading them would page every body in. Every count reads an index or the trigger-kepthttp_bytesrow.lookup,run,applyandtuiprint the summary as one stderr line after the cache opens. It is shown at the default verbosity, because the default log level is WARN and an info event would never appear in Actions. The spinner now starts after the cache opens, so the line isn't drawn over.coldfield.internals/cache.md.No rows in
tests/*-versions.tsvare touched, so this is independent of #351–#358.Tests
the_opening_summary_says_how_warm_and_why: the wording for warm, partly cold, cold after everything was superseded, and each cold origin.opening_reports_how_warm_the_cache_is: a first open isCreatedand cold; a reopen isExistingand warm, with one response and an idle time; a reopen with a zero budget counts one eviction and is cold.opening_prunes_superseded_keysnow also checks the superseded counts per name.Origin::Rebuilt.Follow-ups
::notice::annotation so it shows on the run summary.tools/) isn't covered: a run with a warm database but no installed tools is still slow for lockfile updates.