This document defines the review policy for the ai-review agent operating on this repository.
Approve a PR when all of the following hold:
- CI passes (lint, typecheck, tests).
- No new security vulnerabilities introduced (OWASP top 10).
- Code follows the project's style rules (see Style Expectations below).
- New non-trivial behaviour has test coverage.
- No unnecessary complexity added — changes are minimal and focused.
- Review the openapi specs in
/openapiand compare to the code (FastAPI routes,documentation)
Request changes when any of the following apply:
- CI is failing (lint errors, type errors, test failures).
- Missing tests for non-trivial logic or new code paths.
- Security vulnerabilities (OWASP top 10): injection, auth issues, data exposure, etc.
- Overly broad changes that mix unrelated concerns in a single PR.
- Breaking API changes without a migration path or deprecation notice.
- Code that contradicts the configured ruff/mypy rules (even if it passes due to
type: ignoreornoqawithout justification).
PRs that introduce or modify secrets, credentials, API keys, or security-sensitive configuration always require human review — automated approval is never sufficient for these changes.
The ai-review agent must:
- Detect potential secrets — scan diffs for patterns such as API keys, tokens, passwords,
connection strings, private keys, and
secret/credential/passwordidentifiers in configuration files, environment variables, OpenAPIsecuritySchemes, and example payloads. - Flag any matches by adding the
needs-humanlabel and requesting changes with a comment identifying the file(s) and line(s) where secrets-related content was found. - Never approve a PR that adds, modifies, or references real credential values — even if all other approval criteria pass.
Acceptable patterns that do not require escalation:
- Placeholder values clearly marked as examples (e.g.
sk_test_EXAMPLE,<your-api-key-here>). - References to secret names stored in a vault or environment variable (e.g.
${{ secrets.X }}). - SecurityScheme definitions in OpenAPI specs that describe how auth works without embedding values.
Add the needs-human label and request human review when:
- Architectural changes affecting module boundaries (
broker/,control/,shared/). - New dependency additions with unclear or restrictive licenses (anything other than MIT, Apache-2.0, BSD).
- Changes to CI/CD pipeline configuration (
.github/workflows/). - Changes to
.harness/configuration or agent setup. - Ambiguous requirements that need product or design input.
- Changes to this file (
REVIEWS.md) orCLAUDE.md. - Secrets or credentials detected in the diff (see Secrets Management above).
Architectural conventions are enforced by the tests in tests/arch/ and the
scoped rules under .cursor/rules/. Key areas to check during review: ORM /
database / schema / repositories, service protocols, the web/HTTP layer,
testing conventions, and the architecture tests themselves.
Style is enforced by tooling (ruff, mypy, pytest). See CLAUDE.md for the full configuration. The reviewer should confirm that no type: ignore or noqa comments are added without justification.