Skip to content

Commit 76838a4

Browse files
anakrishCopilot
andcommitted
fix: embed agent perspectives in review instructions, fix CI grep
- Add 'Review Perspectives' section to copilot-code-review-instructions.md that inlines key thinking modes from all 10 relevant agents so the single-pass GitHub PR reviewer adopts multiple roles automatically - Fix copilot-config-validation.yml grep pattern to only match knowledge file references in the table (not docs/rvm/*.md references) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d6e6806 commit 76838a4

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

.github/copilot-code-review-instructions.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,66 @@ You decide which scale matters most for each change. A one-line fix in
4343
`value.rs` may need deep big-picture thinking. A large refactor may mostly
4444
need file-level polish review.
4545

46+
## Review Perspectives
47+
48+
Adopt these perspectives during your review. You cannot launch subagents, so
49+
**think from each relevant perspective yourself**. Not every perspective applies
50+
to every change — select the ones that matter based on what changed.
51+
52+
For deeper guidance on any perspective, read the corresponding agent file from
53+
`.github/agents/` — each contains detailed domain-specific checklists.
54+
55+
### 🔴 Red Teamer (`red-teamer.agent.md`)
56+
Think like an attacker who has read the source code. Can this change be exploited
57+
with pathological inputs? Deeply nested JSON → stack overflow? Enormous strings →
58+
OOM? Policies designed to exploit quadratic evaluation? Can Undefined propagation
59+
be weaponized to flip a policy decision?
60+
61+
### 🧠 Semantics Expert (`semantics-expert.agent.md`)
62+
Does this match the OPA/Rego specification exactly? Is Undefined handled correctly
63+
in every expression? Do interpreter and RVM produce identical results? Are `with`
64+
overrides restored on exit? Does rule conflict resolution follow spec?
65+
66+
### 🏗️ Architect (`architect.agent.md`)
67+
Does this respect module boundaries? How does it affect the 9 FFI bindings? Does
68+
it compile with `--no-default-features`? Will it block planned features (language
69+
servers, partial evaluation, daemon mode)? Is the API change backward compatible?
70+
71+
### ⚡ Performance Engineer (`performance-engineer.agent.md`)
72+
Are there allocations in the evaluation hot path? Clone where borrow suffices?
73+
O(n²) patterns? Temporary collections built just to iterate once? Would this
74+
change benefit from a benchmark?
75+
76+
### 🧪 Test Engineer (`test-engineer.agent.md`)
77+
Are new code paths tested? Both interpreter AND RVM paths? Edge cases: empty
78+
collections, Undefined operands, type mismatches, boundary values? Are tests
79+
testing behavior (not implementation)? Would property-based testing help?
80+
81+
### 🔒 Security Auditor (`security-auditor.agent.md`)
82+
What trust boundaries are crossed? Are resource limits preserved? Any new
83+
dependencies — are they audited and no_std compatible? Actions pinned by SHA?
84+
Can the error path leak sensitive information?
85+
86+
### 🛡️ Reliability Engineer (`reliability-engineer.agent.md`)
87+
Is evaluation still deterministic? Any new panic paths (`unwrap`, unchecked index)?
88+
Are resources bounded and cleaned up on all exit paths? When limits are hit, is
89+
the error clear and actionable?
90+
91+
### 🔧 Support Engineer (`support-engineer.agent.md`)
92+
Do error messages include source location? Can an operator diagnose the issue
93+
without reading regorus source? Are error chains preserved through wrapping?
94+
Does this change preserve or improve diagnostic information?
95+
96+
### 📋 API Steward (`api-steward.agent.md`)
97+
Does this change the public API? Is it backward compatible? Does it need a semver
98+
bump? Are all 9 bindings updated? Is there a deprecation path? Is the CHANGELOG
99+
updated?
100+
101+
### 🔄 Refactorer (`refactorer.agent.md`)
102+
Is there duplicated logic that should be shared? Functions over 50 lines that
103+
should be decomposed? Dead code? Inconsistent patterns? Could newer Rust features
104+
simplify this?
105+
46106
## Domain Knowledge
47107

48108
This is what makes regorus unique. Internalize this context and let it inform

.github/workflows/copilot-config-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
run: |
5353
echo "Checking that all knowledge files referenced in instructions exist..."
5454
# Extract knowledge file references from instructions
55-
grep -oP '[a-z-]+\.md' .github/copilot-instructions.md | sort -u > /tmp/referenced.txt
55+
# Only match .md files in the knowledge file reference table (lines starting with | `)
56+
grep -P '^\| `[a-z-]+\.md`' .github/copilot-instructions.md | grep -oP '`[a-z-]+\.md`' | tr -d '`' | sort -u > /tmp/referenced.txt
5657
5758
# List actual knowledge files
5859
ls docs/knowledge/*.md 2>/dev/null | xargs -I{} basename {} | sort -u > /tmp/actual.txt

0 commit comments

Comments
 (0)