Skip to content

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

Open
VirtualMachinist wants to merge 4 commits into
mainfrom
hn/g4-lock-r2
Open

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

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

Each pinned tool a running layer needs is asked once before the layer
runs. A mismatch is the tool-mismatch verdict: kind environment, exit 3,
naming the tool, the pin and the version found. The cargo-crap-only check
is gone. cargo tops lock --verify exits 0, 2 or 3, and --write rewrites
values only. The kit and drop-in workflows run lock --verify before the
gate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VirtualMachinist and others added 3 commits November 20, 2026 07:13
… pins

A pin that is not a string, a tools key that is not a table, a pin that is
not dot-separated digits, and a lock with no tools table are errors naming
the key (exit 2) in lock, check and the gate. A pre-release never matches a
pin. An unknown key prints a warning, and only the three named libraries
print skipped. A failed probe names its command and how it failed, in the
same words on stdout, in the detail and in the problems, and each probe has
ten seconds.

lock --write rewrites only plain key = "value" lines under tools, refuses
every other form by name without changing the file, reads the edited text
back, prints wrote only for changed values, and leaves a partial pin that
already matches. The protocol text follows what the gate asks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The gate tests run the whole gate several times against stubs, and each gate
now asks the pinned tools for their versions. Three test binaries get a longer
limit in the kit config, with the measured times in the comment. The version
ask looks for its answer sooner and backs off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The backoff was no faster and left a mutation that no test could tell apart.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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