Skip to content

feat(vis): answer vis status natively when no Node version is pinned - #261

Open
prisis wants to merge 3 commits into
nextfrom
t3/native-status
Open

prisis wants to merge 3 commits into
nextfrom
t3/native-status

Conversation

@prisis

@prisis prisis commented Nov 25, 2026

Copy link
Copy Markdown
Member

What

vis status (text and --json) now runs in the native binary in a CI run off a terminal, with output byte for byte equal to the Node handler's, colour codes included.

Why it was thought to be blocked, and is not

status reads no task graph. Its numbers come from the project graph (graph.rs), the script targets list already extracts (list::unique_target_count, a small export), and the run summaries under .vis/runs (flaky task count and cache hit rate), which the new status.rs reads. The base is next; this PR is independent of the graph PR (#260).

What stays Node

Each of these is decided before anything is printed (the parity suite checks exit 70 and an untouched tree for every one):

  • a root with engines, devEngines or packageManager in package.json, or a .nvmrc / .node-version: the runtime findings compare these with the running Node, which the binary is not. Every other root has no findings. (A native answer for pinned roots needs a decision on which Node's version counts once Node is no longer the host; raising it as an open question.)
  • everything list leaves to Node: a vis.config.* (so constraints, which live in the config, are always 0 here), an inference detector in a project, a project without scripts, project.json, overlays, non-ASCII names, non-pnpm roots
  • run history it cannot read like Node: a file that is not strict JSON (BOM included), a retryAttempts or stats.cached/total that is not a number or null (JavaScript would coerce), a null summary, a task without a target or a non-string id, a .vis/runs that is a file, a *.json entry that is a directory or has a non-UTF-8 / non-ASCII name
  • any flag (--json once is the only one), extra arguments, a terminal, a colour flag, Windows

Details worth a look

  • The hit rate rounds a tie up like toFixed(0) (1/8 is 13%, not the 12% of round-half-even); unit-tested and checked against Node.
  • exitCode: null counts as a failure and retryAttempts: null as none, as in analyzeFlakiness.
  • loadRunSummaries falls back to .vis/last-summary.json only when no run file parsed; same here.

Routing

bin/route.mjs, route.rs, routing.json (the old status --json row stays for the non-CI shape) and the route snapshot are updated together.

Tests

  • __tests__/native/status-parity.test.ts (98 cases, text and JSON, plus colour environments and a run from a project directory) uses the workspace harness: from-scratch environment, exit 70 for declined runs without the Node entry, tree snapshot unchanged.
  • Unit tests in status.rs; cargo fmt --all --check, cargo clippy --all-targets -- -D warnings, cargo test -p vis-cli clean; list-parity, routing-fixture, route still pass. All with FORCE_COLOR=3 CI=1 GITHUB_ACTIONS=true TERM=xterm-256color.

Unverified locally: Linux (non-UTF-8 file names are declined, run files are read in sorted order for the 20-run window).

Base: next.

🤖 Generated with Claude Code

The overview needs the project graph, the script targets `list` already
reads and the run summaries under `.vis/runs`; none of it needs a task
graph. The binary now prints the text view and `--json` in a CI run off a
terminal, byte for byte as the Node handler does.

The runtime findings compare the root manifest and `.nvmrc` with the
running Node, which the binary is not, so a root with `engines`,
`devEngines`, `packageManager` or a Node version file goes to Node, as do
the cases `list` leaves to Node (a config file, an inference detector, a
project without scripts). A run summary that is not strict JSON, a
`retryAttempts` or `stats` count whose JavaScript behaviour depends on its
type, and a task without a target are handed to Node before anything is
printed. The hit rate rounds a tie up, as `toFixed(0)` does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

ⓘ 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.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dfc135e2-7b5f-4f36-b71b-bad68e2cd489

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the vouch:trusted PR author is a collaborator, a bot or on the VOUCHED list. label Nov 25, 2026
@github-actions github-actions Bot added size:L Size of the change, tests and generated files excluded. package: vis labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

prisis and others added 2 commits November 26, 2026 00:57
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@prisis
prisis deployed to benchmarks November 25, 2026 23:59 — with GitHub Actions Active
@codspeed

codspeed Bot commented Nov 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

🆕 3 new benchmarks
⏩ 113 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 transform/transform_ts[470] N/A 355.3 µs N/A
🆕 transform/transform_ts[47000] N/A 16 ms N/A
🆕 transform/transform_ts[9400] N/A 3.3 ms N/A

Comparing t3/native-status (d1e81b9) with next (1078fa9)2

Open in CodSpeed

Footnotes

  1. 113 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on next (c8c3ce2) during the generation of this report, so 65c051d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

This branch was successfully deployed

1 active deployment
benchmarks — d1e81b9a Deployed Nov 25, 2026 by prisis via Bench native (vis) #442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: vis size:L Size of the change, tests and generated files excluded. vouch:trusted PR author is a collaborator, a bot or on the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant