feat(mcp): add fix-agent handoff contract #347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify Cargo version is not behind tags | |
| run: python3 .github/scripts/check_version_sync.py | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Lint GitHub Actions | |
| uses: raven-actions/actionlint@v2 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Build frontend | |
| run: cd web && npm ci && npm run build | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Format | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Audit dependencies | |
| run: cargo audit | |
| cargo-deny: | |
| name: cargo-deny (advisories + licenses) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-deny | |
| run: cargo install cargo-deny --locked | |
| - name: Check advisories and licenses | |
| run: cargo deny check advisories licenses | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Build frontend | |
| run: cd web && npm ci && npm run build | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-nextest | |
| run: cargo install cargo-nextest --locked | |
| - name: Test | |
| run: cargo nextest run | |
| coverage: | |
| name: Coverage (llvm-cov) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Build frontend | |
| run: cd web && npm ci && npm run build | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| with: | |
| components: llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate coverage | |
| run: cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| mutation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@1.88.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-mutants | |
| run: cargo install cargo-mutants --locked | |
| - name: Mutation test (storage_json) | |
| run: | | |
| timeout 900 cargo mutants -f '*storage_json*' 2>&1 | tee mutation.log || true | |
| # Extract the missed count (e.g. "14 mutants ... 2 missed, 9 caught" -> 2), not the total | |
| MISSED=$(grep -E '[0-9]+ missed' mutation.log | tail -1 | sed -n 's/.* \([0-9][0-9]*\) missed.*/\1/p' | head -1 || echo "0") | |
| echo "missed=$MISSED" >> "$GITHUB_OUTPUT" | |
| id: mutation | |
| - name: Check mutation baseline | |
| run: | | |
| MISSED="${{ steps.mutation.outputs.missed }}" | |
| BASELINE=15 | |
| if [ -n "$MISSED" ] && [ "$MISSED" -gt "$BASELINE" ]; then | |
| echo "Mutation missed count $MISSED exceeds baseline $BASELINE. Update docs/mutation-testing.md and this baseline if intentional." | |
| exit 1 | |
| fi | |
| if: always() && steps.mutation.outputs.missed != '' |