Repository navigation
Description
Context
The complytime/org-infra project is prototyping a CI-based council review workflow
that uses OpenCode to run each Divisor persona, with agent definitions read dynamically
from the repo's .opencode/agents/divisor-*.md files. The pattern is implemented as a
custom three-workflow chain (collect → consumer → reusable) specific to that org.
Design decisions and rationale are documented in:
openspec/changes/council-review-orchestration/design.md (in complytime/org-infra)
org-infra is the prototype (design.md D8). The generic orchestration logic will be
extracted into this action after validation. org-infra then becomes a thin consumer
handling org-specific concerns (WIF auth, fork-safe chain) while calling this action
for the review itself.
What to extract from the prototype
The following logic is generic and belongs in this action, not in org-infra:
- Agent discovery: Glob
.opencode/agents/divisor-*.md, detect repo-local
or use bundled fallback from the action - Prompt composition: Minimal CI instruction referencing
review-council.md,
review-pr.md, severity packs, and convention packs as methodology - Pre-fetch pattern: Collect CI checks, existing reviews, linked issues as JSON
files for the model to read (no Shell access in CI) opencode runinvocation: With Vertex AI provider, prompt file, model selection
(changed fromclaude -p --agentsper ADR-001)- Output parsing: JSON with
summary+inline_comments(path, line, body
with severity and persona attribution) - Diff size guardrails: Hard limit for massive diffs, adaptive budget based on
repo PR history, noise file filtering, spec file allowance - Fallback: Single-agent mode when no
divisor-*.mdfiles exist, comment mode
when JSON parsing fails, skip mode when diff exceeds hard limit
What stays in the consuming org
- Auth provider configuration (Vertex AI WIF, Bedrock, direct API key)
- Fork-safe workflow chain (collect → consumer → reusable)
- Secret forwarding and concurrency control
- PR comment posting with bot marker deduplication
- Old review cleanup (supersede stale bot reviews)
Acceptance criteria
- Composite action extracts review logic from org-infra prototype
- Agent discovery works (repo-local and bundled fallback)
- Pre-fetch pattern covers review-pr.md methodology
- Structured JSON output (summary + inline_comments) parsed correctly
- Inline comments filtered to diff-visible lines
- Fallback modes: single-agent, comment-only, review-skipped
- Diff size guardrails: hard limit (10K), adaptive budget, noise filtering
- End-to-end evidence: fix: truncate crapload comment when exceeding GitHub character limit complytime/org-infra#425
- Pinned to a release SHA (not feature branch) before downstream distribution
- At least 10 real PR reviews run successfully
Also considered (lower priority)
- Container image: Less compelling since agent definitions are read at runtime —
pre-baked agents would be stale afteruf initupdates. - Full
/review-councilparity: Fix loops, local tool execution, Gaze analysis.
Requires Shell access on untrusted diff content — security risk in CI. - BYOK externalization: Tracked separately in feat: support BYOK provider credentials for external council-review-action usage #330.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone ✔️
Activity
feat: add council-review-action composite GitHub Action
sonupreetam commentedon Jul 14, 2026
Progress update
PRs
What changed from the original design
opencode runreplacesclaude -p --agents— better Vertex AI integration, no permission flagsmax-raw-diff-lines, default 10K) — skips review for massive diffscalibrate-budget.sh) — P75 of recent merged PRs + 2K spec allowanceprepare-diff.sh) — excludes lock files, vendor, generated codefilter-diff-lines.py) — prevents GitHub API 422 errorson inline comments targeting lines outside diff hunks
Evidence
complytime/org-infra#425:
the council review posted an inline
[HIGH] (Adversary)finding on thefeature-branch SHA pin and identified a truncation off-by-one bug in a
test change. Full chain: collect → consumer → reusable → action → inline review.
Remaining
sonupreetam commentedon Jul 15, 2026
Proposed: Review trigger strategy
Currently the collect workflow triggers on every
pull_requestevent(
opened, synchronize, reopened, ready_for_review), meaning the AIreview re-runs on every push. This is wasteful and noisy — early
commits are often WIP, reviews get superseded, and each run costs tokens.
Proposal: Change to review-once-then-on-demand:
openedandready_for_review(removesynchronize)/re-reviewcomment trigger (viaissue_comment) for manual re-runsreview_requestedwhen re-requesting the botThis means the AI sets the baseline when the PR is first opened or
marked ready, humans build on it, and the author can explicitly
re-trigger after significant changes.
feat: add council-review-action composite GitHub Action
sonupreetam commentedon Jul 16, 2026
Upstream tracking: complytime/nunya#384 (WIF for Vertex AI council review)
Implementation PRs:
Evidence: complytime/org-infra#427 (end-to-end validation, 8/8 inline comments on valid diff lines)
Follow-up issues (post-merge):
feat: add council-review-action composite GitHub Action
feat: add council-review-action composite GitHub Action