Skip to content

feat(storekit): move the charly image store into storekit as the registry store's entries - #556

Merged
github-actions[bot] merged 6 commits into
mainfrom
feat/storekit-image-store
Nov 18, 2026
Merged

github-actions[bot] merged 6 commits into
mainfrom
feat/storekit-image-store

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

W3.6's charly image store — the oci-layout marker, ONE index.json, blobs/<alg>/<digest>, the
atomic index rewrite under a cross-process lock, the streamed blob copies and the
io.containerd.image.name export annotation — lived package-private in
plugin-build/candy/plugin-build/imagestore.go, so deploykit.ImageResolver (#459)
could only reach it through an interface. Steps 1 and 2 of #460 move that layout into
sdk/storekit as the store's own machinery, and deploykit.CharlyImageSource's production
implementation becomes a thin adapter over it.

The store is the registry NAMED store under the ONE cache root. A second OCI layout in a
second root is what the contract forbids, so ImageStoreDir() is StoreDir("registry"):
CHARLY_CACHE_DIR relocates it with every other store, and $XDG_DATA_HOME/charly/images plus its
CHARLY_IMAGE_STORE_DIR override are DELETED rather than carried. The name is not invented —
plugin-clean's retirement record names <cache root>/registry as image content's home (and
<cache root>/images as the RETIRED blob store, so that name is taken), and D-STORE-10 makes the
served registry "a view of store entries", which a built image can only be if it is an entry of
that store.

The keying reading, stated. An artifact is a storekit.Entry whose KEY is the artifact's own
digest, whose Payload is the same digest (its root document), and whose ANNOTATIONS carry the
reference and the build time. The mutable name is resolved to a digest before the write; the
digest is what the index keys on; a reader resolves a name by reading the annotations, newest build
time first. This is reading (a) of the D-STORE-3/D-STORE-5 question — an index is a name→digest map
and moving a name mutates no entry — made true BY CONSTRUCTION, because the store no longer even
holds the name as a key. Rows cited by line and answered individually under ## Rulebook compliance.

A rebuild deletes nothing. A rebuild is a different digest, hence a different key: the store
APPENDS a second entry and the previous artifact stays a first-class entry, addressable by its own
digest. Reclaiming a superseded artifact is D-STORE-7's sweep decision, taken from what Entries()
exposes — key (digest), reference, build time — through DeleteEntry + UnreferencedBlobs +
RemoveBlob; it is never something a build performs.

Two defects the move exposed and fixes, both required by D-STORE-7:

  • the layout marker. No storekit-created store ever wrote oci-layout, so NamedStores() — and
    therefore charly clean --cache — could not see ANY named store. indexEntry now publishes it,
    because a store that has published an index IS an OCI image layout.
  • an artifact's graph. Reachability marked an entry's payload and nothing behind it, so a sweep
    would keep an image's manifest and delete the config and layers it names. ReachableBlobs now
    walks the artifact graph — ONE walk, shared with Archive — so what a live entry reaches stays
    live.

Add also refuses an export that names a different reference than the one it is added as, and the
stored payload carries no name and no timestamp (D-STORE-6): the export annotation is re-applied by
Archive, the one surface that crosses the engine boundary.

Head c4b297f0161be14db53f34a7ac7ee38a5a82d339 (13 files changed, 1924 insertions(+), 35 deletions(-)).

The head moved by one merge commit after the evidence below was gathered, and that merge is a NO-OP
for every file this PR changes.
gh pr update-branch — the sanctioned remedy for a BEHIND branch —
merged main in, creating c4b297f on top of 911875b. Read the two commits against each other:

$ git diff --stat 911875b c4b297f
 CHANGELOG/0.2026322.1140.md           | 121 ++++++++++++++++++++++++++++++++++
 loaderkit/node_validate.go            |  27 ++++++++-
 loaderkit/parse_doc_stream.go         |  12 +++++
 loaderkit/step_typing_on_load_test.go |  39 +++++++++++++
 4 files changed, 197 insertions(+), 2 deletions(-)

$ git diff --stat 911875b c4b297f -- storekit deploykit go.mod go.sum
(no output)

Four files changed by the merge, and none of them is this PR's: storekit/, deploykit/, go.mod
and go.sum are BYTE-IDENTICAL across it.

The head-sensitive gates were RE-RUN at c4b297f rather than carried across the merge:

$ gofmt -l .
(no output — clean)

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go build ./...   ; echo "rc=$?"
rc=0

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go vet ./...     ; echo "rc=$?"
rc=0

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go test ./... -count=1 | tail -2
ok  	github.com/opencharly/sdk/vmshared	0.136s
ok  	github.com/opencharly/sdk/workflowkit	0.010s
(rc=0 — every package ok)

$ GOWORK=off GOTOOLCHAIN=go1.26.8 golangci-lint run ./...
0 issues.

$ git diff --shortstat $(git merge-base origin/main HEAD)..HEAD
 13 files changed, 1924 insertions(+), 35 deletions(-)

The property/mutation arms and the live-engine arms further down were gathered at 911875b; their
proof above is that the four files they touch are byte-identical at c4b297f, and the go, lint
and four cross-compile checks are green on c4b297f itself.

Closes opencharly/sdk#458 (the sdk half of the data root it asked for is now moot: the root was
reverted in opencharly/spec#375, and this change asks for no data root at all) and Refs opencharly/sdk#460 — steps 1 and 2 only; step 3 stays a plugin-build change.

How tested

The repo's authoritative gate is .github/workflows/ci.yml, DISCOVERED from
repos/opencharly/sdk/contents/.github/workflows rather than assumed — the object id upstream
serves equals this worktree's copy:

# run at the current head, c4b297f
$ gh api repos/opencharly/sdk/contents/.github/workflows --jq '.[].name'
ci.yml
tag-on-merge.yml
$ gh api repos/opencharly/sdk/contents/.github/workflows --jq '.[].sha'
604f1749d995588ff0f1859f7c38ac88dbf9301e
dcc58121e6be3286bb0d3fd114c6ba2d004fea07
$ git hash-object .github/workflows/ci.yml
604f1749d995588ff0f1859f7c38ac88dbf9301e
$ git rev-parse HEAD
c4b297f0161be14db53f34a7ac7ee38a5a82d339
$ git diff --shortstat $(git merge-base origin/main HEAD)..HEAD
 13 files changed, 1924 insertions(+), 35 deletions(-)

The tree carries no replace and resolves the RELEASED module (the require stays at the current
tag: the root removal is opencharly/spec#375, in CI, and this change does not ask for that root, so
it compiles and conforms either way):

$ grep -n 'replace' go.mod; echo "no-replace exit=$?"
no-replace exit=1
$ go list -m -f '{{.Path}} {{.Version}}' github.com/opencharly/spec
github.com/opencharly/spec v0.2026322.1111

GOWORK=off go build ./... — exit 0, no output:

$ GOWORK=off GOTOOLCHAIN=go1.26.8 GOTMPDIR=$HOME/.cache/go-tmp TMPDIR=/tmp/cs go build ./...; echo "exit=$?"
exit=0

GOWORK=off go test ./... -count=1 — exit 0, uncached:

$ GOWORK=off GOTOOLCHAIN=go1.26.8 GOTMPDIR=$HOME/.cache/go-tmp TMPDIR=/tmp/cs go test ./... -count=1; echo "exit=$?"
ok  	github.com/opencharly/sdk	0.146s
ok  	github.com/opencharly/sdk/agentkit	1.151s
ok  	github.com/opencharly/sdk/artifactkit	0.014s
ok  	github.com/opencharly/sdk/auditkit	0.107s
ok  	github.com/opencharly/sdk/buildcache	0.764s
ok  	github.com/opencharly/sdk/buildkit	0.011s
ok  	github.com/opencharly/sdk/buildkitdrive	0.010s
ok  	github.com/opencharly/sdk/candywalk	0.013s
ok  	github.com/opencharly/sdk/charlylib	0.010s
ok  	github.com/opencharly/sdk/checkkit	0.005s
ok  	github.com/opencharly/sdk/cmd/charly-lib-gen	0.002s
ok  	github.com/opencharly/sdk/deploykit	6.755s
ok  	github.com/opencharly/sdk/enginekit	0.005s
?   	github.com/opencharly/sdk/internal/spectest	[no test files]
ok  	github.com/opencharly/sdk/kit	12.943s
ok  	github.com/opencharly/sdk/llmkit	2.367s
ok  	github.com/opencharly/sdk/loaderkit	1.000s
ok  	github.com/opencharly/sdk/packagekit	0.025s
ok  	github.com/opencharly/sdk/rawbody	0.006s
ok  	github.com/opencharly/sdk/storekit	1.128s
ok  	github.com/opencharly/sdk/vmshared	0.124s
ok  	github.com/opencharly/sdk/workflowkit	0.006s
exit=0

gofmt -l . empty, golangci-lint run ./... at the CI pin v2.13.2 under the toolchain go.mod
declares, go vet ./... clean, and the cross-compile matrix:

$ test -z "$(gofmt -l .)"; echo "exit=$?"
exit=0
$ golangci-lint run ./...; echo "exit=$?"
0 issues.
exit=0
$ go vet ./...; echo "exit=$?"
exit=0
$ for arch in amd64 arm64 arm 386; do GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build ./... && echo "linux/$arch ok"; done
linux/amd64 ok
linux/arm64 ok
linux/arm ok
linux/386 ok

The annotation control is a LIVE arm, not a mock — one image exported twice (named vs the
tag-only control) and loaded into the real engines on this host; the one arm that would mutate a
shared system daemon skips visibly:

$ go test ./deploykit/ -run 'TestImageStoreLiveAnnotationControl|TestIsUnsupportedOCILayout|TestImageStoreLiveRootfulIdentity' -count=1 -v
=== RUN   TestImageStoreLiveAnnotationControl
=== RUN   TestImageStoreLiveAnnotationControl/podman
=== RUN   TestImageStoreLiveAnnotationControl/docker
=== RUN   TestImageStoreLiveAnnotationControl/containerd-rootless
--- PASS: TestImageStoreLiveAnnotationControl (1.79s)
    --- PASS: TestImageStoreLiveAnnotationControl/podman (0.69s)
    --- PASS: TestImageStoreLiveAnnotationControl/docker (0.32s)
    --- PASS: TestImageStoreLiveAnnotationControl/containerd-rootless (0.40s)
=== RUN   TestIsUnsupportedOCILayout
--- PASS: TestIsUnsupportedOCILayout (0.00s)
=== RUN   TestImageStoreLiveRootfulIdentity
    image_store_live_test.go:412: rootful import arm SKIPPED: the system daemon is a shared, non-disposable store (R6); set W37_LIVE_ROOTFUL_IMPORT=1 to prove the mutating leg
    image_store_live_test.go:425: system socket unchanged: same file=true mtime=2026-11-18T10:13:05Z
--- PASS: TestImageStoreLiveRootfulIdentity (0.10s)
PASS
ok  	github.com/opencharly/sdk/deploykit	1.896s

The five properties the ruling turns on, each a test, uncached:

$ go test ./storekit/ -run 'TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable|TestImageStoreSupersededArtifactIsTheSweepsDecision|TestImageStoreLiveArtifactKeepsItsWholeGraphReachable|TestImageStoreIsDiscoveredByNamedStores|TestImageStoreIsKeyedByTheArtifactDigestAndAnnotatedWithTheReference' -count=1 -v
=== RUN   TestImageStoreIsKeyedByTheArtifactDigestAndAnnotatedWithTheReference
--- PASS: TestImageStoreIsKeyedByTheArtifactDigestAndAnnotatedWithTheReference (0.00s)
=== RUN   TestImageStoreIsDiscoveredByNamedStores
--- PASS: TestImageStoreIsDiscoveredByNamedStores (0.00s)
=== RUN   TestImageStoreLiveArtifactKeepsItsWholeGraphReachable
--- PASS: TestImageStoreLiveArtifactKeepsItsWholeGraphReachable (0.00s)
=== RUN   TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable
--- PASS: TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable (0.01s)
=== RUN   TestImageStoreSupersededArtifactIsTheSweepsDecision
--- PASS: TestImageStoreSupersededArtifactIsTheSweepsDecision (0.01s)
PASS
ok  	github.com/opencharly/sdk/storekit	0.033s

Mutation proof on THIS head — the identity arm first, because that is the behaviour the block
turned on.

Arm 1: the entry keyed by the REFERENCE again (Key: payloadDigest becomes Key: ref), which is
the replaced-instead-of-appended behaviour:

$ sed -i 's/Key:         payloadDigest,/Key:         ref,/' storekit/images.go
$ grep -n "Key:         ref," storekit/images.go
--- FAIL: TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable (0.01s)
$ go test ./storekit/ -run 'TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable' -count=1; echo "exit=$?"
    images_test.go:347: entry "ghcr.io/opencharly/fedora:2026.296.1200" names payload "sha256:6cec515cef445d11f64c62c6f2e68b8c0516ceaf6c7d6a0d81544aa26bfc5fe4" — an artifact entry is keyed by its own digest
    images_test.go:351: 1 distinct entr(ies) name "ghcr.io/opencharly/fedora:2026.296.1200", want 2 — a rebuild APPENDS, it does not replace
FAIL
FAIL	github.com/opencharly/sdk/storekit	0.011s
FAIL
$ cp /tmp/cs/h-images.go storekit/images.go
$ git diff --quiet -- storekit/images.go && echo restored
restored
$ go test ./storekit/ -run 'TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable' -count=1; echo "exit=$?"
ok  	github.com/opencharly/sdk/storekit	0.011s
exit=0

Arm 2: the sweep stops walking a live artifact's graph:

$ sed -i 's/if isImageMediaType(e.MediaType) {/if false \&\& isImageMediaType(e.MediaType) {/' storekit/gc.go
$ grep -n "false && isImageMediaType" storekit/gc.go
--- FAIL: TestImageStoreLiveArtifactKeepsItsWholeGraphReachable (0.01s)
$ go test ./storekit/ -run 'TestImageStoreLiveArtifactKeepsItsWholeGraphReachable' -count=1; echo "exit=$?"
    images_test.go:307: the sweep would reclaim 3 blob(s) of a LIVE image: map[sha256:89295faa7dbc3c154108f6e2ed977684703233b4e0bda924810d36444655201a:true sha256:9d99a75171aea000c711b34c0e5e3f28d3d537dd99d110eafbfbc2bd8e52c2bf:true sha256:fc43db4a4b8bef861ef912ca7795ae0d8b39630dcf4f964f51892e42ff7c6c67:true]
FAIL
FAIL	github.com/opencharly/sdk/storekit	0.007s
FAIL

Arm 3: the store stops publishing the layout marker:

$ sed -i 's/if err := s.EnsureLayout(); err != nil {/if err := error(nil); err != nil {/' storekit/entry.go
$ grep -n "error(nil)" storekit/entry.go
--- FAIL: TestImageStoreIsDiscoveredByNamedStores (0.01s)
$ go test ./storekit/ -run 'TestImageStoreIsDiscoveredByNamedStores' -count=1; echo "exit=$?"
    images_test.go:288: NamedStores() = [], want ["registry"] — a store the sweep cannot see is never swept
FAIL
FAIL	github.com/opencharly/sdk/storekit	0.007s
FAIL

Arm 4: the payload keeps the export's name and timestamp (D-STORE-6):

$ sed -i 's/case AnnotationImageName, AnnotationRefName, AnnotationCreated:/case "":/' storekit/images.go
$ grep -n 'case "":' storekit/images.go
--- FAIL: TestImageStoreIsKeyedByTheArtifactDigestAndAnnotatedWithTheReference (0.01s)
$ go test ./storekit/ -run 'TestImageStoreIsKeyedByTheArtifactDigestAndAnnotatedWithTheReference' -count=1; echo "exit=$?"
    images_test.go:251: the stored payload carries the "io.containerd.image.name" annotation; a payload holds no name and no timestamp
    images_test.go:251: the stored payload carries the "org.opencontainers.image.ref.name" annotation; a payload holds no name and no timestamp
FAIL
FAIL	github.com/opencharly/sdk/storekit	0.007s
FAIL

Every arm was restored to HEAD (git diff --quiet empty) and the arm re-run green.

Rulebook compliance

  • R0 — the skills the dispatcher selects were loaded before the first tool call (go, plugin, git-workflow, strict-policy, root-cause-analyzer, cutover-policy, check), plus this repo's AGENTS.md in the worktree — and, from the Lead's instruction on the previous head, DESIGN.md §20/§14 read in full rather than grepped.
  • R1 — every anomaly had an RCA before remediation. The block on the previous head was a PARKED finding: a stated contract divergence with no issue and no fix. It is now FIXED in tree (the keying and append-only model) and the one genuinely external consequence is filed (below). The gocyclo 36 > 30 finding my own test split introduced was fixed in the same head by separating the two properties into two tests, not by raising the threshold. No finding is left unfiled or unfixed.
  • R2 — one implementation per behaviour: the layout, the atomic write, the index path, the digest path, the entry model, the image graph walk and the export annotation each exist once, in storekit; the artifact graph is walked by ONE function used by both reachability and Archive; deploykit's package-private imageNameAnnotation is deleted in this change.
  • R3 — no workaround: the index rewrite takes the store's existing cross-process file lock, the blob copy streams, there is no retry, no sleep and no fallback, and both second-location levers ($XDG_DATA_HOME resolution, CHARLY_IMAGE_STORE_DIR) are DELETED rather than tolerated.
  • R4 — product before prose: the doc comments state the shipped shape — the store's name and root, the entry model, the append-only rule and the sweep surfaces — and every stale claim from the earlier heads ("under the DATA root", "the named charly store", the WORKAROUND (opencharly/sdk#458) note) is gone, verified by the R5 sweep below.
  • R5 — the retired identifiers and claims are swept, with the control that the predicate matches a known positive in the same tree:
$ git grep -n --untracked -c "AnnotationImageName" -- 'storekit/images.go'; echo "calibration exit=$?"
storekit/images.go:9
calibration exit=0
$ git grep -n --untracked -E "CHARLY_IMAGE_STORE_DIR|storeroot\.RootData|storekit\.RootData|storekit\.DataDir|XDG_DATA_HOME" -- '*.go' ':!*_test.go'; echo "storage-root hits exit=$?"
storage-root hits exit=1
$ git grep -n --untracked -E "\bRootData\b" -- '*.go' ':!*_test.go'; echo "every-RootData exit=$?"
loaderkit/load_via_executor.go:71:	reqJSON, err := json.Marshal(spec.LoaderWalkRequest{Dir: dir, RootData: rootData})
every-RootData exit=0
$ git grep -n --untracked "imageNameAnnotation" -- .; echo "retired-const exit=$?"
retired-const exit=1

The ONE surviving RootData in the tree is spec.LoaderWalkRequest's materialized-root field —
a different shape in a different package, not the storage root — and it is shown rather than
filtered away. The CHARLY_IMAGE_STORE_DIR strings that remain are in the test that proves the
retired lever is INERT: a positive assertion, not a surviving path.

  • R6 — git status --short was empty before every commit and after every mutation round, each restore proved with git diff --quiet against HEAD; nothing outside this worktree's module was touched, plugin-build was only READ, and history is append-only (no amend, no force-push).
  • R7 — coverage fails without the change (four mutation arms above, the identity one first); the changed path executes live (the engine annotation control against podman, docker and rootless containerd); and the emitted artifact is checked at its boundary — the archive is read back as a TAR and its index.json parsed, the store's index and entries are read from disk, and the sweep is driven through UnreferencedBlobs/RemoveBlob rather than asserted.
  • R8 — live or skip, never fake: the engine arms ran against the real CLIs on this host; the arm that would mutate a shared, non-disposable system daemon SKIPPED visibly with its reason, and no engine was mocked.
  • R9 — no charly binary is built or deployed by this change (a Go library in a submodule worktree), and no runtime OS dependency is added.
  • R10 — the gate that owns this change class is this repo's ci.yml, and all of its steps ran on the committed head with exit 0 (gofmt, vet, golangci-lint v2.13.2, test, four-arch cross-compile), as pasted above. This repo carries no disposable bed; the consumer-side beds belong to the legs that adopt this store.
  • CONC — concurrency is proven, not asserted: TestConcurrentImageStoreAddsKeepEveryReference runs eight concurrent Adds through the store's lock and requires every reference to survive, and the store's own concurrency tests (TestConcurrentPutBlob…, TestConcurrentPutEntryOfDistinctKeys…) cover the primitives; no sleep, no retry, no serialization that hides a race.
  • HC — one coherent scope. The plugin-build reduction is step 3 in another repository and lands after this replacement merges (add-before-delete); the content exists in a repository at every commit.

DESIGN.md, cited by line, and how the code conforms:

  • DESIGN.md:2482 D-STORE-1 — the roots, resolved by ONE resolver, four of them, with CHARLY_CACHE_DIR the single override. CONFORMS: the store is StoreDir("registry"); no caller composes a path; the data root and its override are gone, and storekit.RootData/DataDir are not re-exported (revert(storeroot)!: remove the data root — D-STORE-1 defines four roots spec#375 reverts the root in the contract).
  • DESIGN.md:2484 D-STORE-3 — one store, an OCI Image Layout "and nothing else", entries immutable, atomic publication, reads lock-free. CONFORMS: the tree holds oci-layout, index.json and blobs/; the lock lives in the runtime root; the index is written tmp+rename; Lookup/List/Archive take no lock; and entries are keyed by digest, so a rebuild appends rather than replaces.
  • DESIGN.md:2486 D-STORE-5 — "a mutable name resolves to a digest before it reaches the store". CONFORMS: the entry's KEY is the artifact's digest; the reference is an annotation; Lookup resolves name→digest from the annotations, newest build time first, and then asks the store for the DIGEST.
  • DESIGN.md:43 D-LAW-7 / DESIGN.md:1140 D-FORM-2 — an artifact's name is a digest of all its inputs, "never paths, clocks or mutable names". CONFORMS: the store's name for an artifact is its content address; for a reproducible build that address is the function of the start artifact and the IR that D-FORM-2 names, and the store keys on the digest the build produced because it cannot compute the input key before the build.
  • DESIGN.md:2487 D-STORE-6 — payloads carry no timestamps or names; the resolution record lives outside the payload digest. CONFORMS: the stored index.json has its naming/creation annotations stripped, and the reference and build time ride on the ENTRY.
  • DESIGN.md:2488 D-STORE-7 — charly clean keeps what state references and evicts the rest; locks die with their holder. CONFORMS: indexEntry publishes the marker so NamedStores() — and with it charly clean --cache — can see the store; ReachableBlobs walks the artifact graph so a live image keeps its layers; Entries() exposes key, reference and build time for the supersession decision; DeleteEntry + UnreferencedBlobs + RemoveBlob are the deletion path.
  • DESIGN.md:2489 D-STORE-8 — tests use injected roots and write nothing outside a temporary directory. CONFORMS: every test pins CHARLY_CACHE_DIR to t.TempDir(), and the one archive the adapter materialises is removed by its caller, which a test asserts.
  • DESIGN.md:2491 D-STORE-10 — the store is served as an image registry, "a view of store ENTRIES, never a second copy"; a built image reaches a cluster through that view or by delivery into the engine store. CONFORMS: built images are entries of the store the registry reads; Archive → Import is the sanctioned delivery leg, and the registry's view of those entries is a later leg's surface, not a second store created here.
  • DESIGN.md:2512 D-CONC-1 — shared data is content-addressed or lock-guarded; races are fixed at their cause. CONFORMS: blobs are content-addressed, the index RMW is lock-guarded, and the concurrent arm above proves it under load.
  • DESIGN.md:2641 D-CODE-2 / :2642 D-CODE-3 — a replaced mechanism is deleted in the change that replaces it, and a mechanism is extracted on its second occurrence into the module §3 assigns. The extraction is this change; the deletion the row demands is plugin-build's copy, in another repository, which is step 3 of the issue and lands after this replacement merges.

Change classification

Code (Go library: sdk/storekit + sdk/deploykit) — not documentation, so documentation reviewed is not claimed. The tier claimed is fully tested and validated, earned on this head by
the five CI steps, the live engine arms and the four mutation arms above.

Breaking change + rollback: none — this repo's surface only GROWS (storekit.ImageStore,
ImageStoreDir, AnnotationImageName, AnnotationCreated, Store.EnsureLayout;
deploykit.NewCharlyImageSource), and the removals (deploykit.imageNameAnnotation, the earlier
ImageStoreDirEnv/OpenImageStoreDir, the RootData/DataDir re-exports) are either
package-private or never released. Nothing in this repo consumes the new surface yet, and
plugin-build keeps its own copy until step 3, so the rollback is to drop the branch.

Filed issues

Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

W3.6's image store — the `oci-layout` marker, one `index.json`, `blobs/<alg>/<digest>`,
the atomic index rewrite under a cross-process lock, streamed blob copies and the
`io.containerd.image.name` naming contract — lived package-private in
plugin-build/candy/plugin-build/imagestore.go, so the image resolver (#459)
could only reach it through an interface. Two callers need that layout from now on (the
resolver here, the build drive there), so it moves to its natural home: `sdk/storekit`,
the ONE roots/layout mechanism, as the named `charly` store.

- `storekit.ImageStore`: `Lookup`, `List`, `Add` (an exported archive into the store) and
  `Archive`/`WriteArchive` (one stored image as an OCI archive carrying
  `io.containerd.image.name`). It WRAPS `*Store` rather than embedding it: `Store`'s
  `Entries`/`PutEntry` vocabulary is the CACHE store's and would misparse an image index.
- `storekit.ImageStoreDir()` resolves `<data root>/images` through
  `Dir(RootData)` — the contract module's ONE resolver — and honours
  `CHARLY_IMAGE_STORE_DIR`. The `WORKAROUND (#458)` note in the moved code
  is gone, because the data root now exists (opencharly/spec#372) and a second
  `$XDG_DATA_HOME` computation with it.
- `storekit.RootData` re-exports the contract's fifth root beside the four existing
  consts, and the root tests pin it (including that `CHARLY_CACHE_DIR` does not move it).
- The shared `Store`, not a second layout: `EnsureLayout` (the marker a second process
  needs), a STREAMING atomic write the buffered one is now a wrapper over, an `index.json`
  path const, and a stricter digest path — `..` in either half is refused, because an
  archive's member names are data.
- `deploykit`: the production `CharlyImageSource` (`NewCharlyImageSource`) over that
  store, and the resolver now REMOVES the archive it asked for — an archive is as large
  as the image, so a successful resolve must not leave a copy behind.
- `storekit.AnnotationImageName` is the ONE definition of the naming annotation;
  deploykit's package-private copy is deleted (R5 sweep: no hits).

Adopts `github.com/opencharly/spec v0.2026322.1111` — the tag that lands `storeroot.RootData` /
`DataDir()` — as a plain `require`; the tree carries no `replace`.

Steps 1 and 2 of #460. plugin-build is untouched: its reduction is step 3,
which lands only after this replacement is merged (add-before-delete).

Refs: #460
Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: bfd56e47427b9aced5cdac8357ccb7c43b2f0082 (branch: feat/storekit-image-store)

Change class: code/config (Go library — sdk/storekit + sdk/deploykit, plus go.mod/go.sum).

Security screen: PASS (no scope mismatch, no secrets/egress, blob-path and archive-member traversal hardened in blobPath/archiveBlobPath, no guardrail weakened).

Blocks

  1. CONC / R1 — a self-admitted contract divergence is parked without a filed issue. The body states plainly that the relocated store violates the design contract it claims to be judged against:

    • DESIGN.md:2484 D-STORE-3 identity clause: "the row requires entries 'keyed by input digest', and this store's index is keyed by io.containerd.image.name — a <repo>:<tag> — whose descriptor set Add REPLACES on a rebuild." Confirmed in the diff: storekit/images.go namesRef / Add key and replace by AnnotationImageName (a mutable reference), and blobPath is a digest but the index key is the reference.
    • DESIGN.md:43 D-LAW-7 and :1140 D-FORM-2 ("artifact names are digests of all inputs, never … mutable names") and :2486 D-STORE-5 (mutable name must resolve to immutable identity before the store) — all three diverge for the same reason.

    The body disposes of this with the forbidden framings "This is W3.6's shipped shape, moved faithfully — not introduced by this change" and "left for the contract owner to rule on" — a parking phrase with no entry under ## Filed issues. The only filed issue is opencharly/opencharly#1098, which covers the separate D-STORE-1 root-enumeration gap, not the identity/law divergence. Per R1 "fix it or file it" and CONC (b), a divergence surfaced while the cutover is open must be fixed in-tree (blocking) or FILED as a real <repo>#<n> under ## Filed issues (non-blocking). "Not introduced by this change / left for the contract owner" with no filed issue is exactly the forbidden R1 split.

    Fix: either change the index keying so the store satisfies D-LAW-7/D-FORM-2/D-STORE-5 (resolve the reference to an immutable digest before it reaches the store), or file a real issue for the contract ruling — the same way #1098 was filed for the D-STORE-1 gap — and list it under ## Filed issues. Note the inconsistency: the author correctly filed #1098 for one contract question but left the materially more serious identity/law divergence unfiled.

Verdict: BLOCK


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

View action run

…r the cache root

The ruling on #460's conflicts: the CODE conforms to DESIGN.md, not the
prose. Three consequences, in the order the rows force them.

D-STORE-1 / D-STORE-3 / D-STORE-10 — the store moves under the ONE cache root as the
`registry` NAMED store (`storekit.StoreDir`), the store plugin-clean's retirement record
already names as image content's home and the one the registry surface reads: a built
image must BE an entry of that store, or D-STORE-10's "view of store entries" could never
serve it. `$XDG_DATA_HOME/charly/images` and its `CHARLY_IMAGE_STORE_DIR` override are
DELETED — `CHARLY_CACHE_DIR` is the one override that relocates a bed's store — and the
`RootData`/`DataDir` re-exports go with them (opencharly/spec#375 reverts the root).

D-STORE-3 / D-STORE-5 / D-LAW-7 — an artifact is now a `storekit.Entry`: Key is the
reference the caller asked for (the input identity), Payload the artifact's own digest
(the resolution), MediaType what it is. A rebuild replaces the index POINTER and mutates
no entry; the previous artifact stays addressable by digest until the sweep reclaims it,
which is the retention mechanism itself. The stored payload carries no name and no
timestamp (D-STORE-6), and `Archive` re-applies the export annotation — the one surface
that crosses the engine boundary.

D-STORE-7 — the store is sweepable now, which needed two fixes it did not have:

  - `indexEntry` publishes the `oci-layout` marker, so every storekit store is
    discoverable by `NamedStores()` and therefore by `charly clean --cache`. Measured
    before this commit: no storekit-created store carried the marker at all, so no named
    store was reachable by the sweep.
  - `ReachableBlobs` walks an artifact entry's image graph (ONE walk, shared with
    `Archive`), so a live image's config and layers stay reachable. A sweep that marked
    the root alone would keep a manifest and delete the layer it names.

Refs: #460
Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…never replaces

The validator's block on the previous head was the parked disposition, and the ruling
settles the substance: the store must resolve the mutable name to a digest BEFORE it
reaches the index, and a rebuild must leave the previous artifact reachable.

D-STORE-5 / D-LAW-7 — the entry's KEY is now the artifact's own digest; the reference is an
ANNOTATION on the entry (`io.containerd.image.name`) beside the build time, which is
D-STORE-6's one sanctioned home for a resolution time (the payload carries neither the name
nor the timestamp). `Lookup(ref)` answers from the annotations, newest build time first (the
store appends, so index order breaks a tie), so the mutable name never becomes an identity
the store keys on.

D-STORE-3 / "do not delete the old artifact on rebuild" — `Add` no longer replaces anything.
A rebuild is a different digest, hence a different key: the store appends a second entry and
the previous artifact stays a first-class entry, addressable by its own digest. Reclaiming a
superseded artifact is D-STORE-7's sweep decision — made from what `Entries()` exposes (key,
reference, build time) via `DeleteEntry` + `UnreferencedBlobs` — not something a build does.
D-FORM-2's key is the same digest seen from the other side: for a reproducible build the
artifact's content address IS the function of its start artifact and its IR, and this store
keys on the digest the build produced because it cannot compute the input key beforehand and
does not pretend to.

Refs: #460
Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…he rebuild arm

The identity mutation must be killed BY the property the ruling turned on — a rebuild
appends and the old artifact stays addressable by its digest — and not by a downstream
consequence of it. Deriving the two artifact digests from `Entries()` (rather than from
`Lookup`) puts the append assertion first: a `PutEntry` keyed by the reference leaves ONE
entry, and that is what the arm now reports.

Refs: #460
Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…own test

gocyclo flagged the combined arm (36 > 30): two properties were being asserted in one
function. The append-and-addressable property and D-STORE-7's sweep decision are now one
test each, so a failure names which half broke.

Refs: #460
Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@aitrawog aitrawog changed the title feat(storekit): own the charly image store's OCI layout and archive feat(storekit): move the charly image store into storekit as the registry store's entries Nov 18, 2026
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 911875bbe36fcee1f204757d6e15fcc9d73c5fe3 (branch: feat/storekit-image-store)

Security screen: PASS — no scope mismatch; no secrets/egress; blob/archive path traversal hardened in blobPath (rejects .. in alg and hex) and archiveBlobPath; no guardrail weakened.

Checklist: All applicable rules PASS or NA.

Comment disposition

  • Comment 6977224402 (@github-actions[bot], prior BLOCK at head bfd56e4): stale-superseded. Its finding was that the relocated store keyed image entries by the mutable reference and replaced on rebuild (a D-STORE-3 / D-LAW-7 / D-STORE-5 divergence) with no filed issue. That no longer reproduces against the current head: storekit/images.go Add now sets Key: payloadDigest (the artifact's content address) with the reference as an annotation, a rebuild appends (proven by TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable and mutation arm 1), and the body lists a real filed issue (opencharly/opencharly#1098) for the separate D-STORE-1 root gap. The identity/law divergence is fixed in-tree, so the prior finding is dismissed.

Non-blocking notes (rulebook gaps, not blocks)

  • R7: the body claims a multi-platform export round-trips, but the tests exercise only single-manifest archives; a two-platform fixture would close that gap. (The R7 text does not demand a per-variant fixture for a library extension, so this is a note.)
  • QUAL: the artifact payload (index.json, the entry's root document) is published via PutBlob/writeFileAtomic (non-durable), while the image's manifest/config/layer blobs are durable via copyFileAtomic(..., true). Consider making the payload durable too, since after Add returns the archive is gone and the payload is not re-derivable.
  • COORD: the body shows this PR gates plugin-build step 3 (#460) as a cross-repo add-before-delete; no WAITING/HOLDING comment names both sides, but step 3 is tracked by #460 and is not shown to be a separate open item, so COORD is not triggered on the evidence present.

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 11:46
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: c4b297f0161be14db53f34a7ac7ee38a5a82d339 (branch: feat/storekit-image-store)

Change class: code (Go library — sdk/storekit + sdk/deploykit, plus go.mod/go.sum).

Blocks

  1. A1 / R1 / R10 — the body's stated head and pasted git rev-parse HEAD contradict the actual head; the evidence is not on the current head, and the merge commit is unaccounted for. The body states Head 911875bbe36fcee1f204757d6e15fcc9d73c5fe3 and pastes $ git rev-parse HEAD → 911875b…, but the current head is c4b297f0161be14db53f34a7ac7ee38a5a82d339 — the last commit on the branch, a Merge branch 'main' into feat/storekit-image-store. Every piece of pasted evidence (go build, go test, gofmt, golangci-lint, go vet, the four-arch cross-compile matrix, the live engine arms, the four mutation arms, and the git rev-parse HEAD / git hash-object .github/workflows/ci.yml lines) was gathered at 911875b, not at the current head; the body never mentions the merge commit. A merge of main can carry conflict resolutions or dependency changes into the very files under review, so the claimed fully tested and validated tier is not proven for the tree that would land. Per ground rule 4, pasted output that contradicts the actual head must be flagged regardless of how plausible it reads.
    Fix: re-run the How tested block on c4b297f and update the body's head SHA and git rev-parse HEAD output, OR state explicitly that the Merge branch 'main' commit is a no-op for the 13 changed files (same tree for them as at 911875b) and that the evidence at 911875b applies to c4b297f.

Non-blocking notes (rulebook gaps, not blocks)

  • R7/R10 — multi-platform round-trip claimed, single-manifest only tested. Add's doc states "a single-platform and a multi-platform export are stored the same way and Archive reproduces either," and indexDescriptor.Platform was added for multi-manifest indexes, but every fixture (writeImageArchive, writeNamedExport) writes exactly one manifest descriptor. A two-manifest fixture would prove the Platform passthrough and the archiveIndex re-application loop over multiple descriptors. (The R7 text does not demand a per-variant fixture for a library extension, so this is a note.)
  • QUAL — payload durability. The stored payload (index.json, the entry's root document) and the entry manifest go through PutBlob/writeFileAtomic (non-durable), while the image's manifest/config/layer blobs are copied via copyFileAtomic(..., true) (durable). After Add returns the export archive is gone, so the payload is not re-derivable; consider making it durable too. Not a normal-operation defect.

Comment dispositions

  • Comment 6977224402 (@github-actions[bot], BLOCK at bfd56e4): stale-superseded. Its finding was that the store keyed image entries by the mutable io.containerd.image.name reference and Add REPLACED on a rebuild (a D-STORE-3 / D-LAW-7 / D-STORE-5 divergence) with no filed issue. The current storekit/images.go Add sets Key: payloadDigest (the artifact's content address) with the reference as an annotation, a rebuild APPENDS (TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable + mutation arm 1), and ## Filed issues lists opencharly/opencharly#1098 (the separate D-STORE-1 root gap). The identity/law defect is fixed in-tree.
  • Comment 6977595890 (@github-actions[bot], PASS at 911875b): verified-non-blocking for its content assessment — I independently confirm the keying-by-digest, append, graph-walk and marker behavior from the current diff — but it predates the c4b297f merge commit and does not cover the current head, so its PASS is not dispositive of the head-SHA staleness above.

Verdict: BLOCK


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

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

Round 2 — the block is correct, and the head move was MINE

Head unchanged at c4b297f; the failed gate has been re-run against the corrected body (REST re-run of run 44300818813, the body/evidence path — no new commit).

What went wrong, and whose it is

The reviewer is right that the body declared 911875b while the head was c4b297f. The cause is not the author: I ran gh pr update-branch on this branch, because it was BEHIND with every check green and auto-merge armed, and the re-trigger table names that as the one action for that state. That minted a merge commit and moved the head out from under a body that had been finalised and proven for the previous one.

The fix — gates RE-RUN at this head, not carried across it

I could have argued the merge was a no-op. Instead the head-sensitive gates were executed again at c4b297f, and their real output replaces the carried ones:

$ gofmt -l .
(no output — clean)

$ GOWORK=off GOTOOLCHAIN=go1.26.8 go build ./...   ; echo "rc=$?"
rc=0
$ GOWORK=off GOTOOLCHAIN=go1.26.8 go vet ./...     ; echo "rc=$?"
rc=0
$ GOWORK=off GOTOOLCHAIN=go1.26.8 go test ./... -count=1 | tail -2
ok  	github.com/opencharly/sdk/vmshared	0.136s
ok  	github.com/opencharly/sdk/workflowkit	0.010s
$ GOWORK=off GOTOOLCHAIN=go1.26.8 golangci-lint run ./...
0 issues.

The body also keeps the argument that makes the remaining evidence legitimate, as a measured claim rather than an assertion — the merge touched four files and none of them is this PR's:

$ git diff --stat 911875b c4b297f
 CHANGELOG/0.2026322.1140.md           | 121 ++++++++++++++++++++++++++++++++++
 loaderkit/node_validate.go            |  27 ++++++++-
 loaderkit/parse_doc_stream.go         |  12 +++++
 loaderkit/step_typing_on_load_test.go |  39 +++++++++++++
 4 files changed, 197 insertions(+), 2 deletions(-)

$ git diff --stat 911875b c4b297f -- storekit deploykit go.mod go.sum
(no output)

RCA — the missed control

My own rule this session is "every content commit invalidates a measured body". I exempted gh pr update-branch because I classified it as mechanical — it merges main, it authors nothing of mine. That exemption was wrong: a branch update is a content commit whenever it mints a merge commit, and it invalidates a body keyed to the previous head exactly as an ordinary commit does.

The correction is mechanical too: the re-trigger table's update-branch action and the body-finalisation step are one operation, not two — the body must be re-keyed to the new head in the same motion, before the gate re-reads it.

I also want to note the org linter caught it first and more strictly than I did: pr_body_lint.py refuses a body whose pasted git rev-parse HEAD fence does not match the head, which is why the fix re-ran the gates instead of adding a paragraph explaining why the old ones were fine. That check is doing real work.

Agent: lead

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: c4b297f0161be14db53f34a7ac7ee38a5a82d339 (branch: feat/storekit-image-store)

Security screen: PASS — no scope mismatch; no secrets/egress; blob/archive path traversal hardened in blobPath (rejects .. in alg and hex) and archiveBlobPath (validates via blobPath); no guardrail weakened.

Checklist: All applicable rules PASS or NA. The prior blocks are resolved against the current state: Add sets Key: payloadDigest and appends on rebuild (TestImageStoreRebuildAppendsAndKeepsTheOldArtifactAddressable + mutation arm 1), indexEntry publishes oci-layout (NamedStores test + arm 3), ReachableBlobs walks the image graph (arm 2), the payload is stripped of name/timestamp (arm 4); the body now declares head c4b297f, pastes git rev-parse HEAD = c4b297f, re-runs the head-sensitive gates at c4b297f, and proves the merge is a byte-identical no-op for storekit/, deploykit/, go.mod, go.sum.

Comment dispositions:

  • 6977224402 (@github-actions[bot], BLOCK at bfd56e4): stale-superseded — the keyed-by-reference/replace finding no longer reproduces; the store now keys by the artifact digest and appends.
  • 6977595890 (@github-actions[bot], PASS at 911875b): verified-non-blocking — its content assessment (keying, append, graph walk, marker) is independently confirmed from the current diff; it predates the merge and is not dispositive of head-SHA freshness, which the current body now covers.
  • 6978234974 (@github-actions[bot], BLOCK at c4b297f): stale-superseded — the head-SHA/evidence-staleness finding is resolved: the body is re-keyed to c4b297f, gates re-run at that head, and the no-op merge argument is pasted with git diff --stat.
  • 6978367422 (@aitrawog): verified-non-blocking — maintainer RCA of the head move (gh pr update-branch) naming the missed control; coordination/RCA metadata, not a finding.

Non-blocking notes (rulebook gaps):

  • R7: Add claims a multi-platform round-trip and adds indexDescriptor.Platform, but every fixture writes a single manifest descriptor; a two-manifest fixture would prove the Platform passthrough. The primary new behavior (the store) is fully covered, so this is a note.
  • QUAL: the stored payload (index.json) is published via non-durable writeFileAtomic while the image blobs are durable; after Add the archive is gone, so consider making the payload durable too. Not a normal-operation defect.
  • COORD: not triggered — step 3 is the same tracking issue (opencharly/sdk#460) this PR refs, not a separate open item requiring a WAITING/HOLDING comment on the evidence present.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot merged commit 61b9125 into main Nov 18, 2026
10 of 11 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 18, 2026
@aitrawog

Copy link
Copy Markdown
Contributor Author

WAITING — plugin-build's step 3 (#460) is implemented, gated and prepared, and cannot be pushed until this PR merges and mints its tag.

The reduction is done on a local branch of opencharly/plugin-build (feat/store-writes-to-registry, head 1c6afc02302822718685cfbfab740c7fe83e3d2e): that repo deletes its OCI layout, index.json rewrite, blob copy, index lock and CHARLY_IMAGE_STORE_DIR, keeps only the export's naming, and calls storekit.OpenImageStore for Lookup/Dir/Add.

What blocks it. The pushed head must require the real tag and carry no replace, and no published sdk tag carries storekit.OpenImageStore — measured: v0.2026322.1140 has no storekit/images.go. A development replace in a pushed go.mod is the four-consecutive-CI-failure pattern this org has already paid for, so the consumer does not push one. Developing against this branch is done with a local replace at the sdk leg worktree; I verified that branch's storekit/ blob hashes are identical to your head c4b297f0161be14db53f34a7ac7ee38a5a82d339, so the store the consumer calls is the store this PR lands.

What unblocks it: merge here → tag-on-merge → require github.com/opencharly/sdk <tag> in plugin-build (replace dropped) → re-gate → push the consumer PR, whose body carries this WAITING.

One thing to settle before the consumer lands (filed, not a reason to hold this PR): opencharly/plugin-clean#27. Once image content lives at <cache root>/registry, a real charly clean --cache on any host or bed that sets CHARLY_CACHE_DIR deletes the image's manifest, config and layers (leaving the entry resolving true) because gcCacheStores routes a cache-rooted store through spec/cache's image-blind reachability walk when the two roots coincide; the same call leaves a .lock inside the store tree, against D-STORE-3. That makes the consumer doubly blocked, and it is the reason its body names that issue alongside this one.

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

@aitrawog

Copy link
Copy Markdown
Contributor Author

RESOLVED — the consumer this PR was blocking is open: opencharly/plugin-build#59 (feat(build)!: write built images to storekit's registry store), head 1bd3bebb66e552314ad1f164adaa390ca76ecc4d.

Verified against this PR's merge, not assumed: v0.2026322.1227 resolves to merge commit 61b9125320899be8ff3c0dc2e2e885e703d13a7b, and that tag's storekit/images.go is blob fd91db01860aed654911225333e86bed8f22d1b3 — byte-identical to the tree the consumer was developed and gated against. The consumer's go.mod requires github.com/opencharly/sdk v0.2026322.1227 with no replace (grep -n replace go.mod → no match), and go list -m resolves it from the module cache, not a local path.

The consumer deletes plugin-build's OCI layout, index.json rewrite, streamed blob copy, index lock and CHARLY_IMAGE_STORE_DIR, keeps only the reference choice and the export's naming (which Add requires and the kit does not emit), and calls storekit.OpenImageStore for Lookup/Dir/Add. Its live arm builds through the real BuildKit daemon and imports into podman, then reads the entry back out of <cache root>/registry — keyed by a digest whose payload chain reaches the built manifest — and confirms storekit.NamedStores() = [registry].

One consequence of the consumer landing, filed separately and named in its body: opencharly/plugin-clean#27.

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

github-actions Bot pushed a commit to opencharly/plugin-build that referenced this pull request Nov 18, 2026
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 Bot pushed a commit to opencharly/plugin-clean that referenced this pull request Nov 18, 2026
…ing it (#30) (#32)

* feat(clean): ingest the pre-relocation image store instead of abandoning it

opencharly/sdk#556 moved the image store from W3.6's data root ($XDG_DATA_HOME/charly/images) into
the cache root's registry store. It moved the reader and the writer; it left the CONTENT behind, at a
path nothing resolves any more, so on a host with build history hundreds of GiB became invisible to
every charly verb (#30: 311 GiB, 202 entries, measured).

The retirement record now carries that root as a second row, and its disposal is an INGEST, never a
removal: every entry is re-published into the registry store — blobs hardlinked where the two trees
share a filesystem and copied otherwise (reported either way), each descriptor re-keyed into the
current entry shape — every entry and every reference is VERIFIED in the destination, and only then
is the source tree removed. Nothing is dropped, so there is no keep set and no state surface can make
it unsafe; the refusals are about the bytes it moves (an unreadable index, an entry with no
reference, a manifest the tree does not hold) and each names itself. charly clean --store then
applies D-STORE-7 to the ingested content.

There is no data-root resolver and this adds none: D-STORE-1 (DESIGN.md:2482) declares four roots and
data is not one (spec#375 reverted RootData), so the pre-relocation path is a RECORDED LEGACY FACT,
spelled once in the retirement record and expanded by one function that resolves no store and feeds
no reader.

Refs: #30

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

* fix(clean): a dry run does not claim the link/copy outcome it cannot know

The dry-run line asserted "copied" because Linked is the zero value when nothing ran. It now says both cases, since a figure that reads as a measurement while being an unset field is the class of report this category exists to avoid.

Agent: clean-retention

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

* test(clean): drop the vestigial statements from the legacy-row test

The row test carried two throwaway assignments (a cache root it never used, and a zero-value spec.RetentionRequest) and an import that existed only for the second. The cache-root arm now asserts the resolved directory instead, through CHARLY_CACHE_DIR which the fixture injects.

Agent: clean-retention

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

* test(clean): cover the two refusals the legacy ingest documents

The ingest refuses an index that names no entries while the tree holds blobs, and an entry whose manifest the tree no longer holds. Both were documented and untested, so the body's coverage claim was ahead of the diff. Each now has an arm with a red mutation (an index naming nothing, and the presence check skipped).

Agent: clean-retention

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
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