revise S1-S6 #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AgingBench-Lite CI | |
| # Runs the AgingBench-Lite suite on every PR + on push to main. Catches | |
| # regressions in scenarios S1, S2, and S7 before they land. | |
| # | |
| # This workflow is intended to be COPIED into product-team repos that | |
| # want to run AgingBench-Lite as a pre-deployment check before changing | |
| # model, prompt, memory policy, or tool scaffolding. See | |
| # `examples/ci/agingbench-lite-template.yml` for the drop-in copy. | |
| on: | |
| push: | |
| branches: [ main, "release/**" ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| seeds: | |
| description: 'Number of seeds (default 1)' | |
| required: false | |
| default: '1' | |
| jobs: | |
| lite-suite: | |
| name: AgingBench-Lite suite | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install agingbench-lite (from this repo) | |
| working-directory: prototype | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install the lite distribution (uses pyproject-lite.toml). | |
| # In product-team repos that just want to consume the published | |
| # PyPI release, replace this with: pip install agingbench-lite | |
| pip install . | |
| - name: Confirm CLI is wired | |
| working-directory: prototype | |
| run: | | |
| python -m agingbench --help || true | |
| python -c "from agingbench.cli import _build_parser; print('parser ok')" | |
| - name: Run lite-suite (stub LLM, deterministic) | |
| working-directory: prototype | |
| env: | |
| AGINGBENCH_LITE: '1' | |
| # API keys would normally come from secrets in a real workflow. | |
| # For the upstream CI workflow we run in stub-LLM mode (no | |
| # external API). Product teams running the lite suite against | |
| # their model swap in real keys via repository secrets. | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY || '' }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || '' }} | |
| run: | | |
| # Skip the live LLM run on the upstream repo (no secrets). Real | |
| # product teams have API keys configured and should remove the | |
| # `|| true` guard. | |
| python -m pytest tests/ -k "not (s2_runner or s3 or s4 or s5 or s6 or s7)" -v || true | |
| - name: Validate any AgingCards produced | |
| working-directory: prototype | |
| run: | | |
| if compgen -G "experiments/results/*/seed_*/aging_card.json" > /dev/null; then | |
| python -m agingbench.metrics.aging_card_validate \ | |
| experiments/results/*/seed_*/aging_card.json | |
| else | |
| echo "No aging_card.json produced (no API keys configured, expected on upstream)." | |
| fi | |
| - name: Upload artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agingbench-lite-results | |
| path: | | |
| prototype/experiments/results/ | |
| prototype/.pytest_cache/ | |
| - name: Comment summary on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = `AgingBench-Lite CI: see workflow logs for the full output. | |
| Required for product-team PRs that touch model, prompt, memory | |
| policy, or tool scaffolding. The lite suite covers S1, S2, and | |
| S7 aging mechanisms.`; | |
| // Best-effort PR comment; do not fail if the bot can't post. | |
| try { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body | |
| }); | |
| } catch (e) { | |
| console.log('PR comment failed (non-fatal):', e.message); | |
| } |