Skip to content

feat(cache): generalize spec/cache into the ONE keyed Store - #143

Merged
github-actions[bot] merged 5 commits into
mainfrom
feat/cache-store
Sep 22, 2026
Merged

github-actions[bot] merged 5 commits into
mainfrom
feat/cache-store

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Generalize github.com/opencharly/spec/cache from a TTL-only single-file cache
into the ONE keyed Store whose validity lives IN the entry, so a single
storage mechanism serves every cache policy the tree needs. This is the shared
mechanism the loader's materialized-tree cache (sdk/loaderkit) and a plugin
HTTP client (plugin-gh) fold onto instead of hand-rolling a third and fourth
copy (R3).

Validity lives in the entry, never in the mechanism. Three interchangeable
modes, one layout:

  • TTL — Entry.Resolved + FreshTTL (the status hot path: image list,
    image labels, submodule verdicts, substrate probes).
  • Components — Entry.Components + FreshComponents (content-addressed /
    identity validity: a GitHub blob keyed by SHA, the loader's walk envelope).
    No time validity: valid while the inputs are unchanged.
  • Validator — Entry.Validator (an upstream revalidation token, e.g. an
    HTTP ETag) for a mutable upstream that must not re-fetch while unchanged.

One storage layout (Store): a directory of one JSON entry per key, keyed
by sha256(key); lock-free atomic reads (tmp + rename publish); a per-key
advisory flock with a double-check on the Fill miss path (concurrent
first-missers compute once); Docker-style prune by entry cap. StoreDir(name)
names a store under ~/.config/charly/cache/<name>/ (CHARLY_CACHE_DIR
overrides the root); OpenNamed(name) is the one-shot open idiom;
HashHex/KeyDigest are the shared components helpers. Fill is the
compute-once primitive (a hit never calls it); a caller that must REVALIDATE a
mutable upstream reads the entry, revalidates, and puts the refresh.

Consumers migrated onto the Store in THIS change, old API deleted (R5):
spec/refs (submodule-populated verdicts) and spec/container (image list,
image labels). The former top-level Read/Write/Invalidate/File API is
gone, and the three store-open sites share OpenNamed (no copy-paste). The
loader (sdk/loaderkit) and plugin-gh fold onto the same Store in their own
producer-ordered changes — the package doc states exactly this scope. The
cache-file layout change is disposable local state (no migration entry; cache
state is not authored config).

How tested

$ gofmt -l .            # empty
$ go vet ./...          # clean
$ go test ./...
ok  github.com/opencharly/spec/cache     0.338s
ok  github.com/opencharly/spec/refs      21.253s
ok  github.com/opencharly/spec/container 4.217s
... (full module green)

New cache/cache_test.go pins each behaviour (each fails without it):

  • TestTTLValidity / TestComponentsValidity / TestValidatorRoundTrip — the
    three modes.
  • TestFillComputesOnceUnderConcurrency — 16 goroutines, ONE fill: the per-key
    flock serializes first-missers.
  • TestFillReturnsExistingWithoutCallingFill — a hit never runs fill.
  • TestPruneReclaimsOldest — the entry cap reclaims the oldest.
  • TestInertStoreNeverErr — an empty dir degrades to compute-without-caching.
  • TestDeleteRemovesEntry / TestOpenNamedResolvesUnderRoot / TestHashHex —
    the new exported API (Delete, Dir via OpenNamed, HashHex).
  • TestKeyDigestStableAndOrdered — the components digest is order-independent.

TestImageCacheTTLExpiry / TestSubmoduleCacheTTLExpiry backdate through the
Store's PutEntry seam; TestInvalidateImageCache asserts the cleared Store is
empty; TestImageCacheStoreDirIsNamed asserts imageCacheStore().Dir().

R5 sweep + consumer liveness (executed)

The removed top-level API is cache.Read / cache.Write / cache.Invalidate /
cache.File. Swept the whole spec repo on the final tree, and checked the ONE
out-of-tree consumer against its origin/main:

$ grep -rn --include=*.go -E "cache\.(Read|Write|Invalidate|File)\b" .
(no hits — the removed API has no live caller in spec)

$ git -C plugin-substrate grep -n "spec/cache\|cache\.\(Read\|Write\)" origin/main -- '*.go'
origin/main:candy/plugin-substrate/status_probes.go:24:  "github.com/opencharly/spec/cache"
origin/main:candy/plugin-substrate/status_probes.go:351:  if cache.Read(cachePath, key, probeCacheTTL, &cached) {
origin/main:candy/plugin-substrate/status_probes.go:362:  cache.Write(cachePath, key, results)

Exactly ONE live consumer exists (plugin-substrate, on origin/main). Its
migration onto cache.OpenNamed/Store.ReadTTL/Store.WriteValue is WRITTEN
and verified to build against this spec change (dev replace), and lands as the
immediate-next consumer PR once this publishes — the pinned require can only
advance after the producer tags, so this is the org's producer-to-consumer order
(B6), not a deferral of in-scope work.

Rulebook compliance

  • R0 — loaded /charly-internals:strict-policy, /charly-internals:go,
    /charly-internals:cutover-policy, /charly-build:migrate.
  • R1 — every gate green from the final tree; the doc/comment divergences
    earlier rounds surfaced (Fill's revalidation claim, the unchecked test
    assertion, the over-broad package-doc scope) are fixed here.
  • R2 — the whole refactor is in this PR; the one live consumer is migrated
    (written + verified) and lands per producer-to-consumer order, named above
    with its origin/main liveness proof.
  • R3 — this PR CREATES the one shared abstraction; the store-open idiom is
    itself unified in OpenNamed.
  • R4 — no sleeps/retries; concurrency is a flock, not a workaround.
  • R5 — the old Read/Write/Invalidate/File API and both in-repo
    consumers' private file-layout assumptions are deleted in the same change;
    the sweep and consumer-liveness output is pasted above.
  • R6 — feat/cache-store off fresh origin/main; no force-push.
  • R7 — coverage that FAILS without the change: the Fill-concurrency,
    components-drift, prune, Delete/HashHex/OpenNamed and TTL tests above.
  • R8 — cache entries are typed JSON validated by construction; the
    PutEntry backdating seam is the test path.
  • R9 — N/A — library/contract module; no deployed binary or runtime OS
    dependency.
  • R10 — N/A — no disposable deploy target in this repo; the module gate
    (gofmt/vet/test on the final tree) is the change-class gate.
  • SDD — no schema-shaped wire type changed; schema/cache.cue describes the
    per-host charly.yml cache: section, which is untouched (the Store is the
    on-disk ~/.config/charly/cache/ area).

Change classification

  • Change class: Go library (the shared cache mechanism).
  • Verification gate: gofmt + go vet + fresh go test ./... on the final
    tree (module gate — no disposable deploy target in this repo).
  • Attribution tier: fully tested and validated.

Attribution evidence — the runtime-reported model string (executed)

The footer names the harness, provider, and model string this authoring session
REPORTED at runtime — from the live opencode runtime log for this host, not a
config file:

$ grep -m1 'llm runtime selected' ~/.local/share/opencode/log/opencode.log
... message="llm runtime selected" llm.runtime=ai-sdk llm.provider=ollama-cloud llm.model=deepseek-v4.1-flash

$ grep -m1 'message=created' ~/.local/share/opencode/log/opencode.log
... agent=build model.id=deepseek-v4.1-flash model.providerID=ollama-cloud model.variant=high version=1.18.31

$ grep -m1 'message=stream' ~/.local/share/opencode/log/opencode.log
... message=stream providerID=ollama-cloud modelID=deepseek-v4.1-flash ... agent=build mode=primary

So the runtime-reported triple is harness opencode (1.18.31), provider
ollama-cloud, model deepseek-v4.1-flash — the exact string used across the
org's opencode-authored commits (git log footers on the org repos repeat
opencode ollama-cloud/deepseek-v4.1-flash). Per the AI-attribution policy the
string is used VERBATIM; substituting a different model name would itself be the
defect.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Replace the TTL-only single-file cache with one Store whose validity lives
IN the entry, so a single storage mechanism serves all three cache policies
the tree needs:

- TTL (Entry.Resolved + FreshTTL) — the status hot path.
- Components (Entry.Components + FreshComponents) — content-addressed /
  identity-validity caches (the loader materialized tree, a GitHub blob by
  SHA): valid while the inputs are unchanged, no time expiry.
- Validator (Entry.Validator) — an upstream revalidation token (HTTP ETag /
  Last-Modified) for a mutable upstream that must not re-fetch unchanged.

One layout: a directory of one JSON entry per key, keyed by sha256(key);
lock-free reads (atomic tmp+rename publish); a per-key flock + double-check
on the Fill miss path (concurrent first-missers compute once); Docker-style
prune by entry cap. StoreDir names a store under ~/.config/charly/cache/
(CHARLY_CACHE_DIR overrides the root); KeyDigest/HashHex are the shared
components-digest helpers.

Migrate spec/refs (submodule verdicts) and spec/container (image list,
image labels) onto the Store and delete the old top-level Read/Write/
Invalidate/File API (R5). The cache-file layout change is disposable state
(no migration entry; cache state is not authored config).

R3: this is the ONE cache mechanism the loader and plugin clients will fold
onto; no hand-rolled per-feature cache.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: fda88e1e497793211395696a3b99dea4c90bd883 (branch: feat/cache-store)

Change class: Go library (the shared spec/cache mechanism + the refs/container consumers); module gate (gofmt + go vet + go test). Security screen: no T1–T4 finding (no secrets/egress, no guardrail edit, no embedded directive; the cache is not a security gate).

Blocks

  1. B18 / R1 — dead code + false comment in a NEW test (container/cache_test.go, TestImageCacheStoreDirIsNamed). The trailing comment // imageCacheStore must resolve into that dir. asserts a verification the test never performs — it never calls imageCacheStore() — and the line that follows, _ = os.RemoveAll(root), is a dead no-op. The test therefore does not check what it claims (R1 comment/reality divergence; B18 dead code). Fix: assert imageCacheStore().Dir() == filepath.Join(root, "images") and delete the os.RemoveAll line.

  2. R3 — the store-open idiom is copy-pasted three times. imageLabelsCacheStore (container/image_inspect.go), imageCacheStore (container/local_image_coneb.go), and submoduleCacheStore (refs/git.go) each repeat the identical cache.StoreDir(name) → cache.Open(dir) with the cache.Open("") inert fallback. A PR whose whole thesis is R3 dedup must not hand-roll the same block in a second/third place. Fix: add one cache.OpenNamed(name string) *cache.Store and call it from all three.

  3. R1 — Store.Fill doc diverges from behaviour (cache/cache.go). The doc says fill "receives the current entry … so a revalidating caller can short-circuit on an unchanged upstream (returning it unchanged refreshes its Resolved)", but Fill invokes fill only on a miss, always with Entry{}; a hit returns immediately without ever calling fill. The described Validator/revalidation path is unreachable. Fix: correct the doc, or provide the revalidation entry point the doc describes.

  4. B12 — new exported behaviour ships with no test that would fail without it (cache/cache.go). HashHex and Store.Delete (and Store.Dir) are new exported API with zero coverage in cache/cache_test.go. Either add tests that fail without them, or drop the unexercised API.

  5. A1 — rule-compliance section incomplete. The body answers R0–R6, R8 and SDD but leaves R7, R9 and R10 unanswered — not even N/A — <reason>. Add the missing rule lines (R9/R10 are legitimately N/A — library repo, no disposable deploy target).

  6. A3 — attribution model name unverifiable. The footer *Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)* is not cross-checkable against any authoring-runtime evidence in the body, and deepseek-v4.1-flash does not correspond to a known DeepSeek model. Confirm the exact harness/provider/full-model string.

Comment thread: empty — nothing to dispose.

Verdict: BLOCK


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

View action run

…on claim

Address the validator BLOCK on #143:
- B18/R1: TestImageCacheStoreDirIsNamed now asserts imageCacheStore().Dir()
  equals <root>/images (was a dead os.RemoveAll no-op with a claim it never
  checked).
- R3: add cache.OpenNamed(name) and route imageCacheStore / imageLabelsCacheStore
  / submoduleCacheStore through it — the store-open block is no longer copied
  three times.
- R1: correct Store.Fill's doc (and signature) — it is the compute-once
  primitive and never calls fill on a hit; the Validator revalidation path lives
  in the caller (it Get()s, revalidates upstream, and Put()s the refresh).
- B12: add tests for the new exported API — Store.Delete, Store.Dir via
  OpenNamed, and HashHex.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: b47e28fbe168db3d491237445f02203894a2c935 (branch: feat/cache-store)

Change class: Go library (shared spec/cache mechanism + the refs/container consumers); module gate (gofmt + go vet + go test). Security screen: PASS (no T1–T4 finding — no secrets/egress, no guardrail edit, no embedded directive).

I re-derived the single prior comment against the CURRENT state. Its findings 1–5 are all demonstrably fixed in this diff/body; finding 6 survives.

Blocks

  1. A3 — the attribution model name is unverifiable and names no known model; the added note is an assertion, not evidence. The footer ends *Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)*. deepseek-v4.1-flash does not correspond to any known DeepSeek model, and the new "Attribution note" only asserts that the string is what "this authoring runtime exposes" — that is a config-read/runtime-derived identifier with no pasted runtime evidence (no session/config output) anywhere in the body. Per A3 ("a guessed or config-read name is a defect") and ground rule 4 ("never let a missing re-run pass on the author's word alone"), the tier's attribution cannot be verified from the body. Fix: paste the actual runtime model string the harness reported, or correct the footer to the real <Provider Full Model Name>.

  2. R5 / B10 / B14(d) — the removed-API sweep ships no executed output and no consumer-liveness statement. The body's R5 line claims the top-level cache.Read/Write/Invalidate/File API is "deleted in the same change," and R2 acknowledges an out-of-tree consumer (plugin-substrate, "which imports spec/cache"). But the body pastes no grep/sweep command output (only gofmt/vet/test), and it never states liveness of the removed symbols was checked against the consumer's origin/main (B10 explicitly requires this for producer-repo symbol removal). "Handled in its own producer-ordered PR once this publishes" is a deferral, not the required liveness evidence. Fix: paste the real sweep command + output for the removed identifiers and state the consumer's origin/main was checked.

Comment dispositions

  • Comment 5783888269, findings 1–5 — stale-superseded: re-derived against the current diff/body and each is now satisfied. (1) container/cache_test.go:TestImageCacheStoreDirIsNamed now asserts imageCacheStore().Dir() == filepath.Join(root, "images") and the dead os.RemoveAll line is gone. (2) cache.OpenNamed exists and is called by all three sites (imageLabelsCacheStore/imageCacheStore/submoduleCacheStore). (3) Fill's doc now correctly says it takes no argument and describes the revalidation caller as a separate Get/Put path — the unreachable claim is dropped. (4) HashHex, Delete, and Dir are covered (TestHashHex, TestDeleteRemovesEntry, TestOpenNamedResolvesUnderRoot, TestImageCacheStoreDirIsNamed). (5) The rule-compliance section now answers R0–R10 + SDD, with R9/R10 marked N/A — <reason>.
  • Comment 5783888269, finding 6 — verified-blocking: reproduces against the current state (the footer still names deepseek-v4.1-flash, and no runtime evidence was added), now Block 1 above.

Verdict: BLOCK


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

View action run

…ribution evidence)

Body-only follow-up to the second validator round: paste the executed R5 sweep
plus the consumer origin/main liveness check, and the runtime attribution
config. No source change.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Empty commit so the org validator fresh run is keyed to a head whose body is
already final (the R5 sweep plus consumer-liveness plus attribution evidence).
No source change.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: e8c302a384e6983e6c363235acc6aa1cc23c9991 (branch: feat/cache-store)

Change class: Go library (the shared spec/cache mechanism plus its refs/container consumers); module gate (gofmt + go vet + go test).

Security screen: no T1–T4 finding (no secrets/egress, no guardrail edit, no embedded directive; the cache is not a security gate).

Blocks

  1. B10 / B14(d) — the removed-API sweep ships no executed output and no consumer-liveness statement. The body (R5) claims the top-level cache.Read/Write/Invalidate/File API is "deleted in the same change", and (R2) acknowledges an out-of-tree consumer (plugin-substrate, "which imports spec/cache"). But the only pasted output is gofmt/vet/test — there is no grep/sweep command and no output anywhere in the body — and the body never states liveness of the removed symbols was checked against the consumer's origin/main. "handled in its own producer-ordered PR once this publishes" is a deferral with no named batch/task, not the required liveness evidence. Fix: paste the real sweep command + output for the removed identifiers and state the consumer's origin/main was checked.

  2. A3 — attribution still unverifiable from the body. The footer ends *Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)*. The added "Attribution note" only asserts that this is the string "this authoring runtime exposes" — no pasted runtime/session/config output exists anywhere in the body to cross-check it against. Per A3 a guessed/config-read model name is a defect, and per ground rule 4 a missing re-run may not pass on the author's word alone. Fix: paste the actual runtime model string the harness reported, or correct the footer to the real <Provider Full Model Name>.

Comment dispositions

  • Comment 5783888269 (at fda88e1e4977), findings 1–5 — stale-superseded, re-derived against the current diff: (1) container/cache_test.go:TestImageCacheStoreDirIsNamed now asserts imageCacheStore().Dir() == filepath.Join(root,"images") and the dead os.RemoveAll line is gone; (2) cache.OpenNamed exists and all three sites (imageLabelsCacheStore/imageCacheStore/submoduleCacheStore) call it; (3) Fill's doc no longer claims a revalidation argument — it takes none; (4) HashHex/Delete/Dir are covered (TestHashHex, TestDeleteRemovesEntry, TestOpenNamedResolvesUnderRoot, TestImageCacheStoreDirIsNamed); (5) the rulebook section now answers R0–R10 + SDD with N/A — <reason> on R9/R10.
  • Comment 5783888269 finding 6 / comment 5784001680 finding 1 — verified-blocking (Block 2).
  • Comment 5784001680 (at b47e28fbe168) finding 2 — verified-blocking (Block 1).
  • No approve-comments present to dispose.

Verdict: BLOCK


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

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: edc8498b9c5ff8d194be98c27161b7071c1e4136 (branch: feat/cache-store)

Change class: Go library (the shared spec/cache mechanism plus its refs/container consumers); module gate (gofmt + go vet + go test).
Security screen: PASS (no T1–T4 finding — no secrets/egress, no guardrail edit, no embedded directive; the cache is not a security gate).

Blocks

  1. A3 — the attribution model name is config-read, not runtime evidence. The footer ends *Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)*, and the new "Attribution evidence" section sources that string from sed -n '/"provider"/,/^ }/p' opencode.json — i.e. it is read out of the opencode config file (the body says so verbatim: "read from the live opencode config at opencode.json"). A3 states outright that "a guessed or config-read name is a defect", and no runtime-reported/session string for this authoring session is pasted anywhere in the body. The same section also asserts the string appears in "git log origin/main footers" with no pasted git log output (B14(d) unexecuted-claim pattern). Fix: paste the model string the harness actually reported for this session (or correct the footer to that string); a config dump does not satisfy A3.

  2. R1 — package doc diverges from reality. The new package doc in cache/cache.go asserts "Every cache in the tree — the status hot path (… the substrate probes), the loader's materialized-tree cache, and a plugin client's HTTP revalidation cache — is a Store". At this head only spec/refs and spec/container are Stores; sdk/loaderkit's tree cache, plugin-substrate's probes and plugin-gh are not migrated (the body itself says they "fold onto" the Store, future tense; the R2/R5 lines confirm only the two in-repo consumers migrated). Reword to intent ("becomes a Store" / "is served by a Store once migrated") or scope the claim to the migrated consumers.

Comment dispositions

  • 5783888269 (at fda88e1e4977) — findings 1–5 stale-superseded, re-derived against the current diff: (1) TestImageCacheStoreDirIsNamed now asserts imageCacheStore().Dir() == filepath.Join(root,"images") and the dead os.RemoveAll line is gone; (2) cache.OpenNamed exists and all three sites (imageLabelsCacheStore/imageCacheStore/submoduleCacheStore) call it; (3) Fill's doc no longer claims a revalidation argument — it takes none and describes the Get/Put path; (4) HashHex/Delete/Dir are covered (TestHashHex, TestDeleteRemovesEntry, TestOpenNamedResolvesUnderRoot, TestImageCacheStoreDirIsNamed); (5) the rulebook section now answers R0–R10 + SDD with N/A — <reason> on R9/R10. Finding 6 (attribution unverifiable) verified-blocking → Block 1.
  • 5784001680 (at b47e28fbe168) — finding 1 (A3 attribution) verified-blocking → Block 1; finding 2 (B10/B14(d) sweep had no pasted output) stale-superseded: the current body pastes the grep -rn … "cache\.(Read|Write|Invalidate|File)\b" . sweep (no hits) and the git -C plugin-substrate grep … origin/main liveness output (one live consumer), which is the evidence that finding demanded.
  • 5784071031 (at e8c302a384e6) — finding 1 (B10 sweep) stale-superseded (sweep output now present, as above); finding 2 (A3) verified-blocking → Block 1.

Verdict: BLOCK


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

View action run

…here

R1: the package doc claimed the loader materialized-tree cache and a plugin
HTTP cache "is a Store" at this head, but only spec/refs and spec/container are
migrated here; the others fold onto the Store in their own producer-ordered
changes. Reword to that reality.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 28edd8d32477f025aed8d40bdd50fb4c22f80ee1 (branch: feat/cache-store)

Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail or validator-spec edit, no embedded directive; a cache is not a security gate).
Checklist: All applicable rules PASS or NA (A1 body + footer, A2 library module-gate, A3 tier backed by pasted module-gate output + runtime-reported model string, R0/R3/R4/R5/R7 verified from the diff, R9/R10 N/A — library repo, no disposable deploy target).
Comments: 5783888269, 5784001680, 5784071031, 5784104939 — every finding re-derived against the current head and now stale-superseded: the dead os.RemoveAll/unchecked assertion is replaced by a real imageCacheStore().Dir() assertion; cache.OpenNamed unifies all three store-open sites; Fill's doc matches its no-argument, compute-once behaviour; HashHex/Delete/Dir/OpenNamed are covered; the rulebook section answers R0–R10 + SDD; the R5 sweep (grep no-hits) and plugin-substrate origin/main liveness output are pasted; the attribution string is now backed by pasted runtime-log grep output (internally consistent across three messages); and the package doc is scoped to the consumers actually migrated here (refs + container), with loaderkit/plugin-gh stated as future producer-ordered folds. No surviving or newly-surfaced blocking finding.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 22, 2026 21:06
@github-actions
github-actions Bot merged commit 3d568de into main Sep 22, 2026
1 of 2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 22, 2026
aitrawog pushed a commit that referenced this pull request Sep 23, 2026
Body-only update (the class gate is now evidenced by the committed ci.yml run
green on the head + the merged #143/#144/#145 precedent, and the no-disposable-
target proof uses a real path). No source change — this empty commit moves the
head so the fresh validator run keys to a head whose body is already final.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
aitrawog pushed a commit that referenced this pull request Sep 23, 2026
Body-only update (the class gate is now evidenced by the committed ci.yml run
green on the head + the merged #143/#144/#145 precedent, and the no-disposable-
target proof uses a real path). No source change — this empty commit moves the
head so the fresh validator run keys to a head whose body is already final.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
github-actions Bot pushed a commit that referenced this pull request Sep 23, 2026
…stry-portable (#148)

* feat(cache): OCI Image Layout ArtifactStore — content-addressed, registry-portable

Replace the keyed one-JSON-file-per-key cache with ONE content-addressed
artifact store whose on-disk form is a standard OCI Image Layout
(oci-layout + index.json + blobs/<alg>/<digest>). Each cached artifact is a
real OCI manifest: the config blob carries the validity metadata
(resolved/components/validator), layers[0] the payload, and annotations the
cache key + org.opencontainers.image.ref.name tag. A named cache is one OCI
index, so a whole store can be pushed/pulled to a registry unchanged (the
verb:oci cache-push/cache-pull transport lands next).

The file backend uses stdlib + opencontainers/image-spec + go-digest ONLY; no
go-containerregistry in the contract module.

The legacy Store API (Open/OpenNamed/OpenLimited/Read/ReadTTL/WriteValue/
PutEntry/entryPath) is DELETED in the same cutover; consumers migrate in this
change (refs submodule verdicts, container image list + labels) and in the sdk
change (loaderkit materialized tree).

repoCacheProvenanceVersion 2 hard-rejects the legacy bare-commit sidecar: a v1
export cannot certify its tree (the pre-cutover loader rewrote it in place —
auto-migrating charly.yml to the consumer's schema CalVer), so it is treated as
not-cached and re-fetched once pristine. IsRepoCached now enforces this, so
immutable-tag caches self-heal too. This is the root-cause fix for the poisoned
@main cache that failed check-substrate's deploy-add.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (syntax check only)

* fix(cache): clear golangci-lint findings (staticcheck QF1008/SA4000, gocritic, unconvert)

- cache.go: drop the redundant Versioned selector on the embedded field.
- cache_test.go: derive the determinism check from fresh values (avoid SA4000).
- container/engine_ops.go: if/else chain -> tagged switch (gocritic).
- container/engine_ops_test.go: drop the unnecessary string() conversions.

The two container findings pre-date this branch (they block the module gate, so
they are fixed here per R2 rather than deferred).

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (syntax check only)

* fix(cache): Fill must stamp Resolved (a zero-Resolved callback result was stored stale)

The validator caught a real regression: the new Fill persisted via put(), which
preserves the caller's Resolved, whereas the legacy Fill persisted via Put(),
which stamped Resolved=now. A fill callback returning an Entry with a zero
Resolved (a degrade/empty result) was therefore stored with Resolved=zero:
instantly TTL-stale (defeating compute-once for any TTL caller) and sorted as
the OLDEST entry for reclamation.

Fill now stamps e.Resolved = time.Now() before persisting, matching Put and the
legacy contract. The fill guard is also per-key again (locks/<tag>.fill.lock),
matching the documented per-key flock rather than the interim store-wide lock.

TestFillStampsResolved fails without the stamp:
  --- FAIL: TestFillStampsResolved (0.00s)
      Fill must stamp Resolved=now so the entry is TTL-fresh; got 0001-01-01...

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* docs(cache): correct Entry.Key doc — Get reconstructs it, put() no longer stamps it

The validator found a doc/impl divergence: the Entry.Key comment still claimed
"Set by the Store on Put", but the new keyed-by-tag layout reconstructs the key
from the manifest annotation on Get and no longer stamps it on write. Fix the
comment to match the implementation.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)

* docs: re-freeze the PR body against the final head

Body-only update (the class gate is now evidenced by the committed ci.yml run
green on the head + the merged #143/#144/#145 precedent, and the no-disposable-
target proof uses a real path). No source change — this empty commit moves the
head so the fresh validator run keys to a head whose body is already final.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)

* docs: re-freeze the PR body against the final head

Body-only update (the class gate is now evidenced by the committed ci.yml run
green on the head + the merged #143/#144/#145 precedent, and the no-disposable-
target proof uses a real path). No source change — this empty commit moves the
head so the fresh validator run keys to a head whose body is already final.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (documentation reviewed)

---------

Co-authored-by: Andreas Trawoeger <[email protected]>
@aitrawog
aitrawog deleted the feat/cache-store branch September 25, 2026 19:09
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.

2 participants