Repository navigation
quint: add 0.33.1, with its Rust evaluator built from source - #1611
Conversation
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>
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
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. View limit details
|
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
| 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, |
There was a problem hiding this comment.
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.
Summary
Adds
quint, the Quint specification language CLI (npm@informalsystems/quint0.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 testandquint repldefault to--backend rust. On first use, upstream fetches thequint_evaluatorbinary from the GitHub releaseevaluator/v0.7.1into$QUINT_HOME(~/.quint). That download has no pin and no hash. This package builds that evaluator from source with ourrust. It then patches the lookup to return the packaged copy, so quint never downloads it.Changes
packages/quint/npm ci --omit=dev --ignore-scriptsfrom a committedpackage-lock.json(79 packages, all from registry.npmjs.org) and installs intousr/libexec/quint.subsetOf node-lts ["node"]andcoreutils(forenv).postinstall, which only warns about its version scheme, so--ignore-scriptsloses nothing.quint_evaluatorfrom thequint-co/quinttagevaluator/v0.7.1withcargo build --release --lockedand--remap-path-prefix.gs://minimal-staging-archives/quint-co/quint/evaluator-v0.7.1.tar.gz(sha2565d4cd64a…5432).usr/libexec/quint/bin/quint_evaluator.glibcandsubsetOf gcc ["libgcc"].getRustEvaluatorPath()indist/src/rust/binaryManager.jsreturns 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:noderesolving the patched function doesn't return the installed binary.evaluator_versionmust equal theQUINT_EVALUATOR_VERSIONthat the quint release pins. Otherwise the build fails. If a quint bump moves the evaluator, the build stops, and a reviewer bumpsevaluator_versionand the evaluatorSource. The updater lists that Source as "not updated — verify".Testing (arm64, local
minsession; amd64 is up to build-bot)min package build --rebuild --verbose quint: build finished.min check --packages quint: all Pass, including standalone tests.version_check:quint --versionprints exactly0.33.1.simulate: runs withHOMEandQUINT_HOMEpointed at empty directories.quint typecheck.quint runon both--backend rustand--backend typescript. A holding invariant must reportNo violation found. A violated invariant (x < 3) must fail.Fetching Rust evaluatoror writes anything intoQUINT_HOME.activate, build,check). Standalone tests showed Fail (simulate). I then restored the patch.QUINT_HOMEleft empty.quint verify/ Apalache (not packaged; a later batch)quint verifystill downloads Apalache at run time, and so does--backend tlc, which uses the Apalache jar.localhost:8822. Failing that, it downloadshttps://github.com/apalache-mc/apalache/releases/download/v0.62.4/apalache.tgzwith no hash check. That is about 188 MB unpacked, into$QUINT_HOME/apalache-dist-0.62.4/. It then runsapalache-mc, which needsjavaon PATH.Downloading Apalache distribution 0.62.4... done., thenapalache-mc: line 83: exec: java: not found, exit 1.A follow-up can package Apalache and point quint at it, the same way this PR does for the evaluator.
Notes for reviewers
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.jsonpins the exact version, plus a lockfile and the version-drift guard."Apache 2.0", which is not valid SPDX. The repo LICENSE is Apache-2.0, so the attr isApache-2.0.source_provenanceisquint-co/quint. The repo also carriesevaluator/v*tags. The pinned CLI version is the barev0.33.1tag series.🤖 Generated with Claude Code