8000 quint: add 0.33.1, with its Rust evaluator built from source by bryan-minimal · Pull Request #1611 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

quint: add 0.33.1, with its Rust evaluator built from source - #1611

Merged
bryan-minimal merged 1 commit into
mainfrom
add-quint
Nov 21, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
add-quint

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

Summary

Adds quint, the Quint specification language CLI (npm @informalsystems/quint 0.33.1, the latest release), for the fv-lab formal-verification loadout.

Quint's simulator would otherwise download a prebuilt binary at run time. quint run, quint test and quint repl default to --backend rust. On first use, upstream fetches the quint_evaluator binary from the GitHub release evaluator/v0.7.1 into $QUINT_HOME (~/.quint). That download has no pin and no hash. This package builds that evaluator from source with our rust. It then patches the lookup to return the packaged copy, so quint never downloads it.

Changes

  • packages/quint/
    • npm half: follows the AGENTS.md "Node pattern". It runs npm ci --omit=dev --ignore-scripts from a committed package-lock.json (79 packages, all from registry.npmjs.org) and installs into usr/libexec/quint.
      • The bin is a relative symlink.
      • Runtime deps are subsetOf node-lts ["node"] and coreutils (for env).
      • No dependency ships or downloads a native binary. There are no os/cpu-specific optional deps. The only install script is protobufjs's postinstall, which only warns about its version scheme, so --ignore-scripts loses nothing.
    • Evaluator half: builds quint_evaluator from the quint-co/quint tag evaluator/v0.7.1 with cargo build --release --locked and --remap-path-prefix.
      • The source is mirrored create-only at gs://minimal-staging-archives/quint-co/quint/evaluator-v0.7.1.tar.gz (sha256 5d4cd64a…5432).
      • The binary is installed at usr/libexec/quint/bin/quint_evaluator.
      • Its runtime deps are glibc and subsetOf gcc ["libgcc"].
    • Patch: one line at the top of getRustEvaluatorPath() in dist/src/rust/binaryManager.js returns the packaged binary, using a path relative to __dirname. That function is the only caller of the download code. build.sh fails closed in three cases:
      • the function signature isn't found exactly once;
      • the patch doesn't apply;
      • node resolving the patched function doesn't return the installed binary.
    • Version guard: evaluator_version must equal the QUINT_EVALUATOR_VERSION that the quint release pins. Otherwise the build fails. If a quint bump moves the evaluator, the build stops, and a reviewer bumps evaluator_version and the evaluator Source. The updater lists that Source as "not updated — verify".

Testing (arm64, local min session; amd64 is up to build-bot)

  • min package build --rebuild --verbose quint: build finished.
  • min check --packages quint: all Pass, including standalone tests.
  • Standalone tests:
    • version_check: quint --version prints exactly 0.33.1.
    • simulate: runs with HOME and QUINT_HOME pointed at empty directories.
      • Runs quint typecheck.
      • Runs quint run on both --backend rust and --backend typescript. A holding invariant must report No violation found. A violated invariant (x < 3) must fail.
      • Fails if quint prints Fetching Rust evaluator or writes anything into QUINT_HOME.
  • Negative control: I removed the evaluator patch from build.sh and ran a fresh session (activate, build, check). Standalone tests showed Fail (simulate). I then restored the patch.
  • Manual run in the session: the Rust backend's trace output came from the packaged evaluator, with no fetch and QUINT_HOME left empty.

quint verify / Apalache (not packaged; a later batch)

quint verify still downloads Apalache at run time, and so does --backend tlc, which uses the Apalache jar.

  • What it does: it first tries an Apalache server at localhost:8822. Failing that, it downloads https://github.com/apalache-mc/apalache/releases/download/v0.62.4/apalache.tgz with no hash check. That is about 188 MB unpacked, into $QUINT_HOME/apalache-dist-0.62.4/. It then runs apalache-mc, which needs java on PATH.
  • Observed in a session with network and no JDK: Downloading Apalache distribution 0.62.4... done., then apalache-mc: line 83: exec: java: not found, exit 1.
  • Without network: it fails at the fetch.
  • Either way: it reports an error and verifies nothing. It never silently passes.

A follow-up can package Apalache and point quint at it, the same way this PR does for the evaluator.

Notes for reviewers

  • This doesn't use pkgmgr import npm's exact output: no pkgmgr binary was available, and Rust can't be built on the host. The layout is the same as prettier's import: package.json pins the exact version, plus a lockfile and the version-drift guard.
  • License: upstream's package.json says "Apache 2.0", which is not valid SPDX. The repo LICENSE is Apache-2.0, so the attr is Apache-2.0.
  • source_provenance is quint-co/quint. The repo also carries evaluator/v* tags. The pinned CLI version is the bare v0.33.1 tag series.

🤖 Generated with Claude Code

The Quint specification language CLI (npm @informalsystems/quint), for the
fv-lab loadout. Node pattern: `npm ci` from a committed lockfile into
usr/libexec/quint, runtime `subsetOf node-lts ["node"]`.

`quint run`/`test`/`repl` default to `--backend rust`, whose binary upstream
downloads from a GitHub release into ~/.quint on first use. build.sh builds
that evaluator (quint-co/quint tag evaluator/v0.7.1, --locked) and patches
getRustEvaluatorPath() to return the packaged binary, so nothing is fetched at
run time. A guard fails the build if a quint bump asks for another evaluator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 20, 2026 20:35
@coderabbitai
coderabbitai Bot commented Nov 20, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 38 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 67 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 03aa958 and a21a65f.

Files ignored due to path filters: 1

  • packages/quint/package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 3

  • packages/quint/build.ncl
  • packages/quint/build.sh
  • packages/quint/package.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope matches the title. The diff adds four files under packages/quint/ and touches nothing else. Clobber none: all four files are new.

Correctness The npm half follows the Node pattern of packages/prettier and packages/vlt: node-lts, subsetOf node-lts ["node"], a private usr/libexec/quint tree and a relative bin symlink. The Rust half uses the same RUSTFLAGS and cargo build --release --locked shape as packages/wasm-bindgen-cli/build.sh. The patched path climbs six directories from dist/src/rust/ to usr/libexec/quint, which is correct. The three build guards fail closed. The lockfile has 79 entries, all from registry.npmjs.org, with one install script (protobufjs) and no os or cpu specific entries. I found one test defect and one comment nit.

Not checked I did not build the package. The sandbox denied the download of the npm tarball, so I did not read upstream binaryManager.js. These claims rest on the PR text only: getRustEvaluatorPath() is the only caller of the download code, the file binds path_1, and quint prints Fetching Rust evaluator. The build-time node check covers the second claim. The sandbox also denied the grype scan, and trivy and gitleaks are not installed, so no advisory scan ran on the lockfile. I read every line of the diff and saw no credential.

Comment thread packages/quint/build.ncl
fi
grep -qi 'violation' bad.log || { cat bad.log; exit 1; }
done
if grep -qi 'fetching rust evaluator' ok.log bad.log; then echo "quint tried to download its evaluator" >&2; exit 1; fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low · The fetch check reads ok.log and bad.log after the loop. Each iteration overwrites both files, and typescript runs last. The grep sees only the typescript backend output, which never fetches the evaluator. The rust backend output is gone, so this check cannot fail. The QUINT_HOME check on the next line is the only effective guard. Move the grep inside the loop, or write the logs to ok-$b.log and bad-$b.log and grep all four. This is one instance: no other package test has this shape.

Comment thread packages/quint/build.ncl
url = "gs://minimal-staging-archives/quint-co/quint/evaluator-v%{evaluator_version}.tar.gz",
sha256 = "5d4cd64a69f5d8b61ed800ed14044899930029c7c14f160d0aedc212a1bf5432",
# a GitHub archive under a renamed file; build.sh unpacks it
extract = false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit · The comment does not say why extract = false is necessary. The mirrored file is a .tar.gz, which Source extraction supports. Other mirror sources such as packages/grype/build.ncl use extract = true with strip_prefix. The comment has the shape of packages/wasm-bindgen-cli/build.ncl:22, where the reason is a .crate extension. If the reason is that the repo root must not unpack over the Local package.json, say that. If there is no reason, use extract = true and drop the tar line in build.sh.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 2f8d806 Nov 21, 2026
16 checks passed
@bryan-minimal
bryan-minimal deleted the add-quint branch November 21, 2026 16:59
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.

2 participants

0