Skip to content

fix: stop blaming PATH when the Very Good CLI version cannot be read - #176

Merged
ryzizub merged 1 commit into
mainfrom
fix/hook-blames-path-for-stale-snapshot
Oct 20, 2026
Merged

ryzizub merged 1 commit into
mainfrom
fix/hook-blames-path-for-stale-snapshot

Conversation

@ryzizub

@ryzizub ryzizub commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #171

Two bugs made the SessionStart hook blame PATH for a Dart SDK upgrade.

very_good --version was read with head -1. When the shim's snapshot is stale it falls back to dart pub global run, which prints its resolution chatter to stdout ahead of the version, so a working CLI read as unverifiable. The match now looks past the first line, anchored so a version-shaped fragment of a path in that chatter cannot win instead.

unverifiable then covered both an absent dart and an unreadable version, and all three hooks reported it as a PATH problem. It now splits on command -v dart: dart_missing keeps the PATH advice without naming one shell's startup file, and unverifiable points at the rebuild and the /mcp reconnect a server started before the upgrade needs.

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Code refactor (refactor)
  • Documentation (docs)
  • CI change (ci)
  • Chore (chore)

🤖 Generated with Claude Code

@ryzizub
ryzizub marked this pull request as ready for review October 13, 2026 09:31
@ryzizub
ryzizub requested a review from a team as a code owner October 13, 2026 09:31
@unicoderbot

unicoderbot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Heads up — I'm auto-updating this PR by merging the latest main into this branch. No action needed; I'll comment again only if this update hits a conflict or an unexpected error.

@unicoderbot

unicoderbot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

I tried to auto-update this PR with main but ran into conflicts. The branch is unchanged — please merge it manually.

@ryzizub
ryzizub force-pushed the fix/hook-blames-path-for-stale-snapshot branch from 35b51d0 to 78c0e51 Compare October 13, 2026 20:59
@ryzizub
ryzizub requested a review from marcossevilla October 13, 2026 21:00
Comment thread hooks/scripts/block-cli-workarounds_test.sh Outdated
Comment thread hooks/scripts/vgv-cli-common.sh Outdated
@unicoderbot

unicoderbot Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Heads up — I'm auto-updating this PR by merging the latest main into this branch. No action needed; I'll comment again only if this update hits a conflict or an unexpected error.

1 similar comment
@unicoderbot

unicoderbot Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Heads up — I'm auto-updating this PR by merging the latest main into this branch. No action needed; I'll comment again only if this update hits a conflict or an unexpected error.

@unicoderbot

unicoderbot Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

I tried to auto-update this PR with main but ran into conflicts. The branch is unchanged — please merge it manually.

@ryzizub
ryzizub force-pushed the fix/hook-blames-path-for-stale-snapshot branch 2 times, most recently from d32b0e2 to 672ab7d Compare October 20, 2026 12:45
@ryzizub ryzizub changed the title fix: name the real cause when the Very Good CLI version is unreadable fix: stop blaming PATH when the Very Good CLI version cannot be read Oct 20, 2026
@ryzizub
ryzizub force-pushed the fix/hook-blames-path-for-stale-snapshot branch from 672ab7d to 9e07451 Compare October 20, 2026 13:08
Closes #171

Two bugs made the SessionStart hook blame PATH for a Dart SDK upgrade.

`very_good --version` was read with `head -1`. When the shim's snapshot is stale
it falls back to `dart pub global run`, which prints its resolution chatter to
stdout ahead of the version, so the first line held no version and a working CLI
read as unverifiable. Match past the first line, anchored so a version-shaped
fragment of a path in that chatter cannot win: a stub whose chatter names
/tmp/vgv-1.2.3/pkg reads as `outdated:1.2.3` unanchored.

`unverifiable` then covered both an absent dart and an unreadable version, and
all three hooks reported it as a PATH problem. Split it on `command -v dart`:
`dart_missing` keeps the PATH advice, no longer naming one shell's startup file,
and `unverifiable` points at the rebuild and the `/mcp` reconnect a server
started before the upgrade needs.

The stubs printed "very_good 1.5.0"; the real CLI prints a bare "1.5.0", so they
now print that. jq reaches the hooks through a symlinked directory, because its
own directory holds dart on a Homebrew machine and the dart_missing cases then
ran the wrong branch; each suite refuses to run if dart resolves on its base PATH.
@ryzizub
ryzizub force-pushed the fix/hook-blames-path-for-stale-snapshot branch from 9e07451 to 7f27e7f Compare October 20, 2026 13:11
@ryzizub
ryzizub merged commit c6ea9d9 into main Oct 20, 2026
5 checks passed
@ryzizub
ryzizub deleted the fix/hook-blames-path-for-stale-snapshot branch October 20, 2026 13:19
@vgvbot vgvbot mentioned this pull request Oct 20, 2026
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.

fix: SessionStart hook blames PATH when a Dart SDK upgrade leaves very_good with a stale snapshot

2 participants