Skip to content

fix(check): isolate the ref cache in box-reconcile-remote-cached so its second run is cache-served by construction - #846

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/box-reconcile-cached-isolated-cache
Oct 8, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
fix/box-reconcile-cached-isolated-cache

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Agent: retention · session task-12 — the in-tree fix for plugin-clean#13's block 2 (a red bed step root-fixed, not re-run away)

Summary

The check-commands-local bed's box-reconcile-remote-cached step asserts that the SECOND
charly box reconcile --remote --dry-run is served from the persisted ref cache. That cache lives under
os.UserCacheDir() and is process-shared: any other charly process on the host — another session's
bed, 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#830
retired 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 the
second 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.

$ 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     # served from it
  → "fetching git metadata" occurrences in run 2: 0
  → drift report present: 1                                        # the `would rewrite N pin(s):` shape

The step's own check: description now records the mechanism, so the next reader knows why the cache is
isolated instead of rediscovering it.

Why it matters beyond this step: the bed is the gate for charly clean's change class, and this step
was 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 not
recoverable 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 of origin/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 and summary.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 --oneline
origin/main..HEAD on this branch lists **two** commits: the fix (e597377`) and the merge.

$ cd .worktrees/retention/charly-831 && git rev-parse HEAD && ./bin/charly version
f7453b4945163cac7af680d902dbf7dab143b7ce
2026.281.1117
$ ./bin/charly check run check-commands-local
[deploy-add] PASS after 4m32.99s [allowlisted=1]
[bring-up-members] PASS after 0s
[check-live] PASS after 2m38.8s [allowlisted=1]
[update] PASS after 1m8.512s [allowlisted=1]
[cleanup] PASS after 10.247s [allowlisted=1]
[cleanup-members] PASS after 0s
PASS (steps=6)
$ python3 -c "import yaml;d=yaml.safe_load(open('.worktrees/retention/charly-831/.check/check-commands-local/2026.281.1202/summary.yml'));print(d['ok'], [s['name'] for s in d['steps']])"
True ['deploy-add', 'bring-up-members', 'check-live', 'update', 'cleanup', 'cleanup-members']

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:

$ ls -la .check/check-commands-local/<calver>/     # a red run of this bed, for reference
    10560 check-live.log
     5636 deploy-add.log
        0 evidence                               # EMPTY
     5955 runner.stderr.log
     2307 summary.yml

Rulebook compliance

  • R0 — skills first. check (bed authoring, summary.yml, disposable beds), cache (the operator
    surface over the ref cache this step depends on), strict-policy, and this repo's AGENTS.md.
  • R1 — RCA every anomaly, and finish it. The mechanism is named (a gate asserting a process-shared
    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.
  • R2 — finish the cutover. Both invocations are isolated in the same commit, and the step's
    description is updated with them; no sibling step in this bed asserts shared-cache state (the other
    network-touching steps are separate beds' concern).
  • R3 — no duplication. One mechanism, stated once in the script and once in the description.
  • R4 — no workarounds. No retry, no sleep, no suppression: the step's precondition is made
    deterministic instead of being retried until it holds. mktemp -d + trap … EXIT leaves no litter.
  • R5 — hard cutover. The old script's shared-cache invocations are gone, not shadowed:
    git diff shows exactly the two call sites plus the comment block.
  • R6 — user work and Git safety. git status clean before the edit and before the run. The branch is
    fix/box-reconcile-cached-isolated-cache and it holds two commits, stated as they are: the fix
    (e5973771) and the merge of origin/main produced 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.
  • R7 — prove behavior, not compilation. The proof is the isolated-cache measurement above plus the
    full bed run in the gate block: the changed path executed live, with its exit status retained.
  • R8 — preserve emitted artifacts. charly box validate on this tree: 0 warnings, 0 errors (609
    candies, 125 boxes, 45 deploys, 7 distros, 7 builders).
  • R9 — binary equals source. The run uses this worktree's own stamped build.
  • R10 — fresh disposable proof. The change is to a bed step, so its gate is the bed itself, run on
    the committed tree against the disposable: true local target it already declares.

Change classification

Configuration + test tooling: charly.yml's box-reconcile-remote-cached step (its command: block and
its 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)

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)
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: e59737713c66759483e9f197c5ca7075923de053 (branch: fix/box-reconcile-cached-isolated-cache)

Change class: config/test tooling (charly.yml bed step) — not docs-only, gate is the bed itself.

Security screen: PASS — no secrets/egress, no guardrail weakening, no supply-chain change; the step is made more deterministic (isolated XDG_CACHE_HOME), not loosened.

Checklist: All applicable rules PASS or NA. Body accounts for both diffed pieces (script + check: description), pasted bed evidence is internally consistent (check-commands-local header matches the diff, 6 steps reconcile with the summary.yml readout, worktree HEAD matches head SHA), the concurrency-class root cause is fixed by construction rather than re-run away, R2/R3/R4/R5/R6/R8/R9/R10 answered with HOW, and the body ends with the required *Assisted-by: …* line. Comment thread is empty (nothing to disposition).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 8, 2026 11:08
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: f7453b4945163cac7af680d902dbf7dab143b7ce (branch: fix/box-reconcile-cached-isolated-cache)

Change class: config/test tooling — a charly.yml bed step (check-commands-local → box-reconcile-remote-cached); not docs-only. Security screen: no finding (no secrets/egress, no guardrail weakening; the step is made more deterministic, not loosened).

Blocks

  1. R10 / A1 — the pasted gate proof is for a superseded commit, not the current head. The body's How tested fence pins the tree it ran on:

    $ cd .worktrees/retention/charly-831 && git rev-parse HEAD && ./bin/charly version
    e59737713c66759483e9f197c5ca7075923de053
    

    but the current head is f7453b4945163cac7af680d902dbf7dab143b7ce — the Merge branch 'main' into fix/box-reconcile-cached-isolated-cache commit. The tested tree (e59737713c66) is therefore not the head tree (fix + main's newly merged commits), and a merge commit exists only because main moved. The check-commands-local run (and its summary.yml readout) proves the pre-merge tree only, so it does not prove the tree that would land. The body even states the fence "names the … commit it ran on … because a count is only comparable to another count from the same tree" — by its own standard the evidence is from the wrong tree. Fix: re-run check-commands-local on the current head and paste the output + summary.yml readout, or supply evidence that the merge is inert for the tested path (that main's merged commits touch neither charly.yml's check-commands-local nor the ref-cache / charly box reconcile path). I cannot verify the merge's effect from the supplied context (main's diff is absent), so this cannot pass on the author's word alone.

  2. R6 / B15 — the body's "one commit" claim no longer matches the branch. The rulebook section states "one commit on fix/box-reconcile-cached-isolated-cache off fresh origin/main", but the branch now carries two non-changelog commits (e59737713c66 fix + f7453b494516 merge). Not a split/partial-work pattern, but the claim is inaccurate and is tied to the freshness gap above — reconcile it when re-running.

Comments considered

  • Comment 6058502125 (@github-actions[bot], PASS at head e59737713c66…) — stale-superseded. Its central claim that the "worktree HEAD matches head SHA" was true only for the pre-merge head; the current head is the merge f7453b494516…, which the body's evidence does not cover. Its PASS carries no authority and does not survive re-derivation against the current state. Its security/checklist lines are otherwise consistent with the current diff, but the verdict rests on the now-stale head.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: f7453b4945163cac7af680d902dbf7dab143b7ce (branch: fix/box-reconcile-cached-isolated-cache)

Security screen: PASS — no secrets/egress, no guardrail weakening, no supply-chain change; the step is made more deterministic (isolated XDG_CACHE_HOME), not loosened.
Checklist: All applicable rules PASS or NA. Body accounts for both diffed pieces (script + check: description); the How tested fence pins the CURRENT head f7453b494516… and its summary.yml readout (6 steps) reconciles with the pasted bed output; the changed bed path executed live, justifying fully tested and validated; R2/R3/R4/R5/R6/R8/R9/R10 answered with HOW; body ends with the required *Assisted-by: …* line.

Comments considered:

  • 6058502125 (@github-actions[bot], PASS) — stale-superseded: its "worktree HEAD matches head SHA" held only for the pre-merge head e5973771; the current head is the merge f7453b49, which the current body's fence names. Its PASS carries no authority.
  • 6058742639 (@github-actions[bot], BLOCK) — stale-superseded: both blocks are answered by the current body. Its block 1 (fence pins e5973771) is contradicted — the current How tested fence re-taken on the merge head shows git rev-parse HEAD → f7453b494516… plus a fresh bed run and summary.yml readout. Its block 2 (body claims "one commit") is contradicted — the R6 section now states the branch holds two commits (fix e5973771 + the origin/main merge f7453b49), matching the commit list. No surviving finding.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot merged commit ef84167 into main Oct 8, 2026
2 of 3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 8, 2026
aitrawog added a commit that referenced this pull request Oct 8, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant