Repository navigation
Conversation
|
Heads up — I'm auto-updating this PR by merging the latest |
|
I tried to auto-update this PR with |
check_vgv_cli returned "unverifiable" for every unreadable version, and every caller reported it as a PATH problem. After a Dart SDK upgrade the shim runs a snapshot built for the old SDK and the fallback rebuild leaves the version unreadable while dart is on PATH the whole time, so the hooks sent users to edit shell profiles that were never at fault. Split the state on `command -v dart`: dart_missing keeps the PATH advice, without naming one shell's startup file; unverifiable points at the stale snapshot, the rebuild, and the /mcp reconnect a server started before the upgrade needs. Closes #171
…ording The three-part comparison in check_vgv_cli was five decision points in one expression, guarded by three `2>/dev/null` redirects that could never fire: the grep above it matches digits only. It is now one rank comparison, with the minimum derived from MIN_VERSION instead of four constants that had to agree. The 10# prefix keeps a zero-padded part such as 1.08.0 out of octal, which bash arithmetic rejects. Also scope raw and version to the function instead of leaking five globals into every sourcing hook, lift the PATH and rebuild advice into constants both hooks share, and give both PreToolUse case statements an explicit "ok" branch and default so a state added later cannot silently widen permissions.
35b51d0 to
78c0e51
Compare
|
|
||
| # The MCP server starts through the same very_good shim, so redirecting to it when the | ||
| # shim cannot exec dart would be a dead end. The reason must point at PATH instead. | ||
| no_dart |
There was a problem hiding this comment.
BASE_PATH here starts with jq's directory. On a Mac with Homebrew that's /opt/homebrew/bin, which usually has dart in it too, so no_dart can't make dart disappear and this dart_missing assertion fails locally.
Could we symlink jq into a dedicated directory (e.g. mkdir "$STUB_DIR/jq-bin" && ln -s "$(command -v jq)" "$STUB_DIR/jq-bin/jq") and put that on BASE_PATH instead of jq's whole directory?
check-vgv-cli_test.sh has the same setup. It passes only because both states expect aside, so it doesn't really test the split either.
| echo "unverifiable" | ||
| local raw version | ||
| raw=$("$vgv_bin" --version 2>/dev/null) | ||
| version=$(echo "$raw" | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) |
There was a problem hiding this comment.
Did you check what very_good --version actually prints on stdout when the shim falls back after exit 253?
It runs dart pub -v global run …, so any build/log output printed before the version line would be dropped by head -1. That would make the version unreadable even though the CLI works.
If that's the cause, matching the version line anywhere in the output (e.g. grep -m1 -oE '^[0-9]+\.[0-9]+\.[0-9]+$') might turn this case into ok instead of a warning.
|
Heads up — I'm auto-updating this PR by merging the latest |
Description
Closes #171
check_vgv_clireturnedunverifiablefor every unreadable version, and all three hooks reported it as a PATH problem. After a Dart SDK upgrade the pub shim runs a snapshot built for the old SDK, the VM rejects it, and the fallback rebuild leaves the version unreadable whiledartis on PATH the whole time — so the hooks sent users to edit shell profiles that were never at fault.The state now splits on
command -v dart.dart_missingkeeps the PATH advice, no longer naming one shell's startup file.unverifiablepoints at the stale snapshot, thevery_good --versionrebuild, and the/mcpreconnect a server started before the upgrade needs;block-cli-workarounds.shgoes back to redirecting at the MCP tool there, sincedartruns and the server is no longer a dead end.Two follow-up commits clean up the same file: one rank comparison in place of the three-part one, dead
2>/dev/nullguards removed, globals scoped to the function, both advice strings shared as constants, and an explicitokbranch and default in each PreToolUsecase.Type of Change
feat)fix)refactor)docs)ci)chore)🤖 Generated with Claude Code