repolens-audit 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 (316) hide show
  1. repolens_audit-0.1.0/LICENSE +21 -0
  2. repolens_audit-0.1.0/PKG-INFO +313 -0
  3. repolens_audit-0.1.0/README.md +242 -0
  4. repolens_audit-0.1.0/pyproject.toml +102 -0
  5. repolens_audit-0.1.0/setup.cfg +4 -0
  6. repolens_audit-0.1.0/src/repolens/__init__.py +3 -0
  7. repolens_audit-0.1.0/src/repolens/__main__.py +4 -0
  8. repolens_audit-0.1.0/src/repolens/adaptive.py +133 -0
  9. repolens_audit-0.1.0/src/repolens/anchor.py +99 -0
  10. repolens_audit-0.1.0/src/repolens/architecture/__init__.py +57 -0
  11. repolens_audit-0.1.0/src/repolens/architecture/fas.py +180 -0
  12. repolens_audit-0.1.0/src/repolens/architecture/issues.py +84 -0
  13. repolens_audit-0.1.0/src/repolens/architecture/load.py +94 -0
  14. repolens_audit-0.1.0/src/repolens/architecture/match.py +42 -0
  15. repolens_audit-0.1.0/src/repolens/architecture/remediation.py +82 -0
  16. repolens_audit-0.1.0/src/repolens/architecture/schema.py +48 -0
  17. repolens_audit-0.1.0/src/repolens/architecture/schemas/architecture.schema.json +33 -0
  18. repolens_audit-0.1.0/src/repolens/architecture/verify.py +77 -0
  19. repolens_audit-0.1.0/src/repolens/bands.py +42 -0
  20. repolens_audit-0.1.0/src/repolens/benchmark.py +129 -0
  21. repolens_audit-0.1.0/src/repolens/blast_radius.py +115 -0
  22. repolens_audit-0.1.0/src/repolens/changeset.py +95 -0
  23. repolens_audit-0.1.0/src/repolens/ci_args.py +73 -0
  24. repolens_audit-0.1.0/src/repolens/cli/__init__.py +28 -0
  25. repolens_audit-0.1.0/src/repolens/cli/adaptive.py +134 -0
  26. repolens_audit-0.1.0/src/repolens/cli/app.py +240 -0
  27. repolens_audit-0.1.0/src/repolens/cli/commands_architecture.py +100 -0
  28. repolens_audit-0.1.0/src/repolens/cli/commands_baseline.py +123 -0
  29. repolens_audit-0.1.0/src/repolens/cli/commands_benchmark.py +72 -0
  30. repolens_audit-0.1.0/src/repolens/cli/commands_check.py +239 -0
  31. repolens_audit-0.1.0/src/repolens/cli/commands_diff_audit.py +55 -0
  32. repolens_audit-0.1.0/src/repolens/cli/commands_duplicates.py +55 -0
  33. repolens_audit-0.1.0/src/repolens/cli/commands_explain.py +122 -0
  34. repolens_audit-0.1.0/src/repolens/cli/commands_feedback.py +113 -0
  35. repolens_audit-0.1.0/src/repolens/cli/commands_graph.py +181 -0
  36. repolens_audit-0.1.0/src/repolens/cli/commands_hotspots.py +42 -0
  37. repolens_audit-0.1.0/src/repolens/cli/commands_ignore.py +66 -0
  38. repolens_audit-0.1.0/src/repolens/cli/commands_journal.py +41 -0
  39. repolens_audit-0.1.0/src/repolens/cli/commands_modes.py +306 -0
  40. repolens_audit-0.1.0/src/repolens/cli/commands_packs.py +25 -0
  41. repolens_audit-0.1.0/src/repolens/cli/commands_plan.py +100 -0
  42. repolens_audit-0.1.0/src/repolens/cli/commands_pr_summary.py +156 -0
  43. repolens_audit-0.1.0/src/repolens/cli/commands_review.py +427 -0
  44. repolens_audit-0.1.0/src/repolens/cli/commands_review_support.py +125 -0
  45. repolens_audit-0.1.0/src/repolens/cli/export.py +120 -0
  46. repolens_audit-0.1.0/src/repolens/cli/pack_scope.py +63 -0
  47. repolens_audit-0.1.0/src/repolens/cli/plugins.py +51 -0
  48. repolens_audit-0.1.0/src/repolens/cluster.py +94 -0
  49. repolens_audit-0.1.0/src/repolens/complexity/__init__.py +27 -0
  50. repolens_audit-0.1.0/src/repolens/complexity/ai_pack.py +83 -0
  51. repolens_audit-0.1.0/src/repolens/complexity/python_ast.py +171 -0
  52. repolens_audit-0.1.0/src/repolens/complexity/runner.py +169 -0
  53. repolens_audit-0.1.0/src/repolens/complexity/thresholds.py +83 -0
  54. repolens_audit-0.1.0/src/repolens/complexity/types.py +21 -0
  55. repolens_audit-0.1.0/src/repolens/config.py +404 -0
  56. repolens_audit-0.1.0/src/repolens/consistency.py +173 -0
  57. repolens_audit-0.1.0/src/repolens/coverage.py +454 -0
  58. repolens_audit-0.1.0/src/repolens/deep.py +496 -0
  59. repolens_audit-0.1.0/src/repolens/diagnostics.py +138 -0
  60. repolens_audit-0.1.0/src/repolens/diagrams.py +243 -0
  61. repolens_audit-0.1.0/src/repolens/diff_audit.py +68 -0
  62. repolens_audit-0.1.0/src/repolens/disclaimer.py +59 -0
  63. repolens_audit-0.1.0/src/repolens/explain.py +477 -0
  64. repolens_audit-0.1.0/src/repolens/explain_render.py +467 -0
  65. repolens_audit-0.1.0/src/repolens/feedback_store.py +256 -0
  66. repolens_audit-0.1.0/src/repolens/file_outline.py +148 -0
  67. repolens_audit-0.1.0/src/repolens/fp_calibrations.py +148 -0
  68. repolens_audit-0.1.0/src/repolens/git_churn.py +87 -0
  69. repolens_audit-0.1.0/src/repolens/git_refs.py +72 -0
  70. repolens_audit-0.1.0/src/repolens/github_pr_comments.py +324 -0
  71. repolens_audit-0.1.0/src/repolens/graph/__init__.py +14 -0
  72. repolens_audit-0.1.0/src/repolens/graph/adapters.py +147 -0
  73. repolens_audit-0.1.0/src/repolens/graph/baseline.py +88 -0
  74. repolens_audit-0.1.0/src/repolens/graph/build.py +246 -0
  75. repolens_audit-0.1.0/src/repolens/graph/cycles.py +64 -0
  76. repolens_audit-0.1.0/src/repolens/graph/diff_anchor.py +187 -0
  77. repolens_audit-0.1.0/src/repolens/graph/discover.py +159 -0
  78. repolens_audit-0.1.0/src/repolens/graph/findings.py +94 -0
  79. repolens_audit-0.1.0/src/repolens/graph/query.py +140 -0
  80. repolens_audit-0.1.0/src/repolens/graph/ratchet.py +151 -0
  81. repolens_audit-0.1.0/src/repolens/graph/scope_tags.py +61 -0
  82. repolens_audit-0.1.0/src/repolens/graph/types.py +49 -0
  83. repolens_audit-0.1.0/src/repolens/heuristics/__init__.py +5 -0
  84. repolens_audit-0.1.0/src/repolens/heuristics/ci_gaps.py +104 -0
  85. repolens_audit-0.1.0/src/repolens/heuristics/deep_nesting.py +85 -0
  86. repolens_audit-0.1.0/src/repolens/heuristics/gitignore_secrets.py +112 -0
  87. repolens_audit-0.1.0/src/repolens/heuristics/mega_files.py +85 -0
  88. repolens_audit-0.1.0/src/repolens/heuristics/near_clones.py +449 -0
  89. repolens_audit-0.1.0/src/repolens/heuristics/paths.py +9 -0
  90. repolens_audit-0.1.0/src/repolens/heuristics/runner.py +185 -0
  91. repolens_audit-0.1.0/src/repolens/heuristics/scripts_hygiene.py +119 -0
  92. repolens_audit-0.1.0/src/repolens/heuristics/siblings.py +99 -0
  93. repolens_audit-0.1.0/src/repolens/inventory.py +330 -0
  94. repolens_audit-0.1.0/src/repolens/issue_ids.py +57 -0
  95. repolens_audit-0.1.0/src/repolens/last_llm.py +151 -0
  96. repolens_audit-0.1.0/src/repolens/learned_prefs.py +92 -0
  97. repolens_audit-0.1.0/src/repolens/learning/__init__.py +22 -0
  98. repolens_audit-0.1.0/src/repolens/learning/consent.py +72 -0
  99. repolens_audit-0.1.0/src/repolens/learning/embeddings.py +20 -0
  100. repolens_audit-0.1.0/src/repolens/learning/index.py +67 -0
  101. repolens_audit-0.1.0/src/repolens/learning/memory.py +48 -0
  102. repolens_audit-0.1.0/src/repolens/learning/retrieve.py +31 -0
  103. repolens_audit-0.1.0/src/repolens/learning/store.py +302 -0
  104. repolens_audit-0.1.0/src/repolens/llm/__init__.py +59 -0
  105. repolens_audit-0.1.0/src/repolens/llm/bedrock.py +312 -0
  106. repolens_audit-0.1.0/src/repolens/llm/errors.py +48 -0
  107. repolens_audit-0.1.0/src/repolens/llm/gemini.py +151 -0
  108. repolens_audit-0.1.0/src/repolens/llm/local_queue.py +77 -0
  109. repolens_audit-0.1.0/src/repolens/llm/model_lock.py +331 -0
  110. repolens_audit-0.1.0/src/repolens/llm/parse.py +376 -0
  111. repolens_audit-0.1.0/src/repolens/llm/setup.py +160 -0
  112. repolens_audit-0.1.0/src/repolens/llm/sse.py +104 -0
  113. repolens_audit-0.1.0/src/repolens/llm/transport.py +440 -0
  114. repolens_audit-0.1.0/src/repolens/llm/vertex.py +143 -0
  115. repolens_audit-0.1.0/src/repolens/llm_structured.py +241 -0
  116. repolens_audit-0.1.0/src/repolens/mcp/__init__.py +5 -0
  117. repolens_audit-0.1.0/src/repolens/mcp/server.py +227 -0
  118. repolens_audit-0.1.0/src/repolens/metrics.py +410 -0
  119. repolens_audit-0.1.0/src/repolens/na_truth.py +75 -0
  120. repolens_audit-0.1.0/src/repolens/packs/__init__.py +7 -0
  121. repolens_audit-0.1.0/src/repolens/packs/azure_sentinel/__init__.py +1 -0
  122. repolens_audit-0.1.0/src/repolens/packs/azure_sentinel/heuristics.py +148 -0
  123. repolens_audit-0.1.0/src/repolens/packs/azure_sentinel/playbook.md +26 -0
  124. repolens_audit-0.1.0/src/repolens/packs/registry.py +110 -0
  125. repolens_audit-0.1.0/src/repolens/path_globs.py +42 -0
  126. repolens_audit-0.1.0/src/repolens/pipeline/__init__.py +17 -0
  127. repolens_audit-0.1.0/src/repolens/pipeline/deep_exec.py +317 -0
  128. repolens_audit-0.1.0/src/repolens/pipeline/deep_exec_support.py +289 -0
  129. repolens_audit-0.1.0/src/repolens/pipeline/deep_pass.py +163 -0
  130. repolens_audit-0.1.0/src/repolens/pipeline/interrupt.py +31 -0
  131. repolens_audit-0.1.0/src/repolens/pipeline/journal.py +83 -0
  132. repolens_audit-0.1.0/src/repolens/pipeline/pass_cache.py +92 -0
  133. repolens_audit-0.1.0/src/repolens/pipeline/pass_resume.py +198 -0
  134. repolens_audit-0.1.0/src/repolens/pipeline/prompt.py +87 -0
  135. repolens_audit-0.1.0/src/repolens/pipeline/review_state.py +102 -0
  136. repolens_audit-0.1.0/src/repolens/pipeline/run.py +422 -0
  137. repolens_audit-0.1.0/src/repolens/pipeline/run_collect.py +341 -0
  138. repolens_audit-0.1.0/src/repolens/pipeline/run_finish.py +242 -0
  139. repolens_audit-0.1.0/src/repolens/pipeline/run_route.py +449 -0
  140. repolens_audit-0.1.0/src/repolens/pipeline/run_support.py +104 -0
  141. repolens_audit-0.1.0/src/repolens/pipeline/types.py +36 -0
  142. repolens_audit-0.1.0/src/repolens/plan_forecast.py +144 -0
  143. repolens_audit-0.1.0/src/repolens/plan_tiers.py +65 -0
  144. repolens_audit-0.1.0/src/repolens/playbooks/README.md +18 -0
  145. repolens_audit-0.1.0/src/repolens/playbooks/architecture.md +378 -0
  146. repolens_audit-0.1.0/src/repolens/playbooks/security.md +152 -0
  147. repolens_audit-0.1.0/src/repolens/playbooks.py +70 -0
  148. repolens_audit-0.1.0/src/repolens/plugins.py +370 -0
  149. repolens_audit-0.1.0/src/repolens/pr_summary.py +144 -0
  150. repolens_audit-0.1.0/src/repolens/progress.py +143 -0
  151. repolens_audit-0.1.0/src/repolens/prose.py +11 -0
  152. repolens_audit-0.1.0/src/repolens/provenance_attest.py +59 -0
  153. repolens_audit-0.1.0/src/repolens/provider_status.py +44 -0
  154. repolens_audit-0.1.0/src/repolens/providers.py +216 -0
  155. repolens_audit-0.1.0/src/repolens/py.typed +0 -0
  156. repolens_audit-0.1.0/src/repolens/quality.py +65 -0
  157. repolens_audit-0.1.0/src/repolens/quality_metrics.py +57 -0
  158. repolens_audit-0.1.0/src/repolens/report.py +496 -0
  159. repolens_audit-0.1.0/src/repolens/report_checklist.py +206 -0
  160. repolens_audit-0.1.0/src/repolens/report_metrics.py +264 -0
  161. repolens_audit-0.1.0/src/repolens/report_parse.py +216 -0
  162. repolens_audit-0.1.0/src/repolens/report_sections.py +302 -0
  163. repolens_audit-0.1.0/src/repolens/rules/__init__.py +7 -0
  164. repolens_audit-0.1.0/src/repolens/rules/defaults/architecture.md +378 -0
  165. repolens_audit-0.1.0/src/repolens/rules/defaults/coverage.json +473 -0
  166. repolens_audit-0.1.0/src/repolens/rules/defaults/manifest.json +26 -0
  167. repolens_audit-0.1.0/src/repolens/rules/defaults/reliability.md +25 -0
  168. repolens_audit-0.1.0/src/repolens/rules/defaults/security.md +152 -0
  169. repolens_audit-0.1.0/src/repolens/rules/registry.py +239 -0
  170. repolens_audit-0.1.0/src/repolens/runtime_estimate.py +65 -0
  171. repolens_audit-0.1.0/src/repolens/sarif.py +189 -0
  172. repolens_audit-0.1.0/src/repolens/sarif_import.py +246 -0
  173. repolens_audit-0.1.0/src/repolens/scanners/__init__.py +5 -0
  174. repolens_audit-0.1.0/src/repolens/scanners/base.py +81 -0
  175. repolens_audit-0.1.0/src/repolens/scanners/checkov.py +143 -0
  176. repolens_audit-0.1.0/src/repolens/scanners/evidence.py +38 -0
  177. repolens_audit-0.1.0/src/repolens/scanners/gitleaks.py +146 -0
  178. repolens_audit-0.1.0/src/repolens/scanners/osv.py +92 -0
  179. repolens_audit-0.1.0/src/repolens/scanners/runner.py +89 -0
  180. repolens_audit-0.1.0/src/repolens/scanners/sca.py +322 -0
  181. repolens_audit-0.1.0/src/repolens/scanners/sca_sbom.py +223 -0
  182. repolens_audit-0.1.0/src/repolens/scanners/semgrep.py +92 -0
  183. repolens_audit-0.1.0/src/repolens/scanners/trivy.py +169 -0
  184. repolens_audit-0.1.0/src/repolens/scanners/usage_hints.py +144 -0
  185. repolens_audit-0.1.0/src/repolens/schema.py +292 -0
  186. repolens_audit-0.1.0/src/repolens/sources.py +289 -0
  187. repolens_audit-0.1.0/src/repolens/suppressions.py +269 -0
  188. repolens_audit-0.1.0/src/repolens/testing/__init__.py +8 -0
  189. repolens_audit-0.1.0/src/repolens/testing/inventory.py +134 -0
  190. repolens_audit-0.1.0/src/repolens/themes.py +191 -0
  191. repolens_audit-0.1.0/src/repolens/triage.py +281 -0
  192. repolens_audit-0.1.0/src/repolens/vacuous_floor.py +151 -0
  193. repolens_audit-0.1.0/src/repolens/verify_findings.py +123 -0
  194. repolens_audit-0.1.0/src/repolens_audit.egg-info/PKG-INFO +313 -0
  195. repolens_audit-0.1.0/src/repolens_audit.egg-info/SOURCES.txt +314 -0
  196. repolens_audit-0.1.0/src/repolens_audit.egg-info/dependency_links.txt +1 -0
  197. repolens_audit-0.1.0/src/repolens_audit.egg-info/entry_points.txt +3 -0
  198. repolens_audit-0.1.0/src/repolens_audit.egg-info/requires.txt +31 -0
  199. repolens_audit-0.1.0/src/repolens_audit.egg-info/top_level.txt +1 -0
  200. repolens_audit-0.1.0/tests/test_adaptive.py +73 -0
  201. repolens_audit-0.1.0/tests/test_architecture.py +146 -0
  202. repolens_audit-0.1.0/tests/test_band_coerce.py +106 -0
  203. repolens_audit-0.1.0/tests/test_benchmark.py +63 -0
  204. repolens_audit-0.1.0/tests/test_blast_radius.py +82 -0
  205. repolens_audit-0.1.0/tests/test_changeset.py +71 -0
  206. repolens_audit-0.1.0/tests/test_ci_args.py +71 -0
  207. repolens_audit-0.1.0/tests/test_cli.py +332 -0
  208. repolens_audit-0.1.0/tests/test_cli_baseline.py +136 -0
  209. repolens_audit-0.1.0/tests/test_cli_check.py +431 -0
  210. repolens_audit-0.1.0/tests/test_cli_hotspots.py +72 -0
  211. repolens_audit-0.1.0/tests/test_cli_review_ratchet.py +152 -0
  212. repolens_audit-0.1.0/tests/test_cluster.py +175 -0
  213. repolens_audit-0.1.0/tests/test_complexity_ai_pack.py +80 -0
  214. repolens_audit-0.1.0/tests/test_complexity_python_ast.py +55 -0
  215. repolens_audit-0.1.0/tests/test_complexity_report.py +49 -0
  216. repolens_audit-0.1.0/tests/test_complexity_runner.py +171 -0
  217. repolens_audit-0.1.0/tests/test_complexity_schema.py +30 -0
  218. repolens_audit-0.1.0/tests/test_complexity_thresholds.py +49 -0
  219. repolens_audit-0.1.0/tests/test_config.py +111 -0
  220. repolens_audit-0.1.0/tests/test_consistency.py +64 -0
  221. repolens_audit-0.1.0/tests/test_coverage_config.py +78 -0
  222. repolens_audit-0.1.0/tests/test_coverage_lazy_na.py +57 -0
  223. repolens_audit-0.1.0/tests/test_coverage_matrix.py +260 -0
  224. repolens_audit-0.1.0/tests/test_coverage_seeding.py +139 -0
  225. repolens_audit-0.1.0/tests/test_deep.py +366 -0
  226. repolens_audit-0.1.0/tests/test_deep_merge.py +200 -0
  227. repolens_audit-0.1.0/tests/test_diagrams.py +105 -0
  228. repolens_audit-0.1.0/tests/test_docs_extras.py +57 -0
  229. repolens_audit-0.1.0/tests/test_editor_cli.py +270 -0
  230. repolens_audit-0.1.0/tests/test_editor_vscode.py +45 -0
  231. repolens_audit-0.1.0/tests/test_explain.py +370 -0
  232. repolens_audit-0.1.0/tests/test_fallback.py +60 -0
  233. repolens_audit-0.1.0/tests/test_fast_brain.py +151 -0
  234. repolens_audit-0.1.0/tests/test_feedback_calibrations.py +214 -0
  235. repolens_audit-0.1.0/tests/test_file_outline.py +88 -0
  236. repolens_audit-0.1.0/tests/test_fp_calibrations.py +132 -0
  237. repolens_audit-0.1.0/tests/test_git_churn.py +73 -0
  238. repolens_audit-0.1.0/tests/test_github_pr_comments.py +178 -0
  239. repolens_audit-0.1.0/tests/test_graph_adapters.py +128 -0
  240. repolens_audit-0.1.0/tests/test_graph_baseline.py +114 -0
  241. repolens_audit-0.1.0/tests/test_graph_build.py +100 -0
  242. repolens_audit-0.1.0/tests/test_graph_cycles.py +15 -0
  243. repolens_audit-0.1.0/tests/test_graph_diff_anchor.py +136 -0
  244. repolens_audit-0.1.0/tests/test_graph_discover.py +141 -0
  245. repolens_audit-0.1.0/tests/test_graph_findings.py +51 -0
  246. repolens_audit-0.1.0/tests/test_graph_pipeline.py +46 -0
  247. repolens_audit-0.1.0/tests/test_graph_ratchet.py +200 -0
  248. repolens_audit-0.1.0/tests/test_graph_scope_tags.py +58 -0
  249. repolens_audit-0.1.0/tests/test_graph_types.py +12 -0
  250. repolens_audit-0.1.0/tests/test_guided_models.py +34 -0
  251. repolens_audit-0.1.0/tests/test_guided_script.py +485 -0
  252. repolens_audit-0.1.0/tests/test_heuristics.py +305 -0
  253. repolens_audit-0.1.0/tests/test_heuristics_deep_nesting.py +80 -0
  254. repolens_audit-0.1.0/tests/test_interrupt.py +72 -0
  255. repolens_audit-0.1.0/tests/test_inventory.py +172 -0
  256. repolens_audit-0.1.0/tests/test_issue_ids.py +61 -0
  257. repolens_audit-0.1.0/tests/test_journal.py +121 -0
  258. repolens_audit-0.1.0/tests/test_last_llm.py +130 -0
  259. repolens_audit-0.1.0/tests/test_learning.py +63 -0
  260. repolens_audit-0.1.0/tests/test_llm_bedrock.py +125 -0
  261. repolens_audit-0.1.0/tests/test_llm_consistency.py +45 -0
  262. repolens_audit-0.1.0/tests/test_llm_gemini.py +100 -0
  263. repolens_audit-0.1.0/tests/test_llm_parse.py +218 -0
  264. repolens_audit-0.1.0/tests/test_llm_setup_prompt.py +15 -0
  265. repolens_audit-0.1.0/tests/test_llm_stream.py +120 -0
  266. repolens_audit-0.1.0/tests/test_llm_structured.py +111 -0
  267. repolens_audit-0.1.0/tests/test_llm_timeout.py +157 -0
  268. repolens_audit-0.1.0/tests/test_llm_vertex.py +93 -0
  269. repolens_audit-0.1.0/tests/test_local_queue.py +58 -0
  270. repolens_audit-0.1.0/tests/test_mcp_graph_tools.py +92 -0
  271. repolens_audit-0.1.0/tests/test_mega_file_filters.py +103 -0
  272. repolens_audit-0.1.0/tests/test_metis_roadmap_mvp.py +134 -0
  273. repolens_audit-0.1.0/tests/test_metrics.py +459 -0
  274. repolens_audit-0.1.0/tests/test_model_lock.py +379 -0
  275. repolens_audit-0.1.0/tests/test_near_clones.py +209 -0
  276. repolens_audit-0.1.0/tests/test_ollama_detect.py +77 -0
  277. repolens_audit-0.1.0/tests/test_pack_scope_options.py +38 -0
  278. repolens_audit-0.1.0/tests/test_packs.py +114 -0
  279. repolens_audit-0.1.0/tests/test_pass_cache.py +92 -0
  280. repolens_audit-0.1.0/tests/test_pipeline.py +69 -0
  281. repolens_audit-0.1.0/tests/test_pipeline_adaptive.py +213 -0
  282. repolens_audit-0.1.0/tests/test_pipeline_deep.py +343 -0
  283. repolens_audit-0.1.0/tests/test_pipeline_deep_resume.py +222 -0
  284. repolens_audit-0.1.0/tests/test_plugins.py +190 -0
  285. repolens_audit-0.1.0/tests/test_pr_summary.py +128 -0
  286. repolens_audit-0.1.0/tests/test_progress.py +109 -0
  287. repolens_audit-0.1.0/tests/test_project_store.py +104 -0
  288. repolens_audit-0.1.0/tests/test_prose.py +59 -0
  289. repolens_audit-0.1.0/tests/test_provider_aliases.py +90 -0
  290. repolens_audit-0.1.0/tests/test_provider_status.py +44 -0
  291. repolens_audit-0.1.0/tests/test_quality_metrics.py +63 -0
  292. repolens_audit-0.1.0/tests/test_quality_scorecard.py +119 -0
  293. repolens_audit-0.1.0/tests/test_report.py +468 -0
  294. repolens_audit-0.1.0/tests/test_report_parse.py +93 -0
  295. repolens_audit-0.1.0/tests/test_report_plan_ledger.py +399 -0
  296. repolens_audit-0.1.0/tests/test_review_state.py +41 -0
  297. repolens_audit-0.1.0/tests/test_role_packs.py +251 -0
  298. repolens_audit-0.1.0/tests/test_rules_registry.py +92 -0
  299. repolens_audit-0.1.0/tests/test_runtime_estimate.py +33 -0
  300. repolens_audit-0.1.0/tests/test_sarif.py +154 -0
  301. repolens_audit-0.1.0/tests/test_sarif_import.py +323 -0
  302. repolens_audit-0.1.0/tests/test_sca_metadata.py +73 -0
  303. repolens_audit-0.1.0/tests/test_sca_sbom.py +419 -0
  304. repolens_audit-0.1.0/tests/test_scanners.py +273 -0
  305. repolens_audit-0.1.0/tests/test_schema.py +71 -0
  306. repolens_audit-0.1.0/tests/test_sources.py +206 -0
  307. repolens_audit-0.1.0/tests/test_suppressions.py +191 -0
  308. repolens_audit-0.1.0/tests/test_suppressions_report.py +77 -0
  309. repolens_audit-0.1.0/tests/test_testing_inventory.py +63 -0
  310. repolens_audit-0.1.0/tests/test_testing_report.py +25 -0
  311. repolens_audit-0.1.0/tests/test_themes.py +221 -0
  312. repolens_audit-0.1.0/tests/test_triage.py +227 -0
  313. repolens_audit-0.1.0/tests/test_trivy_checkov.py +243 -0
  314. repolens_audit-0.1.0/tests/test_usage_hints.py +39 -0
  315. repolens_audit-0.1.0/tests/test_vacuous_floor.py +413 -0
  316. repolens_audit-0.1.0/tests/test_verify_findings.py +99 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RepoLens contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,313 @@
1
+ Metadata-Version: 2.4
2
+ Name: repolens-audit
3
+ Version: 0.1.0
4
+ Summary: Structured security and architecture reviews for any repository
5
+ Author: RepoLens contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 RepoLens contributors
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/vksvicky/RepoLens
29
+ Project-URL: Documentation, https://github.com/vksvicky/RepoLens/tree/main/docs
30
+ Project-URL: Repository, https://github.com/vksvicky/RepoLens
31
+ Project-URL: Issues, https://github.com/vksvicky/RepoLens/issues
32
+ Keywords: security,architecture,code-review,cli,audit
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Environment :: Console
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Programming Language :: Python :: 3.13
41
+ Classifier: Topic :: Security
42
+ Classifier: Topic :: Software Development :: Quality Assurance
43
+ Requires-Python: >=3.11
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: typer>=0.12
47
+ Requires-Dist: rich>=13.0
48
+ Requires-Dist: pydantic>=2.7
49
+ Requires-Dist: pydantic-settings>=2.3
50
+ Requires-Dist: httpx>=0.27
51
+ Requires-Dist: grimp<4,>=3.4
52
+ Requires-Dist: PyYAML>=6.0
53
+ Provides-Extra: dev
54
+ Requires-Dist: pytest>=8.0; extra == "dev"
55
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
56
+ Requires-Dist: ruff>=0.6; extra == "dev"
57
+ Requires-Dist: mypy>=1.11; extra == "dev"
58
+ Provides-Extra: scanners
59
+ Requires-Dist: semgrep<2,>=1.100; extra == "scanners"
60
+ Provides-Extra: local-ml
61
+ Requires-Dist: sentence-transformers<7,>=3.0; extra == "local-ml"
62
+ Provides-Extra: mcp
63
+ Requires-Dist: mcp<3,>=1.0; extra == "mcp"
64
+ Provides-Extra: architecture
65
+ Requires-Dist: PyYAML>=6.0; extra == "architecture"
66
+ Provides-Extra: vertex
67
+ Requires-Dist: google-auth>=2.0; extra == "vertex"
68
+ Provides-Extra: bedrock
69
+ Requires-Dist: botocore>=1.34; extra == "bedrock"
70
+ Dynamic: license-file
71
+
72
+ # RepoLens
73
+
74
+ **See into any repository—security, reliability, and architecture—before you ship.**
75
+
76
+ RepoLens is an open-source CLI that runs structured code reviews against projects you care about: on your machine, or cloned from GitHub, Bitbucket, Hugging Face, or any Git URL. It follows a clear **P1 → P2 → P3** pass (security → bugs/reliability/performance → architecture/quality) and writes audit-friendly reports with impact, remediation steps, and code-example fixes for Critical/High findings.
77
+
78
+ > **Status:** **`repolens-audit==0.1.0`** on PyPI (CLI: `repolens`) — Phases **0–9** complete
79
+ > Local CLI · remotes · optional scanners · explain + diagrams · GitHub Action · opt-in local learning · enterprise CI recipes
80
+ > Install: `pip install "repolens-audit[scanners]==0.1.0"` · from a clone: `pip install -e ".[dev]"`
81
+ > Docs: [phases](./docs/phases.md) · [FAQ](./docs/faq.md) · [rules](./docs/rules.md) · [install extras](./docs/install-extras.md) · [CI / Action](./docs/ci.md) · [remotes](./docs/remote-sources.md) · [scanners](./docs/scanners.md) · [local learning](./docs/local-learning.md) · [publishing](./docs/publishing.md)
82
+
83
+ ---
84
+
85
+ ## Why RepoLens?
86
+
87
+ | Need | How RepoLens helps |
88
+ |------|--------------------|
89
+ | Review **any** project, not one vendor’s stack | Local paths + Git remotes |
90
+ | Security without ignoring architecture | Full review + `sentinel` security-only mode |
91
+ | Actionable findings | Impact, fix plan, **code examples** on Critical/High |
92
+ | Shareable audits | Markdown reports (PDF via pandoc / Print) |
93
+ | Production honesty | Complements—does not replace—CI, tests, and scanners |
94
+ | Python **cyclicity ratchet** | Baseline + `repolens check --diff` for fast CI (Rule 1 — debt must not rise); see [FAQ](./docs/faq.md#cyclicity-ratchet-baseline-g2) |
95
+ | **Complexity + test inventory** | Fast Brain McCabe/cognitive (Python) + Top-10 table; test file/case counts; AI refactor capped at top-5 — [design](./docs/design/complexity-and-cognitive-ai.md) · [FAQ](./docs/faq.md#do-we-measure-complexity-and-test-coverage) |
96
+
97
+ RepoLens is **zero-infrastructure** — `pipx` or ephemeral CI runners; no SonarQube server and no PR-review SaaS. Built for **M&A auditors**, **fractional CTOs**, and **pre-release platform gates** who need portable dual-review evidence. See [competitive landscape 2026](./docs/design/competitive-landscape-sonar-alternatives-2026.md).
98
+
99
+ RepoLens is **not** a replacement for Semgrep, CodeQL, Dependabot, Snyk, or your test suite. Those stay in CI. RepoLens adds a consistent, human-readable due-diligence layer you can run anywhere.
100
+
101
+ ---
102
+
103
+ ## Modes
104
+
105
+ | Command | What it does |
106
+ |---------|--------------|
107
+ | `repolens review` | Full dual review: P1 security + P2 reliability + P3 architecture |
108
+ | `repolens sentinel` | **Security-only** scan (P1 playbook) |
109
+ | `repolens architecture` | Architecture / production-readiness audit |
110
+ | `repolens plugins` | Optional scanners: `status` / `list` / `install` |
111
+ | `repolens learn` | Opt-in local index: `build` / `status` / `clear` |
112
+ | `repolens init` | Write user config (cloud key, Ollama, or none) |
113
+ | `repolens explain` | Deep-dive one finding by ID (solutions + diagram) |
114
+ | `repolens export` | Export / convert a report (e.g. Markdown → PDF via pandoc) |
115
+ | `repolens version` | Print package version |
116
+ | `repolens baseline` | Snapshot import-graph cyclicity (`.repolens/baseline.json`) |
117
+ | `repolens check --diff` | Rule 1 ratchet gate for CI / pre-commit |
118
+
119
+ **What gets checked?** See **[docs/rules.md](./docs/rules.md)** — plain guide to rules, why they exist, and how to turn them on/off.
120
+
121
+ ---
122
+
123
+ ## Languages & tools
124
+
125
+ - **CLI:** Python 3.11+
126
+ - **Reviews:** language-agnostic, with first-class focus on JS/TS, Python, Go, JVM, C#, Ruby, PHP, Rust, Swift (+ IaC/config)
127
+ - **AI:** Bring your own cloud key (Anthropic, OpenAI, DeepSeek), run a local model (e.g. Ollama), or rely on automatic local fallback (`--fallback`)
128
+ - **CVE / SAST / secrets:** optional plugins (OSV, Semgrep, gitleaks)—not in the slim default install
129
+ - **Local learning:** opt-in on-disk FTS index (`repolens learn`), informed consent first
130
+ - **CI:** official GitHub Action (`action.yml`) — see [docs/ci.md](./docs/ci.md)
131
+
132
+ Full answers: **[docs/faq.md](./docs/faq.md)** · **[docs/design/ai-keys-scanners-and-local-learning.md](./docs/design/ai-keys-scanners-and-local-learning.md)**.
133
+ **Setup (cloud / Ollama / scanners):** **[docs/setup-ai-and-scanners.md](./docs/setup-ai-and-scanners.md)**.
134
+ **Try it (local + GitHub / Bitbucket / HF / git URL):** **[docs/try-on-your-repo.md](./docs/try-on-your-repo.md)**.
135
+ Interactive helper: `./scripts/repolens-guided.sh` (see [try-on-your-repo](docs/try-on-your-repo.md#guided-review-interactive)).
136
+
137
+ ---
138
+
139
+ ## Quick start
140
+
141
+ ```bash
142
+ # Preferred: PyPI (CLI entry point is still `repolens`)
143
+ pip install "repolens-audit[scanners]==0.1.0"
144
+
145
+ # From a clone (contributors / dogfood)
146
+ python3 -m venv .venv
147
+ source .venv/bin/activate
148
+ pip install -e ".[dev]"
149
+ ```
150
+
151
+ ### Install extras (`[dev]`, `[scanners]`, …)
152
+
153
+ These are **optional parts of the RepoLens package** (defined in this repo’s [`pyproject.toml`](./pyproject.toml)). They are **not** settings inside the apps you review.
154
+
155
+ | Extra | Command | What you get |
156
+ |-------|---------|--------------|
157
+ | *(none)* | `pip install -e .` | CLI only |
158
+ | **dev** | `pip install -e ".[dev]"` | + pytest, pytest-cov, ruff, mypy |
159
+ | **scanners** | `pip install -e ".[scanners]"` | + Semgrep (gitleaks/osv still via `repolens plugins install`) |
160
+ | **local-ml** | `pip install -e ".[local-ml]"` | + sentence-transformers |
161
+
162
+ Full detail: **[docs/install-extras.md](./docs/install-extras.md)**.
163
+
164
+ ```bash
165
+ # From a clone
166
+ python3 -m venv .venv
167
+ source .venv/bin/activate
168
+ pip install -e ".[dev]"
169
+
170
+ # First-run: cloud key, local Ollama, or none
171
+ # Ollama: uses a model from `ollama list` (or pass --model NAME)
172
+ repolens init --provider ollama # or openai | anthropic | deepseek | none
173
+
174
+ # Inventory + report skeleton (no model call)
175
+ repolens review --path ./my-app --dry-run
176
+
177
+ # Optional scanners (secrets / SAST / CVE)
178
+ repolens plugins install all
179
+ repolens review --path ./my-app --scanners-only
180
+
181
+ # Opt-in local learning (stays on disk)
182
+ repolens learn build --path ./my-app --accept-local-learning
183
+
184
+ # Full local review (requires configured provider + key/Ollama)
185
+ # Progress lines + LLM heartbeats by default; add -v for more detail
186
+ # Deep coverage (multi-pass + heuristics) is on by default; use --no-deep for single-shot
187
+ repolens review --path ./my-app --verbose
188
+ # After first run: warm packs + recommended timeout
189
+ repolens adaptive status --path ./my-app
190
+ repolens sentinel --path ./my-app
191
+ ```
192
+
193
+ ### Sources (local + remotes)
194
+
195
+ ```bash
196
+ # Local folder
197
+ repolens review --path ./my-app --dry-run
198
+
199
+ # GitHub / Bitbucket / Hugging Face / any git URL
200
+ repolens review --github owner/repo --ref main --dry-run
201
+ repolens review --bitbucket workspace/repo --ref main --dry-run
202
+ repolens review --hf org/model --dry-run
203
+ repolens review --hf datasets/org/dataset-name --dry-run
204
+ repolens review --git-url https://github.com/owner/repo.git --ref main --dry-run
205
+ ```
206
+
207
+ Private remotes: `GITHUB_TOKEN` / `BITBUCKET_TOKEN` / `HF_TOKEN` (or `gh auth login`).
208
+ Full examples: [docs/try-on-your-repo.md](./docs/try-on-your-repo.md) · [docs/remote-sources.md](./docs/remote-sources.md) · [docs/scanners.md](./docs/scanners.md).
209
+
210
+ ### GitHub Actions
211
+
212
+ ```yaml
213
+ - uses: actions/checkout@v4
214
+ - uses: vksvicky/RepoLens@main
215
+ with:
216
+ path: .
217
+ run: auto # scanners always; LLM if API key secret is set
218
+ # or: run: dry-run
219
+ env:
220
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # optional
221
+ ```
222
+
223
+ Details: [docs/ci.md](./docs/ci.md).
224
+
225
+ Playbooks also work with any LLM chat: [docs/using-playbooks.md](./docs/using-playbooks.md).
226
+
227
+ ---
228
+
229
+ ## Reports
230
+
231
+ ### In the terminal
232
+ Summaries show **confidence %**, severity counts, and top findings.
233
+
234
+ ### Saved Markdown (default artifact)
235
+ ```text
236
+ reports/gate_review_report_{mode}_YYYY-MM-DD_HHMM.md
237
+ ```
238
+ `mode` is `review`, `sentinel`, or `architecture`. Each Critical/High finding includes explanation, **impact**, recommended fix, and a **code example**. Reports include an **Automated scanners** section when scanners run.
239
+
240
+ ### PDF
241
+ ```bash
242
+ pandoc reports/gate_review_report_review_YYYY-MM-DD_HHMM.md -o reports/gate_review_report_review_YYYY-MM-DD_HHMM.pdf
243
+ # or: Print → Save as PDF from a Markdown preview
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Playbooks & rules
249
+
250
+ | Playbook | File |
251
+ |----------|------|
252
+ | Security (P1 / `sentinel`) | [playbooks/security.md](./playbooks/security.md) |
253
+ | Architecture (release / full audit) | [playbooks/architecture.md](./playbooks/architecture.md) |
254
+
255
+ **Rules** (what is checked, why, enable/disable): **[docs/rules.md](./docs/rules.md)**.
256
+ Playbook files: [playbooks/README.md](./playbooks/README.md). Contributions: [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md).
257
+
258
+ ---
259
+
260
+ ## Repository layout
261
+
262
+ ```text
263
+ RepoLens/
264
+ ├── README.md # This page
265
+ ├── LICENSE # MIT
266
+ ├── action.yml # GitHub Action (composite)
267
+ ├── pyproject.toml # Python package
268
+ ├── src/repolens/ # CLI, pipeline, scanners, learning
269
+ ├── tests/ # pytest suite
270
+ ├── playbooks/ # Review instruction sources
271
+ ├── examples/monorepo/ # Sample project config
272
+ ├── docs/ # Guides, FAQ, ADR, design, phases
273
+ └── .github/workflows/ # CI, publish, Action example
274
+ ```
275
+
276
+ Naming conventions: [docs/README.md](./docs/README.md#naming-pattern).
277
+
278
+ ---
279
+
280
+ ## Roadmap
281
+
282
+ | Phase | Scope | Status |
283
+ |-------|--------|--------|
284
+ | **0** | Docs, playbooks, design | Done |
285
+ | **1** | Core CLI (local path, reports, BYOK / Ollama) | Done (alpha) |
286
+ | **2** | Remotes (`--git-url`, `--github`, `--bitbucket`, `--hf`) | Done |
287
+ | **3** | Optional scanners (gitleaks, Semgrep, OSV) | Done |
288
+ | **4** | GitHub Action, PyPI publish path, local learning | Done |
289
+ | **Next** | Harden publish / marketplace polish / richer embeddings | Open |
290
+
291
+ Tracker: **[docs/phases.md](./docs/phases.md)** · Design: **[docs/design/](./docs/design/)** · ADR: **[docs/adr/01_analysis_runtime_architecture.md](./docs/adr/01_analysis_runtime_architecture.md)**.
292
+
293
+ ---
294
+
295
+ ## Contributing
296
+
297
+ - [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md)
298
+ - [docs/CODE_OF_CONDUCT.md](./docs/CODE_OF_CONDUCT.md)
299
+ - [docs/SECURITY.md](./docs/SECURITY.md) for vulnerability reports
300
+ - [docs/SUPPORT.md](./docs/SUPPORT.md)
301
+ - Feedback (teaching / shipping): [Discussions](https://github.com/vksvicky/RepoLens/discussions) · Bugs & features: [issue templates](https://github.com/vksvicky/RepoLens/issues/new/choose)
302
+
303
+ ---
304
+
305
+ ## Disclaimer (AI / LLM output)
306
+
307
+ RepoLens findings and suggestions may be produced or assisted by AI/LLMs, heuristics, and optional scanners. They can be wrong or incomplete. **You** are responsible for verifying results before you act. Authors accept **no liability** for harm from reliance on AI/LLM or tool-assisted output. Reports are not a certification or professional audit engagement. Full text appears in every Markdown report under **Disclaimer**, and in the [FAQ](./docs/faq.md#disclaimer-ai--llm-output).
308
+
309
+ ---
310
+
311
+ ## License
312
+
313
+ [MIT](./LICENSE) — use it, fork it, adapt the playbooks for your org. Software is provided **as is** (see the licence).
@@ -0,0 +1,242 @@
1
+ # RepoLens
2
+
3
+ **See into any repository—security, reliability, and architecture—before you ship.**
4
+
5
+ RepoLens is an open-source CLI that runs structured code reviews against projects you care about: on your machine, or cloned from GitHub, Bitbucket, Hugging Face, or any Git URL. It follows a clear **P1 → P2 → P3** pass (security → bugs/reliability/performance → architecture/quality) and writes audit-friendly reports with impact, remediation steps, and code-example fixes for Critical/High findings.
6
+
7
+ > **Status:** **`repolens-audit==0.1.0`** on PyPI (CLI: `repolens`) — Phases **0–9** complete
8
+ > Local CLI · remotes · optional scanners · explain + diagrams · GitHub Action · opt-in local learning · enterprise CI recipes
9
+ > Install: `pip install "repolens-audit[scanners]==0.1.0"` · from a clone: `pip install -e ".[dev]"`
10
+ > Docs: [phases](./docs/phases.md) · [FAQ](./docs/faq.md) · [rules](./docs/rules.md) · [install extras](./docs/install-extras.md) · [CI / Action](./docs/ci.md) · [remotes](./docs/remote-sources.md) · [scanners](./docs/scanners.md) · [local learning](./docs/local-learning.md) · [publishing](./docs/publishing.md)
11
+
12
+ ---
13
+
14
+ ## Why RepoLens?
15
+
16
+ | Need | How RepoLens helps |
17
+ |------|--------------------|
18
+ | Review **any** project, not one vendor’s stack | Local paths + Git remotes |
19
+ | Security without ignoring architecture | Full review + `sentinel` security-only mode |
20
+ | Actionable findings | Impact, fix plan, **code examples** on Critical/High |
21
+ | Shareable audits | Markdown reports (PDF via pandoc / Print) |
22
+ | Production honesty | Complements—does not replace—CI, tests, and scanners |
23
+ | Python **cyclicity ratchet** | Baseline + `repolens check --diff` for fast CI (Rule 1 — debt must not rise); see [FAQ](./docs/faq.md#cyclicity-ratchet-baseline-g2) |
24
+ | **Complexity + test inventory** | Fast Brain McCabe/cognitive (Python) + Top-10 table; test file/case counts; AI refactor capped at top-5 — [design](./docs/design/complexity-and-cognitive-ai.md) · [FAQ](./docs/faq.md#do-we-measure-complexity-and-test-coverage) |
25
+
26
+ RepoLens is **zero-infrastructure** — `pipx` or ephemeral CI runners; no SonarQube server and no PR-review SaaS. Built for **M&A auditors**, **fractional CTOs**, and **pre-release platform gates** who need portable dual-review evidence. See [competitive landscape 2026](./docs/design/competitive-landscape-sonar-alternatives-2026.md).
27
+
28
+ RepoLens is **not** a replacement for Semgrep, CodeQL, Dependabot, Snyk, or your test suite. Those stay in CI. RepoLens adds a consistent, human-readable due-diligence layer you can run anywhere.
29
+
30
+ ---
31
+
32
+ ## Modes
33
+
34
+ | Command | What it does |
35
+ |---------|--------------|
36
+ | `repolens review` | Full dual review: P1 security + P2 reliability + P3 architecture |
37
+ | `repolens sentinel` | **Security-only** scan (P1 playbook) |
38
+ | `repolens architecture` | Architecture / production-readiness audit |
39
+ | `repolens plugins` | Optional scanners: `status` / `list` / `install` |
40
+ | `repolens learn` | Opt-in local index: `build` / `status` / `clear` |
41
+ | `repolens init` | Write user config (cloud key, Ollama, or none) |
42
+ | `repolens explain` | Deep-dive one finding by ID (solutions + diagram) |
43
+ | `repolens export` | Export / convert a report (e.g. Markdown → PDF via pandoc) |
44
+ | `repolens version` | Print package version |
45
+ | `repolens baseline` | Snapshot import-graph cyclicity (`.repolens/baseline.json`) |
46
+ | `repolens check --diff` | Rule 1 ratchet gate for CI / pre-commit |
47
+
48
+ **What gets checked?** See **[docs/rules.md](./docs/rules.md)** — plain guide to rules, why they exist, and how to turn them on/off.
49
+
50
+ ---
51
+
52
+ ## Languages & tools
53
+
54
+ - **CLI:** Python 3.11+
55
+ - **Reviews:** language-agnostic, with first-class focus on JS/TS, Python, Go, JVM, C#, Ruby, PHP, Rust, Swift (+ IaC/config)
56
+ - **AI:** Bring your own cloud key (Anthropic, OpenAI, DeepSeek), run a local model (e.g. Ollama), or rely on automatic local fallback (`--fallback`)
57
+ - **CVE / SAST / secrets:** optional plugins (OSV, Semgrep, gitleaks)—not in the slim default install
58
+ - **Local learning:** opt-in on-disk FTS index (`repolens learn`), informed consent first
59
+ - **CI:** official GitHub Action (`action.yml`) — see [docs/ci.md](./docs/ci.md)
60
+
61
+ Full answers: **[docs/faq.md](./docs/faq.md)** · **[docs/design/ai-keys-scanners-and-local-learning.md](./docs/design/ai-keys-scanners-and-local-learning.md)**.
62
+ **Setup (cloud / Ollama / scanners):** **[docs/setup-ai-and-scanners.md](./docs/setup-ai-and-scanners.md)**.
63
+ **Try it (local + GitHub / Bitbucket / HF / git URL):** **[docs/try-on-your-repo.md](./docs/try-on-your-repo.md)**.
64
+ Interactive helper: `./scripts/repolens-guided.sh` (see [try-on-your-repo](docs/try-on-your-repo.md#guided-review-interactive)).
65
+
66
+ ---
67
+
68
+ ## Quick start
69
+
70
+ ```bash
71
+ # Preferred: PyPI (CLI entry point is still `repolens`)
72
+ pip install "repolens-audit[scanners]==0.1.0"
73
+
74
+ # From a clone (contributors / dogfood)
75
+ python3 -m venv .venv
76
+ source .venv/bin/activate
77
+ pip install -e ".[dev]"
78
+ ```
79
+
80
+ ### Install extras (`[dev]`, `[scanners]`, …)
81
+
82
+ These are **optional parts of the RepoLens package** (defined in this repo’s [`pyproject.toml`](./pyproject.toml)). They are **not** settings inside the apps you review.
83
+
84
+ | Extra | Command | What you get |
85
+ |-------|---------|--------------|
86
+ | *(none)* | `pip install -e .` | CLI only |
87
+ | **dev** | `pip install -e ".[dev]"` | + pytest, pytest-cov, ruff, mypy |
88
+ | **scanners** | `pip install -e ".[scanners]"` | + Semgrep (gitleaks/osv still via `repolens plugins install`) |
89
+ | **local-ml** | `pip install -e ".[local-ml]"` | + sentence-transformers |
90
+
91
+ Full detail: **[docs/install-extras.md](./docs/install-extras.md)**.
92
+
93
+ ```bash
94
+ # From a clone
95
+ python3 -m venv .venv
96
+ source .venv/bin/activate
97
+ pip install -e ".[dev]"
98
+
99
+ # First-run: cloud key, local Ollama, or none
100
+ # Ollama: uses a model from `ollama list` (or pass --model NAME)
101
+ repolens init --provider ollama # or openai | anthropic | deepseek | none
102
+
103
+ # Inventory + report skeleton (no model call)
104
+ repolens review --path ./my-app --dry-run
105
+
106
+ # Optional scanners (secrets / SAST / CVE)
107
+ repolens plugins install all
108
+ repolens review --path ./my-app --scanners-only
109
+
110
+ # Opt-in local learning (stays on disk)
111
+ repolens learn build --path ./my-app --accept-local-learning
112
+
113
+ # Full local review (requires configured provider + key/Ollama)
114
+ # Progress lines + LLM heartbeats by default; add -v for more detail
115
+ # Deep coverage (multi-pass + heuristics) is on by default; use --no-deep for single-shot
116
+ repolens review --path ./my-app --verbose
117
+ # After first run: warm packs + recommended timeout
118
+ repolens adaptive status --path ./my-app
119
+ repolens sentinel --path ./my-app
120
+ ```
121
+
122
+ ### Sources (local + remotes)
123
+
124
+ ```bash
125
+ # Local folder
126
+ repolens review --path ./my-app --dry-run
127
+
128
+ # GitHub / Bitbucket / Hugging Face / any git URL
129
+ repolens review --github owner/repo --ref main --dry-run
130
+ repolens review --bitbucket workspace/repo --ref main --dry-run
131
+ repolens review --hf org/model --dry-run
132
+ repolens review --hf datasets/org/dataset-name --dry-run
133
+ repolens review --git-url https://github.com/owner/repo.git --ref main --dry-run
134
+ ```
135
+
136
+ Private remotes: `GITHUB_TOKEN` / `BITBUCKET_TOKEN` / `HF_TOKEN` (or `gh auth login`).
137
+ Full examples: [docs/try-on-your-repo.md](./docs/try-on-your-repo.md) · [docs/remote-sources.md](./docs/remote-sources.md) · [docs/scanners.md](./docs/scanners.md).
138
+
139
+ ### GitHub Actions
140
+
141
+ ```yaml
142
+ - uses: actions/checkout@v4
143
+ - uses: vksvicky/RepoLens@main
144
+ with:
145
+ path: .
146
+ run: auto # scanners always; LLM if API key secret is set
147
+ # or: run: dry-run
148
+ env:
149
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # optional
150
+ ```
151
+
152
+ Details: [docs/ci.md](./docs/ci.md).
153
+
154
+ Playbooks also work with any LLM chat: [docs/using-playbooks.md](./docs/using-playbooks.md).
155
+
156
+ ---
157
+
158
+ ## Reports
159
+
160
+ ### In the terminal
161
+ Summaries show **confidence %**, severity counts, and top findings.
162
+
163
+ ### Saved Markdown (default artifact)
164
+ ```text
165
+ reports/gate_review_report_{mode}_YYYY-MM-DD_HHMM.md
166
+ ```
167
+ `mode` is `review`, `sentinel`, or `architecture`. Each Critical/High finding includes explanation, **impact**, recommended fix, and a **code example**. Reports include an **Automated scanners** section when scanners run.
168
+
169
+ ### PDF
170
+ ```bash
171
+ pandoc reports/gate_review_report_review_YYYY-MM-DD_HHMM.md -o reports/gate_review_report_review_YYYY-MM-DD_HHMM.pdf
172
+ # or: Print → Save as PDF from a Markdown preview
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Playbooks & rules
178
+
179
+ | Playbook | File |
180
+ |----------|------|
181
+ | Security (P1 / `sentinel`) | [playbooks/security.md](./playbooks/security.md) |
182
+ | Architecture (release / full audit) | [playbooks/architecture.md](./playbooks/architecture.md) |
183
+
184
+ **Rules** (what is checked, why, enable/disable): **[docs/rules.md](./docs/rules.md)**.
185
+ Playbook files: [playbooks/README.md](./playbooks/README.md). Contributions: [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md).
186
+
187
+ ---
188
+
189
+ ## Repository layout
190
+
191
+ ```text
192
+ RepoLens/
193
+ ├── README.md # This page
194
+ ├── LICENSE # MIT
195
+ ├── action.yml # GitHub Action (composite)
196
+ ├── pyproject.toml # Python package
197
+ ├── src/repolens/ # CLI, pipeline, scanners, learning
198
+ ├── tests/ # pytest suite
199
+ ├── playbooks/ # Review instruction sources
200
+ ├── examples/monorepo/ # Sample project config
201
+ ├── docs/ # Guides, FAQ, ADR, design, phases
202
+ └── .github/workflows/ # CI, publish, Action example
203
+ ```
204
+
205
+ Naming conventions: [docs/README.md](./docs/README.md#naming-pattern).
206
+
207
+ ---
208
+
209
+ ## Roadmap
210
+
211
+ | Phase | Scope | Status |
212
+ |-------|--------|--------|
213
+ | **0** | Docs, playbooks, design | Done |
214
+ | **1** | Core CLI (local path, reports, BYOK / Ollama) | Done (alpha) |
215
+ | **2** | Remotes (`--git-url`, `--github`, `--bitbucket`, `--hf`) | Done |
216
+ | **3** | Optional scanners (gitleaks, Semgrep, OSV) | Done |
217
+ | **4** | GitHub Action, PyPI publish path, local learning | Done |
218
+ | **Next** | Harden publish / marketplace polish / richer embeddings | Open |
219
+
220
+ Tracker: **[docs/phases.md](./docs/phases.md)** · Design: **[docs/design/](./docs/design/)** · ADR: **[docs/adr/01_analysis_runtime_architecture.md](./docs/adr/01_analysis_runtime_architecture.md)**.
221
+
222
+ ---
223
+
224
+ ## Contributing
225
+
226
+ - [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md)
227
+ - [docs/CODE_OF_CONDUCT.md](./docs/CODE_OF_CONDUCT.md)
228
+ - [docs/SECURITY.md](./docs/SECURITY.md) for vulnerability reports
229
+ - [docs/SUPPORT.md](./docs/SUPPORT.md)
230
+ - Feedback (teaching / shipping): [Discussions](https://github.com/vksvicky/RepoLens/discussions) · Bugs & features: [issue templates](https://github.com/vksvicky/RepoLens/issues/new/choose)
231
+
232
+ ---
233
+
234
+ ## Disclaimer (AI / LLM output)
235
+
236
+ RepoLens findings and suggestions may be produced or assisted by AI/LLMs, heuristics, and optional scanners. They can be wrong or incomplete. **You** are responsible for verifying results before you act. Authors accept **no liability** for harm from reliance on AI/LLM or tool-assisted output. Reports are not a certification or professional audit engagement. Full text appears in every Markdown report under **Disclaimer**, and in the [FAQ](./docs/faq.md#disclaimer-ai--llm-output).
237
+
238
+ ---
239
+
240
+ ## License
241
+
242
+ [MIT](./LICENSE) — use it, fork it, adapt the playbooks for your org. Software is provided **as is** (see the licence).
@@ -0,0 +1,102 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "repolens-audit"
7
+ version = "0.1.0"
8
+ description = "Structured security and architecture reviews for any repository"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.11"
12
+ authors = [{ name = "RepoLens contributors" }]
13
+ keywords = ["security", "architecture", "code-review", "cli", "audit"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Security",
24
+ "Topic :: Software Development :: Quality Assurance",
25
+ ]
26
+ dependencies = [
27
+ "typer>=0.12",
28
+ "rich>=13.0",
29
+ "pydantic>=2.7",
30
+ "pydantic-settings>=2.3",
31
+ "httpx>=0.27",
32
+ "grimp>=3.4,<4",
33
+ "PyYAML>=6.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.0",
39
+ "pytest-cov>=5.0",
40
+ "ruff>=0.6",
41
+ "mypy>=1.11",
42
+ ]
43
+ # Meta extra: Semgrep via pip; also run `repolens plugins install` for gitleaks/osv binaries.
44
+ scanners = [
45
+ "semgrep>=1.100,<2",
46
+ ]
47
+ local-ml = [
48
+ "sentence-transformers>=3.0,<7",
49
+ ]
50
+ mcp = [
51
+ "mcp>=1.0,<3",
52
+ ]
53
+ architecture = [
54
+ "PyYAML>=6.0",
55
+ ]
56
+ vertex = [
57
+ "google-auth>=2.0",
58
+ ]
59
+ bedrock = [
60
+ "botocore>=1.34",
61
+ ]
62
+
63
+ [project.scripts]
64
+ repolens = "repolens.cli:run"
65
+ repolens-mcp = "repolens.mcp.server:main"
66
+
67
+ [project.urls]
68
+ Homepage = "https://github.com/vksvicky/RepoLens"
69
+ Documentation = "https://github.com/vksvicky/RepoLens/tree/main/docs"
70
+ Repository = "https://github.com/vksvicky/RepoLens"
71
+ Issues = "https://github.com/vksvicky/RepoLens/issues"
72
+
73
+ [tool.setuptools.packages.find]
74
+ where = ["src"]
75
+
76
+ [tool.setuptools.package-data]
77
+ repolens = [
78
+ "playbooks/*.md",
79
+ "rules/defaults/*.md",
80
+ "rules/defaults/*.json",
81
+ "packs/**/*.md",
82
+ "architecture/schemas/*.json",
83
+ "py.typed",
84
+ ]
85
+
86
+ [tool.pytest.ini_options]
87
+ testpaths = ["tests"]
88
+ pythonpath = ["src"]
89
+
90
+ [tool.ruff]
91
+ line-length = 100
92
+ target-version = "py311"
93
+
94
+ [tool.ruff.lint]
95
+ select = ["E", "F", "I", "UP", "B"]
96
+ ignore = ["B008"] # Typer Option/Argument defaults are intentional
97
+
98
+ [tool.mypy]
99
+ python_version = "3.11"
100
+ strict = true
101
+ packages = ["repolens"]
102
+ mypy_path = "src"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+