Repository navigation
ci: add opencode reviewer with DeepSeek V4 Pro - #66
Conversation
Review of
|
Signed-off-by: Gonzalo Fleming <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Gonzalo Fleming <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Gonzalo Fleming <[email protected]>
Signed-off-by: Gonzalo Fleming <[email protected]>
- Pin anomalyco/opencode/github to full commit SHA instead of @latest - Add author_association guard (OWNER/MEMBER/COLLABORATOR) on comment triggers - Add github.event.issue.pull_request guard to avoid firing on plain issues - Replace bare prompt with project-specific review criteria matching CLAUDE.md Signed-off-by: Gonzalo Fleming <[email protected]>
cc967ee to
5267ce7
Compare
Resumen de cambios aplicadosSe abordaron todos los comentarios de Claude en esta revisión: Fixes aplicados
No aplicado
|
…ion in ADR - Pin actions/checkout to commit SHA df4cb1c (v6) instead of floating @v6 tag - Add author_association gate on the pull_request trigger path (OWNER/MEMBER/COLLABORATOR only), matching the issue_comment guard - Add ADR-0025 documenting the decision to run opencode as a second automated reviewer, concluding no RFC is required for this incremental CI change Signed-off-by: Gonzalo Fleming <[email protected]>
Segunda ronda: 3 nuevos comentarios resueltos
Los 3 threads están resueltos. Total: 15/15 threads cerrados, 0 pendientes. |
…false - Remove 'comment: true' (not a valid action input per action.yml) - Add 'use_github_token: true' to skip OIDC/OpenCode App auth - Add GITHUB_TOKEN env var for direct token-based posting - Set 'share: false' explicitly (default is true for public repos) Signed-off-by: Gonzalo Fleming <[email protected]>
Review:
|
| Criterion | Status | Notes |
|---|---|---|
| Pinned actions (supply-chain) | OK | actions/checkout@df4cb1c and anomalyco/opencode/github@2c14fc5 are both full-commit-SHA pinned |
| Minimal permissions | OK | contents: read, pull-requests: write, issues: write — no id-token, no contents: write |
| Authorization gates | OK | author_association (OWNER/MEMBER/COLLABORATOR) on both PR and issue_comment trigger paths; issue.pull_request != null guard on comment path |
| Trigger logic | OK | github.event_name == 'pull_request' short-circuits correctly for PR events; issue_comment path gated on both identity and PR context |
| No external share | OK | share: false; persist-credentials: false on checkout |
| Project-specific prompt | OK | Includes all five MANIFIESTO commitments, threat-model hard rules, and PR classification guidance (mirrors Claude reviewer's criteria) |
docs/adr/0025-opencode-second-automated-reviewer.md
| Criterion | Status | Notes |
|---|---|---|
| ADR format (§CLAUDE.md:78-84) | OK | Status, Date, Deciders, Context, Decision, Consequences, Alternatives — all present |
| Governance lane | OK | Explicitly classifies this as an ADR (not RFC), with reasoned justification: mirrors existing Anthropic reviewer; no new server-surface or dependency-graph expansion |
| ADR immutability (ADR-0015) | OK | New ADR, not an in-place edit of an existing one |
| RFC justification | OK | Alternatives section addresses why RFC was rejected (incremental to existing trust relationship, not a new class of trust-base expansion) |
| Numbering | OK | 0025 follows sequentially from 0024 |
Bottom line: The workflow is well-constructed, the ADR is sound, and all 15 prior review threads are properly addressed. No blocking issues.
- Add id-token: write back (required by opencode github run for OIDC token exchange) - Remove use_github_token: true (posts as github-actions[bot] instead of opencode-agent[bot]) - Remove GITHUB_TOKEN env var (not needed for OIDC-based auth) Signed-off-by: Gonzalo Fleming <[email protected]>
Review of
|
| Criterion | Status |
|---|---|
| Pinned actions (supply-chain) | OK — both actions/checkout@df4cb1c and anomalyco/opencode/github@2c14fc5 are SHA-pinned |
| Minimal permissions | OK — contents: read, pull-requests: write, issues: write; id-token: write is unused but mirrors the existing Claude reviewer and poses no risk under author_association gates |
| Authorization gates | OK — OWNER/MEMBER/COLLABORATOR on both pull_request and issue_comment paths; issue.pull_request != null guard on comments |
| Trigger logic | OK — github.event_name == 'pull_request' short-circuits correctly; comment path double-gated on identity + PR context |
| No external share | OK — share: false; persist-credentials: false |
| Project-specific prompt | OK — mirrors the Claude reviewer's five MANIFIESTO commitments and threat-model hard rules |
docs/adr/0025-opencode-second-automated-reviewer.md
| Criterion | Status |
|---|---|
| ADR format (CLAUDE.md § RFC vs ADR) | OK — Status, Date, Deciders, Context, Decision, Consequences, Alternatives all present |
| Governance lane classification | OK — explicitly argues why ADR (not RFC) is appropriate: incremental to existing Anthropic reviewer; no new server-surface or dependency-graph expansion |
| ADR immutability (ADR-0015) | OK — new file, not an edit of an existing ADR |
| Numbering | OK — 0025 follows 0024 |
Comparison with existing claude-code-review.yml
The opencode workflow is actually stricter: SHA-pinned actions vs. @v6/@v1, persist-credentials: false vs. default true, author_association gates vs. none. No regression.
Code reviewConventional Commits violations CLAUDE.md § Contribution conventions requires Conventional Commits for all commit messages. Two commits in this PR use bare imperative descriptions without a type prefix:
Please amend or squash these before merge. |
- Change issues: write to issues: read (reviewer doesn't need issue create/edit) - Document id-token: write requirement in ADR (OIDC for OpenCode App auth) - Fix ADR language: acknowledge issue_comment trigger and id-token differ from Claude reviewer instead of claiming 'identical security constraints' Signed-off-by: Gonzalo Fleming <[email protected]>
Tercera ronda: auth mode y scope de permisos¿Por qué
|
|
I've reviewed both changed files in their current state against CLAUDE.md, the threat model, and all governance rules. All 15 prior Claude review threads and the subsequent opencode/Claude cross-review threads are resolved.
|
| Criterion | Status | Notes |
|---|---|---|
| Pinned actions (supply-chain, CLAUDE.md §4) | OK | actions/checkout@df4cb1c and anomalyco/opencode/github@2c14fc5 are SHA-pinned |
| Minimal permissions (CLAUDE.md §4) | OK | contents: read, pull-requests: write, issues: read, id-token: write — identical scope to the existing claude-code-review.yml; id-token: write is documented for OIDC-based bot identity |
| Authorization gates (threat-model §4.1 — untrusted input gating) | OK | OWNER/MEMBER/COLLABORATOR on both pull_request and issue_comment paths; issue.pull_request != null on comment path |
| Trigger logic | OK | github.event_name == 'pull_request' short-circuits correctly; comment path double-gated on identity + PR context |
| External share (CLAUDE.md §4 — sharp edges) | OK | share: false; persist-credentials: false |
| Project-specific prompt (CLAUDE.md commitments) | OK | Includes all five MANIFIESTO commitments, threat-model hard rules, and PR classification guidance |
docs/adr/0025-opencode-second-automated-reviewer.md
| Criterion | Status | Notes |
|---|---|---|
| ADR format (CLAUDE.md § RFC vs ADR) | OK | Status, Date, Deciders, Context, Decision, Consequences, Alternatives — all present |
| Immutability (ADR-0015) | OK | New ADR, not an edit of an existing one |
| Numbering | OK | 0025 follows sequentially from 0024 |
| Governance lane justification | OK | Honestly documents the two operational differences from the Claude reviewer (issue_comment trigger, id-token: write); argues RFC bypass as incremental to the existing external-inference-reviewer pattern |
Comparison with existing claude-code-review.yml
The opencode workflow is stricter in three respects: SHA-pinned actions (vs. @v6/@v1 mutable tags), persist-credentials: false (vs. default true), and author_association gates (vs. none). The id-token: write and issues: read permissions are identical to the existing reviewer.
No high-signal findings.

Summary
Adds a second automated PR reviewer using
anomalyco/opencodewith DeepSeek V4 Pro, complementing the existing Claude Code Review workflow (claude-code-review.yml). Both reviewers receive the same project-specific criteria (CLAUDE.md, five MANIFIESTO commitments, threat model) and apply the same security lens.Motivation
A second reviewer with a different model provider increases review diversity and catch rate. This is an incremental addition — the Claude reviewer already sends PR diffs to an external inference API (Anthropic). The decision is documented in ADR-0025.
Closes: #66
Type of change
Checklist
git commit -s).cargo fmt --allandcargo clippy --workspace --all-targets -- -D warningslocally. (No Rust code yet; N/A.)CHANGELOG.mdentry. (N/A — internal CI.)Security considerations
actions/checkout@df4cb1candanomalyco/opencode/github@2c14fc5pinned to full commit SHAs.contents: read,pull-requests: write,issues: read,id-token: write. Nocontents: write. Theid-token: writescope is required for OIDC-based authentication with the OpenCode GitHub App (same as the Claude reviewer usesid-token: write). Thepull-requests: writescope is the minimum needed to post review comments.OWNER/MEMBER/COLLABORATOR. Comment-triggered reviews (/oc,/opencode) restricted to the same set and PR comments only.share: false. Diffs are sent to DeepSeek for inference only.DEEPSEEK_API_KEYstored as a repository secret.Notes for reviewers
All Claude review threads resolved (18/18). The opencode reviewer has run successfully and confirmed no high-signal findings. Key design decisions documented in the workflow file, the ADR, and the PR comment thread:
use_github_token) so comments appear asopencode-agent[bot]issues: read(notwrite) — reviewer doesn't need issue creation/deletionid-token: writejustified as equivalent to the Claude reviewer's existing permission