This repository favors small, verified changes. Read the relevant code first, make the smallest safe diff, and document user-visible behavior changes.
- Git
- Rust toolchain from
rust-toolchain.toml curl,tar, andinstallfor installer smoke testsjustfor repository recipesmisefor hk hook/tool provisioning- Node.js 24 and pnpm 11 for
pi-mark - Nix, optional but preferred for a complete local shell
Do not install global tools just to work in the repo when nix develop or the
checked-in package manager setup is available.
Preferred:
nix develop
just setupWithout Nix:
cargo fetch --locked
cargo build -p mark-cli --lockedInstall global hk Git hooks:
just hookshk's global hooks require Git 2.54 or newer. The Nix development shell provides
a new enough Git. The hook command is a no-op in repositories without hk.pkl.
This repository's pre-commit hook runs fast staged-file checks and safe fixers;
pre-push enables the slower full and pi profiles for affected files.
just check
just ci-check
mise x -- hk check --all --plan
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --all-targets --all-features --locked
cargo build -p mark-cli --lockedFor the Pi package:
cd pi-mark
pnpm install
pnpm run checkRun the local extension from the repository root with:
pi -e ./pi-mark/extensions/pi-mark.tsUse the cheapest check that proves the change first:
rust-analyzer diagnostics .cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warnings- Focused unit test, for example
cargo test -p mark-tui filter - Focused integration or smoke test
cargo test --workspace --all-targets --all-features --lockedcargo build --workspace --all-targets --all-features --locked
Full builds are most useful for public API changes, build config changes, dependency changes, generated code, toolchains, release packaging, or broad cross-crate behavior.
Installer and update smoke test:
scripts/smoke-installer-updateInteractive error-pane smoke test:
scripts/test-diff-error-paneThe interactive smoke test must run in a terminal.
scripts/build-pgo produces a profile-guided release mark binary:
it builds instrumented binaries, trains on the committed engine corpora and
bench fixtures, merges the profiles with llvm-profdata (needs
rustup component add llvm-tools), and rebuilds with -Cprofile-use.
Engine-bound corpora run 15–35% faster than a plain release build
(docs/performance-reports/2026-07-12-engine-optimization.md). Retrain
whenever the engine or the global allocator changes materially — a stale
profile silently forfeits most of the gain.
The main mark binary release uses GitHub Releases.
- Update the workspace package version in
Cargo.toml. - Merge the change.
- Push a
vX.Y.Ztag, or run the Release workflow manually.
The Release workflow builds macOS and Linux assets named like:
mark-vX.Y.Z-aarch64-apple-darwin.tar.gz
mark-vX.Y.Z-x86_64-apple-darwin.tar.gz
mark-vX.Y.Z-aarch64-unknown-linux-gnu.tar.gz
mark-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz
Those names are part of the installer contract.
The Nightly workflow publishes the latest main commit to a mutable vnightly
GitHub prerelease. The installer treats it as an explicit version channel:
curl -fsSL https://raw.githubusercontent.com/phongndo/mark/main/scripts/install.sh | MARK_VERSION=nightly shNightly replaces the active mark binary. Users switch back to the latest
stable semver release with:
mark updateKeep vnightly marked as a prerelease and not latest. The installer only
resolves semver tags like v0.8.0 for the default latest channel, so stable
updates do not accidentally install nightly.
Nightly builds set MARK_BUILD_CHANNEL=nightly, so mark --version includes
the channel and source commit.
pi-mark is published separately to npm.
- Update
pi-mark/package.jsonversion. - Merge the change.
- Run the
Publish pi-markworkflow.
The workflow validates the package, publishes with npm provenance, and can
create a pi-mark-vX.Y.Z GitHub release.