Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/crumb-spec/blob/main/.github/workflows/sovereign-reviewer.yml # crumb-spec Crumb Protocol specification and filesystem standard for sovereign AI agents Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `crumb-spec / .github / workflows / sovereign-reviewer.yml` 154 lines ยท 5638 bytes Raw Blame History 1 name: Sovereign Gatekeeper & Automated Reviewer 2 3 on: 4 pull_request_target: 5 types: [opened, synchronize] 6 issues: 7 types: [opened] 8 issue_comment: 9 types: [created] 10 11 permissions: 12 pull-requests: write 13 issues: write 14 contents: read 15 16 jobs: 17 pr-reviewer: 18 if: github.event_name == 'pull_request_target' 19 runs-on: ubuntu-latest 20 steps: 21 - name: Checkout Repository 22 uses: actions/checkout@v4 23 24 - name: Checkout Sovereign Inquisitor Core 25 uses: actions/checkout@v4 26 with: 27 repository: aien-dev/aien-sovereign-core 28 path: sovereign-core 29 30 - name: Build Sovereign Inquisitor 31 run: cargo build --release --manifest-path sovereign-core/Cargo.toml -p spark-inquisitor 32 33 34 - name: Fetch PR Diff 35 env: 36 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 run: | 38 gh pr diff "${{ github.event.pull_request.number }}" > pr.diff 39 40 - name: Execute Sovereign Code Review 41 id: review 42 continue-on-error: true 43 run: | 44 ./sovereign-core/target/release/spark-inquisitor review --author "${{ github.event.pull_request.user.login }}" --pr "${{ github.event.pull_request.number }}" --title "${{ github.event.pull_request.title }}" --diff pr.diff --output comment.md --output-labels labels.txt 45 46 - name: Post PR Review Comment 47 if: always() && steps.review.conclusion != 'skipped' 48 env: 49 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 run: | 51 if [ -f comment.md ]; then 52 gh pr comment "${{ github.event.pull_request.number }}" --body-file comment.md 53 fi 54 55 - name: Apply Review Labels 56 if: always() && steps.review.conclusion != 'skipped' 57 env: 58 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 run: | 60 if [ -f labels.txt ]; then 61 LABELS=$(cat labels.txt) 62 if [ -n "$LABELS" ]; then 63 gh pr edit "${{ github.event.pull_request.number }}" --add-label "$LABELS" || true 64 fi 65 fi 66 67 - name: Verify Audit Invariants 68 run: | 69 if [ "${{ steps.review.outcome }}" != "success" ]; then 70 echo "Constitutional diff audit detected violations. See PR comment for details." 71 exit 1 72 fi 73 74 issue-triage: 75 if: github.event_name == 'issues' && github.event.action == 'opened' 76 runs-on: ubuntu-latest 77 steps: 78 - name: Checkout Sovereign Inquisitor Core 79 uses: actions/checkout@v4 80 with: 81 repository: aien-dev/aien-sovereign-core 82 83 - name: Build Sovereign Inquisitor 84 run: cargo build --release -p spark-inquisitor 85 86 - name: Extract Issue Payload Safely 87 run: | 88 jq -r '.issue.body // ""' "$GITHUB_EVENT_PATH" > issue_body.txt 89 90 - name: Execute Sovereign Issue Triage 91 run: | 92 ./target/release/spark-inquisitor triage-issue --author "${{ github.event.issue.user.login }}" --issue "${{ github.event.issue.number }}" --title "${{ github.event.issue.title }}" --body issue_body.txt --output-comment issue_reply.md --output-labels issue_labels.txt 93 94 - name: Post Issue Triage Comment 95 env: 96 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 97 run: | 98 if [ -f issue_reply.md ]; then 99 gh issue comment "${{ github.event.issue.number }}" --body-file issue_reply.md 100 fi 101 102 - name: Apply Issue Labels 103 env: 104 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 105 run: | 106 if [ -f issue_labels.txt ]; then 107 LABELS=$(cat issue_labels.txt) 108 if [ -n "$LABELS" ]; then 109 gh issue edit "${{ github.event.issue.number }}" --add-label "$LABELS" || true 110 fi 111 fi 112 113 comment-evaluator: 114 if: github.event_name == 'issue_comment' && github.event.action == 'created' && github.event.issue.pull_request != null && github.event.comment.user.login != 'github-actions[bot]' && github.event.comment.user.login != 'aien-dev' 115 runs-on: ubuntu-latest 116 steps: 117 - name: Checkout Sovereign Inquisitor Core 118 uses: actions/checkout@v4 119 with: 120 repository: aien-dev/aien-sovereign-core 121 122 - name: Build Sovereign Inquisitor 123 run: cargo build --release -p spark-inquisitor 124 125 - name: Extract Comment Payload Safely 126 run: | 127 jq -r '.comment.body // ""' "$GITHUB_EVENT_PATH" > comment_body.txt 128 129 - name: Evaluate Contributor Testimony 130 id: eval 131 continue-on-error: true 132 run: | 133 ./target/release/spark-inquisitor evaluate --testimony comment_body.txt --author "${{ github.event.comment.user.login }}" --output-comment verdict.md --output-labels verdict_labels.txt 134 135 - name: Post Verdict Comment 136 if: always() && steps.eval.conclusion != 'skipped' 137 env: 138 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 139 run: | 140 if [ -f verdict.md ]; then 141 gh pr comment "${{ github.event.issue.number }}" --body-file verdict.md 142 fi 143 144 - name: Update PR Labels 145 if: always() && steps.eval.conclusion != 'skipped' 146 env: 147 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 148 run: | 149 if [ -f verdict_labels.txt ]; then 150 LABELS=$(cat verdict_labels.txt) 151 if [ -n "$LABELS" ]; then 152 gh pr edit "${{ github.event.issue.number }}" --add-label "$LABELS" || true 153 fi 154 fi