feat(cache): schema v11 — analytics columns on runs table (dashboard PR 1/10)#19
Merged
Conversation
First PR of the 10-PR dashboard sequence (docs/design/dashboard.md).
Lays the foundation: the data the dashboard will visualize gets a
column to land in. Producer PRs (runner CPU/RSS capture, orchestrator
run_id + hrtime spans, layered-cache bytes-up/down) follow.
Schema additions on `runs`
- run_id TEXT — ULID shared by all tasks in one vzn run
- cpu_ms INTEGER — user+system CPU time for the child
- peak_rss_bytes INTEGER — max RSS observed for the child
- wallclock_start_ns INTEGER — hrtime span start, ns from run t=0
- wallclock_end_ns INTEGER — hrtime span end
- cache_hit INTEGER — 0/1 derivable from status, kept for
fast flamegraph color queries
- bytes_uploaded INTEGER — bytes pushed to remote cache (NULL
when no remote layer)
- bytes_downloaded INTEGER — bytes pulled from remote on hit
- new index runs_run_id ON runs(run_id)
All columns are nullable. RunRecord interface gains the optional
fields. recordRun() takes them; older callers (which omit them) get
NULLs in the row — fully backwards-compatible at the API surface.
Cache identity
- CACHE_VERSION → vzn-cache-v11
- SCHEMA_VERSION → v11
- On version mismatch the existing pre-alpha policy applies: nuke
the entries + runs tables, store the new version. Old on-disk
outputs become orphans (already handled).
Tests: 234 / 232 (+2)
- recordRun persists all v11 columns when provided.
- recordRun stores NULL for omitted columns.
Docs
- docs/caching.md cache-version history extended with the v11 entry.
- CLAUDE.md decision log entry.
This was referenced May 11, 2026
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.
Summary
Dashboard sequence PR 1 of 10. Lays the foundation for the analytics dashboard (
docs/design/dashboard.md): the data the UI will visualize gets a column to land in. Producer PRs (CPU/RSS capture inrunner.ts/sandbox.ts,run_id+ hrtime spans inorchestrator.ts, bytes-up/down inlayered-cache.ts) come next; all of them feed this table.Schema additions on
runs(We don't actually ALTER — we bump
SCHEMA_VERSIONand recreate. Pre-alpha policy from PR #7. Existing on-disk outputs become orphans; they get cleaned up by the nextvzn cache pruneor rebuilt naturally on a cache miss.)All columns are nullable.
RunRecordgains the same fields as optionals.recordRun()accepts them; callers that omit them get NULLs.Cache identity
CACHE_VERSION→vzn-cache-v11SCHEMA_VERSION→v11entries+runsand store the new version. Pre-alpha.Test plan
bun run format:check— cleanbun run lint— cleanbun test src/— 234 / 232 (+2)New tests
recordRun()persists all v11 columns when provided (verified via direct SQLite read).recordRun()stores NULL for omitted columns.Docs
docs/caching.mdcache-version history extended with the v11 entry.CLAUDE.mddecision log.Dashboard sequence (10 PRs total)
runner.ts/sandbox.tsCPU + RSS captureorchestrator.tsULIDrun_id+ hrtime spansvzn dashboardlocal Bun.serve() +/api/*cf-dashboard/template (Worker + D1)POST /api/ingest/runs)https://claude.ai/code/session_016HXj6HW6bxSn8EYuKcxTD9
Generated by Claude Code