Repository navigation
fix(check): isolate the ref cache in box-reconcile-remote-cached so its second run is cache-served by construction - #846
Conversation
The step asserted the behaviour of the PROCESS-SHARED ref cache under os.UserCacheDir(), while other charly processes on this host (another session's bed, an operator's build) can perturb it between its two invocations. A gate keyed on shared mutable state is the false-red class charly#650 names, and charly#830 only half-retired it: it removed the drift-ABSENCE assertion and left the cache-hit one. Running both invocations under a single isolated XDG_CACHE_HOME makes the second run cache-served BY CONSTRUCTION rather than by luck, which is what the step has always meant to assert. Measured in this worktree: $ D=$(mktemp -d) $ XDG_CACHE_HOME=$D charly box reconcile --remote --dry-run # cold: populates the isolated cache $ XDG_CACHE_HOME=$D charly box reconcile --remote --dry-run # 0 "fetching git metadata", drift report present Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — PASSHead SHA: Change class: config/test tooling ( Security screen: PASS — no secrets/egress, no guardrail weakening, no supply-chain change; the step is made more deterministic (isolated Checklist: All applicable rules PASS or NA. Body accounts for both diffed pieces (script + Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: config/test tooling — a Blocks
Comments considered
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, no supply-chain change; the step is made more deterministic (isolated Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…one change The validator diffs against the merge-base, not against origin/main: my earlier revert used origin/main, which already carried #846's check-local-vm gate change, so that unrelated edit appeared in this PR's diff. This commit restores the merge-base's version, so charly.yml is now unchanged against the base and the branch carries only the plugin-candy module advance and its checksums. Agent: charly (fan-out prerequisite) Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
Agent:
retention· sessiontask-12— the in-tree fix forplugin-clean#13's block 2 (a red bed step root-fixed, not re-run away)Summary
The
check-commands-localbed'sbox-reconcile-remote-cachedstep asserts that the SECONDcharly box reconcile --remote --dry-runis served from the persisted ref cache. That cache lives underos.UserCacheDir()and is process-shared: any other charly process on the host — another session'sbed, an operator's build — can perturb it between the step's two invocations. A gate keyed on shared
mutable state is a false-red generator, which is
opencharly/charly#650's class;opencharly/charly#830retired half of it (the drift-ABSENCE assertion) and this retires the other half.
The fix is one variable: both invocations now run under a single isolated
XDG_CACHE_HOME, so thesecond run is cache-served by construction rather than by luck. That is exactly what the step has
always meant to assert, and it removes the only input in the step that another process can move.
The step's own
check:description now records the mechanism, so the next reader knows why the cache isisolated instead of rediscovering it.
Why it matters beyond this step: the bed is the gate for
charly clean's change class, and this stepwas observed red on a tree where every other step passed — a false red that has already cost a producer PR
(
opencharly/plugin-clean#13) a verdict round, because the only available answer was "the conjunct is notrecoverable from the artifacts". It is now recoverable by construction.
How tested
**The bed is the class's gate, and it was re-run on the CURRENT head — which is a MERGE commit, said plainly rather than glossed.** After the branch was updated (a merge oforigin/main), every tree-pinned fence in this body was invalid, so the run was re-taken rather than re-labelled: the fence below carries ITS OWN attribution — worktree, head, binary, steps andsummary.yml— and the head it names is the head this PR publishes, so the tested tree and the tree that would land are the same object.git log --onelineorigin/main..HEAD
on this branch lists **two** commits: the fix (e597377`) and the merge.Also, the failure mode this fixes was reproduced as a mechanism rather than guessed: the step's own
artifacts show why it cannot be diagnosed after the fact — the runner keeps the step's stderr and exit
status, writes its diagnosis to stdout, and stdout is not captured anywhere in the run directory:
Rulebook compliance
check(bed authoring,summary.yml,disposablebeds),cache(the operatorsurface over the ref cache this step depends on),
strict-policy, and this repo'sAGENTS.md.cache's state) and the missed control is named (the step never isolated the cache it was asserting
about). The blast radius is a false red on a producer PR's gate, already observed. The root fix is this
change rather than a re-run.
description is updated with them; no sibling step in this bed asserts shared-cache state (the other
network-touching steps are separate beds' concern).
deterministic instead of being retried until it holds.
mktemp -d+trap … EXITleaves no litter.git diffshows exactly the two call sites plus the comment block.git statusclean before the edit and before the run. The branch isfix/box-reconcile-cached-isolated-cacheand it holds two commits, stated as they are: the fix(
e5973771) and the merge oforigin/mainproduced by a branch update — so the head is a merge commit(
f7453b49), which is exactly why the bed was re-run on it. No rebase, no force-push, no--no-verify.full bed run in the gate block: the changed path executed live, with its exit status retained.
charly box validateon this tree: 0 warnings, 0 errors (609candies, 125 boxes, 45 deploys, 7 distros, 7 builders).
the committed tree against the
disposable: truelocal target it already declares.Change classification
Configuration + test tooling:
charly.yml'sbox-reconcile-remote-cachedstep (itscommand:block andits
check:description), 11 insertions / 3 deletions. Not docs-only. Tier: fully tested and validated.Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)