Repository navigation
refactor(gate): split mise.lock completeness from currency - #99
Merged
Merged
Conversation
lock-check ran `mise lock` — a remote round trip per tool — and rewrote the tracked lockfile, then diffed it. Three things follow, and none of them is what the gate was named for: Its verdict was a property of the world, not of the commit: an upstream release failed whichever branch was in flight, and the rewrite stayed in the working tree for the next `git add -A` to sweep into an unrelated commit. It could not detect incompleteness at all. Regenerate-and-diff sees drift only — `mise lock` never removes or repairs an existing entry, so a stably wrong lockfile passes forever. One did: `ubi:rust-cross/cargo-zigbuild` carried a single platform key `linux-x64-cargo-zigbuild` with a checksum and no url, the exact partial entry lock-check's own comment cited as its motivation, and lock-check reported "complete and current" over it on every run. Verified residue rather than mise output: deleted, `mise lock` does not restore it. Its premise was false. "CI installs with `mise install --locked`" appears only in lock-check's own comment and error text; no workflow passes --locked. Split: `lock-complete` is a pure gate over the committed bytes (no network, no write) wired into hk, and lock-check keeps currency alone, off the landing path on a weekly schedule. Removes the cargo-zigbuild residue. The url check is scoped to required platforms on purpose. mise emits a provenance-only stub where upstream ships no artifact — zizmor's musl entries — and regenerates them, so failing on every url-less block would fail this repo for a decision upstream made: the same defect one level down. Covered by a test. 11 bats cases.
wenzowski
marked this pull request as ready for review
August 7, 2026 15:53
Contributor
Author
|
/fast-forward |
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.
lock-checkranmise lock— a remote round trip per tool — and rewrote the tracked lockfile, then diffed it. It was a gate whose verdict came from a remote API with a write side effect, and it did not test what it was named for.What it was actually testing
Whether upstream changed since the last commit. Not completeness. Three things establish that, each verified rather than reasoned about:
Its premise was false. The comment and error string both assert "CI installs with
mise install --locked".--lockedappears nowhere in.github/workflows/— only insidelock-check's own prose. Every job installs live viainstall_args.It could not detect incompleteness. Regenerate-and-diff sees drift only:
mise locknever removes or repairs an existing entry, so a stably wrong lockfile passes forever. Verified by deleting a block and re-locking — it stayed deleted.A partial entry was in the file and passing.
ubi:rust-cross/cargo-zigbuildcarried one platform key,linux-x64-cargo-zigbuild, with a checksum and nourl— precisely the "mise installwrites only a partial entry" defect its own comment cites as motivation.mise run lock-checkprintedcomplete and currentover it on every run.And the side effects it paid for that: a network dependency on the landing path (observed timing out for 30s and retrying mid-
verify), and a write to a tracked file that agit add -Acan sweep into an unrelated commit.tests/context-budget.batsalready carries the rule this breaks — "A test may not mutate tracked working state" — written after a test ate an in-progress edit.The split
Sorted by which question is a property of the commit:
lock-complete(new)gate, globbed onmise.lock/mise.toml.lock-check(kept)verify'sdepends, moved to a weeklylock-currency.yml.lock-complete's predicates:unknown-platform-key— a platform key outside the set mise emits, i.e. install-time residue rather than a lock. This is what catches the cargo-zigbuild entry, which this PR removes.required-not-installable— a required platform with no block, or a block with nourl. Required defaults tolinux-x64 linux-arm64 macos-arm64(CI runners, agent sandboxes, contributor machines), overridable viaBATTEN_LOCK_PLATFORMS.A tool with no platform block at all is exempt, not a failure — the npm, pipx and core:rust backends lock no URLs, so partiality is not meaningful for them.
A near-miss worth recording
The first version failed on every url-less platform block, which flagged
zizmor's two musl entries. Applying the same delete-and-re-lock test showedmise lockregenerates those — they are how mise records "upstream ships no artifact here." Failing on them would have failed this repo for a decision upstream made, which is the identical defect one level down.The url check is therefore scoped to required platforms, and that case is a test rather than a comment.
Verification
mise run verifygreen on3bee7d2. 163 bats cases, 11 of them new.actionlintandzizmorclean on the new workflow.Also worth noting: this branch's previous
verifyrun exercised the fail-closed fix from #97 for real —mainmoved mid-run,linear-checkfailed, andverifystopped without writing a receipt where it would previously have printedfast-forward-green.Generated by Claude Code