Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
207 lines (188 loc) · 13 KB
/
Copy path.coderabbit.yaml
File metadata and controls
207 lines (188 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US
tone_instructions: >-
Use ASD-STE100 and the Writing Style rules in CONTRIBUTING.md. Use short sentences, plain words, and active voice. Preserve exact code, commands, logs, and errors. Report concrete defects. Put correctness and security first.
chat:
allow_non_org_members: true
knowledge_base:
web_search:
enabled: true
learnings:
scope: local
reviews:
profile: assertive
request_changes_workflow: true
high_level_summary: true
high_level_summary_in_walkthrough: true
review_status: true
review_details: true
collapse_walkthrough: true
changed_files_summary: true
poem: false
auto_review:
enabled: false
drafts: false
auto_incremental_review: true
auto_pause_after_reviewed_commits: 0
labels:
- "coderabbit-review-active"
path_filters:
- "!**/node_modules/**"
- "!**/dist/**"
- "!**/out/**"
- "!**/coverage/**"
- "!**/.turbo/**"
- "!apps/vscode-e2e/.vscode-test/**"
- "!bin/*.vsix"
- "!webview-ui/**/__screenshots__/**"
path_instructions:
- path: "**/*"
instructions: >-
Review each change as an independent reviewer. Check PR claims against the code and its contracts.
Trace changed inputs through normal, boundary, error, cancellation, retry, and default paths. Check their direct tests.
Report a defect in an unchanged file only when changed code triggers it. Also confirm that the changed file alone cannot reveal it.
Look for inputs that break assumptions or guards removed by the change.
First check repository rules, tests, and related code. Verify assumptions that depend on facts outside the diff.
For external behavior, use web search. Prefer official documentation, specifications, and upstream repositories.
Report only concrete defects or conflicts that the author can fix. Cite the code or external source.
Give correctness, security, data loss, lifecycle defects, and test gaps priority.
Do not report generic advice, unsupported concerns, style preferences, or unrelated code changes.
When new code handles a concern shared across modules, check the existing helpers and rules.
Report a difference only when it affects behavior or maintenance. Allow deliberate differences.
Use the linked issue and current PR description to determine scope.
Include specs and TLC configs required by docs/architecture/tla/AGENTS.md when they model behavior changed by this PR.
Keep these files with the implementation. Do not call them unrelated work only because they are specs.
Still flag unrelated files. Resolve explicit scope conflicts using repository policy and the current issue and PR description.
For an existing defect outside this scope, do not request changes unless this PR creates the risk.
List it once under follow-up candidates in the walkthrough. State the trigger in one line.
Write review comments, summaries, walkthroughs, and replies in Simplified Technical English (ASD-STE100).
Follow the Writing Style rules in CONTRIBUTING.md. Use plain words, active voice, and one idea per sentence.
Use 20 words or fewer for an instruction. Do not use contractions, semicolons, or em dashes.
Keep exact code, logs, error messages, identifiers, commands, and reproduction evidence unchanged.
Use these as writing rules. Do not claim formal ASD-STE100 compliance.
- path: "**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}"
instructions: >-
Check types and behavior for normal, boundary, error, cancellation, retry, and compatibility cases.
Check that code handles promises and errors and uses existing helpers.
Flag new `any` types, double assertions without a reason, unhandled promises, repeated helpers, and increased lint suppressions.
When an early return handles an input, confirm that old branches for that input are removed or unreachable.
- path: "{**/*.{test,spec}.{ts,tsx,js,jsx},**/__tests__/**}"
instructions: >-
Require regression tests at the lowest test layer that can show the behavior.
Include relevant negative, error, false, unset, and boundary cases. Check cleanup and repeatable behavior in async tests.
Prefer shared test helpers with precise types.
For each public guard or validator, require tests that accept good input and reject bad input.
A test that only rejects bad input can pass when the guard rejects all input.
Require a saved Playwright component snapshot for a visible webview change. Do not require one for behavior alone.
Do not accept .toBeDefined() or .toHaveBeenCalled() alone when tests can check the exact type, value, or identity.
For listener removal, assert that code removes the same function that it registered. Do not use expect.any(Function) for this check.
A test must check behavior during a pending call before that call completes.
Check that each describe block names the subject that it tests.
When a test checks only mock call counts, look for a related return-value assertion.
Call counts alone can pass when code returns stale fallback data.
For fallback behavior, check both the case without prior state and the case with prior state.
A test double must not copy production logic. Check mocks, stubs, and helpers for repeated predicates, filters, sorts, and transforms.
Use the real function through vi.importActual or vi.spyOn. Replace only external services, filesystem access, or VS Code APIs.
For collection filters, groups, ordering, and duplicate removal, require mixed input and an assertion on the full output array.
Use interleaved types and repeated items when relevant. One item type cannot reveal a predicate that covers too few types.
When Stryker reports a surviving mutant in changed code, prefer a test that detects it.
For an equivalent mutant, prefer removal of the redundant branch before a Stryker disable comment.
- path: "apps/vscode-e2e/**"
instructions: >-
Use end-to-end tests only when the behavior needs the real VS Code host or a full workflow.
Examples include workspace APIs, extension activation, webview messages, and file watchers.
Keep detailed protocol, parsing, storage, retry, and edge-case tests at lower test layers.
- path: "{packages/types/src/**,webview-ui/src/components/settings/**,src/core/config/**,src/core/webview/**}"
instructions: >-
For saved settings, trace the schema, storage, runtime, and webview in both directions.
Check that consumers use the same defaults. Require focused tests for true, false, and unset values.
SettingsView controls must read and update local cachedState. Include each setting in the explicit save payload.
Return each saved value in extension state so the control shows it after saving.
- path: "src/**"
instructions: >-
Check extension and webview contracts, cancellation, error propagation, and the VS Code lifecycle.
Check retries and partial failures. Confirm that code disposes of listeners, resources, and providers without stale state or duplicate work.
- path: "webview-ui/**"
instructions: >-
Check React state, effect dependencies, cleanup, accessibility, translations, and light and dark themes.
Use Tailwind for new markup. Add VS Code CSS variables to src/index.css before using them with Tailwind.
Use Vitest for behavior tests. Use Playwright component snapshots for visible states that need saved regression coverage.
- path: "{src/api/**,src/core/prompts/**,src/core/tools/**,src/services/mcp/**,src/services/destructive-command-guard/**}"
instructions: >-
Treat model, provider, MCP, path, command, and tool data as untrusted input.
Check for approval bypasses, allowlist bypasses, injection, path traversal, and secrets or personal data in logs.
Check cancellation, streaming, retries, and provider compatibility. Enforce restrictions when code runs, not only during display or planning.
- path: "{src/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**,packages/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**,webview-ui/src/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**}"
instructions: >-
Check saved state and lifecycle rules. Check awaited atomic writes, rollback, shared state across windows, cancellation, and safe restart and resume.
If rollback is unavailable, require code to handle partial failure explicitly.
Check that repeated operations do not duplicate work. Check for stale listeners and watchers.
Check that restart and resume do not lose or duplicate saved state.
When code reads shared mutable state before await, check the reference again before writing after await.
Another operation can replace that state during the wait. The old reference can then overwrite newer data.
- path: ".github/**"
instructions: >-
Require full commit SHA pins, minimum permissions, safe expression and shell substitution, and trusted metadata handling.
Privileged workflows must never check out, run, install from, or trust code from a fork PR branch.
- path: "{AGENTS.md,**/AGENTS.md,CONTRIBUTING.md,.changeset/**,CHANGELOG.md,src/CHANGELOG.md}"
instructions: >-
Enforce repository policy. Routine PRs must not add changesets or edit changelogs outside release preparation.
Check that documentation describes real behavior and contracts.
Give prose preferences low priority unless they affect correctness or usability.
finishing_touches:
docstrings:
enabled: false
pre_merge_checks:
override_requested_reviewers_only: true
docstrings:
mode: off
title:
mode: warning
description:
mode: warning
issue_assessment:
mode: error
custom_checks:
- name: Regression evidence
mode: warning
instructions: >-
Fail only when changed behavior has a concrete test gap at the lowest valid test layer.
Examples include tests that copy the implementation and missing relevant negative, error, or unset cases.
Also check for missing required snapshots for visible UI changes.
Do not demand tests for unchanged behavior or mechanical configuration changes.
Do not demand coverage of a branch without a plausible regression case.
Cite the changed behavior and the missing evidence.
- name: Security boundaries
mode: error
instructions: >-
Fail only for a concrete defect in a changed path.
Check for exposed secrets or personal data, trusted or executed unvalidated input, and bypassed approval or allowlist controls.
Cite the changed path and an input or event that can trigger the defect.
Pass when no changed path has such a defect.
- name: Persistence integrity
mode: error
instructions: >-
Fail only when a changed persistence path can lose or corrupt state.
Check for writes without await, non-atomic writes, missing rollback or partial-failure handling, and defaults that do not reach consumers.
Cite the changed path and an input or event that can trigger the defect.
Pass when no changed path has such a defect.
- name: Lifecycle resource cleanup
mode: warning
instructions: >-
Fail only when a changed lifecycle path can leak a listener, watcher, provider, timer, task, or other resource.
Also check for duplicate work after cancellation, disposal, or restart.
Cite the changed path and an input or event that can trigger the defect.
Pass when no changed path has such a defect.
tools:
eslint:
enabled: true
github-checks:
enabled: true
actionlint:
enabled: true
shellcheck:
enabled: true
gitleaks:
enabled: true
semgrep:
enabled: true