Skip to content

Check every pinned tool against the lock; add cargo tops lock - #58

Closed
VirtualMachinist wants to merge 8 commits into
mainfrom
hn/g4-lock
Closed

VirtualMachinist wants to merge 8 commits into
mainfrom
hn/g4-lock

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

Slice 1.6: every pinned tool a running layer needs is checked against rust-tops.lock, and cargo tops lock verifies or rewrites the lock.

  • Table. src/lock.rs has one row for each of the eleven CLI tools, each with its version argv and parse rule, tested against version lines captured from the real tools. Partial pins match whole parts only, so 0.12 matches 0.12.3 and not 0.120.0. rustc --version judges the toolchain pin for rustc, clippy and rustfmt, and cargo clippy --version and cargo fmt --version must also succeed. Library and name rows (proptest, criterion, callgrind-runner) are skipped.
  • Gate. Each pinned tool a running layer needs is asked once, before the layer runs. A mismatch is the new tool-mismatch verdict (kind environment, exit 3), worded the same in stdout, the detail and problems: mismatch cargo-deny: pin 0.18.9, found 0.18.8. A tool that won't run stays tool-missing. The old cargo-crap-only check is gone; a crap pin mismatch was exit 1 and is now exit 3, like every other tool.
  • Command. cargo tops lock --verify [--max-tier N] [--path P] exits 0 when every pin matches, 2 for a lock that does not parse, and 3 for a missing or wrong tool. --write rewrites values only, keeping comments, order and other tables.
  • CI. The kit's tops-gate job runs a fresh init, then lock --verify --max-tier 1, before the gate. The drop-in runs cargo tops lock --verify --max-tier 1 before its gate. --max-tier 1 is there because those jobs don't install cargo-fuzz, Kani or Nushell.

The drop-in on main needs the next cargo-tops release for lock, as with --base.

Gate at the head: 142 mutants tested in 21m: 118 caught, 24 unviable; ok: 8 command(s) passed.

🤖 Generated with Claude Code

VirtualMachinist and others added 8 commits November 19, 2026 21:04
New files only. The table holds the eleven pinned tools, each with its
version argv and parse rule, tested against lines captured from real tools.
The lock command and the gate check are not wired yet; the CLI tests stay red
until they are.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Kani row reads the line a real cargo kani printed. The clippy and
rustfmt rows are judged by the toolchain line and are missing when
cargo clippy or cargo fmt will not run. Test directories are unique per test
and per process.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The gate asks each pinned tool a layer needs for its version before the
layer runs. A tool at another version is a tool-mismatch (environment, exit
3) naming tool, pin and found, in the same words on stdout, in the layer
detail and in the problems. A tool that will not run is a missing tool. The
crap pin check moves onto this path and run_pinned_crap is gone.

cargo tops lock --verify [--max-tier N] [--path P] checks the pins, and
--write replaces the values the tools print, keeping comments and order.
The kit workflow runs init and lock --verify in a temp crate after the pinned
tools install, and the drop-in runs lock --verify before the gate. The gate
tests answer the pins from stubs, so none depends on the host toolchain.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…shold

The version parser keeps one check, since only digits and dots reach it.
The lock command builds its report lines in functions with their own tests.
The project commands are one group in the command line, and the pinned
tools of a layer are asked in the run loop, so no function rose above its
score.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@VirtualMachinist

Copy link
Copy Markdown
Member Author

Recut as a single commit with the same tree: #59

@NebuHedron
NebuHedron deleted the hn/g4-lock branch November 20, 2026 11:16
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.

1 participant