gitpr-cli 1.3.0__tar.gz → 1.4.1__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 (232) hide show
  1. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/PKG-INFO +87 -4
  2. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/README.md +85 -3
  3. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/PKG-INFO +87 -4
  4. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/SOURCES.txt +71 -0
  5. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/requires.txt +1 -0
  6. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/pyproject.toml +9 -1
  7. gitpr_cli-1.4.1/src/application/use_cases/activate_policy_pack.py +122 -0
  8. gitpr_cli-1.4.1/src/application/use_cases/baseline_gate.py +415 -0
  9. gitpr_cli-1.4.1/src/application/use_cases/baseline_summary.py +259 -0
  10. gitpr_cli-1.4.1/src/application/use_cases/calculate_risk.py +309 -0
  11. gitpr_cli-1.4.1/src/application/use_cases/compare_against_baseline.py +41 -0
  12. gitpr_cli-1.4.1/src/application/use_cases/create_baseline.py +709 -0
  13. gitpr_cli-1.4.1/src/application/use_cases/generate_mentor_explanation.py +279 -0
  14. gitpr_cli-1.4.1/src/application/use_cases/install_policy_pack.py +71 -0
  15. gitpr_cli-1.4.1/src/application/use_cases/publish_pull_request.py +270 -0
  16. gitpr_cli-1.4.1/src/application/use_cases/resolve_effective_policy.py +208 -0
  17. gitpr_cli-1.4.1/src/application/use_cases/run_check.py +446 -0
  18. gitpr_cli-1.4.1/src/application/use_cases/suppress_finding.py +483 -0
  19. gitpr_cli-1.4.1/src/application/use_cases/validate_policy_pack.py +263 -0
  20. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/commit_classifier.py +45 -0
  21. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/config.py +298 -3
  22. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/config_schema.py +117 -0
  23. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/core.py +104 -8
  24. gitpr_cli-1.4.1/src/domain/baseline/__init__.py +143 -0
  25. gitpr_cli-1.4.1/src/domain/baseline/baseline_comparator.py +268 -0
  26. gitpr_cli-1.4.1/src/domain/baseline/baseline_fingerprint.py +103 -0
  27. gitpr_cli-1.4.1/src/domain/baseline/baseline_manifest.py +291 -0
  28. gitpr_cli-1.4.1/src/domain/baseline/baseline_types.py +289 -0
  29. gitpr_cli-1.4.1/src/domain/baseline/suppression_policy.py +661 -0
  30. gitpr_cli-1.4.1/src/domain/check/__init__.py +31 -0
  31. gitpr_cli-1.4.1/src/domain/check/check_config.py +122 -0
  32. gitpr_cli-1.4.1/src/domain/check/check_output.py +112 -0
  33. gitpr_cli-1.4.1/src/domain/check/check_types.py +165 -0
  34. gitpr_cli-1.4.1/src/domain/finding/__init__.py +5 -0
  35. gitpr_cli-1.4.1/src/domain/finding/finding_types.py +25 -0
  36. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/linter/sast_finding_mapper.py +5 -1
  37. gitpr_cli-1.4.1/src/domain/mentor/__init__.py +15 -0
  38. gitpr_cli-1.4.1/src/domain/mentor/mentor_explanation_builder.py +228 -0
  39. gitpr_cli-1.4.1/src/domain/policy/__init__.py +116 -0
  40. gitpr_cli-1.4.1/src/domain/policy/policy_checksum.py +60 -0
  41. gitpr_cli-1.4.1/src/domain/policy/policy_compatibility.py +210 -0
  42. gitpr_cli-1.4.1/src/domain/policy/policy_manifest.py +694 -0
  43. gitpr_cli-1.4.1/src/domain/policy/policy_resolver.py +706 -0
  44. gitpr_cli-1.4.1/src/domain/policy/policy_types.py +237 -0
  45. gitpr_cli-1.4.1/src/domain/risk/__init__.py +18 -0
  46. gitpr_cli-1.4.1/src/domain/risk/risk_calculator.py +144 -0
  47. gitpr_cli-1.4.1/src/domain/risk/risk_explanation.py +78 -0
  48. gitpr_cli-1.4.1/src/domain/risk/risk_rules.py +261 -0
  49. gitpr_cli-1.4.1/src/domain/risk/risk_types.py +113 -0
  50. gitpr_cli-1.4.1/src/infrastructure/baseline/__init__.py +28 -0
  51. gitpr_cli-1.4.1/src/infrastructure/baseline/local_baseline_repository.py +355 -0
  52. gitpr_cli-1.4.1/src/infrastructure/ci/__init__.py +11 -0
  53. gitpr_cli-1.4.1/src/infrastructure/ci/junit_builder.py +102 -0
  54. gitpr_cli-1.4.1/src/infrastructure/ci/masking.py +65 -0
  55. gitpr_cli-1.4.1/src/infrastructure/ci/sarif_builder.py +152 -0
  56. gitpr_cli-1.4.1/src/infrastructure/git/identity.py +155 -0
  57. gitpr_cli-1.4.1/src/infrastructure/git/risk_history_reader.py +93 -0
  58. gitpr_cli-1.4.1/src/infrastructure/git/test_matcher.py +78 -0
  59. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/linter/external/__init__.py +1 -1
  60. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/linter/external/bandit_bridge.py +1 -1
  61. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/linter/external/base_bridge.py +3 -13
  62. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/linter/external/gitleaks_bridge.py +1 -1
  63. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/linter/external/semgrep_bridge.py +1 -1
  64. gitpr_cli-1.4.1/src/infrastructure/policy/__init__.py +45 -0
  65. gitpr_cli-1.4.1/src/infrastructure/policy/local_policy_repository.py +142 -0
  66. gitpr_cli-1.4.1/src/infrastructure/policy/policy_pack_loader.py +240 -0
  67. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/azure_devops_provider.py +73 -10
  68. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/base.py +90 -4
  69. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/bitbucket_provider.py +76 -9
  70. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/github_provider.py +77 -19
  71. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/gitlab_provider.py +62 -9
  72. gitpr_cli-1.4.1/src/ledger.py +1124 -0
  73. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/linter_engine.py +192 -8
  74. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/main.py +2682 -184
  75. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/mcp_server.py +497 -5
  76. gitpr_cli-1.4.1/src/metrics.py +1105 -0
  77. gitpr_cli-1.4.1/src/policy_packs/laravel-quality/CHANGELOG.md +25 -0
  78. gitpr_cli-1.4.1/src/policy_packs/laravel-quality/README.md +41 -0
  79. gitpr_cli-1.4.1/src/policy_packs/laravel-quality/linter.yml +61 -0
  80. gitpr_cli-1.4.1/src/policy_packs/laravel-quality/policy.yml +110 -0
  81. gitpr_cli-1.4.1/src/policy_packs/node-quality/README.md +27 -0
  82. gitpr_cli-1.4.1/src/policy_packs/node-quality/linter.yml +57 -0
  83. gitpr_cli-1.4.1/src/policy_packs/node-quality/policy.yml +82 -0
  84. gitpr_cli-1.4.1/src/policy_packs/php-security/README.md +33 -0
  85. gitpr_cli-1.4.1/src/policy_packs/php-security/linter.yml +69 -0
  86. gitpr_cli-1.4.1/src/policy_packs/php-security/policy.yml +75 -0
  87. gitpr_cli-1.4.1/src/policy_packs/vue-quality/README.md +29 -0
  88. gitpr_cli-1.4.1/src/policy_packs/vue-quality/linter.yml +50 -0
  89. gitpr_cli-1.4.1/src/policy_packs/vue-quality/policy.yml +78 -0
  90. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/release_engine.py +65 -1
  91. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/review/remote_pr.py +33 -2
  92. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/review/render.py +18 -10
  93. gitpr_cli-1.4.1/src/ui/metrics_app.py +456 -0
  94. gitpr_cli-1.4.1/src/ui/metrics_migration_app.py +173 -0
  95. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/pr_publish_app.py +58 -8
  96. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/updater.py +3 -3
  97. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/usage_log.py +13 -61
  98. gitpr_cli-1.4.1/tests/test_baseline_cli.py +946 -0
  99. gitpr_cli-1.4.1/tests/test_check_cli.py +118 -0
  100. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_commit_classifier.py +49 -1
  101. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_app.py +15 -0
  102. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_external_linters.py +6 -5
  103. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_mcp_server.py +314 -5
  104. gitpr_cli-1.4.1/tests/test_mentor_cli.py +101 -0
  105. gitpr_cli-1.4.1/tests/test_metrics.py +2205 -0
  106. gitpr_cli-1.4.1/tests/test_policy_cli.py +384 -0
  107. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_pr_publish_app.py +242 -0
  108. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_release_engine.py +152 -0
  109. gitpr_cli-1.4.1/tests/test_risk_cli.py +108 -0
  110. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_skill_context.py +23 -0
  111. gitpr_cli-1.4.1/tests/test_skill_templates.py +36 -0
  112. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_usage_log.py +3 -2
  113. gitpr_cli-1.3.0/src/metrics.py +0 -628
  114. gitpr_cli-1.3.0/src/ui/metrics_app.py +0 -450
  115. gitpr_cli-1.3.0/tests/test_metrics.py +0 -854
  116. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/LICENSE +0 -0
  117. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  118. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/entry_points.txt +0 -0
  119. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/gitpr_cli.egg-info/top_level.txt +0 -0
  120. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/setup.cfg +0 -0
  121. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/__init__.py +0 -0
  122. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ai_providers.py +0 -0
  123. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/application/__init__.py +0 -0
  124. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/application/use_cases/__init__.py +0 -0
  125. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/application/use_cases/generate_pr_explanation.py +0 -0
  126. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/application/use_cases/generate_test_file.py +0 -0
  127. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/blame_engine.py +0 -0
  128. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/branding/__init__.py +0 -0
  129. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/branding/badge_builder.py +0 -0
  130. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/branding/badge_data.py +0 -0
  131. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/cache.py +0 -0
  132. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/changelog_builder.py +0 -0
  133. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/chat_memory.py +0 -0
  134. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/__init__.py +0 -0
  135. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/demo_runner.py +0 -0
  136. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/fake_ai_provider.py +0 -0
  137. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/scenarios/__init__.py +0 -0
  138. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/scenarios/laravel_bug_fix.py +0 -0
  139. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/demo/scenarios/security_issue.py +0 -0
  140. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/diff_parser.py +0 -0
  141. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/doc_links.py +0 -0
  142. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/linter/__init__.py +0 -0
  143. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/pr/__init__.py +0 -0
  144. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/pr/explain_section_builder.py +0 -0
  145. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/tests_generation/__init__.py +0 -0
  146. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/tests_generation/framework_detector.py +0 -0
  147. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/tests_generation/test_content_types.py +0 -0
  148. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/domain/tests_generation/test_scaffold_builder.py +0 -0
  149. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/__init__.py +0 -0
  150. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/apply_fix.py +0 -0
  151. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/fix_history.py +0 -0
  152. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/patch_applier.py +0 -0
  153. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/patch_extractor.py +0 -0
  154. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/patch_provenance.py +0 -0
  155. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/patch_safety_classifier.py +0 -0
  156. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/fix/rollback_fix.py +0 -0
  157. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/github_api.py +0 -0
  158. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/i18n.py +0 -0
  159. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/__init__.py +0 -0
  160. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/git/__init__.py +0 -0
  161. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/git/patch_applier.py +0 -0
  162. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/git/selective_stager.py +0 -0
  163. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/__init__.py +0 -0
  164. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/factory.py +0 -0
  165. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/infrastructure/scm/web_links.py +0 -0
  166. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/issue_engine.py +0 -0
  167. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/linter_wizard.py +0 -0
  168. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/net.py +0 -0
  169. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/review/__init__.py +0 -0
  170. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/review/diff_normalizer.py +0 -0
  171. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/review/diff_source.py +0 -0
  172. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/reviewer_resolution.py +0 -0
  173. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/reviewer_suggestion.py +0 -0
  174. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/security.py +0 -0
  175. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/security_ruleset.py +0 -0
  176. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/spinner.py +0 -0
  177. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/__init__.py +0 -0
  178. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/apply_split_plan.py +0 -0
  179. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/generate_split_plan.py +0 -0
  180. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/hunk_grouper.py +0 -0
  181. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/hunk_parser.py +0 -0
  182. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/split/split_plan.py +0 -0
  183. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/suggest_reviewers.py +0 -0
  184. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/tui_issue.py +0 -0
  185. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/__init__.py +0 -0
  186. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/chat_app.py +0 -0
  187. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/config_app.py +0 -0
  188. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/demo/__init__.py +0 -0
  189. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/demo/demo_app.py +0 -0
  190. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/demo/demo_help_screen.py +0 -0
  191. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/demo/demo_screens.py +0 -0
  192. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/help_screen.py +0 -0
  193. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/issue_app.py +0 -0
  194. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/linter_app.py +0 -0
  195. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/ui/pr_publish_help.py +0 -0
  196. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/src/version_bump.py +0 -0
  197. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_blame_engine_ranges.py +0 -0
  198. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_blame_metrics.py +0 -0
  199. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_changelog_builder.py +0 -0
  200. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_chat_backend.py +0 -0
  201. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_cli.py +0 -0
  202. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_schema.py +0 -0
  203. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_store.py +0 -0
  204. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_suggest_reviewers.py +0 -0
  205. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_config_validation.py +0 -0
  206. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_core.py +0 -0
  207. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_diff_parser.py +0 -0
  208. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_explain_command.py +0 -0
  209. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_i18n.py +0 -0
  210. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_install_wizard.py +0 -0
  211. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_issue_engine.py +0 -0
  212. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_linter_metrics.py +0 -0
  213. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_linter_presets.py +0 -0
  214. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_main_suggest_reviewers.py +0 -0
  215. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_mcp_prompts.py +0 -0
  216. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_mcp_server_e2e.py +0 -0
  217. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_net_timeouts.py +0 -0
  218. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_plugins.py +0 -0
  219. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_pr_publish_linter_modal.py +0 -0
  220. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_pre_save.py +0 -0
  221. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_release_cli.py +0 -0
  222. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_reviewer_resolution.py +0 -0
  223. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_reviewer_suggestion.py +0 -0
  224. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_security_ruleset.py +0 -0
  225. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_skill_command.py +0 -0
  226. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_smart_excludes.py +0 -0
  227. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_suggest_reviewers.py +0 -0
  228. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_tests_command.py +0 -0
  229. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_thinking_words.py +0 -0
  230. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_updater.py +0 -0
  231. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_version_bump.py +0 -0
  232. {gitpr_cli-1.3.0 → gitpr_cli-1.4.1}/tests/test_web_links.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 1.3.0
3
+ Version: 1.4.1
4
4
  Summary: AI-powered PR automation, commit messages, and code review (Gemini, DeepSeek, and Ollama)
5
5
  Author-email: Natan Fiuza <contato@natanfiuza.dev.br>
6
6
  Requires-Python: >=3.10
@@ -15,6 +15,7 @@ Requires-Dist: pyyaml
15
15
  Requires-Dist: textual
16
16
  Requires-Dist: requests
17
17
  Requires-Dist: mcp>=1.0.0
18
+ Requires-Dist: packaging>=23.0
18
19
  Dynamic: license-file
19
20
 
20
21
 
@@ -163,11 +164,16 @@ You can pass the following *flags* for specific actions:
163
164
  * `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md)
164
165
  * `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md)
165
166
  * `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
167
+ * `gitpr mentor [<finding_id>]`: **Junior Mentor Pedagogical Explanations.** Breaks down code review findings with educational context ("why this matters", real-world analogy, guided questions, and key takeaway) to foster growth and mentor developers. Works standalone over the latest review findings or with `--finding <id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mentor-mode.md)
166
168
  * `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
167
169
  * `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md)
170
+ * `gitpr risk`: **Local Risk Scoring for Diffs.** Computes a deterministic, explainable risk score (0.0 to 100.0) and badge (`LOW 🟢`, `MEDIUM 🟡`, `HIGH 🟠`, `CRITICAL 🔴`) using local repository signals (critical paths, missing tests, migrations, bug history, and static findings). Use `--file <path>`, `--format json`, `--base <ref>`, or `--no-history`. Automatically included in code reviews (`GITPR_RISK_INCLUDE_IN_REVIEW=true`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
171
+ * `gitpr policy`: **Shared quality policy for the repository.** Adopts a versioned YAML **Policy Pack** — review skills, linter rules, severity overrides, critical paths, risk weights and PR/commit conventions — and records the choice in `.gitpr/policy.lock.yml`, so the review, the linter and the risk score all run under the same policy, with a checksum per pack. `list`, `validate`, `show`, `use`, `init`, `install`, `off`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md)
172
+ * `gitpr baseline`: **Baseline and auditable suppressions for legacy adoption.** Records the findings a repository already has in `.gitpr/baseline.json`, so a run classifies every finding as `new`, `existing`, `resolved`, `ignored` or `accepted_debt` and **only `new` blocks**. Every suppression carries a reason, and accepted debt carries an owner and an optional deadline. `create`, `show`, `validate`, `update`, `suppress`, `unsuppress`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
173
+ * `gitpr check`: **Unified CI check command.** Consolidates static linter, secret scanning, external bridges (Semgrep, Gitleaks, Bandit), optional AI code review, risk scoring, and baseline into a single CI pipeline command. Emits machine-readable artifacts in **SARIF 2.1.0**, **JSON**, or **JUnit XML** with deterministic exit codes (`0`, `1`, `2`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/check-ci.md)
168
174
  * `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
169
- * `-r` or `--review`: Performs a detailed **Code Review** of local changes.
170
- * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
175
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
176
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
171
177
  * `-i <file>` or `--input <file>`: **Full File Audit.** Must be used together with `-r` or `-f`; it ignores git history and does a Code Review of the entire file. Excellent for acting as a consultant on legacy code refactoring.
172
178
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
173
179
  * `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
@@ -179,7 +185,7 @@ You can pass the following *flags* for specific actions:
179
185
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
180
186
  * `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md)
181
187
  * `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md)
182
- * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 14 annotated tools, 18 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
188
+ * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 16 annotated tools, 19 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
183
189
  * `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/plugins-system.md)
184
190
  * `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
185
191
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -237,6 +243,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
237
243
 
238
244
  Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules, Embedded Security Rules, and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
239
245
 
246
+ ## ⚡ Local Risk Scoring (gitpr risk)
247
+
248
+ GitPR computes a local, deterministic, and explainable risk score (from `0.0` to `100.0`) for individual modified files and the pull request as a whole. It requires no network calls, consumes zero AI tokens, and evaluates repository and Git signals offline:
249
+
250
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
251
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
252
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
253
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
254
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
255
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
256
+
257
+ ### Risk Levels & Badges
258
+
259
+ | Level | Score Range | Badge | Meaning |
260
+ |---|---|---|---|
261
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
262
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
263
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
264
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
265
+
266
+ ### Aggregation Formula (50 / 30 / 20)
267
+
268
+ The aggregate PR score combines:
269
+ * **50%**: Maximum individual file score
270
+ * **30%**: Weighted average of file scores by lines changed
271
+ * **20%**: Aggregated critical evidence score
272
+
273
+ ### Review Integration
274
+
275
+ When enabled (`GITPR_RISK_INCLUDE_IN_REVIEW=true` in `~/.gitpr/.env`), GitPR automatically appends a `## ⚡ Risk Assessment` section to generated code review reports (`-r`, `-f`, `gitpr review-pr`) and primes the AI review prompt with critical risk areas.
276
+
277
+ ```bash
278
+ gitpr risk # Compute risk for current diff
279
+ gitpr risk --file src/auth.py # Decompose risk for a single file
280
+ gitpr risk --format json # Output JSON for CI/CD pipelines
281
+ gitpr risk --base main # Evaluate against specific git base ref
282
+ ```
283
+
284
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
285
+
286
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
287
+
288
+ Adopting GitPR in a repository that already carries hundreds of findings is the moment the tool is least useful: the gate fails on problems nobody in this change introduced, and the alternatives are turning it off or spending a sprint fixing code nobody is touching. A **baseline** is the record of what the repository already has, committed to Git, so that every run classifies what it finds instead of starting from zero.
289
+
290
+ ```bash
291
+ gitpr baseline create # Record the findings of the current diff
292
+ gitpr baseline show # The findings, the decisions and the counts
293
+ gitpr baseline validate # Every defect in the file — exit 1 on any
294
+ gitpr baseline update # Re-record today's diff, keeping decisions
295
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
296
+ gitpr baseline unsuppress <id> # Take a decision back
297
+ ```
298
+
299
+ A suppression is not a silent filter: it carries a **reason**, an author and a date, and accepted debt carries an **owner** and an optional **deadline**. `--scope finding|line|file|rule` widens a decision beyond one finding, and anything wider than a single finding lives in `.gitpr/baseline.overrides.yml`, where it is reviewed with the code. A checksum over the record catches an edit made outside GitPR — `gitpr baseline validate` names the divergence instead of applying the file. A **Policy Pack** may carry a `baseline:` block of its own, applied in memory and attributed to the pack.
300
+
301
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
302
+
303
+ | Key | Default | Effect |
304
+ |---|---|---|
305
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
306
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
307
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
308
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
309
+
310
+ Only a `new` error-level finding exits non-zero, and only `new` findings carry risk points — everything else reaches the risk report as zero-point evidence with its status. The baseline is never sent to the AI, and no entry stores code or a secret: the file is committed, so only a digest of the offending line is kept.
311
+
312
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
313
+
240
314
  ## 🤝 Co-Author Signature
241
315
 
242
316
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -284,6 +358,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
284
358
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
285
359
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
286
360
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
361
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
287
362
 
288
363
  ## 🌐 Internationalization (i18n)
289
364
 
@@ -384,6 +459,8 @@ Once configured, use natural language in your editor's AI chat:
384
459
  | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
385
460
  | `list_fix_candidates` | Fix candidates of the last review: patch, classification, id (read-only) |
386
461
  | `review_remote_pr` | AI review of a pull request already open on the forge, fetched by number (read-only) |
462
+ | `run_check` | Structured CI/Editor quality gate returning normalized findings and pass/fail status |
463
+ | `publish_pull_request` | Publish or update a Pull Request on the remote forge from title and body |
387
464
 
388
465
  ### Direct CLI Invocation
389
466
 
@@ -404,6 +481,8 @@ This is useful for scripting, CI/CD pipelines, and one-off queries where you don
404
481
 
405
482
  📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
406
483
 
484
+ > 🧩 **Official VS Code & Cursor Extension** — Prefer native editor commands, SCM toolbar buttons, and inline `Problems` diagnostics? Install the thin-client extension in [`extensions/vscode/`](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md), powered by `gitpr-mcp`.
485
+
407
486
  > 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-prompts.md) for the full list.
408
487
 
409
488
  ## 🎯 Smart Excludes (Token Optimization)
@@ -490,9 +569,13 @@ If you want to implement GitPR as an automated quality barrier in your team, che
490
569
  * [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
491
570
  * [**Fix Command (gitpr fix)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
492
571
  * [**Split Command (gitpr split)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
572
+ * [**Local Risk Scoring (gitpr risk)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md) — How the `gitpr risk` command evaluates regression risk, decomposes signals (50/30/20 formula), and highlights high-risk areas in code reviews offline.
573
+ * [**Policy Packs (gitpr policy)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md) — How a repository adopts a versioned Policy Pack that carries skills, linter rules, severity overrides, critical paths and risk weights together, the precedence ladder that combines packs, the lockfile the team commits, and the three failures that abort instead of silently degrading.
574
+ * [**Baseline & Auditable Suppressions (gitpr baseline)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md) — How a legacy repository records the findings it already has, how a run classifies them as `new`, `existing`, `resolved`, `ignored` or `accepted_debt`, why only `new` blocks, what the fingerprint hashes and what it deliberately leaves out, the four scopes of a suppression, the checksum that catches a hand edit, and the `baseline:` block a Policy Pack may carry.
493
575
 
494
576
  ### Configuration & Infrastructure
495
577
 
578
+ * [**Editor Extension (VS Code & Cursor)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md) — Thin-client VSIX extension driving `gitpr-mcp` over stdio for SCM commit generation, Markdown code reviews, two-step PR publishing, and inline `Problems` diagnostics.
496
579
  * [**Interactive Configuration TUI (gitpr config)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
497
580
  * [**Multi-Forge SCM Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
498
581
  * [**Suggested Reviewers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.
@@ -144,11 +144,16 @@ You can pass the following *flags* for specific actions:
144
144
  * `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md)
145
145
  * `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md)
146
146
  * `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
147
+ * `gitpr mentor [<finding_id>]`: **Junior Mentor Pedagogical Explanations.** Breaks down code review findings with educational context ("why this matters", real-world analogy, guided questions, and key takeaway) to foster growth and mentor developers. Works standalone over the latest review findings or with `--finding <id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mentor-mode.md)
147
148
  * `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
148
149
  * `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md)
150
+ * `gitpr risk`: **Local Risk Scoring for Diffs.** Computes a deterministic, explainable risk score (0.0 to 100.0) and badge (`LOW 🟢`, `MEDIUM 🟡`, `HIGH 🟠`, `CRITICAL 🔴`) using local repository signals (critical paths, missing tests, migrations, bug history, and static findings). Use `--file <path>`, `--format json`, `--base <ref>`, or `--no-history`. Automatically included in code reviews (`GITPR_RISK_INCLUDE_IN_REVIEW=true`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
151
+ * `gitpr policy`: **Shared quality policy for the repository.** Adopts a versioned YAML **Policy Pack** — review skills, linter rules, severity overrides, critical paths, risk weights and PR/commit conventions — and records the choice in `.gitpr/policy.lock.yml`, so the review, the linter and the risk score all run under the same policy, with a checksum per pack. `list`, `validate`, `show`, `use`, `init`, `install`, `off`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md)
152
+ * `gitpr baseline`: **Baseline and auditable suppressions for legacy adoption.** Records the findings a repository already has in `.gitpr/baseline.json`, so a run classifies every finding as `new`, `existing`, `resolved`, `ignored` or `accepted_debt` and **only `new` blocks**. Every suppression carries a reason, and accepted debt carries an owner and an optional deadline. `create`, `show`, `validate`, `update`, `suppress`, `unsuppress`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
153
+ * `gitpr check`: **Unified CI check command.** Consolidates static linter, secret scanning, external bridges (Semgrep, Gitleaks, Bandit), optional AI code review, risk scoring, and baseline into a single CI pipeline command. Emits machine-readable artifacts in **SARIF 2.1.0**, **JSON**, or **JUnit XML** with deterministic exit codes (`0`, `1`, `2`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/check-ci.md)
149
154
  * `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
150
- * `-r` or `--review`: Performs a detailed **Code Review** of local changes.
151
- * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
155
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
156
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
152
157
  * `-i <file>` or `--input <file>`: **Full File Audit.** Must be used together with `-r` or `-f`; it ignores git history and does a Code Review of the entire file. Excellent for acting as a consultant on legacy code refactoring.
153
158
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
154
159
  * `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
@@ -160,7 +165,7 @@ You can pass the following *flags* for specific actions:
160
165
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
161
166
  * `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md)
162
167
  * `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md)
163
- * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 14 annotated tools, 18 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
168
+ * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 16 annotated tools, 19 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
164
169
  * `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/plugins-system.md)
165
170
  * `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
166
171
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -218,6 +223,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
218
223
 
219
224
  Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules, Embedded Security Rules, and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
220
225
 
226
+ ## ⚡ Local Risk Scoring (gitpr risk)
227
+
228
+ GitPR computes a local, deterministic, and explainable risk score (from `0.0` to `100.0`) for individual modified files and the pull request as a whole. It requires no network calls, consumes zero AI tokens, and evaluates repository and Git signals offline:
229
+
230
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
231
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
232
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
233
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
234
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
235
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
236
+
237
+ ### Risk Levels & Badges
238
+
239
+ | Level | Score Range | Badge | Meaning |
240
+ |---|---|---|---|
241
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
242
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
243
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
244
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
245
+
246
+ ### Aggregation Formula (50 / 30 / 20)
247
+
248
+ The aggregate PR score combines:
249
+ * **50%**: Maximum individual file score
250
+ * **30%**: Weighted average of file scores by lines changed
251
+ * **20%**: Aggregated critical evidence score
252
+
253
+ ### Review Integration
254
+
255
+ When enabled (`GITPR_RISK_INCLUDE_IN_REVIEW=true` in `~/.gitpr/.env`), GitPR automatically appends a `## ⚡ Risk Assessment` section to generated code review reports (`-r`, `-f`, `gitpr review-pr`) and primes the AI review prompt with critical risk areas.
256
+
257
+ ```bash
258
+ gitpr risk # Compute risk for current diff
259
+ gitpr risk --file src/auth.py # Decompose risk for a single file
260
+ gitpr risk --format json # Output JSON for CI/CD pipelines
261
+ gitpr risk --base main # Evaluate against specific git base ref
262
+ ```
263
+
264
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
265
+
266
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
267
+
268
+ Adopting GitPR in a repository that already carries hundreds of findings is the moment the tool is least useful: the gate fails on problems nobody in this change introduced, and the alternatives are turning it off or spending a sprint fixing code nobody is touching. A **baseline** is the record of what the repository already has, committed to Git, so that every run classifies what it finds instead of starting from zero.
269
+
270
+ ```bash
271
+ gitpr baseline create # Record the findings of the current diff
272
+ gitpr baseline show # The findings, the decisions and the counts
273
+ gitpr baseline validate # Every defect in the file — exit 1 on any
274
+ gitpr baseline update # Re-record today's diff, keeping decisions
275
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
276
+ gitpr baseline unsuppress <id> # Take a decision back
277
+ ```
278
+
279
+ A suppression is not a silent filter: it carries a **reason**, an author and a date, and accepted debt carries an **owner** and an optional **deadline**. `--scope finding|line|file|rule` widens a decision beyond one finding, and anything wider than a single finding lives in `.gitpr/baseline.overrides.yml`, where it is reviewed with the code. A checksum over the record catches an edit made outside GitPR — `gitpr baseline validate` names the divergence instead of applying the file. A **Policy Pack** may carry a `baseline:` block of its own, applied in memory and attributed to the pack.
280
+
281
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
282
+
283
+ | Key | Default | Effect |
284
+ |---|---|---|
285
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
286
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
287
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
288
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
289
+
290
+ Only a `new` error-level finding exits non-zero, and only `new` findings carry risk points — everything else reaches the risk report as zero-point evidence with its status. The baseline is never sent to the AI, and no entry stores code or a secret: the file is committed, so only a digest of the offending line is kept.
291
+
292
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
293
+
221
294
  ## 🤝 Co-Author Signature
222
295
 
223
296
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -265,6 +338,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
265
338
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
266
339
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
267
340
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
341
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
268
342
 
269
343
  ## 🌐 Internationalization (i18n)
270
344
 
@@ -365,6 +439,8 @@ Once configured, use natural language in your editor's AI chat:
365
439
  | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
366
440
  | `list_fix_candidates` | Fix candidates of the last review: patch, classification, id (read-only) |
367
441
  | `review_remote_pr` | AI review of a pull request already open on the forge, fetched by number (read-only) |
442
+ | `run_check` | Structured CI/Editor quality gate returning normalized findings and pass/fail status |
443
+ | `publish_pull_request` | Publish or update a Pull Request on the remote forge from title and body |
368
444
 
369
445
  ### Direct CLI Invocation
370
446
 
@@ -385,6 +461,8 @@ This is useful for scripting, CI/CD pipelines, and one-off queries where you don
385
461
 
386
462
  📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
387
463
 
464
+ > 🧩 **Official VS Code & Cursor Extension** — Prefer native editor commands, SCM toolbar buttons, and inline `Problems` diagnostics? Install the thin-client extension in [`extensions/vscode/`](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md), powered by `gitpr-mcp`.
465
+
388
466
  > 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-prompts.md) for the full list.
389
467
 
390
468
  ## 🎯 Smart Excludes (Token Optimization)
@@ -471,9 +549,13 @@ If you want to implement GitPR as an automated quality barrier in your team, che
471
549
  * [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
472
550
  * [**Fix Command (gitpr fix)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
473
551
  * [**Split Command (gitpr split)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
552
+ * [**Local Risk Scoring (gitpr risk)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md) — How the `gitpr risk` command evaluates regression risk, decomposes signals (50/30/20 formula), and highlights high-risk areas in code reviews offline.
553
+ * [**Policy Packs (gitpr policy)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md) — How a repository adopts a versioned Policy Pack that carries skills, linter rules, severity overrides, critical paths and risk weights together, the precedence ladder that combines packs, the lockfile the team commits, and the three failures that abort instead of silently degrading.
554
+ * [**Baseline & Auditable Suppressions (gitpr baseline)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md) — How a legacy repository records the findings it already has, how a run classifies them as `new`, `existing`, `resolved`, `ignored` or `accepted_debt`, why only `new` blocks, what the fingerprint hashes and what it deliberately leaves out, the four scopes of a suppression, the checksum that catches a hand edit, and the `baseline:` block a Policy Pack may carry.
474
555
 
475
556
  ### Configuration & Infrastructure
476
557
 
558
+ * [**Editor Extension (VS Code & Cursor)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md) — Thin-client VSIX extension driving `gitpr-mcp` over stdio for SCM commit generation, Markdown code reviews, two-step PR publishing, and inline `Problems` diagnostics.
477
559
  * [**Interactive Configuration TUI (gitpr config)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
478
560
  * [**Multi-Forge SCM Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
479
561
  * [**Suggested Reviewers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 1.3.0
3
+ Version: 1.4.1
4
4
  Summary: AI-powered PR automation, commit messages, and code review (Gemini, DeepSeek, and Ollama)
5
5
  Author-email: Natan Fiuza <contato@natanfiuza.dev.br>
6
6
  Requires-Python: >=3.10
@@ -15,6 +15,7 @@ Requires-Dist: pyyaml
15
15
  Requires-Dist: textual
16
16
  Requires-Dist: requests
17
17
  Requires-Dist: mcp>=1.0.0
18
+ Requires-Dist: packaging>=23.0
18
19
  Dynamic: license-file
19
20
 
20
21
 
@@ -163,11 +164,16 @@ You can pass the following *flags* for specific actions:
163
164
  * `gitpr fix [<finding_id>]`: **Review findings patch application & rollback.** Turns findings from the last code review (`gitpr -r`) into safe, reviewable unified diffs. Includes safety classification (`safe`, `review_required`, `experimental`), `--all-safe` batching, `--force` validation, and `--rollback <patch-id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md)
164
165
  * `gitpr split`: **Atomic commit splitter.** Reads uncommitted working tree changes, groups hunks by intent using AI, and proposes ordered atomic commits without altering your working tree files (`--dry-run`, `--apply`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md)
165
166
  * `gitpr tests generate`: **AI test suite generation & scaffolding.** Analyzes your diff, a target file (`--file`), or a review finding (`--finding`) and generates complete, executable test suites (supporting pytest, jest, vitest, phpunit, pest). Use `--apply` to write to disk.
167
+ * `gitpr mentor [<finding_id>]`: **Junior Mentor Pedagogical Explanations.** Breaks down code review findings with educational context ("why this matters", real-world analogy, guided questions, and key takeaway) to foster growth and mentor developers. Works standalone over the latest review findings or with `--finding <id>`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mentor-mode.md)
166
168
  * `gitpr explain`: **Reviewer Guide generator.** Generates a concise summary explaining what changed, why it changed, where reviewers should focus, and potential regression risks. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/pull-request-publication.md)
167
169
  * `gitpr review-pr <pr_number>`: **Remote Pull Request review.** Fetches and reviews an open pull request directly from the forge (GitHub, GitLab, Bitbucket, Azure DevOps) without checking out the branch locally. Use `--post-comment` to post the review directly to the PR. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/review-pr.md)
170
+ * `gitpr risk`: **Local Risk Scoring for Diffs.** Computes a deterministic, explainable risk score (0.0 to 100.0) and badge (`LOW 🟢`, `MEDIUM 🟡`, `HIGH 🟠`, `CRITICAL 🔴`) using local repository signals (critical paths, missing tests, migrations, bug history, and static findings). Use `--file <path>`, `--format json`, `--base <ref>`, or `--no-history`. Automatically included in code reviews (`GITPR_RISK_INCLUDE_IN_REVIEW=true`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
171
+ * `gitpr policy`: **Shared quality policy for the repository.** Adopts a versioned YAML **Policy Pack** — review skills, linter rules, severity overrides, critical paths, risk weights and PR/commit conventions — and records the choice in `.gitpr/policy.lock.yml`, so the review, the linter and the risk score all run under the same policy, with a checksum per pack. `list`, `validate`, `show`, `use`, `init`, `install`, `off`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md)
172
+ * `gitpr baseline`: **Baseline and auditable suppressions for legacy adoption.** Records the findings a repository already has in `.gitpr/baseline.json`, so a run classifies every finding as `new`, `existing`, `resolved`, `ignored` or `accepted_debt` and **only `new` blocks**. Every suppression carries a reason, and accepted debt carries an owner and an optional deadline. `create`, `show`, `validate`, `update`, `suppress`, `unsuppress`. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
173
+ * `gitpr check`: **Unified CI check command.** Consolidates static linter, secret scanning, external bridges (Semgrep, Gitleaks, Bandit), optional AI code review, risk scoring, and baseline into a single CI pipeline command. Emits machine-readable artifacts in **SARIF 2.1.0**, **JSON**, or **JUnit XML** with deterministic exit codes (`0`, `1`, `2`). 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/check-ci.md)
168
174
  * `-c` or `--commit`: Runs a local `git diff` and displays **only the suggested commit message**.
169
- * `-r` or `--review`: Performs a detailed **Code Review** of local changes.
170
- * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch.
175
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
176
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
171
177
  * `-i <file>` or `--input <file>`: **Full File Audit.** Must be used together with `-r` or `-f`; it ignores git history and does a Code Review of the entire file. Excellent for acting as a consultant on legacy code refactoring.
172
178
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
173
179
  * `--lang <code>`: Forces the interface language for this execution (e.g.: `en_us`, `pt_br`). Overrides `GITPR_LANG` in `.env` without persisting the change.
@@ -179,7 +185,7 @@ You can pass the following *flags* for specific actions:
179
185
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
180
186
  * `--init`: **Interactive SCM forge wizard.** Detects the repository's forge (GitHub, GitLab, Bitbucket Cloud, Azure DevOps), configures the provider, and stores the access token encrypted. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md)
181
187
  * `--linter-setup`: **Interactive external linter wizard.** Guides you through installing and configuring external linters (ESLint, PHPCS, Stylelint) as a Checkstyle XML bridge. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/linter-regras-customizadas.md)
182
- * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 14 annotated tools, 18 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
188
+ * `--mcp`: Starts GitPR as an **MCP server** (Model Context Protocol) on stdio transport. Enables integration with VS Code, Cursor, Claude Desktop, and other MCP-compatible editors — exposing all GitPR AI capabilities as 16 annotated tools, 19 resources, and 7 pre-built prompts directly inside your IDE. Also available as the standalone `gitpr-mcp` command.
183
189
  * `--plugins`: Lists all **globally installed plugins** — custom linter packs from `~/.gitpr/plugins/linter/` and MCP prompt templates from `~/.gitpr/plugins/prompts/`. These plugins apply across all your projects without duplication. 📖 [Full docs](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/plugins-system.md)
184
190
  * `--install`: **Interactive Setup Wizard.** Runs a guided 4-step setup: downloads skill templates, installs Git hooks, configures MCP for detected editors, and checks/requests your AI provider API key. Each step asks for confirmation before proceeding.
185
191
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -237,6 +243,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
237
243
 
238
244
  Every run — manual via `--linter` or automatic before commits — consolidates the Regex Rules, Embedded Security Rules, and External Linters into a single Markdown report saved at `.gitpr/reports/linter/` (customizable via `OUTPUT_FILE_NAME_LINTER`). The report is generated only when violations are found — clean runs create no files.
239
245
 
246
+ ## ⚡ Local Risk Scoring (gitpr risk)
247
+
248
+ GitPR computes a local, deterministic, and explainable risk score (from `0.0` to `100.0`) for individual modified files and the pull request as a whole. It requires no network calls, consumes zero AI tokens, and evaluates repository and Git signals offline:
249
+
250
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
251
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
252
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
253
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
254
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
255
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
256
+
257
+ ### Risk Levels & Badges
258
+
259
+ | Level | Score Range | Badge | Meaning |
260
+ |---|---|---|---|
261
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
262
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
263
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
264
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
265
+
266
+ ### Aggregation Formula (50 / 30 / 20)
267
+
268
+ The aggregate PR score combines:
269
+ * **50%**: Maximum individual file score
270
+ * **30%**: Weighted average of file scores by lines changed
271
+ * **20%**: Aggregated critical evidence score
272
+
273
+ ### Review Integration
274
+
275
+ When enabled (`GITPR_RISK_INCLUDE_IN_REVIEW=true` in `~/.gitpr/.env`), GitPR automatically appends a `## ⚡ Risk Assessment` section to generated code review reports (`-r`, `-f`, `gitpr review-pr`) and primes the AI review prompt with critical risk areas.
276
+
277
+ ```bash
278
+ gitpr risk # Compute risk for current diff
279
+ gitpr risk --file src/auth.py # Decompose risk for a single file
280
+ gitpr risk --format json # Output JSON for CI/CD pipelines
281
+ gitpr risk --base main # Evaluate against specific git base ref
282
+ ```
283
+
284
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
285
+
286
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
287
+
288
+ Adopting GitPR in a repository that already carries hundreds of findings is the moment the tool is least useful: the gate fails on problems nobody in this change introduced, and the alternatives are turning it off or spending a sprint fixing code nobody is touching. A **baseline** is the record of what the repository already has, committed to Git, so that every run classifies what it finds instead of starting from zero.
289
+
290
+ ```bash
291
+ gitpr baseline create # Record the findings of the current diff
292
+ gitpr baseline show # The findings, the decisions and the counts
293
+ gitpr baseline validate # Every defect in the file — exit 1 on any
294
+ gitpr baseline update # Re-record today's diff, keeping decisions
295
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
296
+ gitpr baseline unsuppress <id> # Take a decision back
297
+ ```
298
+
299
+ A suppression is not a silent filter: it carries a **reason**, an author and a date, and accepted debt carries an **owner** and an optional **deadline**. `--scope finding|line|file|rule` widens a decision beyond one finding, and anything wider than a single finding lives in `.gitpr/baseline.overrides.yml`, where it is reviewed with the code. A checksum over the record catches an edit made outside GitPR — `gitpr baseline validate` names the divergence instead of applying the file. A **Policy Pack** may carry a `baseline:` block of its own, applied in memory and attributed to the pack.
300
+
301
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
302
+
303
+ | Key | Default | Effect |
304
+ |---|---|---|
305
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
306
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
307
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
308
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
309
+
310
+ Only a `new` error-level finding exits non-zero, and only `new` findings carry risk points — everything else reaches the risk report as zero-point evidence with its status. The baseline is never sent to the AI, and no entry stores code or a secret: the file is committed, so only a digest of the offending line is kept.
311
+
312
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
313
+
240
314
  ## 🤝 Co-Author Signature
241
315
 
242
316
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -284,6 +358,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
284
358
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
285
359
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
286
360
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
361
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
287
362
 
288
363
  ## 🌐 Internationalization (i18n)
289
364
 
@@ -384,6 +459,8 @@ Once configured, use natural language in your editor's AI chat:
384
459
  | `analyze_unstaged_diff` | Unstaged diff only (working tree vs index) |
385
460
  | `list_fix_candidates` | Fix candidates of the last review: patch, classification, id (read-only) |
386
461
  | `review_remote_pr` | AI review of a pull request already open on the forge, fetched by number (read-only) |
462
+ | `run_check` | Structured CI/Editor quality gate returning normalized findings and pass/fail status |
463
+ | `publish_pull_request` | Publish or update a Pull Request on the remote forge from title and body |
387
464
 
388
465
  ### Direct CLI Invocation
389
466
 
@@ -404,6 +481,8 @@ This is useful for scripting, CI/CD pipelines, and one-off queries where you don
404
481
 
405
482
  📖 **Full documentation:** [docs/mcp-integration.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-integration.md) — available in 5 languages (EN, PT-BR, PT-PT, ES, FR).
406
483
 
484
+ > 🧩 **Official VS Code & Cursor Extension** — Prefer native editor commands, SCM toolbar buttons, and inline `Problems` diagnostics? Install the thin-client extension in [`extensions/vscode/`](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md), powered by `gitpr-mcp`.
485
+
407
486
  > 💬 **MCP Prompts** — GitPR also exposes 7 pre-defined message templates (prompts) for common flows like "Review PR", "Generate Commit Message", and "Create Issue from Diff". See the [MCP Prompts guide](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/mcp-prompts.md) for the full list.
408
487
 
409
488
  ## 🎯 Smart Excludes (Token Optimization)
@@ -490,9 +569,13 @@ If you want to implement GitPR as an automated quality barrier in your team, che
490
569
  * [**Release Notes & Changelog (gitpr release)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/release-notes.md) — How the `gitpr release` subcommand generates the changelog / release notes of a repository from the delta of the previous version, links every commit, pull request and contributor, suggests the next semantic version and publishes releases on the forge.
491
570
  * [**Fix Command (gitpr fix)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/fix-command.md) — How the `gitpr fix` subcommand turns the findings of the last review into patches you read before they touch your tree, classifies each one by safety, and undoes an applied patch on demand.
492
571
  * [**Split Command (gitpr split)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/split-command.md) — How the `gitpr split` subcommand reads a working tree holding several concerns, groups the hunks by intent with AI, and turns them into ordered atomic commits without ever writing to your files.
572
+ * [**Local Risk Scoring (gitpr risk)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md) — How the `gitpr risk` command evaluates regression risk, decomposes signals (50/30/20 formula), and highlights high-risk areas in code reviews offline.
573
+ * [**Policy Packs (gitpr policy)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/policy-packs.md) — How a repository adopts a versioned Policy Pack that carries skills, linter rules, severity overrides, critical paths and risk weights together, the precedence ladder that combines packs, the lockfile the team commits, and the three failures that abort instead of silently degrading.
574
+ * [**Baseline & Auditable Suppressions (gitpr baseline)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md) — How a legacy repository records the findings it already has, how a run classifies them as `new`, `existing`, `resolved`, `ignored` or `accepted_debt`, why only `new` blocks, what the fingerprint hashes and what it deliberately leaves out, the four scopes of a suppression, the checksum that catches a hand edit, and the `baseline:` block a Policy Pack may carry.
493
575
 
494
576
  ### Configuration & Infrastructure
495
577
 
578
+ * [**Editor Extension (VS Code & Cursor)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/editor-extension.md) — Thin-client VSIX extension driving `gitpr-mcp` over stdio for SCM commit generation, Markdown code reviews, two-step PR publishing, and inline `Problems` diagnostics.
496
579
  * [**Interactive Configuration TUI (gitpr config)**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/config-tui.md) — Master-detail terminal interface to view, edit, and validate settings in `~/.gitpr/.env`.
497
580
  * [**Multi-Forge SCM Integration**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/scm-multiforge.md) — Unified SCM provider layer for GitHub, GitLab, Bitbucket Cloud, and Azure DevOps with `--init` wizard.
498
581
  * [**Suggested Reviewers**](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/suggested-reviewers.md) — Automatic reviewer suggestion via Git blame of added lines mapped to forge logins.