Skip to content

feat(clean): implement D-STORE-7 (--store) and route cache sweeps by store identity - #29

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/clean-store-eviction
Nov 18, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/clean-store-eviction

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

charly clean now implements D-STORE-7 (DESIGN.md:2488) — "keeps what state references and
evicts the rest within a size budget; locks die with their holder"
— for the charly image store,
and the --cache sweep no longer destroys that store's content (opencharly/plugin-clean#27).
The two are one story seen from both ends: charly clean reclaims what is unreferenced and never
destroys what is live.
A sweep that deletes a live image's bytes and a budget that evicts a
referenced entry are the same defect class.

The row was implemented nowhere: keep_images/keep_check_runs count TAG ROWS in the
engine's storage, and no size budget existed in any schema or code. The image store — the
registry named store under the cache root, one immutable entry per build that a rebuild APPENDS
to rather than replaces — therefore grew by one artifact per rebuild forever. #21's re-scope
records the operator's measurement on this host (619 GiB, 1609 entries, 66 image families, nothing
ever removing one); the pre-rename store beside it, which I read while designing this, carried the
same 66 families across 172 entries.

1. --store — the entry policy

Keep-set surface What it is Why it is in the inventory
the container engine (podman ps -a) every container, running or stopped: its image ref and its image ID the runtime truth a deploy actually runs — what charly status --json publishes as image_ref
the quadlet units (deploykit.QuadletDir(), charly-*.container, Image=) the unit charly wrote for each pod deploy the only record of an ENABLED deploy whose container does not exist yet (a status --all row carries no image_ref)

Every state reference is resolved to an entry through ImageStore.Lookup — the store's own "the
newest entry whose annotation names this reference" — because state names a REFERENCE while the
store keys on the artifact's DIGEST. That resolution is also what makes a superseded rebuild of a
referenced tag
reclaimable (five entries under vision-gate: the name resolves to the newest, the
older four are evicted with the reason superseded: …). An entry whose own content address a
container names is kept outright. An entry with no io.containerd.image.name annotation is kept as
unclassifiable — the only verdict that cannot be wrong.

A state reference that names a bare REPOSITORY — a quadlet's Image=vision-gate, or a digest-only
reference normImageRef folds to one — keeps every tag of that repository, and that match is
checked BEFORE the exact-tag one: the state named the repository, not one build of it, and a build a
bare reference covers may not be evicted on a guess. The price is that a bare reference also protects
superseded rebuilds; that is the conservative direction, and it is the one that cannot delete a
deployment.

The refusal is the contract, not a fallback. An unreadable surface is not an empty one: "nothing
is referenced" is how a sweep deletes the image a running deployment was built from. A failed
podman ps, a quadlet that cannot be read, a charly quadlet with no Image= line, an index that
disagrees with its own entries, or a store that cannot be enumerated aborts the whole sweep with
an error naming the surface and the path, and evicts nothing. --dry-run refuses on exactly the same
inputs. A live build makes the sweep decline (SKIPPED, in place of its count), because an
artifact's blobs are published before its entry.

The budget is authored, and it never authorises evicting live state. schema/clean.cue
#CleanPlugin.store_budget.bytes (32 GiB) — CUE first, the Go derived from it, no constant. The
sweep reports the RETAINED bytes against it and says within budget or OVER budget by <bytes>;
being over budget is reported, never "fixed", because the entries left are the ones state
references. --store declares bare: false, so it never fires on a plain charly clean.

What a dry run can and cannot say. The DECISION is identical in both modes (same entries, same
reasons — pinned by mutation). The BYTE figure is not: a dry run measures the store as it is
(N held of <budget>) plus the blobs already unreferenced, while the retained size after eviction
needs the eviction — the store's public surface cannot size a hypothetical entry set without
deleting it, and a number that looked like the post-sweep size while being the pre-sweep one is the
kind of figure this report exists to avoid. The real run measures both exactly.

2. --cache — one reader per store, chosen by IDENTITY (#27)

gcCacheStores used to sweep in two halves and to skip the storekit half whenever the two store
roots resolved to the same directory. With D-STORE-1's one resolver (DESIGN.md:2482) that is
always: cache.StoreRoot() and storekit.CacheDir() both return storeroot.CacheDir(). So every
host handed the storekit-written registry store to spec/cache's image-blind GCStats, which
deleted a live image's manifest, config and layers and left the entry answering Lookup(ref) for
bytes that were gone. The mirror mistake was equally reachable: storekit.NamedStores() lists the
spec/cache layouts too, and storekit's reader would have decoded their manifests as empty entries
and freed their payloads.

The reader is now chosen from the store's own index (classifyStore): every descriptor an
application/vnd.opencharly.store.entry.v1+json entry manifest → storekit; every descriptor an OCI
image manifest → spec/cache; anything else (a mixed index, an unknown media type, an unreadable
index) → refused and reported by name, never swept. The two enumerations are deduped into ONE
inventory by resolved directory, so no store is skipped and none is swept twice, and sameStoreRoot
is deleted. Because the image store is never opened by spec/cache any more, no .lock is written
inside its tree either (DESIGN.md:2484). The one per-store reclaim (sweepStoreBlobs) is now
shared by --cache and --store rather than duplicated.

The --cache report now NAMES the reader that swept each store (cache registry (storekit): 3 live entry(ies); removed 0 unreferenced blob(s) (0 B)). That is a report-format change on purpose: after
#27, "swept by the wrong reader" and "swept by the right one" produced identical lines, so the
fact that matters most was invisible in the product. A consumer that parses cache <name>: must be
told.

The same report no longer says cache: no named cache stores found when a store WAS found and
refused — those two lines read as "there are none, and here is the one there is". --store's own
report is unaffected.

Files

Tag Path What it carries
M candy/plugin-clean/store_eviction.go new — the state inventory, the pure entry plan, the sweep, the budget verdict
M candy/plugin-clean/store_identity.go new — classifyStore, discoverStores, sweepStoreBlobs
M candy/plugin-clean/store_sweep_test.go new — 13 tests over both changes
M candy/plugin-clean/schema/clean.cue the store category row + the authored store_budget
M candy/plugin-clean/categories.go store in the plan + declaredStoreBudget, one shared schema compile
M candy/plugin-clean/command.go the --store report, the budget verdict, the cache refusal lines
M candy/plugin-clean/retention.go gcCacheStores routed by identity, the store category, sameStoreRoot deleted
M candy/plugin-clean/charly.yml the candy description + the store-category ADE step
M candy/plugin-clean/command_test.go --store cases in the derived-grammar table
M candy/plugin-clean/gc_cache_test.go gcCacheStores's new return
M candy/plugin-clean/gc_cache_storekit_test.go the storekit-store route (and a stale comment corrected)
M candy/plugin-clean/go.mod, go.sum sdk v0.2026322.1227 (the merged #556 tag), no replace, plus the go/indirect deltas accounted for below
M README.md, .agents/skills/clean/SKILL.md the product's own docs, swept to match

Why go.mod is not a two-line diff

Two deltas, both mechanical and both named here because an unexplained 30-line go.mod change in a
clean-events PR is a fair question:

  1. go 1.26.4 → go 1.26.8. Not a choice: github.com/opencharly/[email protected]'s own
    go.mod declares go 1.26.8, and Go refuses a dependency whose language version is newer than
    the main module's.
  2. The indirect expansion (containerd/v2, cuelabs.dev/go/oci/ociregistry, logrus,
    x/oauth2, x/sync, go-internal, errdefs, log). It comes from ONE import this change
    adds: deploykit — for deploykit.QuadletDir(), the only exported resolver for the quadlet
    directory, which is one of the two state surfaces. deploykit/vm_box_emit.go imports
    sdk/buildkitdrive, so the whole package's graph comes with it. In the COMPILED-IN placement
    (characters: command:clean) the marginal cost is zero — charly already links deploykit — and
    it lands only on cmd/serve, the out-of-process plugin binary. Resolving the path by hand would
    be a second copy of a rule whose os.UserHomeDir() (not os.UserConfigDir()) detail a
    hand-rolled version gets wrong, so the narrow fix is filed against the sdk instead:
    deploykit.QuadletDir pulls containerd v2 + ociregistry into any consumer (move the path helpers to kit) sdk#559 (move the pure path helpers to a light package).

How tested

The gates, on this head

Four commits, squashed at merge: a46c3a6 (the feature and the routing fix), 5cc74b0 (the
#27/D-STORE-3 assertions), dfe5acc (round 1: the bare-repository keep, the unmeasurable-store
refusal, the dead classifyStore error, the go.mod accounting) and b644e09 (round 2: the cache
report no longer claims "no stores found" while refusing one). Everything below was run on
b644e09.

$ git rev-parse HEAD
b644e09dc82b4e5c11314b686143fdea86865a9c
$ cd candy/plugin-clean && go build ./... && go test -count=1 ./... && test -z "$(gofmt -l .)" && echo "gofmt: clean"
ok  	github.com/opencharly/plugin-clean/candy/plugin-clean	0.087s
?   	github.com/opencharly/plugin-clean/candy/plugin-clean/cmd/serve	[no test files]
gofmt: clean
$ golangci-lint run ./...
0 issues.
$ charly box validate
charly box validate: OK — checked 1 candy, 1 deploy, 6 distros, 7 builders; 0 warnings, 0 errors

The coverage fails without the change — eight run-time mutations of THIS head's code

Each mutation edits the tree in place, runs the test, and restores from a copy — never from git checkout in a dirty tree, so a restore cannot take unrelated work with it. The final git status
is the proof every one was restored.

mut1 restores the PRE-FIX ROUTER (every store to the image-blind spec/cache reader) and
reproduces #27's two effects in one run: the store tree gains .lock, and the entry stops
answering for content that exists. mut2 removes the reference rule (everything evicted), mut3
keeps everything, mut4 drops the budget comparison, mut5 stops refusing when the state surface is
unreadable, mut6 removes the bare-repository keep (round 1's blocking finding — a tagged entry
whose repository the state names bare is then evicted), mut7 turns an unmeasurable store back into
a zero-byte one, and mut8 restores the false "no named cache stores found" line beside a refusal.

$ python3 /tmp/cs/mut1.py && cd candy/plugin-clean && go test -count=1 -run 'TestCleanCacheSweepsTheImageStoreWithItsOwnReader|TestCleanCacheLookupResolvesToExistingContent' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestCleanCacheSweepsTheImageStoreWithItsOwnReader (0.00s)
    store_sweep_test.go:746: the report says spec/cache swept the image store, want storekit; its tree is now [.lock blobs index.json oci-layout]
--- FAIL: TestCleanCacheLookupResolvesToExistingContent (0.00s)
$ cp /tmp/cs/bk-mut candy/plugin-clean/retention.go

$ python3 /tmp/cs/mut2.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweep' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreSweepEvictsOnlyWhatStateNoLongerReferences (0.00s)
    store_sweep_test.go:186: Evicted = 2, want 1: kept=[] evicted=[{sha256:47064acb1ae6925531471b1645181cb5be1300ca952c7ac7d904a726d2e90355 ghcr.io/opencharly/live:2026.322.0001 2026-11-18T10:00:00Z false referenced by quadlet units: ghcr.io/opencharly/live:2026.322.0001 resolves here} {sha256:550eea6e788175177694042d473ba93ad5b18dbae9adde84985aefc527cda4db ghcr.io/opencharly/dead:2026.322.0002 2026-11-18T11:00:00Z false unreferenced: no state surface names ghcr.io/opencharly/dead:2026.322.0002 (or its content address)}]
--- FAIL: TestStoreSweepKeepsAReferencedEntryEvenOverBudget (0.00s)
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

$ python3 /tmp/cs/mut3.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweep' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreSweepEvictsOnlyWhatStateNoLongerReferences (0.00s)
    store_sweep_test.go:186: Evicted = 0, want 1: kept=[{sha256:47064acb1ae6925531471b1645181cb5be1300ca952c7ac7d904a726d2e90355 ghcr.io/opencharly/live:2026.322.0001 2026-11-18T10:00:00Z true referenced by quadlet units: ghcr.io/opencharly/live:2026.322.0001 resolves here} {sha256:550eea6e788175177694042d473ba93ad5b18dbae9adde84985aefc527cda4db ghcr.io/opencharly/dead:2026.322.0002 2026-11-18T11:00:00Z true unreferenced: no state surface names ghcr.io/opencharly/dead:2026.322.0002 (or its content address)}] evicted=[]
--- FAIL: TestStoreSweepKeepsAReferencedEntryEvenOverBudget (0.00s)
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

$ python3 /tmp/cs/mut4.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweepKeepsAReferencedEntryEvenOverBudget' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreSweepKeepsAReferencedEntryEvenOverBudget (0.00s)
    store_sweep_test.go:256: verdict = "within budget", want it to report the store OVER budget
$ cp /tmp/cs/bk-mut candy/plugin-clean/command.go

$ python3 /tmp/cs/mut5.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweepRefusesWhenTheEngineCannotBeListed' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreSweepRefusesWhenTheEngineCannotBeListed (0.00s)
    store_sweep_test.go:501: the sweep ran against an unreadable engine — it must refuse
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

$ python3 /tmp/cs/mut6.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweepKeepsEveryTagOfABareRepositoryReference' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreSweepKeepsEveryTagOfABareRepositoryReference (0.00s)
    store_sweep_test.go:384: Evicted = 2, want 0: a bare-repository reference keeps every tag of it (evicted=[{Key:sha256:2d7ca585ef4c894c09d70350a6bb6cdf67be05616d1113cdfcf6be819f717f6e Ref:ghcr.io/opencharly/vision-gate:2026.323.0002 Created:2026-11-18T10:00:00Z Keep:false Reason:unreferenced: no state surface names ghcr.io/opencharly/vision-gate:2026.323.0002 (or its content address)} {Key:sha256:b0f29f0cc8b8d486fe648f2a8cffdab3327656ca3bec1f41afd5b82560778bd3 Ref:ghcr.io/opencharly/vision-gate:2026.322.0001 Created:2026-11-17T10:00:00Z Keep:false Reason:unreferenced: no state surface names ghcr.io/opencharly/vision-gate:2026.322.0001 (or its content address)}])
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

$ python3 /tmp/cs/mut7.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreBlobBytesRefusesAnUnmeasurableStore|TestStoreSweepRefusesAnUnmeasurableStore' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestStoreBlobBytesRefusesAnUnmeasurableStore (0.00s)
    store_sweep_test.go:412: storeBlobBytes = 0, nil; want an error for a store whose blobs cannot be listed
--- FAIL: TestStoreSweepRefusesAnUnmeasurableStore (0.00s)
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

$ python3 /tmp/cs/mut8.py && cd candy/plugin-clean && go test -count=1 -run 'TestCleanCacheRefusesAStoreItCannotClassify' ./... 2>&1 | grep -E -m 3 '^(--- FAIL|    store_sweep_test)'
--- FAIL: TestCleanCacheRefusesAStoreItCannotClassify (0.00s)
    store_sweep_test.go:857: the report says no named stores were found while refusing one:
$ cp /tmp/cs/bk-mut candy/plugin-clean/command.go

$ git status --porcelain
(nothing above = every mutation restored; HEAD b644e09)

The three assertions #27 and D-STORE-3 now carry by name

  1. The store-tree shape, after a REAL sweep. TestCleanCacheSweepsTheImageStoreWithItsOwnReader
    asserts the router (discoverStores → storeReaderStorekit), the report's reader, the zero
    removed-blob count, every blob the entry reaches still present, and then the directory's
    immediate entries are exactly {"blobs", "index.json", "oci-layout"} — D-STORE-3
    (DESIGN.md:2484) made falsifiable. Its red arm prints the tree, so the .lock half is shown,
    not argued: its tree is now [.lock blobs index.json oci-layout].
  2. The refusal arm. TestCleanCacheRefusesAStoreItCannotClassify writes REAL bytes into a store
    whose index mixes descriptor media types, asserts the refusal names it and the media types,
    that those bytes are still there afterwards, and that the report carries
    cache mixed: REFUSED at <dir> — …. A refusal that only existed as a Go value would be a
    refusal an operator never sees.
  3. The positive/negative pair for #27's data.
    TestCleanCacheLookupResolvesToExistingContent asserts the reference still resolves AND that the
    resolved digest's payload still reads back — the defect's tell was Lookup(ref) = (digest, true)
    over deleted bytes. Two tests rather than one because the blob count can be right while the
    reference is dead, and the reference can be live while the graph is missing bytes.

A fourth assertion joined them in round 1, and it is the one the reviewer found missing:
a bare-repository state reference keeps the repository's TAGGED entries
(TestStoreSweepKeepsEveryTagOfABareRepositoryReference, red arm mut6). The previous covering
test used an untagged annotation on both sides, so it could not see the hole: with a bare reference
the bare rule keeps every tag and the superseded path is never reached. It is now a tagged-vs-tagged
fixture (the Lookup path) and the tagged-vs-bare pair is the new test's job.

The red arm for all four is the mut1/mut6 block above; the green arm is the same tests on this
head, in the gate fence.

The live arms — a real store, a real binary, both directions

The store is synthesised through storekit in a temporary CHARLY_CACHE_DIR (D-STORE-8's injected
root), one image entry per build: 3 entries = 13 blobs, because two entries share a config blob. The
quadlet surface is an injected HOME; the container-engine surface is this host's real
podman ps -a. The binary is built from this head (go build ./cmd/serve).

$ # a REAL store, synthesised through storekit in a temporary CHARLY_CACHE_DIR: 3 image entries = 13 blobs (a rebuild appends)
store /tmp/cs/live/L1/registry: payload bytes added ~2069
  blobs: 13
$ cat $HOME/.config/containers/systemd/charly-live-a.container    # the ONE state surface naming an image
[Container]
Image=ghcr.io/opencharly/live-a:2026.322.1000
ContainerName=live-a
$ CHARLY_CACHE_DIR=/tmp/cs/live/L1 HOME=/tmp/cs/live/home charly-clean --store --dry-run
store state container engine: 12 ref(s), 12 content address(es) (podman ps -a)
store state quadlet units: 1 ref(s) (/tmp/cs/live/home/.config/containers/systemd)
store /tmp/cs/live/L1/registry: 3 entry(ies); 1 kept by state, 2 would evict
  kept    ghcr.io/opencharly/live-a:2026.322.1000  sha256:6de16522939d…  (referenced by quadlet units: ghcr.io/opencharly/live-a:2026.322.1000 resolves here)
  evict   ghcr.io/opencharly/dead-c:2026.301.0900  sha256:d0ad45da841d…  (unreferenced: no state surface names ghcr.io/opencharly/dead-c:2026.301.0900 (or its content address))
  evict   ghcr.io/opencharly/dead-b:2026.300.0900  sha256:e1b6289b1041…  (unreferenced: no state surface names ghcr.io/opencharly/dead-b:2026.300.0900 (or its content address))
store budget: 3.0 KiB held of 32.0 GiB — the real run measures what the evicted entries leave behind
store reclaim: would free 0 B of already-unreferenced blob(s), and each evicted entry's own layers with them
rc=0
$ CHARLY_CACHE_DIR=/tmp/cs/live/L1 HOME=/tmp/cs/live/home charly-clean --store
store state container engine: 12 ref(s), 12 content address(es) (podman ps -a)
store state quadlet units: 1 ref(s) (/tmp/cs/live/home/.config/containers/systemd)
store /tmp/cs/live/L1/registry: 3 entry(ies); 1 kept by state, 2 evicted
  kept    ghcr.io/opencharly/live-a:2026.322.1000  sha256:6de16522939d…  (referenced by quadlet units: ghcr.io/opencharly/live-a:2026.322.1000 resolves here)
  evict   ghcr.io/opencharly/dead-c:2026.301.0900  sha256:d0ad45da841d…  (unreferenced: no state surface names ghcr.io/opencharly/dead-c:2026.301.0900 (or its content address))
  evict   ghcr.io/opencharly/dead-b:2026.300.0900  sha256:e1b6289b1041…  (unreferenced: no state surface names ghcr.io/opencharly/dead-b:2026.300.0900 (or its content address))
store budget: retained 1.0 KiB of 32.0 GiB (within budget)
store reclaim: freed 2.0 KiB of blobs no surviving entry reaches
rc=0
  blobs after: 5

The refusal arm — the same store, with a container engine that cannot be listed:

  blobs in the store before the refusal: 13
$ CHARLY_CACHE_DIR=/tmp/cs/live/L2 HOME=/tmp/cs/live/home PATH=/tmp/cs/live/badbin:/usr/bin:/bin charly-clean --store
refusing to evict from the image store /tmp/cs/live/L2/registry: the container engine cannot be listed (listing containers via podman: exit status 125) — an unreadable state surface is not an empty one
rc=1
  blobs in the store after the refusal: 13

#27, live: a REAL --cache over a store holding image entries, with CHARLY_CACHE_DIR set (the
coincident-root case the issue measures). The report names its reader, every blob survives, and the
tree is the layout and nothing else:

store /tmp/cs/live/L3/registry: payload bytes added ~2069
  blobs before: 13
$ CHARLY_CACHE_DIR=/tmp/cs/live/L3 HOME=/tmp/cs/live/home charly-clean --cache
cache registry (storekit): 3 live entry(ies); removed 0 unreferenced blob(s) (0 B)
cache retired images: absent at /tmp/cs/live/L3/images (already swept)
rc=0
  blobs after:  13
$ ls -A /tmp/cs/live/L3/registry    # D-STORE-3: the tree is the layout and nothing else
blobs
index.json
oci-layout

The same call with the pre-fix router is the mut1 red arm: 4 of the 5 blobs gone, .lock inside
the tree, and the entry still answering Lookup for the missing payload.

Rulebook compliance

  • R0 — every skill the dispatcher selects for this area was loaded before the first tool
    call
    : /charly-core:clean, /charly-internals:plugin, /charly-internals:go,
    /charly-internals:git-workflow, /charly-internals:strict-policy,
    /charly-internals:root-cause-analyzer, /charly-internals:cutover-policy, /charly-check:check,
    /charly-internals:disposable, plus plugin-clean/AGENTS.md; /charly-internals:local-infra and
    /charly-core:charly-status when the state-surface investigation reached the install ledger and
    charly status --json.

  • R1 — every anomaly got a fresh RCA before remediation, and each was fixed or filed.
    (a) The storekit test's comment claimed storekit "never writes" the oci-layout marker; it does,
    from its one index writer (indexEntry → EnsureLayout), so the comment was corrected and the
    fixture now writes the marker deliberately rather than out of necessity. (b) sameStoreRoot()
    was found to be always true under the current spec resolver, which widened clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide #27 from the
    CHARLY_CACHE_DIR class to every host — that is in the Summary and the mut1 red arm. (c) Reading the sdk's
    GCStats while routing it exposed a second, mirror-image hazard (storekit reading spec/cache
    layouts), closed by the same classifier and pinned by TestClassifierRoutesEachStoreByItsOwnIndex.
    (d) The dry run's byte figure cannot be the real run's; that is stated in the report text, the
    skill and here rather than papered over with a number. (e) DeleteEntry returning false (a
    concurrent writer got there first) is reported as AlreadyGone, not silently folded into the
    count. Non-blocking findings were filed: opencharly/plugin-clean#28,
    opencharly/plugin-vm#98. Zero warnings in every gate above.
    (f) Round 1 (the BLOCK at 5cc74b0). The blocking finding — a bare-repository state reference
    did not keep that repository's TAGGED entries, so the command could false-evict a running
    deployment's image — is fixed in dfe5acc: the bare match is checked BEFORE the exact-tag match and
    keeps every tag of the repository, proven by TestStoreSweepKeepsEveryTagOfABareRepositoryReference
    (red arm mut6). The missed control: the property was asserted for the bare case and for the
    tagged case SEPARATELY and never as the mixed pair that crosses them, while the repos doc comment
    described exactly that pair and the one test covering the rule used an untagged annotation on both
    sides — a fixture that cannot fail. The control is now the mixed-pair test, plus the rule that a
    conservative behaviour written down in a doc comment gets an assertion in the SAME commit. The same
    round fixed the two notes: storeBlobBytes errors instead of returning a comfortable zero (an
    unmeasurable store refuses BEFORE evicting, mut7), and classifyStore's always-nil error is gone.
    (g) Round 2 (the BLOCK at dfe5acc). The cache report printed "cache: no named cache stores
    found" whenever the cache sweep produced no row, so an all-refused host printed that line beside the
    refusal that names the store it had just found. b644e09 gates the line on there being neither a swept nor a
    refused store (the mut8 arm above is its red half), and the refusal test now asserts the false
    line's ABSENCE as well as the expected one. The missed control: that test built the very fixture
    which produces the contradiction and asserted only the line it EXPECTED — "the output contains X"
    cannot see a false Y beside it, and a self-contradicting report needs the absence assertion.

  • R2 — one implementation per behaviour: sweepStoreBlobs is the ONE per-store reclaim, called
    by --cache and by --store (the two copies clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide #27's halves used to be are gone);
    listContainerImageRefs is the ONE container→image collector (the dangling sweep's own, reused
    for the keep set); pluginSchema is ONE compile of the served schema for the category set and
    the budget; classifyStore is the ONE reader decision. No sibling -host/-pod anything.

  • R3 — no sleeps, retries, suppressions or magic numbers. The budget is an authored CUE value,
    not a constant; the live-build guard is the package's existing liveBuildFloor seam; the
    concurrency handling is the store's own file lock plus a re-read inside RemoveBlob, never a
    retry loop; no podman/systemctl is invoked outside the sanitized charly surfaces this
    package already owned.

  • R4 — product before prose: the sweep's report, its refusal and its budget verdict are the
    product's own, and the docs (README.md, the authored clean skill, the candy description) were
    swept to match what the product now does.

  • R5 — the deleted surface is deleted: sameStoreRoot is gone (grep below), and every claim
    that described the two-half routing ("HALF TWO skips when the roots coincide", "spec/cache's
    reader sweeps every store") was swept from retention.go's header, gc_cache_storekit_test.go,
    the candy description, README.md and the skill.

$ git grep -n sameStoreRoot
CHANGELOG/2026.288.2246.md:22:So the halves must PARTITION the stores rather than overlap. sameStoreRoot() compares the resolved paths — not the environment variable — and skips the second half when they agree; comparing resolved paths keeps it true if either resolver changes, and a resolver error reports "not the same root" so a broken root is never hidden behind a skip.


The only remaining occurrence is the CHANGELOG entry that INTRODUCED the function — history, which
is where R5 puts it. No live reference survives.
- **R6** — `git status` was read before any action and is empty now; the work is in the session
worktree `.worktrees/clean-store/plugin-clean-retention` branched off `origin/main` (`82aeecc`),
nothing inside the pinned submodule was touched, no force-push, no hook bypass, one local commit.
- **R7** — coverage that fails without the change, proven by the five mutations above, and the
changed path executed live (four arms). Every emitted report line in this body is a real run.
- **R8** — the container-engine surface is a real service and ran live (`podman ps -a` on this
host); when it could not be read the sweep refused **visibly** rather than mocking or guessing.
- **R9** — the runtime binary under test was built from this head (`go build ./cmd/serve`, then the
real `--store` / `--cache` runs). `charly box validate` ran with the umbrella checkout's binary
(`2026.321.2122`) because a plugin module ships no charly of its own; this change adds no runtime
OS dependency, so `packaging:` needs nothing.
- **R10** — **NOT passed, and the tier says so.** This repo's declared R10 witness is the disposable
`check-commands-local` bed in `opencharly/charly`, which requires a charly build wired to THIS
plugin branch; the charly tree is outside this leg's write scope (`plugin-clean/AGENTS.md`: no
per-repo candy gate; the merge gate is the org-wide validator). What ran instead is the whole
changed path live, from a binary built from this head, against a real store — plus the plugin's
own 18 new tests — so the honest tier is `analysed on a live system`, not `fully tested and
validated`. Landing this PR does not require a bed, but a green validator must not be read as an
R10 pass.
- **CONC** — no concurrency primitive is added and no framing excuses one. The store's index
read-modify-write is serialized by storekit's own file lock (`<runtime>/store-index/<store>.lock`)
for both `DeleteEntry` and `PutEntry`, so a delete cannot lose a concurrent put; `RemoveBlob`
re-reads reachability and **refuses** a digest an entry now reaches, so a blob a concurrent writer
just published cannot be freed; a planned entry a concurrent writer already removed is detected
(`DeleteEntry` → `false`) and reported as `AlreadyGone`; and a live build makes the whole sweep
decline before a single blob is examined. There is no sleep, no retry, and no "unlikely" in the
argument.

## Change classification

**Breaking change + rollback:** not breaking for this repo's consumers — the change is additive at
every published surface. No CLI flag is removed or renamed (`--store` is new, `bare: false`), no
`plugin.providers` word changes (`command:clean`, `verb:retention`), `verb:retention`'s wire request
and reply (`spec.RetentionRequest` / `spec.RetentionReply`) are untouched, and the served CUE schema
only gains (`#CleanPlugin.store_budget`, one more `categories` row). The two behaviour changes are
both in `--cache`, and both shrink what it destroys: it now sweeps a store with a reader that can
read it, and it refuses a store it cannot classify instead of guessing. Rollback is
`git revert` of this single commit: no data migration, no state shape, and the store it leaves
behind is one a reverted binary still reads (the entries and blobs it removed are exactly the ones
nothing referenced).

Resolves `opencharly/plugin-clean#21` (the entry policy and the budget; its two separable gaps are
filed below) and `opencharly/plugin-clean#27` (one reader per store, chosen by identity).

## Filed issues

- **opencharly/plugin-clean#28** — the D-STORE-7 budget is authored in the plugin's schema only; a
project cannot tune it (`defaults:` lives in `opencharly/spec`). The sweep reports which number it
used, so nothing is silent.
- **opencharly/sdk#559** — `deploykit.QuadletDir` drags `containerd/v2` + `ociregistry` into any
consumer that only wants a directory; the light-package move is the fix, and this PR will switch
to it the day it exists.
- **opencharly/plugin-vm#98** — a VM's source image is not recorded in host state, so a store entry
that only a VM's authored entity names is classified unreferenced. Latent in this tree (no
`kind: bootc` VM entity exists), and the fix belongs to the VM substrate.

Agent: clean-retention
*Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)*

…store identity

charly clean --store implements DESIGN.md:2488 (D-STORE-7) for the charly image store: it keeps
the entries the host's charly state still references (the container engine's containers and the
quadlet units), evicts the rest, frees the blobs no surviving entry reaches, and reports the
retained size against a size budget AUTHORED in schema/clean.cue — under DESIGN.md:2482's ONE root,
on DESIGN.md:2484's one-layout store, with DESIGN.md:2489's injected roots in every test. It
refuses — evicting nothing — when a state surface cannot be read.

charly clean --cache now chooses each store's reader from the store's OWN index instead of from
the root it sits under, so the storekit-written registry store is never handed to the image-blind
spec/cache GCStats when CHARLY_CACHE_DIR makes the two roots coincide (#27).

Refs: #21, #27
Filed: #28, opencharly/plugin-vm#98

Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
The routing fix was asserted; its two recorded EFFECTS were not, and a D-STORE-3 claim that only a
comment makes reads green because nothing looks. This adds the assertions a dependent leg can cite:

  * the store directory's immediate entries after a REAL `--cache` are exactly
    {oci-layout, index.json, blobs} — no lock, no sidecar (D-STORE-3, DESIGN.md:2484) — and it was the
    storekit reader that swept it (asserted on the router and on the report, not inferred from a
    count);
  * a store whose identity cannot be decided is REFUSED, named in the report with its reason, and
    left byte-for-byte intact — asserted with real bytes in it;
  * the reference still resolves to content that EXISTS after the sweep (the defect's tell was
    Lookup(ref) = (digest, true) over deleted bytes), as its own test so both halves of the pair
    fail with their own message on the red arm.

The `--cache` report now names the reader that swept each store (`cache registry (storekit): ...`):
after #27 the wrong reader and the right one produced identical lines, so the
one fact that matters was invisible in the product.

Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 5cc74b0f0102a753333307a8e10df9f9f068ef4a (branch: feat/clean-store-eviction)

Change class: code/config (Go plugin) + docs.

Blocks

  1. R7 / R1 — the "bare repository keeps every tag" property is documented but not implemented, and the test that should prove it uses an untagged entry so it cannot fail. In candy/plugin-clean/store_eviction.go:
    • storeStateInventory.add puts a state reference with a tag into in.refs[taggedNorm] and one without a tag into in.repos[bareNorm].
    • planStoreEviction resolves the keep set only via inv.refs[norm] for an entry whose annotation has a tag; for a tagged entry it does if hasTag { continue } and never consults inv.repos. So a state surface that names a bare repository (or a digest-only ref, which normImageRef also folds to a bare repo) will not keep that repository's tagged store entries — they fall through to default: unreferenced → evict.
    • This is exactly the failure the command exists to prevent ("a false evict costs a deployment") and it directly contradicts the code's own comment on repos: "a state record that names a bare repository references whatever that repository means to the store, so every tag of it is kept (the conservative direction …)." That comment is an R1 incident (documentation diverges from reality).
    • The covering test TestStoreSweepEvictsASupersededRebuildOfAReferencedRef calls putImageEntry(..., "ghcr.io/opencharly/vision-gate", ...) — an untagged entry annotation — so both sides are bare and the test passes, masking the real tagged-entry case.
    • Fix: in planStoreEviction, for a tagged entry annotation, also look up the bare repository form in inv.repos and keep the entry (and every entry of that repo) when the state names it; then add a test with a tagged entry annotation and a bare-repository quadlet/engine ref that fails on the current code.

Non-blocking notes

  • classifyStore returns error but every path returns nil; the if cerr != nil guard in discoverStores is dead. This is a unparam-class lint finding that sits awkwardly against the body's "0 issues" claim (QUAL).
  • storeBlobBytes silently returns 0 when s.Blobs() errors, which would make budgetVerdict print "within budget" for a store that could not be measured — contradicting the stated "aborts on a store that cannot be enumerated" contract (report truthfulness).
  • The body does not account for the go directive bump (1.26.4 → 1.26.8) nor the large indirect-dependency expansion in go.mod/go.sum beyond naming the sdk/spec tags (A1 accounting).
  • R10 is honestly declared NOT passed and the tier is correctly lowered to analysed on a live system; no disposable bed target is named, which the body discloses rather than hides.

Verdict: BLOCK


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

View action run

The reviewer's blocking finding: `planStoreEviction` resolved the keep set only through
`inv.refs` (tagged references) and, for a tagged entry annotation, did `if hasTag { continue }`
without ever consulting `inv.repos`. A state surface naming a bare repository -- a quadlet's
`Image=vision-gate`, or a digest-only reference `normImageRef` folds to a bare repository -- did
not keep that repository's TAGGED store entries, so a false evict destroyed a running deployment's
image. The inventory's own `repos` doc already promised the conservative behaviour; it is now
implemented, ahead of the exact-match case, and a bare reference keeps EVERY tag of its repository.

The old covering test used an UNTAGGED annotation on both sides, which is why it passed: with a
bare state reference the bare rule keeps every tag and the superseded path is never reached. It is
now a tagged-vs-tagged fixture (the Lookup path), and a new tagged-entry/bare-reference test covers
the hole that was there.

Also from the same round:

  * `storeBlobBytes` now returns an error instead of a comfortable zero, so an unmeasurable store
    REFUSES before anything is evicted rather than letting the budget verdict print "within budget"
    for a size nobody measured -- the body's "aborts on a store that cannot be enumerated" claim
    would otherwise have been false.
  * `classifyStore` no longer returns an error that every path returned `nil` for; the dead guard in
    `discoverStores` is gone.

Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
@aitrawog

Copy link
Copy Markdown
Contributor Author

Round 1 — every finding fixed in dfe5acc

Head: dfe5acce727bf2028b4e54885e6c088bf1b59fd8 (one new commit on the same branch; no amend, no
force-push, no re-dispatch of the blocked head). The body is re-keyed to this head and linted
(pr_body_lint.py --repo . --base origin/main → 0 finding(s)).

The blocking finding — a false evict, fixed and proven

planStoreEviction resolved the keep set only through inv.refs (tagged) and, for a tagged entry
annotation, did if hasTag { continue } without ever consulting inv.repos. A state surface naming
a bare repository (Image=vision-gate, or a digest-only reference normImageRef folds to a bare
repository) therefore did not keep that repository's TAGGED entries: they fell to unreferenced → evict. The code's own repos doc already promised the conservative behaviour, which made it an R1
doc-vs-reality incident as well as a live-deployment hazard.

Fixed: the bare-repository match is now checked before the exact-tag match, and it keeps EVERY
tag of the repository (a bare reference names the repository, not one build of it; the price is that
it also protects superseded rebuilds, which is the conservative direction). Red arm, on this head:

$ python3 /tmp/cs/mut6.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreSweepKeepsEveryTagOfABareRepositoryReference' ./...
--- FAIL: TestStoreSweepKeepsEveryTagOfABareRepositoryReference (0.00s)
    store_sweep_test.go:384: Evicted = 2, want 0: a bare-repository reference keeps every tag of it (... Reason:unreferenced: no state surface names ghcr.io/opencharly/vision-gate:2026.323.0002 ...)
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

Green on this head: TestStoreSweepKeepsEveryTagOfABareRepositoryReference passes (two tagged
entries, both kept, both blobs still present, reason the state names the repository).

On the test that should have caught it, said plainly rather than quietly replaced: the old
TestStoreSweepEvictsASupersededRebuildOfAReferencedRef used an UNTAGGED annotation on both sides
(ghcr.io/opencharly/vision-gate), so with a bare state reference the bare rule kept every tag and
the superseded path was never exercised — the fixture could not fail. It is now tagged-vs-tagged
(one shared CalVer tag, two builds), which is the only shape that reaches Lookup, and the
tagged-entry/bare-reference pair is the new test's job. Its comment carries that history.

storeBlobBytes — an unmeasurable store must refuse, not report

It returned 0 when s.Blobs() errored, so budgetVerdict could print within budget for a size
nobody measured — which would have made the body's "aborts on a store that cannot be enumerated"
claim false. It now returns (int64, error); the sweep refuses BEFORE evicting when it cannot
measure and refuses after the sweep rather than print a retained figure that would be a guess. Two
tests, both red under mut7:

$ python3 /tmp/cs/mut7.py && cd candy/plugin-clean && go test -count=1 -run 'TestStoreBlobBytesRefusesAnUnmeasurableStore|TestStoreSweepRefusesAnUnmeasurableStore' ./...
--- FAIL: TestStoreBlobBytesRefusesAnUnmeasurableStore (0.00s)
    store_sweep_test.go:412: storeBlobBytes = 0, nil; want an error for a store whose blobs cannot be listed
--- FAIL: TestStoreSweepRefusesAnUnmeasurableStore (0.00s)
    store_sweep_test.go:437: refusal = "reclaiming the evicted entries' blobs: open ...registry/blobs: not a directory", want it to name the measurement
$ cp /tmp/cs/bk-mut candy/plugin-clean/store_eviction.go

The two non-blocking notes

  • classifyStore no longer returns an error every path returned nil for; the dead if cerr != nil
    guard in discoverStores is gone, and the four call sites (one production, three test arms) are
    updated. golangci-lint run ./... → 0 issues.
  • The go.mod accounting the review asked for is now a section of the body: the go 1.26.4 → 1.26.8
    bump follows the sdk tag's own go directive (Go refuses a dependency newer than the main
    module), and the indirect expansion comes from the ONE new import — deploykit, for
    deploykit.QuadletDir() — whose vm_box_emit.go pulls sdk/buildkitdrive and with it
    containerd/v2 + ociregistry. Zero marginal cost in the compiled-in placement; it lands only on
    cmd/serve. Filed the narrow fix as deploykit.QuadletDir pulls containerd v2 + ociregistry into any consumer (move the path helpers to kit) sdk#559.

The rest of the round

  • go build ./..., go test -count=1 ./..., gofmt -l . empty, golangci-lint run ./... → 0 issues., charly box validate → OK — checked 1 candy, 1 deploy, 6 distros, 7 builders; 0 warnings, 0 errors — all on dfe5acc, in the body's gate fence.
  • Seven mutation arms (the five from round 0 plus mut6/mut7), each restored from a copy, git status empty afterwards — pasted in the body.
  • Live arms re-taken on this head: the store eviction (-13 → 5 blobs, retained 1.0 KiB of 32.0 GiB (within budget)), the refusal (rc=1, 13 blobs untouched), and the real --cache
    (cache registry (storekit): …, 13 blobs untouched, tree exactly {blobs, index.json, oci-layout}).
  • Tier stays analysed on a live system; R10 stays declared NOT passed.

Missed control (why my own gate did not catch the blocking finding): my tests asserted the
behaviour I designed for the BARE case and the TAGGED case separately, and never the mixed pair that
crosses them; the repos comment described the property the mixed pair needed. The control is the
new mixed-pair test plus the rule that a documented conservative behaviour gets an assertion in the
same commit.

Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: dfe5acce727bf2028b4e54885e6c088bf1b59fd8 (branch: feat/clean-store-eviction)

Change class: code/config (Go plugin) + docs.

Blocks

  1. A1 / R10 — the body and all its pasted evidence are stale relative to the head. The body says "Two commits, squashed at merge: a46c3a6 … and 5cc74b0 …" and "Everything below was run on 5cc74b0's tree." The actual head is dfe5acce — a third commit (fix(clean): keep a tagged entry whose REPOSITORY the state names bare) that changed store_eviction.go (the case inv.repos[repoOf(norm)] != "" branch), store_sweep_test.go (the new TestStoreSweepKeepsEveryTagOfABareRepositoryReference and the corrected tagged fixture), and the routing. Every pasted go test ./... / golangci-lint run ./... / mutation / live-arm block therefore predates the current code and does not cover it. There is no fresh gate output, mutation red-arm, or live arm for dfe5acce. Additionally, the body's Summary/How-tested/R1 sections never account for the new behavior (a bare-repository state reference keeps every tag of that repository) or its test. Re-run the gates on dfe5acce, paste the output, and add the behavior to the Summary and How-tested.

    • The body is also internally inconsistent on the head: it cites 5cc74b0 as HEAD, de7c6b9 as the git status HEAD, while the real head is dfe5acce. Reconcile to one SHA.
  2. R1 — review-round evidence: no fresh RCA naming the missed control. This push follows a BLOCK on 5cc74b0. The finding is fixed in the current diff (the inv.repos[repoOf(norm)] keep branch + the tagged-entry/bare-reference test + the corrected superseded-rebuild fixture), so the fix half is satisfied. But the round's PR body carries no RCA of the missed control — why the author's own pre-push gate let the tagged-entry/bare-reference hole through. The only such RCA is buried in a test comment (store_sweep_test.go: "the previous form of this test used an UNTAGGED annotation … A bare-vs-bare fixture cannot see that hole"); the body's R1 section (a)–(e) never mentions the finding or the fix. The body must carry that RCA.

Comment disposition

  • Comment 6978928974 (prior BLOCK at 5cc74b0): blocking finding fix: remove the stray charly submodule; fetch charly at CI time into a temp checkout #1 (bare-repository/tagged-entry false evict) — verified fixed in the current diff (planStoreEviction now checks inv.repos[repoOf(norm)] before the exact-match case; TestStoreSweepKeepsEveryTagOfABareRepositoryReference and the retagged TestStoreSweepEvictsASupersededRebuildOfAReferencedRef cover it). Non-blocking note on classifyStore returning an unused error — stale/superseded (current signature is (storeReader, string); no error guard remains). Non-blocking note on storeBlobBytes returning 0 on error — stale/superseded (current form returns the error, and TestStoreBlobBytesRefusesAnUnmeasurableStore pins it). go.mod/go.sum accounting note — survives as a minor A1 gap (the go directive bump 1.26.4 → 1.26.8 and the indirect-dependency expansion are still not described beyond the sdk tag), non-blocking on its own.

Verdict: BLOCK


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

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: dfe5acce727bf2028b4e54885e6c088bf1b59fd8 (branch: feat/clean-store-eviction)

Change class: code/config (Go plugin) + docs.

Blocks

  1. R1 / A1 — the --cache report asserts a falsehood in a reachable state, and the body does not account for the behavior. In candy/plugin-clean/command.go (printRetentionResult, cache branch) the line "cache: no named cache stores found" is emitted whenever len(out.CacheSweep) == 0. That is exactly the all-refused case: gcCacheStores returns an empty sweep and a non-empty refused when the only discovered store cannot be classified (storeReaderUnrouted). So charly clean --cache on a host whose sole named store is unclassifiable prints:

    cache: no named cache stores found
    cache mixed: REFUSED at /…/mixed — its index mixes storekit entry manifests (1) with spec/cache manifests (1), …
    

    A named store was found and refused; "no named cache stores found" is false. A self-contradicting report is precisely the class of false figure this PR exists to eliminate (the body's own thesis: "a number that looked like the post-sweep size while being the pre-sweep one is the kind of figure this report exists to avoid"). The PR's own TestCleanCacheRefusesAStoreItCannotClassify builds this exact fixture (infos empty, refused length 1), renders the report, and asserts only the REFUSED line — it never asserts the absence of the false one, so the coverage cannot catch it.

    Fix: gate the empty line on len(out.CacheSweep) == 0 && len(out.RefusedStores) == 0 (or reword it to "no named cache stores swept"), and extend TestCleanCacheRefusesAStoreItCannotClassify to assert the report does not claim no stores were found.

Comment dispositions

  • 6978928974 (prior BLOCK at 5cc74b0) — blocking finding (bare-repository reference failed to keep tagged entries): verified-fixed. planStoreEviction now checks case inv.repos[repoOf(norm)] != "" before the exact-tag case, and TestStoreSweepKeepsEveryTagOfABareRepositoryReference plus the retagged TestStoreSweepEvictsASupersededRebuildOfAReferencedRef pin it (red arm mut6). Its non-blocking notes are stale-superseded: classifyStore now returns (storeReader, string) with no always-nil error guard; storeBlobBytes now returns (int64, error) and refuses before evicting (mut7); the go.mod accounting is now a body section.
  • 6979080129 (@aitrawog, round-1 response) — verified-non-blocking: it accurately describes the fixes against the current diff, and its missed-control RCA is now also carried in the body's R1(f), not only in a test comment.
  • 6979096596 (prior BLOCK at dfe5acce) — stale-superseded: its two findings are contradicted by the current body, which is re-keyed to dfe5acc ("Everything below was run on dfe5acc"; git rev-parse HEAD → dfe5acce…) and carries the missed-control RCA in R1(f). The de7c6b9/5cc74b0 head inconsistency it cited is gone.

Notes (non-blocking)

  • R10 is honestly declared NOT passed and the tier is correctly lowered to analysed on a live system; the changed path did execute live against a real store, and the plugin's declared bed lives in opencharly/charly outside this repo's write scope. Not a block.
  • storeLines omits the budget/reclaim lines when len(o.Decisions) == 0; AlreadyGone is folded into the "evicted" count and disclosed on a following line. Both are cosmetic, not false claims.

Verdict: BLOCK


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

View action run

`printRetentionResult` printed "cache: no named cache stores found" whenever no store was SWEPT,
which is exactly the all-refused case: one named store was found, its reader could not be decided,
and the very next line names it as REFUSED. That is a self-contradicting report in a reachable
state, and the refusal test built the fixture that produces it while asserting only the REFUSED
line, so it could not fail.

The empty line is now gated on there being no swept AND no refused store, and the refusal test
asserts the false line is ABSENT (red arm: mut8).

Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: b644e09dc82b4e5c11314b686143fdea86865a9c (branch: feat/clean-store-eviction)

Change class: code/config (Go plugin) + docs.

Blocks

  1. A1 / R10 — the body and all its pasted evidence are keyed to dfe5acc, not the current head b644e09. The body states "Three commits, squashed at merge: a46c3a6 … 5cc74b0 … and dfe5acc … Everything below was run on dfe5acc" and its gate fence shows git rev-parse HEAD → dfe5acce727bf…. The actual head is b644e09 — a fourth commit (fix(clean): the cache report must not say "no stores" while refusing one) that changed candy/plugin-clean/command.go (the len(out.CacheSweep) == 0 && len(out.RefusedStores) == 0 guard) and candy/plugin-clean/store_sweep_test.go (the !strings.Contains(line, "no named cache stores found") assertion). No pasted go build/go test/golangci-lint/charly box validate output, mutation red-arm, or live arm covers b644e09, and the body's Summary/How-tested do not account for the round-2 behavior (the refusal line must not co-exist with "no stores found"). Re-key the body to b644e09, paste fresh gate output for that tree, and add the behavior to the Summary and How-tested.

  2. R1 — no round-2 RCA naming the missed control. This push follows the BLOCK at dfe5acc (comment 6979262916: charly clean --cache printed "no named cache stores found" while refusing a store). The fix is present in the current diff (the && len(out.RefusedStores) == 0 guard, plus the new assertion in TestCleanCacheRefusesAStoreItCannotClassify), so the fix half is satisfied — but neither the body's R1 section (which stops at "(f) Round 1 (the BLOCK at 5cc74b0)") nor any thread comment carries a round-2 RCA. Add the RCA naming the missed control: the refusal test rendered the report but only asserted the REFUSED line, never the absence of the contradictory empty-store line, so the fixture could not fail on the contradiction.

Comment dispositions

  • 6978928974 (BLOCK at 5cc74b0) — blocking finding (bare-repository ref failed to keep tagged entries): verified-fixed in the current diff (planStoreEviction's case inv.repos[repoOf(norm)] != "" precedes the exact-tag case; TestStoreSweepKeepsEveryTagOfABareRepositoryReference pins it, red arm mut6). Non-blocking notes stale/superseded: classifyStore now returns (storeReader, string) (no always-nil error); storeBlobBytes now returns (int64, error) and refuses before evicting; the go.mod accounting is now a body section.
  • 6979080129 (@aitrawog round-1 response) — verified-non-blocking: accurately describes the dfe5acc fixes against the current diff; its missed-control RCA is present in the body's R1(f).
  • 6979096596 (BLOCK at dfe5acc) — its specific claim (body says 5cc74b0) is stale-superseded (body now says dfe5acc), but the same stale-body pattern recurs at b644e09 — verified-blocking in its recurring form (block 1).
  • 6979262916 (BLOCK at dfe5acc) — the "no named cache stores found" finding is verified-fixed in the current diff (guard + test assertion); its requirement for a round RCA is verified-blocking in its recurring form (block 2).

Verdict: BLOCK


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

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: b644e09dc82b4e5c11314b686143fdea86865a9c (branch: feat/clean-store-eviction)

Security screen: PASS — no secrets/egress, no weakened guardrail, no supply-chain anomaly beyond the declared deploykit import (accounted for in the body), no injected instruction.

Checklist: All applicable rules PASS or NA. Body is re-keyed to the current head, the four commits are named, the gate fence and eight mutation red-arms are pasted, the tier (analysed on a live system) is honestly lowered, and the bare-repository fix, storeBlobBytes error, classifyStore signature and the "no stores found" guard all match the current diff. Placement: CORRECT (capability code in candy/plugin-clean/; no core/alias growth, no sdk mechanism kit imported into core).

Comment dispositions:

  • 6978928974 (bot, BLOCK at 5cc74b0) — bare-repo/tagged-entry finding verified-fixed (case inv.repos[repoOf(norm)] != "" precedes the exact-tag case; TestStoreSweepKeepsEveryTagOfABareRepositoryReference, red arm mut6); its three non-blocking notes stale-superseded (classifyStore now (storeReader, string); storeBlobBytes now returns error; go.mod accounted for in the body).
  • 6979080129 (@aitrawog, round-1 response) — verified-non-blocking: accurately describes the dfe5acc fixes against the current diff; its missed-control RCA is carried in the body's R1(f).
  • 6979096596 (bot, BLOCK at dfe5acc) — stale-body claim stale-superseded (body now says b644e09 and git rev-parse HEAD → b644e09…); no-RCA claim verified-fixed (R1(g) present).
  • 6979262916 (bot, BLOCK at dfe5acc) — "no named cache stores found" finding verified-fixed (len(out.CacheSweep) == 0 && len(out.RefusedStores) == 0 guard; TestCleanCacheRefusesAStoreItCannotClassify now asserts the false line's absence, red arm mut8).
  • 6979362808 (bot, BLOCK at b644e09) — stale-body finding stale-superseded; no-round-2-RCA finding verified-fixed (R1(g) names the missed control: "the output contains X" cannot see a false Y beside it).

Non-blocking note (rulebook gap): R10's disposable bed lives in opencharly/charly, outside this plugin repo's write scope, and no ## Filed issues entry tracks that cross-repo gate. The body discloses R10 as NOT passed and lowers the tier, which is the honest handling; a follow-up issue naming the bed would close the traceability gap.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 18, 2026 13:14
@github-actions
github-actions Bot merged commit 6bb823b into main Nov 18, 2026
5 of 6 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 18, 2026
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