code-review-ai 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. code_review_ai-0.1.0/.claude/settings.local.json +22 -0
  2. code_review_ai-0.1.0/.env.example +112 -0
  3. code_review_ai-0.1.0/.github/workflows/ci.yml +35 -0
  4. code_review_ai-0.1.0/.github/workflows/publish.yml +42 -0
  5. code_review_ai-0.1.0/.gitignore +62 -0
  6. code_review_ai-0.1.0/.pre-commit-config.yaml +36 -0
  7. code_review_ai-0.1.0/.python-version +1 -0
  8. code_review_ai-0.1.0/.secrets.baseline +131 -0
  9. code_review_ai-0.1.0/Dockerfile +25 -0
  10. code_review_ai-0.1.0/LICENSE +191 -0
  11. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/125473520008560 +0 -0
  12. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/126443939089488 +0 -0
  13. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/127458725430432 +0 -0
  14. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/130478795769040 +0 -0
  15. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/137690339218960 +0 -0
  16. code_review_ai-0.1.0/MagicMock/mock.effective_settings.history_db_path/138987042296256 +0 -0
  17. code_review_ai-0.1.0/MagicMock/mock.history_db_path/123433958317360 +0 -0
  18. code_review_ai-0.1.0/MagicMock/mock.history_db_path/123866672271520 +0 -0
  19. code_review_ai-0.1.0/MagicMock/mock.history_db_path/124124152513888 +0 -0
  20. code_review_ai-0.1.0/MagicMock/mock.history_db_path/124124152549680 +0 -0
  21. code_review_ai-0.1.0/MagicMock/mock.history_db_path/124797232400624 +0 -0
  22. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125186624401296 +0 -0
  23. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125270700156512 +0 -0
  24. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125493728638784 +0 -0
  25. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125547829339264 +0 -0
  26. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125596812776496 +0 -0
  27. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125639904939376 +0 -0
  28. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125837942951952 +0 -0
  29. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125837943002832 +0 -0
  30. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125837943671600 +0 -0
  31. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125837950271120 +0 -0
  32. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125876844073072 +0 -0
  33. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125880534338640 +0 -0
  34. code_review_ai-0.1.0/MagicMock/mock.history_db_path/125914404323056 +0 -0
  35. code_review_ai-0.1.0/MagicMock/mock.history_db_path/126479245618368 +0 -0
  36. code_review_ai-0.1.0/MagicMock/mock.history_db_path/126833450543408 +0 -0
  37. code_review_ai-0.1.0/MagicMock/mock.history_db_path/126897162424336 +0 -0
  38. code_review_ai-0.1.0/MagicMock/mock.history_db_path/127544744301280 +0 -0
  39. code_review_ai-0.1.0/MagicMock/mock.history_db_path/127567472021328 +0 -0
  40. code_review_ai-0.1.0/MagicMock/mock.history_db_path/127629276598480 +0 -0
  41. code_review_ai-0.1.0/MagicMock/mock.history_db_path/128198533354832 +0 -0
  42. code_review_ai-0.1.0/MagicMock/mock.history_db_path/128366191638720 +0 -0
  43. code_review_ai-0.1.0/MagicMock/mock.history_db_path/129084350239648 +0 -0
  44. code_review_ai-0.1.0/MagicMock/mock.history_db_path/129196544878848 +0 -0
  45. code_review_ai-0.1.0/MagicMock/mock.history_db_path/129330344417696 +0 -0
  46. code_review_ai-0.1.0/MagicMock/mock.history_db_path/129399040670560 +0 -0
  47. code_review_ai-0.1.0/MagicMock/mock.history_db_path/129823417869440 +0 -0
  48. code_review_ai-0.1.0/MagicMock/mock.history_db_path/130035532342832 +0 -0
  49. code_review_ai-0.1.0/MagicMock/mock.history_db_path/130461201087280 +0 -0
  50. code_review_ai-0.1.0/MagicMock/mock.history_db_path/130461203543440 +0 -0
  51. code_review_ai-0.1.0/MagicMock/mock.history_db_path/130889071385184 +0 -0
  52. code_review_ai-0.1.0/MagicMock/mock.history_db_path/130900838337472 +0 -0
  53. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131266910357312 +0 -0
  54. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131270161812080 +0 -0
  55. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131270161854496 +0 -0
  56. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131488607045776 +0 -0
  57. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131635107107984 +0 -0
  58. code_review_ai-0.1.0/MagicMock/mock.history_db_path/131635107482608 +0 -0
  59. code_review_ai-0.1.0/MagicMock/mock.history_db_path/132179708909552 +0 -0
  60. code_review_ai-0.1.0/MagicMock/mock.history_db_path/132284161353840 +0 -0
  61. code_review_ai-0.1.0/MagicMock/mock.history_db_path/132404863123968 +0 -0
  62. code_review_ai-0.1.0/MagicMock/mock.history_db_path/132704292634352 +0 -0
  63. code_review_ai-0.1.0/MagicMock/mock.history_db_path/132904559716944 +0 -0
  64. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133184891614752 +0 -0
  65. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133493706635552 +0 -0
  66. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133536103042656 +0 -0
  67. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133837160345104 +0 -0
  68. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133894685002928 +0 -0
  69. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133894686143792 +0 -0
  70. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133894686229328 +0 -0
  71. code_review_ai-0.1.0/MagicMock/mock.history_db_path/133894687380864 +0 -0
  72. code_review_ai-0.1.0/MagicMock/mock.history_db_path/134678801027088 +0 -0
  73. code_review_ai-0.1.0/MagicMock/mock.history_db_path/135138171876128 +0 -0
  74. code_review_ai-0.1.0/MagicMock/mock.history_db_path/135146217967200 +0 -0
  75. code_review_ai-0.1.0/MagicMock/mock.history_db_path/135279236284928 +0 -0
  76. code_review_ai-0.1.0/MagicMock/mock.history_db_path/135842297654032 +0 -0
  77. code_review_ai-0.1.0/MagicMock/mock.history_db_path/136030193932512 +0 -0
  78. code_review_ai-0.1.0/MagicMock/mock.history_db_path/136030194263360 +0 -0
  79. code_review_ai-0.1.0/MagicMock/mock.history_db_path/136349837386064 +0 -0
  80. code_review_ai-0.1.0/MagicMock/mock.history_db_path/137330307747184 +0 -0
  81. code_review_ai-0.1.0/MagicMock/mock.history_db_path/138175081156864 +0 -0
  82. code_review_ai-0.1.0/MagicMock/mock.history_db_path/138594780535680 +0 -0
  83. code_review_ai-0.1.0/MagicMock/mock.history_db_path/139359822331344 +0 -0
  84. code_review_ai-0.1.0/MagicMock/mock.history_db_path/139538499620496 +0 -0
  85. code_review_ai-0.1.0/MagicMock/mock.history_db_path/140054564942384 +0 -0
  86. code_review_ai-0.1.0/MagicMock/mock.history_db_path/140435549825712 +0 -0
  87. code_review_ai-0.1.0/MagicMock/mock.history_db_path/140548083461744 +0 -0
  88. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/124124152873184 +0 -0
  89. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/124124153297952 +0 -0
  90. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/130461209641712 +0 -0
  91. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/130461209889632 +0 -0
  92. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/131270161181792 +0 -0
  93. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/131270163841440 +0 -0
  94. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/131635106610736 +0 -0
  95. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/131635107262976 +0 -0
  96. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/136030194703424 +0 -0
  97. code_review_ai-0.1.0/MagicMock/mock.model_copy().history_db_path/136030194861936 +0 -0
  98. code_review_ai-0.1.0/Makefile +37 -0
  99. code_review_ai-0.1.0/PKG-INFO +387 -0
  100. code_review_ai-0.1.0/README.md +350 -0
  101. code_review_ai-0.1.0/docs/architecture.md +298 -0
  102. code_review_ai-0.1.0/docs/cli-guide.md +217 -0
  103. code_review_ai-0.1.0/docs/configuration.md +193 -0
  104. code_review_ai-0.1.0/docs/custom-agents.md +200 -0
  105. code_review_ai-0.1.0/docs/data-models.md +278 -0
  106. code_review_ai-0.1.0/docs/interactive-guide.md +618 -0
  107. code_review_ai-0.1.0/docs/setup-guide.md +524 -0
  108. code_review_ai-0.1.0/pyproject.toml +122 -0
  109. code_review_ai-0.1.0/src/code_review_agent/__init__.py +3 -0
  110. code_review_ai-0.1.0/src/code_review_agent/agent_loader.py +196 -0
  111. code_review_ai-0.1.0/src/code_review_agent/agents/__init__.py +94 -0
  112. code_review_ai-0.1.0/src/code_review_agent/agents/base.py +250 -0
  113. code_review_ai-0.1.0/src/code_review_agent/agents/performance.py +38 -0
  114. code_review_ai-0.1.0/src/code_review_agent/agents/security.py +37 -0
  115. code_review_ai-0.1.0/src/code_review_agent/agents/style.py +38 -0
  116. code_review_ai-0.1.0/src/code_review_agent/agents/test_coverage.py +37 -0
  117. code_review_ai-0.1.0/src/code_review_agent/cancel_prompt.py +129 -0
  118. code_review_ai-0.1.0/src/code_review_agent/config.py +120 -0
  119. code_review_ai-0.1.0/src/code_review_agent/dedup.py +175 -0
  120. code_review_ai-0.1.0/src/code_review_agent/github_client.py +935 -0
  121. code_review_ai-0.1.0/src/code_review_agent/interactive/__init__.py +1 -0
  122. code_review_ai-0.1.0/src/code_review_agent/interactive/background.py +306 -0
  123. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/__init__.py +1 -0
  124. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/_helpers.py +20 -0
  125. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/agent_selector.py +207 -0
  126. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/config_cmd.py +251 -0
  127. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/config_edit.py +890 -0
  128. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/__init__.py +23 -0
  129. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/actions.py +356 -0
  130. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/filters.py +106 -0
  131. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/keybindings.py +257 -0
  132. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/models.py +105 -0
  133. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/renderer.py +537 -0
  134. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings/state.py +468 -0
  135. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/findings_cmd.py +277 -0
  136. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/git_read.py +98 -0
  137. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/git_write.py +275 -0
  138. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/graph_nav.py +571 -0
  139. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/history_cmd.py +281 -0
  140. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/meta.py +199 -0
  141. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/pr_read.py +338 -0
  142. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/pr_workflow.py +402 -0
  143. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/pr_write.py +333 -0
  144. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/provider_selector.py +141 -0
  145. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/repo_cmd.py +396 -0
  146. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/review_cmd.py +270 -0
  147. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/usage_cmd.py +102 -0
  148. code_review_ai-0.1.0/src/code_review_agent/interactive/commands/watch_cmd.py +87 -0
  149. code_review_ai-0.1.0/src/code_review_agent/interactive/completers.py +148 -0
  150. code_review_ai-0.1.0/src/code_review_agent/interactive/git_ops.py +304 -0
  151. code_review_ai-0.1.0/src/code_review_agent/interactive/repl.py +649 -0
  152. code_review_ai-0.1.0/src/code_review_agent/interactive/session.py +323 -0
  153. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/__init__.py +1 -0
  154. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/config_tab.py +71 -0
  155. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/findings_tab.py +89 -0
  156. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/git_tab.py +75 -0
  157. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/more_tab.py +64 -0
  158. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/pr_tab.py +100 -0
  159. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/repo_tab.py +92 -0
  160. code_review_ai-0.1.0/src/code_review_agent/interactive/tabs/usage_tab.py +90 -0
  161. code_review_ai-0.1.0/src/code_review_agent/interactive/tui_app.py +143 -0
  162. code_review_ai-0.1.0/src/code_review_agent/llm_client.py +277 -0
  163. code_review_ai-0.1.0/src/code_review_agent/main.py +447 -0
  164. code_review_ai-0.1.0/src/code_review_agent/models.py +194 -0
  165. code_review_ai-0.1.0/src/code_review_agent/orchestrator.py +881 -0
  166. code_review_ai-0.1.0/src/code_review_agent/progress.py +300 -0
  167. code_review_ai-0.1.0/src/code_review_agent/prompt_security.py +134 -0
  168. code_review_ai-0.1.0/src/code_review_agent/py.typed +0 -0
  169. code_review_ai-0.1.0/src/code_review_agent/rate_limiter.py +126 -0
  170. code_review_ai-0.1.0/src/code_review_agent/report.py +227 -0
  171. code_review_ai-0.1.0/src/code_review_agent/storage.py +948 -0
  172. code_review_ai-0.1.0/src/code_review_agent/theme.py +158 -0
  173. code_review_ai-0.1.0/src/code_review_agent/token_budget.py +180 -0
  174. code_review_ai-0.1.0/tests/__init__.py +0 -0
  175. code_review_ai-0.1.0/tests/conftest.py +225 -0
  176. code_review_ai-0.1.0/tests/test_agent_loader.py +485 -0
  177. code_review_ai-0.1.0/tests/test_agents.py +551 -0
  178. code_review_ai-0.1.0/tests/test_background_review.py +153 -0
  179. code_review_ai-0.1.0/tests/test_cancel_prompt.py +157 -0
  180. code_review_ai-0.1.0/tests/test_cli.py +542 -0
  181. code_review_ai-0.1.0/tests/test_dedup.py +244 -0
  182. code_review_ai-0.1.0/tests/test_findings_viewer.py +532 -0
  183. code_review_ai-0.1.0/tests/test_github_client.py +680 -0
  184. code_review_ai-0.1.0/tests/test_interactive.py +2190 -0
  185. code_review_ai-0.1.0/tests/test_llm_client.py +400 -0
  186. code_review_ai-0.1.0/tests/test_models.py +177 -0
  187. code_review_ai-0.1.0/tests/test_orchestrator.py +793 -0
  188. code_review_ai-0.1.0/tests/test_progress.py +156 -0
  189. code_review_ai-0.1.0/tests/test_prompt_security.py +194 -0
  190. code_review_ai-0.1.0/tests/test_rate_limiter.py +196 -0
  191. code_review_ai-0.1.0/tests/test_report.py +353 -0
  192. code_review_ai-0.1.0/tests/test_risk_validation.py +138 -0
  193. code_review_ai-0.1.0/tests/test_token_budget.py +396 -0
  194. code_review_ai-0.1.0/uv.lock +1358 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "mcp__atlassian__createJiraIssue",
5
+ "mcp__atlassian__getTransitionsForJiraIssue",
6
+ "mcp__atlassian__transitionJiraIssue",
7
+ "mcp__atlassian__searchJiraIssuesUsingJql",
8
+ "mcp__atlassian__getJiraIssue",
9
+ "mcp__atlassian__editJiraIssue",
10
+ "mcp__atlassian__lookupJiraAccountId",
11
+ "mcp__atlassian__addCommentToJiraIssue",
12
+ "Bash(uv run:*)",
13
+ "Bash(git add:*)",
14
+ "Bash(source:*)",
15
+ "Bash(python:*)",
16
+ "Bash(grep:*)",
17
+ "Bash(uv add:*)",
18
+ "Bash(sed -i 's|minhtribk12/code-review-agent|minhtribk12/code-review-ai|g' docs/cli-guide.md docs/interactive-guide.md docs/setup-guide.md)",
19
+ "Bash(sed -i 's|code-review-agent|code-review-ai|g' docs/cli-guide.md docs/interactive-guide.md docs/setup-guide.md)"
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,112 @@
1
+ # LLM Provider (openrouter, nvidia, openai)
2
+ LLM_PROVIDER=openrouter
3
+
4
+ # API key for the LLM provider
5
+ LLM_API_KEY=your-api-key-here
6
+
7
+ # Model to use (default: nvidia/nemotron-3-super-120b-a12b)
8
+ LLM_MODEL=nvidia/nemotron-3-super-120b-a12b
9
+
10
+ # Custom base URL (overrides provider URL, for local servers or custom endpoints)
11
+ # LLM_BASE_URL=http://localhost:8000/v1
12
+
13
+ # Temperature for LLM responses (0.0 to 1.0, lower = more consistent)
14
+ LLM_TEMPERATURE=0.1
15
+
16
+ # Top-p (nucleus sampling) for LLM responses (0.0 to 1.0)
17
+ # LLM_TOP_P=0.95
18
+
19
+ # Maximum tokens in LLM response (128+, default 4096)
20
+ # LLM_MAX_TOKENS=4096
21
+
22
+ # Request timeout in seconds for LLM API calls
23
+ REQUEST_TIMEOUT_SECONDS=120
24
+
25
+ # Token budget tier (free, standard, premium)
26
+ # - free: 5000 tokens (8k context models, free tier APIs)
27
+ # - standard: 16000 tokens (32k context models)
28
+ # - premium: 48000 tokens (128k context models)
29
+ # Budget is auto-detected from model name when possible. Tier is the fallback.
30
+ TOKEN_TIER=free
31
+
32
+ # Explicit token budget override (overrides both tier and auto-detection)
33
+ # MAX_PROMPT_TOKENS=32000
34
+
35
+ # Maximum total tokens per review (all agents + synthesis). Optional hard cap.
36
+ # When exceeded, a warning is logged. Default: unlimited.
37
+ # MAX_TOKENS_PER_REVIEW=50000
38
+
39
+ # Custom LLM pricing (per 1M tokens). Overrides auto-detected pricing.
40
+ # Used for cost estimation in the report. Leave unset for auto-detection.
41
+ # LLM_INPUT_PRICE_PER_M=0.30
42
+ # LLM_OUTPUT_PRICE_PER_M=0.60
43
+
44
+ # Rate limit: requests per minute (auto-detected from tier by default)
45
+ # FREE=5 rpm, STANDARD=30 rpm, PREMIUM=unlimited
46
+ # Adapts automatically from provider 429 responses.
47
+ # RATE_LIMIT_RPM=10
48
+
49
+ # Maximum total review time in seconds (all agents + synthesis)
50
+ MAX_REVIEW_SECONDS=600
51
+
52
+ # Deduplication strategy for findings across agents
53
+ # exact (default): same file + line + title
54
+ # location: same file + line only
55
+ # similar: same file + line + title similarity > 0.6
56
+ # disabled: no dedup
57
+ DEDUP_STRATEGY=exact
58
+
59
+ # Maximum number of files to fetch from a GitHub PR (pagination cap)
60
+ MAX_PR_FILES=200
61
+
62
+ # GitHub personal access token (for PR integration)
63
+ GITHUB_TOKEN=your-github-token-here
64
+
65
+ # GitHub API base URL (override for testing with mock server)
66
+ # GITHUB_API_BASE_URL=http://localhost:9998
67
+
68
+ # GitHub rate limit warning threshold (log WARNING when remaining < this)
69
+ # Unauthenticated: 60/hour, Authenticated: 5000/hour
70
+ # GITHUB_RATE_LIMIT_WARN_THRESHOLD=100
71
+
72
+ # Days of inactivity before a PR is considered stale (for `pr stale` command)
73
+ # PR_STALE_DAYS=7
74
+
75
+ # Log level (DEBUG, INFO, WARNING, ERROR)
76
+ LOG_LEVEL=INFO
77
+
78
+ # Maximum number of agents running in parallel
79
+ MAX_CONCURRENT_AGENTS=4
80
+
81
+ # Interactive mode settings
82
+ # INTERACTIVE_HISTORY_FILE=~/.cra_history
83
+ # INTERACTIVE_PROMPT=cra>
84
+ # INTERACTIVE_VI_MODE=false
85
+ # INTERACTIVE_AUTOCOMPLETE_CACHE_TTL=5
86
+
87
+ # Watch mode: polling interval in seconds (for `watch` command)
88
+ # WATCH_DEBOUNCE_SECONDS=5.0
89
+
90
+ # Iterative review: run agents multiple rounds for deeper analysis
91
+ # Each round feeds previous findings back to agents. Cost multiplier = N rounds.
92
+ # MAX_DEEPENING_ROUNDS=1
93
+
94
+ # Validation: separate validator agent reviews all findings for false positives
95
+ # Adds 1 LLM call per validation round. Only useful with 2+ review agents.
96
+ # IS_VALIDATION_ENABLED=false
97
+ # MAX_VALIDATION_ROUNDS=1
98
+
99
+ # Custom agents: directory containing YAML agent definitions
100
+ # Agents are also loaded from .cra/agents/ in the project root.
101
+ # CUSTOM_AGENTS_DIR=~/.cra/agents
102
+
103
+ # Default agents to run (comma-separated). Empty = use tier defaults.
104
+ # DEFAULT_AGENTS=security,performance
105
+
106
+ # Review history storage
107
+ # HISTORY_DB_PATH=~/.cra/reviews.db
108
+ # AUTO_SAVE_HISTORY=true
109
+
110
+ # Usage display window for toolbar and progress bar
111
+ # Options: session, hour, day, week, month, year, all
112
+ # USAGE_WINDOW=hour
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ check:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+
25
+ - name: Install dependencies
26
+ run: uv sync
27
+
28
+ - name: Lint
29
+ run: make lint
30
+
31
+ - name: Type check
32
+ run: make typecheck
33
+
34
+ - name: Test
35
+ run: make test
@@ -0,0 +1,42 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ environment: pypi
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v5
24
+
25
+ - name: Install dependencies
26
+ run: uv sync
27
+
28
+ - name: Run tests
29
+ run: uv run pytest --no-cov -q
30
+
31
+ - name: Build package
32
+ run: uv build
33
+
34
+ - name: Publish to PyPI
35
+ run: uv publish
36
+ env:
37
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
38
+
39
+ - name: Create GitHub Release
40
+ run: gh release create ${{ github.ref_name }} dist/* --generate-notes
41
+ env:
42
+ GH_TOKEN: ${{ github.token }}
@@ -0,0 +1,62 @@
1
+ # Python bytecode
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.egg
11
+ sdist/
12
+ wheels/
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+ ENV/
18
+ env/
19
+
20
+ # Environment variables (secrets)
21
+ .env
22
+ .env.local
23
+ .env.*.local
24
+
25
+ # Testing
26
+ .pytest_cache/
27
+ htmlcov/
28
+ .coverage
29
+ .coverage.*
30
+ coverage.xml
31
+
32
+ # Type checking
33
+ .mypy_cache/
34
+ .dmypy.json
35
+ dmypy.json
36
+
37
+ # Linting
38
+ .ruff_cache/
39
+
40
+ # IDE
41
+ .idea/
42
+ .vscode/
43
+ *.swp
44
+ *.swo
45
+ *~
46
+ .project
47
+ .settings/
48
+
49
+ # OS files
50
+ .DS_Store
51
+ Thumbs.db
52
+ Desktop.ini
53
+
54
+
55
+ # Jupyter
56
+ .ipynb_checkpoints/
57
+
58
+ # Local planning (not for repo)
59
+ plan/
60
+
61
+ # Interactive tests (local only, not for repo)
62
+ interactive_tests/
@@ -0,0 +1,36 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+
8
+ - repo: https://github.com/astral-sh/ruff-pre-commit
9
+ rev: v0.9.7
10
+ hooks:
11
+ - id: ruff
12
+ args: [--fix, --exit-non-zero-on-fix]
13
+ - id: ruff-format
14
+
15
+ - repo: https://github.com/pre-commit/mirrors-mypy
16
+ rev: v1.15.0
17
+ hooks:
18
+ - id: mypy
19
+ additional_dependencies:
20
+ - pydantic>=2.0
21
+ - pydantic-settings
22
+ - typer>=0.12
23
+ - structlog
24
+ - httpx
25
+ - openai
26
+ - tenacity
27
+ - prompt-toolkit>=3.0
28
+ args: [--strict]
29
+ pass_filenames: false
30
+ entry: mypy src/
31
+
32
+ - repo: https://github.com/Yelp/detect-secrets
33
+ rev: v1.5.0
34
+ hooks:
35
+ - id: detect-secrets
36
+ args: [--baseline, .secrets.baseline]
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,131 @@
1
+ {
2
+ "version": "1.5.0",
3
+ "plugins_used": [
4
+ {
5
+ "name": "ArtifactoryDetector"
6
+ },
7
+ {
8
+ "name": "AWSKeyDetector"
9
+ },
10
+ {
11
+ "name": "AzureStorageKeyDetector"
12
+ },
13
+ {
14
+ "name": "Base64HighEntropyString",
15
+ "limit": 4.5
16
+ },
17
+ {
18
+ "name": "BasicAuthDetector"
19
+ },
20
+ {
21
+ "name": "CloudantDetector"
22
+ },
23
+ {
24
+ "name": "DiscordBotTokenDetector"
25
+ },
26
+ {
27
+ "name": "GitHubTokenDetector"
28
+ },
29
+ {
30
+ "name": "GitLabTokenDetector"
31
+ },
32
+ {
33
+ "name": "HexHighEntropyString",
34
+ "limit": 3.0
35
+ },
36
+ {
37
+ "name": "IbmCloudIamDetector"
38
+ },
39
+ {
40
+ "name": "IbmCosHmacDetector"
41
+ },
42
+ {
43
+ "name": "IPPublicDetector"
44
+ },
45
+ {
46
+ "name": "JwtTokenDetector"
47
+ },
48
+ {
49
+ "name": "KeywordDetector",
50
+ "keyword_exclude": ""
51
+ },
52
+ {
53
+ "name": "MailchimpDetector"
54
+ },
55
+ {
56
+ "name": "NpmDetector"
57
+ },
58
+ {
59
+ "name": "OpenAIDetector"
60
+ },
61
+ {
62
+ "name": "PrivateKeyDetector"
63
+ },
64
+ {
65
+ "name": "PypiTokenDetector"
66
+ },
67
+ {
68
+ "name": "SendGridDetector"
69
+ },
70
+ {
71
+ "name": "SlackDetector"
72
+ },
73
+ {
74
+ "name": "SoftlayerDetector"
75
+ },
76
+ {
77
+ "name": "SquareOAuthDetector"
78
+ },
79
+ {
80
+ "name": "StripeDetector"
81
+ },
82
+ {
83
+ "name": "TelegramBotTokenDetector"
84
+ },
85
+ {
86
+ "name": "TwilioKeyDetector"
87
+ }
88
+ ],
89
+ "filters_used": [
90
+ {
91
+ "path": "detect_secrets.filters.allowlist.is_line_allowlisted"
92
+ },
93
+ {
94
+ "path": "detect_secrets.filters.common.is_baseline_file",
95
+ "filename": ".secrets.baseline"
96
+ },
97
+ {
98
+ "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
99
+ "min_level": 2
100
+ },
101
+ {
102
+ "path": "detect_secrets.filters.heuristic.is_indirect_reference"
103
+ },
104
+ {
105
+ "path": "detect_secrets.filters.heuristic.is_likely_id_string"
106
+ },
107
+ {
108
+ "path": "detect_secrets.filters.heuristic.is_lock_file"
109
+ },
110
+ {
111
+ "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
112
+ },
113
+ {
114
+ "path": "detect_secrets.filters.heuristic.is_potential_uuid"
115
+ },
116
+ {
117
+ "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
118
+ },
119
+ {
120
+ "path": "detect_secrets.filters.heuristic.is_sequential_string"
121
+ },
122
+ {
123
+ "path": "detect_secrets.filters.heuristic.is_swagger_file"
124
+ },
125
+ {
126
+ "path": "detect_secrets.filters.heuristic.is_templated_secret"
127
+ }
128
+ ],
129
+ "results": {},
130
+ "generated_at": "2026-03-17T22:53:03Z"
131
+ }
@@ -0,0 +1,25 @@
1
+ FROM python:3.12-slim AS builder
2
+
3
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
4
+
5
+ WORKDIR /app
6
+
7
+ COPY pyproject.toml uv.lock ./
8
+ RUN uv sync --no-dev --frozen --no-install-project
9
+
10
+ COPY src/ src/
11
+ RUN uv sync --no-dev --frozen
12
+
13
+
14
+ FROM python:3.12-slim AS runtime
15
+
16
+ RUN groupadd --system app && useradd --system --gid app app
17
+
18
+ COPY --from=builder /app/.venv /app/.venv
19
+
20
+ ENV PATH="/app/.venv/bin:${PATH}"
21
+
22
+ USER app
23
+ WORKDIR /app
24
+
25
+ ENTRYPOINT ["code-review-ai"]
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 Tri Nguyen
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.