|
| 1 | +# Council of Claudes — single-stage PR code review. |
| 2 | +# |
| 3 | +# On a pull request, fans out the PR's diff to persona-based review agents |
| 4 | +# hosted on the kagent cluster (agents.tigera.ai) and posts each persona's |
| 5 | +# feedback back to the PR as a distinct review. |
| 6 | +# |
| 7 | +# Single-stage (unlike the two-stage fork-safe model in cherry_pick_candidate.yml): |
| 8 | +# our demo PRs are same-repo branches, which receive secrets + a write-scoped |
| 9 | +# GITHUB_TOKEN directly. All logic lives in |
| 10 | +# .github/workflows/scripts/council_of_claudes.js. |
| 11 | +# |
| 12 | +# Each persona is gated on its own *_AGENT_URL / *_AGENT_TOKEN repo secrets; |
| 13 | +# personas whose secrets are unset are skipped, so the workflow is usable with |
| 14 | +# only one persona configured (e.g. Correctness first). |
| 15 | + |
| 16 | +name: Council of Claudes |
| 17 | +on: |
| 18 | + pull_request: |
| 19 | + types: [opened, reopened, synchronize] |
| 20 | + |
| 21 | +concurrency: |
| 22 | + # Coalesce rapid pushes to the same PR branch; cancel superseded runs. |
| 23 | + group: council-of-claudes-${{ github.event.pull_request.head.ref }} |
| 24 | + cancel-in-progress: true |
| 25 | + |
| 26 | +jobs: |
| 27 | + review: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + # Headroom for the full serial path on a large/slow PR: 5 personas in |
| 30 | + # parallel (worst ~8m) + the orchestrator's poll (MAX_POLL_MS 10m) + posting. |
| 31 | + # Must exceed that so the orchestrator's own graceful degradation (post-all on |
| 32 | + # timeout) can run instead of the whole job being cancelled mid-flight. |
| 33 | + timeout-minutes: 30 |
| 34 | + permissions: |
| 35 | + contents: read |
| 36 | + pull-requests: write |
| 37 | + env: |
| 38 | + CORRECTNESS_AGENT_URL: ${{ secrets.CORRECTNESS_AGENT_URL }} |
| 39 | + CORRECTNESS_AGENT_TOKEN: ${{ secrets.CORRECTNESS_AGENT_TOKEN }} |
| 40 | + MAINTAINABILITY_AGENT_URL: ${{ secrets.MAINTAINABILITY_AGENT_URL }} |
| 41 | + MAINTAINABILITY_AGENT_TOKEN: ${{ secrets.MAINTAINABILITY_AGENT_TOKEN }} |
| 42 | + SECURITY_AGENT_URL: ${{ secrets.SECURITY_AGENT_URL }} |
| 43 | + SECURITY_AGENT_TOKEN: ${{ secrets.SECURITY_AGENT_TOKEN }} |
| 44 | + # NOTE: every persona in the PERSONAS array (scripts/council_of_claudes.js) must have its |
| 45 | + # *_AGENT_URL/_TOKEN mapped here too — repo secrets are NOT auto-exposed to the script. |
| 46 | + NELLJERRAM_AGENT_URL: ${{ secrets.NELLJERRAM_AGENT_URL }} |
| 47 | + NELLJERRAM_AGENT_TOKEN: ${{ secrets.NELLJERRAM_AGENT_TOKEN }} |
| 48 | + CASEYDAVENPORT_AGENT_URL: ${{ secrets.CASEYDAVENPORT_AGENT_URL }} |
| 49 | + CASEYDAVENPORT_AGENT_TOKEN: ${{ secrets.CASEYDAVENPORT_AGENT_TOKEN }} |
| 50 | + # Orchestrator (cross-persona dedup); if unset, all comments are posted unfiltered. |
| 51 | + ORCHESTRATOR_AGENT_URL: ${{ secrets.ORCHESTRATOR_AGENT_URL }} |
| 52 | + ORCHESTRATOR_AGENT_TOKEN: ${{ secrets.ORCHESTRATOR_AGENT_TOKEN }} |
| 53 | + steps: |
| 54 | + # pull_request checks out the merge ref by default, so the script comes |
| 55 | + # from the PR's own tree — letting us iterate on the workflow via its PR. |
| 56 | + - name: Checkout workflow scripts |
| 57 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 58 | + with: |
| 59 | + persist-credentials: false |
| 60 | + - name: Review pull request |
| 61 | + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 |
| 62 | + with: |
| 63 | + script: | |
| 64 | + const fn = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/council_of_claudes.js`); |
| 65 | + await fn({ github, context, core }); |
0 commit comments