diff --git a/.github/workflows/port-contract.yml b/.github/workflows/port-contract.yml deleted file mode 100644 index 2de174291..000000000 --- a/.github/workflows/port-contract.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: port-contract - -on: - push: - branches: [main] - pull_request: - -permissions: - contents: read - -concurrency: - group: port-contract-${{ github.ref }} - cancel-in-progress: true - -# The WS contract must never drift silently again (it did: PR #498 era -# amplifier.activity.*, 317e2ea1 terminal.idle, eef9b344 partial regen). -# No path filter on purpose: generator output also depends on the -# typescript/zod toolchain, so lockfile bumps must run this too. -jobs: - contract: - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Contract freeze suite (TS drift guard) - run: npm run test:port - - - name: Regen idempotency (contract:generate must produce no diff) - run: | - npm run contract:generate - git diff --exit-code -- port/contract - - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.96.0 - - - uses: Swatinem/rust-cache@v2 - - - name: Rust T0 surface (freshell-protocol) - run: cargo test -p freshell-protocol --locked - - # The mode-preamble baselines (port/oracle/baselines/mode-preamble/) - # are consumed by freshell-terminal's fixture test — without this step - # the cross-language tracker contract is unpinned in CI (G5-A1). - - name: Mode-preamble fixture contract (freshell-terminal) - run: cargo test -p freshell-terminal --locked diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml deleted file mode 100644 index a6daf1a70..000000000 --- a/.github/workflows/rust-clippy.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Rust Clippy - -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -concurrency: - group: rust-clippy-${{ github.ref }} - cancel-in-progress: true - -jobs: - clippy: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - # Pinned toolchain (NOT @stable): keeps green-local <=> green-CI deterministic. - # Current stable (1.97.x) already adds default-warn lints this branch was not - # validated against. Bump this pin deliberately: update the version, re-run the - # gate locally on that toolchain, fix new lints in the same PR. - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.96.0 - components: clippy, rustfmt - - - uses: Swatinem/rust-cache@v2 - - # freshell-tauri (Tauri v2 / WRY) needs GTK+WebKit system libs to compile - # on ubuntu-latest; installing them keeps the gate truly --workspace. - - name: Install Tauri system dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev \ - libjavascriptcoregtk-4.1-dev librsvg2-dev \ - libayatana-appindicator3-dev pkg-config build-essential - - - name: cargo fmt - run: cargo fmt --all --check - - - name: cargo clippy (workspace) - run: cargo clippy --workspace --all-targets -- -D warnings - - # --all-targets does not imply --all-features: the real-transport - # backends are default-off and would otherwise go unlinted. - - name: cargo clippy (feature-gated backends) - run: | - cargo clippy -p freshell-codex --features real-transport --all-targets -- -D warnings - cargo clippy -p freshell-opencode --features real-transport --all-targets -- -D warnings - - rust-test: - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - RUST_BACKTRACE: 1 - steps: - - uses: actions/checkout@v4 - - # Same pinned toolchain as the clippy job (NOT @stable). - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.96.0 - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - # freshell-tauri needs GTK+WebKit system libs to compile (same set as clippy job). - - name: Install Tauri system dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - libwebkit2gtk-4.1-dev libgtk-3-dev libsoup-3.0-dev \ - libjavascriptcoregtk-4.1-dev librsvg2-dev \ - libayatana-appindicator3-dev pkg-config build-essential - - # freshell-freshagent and freshell-ws tests spawn MCP servers that resolve tsx from node_modules. - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install Node dependencies - run: npm ci - - # Build the server binary explicitly so the Tauri smoke can never soft-skip. - - name: Build Rust server for Tauri smoke - run: cargo build -p freshell-server --locked - - # --locked for reproducibility parity with port-contract.yml. - # FRESHELL_SERVER_BIN ensures the Tauri smoke finds the binary via env var. - - name: Rust workspace tests - env: - FRESHELL_SERVER_BIN: ${{ github.workspace }}/target/debug/freshell-server - run: cargo test --workspace --locked --no-fail-fast - - # Dedicated Tauri smoke with --nocapture so the CI log visibly shows - # "using server binary:" (confirming the test exercised the real binary, - # not soft-skipped). The grep enforces non-vacuity: if the binary is ever - # missing, the smoke soft-skips and the grep fails, turning CI red. - - name: Tauri app-bound server spawn smoke - env: - FRESHELL_SERVER_BIN: ${{ github.workspace }}/target/debug/freshell-server - shell: bash - run: | - set -o pipefail - cargo test -p freshell-tauri --locked --test server_spawn_smoke app_bound_spawn_health_reap_end_to_end -- --exact --nocapture 2>&1 | tee /tmp/smoke.log - grep -q 'using server binary:' /tmp/smoke.log diff --git a/.github/workflows/typecheck-client.yml b/.github/workflows/typecheck-client.yml deleted file mode 100644 index 00b31b468..000000000 --- a/.github/workflows/typecheck-client.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Typecheck Client - -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -concurrency: - group: typecheck-client-${{ github.ref }} - cancel-in-progress: true - -jobs: - typecheck-client: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Run client typecheck - run: npm run typecheck:client diff --git a/port/contract/README.md b/port/contract/README.md index c7807ad70..c8ce8699f 100644 --- a/port/contract/README.md +++ b/port/contract/README.md @@ -77,13 +77,16 @@ The contract regenerates only when the **authoring** source npm run contract:generate # tsx port/contract/generate-ws-contract.ts ``` -Run the drift guard with `npm run test:port`. CI runs it on every PR via -`.github/workflows/port-contract.yml`, which also regenerates the contract -(`npm run contract:generate`) and fails on any resulting diff, and runs -`cargo test -p freshell-protocol` so the Rust T0 surface moves in lockstep. -When you change `shared/ws-protocol.ts`: run `npm run contract:generate`, -update `crates/freshell-protocol` (arrays + inventory-test counts), and -commit the regenerated `port/contract/*.json` in the same PR. +Run the drift guard with `npm run test:port`. The local default suite +(`npm test`) also runs it on every local test run, so the TS side of the +contract is checked before every PR. The drift guard regenerates the contract +in-memory and asserts byte-equality with the committed files, subsuming the +`npm run contract:generate` idempotency check. Run +`cargo test -p freshell-protocol` separately to verify the Rust T0 surface +moves in lockstep. When you change `shared/ws-protocol.ts`: run +`npm run contract:generate`, update `crates/freshell-protocol` (arrays + +inventory-test counts), and commit the regenerated `port/contract/*.json` in +the same PR. ## How it is generated