Repository navigation
fix(loaderkit): a real CalVer tag outranks a bare SHA, and the skew names every loser - #549
Merged
Merged
Conversation
…ames every loser
Two defects in the same arbiter, both found while advancing a pin in a consumer project.
1. A BARE SHA WON THE NEWEST ARBITRATION. PickCandyVersion ordered candidates with the lenient
kit.CompareCalVer, whose lexical fallback puts 7766a9d06ec5 ABOVE v2026.320.1938 (7 sorts
after 2). A bare commit SHA is a legitimate pin — the distro-* rule pins SHAs because those
commits are untagged — but it carries NO recency, so a stale SHA was chosen as the newest
candidate and the pre-fix content won, with only an INFO line to say so. Measured in
opencharly/distro-cachyos: the CDI driver-shadowing fix at layer-nvidia v2026.320.1938 lost
to the pre-fix commit pinned by a stale require: two hops away, so the composed image would
still have baked the driver user-space. spec/calver.ParseCalVer already documents the
intended semantics ("a false result is treated as older than every real CalVer"); this
restores it. Tags carry a leading v, so the comparison trims it before parsing. Two refs that
are BOTH non-CalVer keep the legacy lenient order, so a project that pins only SHAs is
unaffected.
2. THE DIAGNOSTIC NAMED ONLY THE WINNER. A message that states a comparison and hides one side
is not actionable: the reader cannot see which refs disagree or where the losing one came
from. The skew line now appends every losing candidate with its tag, its source, and the box
scopes that named it. That gap cost hours on the pin advance above (opencharly/charly#1179:
the losing ref turned out to be a stale require: in another candy).
Tests: two new cases pin both halves (the loser is named verbatim; the winner is the newest
CalVer tag even when a SHA is lexically greater), and describeSkew is empty when every candidate
is the winner, so an unskewed closure's message is unchanged.
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
This was referenced Nov 16, 2026
Merged
fix(require): advance the pod-marimo pin past the CDI driver-shadowing fix
opencharly/pod-airflow#12
Merged
Merged
github-actions Bot
pushed a commit
to opencharly/charly
that referenced
this pull request
Nov 17, 2026
…ag over a bare SHA (#1186) Consumes opencharly/sdk#549 (v2026.320.2158): PickCandyVersion preferred a bare commit SHA over a real CalVer tag, because the lenient comparator's lexical fallback sorts 7766a9d06ec5 above v2026.320.1938. The OLDER content therefore won the arbitration and the only signal was an INFO line -- measured in distro-cachyos, where the CDI driver-shadowing fix lost to a pre-fix commit pinned by a stale require: two hops away. The same release makes the skew diagnostic name every losing ref with its source and box scopes (#1179). This repo is a multi-module tree (go.work + tools/*/go.mod) and its own contract test enforces ONE shared sdk pin across every lockstep module, so the bump is the sdk line plus this repo's own verb: [pass] run -- adopt the shared pins and tidy every lockstep module [pass] check -- every lockstep module now carries the shared pins Ten files: charly/go.mod + go.sum, and the four lockstep tools modules (generate-packages, golden-cloudinit, golden-compile, gomod-canonical) in go.mod + go.sum each. Verified before the push: go build ./... clean; go test ./... green in charly/ (2 packages) and in all five tools modules under GOWORK=off, including gomod-canonical's TestContractPinsMatchShared -- the test that failed on the earlier attempt to bump only charly/go.mod. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two defects in the candy-version arbiter, both found while advancing a pin in a consumer project
(opencharly/distro-cachyos#184) and both of a kind that silently produces the WRONG image.
1. A bare SHA wins the "newest" arbitration.
PickCandyVersionorders candidates with thelenient
kit.CompareCalVer, whose lexical fallback compares7766a9d06ec5againstv2026.320.1938as strings:'7' > '2', so the stale SHA is "newest". A bare commit SHA isa legitimate pin — the
distro-*rule pins SHAs precisely because those commits are untagged —but it carries no recency at all, so this inverts the arbitration exactly when a project mixes
the two forms.
Measured in opencharly/distro-cachyos: the CDI driver-shadowing fix at
layer-nvidia:v2026.320.1938lost to the pre-fix commit that a stalerequire:two hops awaystill pinned, and the resolver said so at INFO level:
spec/calver.ParseCalVeralready documents the intended semantics — "a false result is treatedby the freshness comparison as older than every real CalVer" — so this restores it rather than
inventing a new rule: a parsed CalVer tag outranks a non-CalVer ref, and only two non-CalVer refs
fall back to the legacy lenient order (so a project that pins only SHAs is unaffected). Tags
carry a leading
v, so the comparison trims it before parsing — without the trim every tagparses as non-CalVer and the preference would never apply.
2. The skew diagnostic named only the winner. A message that states a comparison and hides
one side is not actionable: the reader cannot tell which refs disagree, nor where the losing one
came from. The line now appends every losing candidate with its tag, its source, and the box
scopes that named it:
That gap is opencharly/charly#1179, filed from the same episode: finding the losing ref took
bisecting an eighteen-candy box one candy at a time, because the tool named one side of a
two-sided comparison.
How tested
1. The two new cases, and the full package suite:
The new cases assert both halves, and both fail on the pre-change code: the first because the
arbiter returned the SHA, the second because the message carried no loser at all.
2. The whole module, because this is a shared library:
3. This repo's structural gate, on the committed tree:
4. Why no bed. This repo is a library:
charly.ymldeclares one candy and no disposabledeployment, so there is no R10 bed to run here. The behaviour change is exercised by the tests
above, and its consequence for a real project is the measured one in the Summary — it is the
consumer that will show it, in opencharly/distro-cachyos#184.
Rulebook compliance
/charly-internals:git-workflow,/charly-internals:go,/charly-internals:go-quality,/charly-check:check.fix(resolve): the multi-ref candy error names only the winning ref, never the loser or its referrer charly#1179 (the diagnosability half) and in distro-cachyos#184 (the pin advance it
blocked); this PR is the root fix for both halves.
through; no caller-side special case.
teaching callers to avoid SHA pins.
measured reason at the site.
git status --shortempty after the commit; fresh worktree offorigin/main; nothingoutside this repo touched.
returned the SHA, and the message test found no loser), and the changed path executes in the
suite.
go vetclean.is the package suite plus
charly box validate, both pasted.Change classification
Breaking change + rollback: behaviour changes for exactly one case — a closure that names the
same candy both by CalVer tag and by bare SHA now resolves to the TAG instead of the lexically
greater SHA. That is the intended semantics (a SHA is a pinned old commit, not a newer version),
and it is what a consumer wants: the alternative silently kept pre-fix content. Rollback is
reverting this commit; consumers then resolve to the SHA again, which is the defect.
Change class: library code — unit suite +
go vet+ the repo's validate gate.Filed issues
Agent: charly
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)