Skip to content

kit check reports ✓ for tools it never verified: "latest" means "on PATH", cli-lock claims a provenance it does not own, and undeclared CLIs are invisible #500

Closed

Description

@sandstream

kit check reports ✓ for tools it never verified. Three defects, one root: nothing resolves a declared tool to an actual version, an actual source, or a known-latest — and the output makes an unverified pass indistinguishable from a verified pin.

kit's own claim, from the site: "a check that could not run FAILS the gate — no false green." This is that rule inverted, in the subsystem that decides which binaries an agent then trusts.

Defect 1 — latest is not checked against anything

// src/check-tools.ts:45
function versionSatisfies(installed: string, required: string): boolean {
  if (required === "latest") return true;
  return installed.startsWith(required);
}

latest therefore means "the binary answered --version". Measured on this machine (kit 6.6.5, macOS, Apple Silicon), with a project declaring:

[tools]
bun = "1.3.10"
vercel = "latest"
semgrep = "latest"

kit printed:

✓ bun       1.3.10    (need 1.3.10)
✓ vercel    53.1.1    (need latest)
✓ semgrep   1.167.0   (need latest)

Reality, measured just now:

$ vercel --version   →  53.1.1
$ npm view vercel version → 59.1.4      # six majors behind
$ semgrep --version  →  1.167.0          # latest is 1.173.0

Three greens, one of which is a real verified pin and two of which are "present". The reader cannot tell them apart — and an agent choosing whom to trust picks kit check. In the session that found this, Claude Code's own session hook said "The Vercel CLI is outdated (53.1.1 → 59.1.4)" at the same moment kit said ✓. Two sources disagreed and kit was the one that was wrong.

Defect 2 — cli-lock.json records a provenance it does not own, and calls it in sync

The lock entry:

"vercel": { "version": "latest", "source": "mise", "installedAt": "2026-08-14T06:08:43.879Z" }

Both fields are fabrications, and both come from the same two lines:

// src/fix.ts:306  and  src/commands/setup.ts:946 — identical
for (const [name, version] of Object.entries(config.tools)) {
  tools[name] = { version, source: "mise" };
}

version is the declared string, not a resolved version, so latest is written verbatim; source is hardcoded "mise" regardless of where the binary comes from. Measured:

$ command -v vercel        →  /opt/homebrew/bin/vercel     # brew
$ mise ls | grep -i vercel →  (empty — mise does not manage it)

And the check that is supposed to notice:

// src/check-lock.ts — the whole comparison
for (const toolName of configToolNames) {
  if (!cliLock.tools[toolName]) missing.push(toolName);
  else if (cliLock.tools[toolName].auth) authRequired.push(toolName);
}
inSync: missing.length === 0

It compares names only. Not the recorded version against the installed one, not the recorded source against the PATH winner. So:

✓ cli-lock.json   in sync   — all tools locked

A lock file whose purpose is provenance says mise for a brew binary, and the gate agrees. The pattern holds for every tool whose PATH winner comes from a different installer than the lock believes.

Defect 3 — undeclared CLIs are not inventoried at all

Tools that agents actually make decisions from are absent from [tools], so nothing checks them: gh, op, jq, mise, docker, gcloud, kubectl, supabase, stripe, psql. There is also no command that would show them — the verb surface has doctor, install, pkg, upgrade, and nothing that inventories what is on PATH.

Inventory taken by hand on the machine (source / installed / latest):

tool source installed latest
vercel brew 53.1.1 59.1.4
semgrep mise 1.167.0 1.173.0
mise brew 2026.6.11 2026.8.9
gh brew 2.96.0 2.97.0
node mise 25.8.0 26.7.0
op, osv-scanner, trivy, trufflehog, grype mise 2.34.0, 2.4.0, 0.72.0, 3.95.9, 0.114.0 —
gitleaks mise does not answer --version —
jq, git, python3 system 1.7.1, 2.50.1, 3.9.6 —
bun, npm, pnpm, yarn, turbo ~/.kit-shims — —
kit npm -g 6.6.5 —

brew outdated: 89 formulae.

Why an unverified green costs more than a missing check

Retracted (2026-08-20): this section originally carried a worked example about a missing
production environment variable. That example was wrong and has been struck — the variable
existed all along; the CLI hid it because the account lacked permission to read the production
environment and the client filters Sensitive Production variables without saying it is showing a
subset
. That is a Vercel-client defect, not a kit one, and it is not evidence for anything here.

What stands on its own is narrower and enough: two sources disagreed about the same binary in the
same minute, and kit was the one that was wrong. Claude Code's session hook said "The Vercel CLI
is outdated (53.1.1 → 59.1.4)"
while kit check printed ✓ vercel 53.1.1 (need latest). An
agent deciding whom to trust picks the one that reports a verdict, and the verdict here was
produced by a comparison that returns true before looking at anything.

The cost is not a wrong error message; it is that no error occurs. Six majors of drift, a lock
file naming the wrong installer, and an uninventoried PATH all read exactly like a healthy repo.

What is being asked for (requirements, not implementation)

  1. Separate "present" from "current". Either latest is checked against the registry and drift warns, or the pin is renamed to something that does not promise currency (any / present). Green must not mean unchecked.
  2. cli-lock.json records the resolved version AND the actual provenance, and the check alarms when the PATH winner comes from a different installer than the lock states.
  3. Offline degrades to skip with a reason — never to green, never to a hard error.
  4. kit tools list: path, source, installed version, latest known version — including undeclared tools found on PATH.
  5. An upgrade path that respects the per-tool installer: brew for vercel/gh/mise here, mise for semgrep/trufflehog/op, npm -g for kit itself.
  6. A sane cache/TTL on registry lookups, so the check does not become slow or network-dependent in the normal case.

Reported from a session on kit 6.6.5; the code references above are current on main at 6.7.0.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions