Say when the agent's hook is running a different build than you are - #434
Merged
Conversation
A plugin cache found on this machine held 0.4.0 while the CLI beside it was 0.6.0 -- four releases apart, with nothing telling the user anything was behind. The manifest was not at fault: `origin/main` declares 0.6.0 and the latest release is v0.6.0. The cache simply never refreshed. That matters more than a stale dependency usually does, because the agent runs the hook and not the CLI. Every edit in that repository was graded by 0.4.0's rules while the user ran `doctor` from 0.6.0 and saw nothing wrong. Two of the fixes in between are security fixes. `checkInjectRuntime` already spawns the configured hook executable to see whether it answers. Asking the same command for its version costs one more process, no network, and nothing that was not already being run. Not a duplicate of #382. That check compares the install the *commit-msg* hook is pinned to; this one compares the executable the *PreToolUse* hook resolves to. They are separate installations, and in the case that prompted this it was the second one that was stale. The check's first version reported a mismatch on a healthy install, and the suite caught it: `test/init.test.ts` ships a stub `commitlore` that prints a hook payload for any argv, `--version` included. Exit 0 is not the same as an answer, so output that is not shaped like a version is now `skipped` rather than compared. Two builds cannot be compared unless both sides actually said one. Limit: nothing here can update anything -- the plugin cache is the client's, so the only move available is to say what is true Ruled-out: comparing against the published release over the network | every other check in doctor reads local state, and a version check that needs the internet is one that fails on a plane and tells nobody why Ruled-out: making it a `fail` | an older hook still delivers records, under older rules, which is worth saying and not worth refusing to run over Ruled-out: folding it into #382's pinned-CLI check | that one is about the commit-msg hook's recorded target, and merging the two would report one surface's staleness under the other's name Warn: exit 0 from a `--version` call is not an answer; a wrapper that ignores argv exits 0 too, and comparing its output produces a mismatch against something that was never a version Blast: module Undo: easy Certainty: firm Verified: run against the real 0.4.0 plugin cache on this machine it reports the mismatch and names both versions; five cases cover behind, ahead, matching, absent, and unparseable, plus one that pins the assumption the check rests on -- that the real bundle's `--version` equals `packageVersion()` Provenance: authored Record-Id: r-hookver433
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (96)
Ruled out (222)
Warnings (57)
Truncated: 55 lines omitted — the comment hit GitHub's 65000 character limit. Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
This was referenced Aug 7, 2026
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.
Closes #433.
What was found
A plugin cache on this machine held 0.4.0 while the CLI beside it was 0.6.0 — four releases apart, with nothing telling the user anything was behind.
The manifest was not at fault.
origin/maindeclares0.6.0and the latest release isv0.6.0; the cache simply never refreshed.It matters more than a stale dependency usually does, because the agent runs the hook and not the CLI. Every edit in that repository was graded by 0.4.0's rules while the user could run
doctorfrom 0.6.0 and see nothing wrong. Two of the fixes in between (#408, #409) are security fixes.The check
checkInjectRuntimealready spawns the configured hook executable to see whether it answers. Asking that same command for its version costs one more process, no network, and nothing that was not already being run.Against the real 0.4.0 cache on this machine:
warn, notfail: an older hook still delivers records, under older rules. Worth saying; not worth refusing to run over.Not a duplicate of #382
That check compares the install the commit-msg hook is pinned to, via the recorded
commitlore.bin. This one compares the executable the PreToolUse hook resolves to. Separate installations — and in the case that prompted this, it was the second one that was stale.The suite caught a real weakness in the first version
Four
inittests went red.test/init.test.tsships a stubcommitlorethat prints a hook payload for any argv,--versionincluded — so the check read that JSON as a version and reported a mismatch on a healthy install.Exit 0 is not the same as an answer. Output that is not shaped like a version is now
skippedrather than compared, and that case is pinned by its own test. Without that failure this would have shipped a false positive to every user.Verification
test/doctor-inject-version.test.ts— behind, ahead, matching, no hook, unparseable answer, plus one pinning the assumption the check rests on (the real bundle's--versionequalspackageVersion()), so the others cannot pass while comparing nothing.test/doctor.test.ts— the pinned check list and counts updated from 10 to 11.test/dogfood.test.tsre-run after committing: 9 passed.Still open in #433's scope
Whether the marketplace refresh can be made to happen, rather than only reported. That is client-side and is not addressed here.