Stabilize remediation verification and release gates #139
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # REQUIRED PR GATES (per context-engine-audit-response-swarm-plan.md § E.8): | |
| # - Phase 1 transport/cancellation checks | |
| # - Phase 2 retrieval no-silent-downgrade checks | |
| # - Phase 2.5/3 provider conformance checks | |
| name: Performance Gates | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| schedule: | |
| - cron: "30 2 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| baseline_path: | |
| description: "Baseline benchmark JSON path" | |
| required: false | |
| default: "bench-baseline.json" | |
| permissions: | |
| contents: read | |
| jobs: | |
| pr_gate: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| env: | |
| CE_RETRIEVAL_PROVIDER: local_native | |
| BENCH_PROVIDER_LANE: local_native | |
| BENCH_DATASET_ID: context-engine-retrieval-pr-v1 | |
| BENCH_WORKSPACE_ID: ${{ github.repository }}:retrieval-pr-v1 | |
| BENCH_INDEX_FINGERPRINT: context-engine-local-native-index-v1 | |
| BENCH_BASELINE_PATH: artifacts/bench/pr-baseline-remediation-2026-07-15.json | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Check brand detachment guard | |
| run: npm run ci:check:brand-detachment | |
| # Fixture-pack lane: PR-blocking smoke stays on the small checked-in pack | |
| # (config/ci/retrieval-quality-fixture-pack.json, currently 5 holdout cases). | |
| - name: Run benchmark suite and compare (PR mode) | |
| run: npm run bench:ci:pr | |
| - name: Run WS19 SLO threshold gate (index/search family) | |
| run: node --import tsx scripts/ci/ws19-slo-gate.ts --family index_search --artifact artifacts/bench/pr-candidate.json | |
| - name: Generate retrieval parity artifact + threshold gate (PR mode) | |
| run: node --import tsx scripts/ci/retrieval-parity-gate.ts --bench-baseline "${{ env.BENCH_BASELINE_PATH }}" --bench-candidate artifacts/bench/pr-candidate.json --thresholds config/ci/retrieval-parity-thresholds.json --out artifacts/bench/retrieval-parity-pr.json | |
| - name: Upload benchmark artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-gate-pr-artifacts-local_native | |
| path: artifacts/bench/ | |
| if-no-files-found: warn | |
| nightly_gate: | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| env: | |
| CE_RETRIEVAL_PROVIDER: local_native | |
| BENCH_PROVIDER_LANE: local_native | |
| BENCH_DATASET_ID: context-engine-retrieval-nightly-v1 | |
| BENCH_WORKSPACE_ID: ${{ github.repository }}:retrieval-nightly-v1 | |
| BENCH_INDEX_FINGERPRINT: context-engine-local-native-index-v1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Check brand detachment guard | |
| run: npm run ci:check:brand-detachment | |
| # TODO(required-lane-fixture-pack): nightly should select the multilingual/polyglot | |
| # ~144-case pack from Appendix E.10 once an explicit pack/file flag exists in the | |
| # bench helper; current workflow still uses the default checked-in pack. | |
| - name: Run benchmark suite and compare (Nightly mode) | |
| run: npm run bench:ci:nightly | |
| - name: Run WS19 SLO threshold gate (index/search family) | |
| run: node --import tsx scripts/ci/ws19-slo-gate.ts --family index_search --artifact artifacts/bench/nightly-candidate.json | |
| - name: Generate retrieval parity artifact + threshold gate (Nightly mode) | |
| run: node --import tsx scripts/ci/retrieval-parity-gate.ts --bench-baseline artifacts/bench/nightly-baseline.json --bench-candidate artifacts/bench/nightly-candidate.json --thresholds config/ci/retrieval-parity-thresholds.json --out artifacts/bench/retrieval-parity-nightly.json | |
| - name: Generate and validate weekly retrieval trend artifact (Monday UTC) | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "schedule" ] && [ "$(date -u +%u)" = "1" ]; then | |
| npm run -s ci:check:legacy-capability-parity | |
| npm run -s ci:generate:retrieval-quality-report | |
| npm run -s ci:generate:weekly-retrieval-trend-report | |
| npm run -s ci:check:weekly-retrieval-trend-report | |
| else | |
| echo "Skipping weekly trend generation/check (scheduled Monday UTC only)." | |
| fi | |
| - name: Upload benchmark artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-gate-nightly-artifacts-local_native | |
| path: artifacts/bench/ | |
| if-no-files-found: warn | |