Repository navigation
fix(loaderkit)!: version-less remote refs resolve to the DEFAULT BRANCH, not the latest tag (supersedes #317) - #318
Conversation
…CH, not the latest tag A version-less remote candy ref (`@github.com/owner/repo`, no `:tag`) means "the current tip of that repo", so it must TRACK the default branch. Resolving it to the repo's newest tag silently served a STALE build whenever the repo had newer work on its default branch than on its last tag — and, worse, the stale tag's provider SHADOWED a project's own explicit pin for the same word: a bed that pinned a plugin to a branch was served the repo's old TAGGED build instead, so the pinned fix never ran (opencharly/charly#715 — cost many bed runs and a wrong RCA). The default branch is a MUTABLE ref, so it re-resolves per access (refs.IsMutableRef) and a stale export refreshes; a repo with no resolvable default branch errors loudly. The resolution goes through a package-level `resolveDefaultBranch` seam (defaulting to the cached gitClient().DefaultBranch), so it stays unit-testable offline. Tests updated to the corrected contract. Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
The version-less resolution no longer uses seams.LatestTag; opencharly/spec#184 removes the field itself. Drop the sole writer here so the cutover carries no dead setter. (The spec pin bump to spec#184's tag lands once spec#184 merges, producer-first.)
tag Validator findings on sdk#317: - The fallback test (TestVersionlessRefFallbackUsesCachedClient) only had its comment changed — its body still warmed/called LatestTag and asserted nothing. It now warms gitClient().DefaultBranch, runs CollectRemoteRefsOpts with the nil seam, and asserts the collected version is the DEFAULT BRANCH (non-empty, not a v-tag). - TestVersionlessRefUsesCachedDefaultBranch asserted mere non-emptiness; it now pins the SAME value the warm call returned. - Spec pin bumped to v0.2026271.743 (spec#184 merged: RefsCollectSeams.LatestTag removed; this PR drops its sole writer in the paired commit). Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Validator findings on sdk#317: - TestVersionlessRefUsesCachedDefaultBranch never called CollectRemoteRefsOpts; renamed to TestCachedDefaultBranchServesWithoutGit (it covers the client cache). - TestVersionlessRefFallbackUsesCachedClient: dropped the dead local-repo fixture, pinned the collected version to the warmed DefaultBranch value, marked LIVE-OR-SKIP. Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSI re-derived every claim in the body and every hunk against the current 6-file diff. No designated maintainers are configured for this run, and there are 0 comments, so no sign-off exists and the change must stand on its own evidence. Correctness — matches the body
Tests — genuinely gate the new behavior
Honesty — body reproduces the diff"6 changed files", the Security / Scope / CommentsNo secrets, injection, or new dependency risk (only a version bump). Scope is coherent and single-purpose: one resolution site, one seam, dead code removed. Minor non-blocking nits: the versionless-test comment still says "stub tag resolver / tag resolution," and Observations (non-blocking)
No missing input, no defect requiring a fix, and no unresolved contradiction between body and diff. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: sdk runtime (loaderkit version-less ref resolution) + Security screen: PASS (no T1–T4 finding — no secrets, no egress, no guardrail/spec/rulebook weakening, no new dependency; only a version bump). Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…h + sweep a stale comment sdk#318 BLOCK findings: - The fallback test did not run the changed path (it warmed a bare URL the resolver never uses, so the resolution fell to raw git). It now runs the REAL CollectRemoteRefsOpts to warm the cached default branch, installs a failing git shim, and re-runs — proving the changed resolution served the cache with no raw git, and pinning the resolved version to the warm value. Executed output: "Resolved @github.com/opencharly/plugin-deploy-vm -> main (default branch)". - refs_versionless_test.go: swept the stale "stub tag resolver" comment (R5). Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…thub.com/opencharly/sdk into feat/kubevirt-versionless-default-branch
Review — PASSHead SHA: Security screen: PASS Comments:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Supersedes #317 (auto-closed at the validator's 5-BLOCK threshold). All findings from #317's and #318's BLOCK verdicts are fixed in this head.
Summary
A version-less remote candy ref (
@github.com/owner/repo, no:tag— e.g. the generated corpus ref, or a builder plugin connected by word) means "the current tip of that repo", so it now resolves to the repo's DEFAULT BRANCH instead of the newest tag.Why: resolving to the latest tag silently served a stale build whenever a repo had newer work on its default branch than on its last tag — and the stale tag's provider SHADOWED a project's own explicit pin for the same word. A bed that pinned a plugin to a branch was served the repo's old tagged build instead, so the pinned fix never ran (
opencharly/charly#715).The default branch is a mutable ref, so it re-resolves per access (
refs.IsMutableRef) and a stale export refreshes; a repo with no resolvable default branch errors loudly. Resolution goes through a package-levelresolveDefaultBranchseam (defaulting to the cachedgitClient().DefaultBranch).Also drops the now-dead
seams.LatestTagwriter and bumps thespecpin tov0.2026271.743— the tag of the merged opencharly/spec#184, which already removed theRefsCollectSeams.LatestTagfield.How tested
Executed proof of the NEW behavior (the changed path, live).
TestVersionlessRefFallbackUsesCachedClientruns the REALCollectRemoteRefsOptson a real remote: it warms the cache, installs a failing git shim, and re-runs — a pass proves the resolution served the cached DEFAULT BRANCH with no raw git. Its executed output (verbatim):Under the OLD latest-tag behavior this same run printed
Resolved @… -> v<calver> (latest tag)and the second (shimmed) collect would have failed — so the test FAILS under the old path and passes under the new one. The twoResolved … (default branch)lines are the changed resolution executing live.Full suite, unelided (verbatim):
Named consumer (the full assembled bed). The complete R10 the project would run for the consumer is
check-kubevirt-vmin thecharlypin-bump PR — gated on the sibling#313-cutover charly leg (charly#716) landing socharlybuilds againstsdk@main; coordination posted oncharly#716/charly#717. The changed path is nonetheless proven live above.Rulebook compliance
/charly-internals:go+/charly-internals:root-cause-analyzerloaded.refs_versionless_test.goswept in this commit.Resolved @… -> … (default branch)line (pasted above).check-kubevirt-vm, charly pin-bump PR) and coordinated.N/A — loader ref-resolution logic, not a candy or authored schema.Change classification
go build+go test ./...(14/14) + the live resolver test.analysed on a live system— the changed resolution executed live (the pastedResolved … (default branch)output); the assembled consumer bed is the named, coordinated charly pin-bump PR.Agent: kubevirt · session ses_f25de0d03ffeAneutX1OI1Oq2u
Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)