Skip to content

feat: add council-review-action composite GitHub Action - #329

Closed
sonupreetam wants to merge 1 commit into
unbound-force:mainfrom
sonupreetam:feat/council-review-action
Closed

sonupreetam wants to merge 1 commit into
unbound-force:mainfrom
sonupreetam:feat/council-review-action

Conversation

@sonupreetam

@sonupreetam sonupreetam commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a composite GitHub Action (council-review-action/) for AI-assisted
code review using OpenCode on Vertex AI. Extracted from the
complytime/org-infra prototype (PR complytime/org-infra#428), as specified
in #253.

What the action does:

  • Auto-discovers Divisor persona definitions from .opencode/agents/divisor-*.md
    (repo-local or bundled fallback)
  • Pre-fetches PR context (CI checks, existing reviews, linked issues) as JSON
  • Filters noise files from diff (lock files, vendor, generated code)
  • Annotates diff with [L<N>] source-file line numbers for accurate inline comments
  • Builds a constrained review prompt delegating methodology to
    .opencode/commands/review-council.md and review-pr.md
  • Invokes opencode run with google-vertex-anthropic provider for Claude
    on Vertex AI via WIF
  • Parses structured JSON output (summary + inline comments) from OpenCode
    JSONL streaming format
  • Filters inline comments to diff-visible lines (prevents GitHub API 422)
  • Rescues out-of-diff findings into the summary body
  • Falls back gracefully: single-agent mode when no personas exist, comment
    mode when JSON parsing fails

Supply-chain safety:

  • OpenCode pinned to [email protected] via npm
  • All GitHub Actions in the caller pinned to full SHA

Includes documentation: README (architecture), docs/decisions.md (key design
decisions), docs/testing.md (coverage matrix), and test/test-pipeline.sh
(39 assertions across 15 test scenarios).

Closes #253

Evidence

End-to-end validation in complytime/org-infra#427:

  • Council review posted 8 inline comments on valid source-file lines (8/8)
  • Line annotation approach eliminated patch-position confusion
  • Full workflow chain: collect → consumer → reusable → action → inline review

Test plan

Post-merge checklist

  • Update action SHA in complytime/org-infra reusable_council_review.yml to merged main commit
  • Switch ci_council_review.yml uses: from @test/council-review-evidence-v2 to @main
  • Verify full automatic chain fires on a real PR
  • Delete stale branch: feat/council-review-action

sonupreetam added a commit to complytime/org-infra that referenced this pull request Jul 14, 2026
Re-trigger the council review workflow to validate the
[email protected] pinned npm install in the upstream
council-review-action (unbound-force/unbound-force#329).

Signed-off-by: sonupreetam <[email protected]>
@sonupreetam
sonupreetam force-pushed the feat/council-review-action branch from fcc172b to 4cf0d47 Compare July 14, 2026 17:52
@sonupreetam
sonupreetam marked this pull request as ready for review July 14, 2026 18:55
@sonupreetam
sonupreetam marked this pull request as draft July 15, 2026 08:07
sonupreetam added a commit to sonupreetam/org-infra that referenced this pull request Jul 15, 2026
Adds the AI council review workflow chain (collect → consumer → reusable)
with WIF authentication on Vertex AI, plus diff size guardrails.

Also fixes the off-by-one truncation bug in generate-crapload-comment.sh
where the trailer was appended after the byte limit.

Evidence PR for complytime#424 and unbound-force/unbound-force#329.
Replaces complytime#425 (closed due to cluttered timeline).

Signed-off-by: sonupreetam <[email protected]>
sonupreetam added a commit to sonupreetam/org-infra that referenced this pull request Jul 15, 2026
Adds the AI council review workflow chain (collect → consumer → reusable)
with WIF authentication on Vertex AI, plus diff size guardrails.

Also fixes the off-by-one truncation bug in generate-crapload-comment.sh
where the trailer was appended after the byte limit.

Evidence PR for complytime#424 and unbound-force/unbound-force#329.
Replaces complytime#425 (closed due to cluttered timeline).

Signed-off-by: sonupreetam <[email protected]>
@sonupreetam
sonupreetam force-pushed the feat/council-review-action branch from aa77138 to ce19a17 Compare July 15, 2026 08:58
sonupreetam added a commit to sonupreetam/org-infra that referenced this pull request Jul 15, 2026
Adds the AI council review workflow chain (collect → consumer → reusable)
with WIF authentication on Vertex AI, plus diff size guardrails.

Also fixes the off-by-one truncation bug in generate-crapload-comment.sh
where the trailer was appended after the byte limit.

Evidence PR for complytime#424 and unbound-force/unbound-force#329.
Replaces complytime#425 (closed due to cluttered timeline).

Signed-off-by: sonupreetam <[email protected]>
sonupreetam added a commit to sonupreetam/org-infra that referenced this pull request Jul 15, 2026
Adds the AI council review workflow chain (collect → consumer → reusable)
with WIF authentication on Vertex AI, plus diff size guardrails.

Also fixes the off-by-one truncation bug in generate-crapload-comment.sh
where the trailer was appended after the byte limit.

Evidence PR for complytime#424 and unbound-force/unbound-force#329.
Replaces complytime#425 (closed due to cluttered timeline).

Signed-off-by: sonupreetam <[email protected]>
sonupreetam added a commit to complytime/org-infra that referenced this pull request Jul 15, 2026
Adds the AI council review workflow chain (collect → consumer → reusable)
with WIF authentication on Vertex AI, plus diff size guardrails.

Also fixes the off-by-one truncation bug in generate-crapload-comment.sh
where the trailer was appended after the byte limit.

Evidence PR for #424 and unbound-force/unbound-force#329.
Replaces #425 (closed due to cluttered timeline).

Signed-off-by: sonupreetam <[email protected]>
Composite action for AI code review using OpenCode on Vertex AI
with Divisor persona discovery:

- Auto-discovers Divisor personas from .opencode/agents/divisor-*.md
  (repo-local or bundled fallback, single-agent if none found)
- Filters noise from diff (lock files, vendor, generated code)
- Annotates diff with [L<N>] source-file line numbers for accurate
  inline comment placement
- Pre-fetches PR context (CI checks, existing reviews, linked issues)
- Builds constrained review prompt with prompt injection defense
- Invokes opencode run on Vertex AI, parses structured JSON output
- Validates inline comments against diff hunks, rescues out-of-range
  findings into the summary body

Includes README (architecture), docs/decisions.md (9 key design
decisions), docs/testing.md (coverage matrix), and test/test-pipeline.sh
(15 scenarios, 39 assertions).

Closes unbound-force#253

Signed-off-by: sonupreetam <[email protected]>
@sonupreetam
sonupreetam force-pushed the feat/council-review-action branch from 7e731c1 to 78c8a65 Compare July 15, 2026 12:43
@sonupreetam

Copy link
Copy Markdown
Contributor Author

Closing in favor of a clean PR from feat/council-review-action-v2 — same single commit, clean timeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: council-review-action — reusable GitHub Action for CI council reviews

1 participant