feat: cache the project TM across CI runs (out of git)#5
Merged
Conversation
The translation memory is derived state, not committed source (neokapi AD-009): it accumulates leverage but should never land in git. Add a job-cache step that restores the latest branch TM at setup and — via a run-unique key — saves the grown TM back at job end through actions/cache's own post step. No commits, no locking (per-branch, last-write-wins); a cold cache rebuilds from the committed translations, so losing it is a perf hit, not data loss. Covers .kapi/tm.db and the .kapi/cache/ derived stores. Gated on a *.kapi recipe being present (the .kapi/ state dir is gitignored, so the committed recipe is the signal). New inputs: cache-tm (default true), project-dir (default "."). Implements neokapi#1367.
4 tasks
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 translation memory is derived state, not committed source (neokapi AD-009): it accumulates leverage across runs but should never be committed to git. This wires that model into CI.
What
A job-cache step (
actions/cache@v5, the same pattern already used for the binary and plugin caches) that:restore-keysfallback: branch → any), andgithub.run_id, so it's always a miss on the exact key andactions/cache's own post step persists the updated state.Covers
.kapi/tm.dband the.kapi/cache/derived stores. Gated on a*.kapirecipe being present (the.kapi/state dir is gitignored, so the committed recipe is the signal).Why this shape
kapi-action). This avoids the pull/merge inconsistency and CI-writes-to-repo fragility of committing stores.Inputs
cache-tm(defaulttrue) — enable;falseto disable.project-dir(default.) — where the.kapiproject lives.Implements neokapi#1367. Backward-compatible (new inputs default sensibly; no-op when no recipe is present).