Skip to content

feat(vis): answer security sync natively for pnpm workspaces - #257

Merged
prisis merged 5 commits into
nextfrom
feat/native-security-sync
Nov 25, 2026
Merged

prisis merged 5 commits into
nextfrom
feat/native-security-sync

Conversation

@prisis

@prisis prisis commented Nov 25, 2026

Copy link
Copy Markdown
Member

What

vis security sync now runs in the native binary for pnpm workspaces, without starting Node. It pushes security.policies.installScripts.allow and security.policies.firstSeen of vis.config into pnpm-workspace.yaml and package.json, and prints the same pail lines as the Node command.

The command makes no request, so it doesn't use the HTTP client (native/cli/src/http/ is untouched).

Native

  • A unix CI run off a terminal at the root of a pnpm workspace, with pail's layout decided by the environment.
  • security sync with --skip-allow-builds and/or --skip-min-release-age, each at most once, in either order.
  • A vis.config readable as data (the reader of security list, now shared through sync_input). A config without a security block syncs the loader's defaults, like Node.
  • Edits to pnpm-workspace.yaml follow the line rules of the Node code (a block ends at the first line without two blanks). The file is read through the strict grammar of security list where Node parses it.
  • package.json goes through the JS-faithful JSON module.
  • Files are written like @visulima/fs does: a sibling temporary file renamed over the target. Everything is staged before the first rename.

Node resets a rewritten file's mode to the default for a new file, so native does too. The parity suite compares modes.

Handed to Node before any output or write

  • Any other argument, any non-pnpm package manager, non-CI runs, Windows.
  • A config Node must evaluate, a truthy allow value that isn't true, names containing $ or outside ASCII, or non-integer minutes.
  • A yaml or json outside the supported subset (CRLF, tabs when allowBuilds is read, nested maps, inline comments, fractions in package.json).
  • A locale other than the root collation, and any run whose log lines would wrap.
  • A failure to stage the files or to replace the first one.

Tests

  • Rust unit tests for the text edits, the planner and the writer.
  • security-sync-parity.test.ts: native vs Node for stdout, stderr, exit status, written bytes and file modes, plus the declined cases (exit 70, files untouched), also under FORCE_COLOR=3/CI colour environments.
  • Routing: launcher gate in bin/route.mjs, route.rs, the shared routing.json cases and the route snapshot.

The first commit is the two-line import fix from #252, so this branch compiles on next; it merges cleanly with #252.

Not verified: Windows (the command is declined there) and Linux (only run on macOS here).

🤖 Generated with Claude Code

prisis and others added 3 commits November 25, 2026 12:50
The run summary and the security scan still imported the JSON type through
`sort_package_json::json`, a path that stopped being public when the module
moved to `crate::json`. Both merged branches compiled alone; together on
`next` the native build failed with E0603.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`vis security sync` pushes `security.policies.installScripts.allow` and
`security.policies.firstSeen` of vis.config into `pnpm-workspace.yaml` and
`package.json`. It makes no request, so the native path is a port of the file
edits and the pail output, gated like `security list`: a unix CI run off a
terminal at the root of a pnpm workspace, a config readable as data, and
pail's layout decided by the environment.

The yaml is edited with the same line rules as the Node code (a block ends at
the first line without two blanks) and read through the strict grammar of
`security list`; `package.json` goes through the JS-faithful JSON module. The
files are written like `@visulima/fs` does: a sibling temporary file, renamed
over the target, after every file is staged. Whatever the port cannot
reproduce exactly is handed to Node before anything is printed or written:
other flags, other package managers, truthy allow values other than `true`,
names with `$` or outside ASCII, yaml or json outside the supported grammar,
a non-root collation, and messages that would wrap.

Adds the launcher gate, the route row, the shared routing cases and a
native-vs-Node parity suite that also compares file modes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e path

The module no longer needs a unix-only gate (the run itself is still declined
off unix by the CI-root context), so nothing is dead code on Windows. A
failure to replace the first file now hands the run to Node, since no target
has changed by then.

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: 358af68e-068e-45e8-8722-785cd43eef61

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

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions github-actions Bot added vouch:trusted PR author is a collaborator, a bot or on the VOUCHED list. package: vis labels Nov 25, 2026
Drop a one-use binding and correct a doc comment.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:XXL Size of the change, tests and generated files excluded. label Nov 25, 2026
@prisis
prisis deployed to benchmarks November 25, 2026 12:34 — with GitHub Actions Active
@codspeed

codspeed Bot commented Nov 25, 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 feat/native-security-sync (511d159) 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 (91e8f92) 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. ↩

# Conflicts:
#	packages/tooling/vis/native/cli/tests/fixtures/routing.json
@prisis
prisis deployed to benchmarks November 25, 2026 13:35 — with GitHub Actions Active
@prisis
prisis merged commit c8c3ce2 into next Nov 25, 2026
31 of 32 checks passed

This branch was successfully deployed

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

Labels

package: vis size:XXL 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