mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
524aab5528
Add comprehensive documentation and GitHub Copilot configuration: - docs/knowledge/: 17 deep-dive knowledge files covering value semantics, RVM architecture, builtins, FFI boundary, feature composition, error handling migration, policy evaluation security, Rego semantics, interpreter/compiler architecture, Azure Policy/RBAC, engine API, time builtins, language extension guide, tooling architecture, causality/partial eval, Rego compiler, Azure Policy aliases, and telemetry/diagnostics - .github/agents/: 16 role-specific AI agent definitions (red-teamer, semantics-expert, architect, performance-engineer, test-engineer, verification-engineer, security-auditor, reliability-engineer, support-engineer, ci-engineer, refactorer, api-steward, program-manager, demo-engineer, dx-engineer, tech-lead) - .github/skills/: 6 workflow skill definitions (thorough-review, design-alternatives, add-builtin, opa-conformance, security-review, verification) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: anakrish <35780660+anakrish@users.noreply.github.com>
2.8 KiB
2.8 KiB
name, description, allowed-tools
| name | description | allowed-tools |
|---|---|---|
| opa-conformance | Check OPA conformance for regorus changes. Use this skill when modifying Rego evaluation, builtins, or anything that could affect OPA compatibility. Runs conformance tests and analyzes failures. | shell |
OPA Conformance Skill
regorus aims for high conformance with the Open Policy Agent (OPA) reference implementation. This skill helps verify that changes don't break conformance and diagnose any failures.
When to Use
- Modifying Rego evaluation (interpreter or RVM compiler)
- Adding or changing builtin functions
- Changing the Value type or its operations
- Modifying the parser or scheduler
- Any change where you're unsure if it affects Rego semantics
Running Conformance Tests
# Full OPA conformance suite
cargo test --test opa --features opa-testutil
# Run with verbose output to see which tests pass/fail
cargo test --test opa --features opa-testutil -- --nocapture
# Run a specific conformance test category
cargo test --test opa --features opa-testutil -- test_name_pattern
Analyzing Failures
When conformance tests fail:
- Read the test case — OPA conformance tests are in
tests/opa/and follow a standard structure: input, data, policy, expected result - Identify the Rego feature — which language feature does the failing
test exercise? (comprehensions,
with, negation, builtins, etc.) - Check both execution paths — run the failing test against both the interpreter and RVM to see if the failure is path-specific
- Compare with OPA spec — the expected result comes from the OPA reference implementation. Understand why OPA produces that result.
- Check Undefined propagation — the most common conformance failure
is incorrect Undefined handling. Review
docs/knowledge/value-semantics.md.
Known Non-Conformance
Some OPA features are intentionally not supported or have known gaps. Before investigating a failure, check if it's in a known category:
- Check
tests/for any skip lists or known-failure annotations - Check GitHub issues for tracked conformance gaps
- Some builtins may be feature-gated — ensure the right features are enabled
After Fixing
After fixing a conformance issue:
- Run the full conformance suite to ensure no regressions
- Run
cargo testfor general test suite - Verify the fix works in both interpreter and RVM paths
- Update
docs/knowledge/if the fix reveals a subtle semantic rule
Reference
docs/knowledge/rego-semantics.md— Rego evaluation modeldocs/knowledge/value-semantics.md— Value type and Undefineddocs/knowledge/builtin-system.md— Builtin registration and conformancedocs/knowledge/interpreter-architecture.md— Interpreter detailsdocs/knowledge/rego-compiler.md— RVM compiler details