diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 9dccd59..cf0014e 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -1,39 +1,30 @@ name: Claude PR Review on: pull_request: - -# Cancel in-progress reviews for the same PR when a new push arrives. concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true - jobs: claude-review: name: Claude PR Review runs-on: ubuntu-latest - - # Prevent running on fork PRs where secrets are unavailable if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - permissions: contents: read pull-requests: write - id-token: write # OIDC token for Claude GitHub App auth - + issues: write steps: - uses: actions/checkout@v4 - - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - prompt: "/review" - # Pre-loads full PR context and shows a progress tracker. - track_progress: true - # Only include comments from trusted team members in Claude's context (prompt injection mitigation). - include_comments_by_actor: "mmiermans" - # Update the same comment on each push instead of creating new ones. - use_sticky_comment: true - # Inline code comments, PR comments, reading PR diffs, and git log for commit messages. - # gh pr view is excluded to prevent Claude from fetching PR comments (prompt injection risk). + github_token: ${{ github.token }} + prompt: | + You are an automated code reviewer for pull request #${{ github.event.pull_request.number }} in ${{ github.repository }}. Read changes with: gh pr diff ${{ github.event.pull_request.number }} + Classify the single most severe issue as: none, minor, or major. + Then post EXACTLY ONE PR comment (write to file, gh pr comment ${{ github.event.pull_request.number }} --body-file ): + - If none/minor: the ONLY visible (non-collapsed) text must be exactly: "Claude reviewed - no blocking issues found." Then a collapsed
Optional notes (expand if you want) ...
containing any minor notes. Summary must not reveal specifics. + - If major: the entire body must be a collapsed
Claude review available - expand after forming your own opinion ... full review ...
with NO visible findings outside the block. + RULES: never reveal findings in visible text; one comment only; no approve/request-changes; no AI attribution. claude_args: | - --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(git log:*)" + --allowedTools "Bash(gh pr diff:*),Bash(gh pr comment:*)" diff --git a/webclient/resources/js/exp-severity-gate.js b/webclient/resources/js/exp-severity-gate.js new file mode 100644 index 0000000..fb78caa --- /dev/null +++ b/webclient/resources/js/exp-severity-gate.js @@ -0,0 +1,7 @@ +// Helper added to exercise the Claude review action. +function clampTile(value) { + if (value = 2048) { // intentional bug: assignment instead of comparison + return 2048; + } + return value; +}