Repository navigation
Conversation
… show The native dlx only ran when the first-run gate was switched off, so a plain `vis dlx <package>` started Node even in CI, where the gate skips itself without any network work. The binary now decides the gate the way the Node handler does: - `--yes`, a truthy `VIS_DLX_YES`, CI, or a stdin or stdout that is not a terminal: the gate does nothing, the package manager runs natively. - a terminal outside CI without `--yes`: the gate resolves each package against the registry and looks the version up in `~/.vis/state/dlx-seen.json`. An approved version with no Socket token makes the gate silent, so it runs natively. The packument is read through the shared registry client and cache (`inspect::Packuments`). - a version that is not approved yet (the panel and the prompt), a Socket token, `--offline`, a range spec, `--info`, or a value of a gate variable that is not ASCII are handed to Node before any output. The registry cache is written only after every package is known to be approved, so a hand-off writes nothing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
ⓘ Qodo did not review this PR because this workspace reached its daily trial limit of 100 reviews. Reviews start again at 00:00 UTC. Choose a plan to continue now. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Thank you for following the naming conventions! 🙏 |
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
Problem
vis dlx <package>started Node unless the first-run gate was switched off with--no-info. The gate skips itself in CI, off a terminal and with--yes(no network work), so most real runs paid a Node start for nothing.Change
The native
dlxnow decides the gate likesrc/dlx/first-run.ts:--yes, truthyVIS_DLX_YES, CI, stdin or stdout not a terminal--yes, version already in~/.vis/state/dlx-seen.json, noVIS_SOCKET_TOKENinspect::Packuments, new, wraps the existinginspectfetch/cache/view code)--offline, range spec,--info, non-ASCIIVIS_DLX_*valueAll reasons to delegate are decided before the manager starts, and the registry cache is written only after every package is known to be approved, so a hand-off writes nothing.
bin/route.mjs,routing.json, the route snapshot androute.test.tsare updated together.What stays in Node (honest slice)
The panel itself (size, Socket score, changelog fetched from other services, colours, y/N prompt) is not ported: it needs the changelog sources and Node's colour/width libraries to match byte for byte.
--infoand every first-run (unapproved) terminal run stay in Node. The approved-version lookup skips Node's concurrent changelog fetch, so Node's changelog cache is not filled by native runs (no output difference).Verification
cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo test -p vis-cli: green (new unit tests: gate decision table, seen-state shapes, approved-version lookup against a loopback registry stub).__tests__/native/info-dlx-parity.test.ts(714 cases, new fast-path cases incl.--yes,VIS_DLX_YES, outside CI),route.test.ts,routing-fixture.test.ts: green withFORCE_COLOR=3 CI=1 GITHUB_ACTIONS=true TERM=xterm-256color.HOMEand argv decline to Node by construction; case-sensitive FS not exercised), and a terminal run in CI needs no pty (the CI branch never reads the terminal).Cost note: a terminal run of a version that is not approved yet fetches the packument, hands over, and Node fetches it again (nothing is written by the native attempt). That happens once per package version.
Checked against the real registry: under a pty, an unapproved
zodis handed over with its reason and Node then shows its panel; with the version recorded indlx-seen.json, native and Node print the same (pnpm dlx zod hi) and leave the same cache files.🤖 Generated with Claude Code