From 2c6c0d6d3f207c84f4f681497669c315b07cc9e4 Mon Sep 17 00:00:00 2001 From: Sean Parsons Date: Sun, 6 Sep 2026 16:41:49 -0500 Subject: [PATCH 1/4] Ignore generated dist plan manifest Add `/plan-dist-manifest.json` to `.gitignore`. This keeps workspace status clean when `dist plan` runs locally. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index eae913f6..5d0630db 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ # The gateway sidecar staged for bundle.externalBin by CI before # `tauri build` (crates/workshop/tauri.conf.json); a build artifact. /crates/workshop/binaries/ +/plan-dist-manifest.json From ed07bf09b886c0d63bbcb6fa7dbcd45eeb23ed32 Mon Sep 17 00:00:00 2001 From: Sean Parsons Date: Sun, 6 Sep 2026 16:41:56 -0500 Subject: [PATCH 2/4] Add local pre-commit and pre-push Git hooks Add executable `.githooks/pre-commit` and `.githooks/pre-push` scripts to validate changes locally before they reach CI. Document the `git config core.hooksPath .githooks` setup command in `README.md`. - *Structural decisions*: hooks reside directly in `.githooks/` so developers can configure them without external tools. - *Behavior facts*: `pre-commit` executes `cargo fmt --all --check` and `pre-push` validates headless gateway compilation with `cargo check -p gateway --no-default-features`, runs `cargo clippy`, and invokes `cargo deny check` when present. --- .githooks/pre-commit | 6 ++++++ .githooks/pre-push | 16 ++++++++++++++++ README.md | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100755 .githooks/pre-commit create mode 100755 .githooks/pre-push diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..59c2f95d --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Pre-commit hook: Fast formatting check before creating commits. +set -e + +echo "==> Running cargo fmt --all --check..." +cargo fmt --all --check diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 00000000..4e978906 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Pre-push hook: Comprehensive validation before pushing to remote. +set -e + +echo "==> Checking headless gateway (AGENTS.md rule)..." +cargo check -p gateway --no-default-features + +echo "==> Running Clippy on workspace..." +cargo clippy --workspace --exclude workshop --exclude workshop-server --all-targets --all-features -- -D warnings + +if command -v cargo-deny >/dev/null 2>&1; then + echo "==> Running cargo deny check..." + cargo deny check +fi + +echo "==> Pre-push checks passed successfully." diff --git a/README.md b/README.md index a24e0c00..0022539e 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,12 @@ Rust 1.89 or later. Build, format, and test before you open a PR. CI runs `cargo fmt --check`, `clippy -D warnings`, and `cargo test --workspace`. +To enable automatic local pre-commit and pre-push validation hooks: + +```bash +git config core.hooksPath .githooks +``` + ![Creator](images/promptforge-portrait.png) ## License From 93b266f34540e7eafc50e40438552bd2169b9c61 Mon Sep 17 00:00:00 2001 From: Sean Parsons Date: Sun, 6 Sep 2026 16:42:03 -0500 Subject: [PATCH 3/4] Add npm caching to release and nightly workflows Configure `cache: npm` and `cache-dependency-path` for `actions/setup-node@v4` across nightly and release workflow definitions. Pass `--no-install-recommends` during Linux package installation in `release-workshop.yml`. - *Behavior facts*: `actions/setup-node@v4` caches `crates/*/ui/package-lock.json` dependencies in `.github/workflows/dist-ci/build-setup.yml`, `.github/workflows/nightly.yml`, and `.github/workflows/release-workshop.yml`. --- .github/workflows/dist-ci/build-setup.yml | 2 ++ .github/workflows/nightly.yml | 6 ++++++ .github/workflows/release-workshop.yml | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dist-ci/build-setup.yml b/.github/workflows/dist-ci/build-setup.yml index 2a5b8d56..356b7f0c 100644 --- a/.github/workflows/dist-ci/build-setup.yml +++ b/.github/workflows/dist-ci/build-setup.yml @@ -8,6 +8,8 @@ uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies run: npm ci --prefix crates/workshop-server/ui - name: Install config UI dependencies diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 98b68b32..0b48d917 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -66,6 +66,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies run: | npm ci --prefix crates/workshop-server/ui @@ -97,6 +99,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies run: | npm ci --prefix crates/workshop-server/ui @@ -157,6 +161,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies working-directory: crates/workshop-server/ui diff --git a/.github/workflows/release-workshop.yml b/.github/workflows/release-workshop.yml index e66b2918..5d97e760 100644 --- a/.github/workflows/release-workshop.yml +++ b/.github/workflows/release-workshop.yml @@ -66,6 +66,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies working-directory: crates/workshop-server/ui @@ -88,7 +90,7 @@ jobs: # xdg-utils: the AppImage bundler shells out to xdg-open, which the # ARM runner images do not preinstall (the x64 image does). # https://github.com/tauri-apps/tauri-action/issues/1319 - sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev xdg-utils + sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev xdg-utils # SIGNING (Windows): import the Authenticode certificate here once an # EV/OV cert exists; tauri-action picks it up from the machine store. From 8d0e95be8ee3e77cfc9337fcf09ee4b35f305146 Mon Sep 17 00:00:00 2001 From: Sean Parsons Date: Sun, 6 Sep 2026 16:42:09 -0500 Subject: [PATCH 4/4] Parallelize CI workflow checks and adopt cargo-nextest Split the monolithic `check` job in `.github/workflows/ci.yml` into separate `fmt`, `clippy`, `test`, and `docs` jobs. Install `cargo-nextest` via `taiki-e/install-action@nextest` for multi-core test scheduling, install prebuilt `cargo-deny` and `cargo-audit` binaries in `supply-chain`, and install UI dependencies across compilation jobs. - *Structural decisions*: `fmt`, `clippy`, `test`, and `docs` run as independent concurrent jobs on `ubuntu-latest`. - *Behavior facts*: `cargo-nextest` runs workspace tests concurrently across process pools in `test`, `check-workshop`, and `msrv`, while `npm ci` stages both UI trees for crates requiring build-script UI artifacts. --- .github/workflows/ci.yml | 160 +++++++++++++++++++++++++++------------ 1 file changed, 112 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d394e9e6..d65027ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,12 +16,23 @@ concurrency: # to anonymous, which is what the cache is there to make rare. env: HF_TOKEN: ${{ secrets.HF_TOKEN }} + RUSTUP_TOOLCHAIN: stable jobs: - check: + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Format + run: cargo fmt --all --check + + clippy: runs-on: ubuntu-latest - # RUSTUP_TOOLCHAIN outranks the repo's rust-toolchain.toml (pinned to the - # MSRV for local builds); this job means to test stable. env: RUSTUP_TOOLCHAIN: stable steps: @@ -29,7 +40,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: - components: rustfmt, clippy + components: clippy - name: Cache cargo uses: Swatinem/rust-cache@v2 @@ -40,35 +51,52 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies - working-directory: crates/workshop-server/ui - run: npm ci - - - name: Install config UI dependencies - working-directory: crates/gateway-config-ui/ui - run: npm ci - - - name: Format - run: cargo fmt --all --check + run: | + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui - # The desktop packages stay in their platform jobs because Linux needs - # Tauri system libraries. All gateway and STT features are pure Rust - # now that whisper.cpp is loaded from a managed runtime artifact. - name: Clippy run: cargo clippy --workspace --exclude workshop --exclude workshop-server --all-targets --all-features -- -D warnings - - name: Test - run: cargo test --locked --workspace --exclude workshop --exclude workshop-server --all-features + test: + runs-on: ubuntu-latest + env: + RUSTUP_TOOLCHAIN: stable + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - name: Cache the embedding model + uses: ./.github/actions/hf-model-cache + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json + + - name: Install UI dependencies + run: | + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui + + - name: Test (concurrent via nextest) + run: cargo nextest run --locked --workspace --exclude workshop --exclude workshop-server --all-features - name: Doctests run: cargo test --workspace --exclude workshop --exclude workshop-server --all-features --doc - - name: Docs - env: - RUSTDOCFLAGS: -D warnings - run: cargo doc --workspace --no-deps --all-features --exclude workshop --exclude workshop-server - - name: Check headless gateway run: cargo check -p gateway --no-default-features @@ -83,6 +111,36 @@ jobs: exit 1 fi + docs: + runs-on: ubuntu-latest + env: + RUSTUP_TOOLCHAIN: stable + RUSTDOCFLAGS: -D warnings + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - name: Cache the embedding model + uses: ./.github/actions/hf-model-cache + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json + + - name: Install UI dependencies + run: | + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui + + - name: Docs + run: cargo doc --workspace --no-deps --all-features --exclude workshop --exclude workshop-server + check-workshop: runs-on: windows-latest env: @@ -94,6 +152,9 @@ jobs: with: components: clippy + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + - name: Cache cargo uses: Swatinem/rust-cache@v2 @@ -103,16 +164,19 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies - working-directory: crates/workshop-server/ui - run: npm ci + run: | + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui - name: Clippy (workshop) run: cargo clippy -p workshop -p workshop-server --all-targets -- -D warnings - - name: Test (workshop) - run: cargo test --locked -p workshop -p workshop-server + - name: Test (workshop, concurrent via nextest) + run: cargo nextest run --locked -p workshop -p workshop-server - name: Clean tree shell: bash @@ -146,15 +210,18 @@ jobs: - name: Install Tauri system packages run: | sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev + sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies - working-directory: crates/workshop-server/ui - run: npm ci + run: | + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui - name: Build (workshop, Linux) run: cargo build --locked -p workshop @@ -179,6 +246,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies working-directory: crates/workshop-server/ui @@ -220,8 +289,9 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.89.0 - with: - components: rustfmt + + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest - name: Cache cargo uses: Swatinem/rust-cache@v2 @@ -232,31 +302,25 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + cache: npm + cache-dependency-path: crates/*/ui/package-lock.json - name: Install UI dependencies - working-directory: crates/workshop-server/ui - run: npm ci - - - name: Install config UI dependencies - working-directory: crates/gateway-config-ui/ui - run: npm ci - - - name: Build and test on MSRV run: | - cargo build --locked --workspace --exclude workshop --exclude workshop-server --all-features - cargo test --locked --workspace --exclude workshop --exclude workshop-server --all-features + npm ci --prefix crates/workshop-server/ui + npm ci --prefix crates/gateway-config-ui/ui + + - name: Test on MSRV + run: cargo nextest run --locked --workspace --exclude workshop --exclude workshop-server --all-features supply-chain: runs-on: ubuntu-latest - env: - RUSTUP_TOOLCHAIN: stable steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - - name: Install cargo-deny and cargo-audit - run: cargo install cargo-deny cargo-audit --locked + - uses: taiki-e/install-action@v2 + with: + tool: cargo-deny, cargo-audit - name: cargo deny run: cargo deny check