These are OpenReview's own review rules, applied when reviewing this repository (dogfooding).
- All code is TypeScript with strict mode enabled
- Use ESM imports (
import/export), never CommonJS (require/module.exports) - Use
typeimports for type-only imports (import type { Foo } from './bar.js') - Imports must be ordered: builtin → external → internal → parent → sibling → index
- Single quotes, trailing commas, 100 char line width (enforced by Prettier)
- Business logic belongs in
core/—cli/andaction/are thin wrappers - GitHub API calls go through
core/src/github/client.ts, never called directly elsewhere - LLM calls go through
core/src/llm/router.ts, never instantiate models directly - All findings use the
ReviewFindinginterface fromcore/src/review/types.ts— no ad-hoc finding formats - Large diffs are chunked by file boundary (~40K chars per chunk) — never send >100K to the LLM
- Non-reviewable files (lock files, generated code, images) are filtered before LLM review
- Structured LLM output via Zod schemas is preferred; raw text parsing is the fallback
- Small PRs (≤5 files, ≤3K chars) use compact prompts; large PRs use comprehensive prompts
- File-type detection adapts the reviewer persona (code / config / docs / K8s)
- Progress messages go to
stderr, findings go tostdout(for clean piping) --submitposts findings to GitHub; without it, output is local only- All commands handle missing tokens/keys with actionable error messages including links
- Summary comments use replace-not-duplicate strategy via
<!-- openreview-summary -->marker
- Never swallow errors silently — at minimum
console.errorwith context - GitHub API errors should include the HTTP status code and endpoint in the message
- Auth errors (401/403/404) provide specific guidance on token scopes needed
- Linter failures should be non-fatal — skip with a warning, never crash the review
- LLM failures should fall back gracefully (structured → raw → retry)
- Every module should have a corresponding
.test.tsfile - Mock external services (GitHub API, LLM providers) — never make real API calls in tests
- Test edge cases: empty diffs, binary files, rate limits, timeout scenarios
- QA validation: 10 test PRs across 5 languages must catch ≥8/10 bugs
- Never log or trace API keys, tokens, or secrets —
TraceLoggerscrubs secrets automatically - Validate all user input from GitHub webhook payloads
- Deno sandbox must run with
deno run --allow-read=<script> --deny-net --deny-env --deny-run - Auth scheme detection:
ghp_tokens usetokenscheme, others useBearer