Skip to content

feat(build)!: write built images to storekit's registry store - #59

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/store-writes-to-registry
Nov 18, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/store-writes-to-registry

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

plugin-build no longer owns an OCI image store. The layout (oci-layout + one index.json +
blobs/<alg>/<digest>), the streamed blob copy, the atomic index rewrite and the cross-process
index lock now live in sdk/storekit, where the image resolver reads the same entries
(opencharly/sdk#556), and this repo keeps only what a build owns and calls the shared store —
opencharly/sdk#460 step 3, "reduce plugin-build's file to the build-specific annotations and call
the shared store".

Head 1bd3bebb66e552314ad1f164adaa390ca76ecc4d — 10 files, +335 −489.

File What
candy/plugin-build/imagestore.go the reduction: the store implementation deleted, the build's half kept (±329 lines)
candy/plugin-build/buildkit.go the call sites: storekit.OpenImageStore() for Lookup/Dir/Add; the binding block extracted as bindStoreContexts
candy/plugin-build/imagestore_test.go the store's own contract left to sdk; the naming contract kept; a relocation proof added
candy/plugin-build/imagestore_live_test.go retargeted at the shared store; the entry/digest and discovery assertions moved into the live run
candy/plugin-build/buildkit_live_test.go one comment that named the dead relocation lever
candy/plugin-build/registry.go the one pre-existing errcheck finding that reddened this change's lint gate (R1, blocking: fixed)
candy/plugin-build/charly.yml, README.md the claims that named $XDG_DATA_HOME/charly/images and CHARLY_IMAGE_STORE_DIR (R5 sweep)
candy/plugin-build/go.mod, go.sum require github.com/opencharly/sdk v0.2026322.1227, no replace

Deleted, because the store is not this repo's business: imageStoreDir() and its
hand-resolved $XDG_DATA_HOME (the WORKAROUND the file itself called out), CHARLY_IMAGE_STORE_DIR,
the oci-layout marker writer, the index.json read/merge/rewrite, the streamed blob copy, the
layout-directory preparation, and the store-index lock.

Kept, because only a build has it: choosing the reference — containerfileStageRefs /
FromRefs / BaseRef, now driven by bindStoreContexts, which asks the store for Lookup and
Dir instead of composing a path — and naming the export. annotateExport still writes
io.containerd.image.name (plus the tag-only org.opencontainers.image.ref.name and the build
instant) into the archive, because storekit.ImageStore.Add refuses an archive that does not
already name its reference, and the kit emits a bare --output type=oci,dest=<file>. That is the
one thing Add cannot do for the build's export.

Where the store is now: the registry named store under the cache root, resolved by
storekit.StoreDir. D-STORE-1 (DESIGN.md:2482) blesses exactly one relocation lever —
CHARLY_CACHE_DIR — so the image-specific override is deleted rather than reworded;
plugin-clean's retirement record keeps <cache root>/images, and nothing here writes to a store
named images.

The add this removal names has LANDED. opencharly/sdk#556 merged at 2026-11-18T12:27:16Z as
merge commit 61b9125320899be8ff3c0dc2e2e885e703d13a7b and is tagged v0.2026322.1227. Verified
rather than assumed: that tag's storekit/images.go is blob fd91db01860aed654911225333e86bed8f22d1b3,
identical to the tree this change was developed and gated against — so the store this diff calls is
the store the tag ships.

The requirement is the published tag, with no replace. This head requires
github.com/opencharly/sdk v0.2026322.1227 and carries no replace; go list -m resolves it from
the module cache, not from a local path. A head carrying a development replace is never pushed —
that pattern has cost this org four consecutive CI failures.

How tested

The module gate, on this head

$ git rev-parse HEAD
1bd3bebb66e552314ad1f164adaa390ca76ecc4d

$ git -c diff.algorithm=myers diff --shortstat origin/main...HEAD   # git default, = what GitHub shows
 10 files changed, 335 insertions(+), 489 deletions(-)

$ go build ./...
exit=0

$ go test -count=1 ./...
ok  	github.com/opencharly/plugin-build/candy/plugin-build	5.612s
?   	github.com/opencharly/plugin-build/candy/plugin-build/cmd/serve	[no test files]
exit=0

$ gofmt -l .
(no output above = clean)

$ golangci-lint run ./...
0 issues.
exit=0

$ charly box validate
charly box validate: OK — checked 1 candy, 6 distros, 7 builders; 0 warnings, 0 errors
exit=0

# R5 sweep: retired identifiers and the dead relocation lever
$ grep -rn -- "XDG_DATA_HOME\|charly/images\|CHARLY_IMAGE_STORE_DIR\|imageStoreDir\|storeLookup\|storeAdd\|imageStoreID\|copyBlobsIntoStore\|storeLockPath" --include="*.go" --include="*.yml" --include="*.md" . | grep -v "^./CHANGELOG/" | wc -l
0

One note on that figure, because it is not the only true one: git's line counts depend on its diff
algorithm, and this host has diff.algorithm=histogram configured globally, which computes
+340 −494 for the same tree. The command above pins git's DEFAULT (myers) deliberately — that is
what a pull request's own diff shows (gh pr view reports 10 files, +335 −489), so the headline
carries that figure. The gate itself has this pinned nowhere; filed as opencharly/marketplace#622.

The live arm — one box built end to end writes the registry store

The live tests drive driveConfig.buildImage — the changed path — against the real BuildKit daemon
and the real podman engine into a throwaway cache root, so the run proves the store write rather
than describing it. They skip visibly when the toolchain is absent.

$ CHARLY_CACHE_DIR=/tmp/cs/pr-ship go test -count=1 -v -run TestImageStore_ .
=== RUN   TestImageStore_AnnotationNamesTheImport_AndItsAbsenceDoesNot

--- Building w36named ---
--- PASS: TestImageStore_AnnotationNamesTheImport_AndItsAbsenceDoesNot (1.74s)
=== RUN   TestImageStore_BoxOnBoxBuildsWithTheRegistryUnreachable

--- Building w36parent ---
ensure-image: base ghcr.invalid/opencharly/w36-live-absent:2026.296.1200 is not in local storage — ensuring it (resolve, pull, else build locally)
--- w36child: ghcr.invalid/opencharly/w36-live-parent:2026.296.1200 from the charly image store ---

--- Building w36child ---
--- PASS: TestImageStore_BoxOnBoxBuildsWithTheRegistryUnreachable (1.73s)
PASS
ok  	github.com/opencharly/plugin-build/candy/plugin-build	3.475s
exit=0

The store that build wrote — oci-layout + index.json + blobs/, and nothing else at the time
the build finished (D-STORE-3, DESIGN.md:2484):

$ find "$CHARLY_CACHE_DIR" -mindepth 1 -maxdepth 3 | sort | sed "s|$CHARLY_CACHE_DIR|<cache root>|"
<cache root>/buildkitd
<cache root>/buildkitd/export
<cache root>/registry
<cache root>/registry/blobs
<cache root>/registry/blobs/sha256
<cache root>/registry/index.json
<cache root>/registry/oci-layout

Resolving the built reference through that layout. The entry is keyed by a digest — the index.json
descriptor's ai.opencharly.cache.key annotation IS the entry's key, which IS its payload, and
that payload is the artifact index naming the manifest BuildKit produced, whose config and layer are
blobs in the store (D-STORE-5, DESIGN.md:2486; D-STORE-10, :2491):

$ python3 - <<'PY'
import json, os
root = "/tmp/cs/pr-ship/registry"
ref = "localhost/w36-named-live:2026.296.1200"

def blob(d):
    alg, h = d.split(":")
    with open(os.path.join(root, "blobs", alg, h), "rb") as fh:
        return fh.read()

idx = json.load(open(os.path.join(root, "index.json")))
print(f"index.json: schemaVersion={idx['schemaVersion']} descriptors={len(idx['manifests'])}")
for d in idx["manifests"]:
    entry = json.loads(blob(d["digest"]))
    if entry["annotations"].get("io.containerd.image.name") != ref:
        continue
    assert d["annotations"]["ai.opencharly.cache.key"] == entry["key"], "descriptor key != entry key"
    assert entry["payload"] == entry["key"], "payload != key"
    assert os.path.exists(os.path.join(root, "blobs", *entry["key"].split(":")))
    print(f"descriptor.digest          = {d['digest']}")
    print(f"descriptor mediaType       = {d['mediaType']}")
    print(f"entry.key (the digest key) = {entry['key']}")
    print(f"entry.payload              = {entry['payload']}")
    print(f"entry name                 = {entry['annotations']['io.containerd.image.name']}")
    print(f"entry created              = {entry['annotations']['org.opencontainers.image.created']}")
    art = json.loads(blob(entry["payload"]))
    man = art["manifests"][0]
    m = json.loads(blob(man["digest"]))
    print(f"-> artifact index names     manifest {man['digest']}")
    print(f"-> manifest config          {m['config']['digest']}")
    print(f"-> manifest layer           {m['layers'][0]['digest']} ({m['layers'][0]['size']} bytes)")
    for dg in (man["digest"], m["config"]["digest"], m["layers"][0]["digest"]):
        assert os.path.exists(os.path.join(root, "blobs", *dg.split(":"))), f"missing {dg}"
    print("-> every digest in the chain is a blob in the store: yes")
print("store top-level entries:", sorted(os.listdir(root)))
PY
index.json: schemaVersion=2 descriptors=3
descriptor.digest          = sha256:29ddd07eef286383c27e706b5bb3100e89411982a551079fdc72b396051c4eb2
descriptor mediaType       = application/vnd.opencharly.store.entry.v1+json
entry.key (the digest key) = sha256:244ba6958045ffee918b6938bea47763babc0b4fb90c25ab36dfb1f5c81b9e32
entry.payload              = sha256:244ba6958045ffee918b6938bea47763babc0b4fb90c25ab36dfb1f5c81b9e32
entry name                 = localhost/w36-named-live:2026.296.1200
entry created              = 2026-11-18T12:30:43Z
-> artifact index names     manifest sha256:d457b6c969ad86a3c4754eb8b41ed3001a0897db40d6e3c12966f17324a18812
-> manifest config          sha256:8006952c9b9def36be797c1ef3e28b1ccc6631811b12ac7b164957da741df155
-> manifest layer           sha256:25f1d6b1951ac8eb3740558fe94cb83d377bdadf95fd9f98b50d2e1b96130471 (3630321 bytes)
-> every digest in the chain is a blob in the store: yes
store top-level entries: ['blobs', 'index.json', 'oci-layout']

The same facts read through the store's own API — a short probe against this cache root; the same
assertions are in-repo, in TestBuildExportLandsInTheRegistryStoreKeyedByDigest (unit) and in the
live test's entry-and-discovery assertions:

$ (cd /tmp/cs/nsprobe && CHARLY_CACHE_DIR=/tmp/cs/pr-ship go run .)   # storekit.NamedStores / ImageStoreDir / List / Lookup
storekit.NamedStores() = [registry]
storekit.ImageStoreDir() = /tmp/cs/pr-ship/registry
store.Dir() = /tmp/cs/pr-ship/registry
store.List() = [ghcr.invalid/opencharly/w36-live-parent:2026.296.1200 localhost/w36-live-child:2026.296.1200 localhost/w36-named-live:2026.296.1200]
  Lookup("ghcr.invalid/opencharly/w36-live-parent:2026.296.1200") = (sha256:45cd9e7f5c381c2e172870345ccb7bcd6f329f7f0dbabee39fd02f67a397e72c, true, <nil>)
  Lookup("localhost/w36-live-child:2026.296.1200") = (sha256:81a566270bfef00e1e31770eb312bc8042876275519cfd891dfa9c8815e4a98b, true, <nil>)
  Lookup("localhost/w36-named-live:2026.296.1200") = (sha256:244ba6958045ffee918b6938bea47763babc0b4fb90c25ab36dfb1f5c81b9e32, true, <nil>)
exit=0

The sweep, and then the fix — two measurements about two different binaries, kept apart on purpose.
This host's charly is 2026.321.2122, which predates plugin-clean's fix and compiles clean IN
(an out-of-process command:clean is not dispatched: pointed at a v2026.322.1315 build through
CHARLY_PLUGIN_DIR, the command still printed the line below, so the compiled-in copy ran). This
block is therefore the DEFECT's measurement, not a description of the current sweep:

$ CHARLY_CACHE_DIR=/tmp/cs/pr-ship charly clean --cache --dry-run
cache registry: 3 live entry(ies); would remove 10 unreferenced blob(s) (3.5 MiB)
cache retired images: absent at /tmp/cs/pr-ship/images (already swept)
exit=0

What that line is. That binary's reachability walk has no image graph to walk, so the ten blobs
it calls unreferenced are exactly the three entry manifests plus the image manifests, configs and the
one shared layer those entries reach. On a real run the sweep deletes them, and it also leaves a
.lock inside the store tree, which D-STORE-3 forbids. Measured on a scratch copy: five blobs
became one, and the surviving entry still answered Lookup → (digest, true) for bytes that were gone.

This was blocking, and it is fixed upstream. The reviewer's classification was right: landing
the writer while the sweep destroys what it writes is the R1/CONC shape, not a filed-and-separate
finding. The misrouting that produced both effects is fixed in opencharly/plugin-clean
v2026.322.1315 = 6bb823b02783289204266d75e65a42823a40b502: the sweep is now one inventory with one
reader per store chosen by the store's IDENTITY — an application/vnd.opencharly.store.entry.v1+json
descriptor routes to storekit, an OCI image manifest descriptor routes to spec/cache, and a store
whose identity cannot be decided is refused and reported rather than guessed. Its own test asserts,
at the COINCIDENT roots (CHARLY_CACHE_DIR set) and on a REAL sweep, the outcome the defect could not
reach: the image store routed to storekit, zero blobs removed, every blob still reading back, and the
store's immediate entries exactly {blobs, index.json, oci-layout} — a .lock fails that assertion.
Neither the deletion of an entry's manifest, config and layers nor its D-STORE-3 sidecar can now
occur.

Run here, at the tag:

$ git ls-remote --tags https://github.com/opencharly/plugin-clean 'refs/tags/v2026.322.1315*'
6bb823b02783289204266d75e65a42823a40b502	refs/tags/v2026.322.1315

$ cd candy/plugin-clean && go test -count=1 -v -run 'TestCleanCache|TestClassifierRoutesEachStoreByItsOwnIndex' .
=== RUN   TestClassifierRoutesEachStoreByItsOwnIndex
=== RUN   TestClassifierRoutesEachStoreByItsOwnIndex/storekit_store
=== RUN   TestClassifierRoutesEachStoreByItsOwnIndex/spec/cache_layout
=== RUN   TestClassifierRoutesEachStoreByItsOwnIndex/empty_store
=== RUN   TestClassifierRoutesEachStoreByItsOwnIndex/unreadable_index_is_refused,_never_guessed
--- PASS: TestClassifierRoutesEachStoreByItsOwnIndex (0.00s)
    --- PASS: TestClassifierRoutesEachStoreByItsOwnIndex/storekit_store (0.00s)
    --- PASS: TestClassifierRoutesEachStoreByItsOwnIndex/spec/cache_layout (0.00s)
    --- PASS: TestClassifierRoutesEachStoreByItsOwnIndex/empty_store (0.00s)
    --- PASS: TestClassifierRoutesEachStoreByItsOwnIndex/unreadable_index_is_refused,_never_guessed (0.00s)
=== RUN   TestCleanCacheSweepsTheImageStoreWithItsOwnReader
--- PASS: TestCleanCacheSweepsTheImageStoreWithItsOwnReader (0.00s)
=== RUN   TestCleanCacheLookupResolvesToExistingContent
--- PASS: TestCleanCacheLookupResolvesToExistingContent (0.00s)
=== RUN   TestCleanCacheRefusesAStoreItCannotClassify
--- PASS: TestCleanCacheRefusesAStoreItCannotClassify (0.00s)
PASS
ok  	github.com/opencharly/plugin-clean/candy/plugin-clean	0.006s

The re-capture of the FIXED line on this host — charly clean --cache --dry-run printing
cache registry (storekit): …, with the reader named (candy/plugin-clean/command.go:216 at the
tag) — is owed to the pin wave that rebuilds charly with plugin-clean v2026.322.1315; it cannot be
taken from this checkout, for the reason measured above.

Coverage that fails without the change

Two mutations, each applied to this head and reverted; the tree is green again afterwards. Arm 1
disables the store write, which must kill the live arm. Arm 2 removes the naming annotation, which
must kill both the naming test and the store-ingest test — an unannotated export is exactly what
Add refuses, so a build that named nothing would have to fail.

### mutation arm 1 — the build stops writing to the store
$ git diff --stat
 candy/plugin-build/buildkit.go | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

$ CHARLY_CACHE_DIR=/tmp/cs/mut-arm1 go test -count=1 -run TestImageStore_AnnotationNamesTheImport_AndItsAbsenceDoesNot .

--- Building w36named ---
--- FAIL: TestImageStore_AnnotationNamesTheImport_AndItsAbsenceDoesNot (0.58s)
    imagestore_live_test.go:85: the charly image store has no entry for localhost/w36-named-live:2026.296.1200 (ok=false, digest="", err=<nil>)
FAIL
FAIL	github.com/opencharly/plugin-build/candy/plugin-build	0.590s
FAIL
exit=1

(mutation 1 reverted; tree clean: yes)

### mutation arm 2 — the export stops carrying the naming annotation
$ git diff --stat
 candy/plugin-build/imagestore.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

$ go test -count=1 -run "TestAnnotateExport|TestBuildExportLandsInTheRegistryStoreKeyedByDigest" .
--- FAIL: TestAnnotateExportNamesWithTheFullReferenceAndDatesIt (0.00s)
    imagestore_test.go:141: io.containerd.image.name = "", want "ghcr.io/opencharly/fedora:2026.296.1200"
--- FAIL: TestBuildExportLandsInTheRegistryStoreKeyedByDigest (0.00s)
    imagestore_test.go:178: the store refused the build's own export: the OCI archive /home/atrawog/.cache/go-tmp/TestBuildExportLandsInTheRegistryStoreKeyedByDigest2078953487/002/export.tar carries no io.containerd.image.name annotation on manifest 0: an archive without it lands unaddressable
FAIL
FAIL	github.com/opencharly/plugin-build/candy/plugin-build	0.014s
FAIL
exit=1

(mutation 2 reverted; tree clean: yes)
$ go build ./... && go test -count=1 ./...   # restored tree is green again
ok  	github.com/opencharly/plugin-build/candy/plugin-build	3.922s
?   	github.com/opencharly/plugin-build/candy/plugin-build/cmd/serve	[no test files]
exit=0

Rulebook compliance

R0 — skills first. Loaded before the first repository action, in this order:
/charly-build:build, /charly-build:generate, /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 /charly-core:clean and /charly-internals:go-quality (the
rows this change's own gates select) and this repo's AGENTS.md.

R1 — RCA every anomaly, then fix it or file it. Three anomalies, each root-caused before
remediation. (a) golangci-lint reported errcheck at registry.go:95 — pre-existing, but it
reddened this change's lint gate, which R1 makes blocking, so it is fixed here with the explicit
_ = close the codebase already uses. (b) This leg's first relocation assertion encoded the OLD
store's descriptor model and failed against storekit's entry model; the reader was corrected against
storekit's Entry, and the assertion now states the real chain. (c) The live arm's charly clean --cache surfaced real data loss plus a .lock in a store tree; root-caused to
spec/cache's lock path and its image-blind reachability walk reached through
gcCacheStores' sameStoreRoot shortcut, and filed as opencharly/plugin-clean#27. No
"pre-existing", "out of scope" or "follow-up" classification without an issue number.

R2 — no duplication. The store existed twice the moment storekit gained it; this change deletes
this repo's copy in the same cutover, so one implementation survives. The two things kept are not a
second copy of anything: the export's naming, which Add does not perform (it refuses an unnamed
archive), and the Containerfile stage-reference reader, which no other repo has. storeIndex /
storeManifest became ociIndex / ociManifest because they now model the EXPORT's documents, not
the store's — storekit's archive reader is unexported, so reading an export's index here is not a
second implementation of a published surface.

R3 — no workaround. No sleep, retry, fallback or magic number is added; the deleted lock is not
replaced by a local one, and the store's directory is never composed — it comes from the resolver.
The CHARLY_IMAGE_STORE_DIR override is deleted rather than kept as a second lever, which is the
workaround D-STORE-1 forbids.

R4 — product before prose. The code was reduced first; the two prose claims naming the retired
path (README.md, the plugin-build: candy description in candy/plugin-build/charly.yml) were
then swept to it, and one stale comment in buildkit_live_test.go with them.

R5 — hard cutover, one phase. Every deprecated path and every reference to a deleted identifier
goes in this commit. The claim-keyed grep, pasted above, returns 0 outside CHANGELOG/. Deleted
identifiers: imageStoreDir, imageStoreDirEnv (CHARLY_IMAGE_STORE_DIR), imageStoreLockName,
imageStoreLayoutMarker, storeAdd, storeLookup, copyBlobsIntoStore, storeLockPath,
ensureLayout, readStoreIndex, storeIndexPath, writeFileAtomic, copyFileAtomic, the three
local annotation constants (now storekit.Annotation*), and imageStoreID → ociLayoutID.

R6 — preserve user work and Git safety. git status was read before every mutation and before
the commit; nothing is force-pushed, no hook bypassed, no push to main. The sibling worktrees
(spec, sdk, plugin-clean) were READ ONLY and each still reports 0 modified paths.

R7 — prove behaviour, not compilation. Both mutation arms above fail without the change and
pass with it, and the changed path executed live — a real BuildKit build, a real engine import, the
store write read back through the store's own API. The emitted artefact (the store tree, its
index.json, the entry, the payload chain) was validated at its boundary, not inferred.

R8 — live or skip. The live boundary ran against the real services (BuildKit, podman) and is
never mocked; liveTools skips visibly, naming the missing tool, when the toolchain is absent.

R9 — binary equals source. No binary is built by this repo: the plugin is compiled INTO charly
by that repo's build, so "the deployed binary matches the source" is owed by the charly leg that
pins this PR. What is proven here is that the module compiles and tests from THIS worktree
(go build, go test on the head above).

R10 — fresh disposable proof. The gates above are on the committed head, with zero warnings. The
change-class bed for a plugin-library change is the assembled bed that composes the plugin — and the
plugin reaches a bed only through charly's compiled-in copy, i.e. through charly's pin of this
repo, which does not exist yet. That bed is therefore not run and cannot be run from here; the
changed path was instead executed live directly, which is why the tier below is
analysed on a live system and not fully tested and validated. The bed is owed by the charly leg
that bumps the pin.

CONC — concurrency. This change DELETES the concurrent-write surface: the index read-modify-write
and its cross-process lock leave this repo, and the surviving writer is storekit's, whose index lock
lives in the runtime root and whose concurrency is proven under load in the add —
TestConcurrentImageStoreAddsKeepEveryReference, TestConcurrentPutEntryOfDistinctKeysKeepsEveryEntry,
TestConcurrentPutEntryOfTheSameKeySucceeds, TestConcurrentPutBlobOfTheSameBytesSucceeds, run with
-race in the sdk leg (go test -race -run Concurr ./storekit/ → ok). No forbidden framing: no
sleep, no retry, no serialization hiding a race.

DESIGN.md rows. D-STORE-1 (:2482) — one cache root, one override, addressed through the
resolver. D-STORE-3 (:2484) — the store tree is the layout and nothing else; the build's tree is
verified to hold exactly oci-layout, index.json and blobs/, and the store's locks are storekit's
in the runtime root. D-STORE-5 (:2486) — the mutable reference resolves to a digest before it
reaches the store, and the entry is keyed by that digest. D-STORE-7 (:2488) — the store is
discoverable by name, so charly clean --cache sees it (and the sweep's own correctness is
opencharly/plugin-clean#27). D-STORE-10 (:2491) — the built image IS an entry of the store the
registry view serves, never a second copy. Section 25, "Code rules and enforcement" (:2642; its
rows are :2646–:2650) — D-CODE-2 (a replaced mechanism is deleted in the change that replaces
it) and D-CODE-3 (extract on second occurrence) are what this diff enacts; D-CODE-4 (comments
describe present code) drove the three prose/comment fixes.

Change classification

Plugin-library change: Go plugin source, no schema, no image, no bed definition. build:box,
build:generate and build:ensure keep their inputs, replies and plan steps.

Breaking change + rollback: the retired CHARLY_IMAGE_STORE_DIR no longer relocates anything and
the pre-change $XDG_DATA_HOME/charly/images tree is not migrated, so an image built before this
change is no longer found by the drive — it is rebuilt on next use, and a host that relied on the
override now relocates only through CHARLY_CACHE_DIR. Rollback is reverting this commit: the old
layout was never deleted, so those images are still on disk at their original path and resolve again
once the previous code returns.

Landing order. Producer-first is satisfied on both legs: opencharly/sdk#556 is merged and tagged,
so the store this PR calls exists at its new home, and opencharly/plugin-clean#27's misrouting is
fixed at v2026.322.1315 — the sweep now routes this store to the reader that can read it. Nothing
further gates this leg.

Filed issues

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

The image store's OCI layout, index rewrite, streamed blob copy and index lock
now live in sdk/storekit, where the image resolver reads the same entries
(opencharly/sdk#556, v0.2026322.1227); this repo keeps only what a build owns —
choosing the reference, and naming the export that crosses the engine
boundary — and calls the shared store (opencharly/sdk#460, step 3).

Deleted here: imageStoreDir() and its hand-resolved $XDG_DATA_HOME, the
oci-layout marker writer, the index.json rewrite, the blob copy, the
store-index lock, and CHARLY_IMAGE_STORE_DIR. The store is the `registry` named
store under the cache root, resolved by storekit.StoreDir: D-STORE-1 blesses
exactly one relocation lever (CHARLY_CACHE_DIR). Reads and writes go through
storekit.OpenImageStore (Lookup/Dir/Add).

Requires github.com/opencharly/sdk v0.2026322.1227, with no replace.

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

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 1bd3bebb66e552314ad1f164adaa390ca76ecc4d (branch: feat/store-writes-to-registry)

Change class: code/config — Go plugin library (plugin-build), plus doc/comment sweeps and a dependency bump. Not docs-only.
Security screen: PASS — no secrets/exfiltration, no new network egress, no guardrail weakened; the dependency bump is the declared sdk/spec pair with no replace.
Comments: thread is empty (0) — nothing to disposition.

Blocks

  1. R1 / CONC — a data-loss defect this change introduces is filed as non-blocking instead of fixed. The store write moves from $XDG_DATA_HOME/charly/images (a data root the GC does not sweep) to <cache root>/registry (the cache root the image-blind charly clean --cache does sweep). The body's own pasted probe demonstrates the deletion:

    cache registry: 3 live entry(ies); would remove 10 unreferenced blob(s) (3.5 MiB)
    

    and the body itself states the surviving entry then answers Lookup → (digest, true) for bytes that are gone. That is a real, surfaced WARNING in the pasted evidence, and this change introduces it (before this PR the store lived outside the cache root and was not swept). R1 requires a real fix for a blocking finding — "fix it or file it" covers only a genuinely NON-blocking finding, and "this change introduces it" makes it blocking, so the ## Filed issues entry (clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide plugin-clean#27) mislabels a blocking finding (CONC: "a blocking finding mislabelled non-blocking is a BLOCK"). Fix in-tree by landing the image-aware GC so the reachability walk no longer deletes the store's entry manifests, image manifests, configs and layers; or obtain an explicit sign-off from a maintainer account (AI_REVIEW_MAINTAINER) accepting the data-loss risk. The body's "the operator's call … is recorded here rather than assumed" is not such a sign-off — there is no maintainer-posted comment and the call's outcome is never stated.

  2. COORD — no WAITING/HOLDING comment for the chore(deps): adopt sdk v0.2026286.849 so the plugin compiles against the moved seam #27 landing-order dependency. The body records that landing this before clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide plugin-clean#27 is fixed is an open operator decision (a blocking dependency), but the thread carries 0 comments and thus no WAITING/HOLDING comment naming both sides, which the rulebook requires on both threads.

Verdict: BLOCK


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

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

WAITING — this PR is held by opencharly/plugin-clean#27 (and by the operator's decision on it); it does not land until that issue's fix exists.

Both threads now carry the pair, as the COORD finding requires: this comment names the blocked side here, and opencharly/plugin-clean#27 carries the matching WAITING naming #59 as its consumer.

Why it is filed rather than fixed in this diff. The mechanism is not in this repo: gcCacheStores (plugin-clean) routes a cache-rooted store through spec/cache's Layout.GCStats when sameStoreRoot() sees the two roots coincide, and that walk has no image graph. This PR is plugin-build, whose only writer-side action is storekit.ImageStore.Add; nothing it can do inside its own tree makes a spec/cache GC retain the manifest, config and layer an image entry reaches. Landing an image-aware GC here is not possible, so the finding cannot be fixed in-tree.

What I can state as measured, not assumed (scratch cache root, head 1bd3bebb6):

$ CHARLY_CACHE_DIR=/tmp/cs/wipe-test charly clean --cache
cache registry: 1 live entry(ies); removed 4 unreferenced blob(s) (3.5 MiB)
BLOBS AFTER: 1            # was 5
$ storekit lookups
  Lookup("localhost/w36-named-live:2026.296.1200") = (sha256:244ba695…c81b9e32, true, <nil>)

The entry survives and still answers; its manifest, config and layer do not. --dry-run reports the same deletion as its plan, so it does not warn.

The decision this needs is not mine to take. Two dispositions clear the block, and both belong to the operator: (a) opencharly/plugin-clean#27 is fixed first, and this PR follows it; or (b) a maintainer explicitly accepts the risk for this landing on this thread. I have not pushed anything in response to the BLOCK, because a re-run before one of those exists would only spend a round.

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

@aitrawog

Copy link
Copy Markdown
Contributor Author

Body corrected for the BLOCK. Head unchanged at 1bd3bebb66e552314ad1f164adaa390ca76ecc4d — nothing in the tree moved, so every pasted gate block, the head sha and the diffstat (10 files, +335 −489) still describe the same bytes the evidence was produced on. This is a body-only edit; the required gate is re-run on this same head by REST re-run (no new SHA, no force, no re-dispatch).

What changed, and against what.

  1. R1/CONC — accepted, and now fixed rather than filed. The reviewer was right: landing the writer while the sweep destroys what it writes is blocking, not a filed-and-separate finding. clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide plugin-clean#27 is fixed upstream in v2026.322.1315 = 6bb823b02783289204266d75e65a42823a40b502, and the body now says so instead of listing it as outstanding. I verified the fix from the tag's own tree rather than from its title: candy/plugin-clean/store_sweep_test.go at that tag defines imageStoreTree() and, in TestCleanCacheSweepsTheImageStoreWithItsOwnReader, asserts on a REAL sweep at the COINCIDENT roots (coincidentRootImageStore sets CHARLY_CACHE_DIR) that the store routes to storekit, that zero blobs are removed, that every blob still reads back, and that the immediate entries are exactly {blobs, index.json, oci-layout} — so a .lock fails the test. Running those assertions here at the tag: TestClassifierRoutesEachStoreByItsOwnIndex, TestCleanCacheSweepsTheImageStoreWithItsOwnReader, TestCleanCacheLookupResolvesToExistingContent, TestCleanCacheRefusesAStoreItCannotClassify — all PASS.

  2. COORD — the pair is posted. WAITING on clean --cache deletes the image store's manifests, configs and layers when CHARLY_CACHE_DIR makes the two store roots coincide plugin-clean#27 naming feat(build)!: write built images to storekit's registry store #59 as its consumer, and the matching WAITING on this thread. Both name both sides.

  3. One block is deliberately NOT re-captured, and it is labelled as such. The sweep line pasted in ## How tested is the DEFECT's measurement, captured with this host's charly 2026.321.2122, which predates the fix and compiles clean in. I tried to take the FIXED line (cache registry (storekit): …) here and could not: pointing CHARLY_PLUGIN_DIR at a v2026.322.1315 build of candy/plugin-clean still produced the old line, because the compiled-in copy is what dispatches. Re-taking it needs charly rebuilt with the new plugin-clean pin — the pin wave, one step away. So the body keeps the old binary's line as the defect's evidence, and proves the fixed behaviour from the tag's own assertions rather than from a stale capture dressed up as current.

No cross-repo Closes keyword: this PR does not resolve opencharly/plugin-clean#27, plugin-clean's merge did. opencharly/marketplace#622 stays listed as outstanding and unrelated.

Tier unchanged: (analysed on a live system); R10's assembled bed is still declared NOT passed (it can only reach this plugin through charly's pin).

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

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 1bd3bebb66e552314ad1f164adaa390ca76ecc4d (branch: feat/store-writes-to-registry)

Security screen: PASS — no secrets/exfiltration, no new network egress, no guardrail weakened; the sdk/spec bump is the declared pair with no replace.

Checklist: All applicable rules PASS or NA. The store relocation is outward (candy → sdk/storekit), the deleted surface is swept in-commit (grep → 0 outside CHANGELOG/), the export-naming half that Add cannot do is correctly retained, and the diff is internally consistent with the body's +335/−489 accounting across all 10 files.

Comments considered:

  • 6978685763 (@github-actions[bot], prior BLOCK) — stale-superseded/resolved: its R1/CONC data-loss finding is addressed by the landed plugin-clean v2026.322.1315 fix (verified via the tag's pasted TestClassifierRoutesEachStoreByItsOwnIndex / TestCleanCacheSweepsTheImageStoreWithItsOwnReader output), and its COORD finding is addressed by the posted WAITING. Re-derived against the current body: the store now routes by identity before the charly pin wave that also bumps plugin-clean, so the swept-store defect cannot occur on a deployed charly. (Tool-limited: I cannot re-run plugin-clean; the pasted evidence is internally coherent.)
  • 6978794717 (@aitrawog) — valid WAITING coordination, names both sides, maintainer account.
  • 6979810652 (@aitrawog) — maintainer body-correction; R1/CONC fixed upstream, tier honestly held at analysed on a live system (assembled bed genuinely owed by the charly pin leg), direct fixed-line capture correctly labelled as owed rather than fabricated.

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:24
@github-actions
github-actions Bot merged commit 09de5ec 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