diff --git a/.github/actions/rust-ci-setup/action.yml b/.github/actions/rust-ci-setup/action.yml index 7f0374526a..b6c2ccc730 100644 --- a/.github/actions/rust-ci-setup/action.yml +++ b/.github/actions/rust-ci-setup/action.yml @@ -24,7 +24,7 @@ runs: using: composite steps: - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: ${{ inputs.toolchain }} components: ${{ inputs.components }} @@ -51,7 +51,7 @@ runs: fi - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache shell: bash @@ -76,7 +76,7 @@ runs: # CPU pin lives in that file next to the Windows stack flags. - name: Cache cargo registry (one key per OS, save on main only) - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: workspaces: "." shared-key: ${{ runner.os }}-astraweave @@ -86,4 +86,4 @@ runs: - name: Install cargo-nextest if: inputs.install-nextest == 'true' - uses: taiki-e/install-action@nextest + uses: taiki-e/install-action@7c48f0a661edab95fdc666d1526d9ef945205245 # nextest diff --git a/.github/actions/rust-nightly/action.yml b/.github/actions/rust-nightly/action.yml index 65b4161d76..d6e4abd7e3 100644 --- a/.github/actions/rust-nightly/action.yml +++ b/.github/actions/rust-nightly/action.yml @@ -31,7 +31,7 @@ runs: echo "Pinned nightly: $channel" - name: Install pinned nightly - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: ${{ steps.pin.outputs.channel }} components: ${{ inputs.components }} diff --git a/.github/workflows/aw-editor-tests.yml b/.github/workflows/aw-editor-tests.yml index 60e58557f7..80ff44d923 100644 --- a/.github/workflows/aw-editor-tests.yml +++ b/.github/workflows/aw-editor-tests.yml @@ -17,6 +17,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +permissions: {} + env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 @@ -24,6 +26,8 @@ env: jobs: test: name: Test AW Editor (${{ matrix.os }}) + permissions: + contents: read runs-on: ${{ matrix.os }} timeout-minutes: 45 # Skip if editor has known compilation issues - allows CI to pass while editor is being fixed @@ -35,7 +39,9 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false - name: Rust CI setup uses: ./.github/actions/rust-ci-setup @@ -99,15 +105,19 @@ jobs: # Coverage job (optional - Linux only for speed) coverage: name: Test Coverage + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 45 steps: - name: Checkout Repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 with: components: llvm-tools-preview @@ -117,18 +127,41 @@ jobs: sudo apt-get install -y pkg-config libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libegl1-mesa-dev libudev-dev libasound2-dev - name: Install cargo-llvm-cov - run: cargo install cargo-llvm-cov + run: cargo install cargo-llvm-cov --version 0.9.1 --locked - name: Generate Coverage Report run: | cargo llvm-cov --package aw_editor --lib --lcov --output-path lcov.info - continue-on-error: true - + + - name: Upload coverage report + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: aw-editor-lcov + path: lcov.info + retention-days: 30 + + codecov: + name: Codecov upload + needs: coverage + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Download coverage report + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: aw-editor-lcov + path: . + - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v4 - if: success() + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: ./lcov.info + disable_search: true flags: aw_editor name: aw-editor-coverage - continue-on-error: true # Don't fail if codecov upload fails + version: v11.3.2 + fail_ci_if_error: true + use_oidc: true diff --git a/.github/workflows/benchmark-dashboard.yml b/.github/workflows/benchmark-dashboard.yml index 0fc762b19e..7de8aaf922 100644 --- a/.github/workflows/benchmark-dashboard.yml +++ b/.github/workflows/benchmark-dashboard.yml @@ -31,12 +31,12 @@ jobs: fetch-depth: 0 # Need full history for gh-pages - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 with: components: clippy - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -182,7 +182,7 @@ jobs: EOF - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./gh-pages diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5c43c2ee9e..7e72805d6f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -221,7 +221,7 @@ jobs: retention-days: 30 - name: Store benchmark results for tracking - uses: benchmark-action/github-action-benchmark@v1.22.2 + uses: benchmark-action/github-action-benchmark@4322e5726e6334590d251fc4f92bec0efafc45dc # v1.22.2 if: >- steps.merge.outputs.healthy == 'true' && github.event_name == 'push' && @@ -250,7 +250,7 @@ jobs: gh-repository: github.com/${{ github.repository }} - name: Comment benchmark results on PR - uses: benchmark-action/github-action-benchmark@v1.22.2 + uses: benchmark-action/github-action-benchmark@4322e5726e6334590d251fc4f92bec0efafc45dc # v1.22.2 if: >- steps.merge.outputs.healthy == 'true' && github.event_name == 'pull_request' && diff --git a/.github/workflows/benchmark_alert.yml b/.github/workflows/benchmark_alert.yml index 7a469df54e..eb7213c9e4 100644 --- a/.github/workflows/benchmark_alert.yml +++ b/.github/workflows/benchmark_alert.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install system dependencies run: | @@ -45,10 +45,10 @@ jobs: bc jq coreutils - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Set up Rust cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -363,7 +363,7 @@ jobs: - name: Deploy dashboard to GitHub Pages if: steps.merge.outputs.healthy == 'true' && success() - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 02dfc53475..d53a384f0a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,14 +34,14 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 with: languages: ${{ matrix.language }} - name: Autobuild - uses: github/codeql-action/autobuild@v4 + uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 with: category: "/language:${{matrix.language}}" \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5ec26ad3fa..1ea0abf583 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,17 +11,21 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +permissions: {} + jobs: coverage: name: Generate Code Coverage + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 45 - # Coverage may fail on some configurations - non-blocking - continue-on-error: true - + steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false - name: Rust CI setup uses: ./.github/actions/rust-ci-setup @@ -33,31 +37,80 @@ jobs: run: | cd tools/astraweave-assets cargo tarpaulin --out Xml --output-dir coverage --exclude-files 'src/main.rs' --exclude-files 'tests/*' - + + - name: Upload coverage XML + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: coverage-xml + path: tools/astraweave-assets/coverage/cobertura.xml + retention-days: 30 + + codecov: + name: Codecov upload + needs: coverage + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Download coverage XML + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: coverage-xml + path: tools/astraweave-assets/coverage + - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: ./tools/astraweave-assets/coverage/cobertura.xml + disable_search: true flags: astraweave-assets name: astraweave-assets-coverage - fail_ci_if_error: false - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - + version: v11.3.2 + fail_ci_if_error: true + use_oidc: true + + coverage-html: + name: HTML coverage report + needs: coverage + permissions: + contents: read + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Rust CI setup + uses: ./.github/actions/rust-ci-setup + + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin --version 0.35.2 --locked + + - name: Download coverage XML + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: coverage-xml + path: tools/astraweave-assets/coverage + - name: Generate HTML report if: always() run: | cd tools/astraweave-assets cargo tarpaulin --out Html --output-dir coverage-html --exclude-files 'src/main.rs' --exclude-files 'tests/*' - + - name: Upload HTML coverage report if: always() - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: coverage-report path: tools/astraweave-assets/coverage-html retention-days: 30 - + - name: Coverage summary if: always() run: | @@ -69,7 +122,7 @@ jobs: echo "**Overall Coverage:** ${COVERAGE}%" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "Target: 80%+ (Production Ready)" >> $GITHUB_STEP_SUMMARY - + if (( $(echo "$COVERAGE >= 80" | bc -l) )); then echo "✅ **Status:** PASS (meets target)" >> $GITHUB_STEP_SUMMARY else diff --git a/.github/workflows/dependency-management.yml b/.github/workflows/dependency-management.yml index 13ce22cf5d..5f7e57d942 100644 --- a/.github/workflows/dependency-management.yml +++ b/.github/workflows/dependency-management.yml @@ -70,7 +70,7 @@ jobs: run: cargo deny check - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install system dependencies run: | @@ -78,7 +78,7 @@ jobs: sudo apt-get install -y -q build-essential pkg-config cmake ninja-build - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -132,7 +132,7 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install system dependencies (Ubuntu) if: matrix.os == 'ubuntu-latest' @@ -156,7 +156,7 @@ jobs: # FIX: separate steps; don't mix 'run' and 'uses' in the same step - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Cache cleanup (if requested) if: github.event.inputs.cache_action == 'clean' @@ -166,7 +166,7 @@ jobs: rm -rf ~/.cargo/git/db || true - name: Setup optimized cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -211,10 +211,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -278,7 +278,7 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 with: components: rustfmt, clippy @@ -299,7 +299,7 @@ jobs: cargo install --locked cargo-bloat || echo "cargo-bloat already installed" - name: Setup cache for profiling - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false diff --git a/.github/workflows/determinism-profile.yml b/.github/workflows/determinism-profile.yml index a6f8dede4b..8577e1cf23 100644 --- a/.github/workflows/determinism-profile.yml +++ b/.github/workflows/determinism-profile.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install Linux build libraries if: runner.os == 'Linux' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1cdbc5d0be..ebe7736ba2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -88,11 +88,11 @@ jobs: - name: Install Rust continue-on-error: true - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Cache Rust dependencies continue-on-error: true - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -157,7 +157,7 @@ jobs: - name: Deploy to GitHub Pages if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/book diff --git a/.github/workflows/editor-ci.yml b/.github/workflows/editor-ci.yml index 2d05fdac7b..4406f57969 100644 --- a/.github/workflows/editor-ci.yml +++ b/.github/workflows/editor-ci.yml @@ -23,9 +23,13 @@ env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 +permissions: {} + jobs: editor-ci: name: editor-ci + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 45 # Skip if editor has known compilation issues @@ -39,7 +43,9 @@ jobs: uses: ./.github/actions/rust-ci-setup - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov + uses: taiki-e/install-action@3f7c3597aa4e6da3f315e128de702ce61e7b2877 # cargo-llvm-cov + with: + tool: cargo-llvm-cov@0.9.1 - name: Format check run: cargo fmt -p aw_editor -- --check diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 316b208e22..d8e8cecbed 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -40,10 +40,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache run: | @@ -62,7 +62,7 @@ jobs: libasound2-dev libpulse-dev libudev-dev - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -84,10 +84,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache run: | @@ -100,7 +100,7 @@ jobs: sudo apt-get install -y -q build-essential pkg-config cmake libudev-dev - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -122,10 +122,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache run: | @@ -138,7 +138,7 @@ jobs: sudo apt-get install -y -q build-essential pkg-config cmake - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -160,10 +160,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache run: | @@ -171,7 +171,7 @@ jobs: echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -193,10 +193,10 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Enable sccache run: | @@ -209,7 +209,7 @@ jobs: sudo apt-get install -y -q build-essential pkg-config cmake - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false diff --git a/.github/workflows/kani.yml b/.github/workflows/kani.yml index 6842a7b1ee..f6d1e79db5 100644 --- a/.github/workflows/kani.yml +++ b/.github/workflows/kani.yml @@ -23,9 +23,12 @@ on: required: false default: 'astraweave-ecs,astraweave-math,astraweave-sdk,astraweave-core' timeout: - description: 'Timeout per harness in seconds' + description: 'Timeout per harness in seconds (60, 120, 300, 600, or 900)' required: false - default: '300' + type: number + default: 300 + +permissions: {} env: CARGO_TERM_COLOR: always @@ -34,19 +37,43 @@ env: jobs: kani-ecs: name: Kani - astraweave-ecs + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 120 steps: - - uses: actions/checkout@v7 - + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Resolve harness timeout + id: timeout + env: + KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }} + run: | + raw="${KANI_TIMEOUT_INPUT:-300}" + if [ "$raw" = "null" ]; then + raw=300 + fi + case "$raw" in + 60|120|300|600|900) ;; + *) + echo "harness timeout must be 60, 120, 300, 600, or 900" >&2 + exit 1 + ;; + esac + echo "value=$raw" >> "$GITHUB_OUTPUT" + - name: Kani Verification - uses: model-checking/kani-github-action@v1 + uses: model-checking/kani-github-action@69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237 # v1 with: + kani-version: 0.68.0 + command: cargo-kani working-directory: . - args: --package astraweave-ecs -Z unstable-options --harness-timeout ${{ github.event.inputs.timeout || '300' }} + args: --package astraweave-ecs -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }} - name: Upload Kani Report - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() with: name: kani-report-ecs @@ -55,19 +82,43 @@ jobs: kani-math: name: Kani - astraweave-math + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v7 - + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Resolve harness timeout + id: timeout + env: + KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }} + run: | + raw="${KANI_TIMEOUT_INPUT:-300}" + if [ "$raw" = "null" ]; then + raw=300 + fi + case "$raw" in + 60|120|300|600|900) ;; + *) + echo "harness timeout must be 60, 120, 300, 600, or 900" >&2 + exit 1 + ;; + esac + echo "value=$raw" >> "$GITHUB_OUTPUT" + - name: Kani Verification - uses: model-checking/kani-github-action@v1 + uses: model-checking/kani-github-action@69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237 # v1 with: + kani-version: 0.68.0 + command: cargo-kani working-directory: . - args: --package astraweave-math -Z unstable-options --harness-timeout ${{ github.event.inputs.timeout || '300' }} + args: --package astraweave-math -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }} - name: Upload Kani Report - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() with: name: kani-report-math @@ -76,19 +127,43 @@ jobs: kani-sdk: name: Kani - astraweave-sdk + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v7 - + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Resolve harness timeout + id: timeout + env: + KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }} + run: | + raw="${KANI_TIMEOUT_INPUT:-300}" + if [ "$raw" = "null" ]; then + raw=300 + fi + case "$raw" in + 60|120|300|600|900) ;; + *) + echo "harness timeout must be 60, 120, 300, 600, or 900" >&2 + exit 1 + ;; + esac + echo "value=$raw" >> "$GITHUB_OUTPUT" + - name: Kani Verification - uses: model-checking/kani-github-action@v1 + uses: model-checking/kani-github-action@69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237 # v1 with: + kani-version: 0.68.0 + command: cargo-kani working-directory: . - args: --package astraweave-sdk -Z unstable-options --harness-timeout ${{ github.event.inputs.timeout || '300' }} + args: --package astraweave-sdk -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }} - name: Upload Kani Report - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() with: name: kani-report-sdk @@ -97,19 +172,43 @@ jobs: kani-core: name: Kani - astraweave-core + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 90 steps: - - uses: actions/checkout@v7 - + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Resolve harness timeout + id: timeout + env: + KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }} + run: | + raw="${KANI_TIMEOUT_INPUT:-300}" + if [ "$raw" = "null" ]; then + raw=300 + fi + case "$raw" in + 60|120|300|600|900) ;; + *) + echo "harness timeout must be 60, 120, 300, 600, or 900" >&2 + exit 1 + ;; + esac + echo "value=$raw" >> "$GITHUB_OUTPUT" + - name: Kani Verification - uses: model-checking/kani-github-action@v1 + uses: model-checking/kani-github-action@69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237 # v1 with: + kani-version: 0.68.0 + command: cargo-kani working-directory: . - args: --package astraweave-core -Z unstable-options --harness-timeout ${{ github.event.inputs.timeout || '300' }} + args: --package astraweave-core -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }} - name: Upload Kani Report - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() with: name: kani-report-core @@ -118,6 +217,8 @@ jobs: summary: name: Kani Summary + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 10 needs: [kani-ecs, kani-math, kani-sdk, kani-core] diff --git a/.github/workflows/mutation-testing.yml b/.github/workflows/mutation-testing.yml index b6bda9d53d..f1b5c3f8ff 100644 --- a/.github/workflows/mutation-testing.yml +++ b/.github/workflows/mutation-testing.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install cargo-mutants run: cargo install cargo-mutants --version 27.1.0 --locked @@ -107,7 +107,7 @@ jobs: - uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install cargo-mutants run: cargo install cargo-mutants --version 27.1.0 --locked @@ -153,7 +153,7 @@ jobs: - uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install cargo-mutants run: cargo install cargo-mutants --version 27.1.0 --locked @@ -239,7 +239,7 @@ jobs: - uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install cargo-mutants run: cargo install cargo-mutants --version 27.1.0 --locked @@ -280,7 +280,7 @@ jobs: - uses: actions/checkout@v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install cargo-mutants run: cargo install cargo-mutants --version 27.1.0 --locked diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bd7399517..6abf997254 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: steps: - uses: actions/checkout@v7 - - uses: dtolnay/rust-toolchain@1.89.0 + - uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Install system dependencies (Linux) if: runner.os == 'Linux' @@ -98,7 +98,7 @@ jobs: with: path: dist - name: Create Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2 with: draft: false prerelease: false diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 196ae0d0e2..bec7e70531 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -449,7 +449,7 @@ jobs: sudo apt-get install -y pkg-config libudev-dev - name: Install Rust Stable - uses: dtolnay/rust-toolchain@1.89.0 + uses: dtolnay/rust-toolchain@599c45df1a24c1c63ae1129a7e59f46654b8fb66 # 1.89.0 - name: Cache cargo registry uses: actions/cache@v6 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 2eb3604369..0ba99d5aed 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -39,7 +39,7 @@ jobs: persist-credentials: false - name: Run Scorecard analysis - uses: ossf/scorecard-action@v2.5.0 + uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0 with: results_file: results.sarif results_format: sarif @@ -56,6 +56,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@v4 + uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 with: sarif_file: results.sarif \ No newline at end of file diff --git a/.github/workflows/toolchain-management.yml b/.github/workflows/toolchain-management.yml index d556b4230b..d915adbfb1 100644 --- a/.github/workflows/toolchain-management.yml +++ b/.github/workflows/toolchain-management.yml @@ -88,7 +88,7 @@ jobs: - name: Set up Rust toolchain if: ${{ !matrix.experimental }} - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: ${{ github.event.inputs.toolchain_version || matrix.toolchain }} components: rustfmt, clippy, rust-src, rust-analyzer @@ -108,7 +108,7 @@ jobs: run: brew install pkg-config cmake - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Configure sccache run: | @@ -129,7 +129,7 @@ jobs: cat rust-toolchain.toml - name: Set up toolchain-specific cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -226,7 +226,7 @@ jobs: echo "Detected MSRV: $MSRV" - name: Set up MSRV toolchain - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: ${{ env.MSRV }} @@ -240,7 +240,7 @@ jobs: mesa-vulkan-drivers libvulkan1 vulkan-tools - name: Set up MSRV cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false @@ -265,7 +265,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Rust toolchain - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: ${{ matrix.toolchain }} @@ -279,7 +279,7 @@ jobs: mesa-vulkan-drivers libvulkan1 vulkan-tools time - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.11 + uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 - name: Configure sccache run: | @@ -287,7 +287,7 @@ jobs: echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - name: Set up performance cache - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: shared-key: ${{ runner.os }}-astraweave cache-targets: false diff --git a/astraweave-terrain/src/heightmap.rs b/astraweave-terrain/src/heightmap.rs index f6d88f1380..eb022adbbc 100644 --- a/astraweave-terrain/src/heightmap.rs +++ b/astraweave-terrain/src/heightmap.rs @@ -39,7 +39,7 @@ pub struct Heightmap { impl Heightmap { /// Create a new heightmap with the given configuration pub fn new(config: HeightmapConfig) -> anyhow::Result { - let size = (config.resolution * config.resolution) as usize; + let size = heightmap_cell_count(config.resolution)?; Ok(Self { data: vec![0.0; size], resolution: config.resolution, @@ -50,7 +50,7 @@ impl Heightmap { /// Create a heightmap from existing data pub fn from_data(data: Vec, resolution: u32) -> anyhow::Result { - if data.len() != (resolution * resolution) as usize { + if data.len() != heightmap_cell_count(resolution)? { return Err(anyhow::anyhow!( "Data size {} doesn't match resolution {}x{}", data.len(), @@ -347,6 +347,22 @@ impl Heightmap { } } +/// Highest resolution whose bilinear neighbour index stays inside the grid. +/// +/// `(resolution as f32) - 1.001` rounds to `resolution - 1` at 32770, so +/// `x0 + 1` would pass the edge. Resolutions 2 through 32769 keep +/// `x0 + 1 <= resolution - 1`. +const MAX_HEIGHTMAP_RESOLUTION: u32 = 32769; + +fn heightmap_cell_count(resolution: u32) -> anyhow::Result { + if resolution > MAX_HEIGHTMAP_RESOLUTION { + return Err(anyhow::anyhow!( + "heightmap resolution {resolution} exceeds {MAX_HEIGHTMAP_RESOLUTION}" + )); + } + Ok(resolution as usize * resolution as usize) +} + #[cfg(test)] mod tests { use super::*; @@ -360,6 +376,28 @@ mod tests { assert_eq!(heightmap.data().len(), 128 * 128); } + #[test] + fn heightmap_resolution_above_32769_is_rejected() { + let over = Heightmap::from_data(Vec::new(), 32_770) + .unwrap_err() + .to_string(); + assert!(over.contains("exceeds"), "{over}"); + assert!(over.contains("32770"), "{over}"); + + let edge = Heightmap::from_data(Vec::new(), 32_769) + .unwrap_err() + .to_string(); + assert!(edge.contains("doesn't match resolution"), "{edge}"); + assert!(!edge.contains("exceeds"), "{edge}"); + + let config = HeightmapConfig { + resolution: 32_770, + ..HeightmapConfig::default() + }; + let created = Heightmap::new(config).unwrap_err().to_string(); + assert!(created.contains("exceeds"), "{created}"); + } + #[test] fn test_heightmap_get_set() { let config = HeightmapConfig::default(); diff --git a/docs/architecture/terrain.md b/docs/architecture/terrain.md index ec7df6795d..c96b54aa36 100644 --- a/docs/architecture/terrain.md +++ b/docs/architecture/terrain.md @@ -169,7 +169,7 @@ The parallel **voxel** path (wired in `examples/hybrid_voxel_demo` and `aravath_ | **`ChunkCoord`** | 3D `{x,y,z:i32}` identifier for a voxel chunk (32³) | `voxel_data.rs:29`, `meshing.rs` | | **`TerrainChunk`** | Heightmap-based chunk: heightmap + biome_map + optional biome_weights/biome_ids | `chunk.rs:65` | | **`VoxelChunk`** | Sparse-voxel-octree chunk of `Voxel{density, material}` | `voxel_data.rs` | -| **`Heightmap`** | 2D grid of f32 heights at a given resolution | `heightmap.rs`, `noise_gen.rs` | +| **`Heightmap`** | 2D grid of f32 heights. `new` and `from_data` reject a resolution above 32769. For resolutions 2 through 32769, `x0 + 1` is already at most `resolution - 1`, so the neighbour index does not depend on the clamp. Resolutions 0 and 1 are still accepted; `sample_bilinear` panics in the clamp at `heightmap.rs:147-148` because the upper bound is below 0 | `heightmap.rs`, `noise_gen.rs` | | **`BiomeType`** | 8-variant ecological enum (Grassland/Desert/Forest/Mountain/Tundra/Swamp/Beach/River) | `biome.rs:12` | | **`BiomeId`** | Whittaker climate-lookup biome identity used by the F.4.B.3.D climate-field path | `biome_lookup.rs`, `chunk.rs:91` | | **`biome_weights`** | Per-vertex `[f32;8]` soft biome blend, pre-erosion | `chunk.rs:81`, `elevation_biome.rs` | @@ -211,7 +211,7 @@ The parallel **voxel** path (wired in `examples/hybrid_voxel_demo` and `aravath_ | `tools/aw_editor` (blueprint zones) | `ZoneScatterGenerator::new(64.0, 65).generate_zone_scatter(&bz, &chunk_refs, seed)` | `ZoneGenerationResult` | `main.rs:7458-7465`. Note: editor seeds this from `SystemTime` (main.rs:7459) — non-deterministic at that call site | | `examples/hybrid_voxel_demo` (voxel path) | `DualContouring::generate_mesh(chunk)`, `LodMeshGenerator::generate_mesh_lod(...)` | `ChunkMesh` | `examples/hybrid_voxel_demo/src/main.rs:120,183` | | `aravath_runtime` (voxel path) | `DualContouring::generate_mesh` via `Ground::sync_dirty` | `ChunkMesh` turned into a static trimesh and render parts | `aravath_runtime/src/ground.rs`. The greybox island stands on this mesh | -| `astraweave-render` (terrain GPU bridge) | `astraweave_terrain::gpu_bridge::TerrainGpuAccelerator` impl `WgpuTerrainAccelerator` | `GpuHeightmapRequest`/`GpuNoiseRequest`/`GpuErosionRequest` | `astraweave-render/src/terrain_gpu_bridge.rs:11-67`. The impl exists but has no production caller outside its own file (§11). Traced in [`render_pipeline_material_system_shader_infrastructure.md`](render_pipeline_material_system_shader_infrastructure.md) | +| `astraweave-render` (terrain GPU bridge) | none in tree | none | `astraweave-render/src/terrain_gpu_bridge.rs` is not in the tree, and `TerrainGpuAccelerator` / `WgpuTerrainAccelerator` are not defined. The status line records that the GPU erosion trait was removed | | Material/splat path | biome data → editor splat bake | biome → material slot influence | Out of scope here; see [`terrain_materials.md`](terrain_materials.md) §4 (the exact biome→material-slot interface is marked NEEDS VERIFICATION there) | ### Bidirectional / Coupled @@ -231,7 +231,7 @@ Wiredness verified by workspace grep for non-test/non-example production callers | `noise_gen.rs` | `TerrainNoise`, `NoiseConfig`, layered fBm + domain warp + continental + derivative-weighted + per-octave weights | Active | Deterministic; seeded off `config.seed`. E3 defaults: base layer `NoiseType::Fbm` 4-octave (noise_gen.rs:226), mountains `NoiseType::Billow` (:241, replacing RidgedMulti's knife-ridge networks), detail amplitude 3.0 (:247). `continental_enabled` default **false — deliberate** (:120-139): the erosion-driven `mountains_amplitude` spline now gates mountain regions; continentalness gating on top would double-gate. `base_derivative_weighted` default false (:202-204). `mountain_octave_weights` field is read-but-no-effect (infrastructure-only, noise_gen.rs:84-97) | | `noise_simd.rs` | `SimdHeightmapGenerator` (SIMD heightmap, default `simd-noise` feature) | Active | Used by `generate_chunk` under `#[cfg(feature="simd-noise")]` (lib.rs:270) | | `perlin_gradient.rs` | Analytical-derivative Perlin + derivative-weighted fBm | Active (noise layer) | Backs `base_derivative_weighted` path | -| `heightmap.rs` | `Heightmap`, `HeightmapConfig` | Active | Core storage type | +| `heightmap.rs` | `Heightmap`, `HeightmapConfig` | Active | Core storage type. Constructors reject a resolution above 32769 | | `chunk.rs` | `ChunkId`, `TerrainChunk`, `ChunkManager`, `smooth_shared_vertices` | Active | Heightmap chunk + manager; legacy `apply_erosion` CA lives here (line 204) | | `climate.rs` | `ClimateMap`, `ClimateConfig` (temperature/moisture field) | Active | Feeds biome classification | | `biome.rs` | `BiomeType` (8), `BiomeConfig`, `BiomeVegetation`, `VegetationType` | Active | Imports gameplay `ResourceKind`/`BiomeRule` (reverse dep) | @@ -419,7 +419,7 @@ Wiredness verified by workspace grep for non-test/non-example production callers - **Is the async streaming/LOD subsystem (`BackgroundChunkLoader`, `LodManager`, `MorphingLodManager`, `StreamingDiagnostics`, `partition_integration`) intended to become the runtime loader, or is it dormant scaffolding?** It is fully implemented and tested but has zero production callers at `7c29b8182`; the editor uses synchronous `generate_chunk_with_climate`. Resolving this determines whether these ~5K LoC are "in-design-but-tested" (per CLAUDE.md Lesson 8) or destined for wiring. - **Should the `RegionalArchetypeMask` `Some`-branch be wired into the editor?** The panel exists, owns a mask, and Multi-Tool SP5.B (2026-06-06) wired click+drag painting INTO the panel's mask — but no code assigns that mask onto a generator (`set_mask` callers are test-only; `regenerate_terrain` builds a fresh `TerrainState::new()`), so the multi-archetype generation branch (lib.rs:620-643) remains unreachable in production at `8232b150b`. Per the 2026-07-20 T-series ratification, spatial multi-archetype stays a **separately-ratifiable future feature** — explicitly NOT in the terrain T-series (`E3_PREFLIGHT_2026-07.md` §7). - **What is the runtime role of the voxel terrain path (`VoxelChunk`/`DualContouring`)?** `examples/hybrid_voxel_demo` and `aravath_runtime` (`Ground::sync_dirty`) both call `generate_mesh`. The greybox island collider and render mesh come from that call. The heightmap editor path is a separate system. Column deformation replays `astraweave-destruction` commands inside `ColumnStream`. `destruction_seam.rs` keeps the ring occupancy replay because `Terrain` holds four chunks. -- **Does `WgpuTerrainAccelerator` (the `TerrainGpuAccelerator` impl in `astraweave-render`) have any intended caller?** The impl compiles but nothing invokes it outside its own file. GPU-accelerated heightmap/erosion is therefore dormant. +- **The GPU erosion trait is not in the tree.** `astraweave-render/src/terrain_gpu_bridge.rs` is absent, and `TerrainGpuAccelerator` / `WgpuTerrainAccelerator` are not defined. The status line records the removal. - **Is the CLAUDE.md claim that `AdvancedErosionSimulator` and `RegionalArchetypePanel` were "removed" stale, or did a prior commit remove and re-add them?** Both are present and (for erosion) wired at `7c29b8182`. This trace verified only current state. [NEEDS VERIFICATION of git history.] - **Should the gameplay reverse dependency be inverted?** [`ARCHITECTURE_MAP.md`](ARCHITECTURE_MAP.md):148 flags it as a directional anomaly with HIGH blast radius. It is working code; the question is parked, not a recommendation. - ~~**The Terrain panel's "Base Amplitude" slider is inert — restore it, or remove it?**~~ **CLOSED 2026-07-26 by ED-3 (ratified direction: splines stay the authority).** `NoiseConfig::base_amplitude_scale` (serde-default 1.0 = bit-identical output, D5FIX discipline preserved) multiplies `params.base_elevation_amplitude` at its single consumption site in `sample_height_with_params`; the panel's slider is now "Amplitude x (spline scale)" via `TerrainState::set_amplitude_scale`. Regression: `lib.rs::ed3_base_amplitude_scale_is_live_and_identity_at_default` (identity at 1.0, live at 0.5) + render proof `tools/aw_editor/tests/ed3_proof.rs` (three scales pairwise ~99.5% different pixels). Classification uses the same scaled function, so biome assignment follows the terrain (no new §7.7 seam). **T.3's amplitude-finality gate is now actionable.** Original finding (T.2d third pass, 2026-07-25): `terrain_panel.rs:1064` (slider, 10..200) → `terrain_panel.rs:2016` `set_noise_params(..)` → `terrain_integration.rs:167` `config.noise.base_elevation.amplitude`; but `noise_gen.rs:575` documents that read as **replaced** by `params.base_elevation_amplitude` (applied at `:663`), which `regional_archetype_mask.rs:469` blends from archetype splines and never from `config`. Octaves / lacunarity / persistence are still read — amplitude alone is dead. `terrain_panel.rs:2004-2005`'s comment still claims all four "flow through", so this is doc-drift as well as a settable-but-never-read field (Integration-Completeness §3). Proven empirically: `tools/aw_editor/tests/t2d_camera_light.rs` Experiment F renders amplitudes 50/20/6 **byte-identical**. Decisional — the fix could be re-plumbing the slider into `BootstrapParams`, or deleting it because per-archetype splines are now the intended authority. diff --git a/docs/architecture/ui.md b/docs/architecture/ui.md index f67535f966..5822699361 100644 --- a/docs/architecture/ui.md +++ b/docs/architecture/ui.md @@ -187,7 +187,7 @@ The crate exposes **two distinct integration paths** that callers pick between; |---|---|---|---| | `examples/ui_controls_demo` | `draw_ui(...)`, `UiLayer`, `MenuManager`, `Accessibility`, `UiFlags`, `UiData` (`examples/ui_controls_demo/src/main.rs:17`) | `UiResult` | Uses **Path A** (`draw_ui`). Also the sole real consumer of `astraweave-input` in the workspace (see ARCHITECTURE_MAP note below). | | `examples/ui_menu_demo` | `UiLayer`, `MenuManager`, `HudManager`, `DialogueNode`, `DialogueChoice`, `TooltipData`, `QuestNotification` (`examples/ui_menu_demo/src/main.rs:47-51,236,582,774`) | `MenuAction`, rendered HUD | Uses **Path B** (direct `HudManager::render` at `main.rs:758` + `MenuManager::show` at `main.rs:830`); does **not** call `draw_ui`. | -| `examples/hello_companion` | `astraweave-ui` as an **optional** dep (`examples/hello_companion/Cargo.toml:29,59`) | — | Gated behind the `visual` feature (`Cargo.toml:54-71`). Verified — even with `visual` on, no `use astraweave_ui` / `UiLayer` / `HudManager` / `MenuManager` / `draw_ui` appears anywhere in `src/`; `chat_ui.rs` and `visual_demo.rs` draw raw egui directly (`chat_ui.rs:109` takes `&egui::Context`). The dep is declared-but-unused on every build path. | +| `examples/hello_companion` | `astraweave-ui` as an **optional** dep (`examples/hello_companion/Cargo.toml:30,61`) | — | Gated behind the `visual` feature (`Cargo.toml:56-73`). Verified — even with `visual` on, no `use astraweave_ui` / `UiLayer` / `HudManager` / `MenuManager` / `draw_ui` appears anywhere in `src/`; `chat_ui.rs` and `visual_demo.rs` draw raw egui directly (`chat_ui.rs:109` takes `&egui::Context`). The dep is declared-but-unused on every build path. | ### Bidirectional / Coupled @@ -329,7 +329,7 @@ Immediate-mode UI re-emitted every frame; no persistent retained scene. Per-fram - **`#[cfg(test)] mod mutation_tests`** declared in `lib.rs:34-35` (`mutation_tests.rs`, 1,193 LoC). - **Integration / dedicated test files** under `astraweave-ui/tests/`: `hud_tests`, `hud_logic_tests`, `hud_priority1/2/3_tests`, `menu_tests`, `menus_tests`, `panel_tests`, `input_tests`, `integration_ui_rendering`, `nan_infinity_tests`, `mutation_hardening_tests`, `mutation_resistant_comprehensive_tests`, plus `tests/fixtures/mod.rs`. - **Mutation testing:** Multiple mutation-oriented suites present (`mutation_tests.rs`, `mutation_hardening_tests.rs`, `mutation_resistant_comprehensive_tests.rs`). [Coverage figures not cross-checked for this trace.] -- **Miri / Kani:** Not listed among the Miri-validated crates in CLAUDE.md (`ecs`, `math`, `core`, `sdk`). The crate's only `unsafe` is the `UiLayer` lifetime transmute (`layer.rs:140-145`) with a `// SAFETY:` comment. Verified — `astraweave-ui` is in **neither** verification pipeline: `.github/workflows/miri.yml` runs Miri only on `astraweave-ecs`/`-core`/`-physics`/`-ai` (`miri.yml:34-173`), and `.github/workflows/kani.yml` runs Kani only on `astraweave-ecs`/`-math`/`-sdk`/`-core` (`kani.yml:46,67,88,109`). `ci.yml`'s references to `astraweave-ui` (`ci.yml:180,295,317`) are plain build/test jobs, not Miri/Kani. This `unsafe` transmute is therefore not exercised under any formal-verification pipeline. +- **Miri / Kani:** Not listed among the Miri-validated crates in `docs/current/MIRI_VALIDATION_REPORT.md:18-21` (`astraweave-ecs`, `astraweave-math`, `astraweave-core`, `astraweave-sdk`). The crate's only `unsafe` is the `UiLayer` lifetime transmute (`layer.rs:140-145`) with a `// SAFETY:` comment. Verified — `astraweave-ui` is in **neither** verification pipeline: `.github/workflows/miri.yml` runs Miri on `astraweave-ecs`, `astraweave-sdk`, `astraweave-core`, `astraweave-physics`, and `astraweave-ai` (`miri.yml:77,184,219,254,292`), and `.github/workflows/kani.yml` runs Kani only on `astraweave-ecs`, `astraweave-math`, `astraweave-sdk`, and `astraweave-core` (`kani.yml:73,118,163,208`). `ci.yml` does not name `astraweave-ui`. This `unsafe` transmute is therefore not exercised under any formal-verification pipeline. - **Manual validation:** `examples/ui_controls_demo` (Path A) and `examples/ui_menu_demo` (Path B) are the runnable integration surfaces. --- @@ -341,7 +341,7 @@ Immediate-mode UI re-emitted every frame; no persistent retained scene. Per-fram - **Should the unimported `astraweave-input` dependency remain declared?** ARCHITECTURE_MAP §5 and input.md §11 already flag this as a declared-but-unused dep; the crate uses gilrs directly via `gamepad.rs`. - **Does the settings-menu key-rebind ever complete?** The UI sets `rebinding_key` but no in-crate code captures the next key press to write the binding. Is the capture expected from a caller, and does any caller implement it? (`ui_controls_demo`/`ui_menu_demo` not confirmed to.) - **Does `MenuAction::ApplySettings` ever push graphics settings to a renderer/window?** Currently only TOML is written (`menu.rs:320-329`, with a "In future" comment). Is a renderer-apply path planned? -- **Is `astraweave-ui` reachable from `hello_companion`?** It is an optional dependency (`hello_companion/Cargo.toml:29`) but no `use astraweave_ui` was found in its `src/`. [NEEDS VERIFICATION.] *(Verification note 2026-06-24: the dep is gated behind the `visual` feature (`Cargo.toml:54-71`); a workspace grep for `astraweave_ui`/`UiLayer`/`HudManager`/`MenuManager`/`draw_ui` across `hello_companion/src/` returns zero hits even on the `visual` path — `chat_ui.rs`/`visual_demo.rs` use raw egui. So it is a declared-but-unused dep on every build path. The parked question of whether it should remain declared is left to the owner.)* +- **Is `astraweave-ui` reachable from `hello_companion`?** It is an optional dependency (`hello_companion/Cargo.toml:30`) but no `use astraweave_ui` was found in its `src/`. [NEEDS VERIFICATION.] *(Verification note 2026-06-24: the dep is gated behind the `visual` feature (`Cargo.toml:56-73`); a workspace grep for `astraweave_ui`/`UiLayer`/`HudManager`/`MenuManager`/`draw_ui` across `hello_companion/src/` returns zero hits even on the `visual` path — `chat_ui.rs`/`visual_demo.rs` use raw egui. So it is a declared-but-unused dep on every build path. The parked question of whether it should remain declared is left to the owner.)* --- diff --git a/docs/current/ARCHITECTURE_REFERENCE.md b/docs/current/ARCHITECTURE_REFERENCE.md index 2b340f6c57..25dc47c260 100644 --- a/docs/current/ARCHITECTURE_REFERENCE.md +++ b/docs/current/ARCHITECTURE_REFERENCE.md @@ -582,7 +582,7 @@ cargo +nightly miri test -p astraweave-ecs --lib -- --test-threads=1 - `astraweave-ecs/tests/mutation_resistant_comprehensive_tests.rs` — BlobVec, Entity bit encoding, EntityAllocator proof mirrors - `astraweave-sdk/src/lib_kani.rs` — C ABI function proofs -**CI**: `.github/workflows/kani.yml` (uses `model-checking/kani-github-action@v1`) +**CI**: `.github/workflows/kani.yml` (uses `model-checking/kani-github-action` commit `69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237`, `# v1`) **Running locally**: ```bash diff --git a/docs/current/CI_ARCHITECTURE.md b/docs/current/CI_ARCHITECTURE.md index e59ef1513e..fa6c54f845 100644 --- a/docs/current/CI_ARCHITECTURE.md +++ b/docs/current/CI_ARCHITECTURE.md @@ -59,7 +59,7 @@ These path-filtered workflows are not in the required set because a filter would | Full 3-OS `cargo nextest` plus a release build of the core crates, and demo validation | `ci.yml` on push, schedule 04:30 UTC, dispatch. Not on pull requests. | | 5-toolchain matrix (stable, 1.89.0, 1.88.0, beta, pinned nightly) | `toolchain-management.yml` on push to main, schedule 05:40 UTC, dispatch. The nightly matrix label is `pinned-nightly`. The channel is the date in `.github/rust-nightly-channel` (#560). Miri, sanitizers, and fuzz use that same pin. The checkout sets `lfs: true` (#348) so `ASSET_MANIFEST.tsv` hashes the Aravath blobs, not the pointer files. `Toolchain Validation (1.89.0)` runs workspace clippy `-D warnings`, with that workflow's package excludes. #360 closed the `expect` on schedule registration. #358 is closed. The fix is #360. That 1.89.0 clippy step is expected green. The CI agent is confirming it on main. #375 removes the 50 ms debug wall-clock assert from `view_ring_lod_keeps_the_forest_under_budget`. The test still requires `total > 400` and `kept < 900`. macOS 1.89 on run 39084152246 measured 50.776916 ms, failed `as_millis() < 50`, and skipped `Run clippy with toolchain`. That host-clock assert no longer skips clippy. MSRV stays on the pull request. | | Sanitizers | `sanitizers.yml` on push and schedule 03:00 UTC. Not on pull requests. | -| Coverage | `coverage.yml` on push to main, schedule 06:10 UTC, dispatch. | +| Coverage | `coverage.yml` on push to main, schedule 06:10 UTC, dispatch. Its Codecov step and the `aw-editor-tests.yml` coverage upload use `codecov/codecov-action` commit `303a32d7a59b442fa8d48b6a1cc6825c09c847a5` (# v7.1.1), CLI `version: v11.3.2`, `fail_ci_if_error: true`, `disable_search: true`, an explicit `files:` path, and `use_oidc: true`. Neither workflow sets a `token` or `CODECOV_TOKEN` key, and neither puts a `secrets` context in the Codecov step, that job's `env`, or the workflow `env`. The producer job's permissions are exactly `contents: read`. An added, removed, or changed scope fails the check. That job uploads the report as an artifact. In those two workflows every non-local action `uses:` is a 40-character commit SHA, not a major tag. That includes `actions/checkout` (`3d3c42e5aac5ba805825da76410c181273ba90b1`, # v7), the coverage XML upload, the coverage HTML upload, the editor report upload (`cf430e030ddbb5b0abf93d22962f4752f3646cd9`, # v7.0.2), and the three `actions/download-artifact` steps — the Codecov upload and the HTML job in `coverage.yml`, and the Codecov upload in `aw-editor-tests.yml` (`9000827ccba6bdab643e8b6fd33ac0654aef8333`, # v8.0.2). A local `./` action has no ref. `actions/checkout@v7` fails that check. `with:` on the Codecov download is exactly `name` and `path`, both required, and that step's keys are `name`, `uses`, and `with`. In `coverage.yml` that `name` is `coverage-xml` and `files` is `./tools/astraweave-assets/coverage/cobertura.xml`. In `aw-editor-tests.yml` that `name` is `aw-editor-lcov` and `files` is `./lcov.info`. The Codecov step's own keys are only `name`, `uses`, and `with`, so an `if:` on that step fails the check. The Codecov upload job's permissions are exactly `contents: read` and `id-token: write`. Its `runs-on` is `ubuntu-latest` and its `timeout-minutes` is 10. A repeated key on that upload job fails. A repeated key in that job's permissions map fails, including when the last value is `contents: read` and `id-token: write`. Top-level `permissions` stay `{}`. Any repeated workflow key fails, including a repeated `permissions` key whose last value is `{}`. Neither workflow runs on pull requests. The HTML report, its artifact upload, and the coverage summary are a separate job. The Codecov upload job's `needs` is exactly the job `coverage`, written as the string `coverage` or the one-element list `[coverage]`. That `coverage` job's last step is the `upload-artifact` whose `with.name` is the pinned report (`coverage-xml` or `aw-editor-lcov`). A job-level `if:`, an `if:` on a step in that job, a later step, a different artifact name, or a step that is not exactly its canonical step fails the check. The `coverage` job in `coverage.yml` and the `coverage` job in `aw-editor-tests.yml` are each an exact ordered list of canonical steps. An inserted, removed, or reordered step fails. Every step equals its canonical step, including `Rust CI setup` and `Install Rust Toolchain`, with their `with:` and `env`. The key set matches, every other key and value matches, including the upload `with:` map, and the `run` text matches after trailing whitespace is trimmed. Leading whitespace on `run` fails. An extra key, an extra run line, a different upload `path`, or `if-no-files-found` fails. The producer job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 45. A generate-coverage script other than the approved `cargo tarpaulin --out Xml` command, or a step between the editor `cargo llvm-cov` run and the lcov upload, fails the check. Job `coverage-html` and the editor `test` job are each an exact ordered list of canonical steps. An inserted, removed, or reordered step fails. The `Install cargo-tarpaulin` step in `coverage-html` is that list's canonical install, including `--version` and `--locked`. `coverage-html` keys are exactly `name`, `needs`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. `needs` is the job `coverage`, as that string or as `[coverage]`. `permissions` are exactly `contents: read`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 45. A job-level `if:` or `container:` fails. A repeated key fails. The editor `test` job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, `continue-on-error`, `strategy`, and `steps`. Its permissions map is exactly `contents: read`. `runs-on` is `${{ matrix.os }}`. `timeout-minutes` is 45. `strategy` is `fail-fast: false` and `matrix.os` is `ubuntu-latest`, `windows-latest`, and `macos-latest`, with no other matrix key. A job-level `if:` or `container:` fails. A repeated key fails. In those two workflows the only upload of `coverage-xml` or `aw-editor-lcov` is the producer job's report upload. No step sets `overwrite`. Every scanned upload `name`, in every workflow and composite, fails when `str.strip()` changes it, or when it contains a character outside printable ASCII (0x20-0x7E). The publish path rejects any scalar outside 0x20–0x7E on either edge or in the middle of either pinned name. The test walks every non-surrogate scalar outside 0x20-0x7E, on either edge and in the middle of both pinned names, through the form check and through the publish function on a non-producer path and on both producer workflows, and expects a reject for each name. The same walk checks the form check against `_could_be_pinned_report_name` on the non-producer path, and it walks the printable scalars on those edges. A space or `~` in the middle of a name is allowed. A name that contains `${{` fails in `coverage.yml` and `aw-editor-tests.yml`. Elsewhere that name fails unless it is an exact member of the published artifact names. Those names are `alloc-measure-${{ matrix.crate }}`, `benchmark-alert-results-${{ github.sha }}`, `benchmark-alert-results-${{ github.sha }}-shard-${{ matrix.shard_index }}`, `benchmark-results-${{ github.sha }}`, `benchmark-results-${{ github.sha }}-shard-${{ matrix.shard_index }}`, `bundle-${{ matrix.target }}`, `mutants-ai-results-${{ matrix.shard }}`, `performance-${{ matrix.toolchain }}`, `regression-report-${{ github.sha }}`, `replay-hash-${{ runner.os }}`, and `security-audit-report-${{ github.run_number }}`. A new published name is that exact string added to this list. The expression is not evaluated, and literal text around `${{` is not matched. A name that remains is compared without case to the pinned report. `archive` fails unless it is absent or true. A repeated key in an upload `with:` map fails, including a later case-variant. The check does not keep the first value or the last value. A sub-path of `actions/upload-artifact`, including `merge`, is the same upload, and that action-name compare ignores case. The one plain producer upload remains the exception when its `name` is exactly that file's pinned report. Every local `uses:` must exactly match `./.github/actions/rust-ci-setup` or `./.github/actions/rust-nightly`, or an entry on the reusable-workflow allowlist. That allowlist is empty. There is no prefix exemption. A directory under `.github/workflows` fails. Each of those two action files is shape-locked, including `runs.using`, inputs, and steps, and the locked `action.yml` must exist with no `action.yaml` beside it. Any other local path fails. Reusable workflow targets are an exact allowlist, and that allowlist is empty, so a local or SHA-pinned reusable workflow fails unless it is listed. The job ids in `coverage.yml` are exactly `coverage`, `codecov`, and `coverage-html`. The job ids in `aw-editor-tests.yml` are exactly `test`, `coverage`, and `codecov`. An added or missing job id fails. External actions in each of those files are an exact allowlist of the actions that file uses. Any other external action fails. An `overwrite` key still fails on every scanned upload step. In `coverage.yml`, `aw-editor-tests.yml`, and `kani.yml`, `defaults` is absent at workflow level and at job level. Workflow `env` is absent in `coverage.yml` and exactly the canonical map in `aw-editor-tests.yml` and `kani.yml`. Removing that map fails. Job `env` is absent. A custom shell, a working-directory, or an env map that is not that canonical map fails. The generation job and the upload job do not set `continue-on-error`. The editor coverage job installs `cargo-llvm-cov` `0.9.1` with `--locked`. `editor-ci.yml` installs that same version with `tool: cargo-llvm-cov@0.9.1` on `taiki-e/install-action` commit `3f7c3597aa4e6da3f315e128de702ce61e7b2877`. `editor-ci.yml` and `kani.yml` set top-level `permissions: {}` and exactly `contents: read` on every job. Any repeated key on that workflow mapping fails, including a repeated `permissions` key whose last value is `{}`. A repeated key on the job fails, including a repeated `permissions` key whose last map is `contents: read`. A repeated key on a job permissions map fails, including when the last value is still `contents: read`. An extra scope, a different case, or padding on that map fails. Kani steps pass `kani-version: 0.68.0`. The Kani `timeout` input is `type: number` with default `300`. Each Kani job allowlists 60, 120, 300, 600, and 900. Its `args` value is exactly `--package -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }}` for that job's crate. The only expression is `steps.timeout.outputs.value`. A dot, bracket, quoted, whitespace, or case spelling of the input context fails that check. The step's `with:` keys are `kani-version`, `command`, `working-directory`, and `args`. `command` is exactly `cargo-kani`. `working-directory` is the literal `.`. A repeated input key fails, including a later case-variant that a first-match lookup would skip. Each Kani job's `timeout` step equals the canonical step. The keys are `name`, `id`, `env`, and `run`. `env` is exactly `KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }}`. The `run` text matches the approved script after trailing whitespace is trimmed. Leading whitespace on `run` fails. Any other key, value, or run line fails. A second timeout step fails. Each of the four Kani jobs is an exact ordered list of canonical steps for its job id: checkout, the timeout step, the Kani action, and the report upload. An inserted, removed, or reordered step fails. Every step equals its canonical step, including the action step's keys, so a step `env` fails. The job id maps to a canonical entry whose `args` is a non-null string. An unmapped or renamed job fails. Each of the four mapped job ids must be present. A null `args` value does not compare equal to a missing entry. Each of those four jobs has exactly the keys `name`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. A repeated key fails. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 120 on `kani-ecs`, 60 on `kani-math`, 60 on `kani-sdk`, and 90 on `kani-core`. A job-level `if:` fails, and so do `container:`, `services:`, `strategy:`, `environment:`, `outputs:`, `concurrency:`, `needs:`, and `snapshot:`. A step `if:` or a step `continue-on-error` fails. A job-level `continue-on-error` fails. The `summary` job needs exactly those four job ids, in that order, and its `if:` is `always()`. A missing `needs` value, or a `needs` value that is not that list, fails. A repeated key on the summary job fails. The summary job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, `needs`, `if`, and `steps`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 10. Its steps are exactly `Check Results`, then `Fail if any verification failed`. A changed step, an extra step, or a job-level `continue-on-error`, `container:`, `services:`, `strategy:`, or `environment:` fails. The `Fail if any verification failed` step equals its canonical step, and that step is present once. That step's `if:` is true when any needed result is not `success`, so a skipped or cancelled job fails the gate. Each `actions/checkout` step in `coverage.yml`, `aw-editor-tests.yml`, and `kani.yml` equals that file's canonical checkout. The key set and every value match, including the `with:` map, which is exactly `persist-credentials: false`. `coverage.yml` names the step `Checkout code`. `aw-editor-tests.yml` names it `Checkout Repository`. `kani.yml` has no `name` key. An extra key such as `repository`, `ref`, or `token`, or an extra `run` line, fails. | | CodeQL | push to main and weekly (Sunday 03:00 UTC). Not on pull requests. | | Benchmarks, including `aw_build` | see item 1 above. Shard count is 16 (`shard_index` 0–15, `--shard-count 16`). Shards 13, 14, and 15 are `astraweave-render@a`, `@b`, and `@c` (explicit thirds of that crate's bench targets). #374 flat-samples `fluid_baseline_50k` and is on main. Shard 0 is `astraweave-net`, `astraweave-profiling`, `astraweave-water`, and `astraweave-localsim` (#351). Each sharded bench target gets `timeout 600` after `cargo bench --no-run`. Compilation is outside that limit. The `aw_build` job is separate and uses its 30-minute job timeout. The aggregate expects 53 package records. `github-action-benchmark` stores `dev/bench` on branch `benchmark-data`. `gh-pages` is the docs site, and main also has a `gh-pages/` directory, so the old checkout never published that history. The PR comment step clones `github.com//`, does not auto-push, and comments only when a result exceeds the alert threshold. | | Integration tests other than the replay hash | `integration-tests.yml` on push and schedule 04:00 UTC. | @@ -101,16 +101,16 @@ When the same tests also run under nextest (an affected crate on a pull request, Those four workflows still trigger on every pull request. The heavy jobs are conditional. A skipped job reports success to branch protection. `on.paths` is not used: a path filter would leave a required check pending. `determinism-replay.yml` has no scope and no path filter. The Aravath golden-hash matrix still expands when the scope is cold, so the three `Replay hash (...)` check names are created; the compile steps are skipped. `net-tests.yml` no longer uses `paths-ignore` for markdown. A docs-only pull request classifies `run=false` and skips the `net-tests` job by condition instead of omitting the workflow. Push, schedule, and `workflow_dispatch` do not consult the diff. -`scripts/ci/test_affected_crates.py` and `scripts/ci/test_workflow_policy.py` lock this in. `actionlint` 1.7.7 reports no findings on the workflow files. +`scripts/ci/test_affected_crates.py` and `scripts/ci/test_workflow_policy.py` lock this in. `actionlint` 1.7.12 reports two findings on the workflow files, both the pre-existing `gpu` runner label in `allocation-measurement.yml` and `gpu-frame-budget.yml`. Those two findings are the same on the base commit. The policy test parses each file with one `CSafeLoader` pass. The module fails to import when libyaml's `CSafeLoader` is missing. A pure `SafeLoader` is not the scan binding. Every scanned file parses to the same marked tree under both bindings. A tab after a key, a tab before a trailing comment, and a tab inside a flow mapping parse under `CSafeLoader` and fail under `SafeLoader`. A lone surrogate escape fails under `CSafeLoader` and parses under `SafeLoader`. Both reject tags outside the safe schema. A plain scalar's style is stored as null. There is no earlier `safe_load` pass. Any repeated key on any mapping fails, including a repeated job id and a repeated step key, on every workflow and composite. The walk includes `with`, `env`, and `permissions`. A YAML 1.1 bool-name key is compared by its scalar spelling, so a quoted or tagged `on` is the same key as a bare `on`. A single bare `on` still passes. Case is exact: `FOO` and `foo` are different keys. Root, job, and step keys are an exact allowlist of GitHub's keys on every scanned workflow and composite action. A different case or any other key fails. The job ids in `editor-ci.yml` are exactly `editor-ci`. The `editor-ci` job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, `continue-on-error`, and `steps`. A different case or any other key fails. It checks every `uses` value, including `jobs.*.steps[*].uses`, `jobs.*.uses`, and composite `runs.steps[*].uses`. The scan covers `.github/workflows` and `.github/actions`, including `*.yml` and `*.yaml`, and runs every violations check. `.github/actions/rust-ci-setup/action.yml` `runs.steps` equals a canonical ordered list, `Enable sccache` has one `RUSTC_WRAPPER=` assignment, and the `toolchain` default is `1.89.0`. An extra step, including one that writes `GITHUB_ENV`, fails. The action's top-level keys are `name`, `description`, `inputs`, and `runs`. `inputs` are exactly `toolchain`, `components`, and `install-nextest`, with defaults `1.89.0`, `rustfmt,clippy`, and `false`. `runs.using` is `composite`. Every local `uses:` must exactly match `./.github/actions/rust-ci-setup` or `./.github/actions/rust-nightly`, or an entry on the reusable-workflow allowlist. That allowlist is empty, so there is no prefix exemption. A directory under `.github/workflows` fails. The locked `action.yml` must exist, and `action.yaml` must not sit beside it. Both action files are shape-locked. An extra input, a changed default, an extra top-level key, or any other `runs.using` fails. Quotes, block scalars (`>`, `>-`, `|`, `|-`, and an explicit indent such as `>2-`), flow mappings, aliases, and an escaped `@` are the parsed string. A local `./` action has no ref. `docker://` must end in `@sha256:` and 64 hex digits. The five pinned `actions/*` names stay on the major-tag rule outside those two workflows. `kani.yml` checkout and upload-artifact are the exception: `actions/checkout` commit `3d3c42e5aac5ba805825da76410c181273ba90b1` (# v7) and `actions/upload-artifact` commit `cf430e030ddbb5b0abf93d22962f4752f3646cd9` (# v7.0.2). `editor-ci.yml` stays on the major tag. In `coverage.yml` and `aw-editor-tests.yml`, `coverage_artifact_pin_violations` requires a 40-character commit SHA on every non-local `uses:`, including `actions/checkout` (`3d3c42e5aac5ba805825da76410c181273ba90b1`, # v7), the coverage HTML upload (`cf430e030ddbb5b0abf93d22962f4752f3646cd9`, # v7.0.2), and the three `actions/download-artifact` steps (`9000827ccba6bdab643e8b6fd33ac0654aef8333`, # v8.0.2). A major tag, including `actions/checkout@v7`, fails that check. A local `./` action has no ref. Every other ref, including any other `actions/*` name, must be a 40-character commit SHA. Invalid YAML fails the check. Every `codecov/codecov-action` step, matched case-insensitively, must set `fail_ci_if_error`, `disable_search`, and `use_oidc` to a value the runner passes as the string `true`: a plain scalar `true`, `True`, or `TRUE`, or the quoted string `true`. `yes` and `on` fail that check. `version` must be an exact `vX.Y.Z` and `files` a non-empty path. On these two workflows `files` must be the pinned path: `./tools/astraweave-assets/coverage/cobertura.xml` in `coverage.yml` and `./lcov.info` in `aw-editor-tests.yml`. Those keys are read only from that step's `with:` mapping, compared case-insensitively. The same key on the step or under `env:` fails the check. The step's own keys must be among `name`, `uses`, and `with`. An `if:` fails that check, including `false`, `${{ false }}`, and `failure()`. The `with:` keys must be among `files`, `disable_search`, `flags`, `name`, `version`, `fail_ci_if_error`, and `use_oidc`. A `token` or `CODECOV_TOKEN` key, compared case-insensitively, fails the check on the step, in that job's `env`, and in the workflow `env`. A `secrets` context inside `${{ }}` in those same places fails the check, including `secrets['NAME']` and `SECRETS.NAME`. The secret name is not special-cased. A job that runs the action, and a job named in that job's `needs:`, may set `continue-on-error` only when the key is absent or the raw scalar is the word false in any case, as a plain boolean or a quoted string. Any other value is a violation, including every `${{ }}` expression, on the parsed job or on any parsed step. A quoted key and a flow mapping count. On `coverage.yml` and `aw-editor-tests.yml` only, the action is allowed only in a job whose keys are exactly `name`, `needs`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`, and whose steps are `actions/download-artifact` plus the SHA-pinned Codecov action. That upload job's `runs-on` is `ubuntu-latest` and its `timeout-minutes` is 10. That download step's keys are only `name`, `uses`, and `with`. Its `with:` keys are exactly `name` and `path`, both required. The `name` value is `coverage-xml` in `coverage.yml` and `aw-editor-lcov` in `aw-editor-tests.yml`. `needs` is exactly the job `coverage`, as that string or as `[coverage]`. The `coverage` job's last step is the `upload-artifact` whose `with.name` is the pinned report (`coverage-xml` or `aw-editor-lcov`). A job-level `if:`, an `if:` on a step in that job, a later step, a different artifact name, or a step that is not exactly its canonical step fails the check. The `coverage` job in `coverage.yml` and the `coverage` job in `aw-editor-tests.yml` are each an exact ordered list of canonical steps. An inserted, removed, or reordered step fails. Every step equals its canonical step, including `Rust CI setup` and `Install Rust Toolchain`, with their `with:` and `env`. The key set matches, every other key and value matches, including the upload `with:` map, and the `run` text matches after trailing whitespace is trimmed. Leading whitespace on `run` fails. An extra key, an extra run line, a different upload `path`, or `if-no-files-found` fails. The producer job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 45. A generate-coverage script other than the approved `cargo tarpaulin --out Xml` command, or a step between the editor `cargo llvm-cov` run and the lcov upload, fails the check. Job `coverage-html` and the editor `test` job are each an exact ordered list of canonical steps. An inserted, removed, or reordered step fails. The `Install cargo-tarpaulin` step in `coverage-html` is that list's canonical install, including `--version` and `--locked`. `coverage-html` keys are exactly `name`, `needs`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. `needs` is the job `coverage`, as that string or as `[coverage]`. `permissions` are exactly `contents: read`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 45. A job-level `if:` or `container:` fails. A repeated key fails. The editor `test` job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, `continue-on-error`, `strategy`, and `steps`. Its permissions map is exactly `contents: read`. `runs-on` is `${{ matrix.os }}`. `timeout-minutes` is 45. `strategy` is `fail-fast: false` and `matrix.os` is `ubuntu-latest`, `windows-latest`, and `macos-latest`, with no other matrix key. A job-level `if:` or `container:` fails. A repeated key fails. In those two workflows the only upload of `coverage-xml` or `aw-editor-lcov` is the producer job's report upload. No step sets `overwrite`. Every scanned upload `name`, in every workflow and composite, fails when `str.strip()` changes it, or when it contains a character outside printable ASCII (0x20-0x7E). The publish path rejects any scalar outside 0x20–0x7E on either edge or in the middle of either pinned name. The test walks every non-surrogate scalar outside 0x20-0x7E, on either edge and in the middle of both pinned names, through the form check and through the publish function on a non-producer path and on both producer workflows, and expects a reject for each name. The same walk checks the form check against `_could_be_pinned_report_name` on the non-producer path, and it walks the printable scalars on those edges. A space or `~` in the middle of a name is allowed. A name that contains `${{` fails in `coverage.yml` and `aw-editor-tests.yml`. Elsewhere that name fails unless it is an exact member of the published artifact names. Those names are `alloc-measure-${{ matrix.crate }}`, `benchmark-alert-results-${{ github.sha }}`, `benchmark-alert-results-${{ github.sha }}-shard-${{ matrix.shard_index }}`, `benchmark-results-${{ github.sha }}`, `benchmark-results-${{ github.sha }}-shard-${{ matrix.shard_index }}`, `bundle-${{ matrix.target }}`, `mutants-ai-results-${{ matrix.shard }}`, `performance-${{ matrix.toolchain }}`, `regression-report-${{ github.sha }}`, `replay-hash-${{ runner.os }}`, and `security-audit-report-${{ github.run_number }}`. A new published name is that exact string added to this list. The expression is not evaluated, and literal text around `${{` is not matched. A name that remains is compared without case to the pinned report. `archive` fails unless it is absent or true. A repeated key in an upload `with:` map fails, including a later case-variant. The check does not keep the first value or the last value. A sub-path of `actions/upload-artifact`, including `merge`, is the same upload, and that action-name compare ignores case. The one plain producer upload remains the exception when its `name` is exactly that file's pinned report. Every local `uses:` must exactly match `./.github/actions/rust-ci-setup` or `./.github/actions/rust-nightly`, or an entry on the reusable-workflow allowlist. That allowlist is empty. There is no prefix exemption. A directory under `.github/workflows` fails. Each of those two action files is shape-locked, including `runs.using`, inputs, and steps, and the locked `action.yml` must exist with no `action.yaml` beside it. Any other local path fails. Reusable workflow targets are an exact allowlist, and that allowlist is empty, so a local or SHA-pinned reusable workflow fails unless it is listed. The job ids in `coverage.yml` are exactly `coverage`, `codecov`, and `coverage-html`. The job ids in `aw-editor-tests.yml` are exactly `test`, `coverage`, and `codecov`. An added or missing job id fails. External actions in each of those files are an exact allowlist of the actions that file uses. Any other external action fails. An `overwrite` key still fails on every scanned upload step. In `coverage.yml`, `aw-editor-tests.yml`, and `kani.yml`, `defaults` is absent at workflow level and at job level. Workflow `env` is absent in `coverage.yml` and exactly the canonical map in `aw-editor-tests.yml` and `kani.yml`. Removing that map fails. Job `env` is absent. A custom shell, a working-directory, or an env map that is not that canonical map fails. The producer job's permissions map is exactly `contents: read`. An added, removed, or changed scope fails. On the Codecov upload job, `container:`, `services:`, `uses:`, and a checkout step fail the check. The Codecov upload job's permissions must be exactly `contents: read` and `id-token: write`. Its `runs-on` is `ubuntu-latest` and its `timeout-minutes` is 10. A repeated key on that upload job fails. A repeated key in that job's permissions map fails, including when the last value is `contents: read` and `id-token: write`. Parsed top-level `permissions` must be `{}`, and a missing top-level `permissions` key fails the check. Any repeated workflow key fails, including a repeated `permissions` key whose last value is `{}`. The check rejects a `write-all` scalar or value. A key or value that parses to anything other than the exact map fails, including a different case, padding, a quoted value other than `read` or `none`, or an expression. A quoted key or a flow mapping that parses to the exact map is that map. `id-token` may be exactly `write` on the upload job. The editor `test` job's permissions map is exactly `contents: read`. `on:` is parsed as a string, a list, or a mapping, and a bare `on` key loads as `True`. Those two workflows may list only `push`, `schedule`, and `workflow_dispatch`. `pull_request`, `pull_request_target`, `workflow_run`, and `issue_comment` fail the check. `kani.yml` and `editor-ci.yml` must set top-level `permissions` to `{}` and each job's `permissions` to exactly `contents: read`. Any repeated key on that workflow mapping fails, including a repeated `permissions` key whose last value is `{}`. A repeated key on the job fails, including a repeated `permissions` key whose last map is `contents: read`. A repeated key on a job permissions map fails, including when the last value is `contents: read`. An extra scope, a different case, or padding on that map fails. The Kani `timeout` input must be `type: number` with default `300`. Each of the four Kani jobs allowlists 60, 120, 300, 600, and 900. Each step's `args`, read from `with:`, must equal `--package -Z unstable-options --harness-timeout ${{ steps.timeout.outputs.value }}` for that job's crate. The only expression is `steps.timeout.outputs.value`. A dot, bracket, quoted, whitespace, or case spelling of the input context fails that check, and so does any other change to the string. The step's `with:` keys are `kani-version`, `command`, `working-directory`, and `args`. `command` is exactly `cargo-kani`. `working-directory` is the literal `.`. A repeated input key fails, including a later case-variant that a first-match lookup would skip. Each Kani job's `timeout` step equals the canonical step. The keys are `name`, `id`, `env`, and `run`. `env` is exactly `KANI_TIMEOUT_INPUT: ${{ github.event.inputs.timeout }}`. The `run` text matches the approved script after trailing whitespace is trimmed. Leading whitespace on `run` fails. Any other key, value, or run line fails. A second timeout step fails. Each of the four Kani jobs is an exact ordered list of canonical steps for its job id: checkout, the timeout step, the Kani action, and the report upload. An inserted, removed, or reordered step fails. Every step equals its canonical step, including the action step's keys, so a step `env` fails. The job id maps to a canonical entry whose `args` is a non-null string. An unmapped or renamed job fails. Each of the four mapped job ids must be present. A null `args` value does not compare equal to a missing entry. Each of those four jobs has exactly the keys `name`, `permissions`, `runs-on`, `timeout-minutes`, and `steps`. A repeated key fails. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 120 on `kani-ecs`, 60 on `kani-math`, 60 on `kani-sdk`, and 90 on `kani-core`. A job-level `if:` fails, and so do `container:`, `services:`, `strategy:`, `environment:`, `outputs:`, `concurrency:`, `needs:`, and `snapshot:`. A step `if:` or a step `continue-on-error` fails. A job-level `continue-on-error` fails. The `summary` job needs exactly those four job ids, in that order, and its `if:` is `always()`. A missing `needs` value, or a `needs` value that is not that list, fails. A repeated key on the summary job fails. The summary job's keys are exactly `name`, `permissions`, `runs-on`, `timeout-minutes`, `needs`, `if`, and `steps`. `runs-on` is `ubuntu-latest`. `timeout-minutes` is 10. Its steps are exactly `Check Results`, then `Fail if any verification failed`. A changed step, an extra step, or a job-level `continue-on-error`, `container:`, `services:`, `strategy:`, or `environment:` fails. The `Fail if any verification failed` step equals its canonical step, and that step is present once. That step's `if:` is true when any needed result is not `success`, so a skipped or cancelled job fails the gate. Each `actions/checkout` step in `coverage.yml`, `aw-editor-tests.yml`, and `kani.yml` equals that file's canonical checkout. The key set and every value match, including the `with:` map, which is exactly `persist-credentials: false`. `coverage.yml` names the step `Checkout code`. `aw-editor-tests.yml` names it `Checkout Repository`. `kani.yml` has no `name` key. An extra key such as `repository`, `ref`, or `token`, or an extra `run` line, fails. Every Kani step must set `kani-version` to an exact `X.Y.Z` under `with:` only. The same key on the step or under `env:` fails the check. A `uses:` ref of `@stable` fails the SHA rule. Every `cargo install` of `cargo-llvm-cov` in a run script must pass `--version X.Y.Z` and `--locked`, including a second install after `&&` and a backslash continuation. An `install-action` step that installs it must set `tool: cargo-llvm-cov@X.Y.Z` under `with:` only. ## Cache -`.github/actions/rust-ci-setup` is the shared setup: +`.github/actions/rust-ci-setup` is the shared setup. The policy test exact-matches that action's `runs.steps` to a canonical ordered list. `Enable sccache` contains one `RUSTC_WRAPPER=` assignment. An extra step fails, including a step that writes `GITHUB_ENV`. The action's top-level keys are `name`, `description`, `inputs`, and `runs`. `inputs` are exactly `toolchain`, `components`, and `install-nextest`, with defaults `1.89.0`, `rustfmt,clippy`, and `false`. `runs.using` is `composite`. Every local `uses:` must exactly match `./.github/actions/rust-ci-setup` or `./.github/actions/rust-nightly`, or an entry on the reusable-workflow allowlist. That allowlist is empty, so there is no prefix exemption. A directory under `.github/workflows` fails. The locked `action.yml` must exist, and `action.yaml` must not sit beside it. `.github/actions/rust-nightly/action.yml` equals its canonical document, including `runs.using: composite`. -- pinned toolchain (default 1.89.0) via `dtolnay/rust-toolchain` +- pinned toolchain (`toolchain` input, default 1.89.0) via `dtolnay/rust-toolchain` `master` commit `683b588c487a69d01f6c6ddf40f036ff682cc2c8`. `rust-ci-setup`, `rust-nightly`, and toolchain-management pin that commit and pass the toolchain as an input. `rust-ci-setup` passes `toolchain: ${{ inputs.toolchain }}`. Workflows that call `dtolnay/rust-toolchain` directly use the `1.89.0` branch commit `599c45df1a24c1c63ae1129a7e59f46654b8fb66`. Workflows that already named `d77020bf130f2e8c39c025bf9c4c3a445fe2b9fa` stay on that earlier `1.89.0` commit. - Linux build dependencies, including `libudev-dev` and `libasound2-dev` (this is what Editor CI was missing on PR #212) -- `sccache` 0.19.0 with `SCCACHE_GHA_ENABLED=true` and `RUSTC_WRAPPER=sccache`. `CARGO_INCREMENTAL=0` is set in this action and in `ci.yml`. Pull requests and non-main refs set `SCCACHE_GHA_RW_MODE=READ_ONLY`. Pushes and schedules on `refs/heads/main` set `READ_WRITE`. The action does not set `RUSTFLAGS`: Cargo 1.89 replaces every `rustflags` entry in `.cargo/config.toml` when that variable is set. The Linux CPU pin is `[target.x86_64-unknown-linux-gnu] rustflags = ["-C", "target-cpu=x86-64"]`, beside the Windows 16 MiB stack flags. aarch64 keeps the default baseline. sccache 0.19 does not cache `bin`, `cdylib`, or `proc-macro` crate types. -- Swatinem `rust-cache` v2 with `shared-key: ${{ runner.os }}-astraweave`, `cache-targets: false`, `save-if` only on `refs/heads/main` +- `sccache` 0.19.0 with `SCCACHE_GHA_ENABLED=true` and `RUSTC_WRAPPER=sccache`. The action is `mozilla-actions/sccache-action` commit `fc920bf0ec8de6ee65d409111f7ec508035751ba` (# v0.0.11). `CARGO_INCREMENTAL=0` is set in this action and in `ci.yml`. Pull requests and non-main refs set `SCCACHE_GHA_RW_MODE=READ_ONLY`. Pushes and schedules on `refs/heads/main` set `READ_WRITE`. The action does not set `RUSTFLAGS`: Cargo 1.89 replaces every `rustflags` entry in `.cargo/config.toml` when that variable is set. The Linux CPU pin is `[target.x86_64-unknown-linux-gnu] rustflags = ["-C", "target-cpu=x86-64"]`, beside the Windows 16 MiB stack flags. aarch64 keeps the default baseline. sccache 0.19 does not cache `bin`, `cdylib`, or `proc-macro` crate types. +- Swatinem `rust-cache` v2.9.3 (`d1527c8f67ef9af357290475d4af4b0fab8f12e0`) with `shared-key: ${{ runner.os }}-astraweave`, `cache-targets: false`, `save-if` only on `refs/heads/main`. Workflows that already named `6323deb102c322ba6fcbdcafc7e3dddab59af2b6` stay on that v2.9.2 pin. Registry and git caches are shared across jobs and workflows on the same OS. Compilation artifacts stay in sccache, so the two caches do not both wrap `target/`. Pull requests restore both caches and do not save them. Job `121303738868` (run `40235303264`) recorded rust hit rate 11.01%, 263 cache write errors, and 826 non-cacheable calls (621 `crate-type`, 113 `bin`, 66 `proc-macro`) while `effective_cache_mode` was `ReadWrite`. Gate samples from the same window were 24.34% and 38.52% overall. diff --git a/docs/current/EDITOR_BASELINE.md b/docs/current/EDITOR_BASELINE.md index 737f8b10d3..ba631069d7 100644 --- a/docs/current/EDITOR_BASELINE.md +++ b/docs/current/EDITOR_BASELINE.md @@ -6,7 +6,7 @@ with the shared configuration in `llvm-cov.toml` and by inspecting the crates an ## CI and Instrumentation - `.github/workflows/editor-ci.yml` now enforces `cargo fmt`, `cargo clippy`, `cargo check`, headless smoke tests, and publishes the `cargo llvm-cov` artifact on every PR touching the editor (see `.github/workflows/editor-ci.yml:1`). - The job uploads both the LCOV file and the HTML report plus a summary extracted from `coverage/summary.json` so coverage deltas are always reviewable (`.github/workflows/editor-ci.yml:63-90`). + The job uploads both the LCOV file and the HTML report plus a summary extracted from `coverage/summary.json` so coverage deltas are always reviewable (`.github/workflows/editor-ci.yml:69-112`). - The root `llvm-cov.toml` forces `--all-features`, disables early aborts, and filters generated/test-only paths so measurements stay comparable to the north-star targets (`llvm-cov.toml:1-16`). ## Coverage Snapshot (`cargo llvm-cov` on Windows, Rust 1.89.0) diff --git a/docs/current/MASTER_COVERAGE_REPORT.md b/docs/current/MASTER_COVERAGE_REPORT.md index ad9928aaa8..c277cd5612 100644 --- a/docs/current/MASTER_COVERAGE_REPORT.md +++ b/docs/current/MASTER_COVERAGE_REPORT.md @@ -260,7 +260,7 @@ Full details: [MIRI_VALIDATION_REPORT.md](MIRI_VALIDATION_REPORT.md) **Scope**: 4 crates, ~71 proof harnesses **Status**: Clean — all proofs verified -**CI**: Weekly (Sunday 3:00 AM UTC) via `model-checking/kani-github-action@v1` +**CI**: Weekly (Sunday 3:00 AM UTC) via `model-checking/kani-github-action` commit `69d357bade1eb7b32bc3fc3d5c3d173c5bfa5237` (`# v1`) | Crate | Proofs | Properties Verified | |-------|--------|---------------------| @@ -328,14 +328,14 @@ Kani uses CBMC bounded model checking. Math proofs use concrete representative i | **Wave 3 Total** | | **463** | **22** | **3** | **1** | **95.5%** | **Terrain remaining MISSED** (4 in latest v4 run): -- `heightmap.rs:152–153`: `replace - with +` and `replace - with /` in `Heightmap::sample_bilinear` — bilinear interpolation weight calculations require exact-value regression tests -- All 4 are arithmetic operator mutations in interpolation weight computation +- `heightmap.rs:152–153`: `replace - with +` and `replace - with /` on the neighbour-index clamps `(x0 + 1).min(self.resolution - 1)` and `(z0 + 1).min(self.resolution - 1)` in `Heightmap::sample_bilinear`. `Heightmap::new` and `Heightmap::from_data` reject a resolution above 32769. For every resolution from 2 through 32769, `(resolution as f32) - 1.001` is strictly below `resolution - 1`, so `x0 + 1` and `z0 + 1` are already at most `resolution - 1` and the `min` does not change the index. Resolution 32770 is the first value where that subtraction rounds to `resolution - 1`, `x0 + 1` is `resolution`, and both replacements read past the edge. The constructor rejects it. Resolutions 0 and 1 are still accepted. At those sizes `sample_bilinear` panics in the clamp at `:147–148` before the neighbour index, because the upper bound is below 0, in the original and in both replacements. +- All 4 are those neighbour-index clamp mutants. The interpolation weights at `:163–166` are a different site. **Render remaining MISSED** (5 in v2 run): -- `environment.rs:61`: `replace - with +` in `get_sun_position` — azimuth sign inversion -- `environment.rs:67`: `replace < with ==` and `replace < with <=` in `get_sun_position` — boundary condition in sun hemisphere check -- `renderer.rs:3292`: `replace set_weather with ()` — requires GPU context for full validation -- `biome_transition.rs:96`: `replace < with <=` in `EasingFunction::apply` — boundary condition at t=1.0 +- `environment.rs:63`: `replace - with +` in `get_sun_position` — full-period shift. `current_time - 12.0` becomes `current_time + 12.0`, which adds 2π to the azimuth over the reals. In `f32`, `sin` and `cos` still change by rounding, by at most about 1.4e-6. Not equivalent. The current sun-position assertions use absolute tolerances of about `1e-3` and wider, so they do not detect that delta. +- `environment.rs:69`: `replace < with ==` and `replace < with <=` in `get_sun_position` — boundary condition in sun hemisphere check +- `renderer.rs:6950`: `replace set_weather with ()` — requires GPU context for full validation +- `biome_transition.rs:96`: `replace < with <=` in `EasingFunction::apply` — EaseInOut boundary at `t < 0.5`. Both branches return 0.5 at `t = 0.5`, so this mutant is equivalent. **Wave 3 remediation commits**: `cd6475df`, `9db0d3be`, `c7d573fb`, `bfb94e46`, `57a14600`. diff --git a/scripts/ci/test_workflow_policy.py b/scripts/ci/test_workflow_policy.py index 27f4ea0493..2488c54af0 100644 --- a/scripts/ci/test_workflow_policy.py +++ b/scripts/ci/test_workflow_policy.py @@ -7,7 +7,6 @@ from __future__ import annotations -import inspect import json import os import re @@ -18,6 +17,8 @@ import unittest from pathlib import Path +import yaml + ROOT = Path(__file__).resolve().parents[2] WORKFLOWS = ROOT / ".github" / "workflows" sys.path.insert(0, str(ROOT / "scripts" / "ci")) @@ -103,579 +104,3695 @@ def action_ref_violation(action: str, ref: str) -> str | None: return f"{action}@{ref} {NON_SHA_TAG_MSG}" -def workflow_action_pin_violations(text: str, *, path: str = "") -> list[str]: - violations: list[str] = [] - prefix = f"{path}: " if path else "" - for line_no, line in enumerate(text.splitlines(), start=1): - match = ACTION_USES_RE.search(line) - if not match: +# A matching quote, or a one-level >, >-, |, or |- block scalar, is valid +# YAML for a uses value. Flatten those forms before the major-tag and SHA +# checks so the ref group cannot keep the quote or the block marker. +_QUOTED_USES_RE = re.compile( + r"^(?P\s*(?:-\s+)?)uses:\s*(?P['\"])(?P.*?)(?P=q)(?P\s*(?:#.*)?)?$" +) +_BLOCK_USES_RE = re.compile( + r"^(?P\s*(?:-\s+)?)uses:\s*(?P