Supply chain
Merlion ships no third-party code to users. Every published artifact has zero runtime dependencies, and every release can be traced to a tagged commit.
Dependency policy
Section titled “Dependency policy”| Artifact | Runtime dependencies | Enforcement |
|---|---|---|
merlion-render |
0 | [dependencies] must be empty; CI fails otherwise |
merlion-cli |
0 besides the core | Same check; arguments are parsed with std::env::args |
merlion-wasm |
0 besides the core | No wasm-bindgen, js-sys or web-sys |
@fractalboxdev/merlion-wasm, @fractalboxdev/merlion-rehype, @fractalboxdev/merlion-astro, @fractalboxdev/merlion-view |
0 | "dependencies": {} is checked in CI; peerDependencies only where the host framework is already present (astro for @fractalboxdev/merlion-astro) |
Development dependencies (the test runner, fuzzer, benchmark harness, wasm-opt, and the release tooling) are allowed. They are pinned by lockfile, and none reach a published artifact.
Adding any runtime dependency needs an ADR. It must name the dependency, its licence, its full transitive tree, and why writing the code is worse.
Controls
Section titled “Controls”- Rust:
cargo-denychecks licences (allow-list: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, Unicode-3.0, Zlib), advisories, duplicate versions and sources (crates.io only, no git dependencies).cargo-vetrecords an audit for every development dependency. - npm: the lockfile is committed and CI installs with
--ignore-scripts. Every published package’sfilesfield is an allow-list. - No network in builds:
build.rsscripts don’t exist in the published crates, and generated sources (the font tables) are committed. A build needs onlyrustcand the crate sources. - Font inputs: the Inter source files are pinned by SHA-256 in
tools/fontgen. The generator refuses a font whose hash differs.
Releases
Section titled “Releases”-
Tags. Only maintainers can create
v*tags (a repository tag ruleset). The release workflow (.github/workflows/release.yml) first verifies the tag’s SSH signature against.github/allowed_signersas it stands onmain, never the tagged commit’s copy, and requires the tagged commit to be reachable frommain; it stops if either check fails. -
Release workflow. One workflow, triggered only by a
v*tag push, holdsid-token: write. It runs in a protectedreleaseenvironment with required reviewers, uses no caches shared with other workflows, and pins every action by commit SHA. No workflow triggered bypull_request_targetexists, and no workflow that runs third-party input (the benchmark, which renders external corpora in headless Chromium) has publish permissions. -
Versions. The five npm packages version in lockstep: every
packages/*/package.jsoncarries the tag’s version, and every peer range on another@fractalboxdev/merlion-*package names exactly that version.scripts/release-check.mjsenforces both, against the tag in the release workflow and against the current version inpnpm test, and prints the publish order, which puts each package after the peers it names. -
Registry. The npm packages publish to GitHub Packages (
https://npm.pkg.github.com), which accepts only the repository owner’s scope, hence@fractalboxdev. Every package’spublishConfig.registrynames it, so no publish reaches another registry. The publish job authenticates with the workflow’sGITHUB_TOKEN(packages: write); no registry token is stored. GitHub Packages takes nonpm --provenance, so the release attests every packed tarball as it attestsmerlion.wasm(gh attestation verify <tarball> --repo fractalboxdev/merlion). -
npm packages are packed with
pnpm pack, which rewritesworkspace:ranges. A version with a prerelease suffix publishes under thenextdist-tag. A package already on the registry at that version is skipped, so a release that failed partway re-runs cleanly. -
Consumers. GitHub Packages requires authentication even for public packages. A consumer maps the scope in
.npmrcand supplies a token withread:packages(in GitHub Actions, the workflow’sGITHUB_TOKENwithpackages: read):@fractalboxdev:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} -
Cutting a release. Bump every
packages/*/package.jsonversion and the internal peer ranges, merge tomain, then frommain:git tag -s v<version> -m v<version>andgit push origin v<version>. Thereleaseenvironment’s reviewers approve the publish job. -
crates.io publishing uses trusted publishing (OIDC), with no stored token.
-
Reproducible artifacts. Binaries and the
.wasmfile are built reproducibly (pinned toolchain viarust-toolchain.toml,--remap-path-prefix,SOURCE_DATE_EPOCH), and their SHA-256 values (SHA256SUMS, attached to the GitHub release withmerlion.wasm) and build attestations (gh attestation verify merlion.wasm --repo fractalboxdev/merlion) are published with the release. A second job rebuilds from the tag on a different runner image and operating system family, and fails the release if any hash differs, so a single compromised image can’t produce matching bad artifacts. The build recipe is documented so that anyone can reproduce the hashes. -
Derived artifacts. The npm
.wasmand the binaries bundled inmerlion-vscodeare the attested release artifacts, checked by hash, never rebuilt (integrations.md). -
merlion.wasmSha256.packages/merlion-wasm/scripts/build-wasm.shrecords the.wasmfile’s SHA-256 inpackage.json, so the committed value is empty until a build writes one. Its test suite holds the field to a hash or nothing, never a malformed value, and requires a hash underMERLION_RELEASE=1, which the release workflow sets. The value is meaningful only against the release attestation, so the comparison against the file on disk runs under that flag alone: a local build runs an unpinned toolchain withoutSOURCE_DATE_EPOCHand reproduces no attested hash, so the test skips with that reason instead of failing every working copy.