Skip to content

Add locked and offline dependency modes - #9

Merged
LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/locked-offline-mode
Aug 7, 2026
Merged

LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/locked-offline-mode

Conversation

@LunaStev

@LunaStev LunaStev commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Add --locked to vex build, run, check, and fetch.
  • Add --offline to the same package-oriented commands.
  • Prevent lockfile creation or modification in locked mode.
  • Prohibit Git clone and fetch operations in offline mode while still allowing local checkout changes to an available locked commit.
  • Reject --locked and --offline with vex update, which intentionally refreshes refs and rewrites the lockfile.
  • Expand the Git graph integration test to cover missing locks, offline reuse, missing checkouts, exact-SHA restoration, and manifest/lock mismatches.
  • Add GitHub Actions CI for formatting, unit and integration tests, Clippy, and builds.

Why

Vex already pins transitive Git dependencies, but callers could not require that vex.lock remain unchanged or guarantee that a command would avoid the network. That made strict CI and disconnected builds difficult to express.

These modes turn the existing reproducibility behavior into enforceable policy without exposing raw compiler flags or introducing a central registry.

Behavior

  • --locked requires a version 2 lockfile that exactly matches the manifest graph. Missing or stale lockfiles fail with instructions to run vex fetch.
  • --locked may download a commit already pinned by the lockfile when its managed checkout is missing.
  • --offline never clones or fetches. It can switch an existing checkout to a locally available locked commit.
  • Missing offline checkouts or commits fail with cause context and instructions to fetch while online.
  • --locked --offline provides the strictest reproducible build mode.

Validation

  • cargo fmt --check
  • cargo test --locked (14 unit tests and 1 Git integration test passed)
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo build --locked
  • Smoke tested vex run --locked --offline; output: Hello World.
  • Smoke tested rejection of vex update --offline.
  • The integration test verifies exact locked SHA preservation and restoration without allowing offline network fallback.

@LunaStev
LunaStev marked this pull request as ready for review August 7, 2026 03:09
@LunaStev
LunaStev merged commit 0323c96 into wavefnd:master Aug 7, 2026
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.

1 participant