fix: cache the parse cache kapi 1.2 writes, not retired paths - #8
Merged
Merged
Conversation
Adds a fixture project and two jobs: the first runs it and lets the action save its cache, the second restores the cache and requires a warm run to match a cold run of a pristine copy in every exit code, output and written file. A negative control restores .kapi/work/store.db and requires the comparison to report a difference. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
The state cache cached .kapi/tm.db and .kapi/cache, which kapi 1.2 never writes, so it saved nothing. It now caches .kapi/work/cache/docs, the one path under .kapi/work that kapi keys by content, configuration, recipe and build. The store and the rest of .kapi/work stay out: restoring them changes what kapi status, kapi check --ship and kapi up report. The key carries the resolved kapi version, and the input keeps its name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
Temporary. Restoring the store has to fail the round trip; this commit is reverted once the run shows it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
…iling" The run on that commit showed the round trip failing with the store restored; the action caches .kapi/work/cache/docs again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
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.
The state cache (
cache-tm, on by default) cached.kapi/tm.dband.kapi/cache. kapi 1.2 writes neither, so it saved nothing.What kapi 1.2 writes
From running
v1.2.0-rc32on a fixture and readingcore/project/layout.goandcore/projectdbat that tag:kapi.yaml, and everything under.kapi/exceptwork/andfilters.local.json. That includes the content memory bundles and the unit-state recordkapi upwrites..kapi/work/cache/docs: the parse cache. Each entry is keyed by absolute path, content hash, parse configuration, recipe and kapi build..kapi/work/:store.db, which holds stored targets and the unit working setcache/extractions,cache/redactionandvault/Change
.kapi/work/cache/docs.kapi-parse-<os>-<kapi version>-<ref>-<job>-<run id>-<attempt>.cache-tmkeeps its name. Its description, the step comments and the README say what is cached and why the rest is not.latestinstalls a release withoutkapi up.Tests
Two new jobs,
State cache saveandState cache restore, run on ubuntu and macOS.kapi status,kapi check,kapi check --shipandkapi upontest/fixture.store.dband requires a difference.Evidence
Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.The restore jobs find no cache and fail.Cache restored from key: kapi-parse-Linux-1.2.0-rc32-8/merge-test-state-cache-save-34937356412-1, restore 5 files, and reportIdenticalfor all three comparisons..kapi/work(6400119, reverted in 6e43d7b): run 34937481197 fails. With the store restored:kapi statusreports fr at 100% beforekapi upkapi check --shipchanges exit codekapi upruns 0 passes and writes no targets🤖 Generated with Claude Code
https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4