Repository navigation
Rename the cache-tm input to parse-cache - #9
Merged
Merged
Conversation
The input caches kapi's parse cache, which has nothing to do with content memory. cache-tm stays as a deprecated alias: when a workflow sets it, it decides and the action prints a warning naming parse-cache. One step resolves the value and both conditions read it. The input description and the README now describe kapi 1.3: the project's context lives in kapi's workspace and moves through a context backend with kapi context pull, which this action leaves to kapi-action's context-sync input or the workflow's own step. The test workflow covers parse-cache: false, cache-tm: false, and cache-tm deciding over parse-cache. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWc9qYQJ93y88XrN6TkMvT
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
A kapi that keeps each checkout's state outside the checkout prints that directory with `kapi state path`. The action keeps the cache in a fixed directory under runner.temp and links the state directory's work/cache/docs to it, so actions/cache saves it in its post step. A kapi without the command keeps the in-tree path. A pull_request_target run restores and never saves. Verified: test/parse-cache/locate.sh with the stub, against kapi 1.4.0-rc5 (tree) and a build of neokapi#3780 (state); two-run warm/cold comparison with the #3780 build; actionlint; shellcheck Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
The answer must be one line, an absolute path with no control characters, shaped <data root>/checkouts/<32 hex>, with no symbolic link among its components. Anything else carries no cache, prints a warning, and leaves the file system untouched. Verified: test/parse-cache/locate.sh (good, empty, two lines, relative, outside the data root, not a checkout, control character, through a link) and against kapi 1.4.0-rc5 and a neokapi#3780 build; shellcheck Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
…egistry#6 The action sets KAPI_PARSE_CACHE_DIR to a fixed directory under runner.temp (or keeps a caller's value under runner.temp or the workspace) and caches that directory and the in-tree .kapi/work/cache/docs. It no longer runs kapi state path, makes no link and takes no path from a command's output. Tests: the Windows jobs install no plugin and assert that bowrain has no Windows build (registry#6); the plugin seed is bowrain 1.4.0-rc5 from beta, since 1.0.2 is no longer listed. Verified: test/parse-cache/env.sh; kapi 1.2.0 installs bowrain@1.4.0-rc5 from beta; actionlint; shellcheck Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
kapi refuses a parse cache directory inside the checkout, a link, or one wider than 0700, and creates it at 0700 itself, so the action creates no directory and the README tells other CI systems to let kapi create it. Verified: test/parse-cache/env.sh; actionlint Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (removes a measurement job; results in run 45239899921) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
…3804 Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
…README Verified: cold and warm runs against the neokapi#3804 build through this action on Linux and macOS (run 45245109823); actionlint Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (README only; actions/cache@v5 runs its save step under post-if: success()) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
…en other output writes - A caller's KAPI_PARSE_CACHE_DIR with a control character, or naming runner.temp itself, is not cached; dir= is written only after the checks. - The version must look like a release version; parse-cache's output is true or false; the auth values go to GITHUB_ENV with a random delimiter. - workflow_run and issue_comment runs restore the parse cache and never save. - README: repository wording, scoped test claim, gh cache commands for the kapi-parse- prefix only, kapi up example without a pin, no em dash. Verified: test/parse-cache/env.sh (newline, CR, runner.temp itself and with / and /., nested, auth token with a line break); the resolve step on a version with a line break; actionlint; shellcheck Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
Verified: none (a measurement job, removed before merge) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
The restore prefix kapi-parse-<os>-1.4.0- matched caches saved by 1.4.0-rc5, as the run against neokapi main showed (1.2.0 restored a 1.2.0-rc32 cache). An underscore now ends the version, which the version check does not allow inside one. Verified: cold and warm runs against neokapi main 24b78f1 (with #3804) through this action on Linux and macOS, run 45248697071; test/parse-cache/env.sh; actionlint Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
…through a real run - 'False' and 'FALSE' turn the cache off for parse-cache and cache-tm, as v1's expression comparison did. - Each line of auth-token is masked before it is written to GITHUB_ENV. - A job passes a two-line dummy token through the action on Linux, macOS and Windows and reads both variables back. Verified: test/parse-cache/env.sh (False/FALSE/false for both inputs, the mask commands); actionlint; shellcheck Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr
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.
This changes checks and narrows what the Windows jobs test. The founder decided that Windows has no listed Bowrain plugin until the next kapi release: registry#6 removed every kapi-bowrain version except 1.3.0 and 1.4.0-rc5, and neither has a Windows build. So
setup-kapi@v1with the defaultpluginsfails on Windows until then. The Latest, Pinned and Cache hit jobs therefore run withplugins: ""on Windows, and each has a step (test/plugins/windows-unlisted.sh) that asserts the default install still fails with "no version of plugin "bowrain" … for platform windows/". That step fails when a Windows build is listed again, which is the reminder to restore the default in those jobs. The plugin-cache seed changes from bowrain 1.0.2, which is no longer listed, to 1.4.0-rc5 from the beta channel. That is a bowrain the newest stable kapi does not pick on a fresh install, so the upgrade test asserts the same thing as before. kapi 1.2.0, the seed kapi, installs it (checked locally).Renames the
cache-tminput toparse-cacheand carries kapi's parse cache for both generations of kapi.What it does now
parse-cache(defaulttrue) keeps kapi's parse cache between runs for a project with akapi.yaml.KAPI_PARSE_CACHE_DIR=<runner.temp>/kapi-parse-cachetoGITHUB_ENVand givesactions/cachetwo fixed paths: that directory and<project-dir>/.kapi/work/cache/docs.kapi state path, makes no link, and takes no path from a command's output.KAPI_PARSE_CACHE_DIR, the action keeps it and caches it when it lies underrunner.tempwith no..component. Otherwise it warns and carries no cache.pull_request_target,workflow_runorissue_commentrun restores and never saves.GITHUB_OUTPUTandGITHUB_ENV.KAPI_PARSE_CACHE_DIRis refused when it has a control character (a line break included) or namesrunner.tempitself (also as/or/.), anddir=is written only after the checks.versionmust look like a release version.parse-cacheoutput is onlytrueorfalse.GITHUB_ENVwith a random delimiter.kapi-parse-<os>-<version>_<ref>-…). Before, the restore prefix for1.2.0matched a1.2.0-rc32cache, as the run against neokapi main showed.Compatibility for
v1callerscache-tmstill works: when it is set, it is used in place ofparse-cache, with a deprecation warning. For kapi 1.3 and earlier the in-tree path is still cached, under the same key.Verified
test/parse-cache/env.sh(in CI) runs the step out ofaction.yml. It covers the variable unset (exported, output), a caller value underrunner.tempor the workspace (kept, not overwritten), and values outside both, relative, with.., or sharing a prefix (warned, skipped). It asserts that both cache steps carry both paths.test-parse-cache-in-treeruns the real kapi 1.3.0 and 1.4.0-rc5. The variable is exported, kapi writes the in-tree cache, and the fixed directory stays absent. The existing save/restore warm-vs-cold jobs on 1.2.0-rc32 cover the round trip.actionlint and shellcheck.
Cache cleanup: I deleted the
kapi-parse-*caches onrefs/pull/9/mergewhose keys containe2e-. I also deleted the 1.4.0-rc5test-parse-cache-in-treecaches from runs 45242099518 and 45243184972. The temporary #3804 jobs had saved, or caused to be saved, a parse cache under the 1.4.0-rc5 key, and other jobs then restored it. No cache on any other ref was touched.Against a kapi that reads
KAPI_PARSE_CACHE_DIR: neokapi main at 24b78f1, with #3804 merged, built in CI. Cold and warm runs went through this action on Linux and macOS in run 45248697071. Each job had its own runner, so the checkout folder and the data root were new each time. The jobs were removed again; the earlier run 45245109823 used #3804 at bd3ab4986.🤖 Generated with Claude Code
https://claude.ai/code/session_01GtGobCdyR3d9yLXAfX9jsr