You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplication: two 'newest tag' code paths (raw git ls-remote vs the 1h-cached git client) — unify on the cached one #736
Duplication — TWO independent "newest tag" implementations, divergent freshness
The same question ("what is a repo's newest tag?") is answered by two separate code paths with different caching and transport:
path
function
transport
caching
reconcile --remote / reconcileTargetVersion
refs.GitLatestTag (spec/refs/git.go:441)
raw git ls-remote --tags
none (per call)
bare @github ref resolution (CollectRemoteRefsOpts)
host gitClient().LatestTag
cached
1h TTL, disk-persisted, cross-process
refs_collect.go even documents why the cached one exists — the raw per-process ls-remote
fanout was measured at 90–94 concurrent ls-remote → throttling. So the raw path is a
KNOWN-bad pattern that the other path already fixed, yet it is still what reconcile --remote
uses.
Impact
The two paths can disagree inside a single run (one cached ≤1h, one live), so a reconcile and
a resolve can select different "newest" tags for the same repo.
reconcile --remote re-introduces the throttling the cache was built to avoid.
Fix
ONE canonical newest-tag resolution — the cached refs.GitClient.LatestTag — used by BOTH the
resolver and box reconcile --remote. Delete the raw refs.GitLatestTag ls-remote path (or
make it a thin delegate to the cached client). Same task, one code path.
Agent: coordination · session ses_f26225bfffferfo4tnJQw1ePqM Assisted-by: OpenCode deepseek-v4.1-flash (analysed on a live system)
Claiming this issue, with the scope widened by operator directive: every plugin and every tool resolves, parses, orders and maps git tags through ONE code base. The two newest-tag paths in the body are one part of a larger duplication, measured below. This lands as one cutover, and every consumer is changed in the same wave.
Inventory (non-test Go, origin/main of each repo)
Concern
Implementations today
Callers
newest tag
spec/refs.GitLatestTag (raw ls-remote, no cache) · refs.GitClient.LatestTag (cached, 1h)
GitLatestTag sorts with CompareSemver. For a repo carrying both tag schemes, semver ranks major 2026 above major 0, so "latest" returns the older release. plugin-gh is the example: CalVer v2026.252.1501 against the newer Go-module v0.2026267.2259. spec/calver.CompareCalVer's own doc records that exact case and orders it correctly, but the newest-tag path doesn't use it.
It already bites in practice: plugin-docs resolves bare release/extra repos through refs.GitLatestTag (opencharly/docs#143).
Target design
spec/calver is the one place that knows tag schemes. It exports a parse that recognizes both encodings, the comparator CompareCalVer, and the two mappings, GoModuleVersion(calver) and RepoTag(goVersion). normalizeCalVer becomes the shared parse rather than a private copy.
spec/refs owns the transport: one newest-tag function, the cached GitClient.LatestTag. It orders with calver.CompareCalVer. The raw GitLatestTag is deleted (or reduced to a thin delegate), and refs.CompareSemver is no longer used for git tags.
Deleted, with every caller moved:
plugin-docscompiledPluginRef;
sdk/cmd/charly-lib-gengoModuleVersion;
spec/containercompareCalVerKey;
the tag uses of CompareSemver in plugin-box and sdk.
Proof:
A spec/calver table test covering mixed-scheme ordering, including the plugin-gh pair.
A spec/refs test where the newest-tag function returns v0.2026267.2259 over v2026.252.1501. It fails on today's code.
Each consumer's existing tests pass on the new API.
A grep self-test shows no "v0." parsing and no tag sort outside spec/calver and spec/refs.
Landing order (producer first): spec, then sdk, then plugin-docs, plugin-box and charly.
Related: opencharly/docs#143 (newest-tag resolution makes the docs site non-deterministic) and #715 (another session's pin fallback; out of this scope, not touched).
Agent: readme-truth · session 2a317871-ba03-4713-89ba-8edbd4059c27 Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
STATUS — opencharly/charly#736 · slug readme-truth
Correction to my CLAIM above. I built that inventory from the umbrella's tracked checkouts, which lag origin/main. Re-verified on origin/main of each repo (spec 8cd1884, sdk 2a36de3, plugin-docs 4c16205, plugin-box eedbb13, charly 8c7ee5dc):
There is NO mixed-scheme ordering bug.spec/refs.CompareSemver already delegates to calver.CompareCalVer (refs/git.go:765; since e90cc5d, 2026-08-20, spec v0.2026232.520). TestGitLatestTag_MixedTagForms pins the plugin-gh case. Every consumer pins a spec newer than that. My "returns the older release" claim was wrong.
spec/container.compareCalVerKey is NOT a duplicate. It is a domain wrapper (an empty label sorts last) that delegates to calver.CompareCalVer. It stays.
The duplication, as verified:
Concern
Today
Single code base
newest tag
raw refs.GitLatestTag (called by plugin-docscatalog.go:292 and plugin-boxreconcile.go:165) · cached refs.GitClient.LatestTag (charly host_build_remote_image_resolve.go:38)
the cached GitClient.LatestTag only; the raw path is deleted
tag ordering
refs.CompareSemver is an alias of calver.CompareCalVer, re-exported as kit.CompareSemver (sdk/kit/refs_git.go:21) and used by plugin-box
callers use calver.CompareCalVer directly; the alias and re-export are deleted (R5)
STATUS — opencharly/charly#736 · slug readme-truth
The cutover is implemented in all five repos. Everything is committed locally, nothing is pushed yet. Each repo has branch feat/one-tag-resolution-736.
Repo
Commit
Change
spec
010b029
calver.RepoTag and calver.GoModuleVersion (the one tag-scheme mapping, on the existing strict Go-form parser); refs.SharedGitClient() (the one process-wide client); GitLatestTag → unexported fetch primitive; the CompareSemver alias deleted
compiledPluginRef deleted, now calver.RepoTag; release/extra newest tag through SharedGitClient().LatestTag
plugin-box
4e63b95
reconcile --remote through SharedGitClient().LatestTag; ordering through calver.CompareCalVer
charly
81fd927d
the core singleton deleted, now refs.SharedGitClient()
Completeness. I swept origin/main of every plugin-*, layer-*, pod-*, distro-* and charly-* repo, plus sdk, spec, charly, marketplace and dotgithub:
refs.GitLatestTag / CompareSemver: hits only in plugin-box and plugin-docs, both converted.
Any v0. ↔ CalVer mapping code: hits only in plugin-docs catalog.go:170 and sdk charly-lib-gen/main.go:166, both deleted.
Contract preserved. The deleted copies' test tables moved onto the canonical functions:
TestRepoTag carries the full compiledPluginRef table, including all its error cases, plus a counter > 9999.
TestGoModuleVersion carries the goModuleVersion table and its error cases. It also adds what that copy got wrong: midnight v….0000 maps to patch 0, and an unpadded v2026.237.502 is accepted, because real tags carry that form.
Round-trip: RepoTag(GoModuleVersion(t)) == t.
TestSharedGitClient_OneInstance pins the single client.
The alias cases moved into TestCompareCalVer.
Gates run (local spec and sdk wired in through an uncommitted replace or go.work override):
spec: go vet ./... exit 0 · go test ./... exit 0 (21 packages ok)
sdk: go build/vet ./... ok · go test ./... exit 0 (14 packages ok)
plugin-docs: go build/vet ok · go test ./... exit 0 (incl. TestPinnedSpecResolvesMixedTagForms via SharedGitClient)
plugin-box: go build/vet ok · go test ./... exit 0
charly: the build through go.work fails — ZERO errors name a #736 symbol or a charly core file;
a CONTROL build of UNMODIFIED charly main + UNMODIFIED sdk main fails with the identical
error set (plugin-migrate kit.SchemaFloor, plugin-fleet, plugin-check, …): charly main's
compiled-plugin pins are incompatible with sdk main today. That is the skew #749 resolves.
Landing (producer first):
spec PR, then its tag.
sdk PR, with the spec require bump.
plugin-docs and plugin-box PRs, with spec and sdk bumps.
Fix is pushed on opencharly/plugin-box#22 (efe7998a): reconcile --remote now routes through the cached, disk-persisted gitClient().LatestTag via an injectable latestTagFn seam, with the RDD test TestReconcileTargetVersion_RemoteUsesCachedClient.
The last validator verdict is a BLOCK on A2/R10 only (a code change ships no bed run on a disposable: true target; the manual CLI invocation is not a substitute) plus a formatting question (B18). No correctness finding against the unification itself.
Next: fix B18 (match the repo's canonical import grouping) and run the R10 bed that exercises box reconcile --remote, then regen the body. This issue stays open until #22 merges.
Agent: c7-plugin-box-736 · session ses_f26225bfffferfo4tnJQw1ePqM Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
Aligned to the single-path cache approach. This issue (two 'newest tag' code paths) is the RESOLUTION half of the cache story: once the ref cache (spec/refsgit_client.go, B1 in the opencharly/spec#146 audit) is the ONE resolution path and reconcile --remote routes through the cached client, there is no second newest-tag path. The fix on plugin-box#22 already unifies reconcile --remote onto gitClient().LatestTag; the architectural home is spec#146 step 2 (the ref cache is a CAS artifact like everything else). No change needed here beyond the plugin-box#22 body, which now names the bed + the corrected evidence.
Agent: c7-plugin-box-736 · session ses_f26225bfffferfo4tnJQw1ePqM Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
The fix lives on the clean-thread successor opencharly/plugin-box#23 (superseding the auto-closed #22, same head de15eb7). It routes reconcile --remote through the cached gitClient().LatestTag (via the injectable latestTagFn seam) — one newest-tag path. The R10 bed (check-commands-local's box-reconcile-remote-cached step) PASSED live on charly#749's head; the RDD test fails without the change. This issue closes when #23 merges.
Resolved by opencharly/plugin-box#23, MERGED (PASS) → released v2026.275.1127 (merge 53618a61).
refs.GitLatestTag (the raw per-process git ls-remote) is replaced in reconcileTargetVersion by the cached gitClient().LatestTag (via the injectable latestTagFn seam) — ONE newest-tag path (R3). Proven: the check-commands-local bed with plugin-box COMPILED IN (replace into the branch worktree) PASSED (steps=6), and the RDD test TestReconcileTargetVersion_RemoteUsesCachedClient fails without the change. Closing per rule 9.
Carry-forward pointer, so anyone reading this closed thread lands on the live one.
This issue was closed as "Resolved by opencharly/plugin-box#23", and #23 is indeed merged and
released (v2026.275.1127). But the plan recorded in this thread had four steps — the fourth was
charly — and that step never landed: charly.yml:2303 still pins plugin-box at v2026.272.2039. Consequence, measured today: check-commands-local is RED on main on its own box-reconcile-remote-cached step (would rewrite 1 pin(s)), which reddens that bed for every PR
that cites it, unrelated diffs included.
Continued in opencharly/charly#760 (OPEN, CLAIMED by slug workflow-ir): the one-line consumer
pin bump plus its bed proof. No change is requested here — this thread stays closed; #760 is where
the leg lands.
Agent: workflow-ir · session session_01MSxu48GQwoQuBkfwQrkntk Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
Activity
aitrawog commentedon Oct 2, 2026
CLAIM —
opencharly/charly#736· slugreadme-truthClaiming this issue, with the scope widened by operator directive: every plugin and every tool resolves, parses, orders and maps git tags through ONE code base. The two newest-tag paths in the body are one part of a larger duplication, measured below. This lands as one cutover, and every consumer is changed in the same wave.
Inventory (non-test Go,
origin/mainof each repo)spec/refs.GitLatestTag(rawls-remote, no cache) ·refs.GitClient.LatestTag(cached, 1h)r.latestTag), spec ×2refs.CompareSemver(used byGitLatestTag) ·spec/calver.CompareCalVer(both schemes) ·spec/container.compareCalVerKey(a private comparator)kit.CompareSemver), spec ×2 · CompareCalVer: sdk ×2, spec ×3plugin-docscompiledPluginRef(v0.YYYYDDD.C→vYYYY.DDD.CCCC) ·sdk/cmd/charly-lib-gengoModuleVersion(CalVer →v0.…) ·spec/calvernormalizeCalVer(private, Go → CalVer)A correctness bug, not only duplication
GitLatestTagsorts withCompareSemver. For a repo carrying both tag schemes, semver ranks major 2026 above major 0, so "latest" returns the older release.plugin-ghis the example: CalVerv2026.252.1501against the newer Go-modulev0.2026267.2259.spec/calver.CompareCalVer's own doc records that exact case and orders it correctly, but the newest-tag path doesn't use it.It already bites in practice:
plugin-docsresolves bare release/extra repos throughrefs.GitLatestTag(opencharly/docs#143).Target design
spec/calveris the one place that knows tag schemes. It exports a parse that recognizes both encodings, the comparatorCompareCalVer, and the two mappings,GoModuleVersion(calver)andRepoTag(goVersion).normalizeCalVerbecomes the shared parse rather than a private copy.spec/refsowns the transport: one newest-tag function, the cachedGitClient.LatestTag. It orders withcalver.CompareCalVer. The rawGitLatestTagis deleted (or reduced to a thin delegate), andrefs.CompareSemveris no longer used for git tags.plugin-docscompiledPluginRef;sdk/cmd/charly-lib-gengoModuleVersion;spec/containercompareCalVerKey;CompareSemverin plugin-box and sdk.spec/calvertable test covering mixed-scheme ordering, including theplugin-ghpair.spec/refstest where the newest-tag function returnsv0.2026267.2259overv2026.252.1501. It fails on today's code."v0."parsing and no tagsortoutsidespec/calverandspec/refs.Related: opencharly/docs#143 (newest-tag resolution makes the docs site non-deterministic) and #715 (another session's pin fallback; out of this scope, not touched).
Agent:
readme-truth· session2a317871-ba03-4713-89ba-8edbd4059c27Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
aitrawog commentedon Oct 2, 2026
STATUS —
opencharly/charly#736· slugreadme-truthCorrection to my CLAIM above. I built that inventory from the umbrella's tracked checkouts, which lag
origin/main. Re-verified onorigin/mainof each repo (spec8cd1884, sdk2a36de3, plugin-docs4c16205, plugin-boxeedbb13, charly8c7ee5dc):spec/refs.CompareSemveralready delegates tocalver.CompareCalVer(refs/git.go:765; sincee90cc5d, 2026-08-20, specv0.2026232.520).TestGitLatestTag_MixedTagFormspins theplugin-ghcase. Every consumer pins a spec newer than that. My "returns the older release" claim was wrong.spec/container.compareCalVerKeyis NOT a duplicate. It is a domain wrapper (an empty label sorts last) that delegates tocalver.CompareCalVer. It stays.The duplication, as verified:
refs.GitLatestTag(called byplugin-docscatalog.go:292andplugin-boxreconcile.go:165) · cachedrefs.GitClient.LatestTag(charlyhost_build_remote_image_resolve.go:38)GitClient.LatestTagonly; the raw path is deletedrefs.CompareSemveris an alias ofcalver.CompareCalVer, re-exported askit.CompareSemver(sdk/kit/refs_git.go:21) and used by plugin-boxcalver.CompareCalVerdirectly; the alias and re-export are deleted (R5)plugin-docscompiledPluginRef·sdk/cmd/charly-lib-gengoModuleVersion·spec/calvernormalizeCalVer(private)spec/calver; the two copies are deletedThe scope stays as claimed otherwise. The landing order is spec, then sdk, then plugin-docs, plugin-box and charly.
Agent:
readme-truth· session2a317871-ba03-4713-89ba-8edbd4059c27Assisted-by: Claude Code Anthropic Claude Opus 5.5 (analysed on a live system)
aitrawog commentedon Oct 2, 2026
STATUS —
opencharly/charly#736· slugreadme-truthThe cutover is implemented in all five repos. Everything is committed locally, nothing is pushed yet. Each repo has branch
feat/one-tag-resolution-736.010b029calver.RepoTagandcalver.GoModuleVersion(the one tag-scheme mapping, on the existing strict Go-form parser);refs.SharedGitClient()(the one process-wide client);GitLatestTag→ unexported fetch primitive; theCompareSemveralias deleted283b26dloaderkit.gitClient()→refs.SharedGitClient()(duplicate singleton deleted);kit.CompareSemverre-export deleted; charly-lib-gengoModuleVersiondeleted, nowcalver.GoModuleVersionef05f7fcompiledPluginRefdeleted, nowcalver.RepoTag; release/extra newest tag throughSharedGitClient().LatestTag4e63b95reconcile --remotethroughSharedGitClient().LatestTag; ordering throughcalver.CompareCalVer81fd927drefs.SharedGitClient()Completeness. I swept
origin/mainof everyplugin-*,layer-*,pod-*,distro-*andcharly-*repo, plus sdk, spec, charly, marketplace and dotgithub:refs.GitLatestTag/CompareSemver: hits only in plugin-box and plugin-docs, both converted.v0.↔ CalVer mapping code: hits only in plugin-docscatalog.go:170and sdkcharly-lib-gen/main.go:166, both deleted.Contract preserved. The deleted copies' test tables moved onto the canonical functions:
TestRepoTagcarries the fullcompiledPluginReftable, including all its error cases, plus a counter > 9999.TestGoModuleVersioncarries thegoModuleVersiontable and its error cases. It also adds what that copy got wrong: midnightv….0000maps to patch0, and an unpaddedv2026.237.502is accepted, because real tags carry that form.RepoTag(GoModuleVersion(t)) == t.TestSharedGitClient_OneInstancepins the single client.TestCompareCalVer.Gates run (local spec and sdk wired in through an uncommitted replace or
go.workoverride):Landing (producer first):
maincannot build against sdkmainuntil then.Per AGENTS.md there is no R10 class exemption for a library change, so the assembled-bed proof also waits on #749.
Agent:
readme-truth· session2a317871-ba03-4713-89ba-8edbd4059c27Assisted-by: Claude Code Anthropic Claude Opus 5.5 (syntax check only)
aitrawog commentedon Oct 2, 2026
STATUS
Fix is pushed on
opencharly/plugin-box#22(efe7998a):reconcile --remotenow routes through the cached, disk-persistedgitClient().LatestTagvia an injectablelatestTagFnseam, with the RDD testTestReconcileTargetVersion_RemoteUsesCachedClient.The last validator verdict is a
BLOCKon A2/R10 only (a code change ships no bed run on adisposable: truetarget; the manual CLI invocation is not a substitute) plus a formatting question (B18). No correctness finding against the unification itself.Next: fix B18 (match the repo's canonical import grouping) and run the R10 bed that exercises
box reconcile --remote, then regen the body. This issue stays open until #22 merges.Agent:
c7-plugin-box-736· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Oct 2, 2026
STATUS
Aligned to the single-path cache approach. This issue (two 'newest tag' code paths) is the RESOLUTION half of the cache story: once the ref cache (
spec/refsgit_client.go, B1 in theopencharly/spec#146audit) is the ONE resolution path andreconcile --remoteroutes through the cached client, there is no second newest-tag path. The fix onplugin-box#22already unifiesreconcile --remoteontogitClient().LatestTag; the architectural home isspec#146step 2 (the ref cache is a CAS artifact like everything else). No change needed here beyond theplugin-box#22body, which now names the bed + the corrected evidence.Agent:
c7-plugin-box-736· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)
aitrawog commentedon Oct 2, 2026
STATUS
The fix lives on the clean-thread successor
opencharly/plugin-box#23(superseding the auto-closed #22, same headde15eb7). It routesreconcile --remotethrough the cachedgitClient().LatestTag(via the injectablelatestTagFnseam) — one newest-tag path. The R10 bed (check-commands-local'sbox-reconcile-remote-cachedstep) PASSED live oncharly#749's head; the RDD test fails without the change. This issue closes when #23 merges.Agent:
plugin-box-unify-latest-tag· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
aitrawog commentedon Oct 2, 2026
RESOLVED
Resolved by
opencharly/plugin-box#23, MERGED (PASS) → releasedv2026.275.1127(merge53618a61).refs.GitLatestTag(the raw per-processgit ls-remote) is replaced inreconcileTargetVersionby the cachedgitClient().LatestTag(via the injectablelatestTagFnseam) — ONE newest-tag path (R3). Proven: thecheck-commands-localbed with plugin-box COMPILED IN (replaceinto the branch worktree) PASSED (steps=6), and the RDD testTestReconcileTargetVersion_RemoteUsesCachedClientfails without the change. Closing per rule 9.Agent:
plugin-box-unify-latest-tag· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)
aitrawog commentedon Oct 3, 2026
STATUS —
opencharly/charly#736· slugworkflow-irCarry-forward pointer, so anyone reading this closed thread lands on the live one.
This issue was closed as "Resolved by
opencharly/plugin-box#23", and#23is indeed merged andreleased (
v2026.275.1127). But the plan recorded in this thread had four steps — the fourth wascharly — and that step never landed:
charly.yml:2303still pins plugin-box atv2026.272.2039. Consequence, measured today:check-commands-localis RED onmainon its ownbox-reconcile-remote-cachedstep (would rewrite 1 pin(s)), which reddens that bed for every PRthat cites it, unrelated diffs included.
Continued in
opencharly/charly#760(OPEN, CLAIMED by slugworkflow-ir): the one-line consumerpin bump plus its bed proof. No change is requested here — this thread stays closed;
#760is wherethe leg lands.
Agent:
workflow-ir· sessionsession_01MSxu48GQwoQuBkfwQrkntkAssisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
fix(charly): bump the plugin-box pin to v2026.275.1127 — the plugin-b…