Open History to see the last commit
1import { defineConfig, type CodeRabbitContext } from "@coderabbitai/config";
2
3const UNGATED_AUTHORS = new Set(["OWNER", "MEMBER", "COLLABORATOR"]);
4const isGated = ({ pr }: CodeRabbitContext) => !UNGATED_AUTHORS.has(pr?.authorAssociation ?? "");
5
6const DOC_RULES = [
7 {
8 files: "docs/internals/01_architecture.md",
9 applyTo:
10 "{apps/server/src/orchestration-v2,apps/server/src/checkpointing,packages/contracts/src,apps/desktop/src/snapShot}/**/*.ts",
11 instructions:
12 "Hold changed code to the architectural boundaries in docs/internals/01_architecture.md.",
13 },
14 {
15 files: "docs/internals/02_effect-services.md",
16 applyTo: "{apps,packages,infra}/**/*.ts",
17 instructions: "Hold changed code to the rules in docs/internals/02_effect-services.md.",
18 },
19 {
20 files: "docs/internals/03_providers.md",
21 applyTo:
22 "{packages/provider-*,apps/server/src/provider,apps/server/src/orchestration-v2/Adapters}/**/*.{ts,json}",
23 instructions:
24 "Hold provider changes to docs/internals/03_providers.md, including strict ACP spec compliance for non-first-party agents and bumping updatedAt on model-manifest.json edits.",
25 },
26 {
27 files: "docs/internals/04_environment-auth.md",
28 applyTo:
29 "{apps/server/src/auth,apps/server/src/mcp,apps/server/src/guest,apps/server/src/assets,apps/server/src/workspace}/**/*.ts",
30 instructions:
31 "Hold auth, MCP, guest link, and filesystem boundary changes to docs/internals/04_environment-auth.md.",
32 },
33 {
34 files: "docs/internals/05_remote.md",
35 applyTo:
36 "{apps/server/src/peer,apps/server/src/environment,packages/ssh,packages/tailscale,apps/desktop/src/preview,apps/desktop/src/ssh}/**/*.ts",
37 instructions:
38 "Hold remote route, peer link, SSH, and preview tunnel changes to docs/internals/05_remote.md.",
39 },
40 {
41 files: "docs/internals/06_t3-connect.md",
42 applyTo: "{infra/relay/src,apps/server/src/cloud}/**/*.ts",
43 instructions: "Hold relay and T3 Connect changes to docs/internals/06_t3-connect.md.",
44 },
45 {
46 files: "SECURITY.md",
47 applyTo:
48 "{apps/server/src/auth,apps/server/src/mcp,apps/server/src/guest,apps/server/src/assets,apps/server/src/peer,apps/server/src/cloud,apps/server/src/policy,infra/relay/src}/**/*.ts",
49 instructions:
50 "Check security boundary changes against the trust model and real-finding criteria in SECURITY.md.",
51 },
52 {
53 files: "docs/internals/07_server-updates.md",
54 applyTo:
55 "apps/server/src/{serviceLauncher.ts,desktopUpdate/**,cloud/serviceSelectionLock.ts,orchestration-v2/ProviderRuntimeRecoveryService.ts,orchestration-v2/RestartContinuation.ts}",
56 instructions:
57 "Hold update, rollback, and restart-recovery changes to docs/internals/07_server-updates.md.",
58 },
59 {
60 files: "docs/internals/08_product-analytics.md",
61 applyTo: "{apps/server/src/telemetry,apps/server/src/feedback}/**/*.ts",
62 instructions:
63 "Hold analytics identity, attribution, and privacy boundaries to docs/internals/08_product-analytics.md.",
64 },
65 {
66 files: "docs/internals/09_connection-runtime.md",
67 applyTo: "packages/client-runtime/src/**/*.ts",
68 instructions:
69 "Hold connection, sync, and cache changes to docs/internals/09_connection-runtime.md.",
70 },
71 {
72 files: "docs/internals/10_web-ui.md",
73 applyTo: "apps/web/src/**/*.{tsx,css}",
74 instructions: "Hold changed code to the rules in docs/internals/10_web-ui.md.",
75 },
76 {
77 files: "docs/internals/11_mobile-layout.md",
78 applyTo: "apps/mobile/src/**/*.{ts,tsx}",
79 instructions: "Hold mobile layout and pane changes to docs/internals/11_mobile-layout.md.",
80 },
81 {
82 files: "docs/internals/12_mobile-navigation.md",
83 applyTo: "apps/mobile/{src,modules}/**/*.{ts,tsx,swift,kt}",
84 instructions:
85 "Hold mobile navigation, native header, and media presentation changes to docs/internals/12_mobile-navigation.md.",
86 },
87 {
88 files: "docs/internals/13_mobile-development.md",
89 applyTo: "apps/mobile/{src/lib,modules,scripts}/**/*.{ts,tsx,mts}",
90 instructions:
91 "Hold mobile HMR, native module, and React Compiler changes to docs/internals/13_mobile-development.md.",
92 },
93 {
94 files: "docs/internals/14_i18n.md",
95 applyTo:
96 "{apps/web/src,apps/mobile/src,apps/desktop/src,packages/client-runtime/src,packages/shared/src}/**/*.{ts,tsx}",
97 instructions:
98 "Hold user-facing copy and translations to the rules in docs/internals/14_i18n.md.",
99 },
100 {
101 files: "docs/internals/15_testing.md",
102 applyTo: "{apps,packages,infra}/**/*.{ts,tsx}",
103 path: "**/*.test.*",
104 instructions:
105 "Hold changed tests to the rules in docs/internals/15_testing.md. Request tests only as those rules allow.",
106 },
107 {
108 files: "docs/internals/16_performance-regressions.md",
109 applyTo:
110 "{apps/server/src/orchestration-v2,apps/server/integration,apps/mobile/src}/**/*.{ts,tsx}",
111 instructions:
112 "Hold wire payload, indexing, and mobile animation changes to docs/internals/16_performance-regressions.md.",
113 },
114 {
115 files: "docs/internals/17_scripts.md",
116 applyTo: "{scripts,apps/*/scripts,packages/*/scripts,infra/*/scripts}/**/*.{ts,mts}",
117 instructions:
118 "Hold repository and package scripts to docs/internals/17_scripts.md: use Effect, effect/cli, NodeServices, and NodeRuntime.runMain rather than raw node:fs, node:child_process, or hand-rolled process.argv parsing.",
119 },
120 {
121 files: "AGENTS.md",
122 applyTo: "docs/internals/**/*.md",
123 instructions:
124 "Hold internal doc edits to the Documentation rules in AGENTS.md: keep only durable architectural decisions, trust boundaries, conventions, and cross-cutting traps. Flag single-feature walkthroughs, field/method catalogs, exact constants/timeouts/migration numbers, and PR appends.",
125 },
126] as const;
127
128export default defineConfig((ctx) => ({
129 reviews: {
130 high_level_summary: false,
131 review_status: false,
132 request_changes_workflow: false,
133 allow_author_approval: !isGated(ctx),
134 auto_review: {
135 enabled: true,
136 },
137 pre_merge_checks: {
138 docstrings: { mode: "off" },
139 override_requested_reviewers_only: isGated(ctx),
140 },
141 path_filters: ["!.repos/**"],
142 path_instructions: DOC_RULES.map((rule) => ({
143 path: "path" in rule ? rule.path : rule.applyTo,
144 instructions: rule.instructions,
145 })),
146 },
147 knowledge_base: {
148 code_guidelines: {
149 filePatterns: DOC_RULES.map(({ files, applyTo }) => ({ files, applyTo })),
150 },
151 },
152}));