gitpr-cli 1.3.0__tar.gz → 1.4.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 (220) hide show
  1. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/PKG-INFO +81 -4
  2. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/README.md +79 -3
  3. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/PKG-INFO +81 -4
  4. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/SOURCES.txt +59 -0
  5. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/requires.txt +1 -0
  6. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/pyproject.toml +9 -1
  7. gitpr_cli-1.4.0/src/application/use_cases/activate_policy_pack.py +122 -0
  8. gitpr_cli-1.4.0/src/application/use_cases/baseline_gate.py +415 -0
  9. gitpr_cli-1.4.0/src/application/use_cases/baseline_summary.py +259 -0
  10. gitpr_cli-1.4.0/src/application/use_cases/calculate_risk.py +309 -0
  11. gitpr_cli-1.4.0/src/application/use_cases/compare_against_baseline.py +41 -0
  12. gitpr_cli-1.4.0/src/application/use_cases/create_baseline.py +709 -0
  13. gitpr_cli-1.4.0/src/application/use_cases/generate_mentor_explanation.py +279 -0
  14. gitpr_cli-1.4.0/src/application/use_cases/install_policy_pack.py +71 -0
  15. gitpr_cli-1.4.0/src/application/use_cases/resolve_effective_policy.py +208 -0
  16. gitpr_cli-1.4.0/src/application/use_cases/suppress_finding.py +483 -0
  17. gitpr_cli-1.4.0/src/application/use_cases/validate_policy_pack.py +263 -0
  18. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/commit_classifier.py +45 -0
  19. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/config.py +298 -3
  20. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/config_schema.py +117 -0
  21. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/core.py +94 -8
  22. gitpr_cli-1.4.0/src/domain/baseline/__init__.py +143 -0
  23. gitpr_cli-1.4.0/src/domain/baseline/baseline_comparator.py +268 -0
  24. gitpr_cli-1.4.0/src/domain/baseline/baseline_fingerprint.py +103 -0
  25. gitpr_cli-1.4.0/src/domain/baseline/baseline_manifest.py +291 -0
  26. gitpr_cli-1.4.0/src/domain/baseline/baseline_types.py +289 -0
  27. gitpr_cli-1.4.0/src/domain/baseline/suppression_policy.py +661 -0
  28. gitpr_cli-1.4.0/src/domain/finding/__init__.py +5 -0
  29. gitpr_cli-1.4.0/src/domain/finding/finding_types.py +25 -0
  30. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/linter/sast_finding_mapper.py +5 -1
  31. gitpr_cli-1.4.0/src/domain/mentor/__init__.py +15 -0
  32. gitpr_cli-1.4.0/src/domain/mentor/mentor_explanation_builder.py +228 -0
  33. gitpr_cli-1.4.0/src/domain/policy/__init__.py +116 -0
  34. gitpr_cli-1.4.0/src/domain/policy/policy_checksum.py +60 -0
  35. gitpr_cli-1.4.0/src/domain/policy/policy_compatibility.py +210 -0
  36. gitpr_cli-1.4.0/src/domain/policy/policy_manifest.py +694 -0
  37. gitpr_cli-1.4.0/src/domain/policy/policy_resolver.py +706 -0
  38. gitpr_cli-1.4.0/src/domain/policy/policy_types.py +237 -0
  39. gitpr_cli-1.4.0/src/domain/risk/__init__.py +18 -0
  40. gitpr_cli-1.4.0/src/domain/risk/risk_calculator.py +144 -0
  41. gitpr_cli-1.4.0/src/domain/risk/risk_explanation.py +78 -0
  42. gitpr_cli-1.4.0/src/domain/risk/risk_rules.py +261 -0
  43. gitpr_cli-1.4.0/src/domain/risk/risk_types.py +113 -0
  44. gitpr_cli-1.4.0/src/infrastructure/baseline/__init__.py +28 -0
  45. gitpr_cli-1.4.0/src/infrastructure/baseline/local_baseline_repository.py +355 -0
  46. gitpr_cli-1.4.0/src/infrastructure/git/identity.py +155 -0
  47. gitpr_cli-1.4.0/src/infrastructure/git/risk_history_reader.py +93 -0
  48. gitpr_cli-1.4.0/src/infrastructure/git/test_matcher.py +78 -0
  49. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/linter/external/__init__.py +1 -1
  50. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/linter/external/bandit_bridge.py +1 -1
  51. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/linter/external/base_bridge.py +3 -13
  52. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/linter/external/gitleaks_bridge.py +1 -1
  53. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/linter/external/semgrep_bridge.py +1 -1
  54. gitpr_cli-1.4.0/src/infrastructure/policy/__init__.py +45 -0
  55. gitpr_cli-1.4.0/src/infrastructure/policy/local_policy_repository.py +142 -0
  56. gitpr_cli-1.4.0/src/infrastructure/policy/policy_pack_loader.py +240 -0
  57. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/azure_devops_provider.py +73 -10
  58. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/base.py +90 -4
  59. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/bitbucket_provider.py +76 -9
  60. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/github_provider.py +77 -19
  61. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/gitlab_provider.py +62 -9
  62. gitpr_cli-1.4.0/src/ledger.py +1124 -0
  63. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/linter_engine.py +192 -8
  64. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/main.py +2528 -157
  65. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/mcp_server.py +185 -0
  66. gitpr_cli-1.4.0/src/metrics.py +1105 -0
  67. gitpr_cli-1.4.0/src/policy_packs/laravel-quality/CHANGELOG.md +25 -0
  68. gitpr_cli-1.4.0/src/policy_packs/laravel-quality/README.md +41 -0
  69. gitpr_cli-1.4.0/src/policy_packs/laravel-quality/linter.yml +61 -0
  70. gitpr_cli-1.4.0/src/policy_packs/laravel-quality/policy.yml +110 -0
  71. gitpr_cli-1.4.0/src/policy_packs/node-quality/README.md +27 -0
  72. gitpr_cli-1.4.0/src/policy_packs/node-quality/linter.yml +57 -0
  73. gitpr_cli-1.4.0/src/policy_packs/node-quality/policy.yml +82 -0
  74. gitpr_cli-1.4.0/src/policy_packs/php-security/README.md +33 -0
  75. gitpr_cli-1.4.0/src/policy_packs/php-security/linter.yml +69 -0
  76. gitpr_cli-1.4.0/src/policy_packs/php-security/policy.yml +75 -0
  77. gitpr_cli-1.4.0/src/policy_packs/vue-quality/README.md +29 -0
  78. gitpr_cli-1.4.0/src/policy_packs/vue-quality/linter.yml +50 -0
  79. gitpr_cli-1.4.0/src/policy_packs/vue-quality/policy.yml +78 -0
  80. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/release_engine.py +65 -1
  81. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/review/remote_pr.py +33 -2
  82. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/review/render.py +18 -10
  83. gitpr_cli-1.4.0/src/ui/metrics_app.py +456 -0
  84. gitpr_cli-1.4.0/src/ui/metrics_migration_app.py +173 -0
  85. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/updater.py +3 -3
  86. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/usage_log.py +13 -61
  87. gitpr_cli-1.4.0/tests/test_baseline_cli.py +946 -0
  88. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_commit_classifier.py +49 -1
  89. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_app.py +15 -0
  90. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_external_linters.py +6 -5
  91. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_mcp_server.py +140 -5
  92. gitpr_cli-1.4.0/tests/test_mentor_cli.py +101 -0
  93. gitpr_cli-1.4.0/tests/test_metrics.py +2205 -0
  94. gitpr_cli-1.4.0/tests/test_policy_cli.py +384 -0
  95. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_release_engine.py +152 -0
  96. gitpr_cli-1.4.0/tests/test_risk_cli.py +108 -0
  97. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_usage_log.py +3 -2
  98. gitpr_cli-1.3.0/src/metrics.py +0 -628
  99. gitpr_cli-1.3.0/src/ui/metrics_app.py +0 -450
  100. gitpr_cli-1.3.0/tests/test_metrics.py +0 -854
  101. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/LICENSE +0 -0
  102. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/dependency_links.txt +0 -0
  103. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/entry_points.txt +0 -0
  104. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/gitpr_cli.egg-info/top_level.txt +0 -0
  105. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/setup.cfg +0 -0
  106. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/__init__.py +0 -0
  107. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ai_providers.py +0 -0
  108. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/application/__init__.py +0 -0
  109. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/application/use_cases/__init__.py +0 -0
  110. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/application/use_cases/generate_pr_explanation.py +0 -0
  111. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/application/use_cases/generate_test_file.py +0 -0
  112. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/blame_engine.py +0 -0
  113. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/branding/__init__.py +0 -0
  114. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/branding/badge_builder.py +0 -0
  115. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/branding/badge_data.py +0 -0
  116. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/cache.py +0 -0
  117. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/changelog_builder.py +0 -0
  118. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/chat_memory.py +0 -0
  119. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/__init__.py +0 -0
  120. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/demo_runner.py +0 -0
  121. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/fake_ai_provider.py +0 -0
  122. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/scenarios/__init__.py +0 -0
  123. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/scenarios/laravel_bug_fix.py +0 -0
  124. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/demo/scenarios/security_issue.py +0 -0
  125. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/diff_parser.py +0 -0
  126. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/doc_links.py +0 -0
  127. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/linter/__init__.py +0 -0
  128. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/pr/__init__.py +0 -0
  129. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/pr/explain_section_builder.py +0 -0
  130. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/tests_generation/__init__.py +0 -0
  131. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/tests_generation/framework_detector.py +0 -0
  132. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/tests_generation/test_content_types.py +0 -0
  133. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/domain/tests_generation/test_scaffold_builder.py +0 -0
  134. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/__init__.py +0 -0
  135. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/apply_fix.py +0 -0
  136. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/fix_history.py +0 -0
  137. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/patch_applier.py +0 -0
  138. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/patch_extractor.py +0 -0
  139. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/patch_provenance.py +0 -0
  140. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/patch_safety_classifier.py +0 -0
  141. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/fix/rollback_fix.py +0 -0
  142. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/github_api.py +0 -0
  143. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/i18n.py +0 -0
  144. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/__init__.py +0 -0
  145. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/git/__init__.py +0 -0
  146. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/git/patch_applier.py +0 -0
  147. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/git/selective_stager.py +0 -0
  148. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/__init__.py +0 -0
  149. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/factory.py +0 -0
  150. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/infrastructure/scm/web_links.py +0 -0
  151. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/issue_engine.py +0 -0
  152. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/linter_wizard.py +0 -0
  153. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/net.py +0 -0
  154. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/review/__init__.py +0 -0
  155. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/review/diff_normalizer.py +0 -0
  156. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/review/diff_source.py +0 -0
  157. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/reviewer_resolution.py +0 -0
  158. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/reviewer_suggestion.py +0 -0
  159. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/security.py +0 -0
  160. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/security_ruleset.py +0 -0
  161. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/spinner.py +0 -0
  162. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/__init__.py +0 -0
  163. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/apply_split_plan.py +0 -0
  164. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/generate_split_plan.py +0 -0
  165. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/hunk_grouper.py +0 -0
  166. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/hunk_parser.py +0 -0
  167. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/split/split_plan.py +0 -0
  168. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/suggest_reviewers.py +0 -0
  169. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/tui_issue.py +0 -0
  170. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/__init__.py +0 -0
  171. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/chat_app.py +0 -0
  172. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/config_app.py +0 -0
  173. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/demo/__init__.py +0 -0
  174. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/demo/demo_app.py +0 -0
  175. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/demo/demo_help_screen.py +0 -0
  176. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/demo/demo_screens.py +0 -0
  177. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/help_screen.py +0 -0
  178. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/issue_app.py +0 -0
  179. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/linter_app.py +0 -0
  180. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/pr_publish_app.py +0 -0
  181. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/ui/pr_publish_help.py +0 -0
  182. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/src/version_bump.py +0 -0
  183. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_blame_engine_ranges.py +0 -0
  184. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_blame_metrics.py +0 -0
  185. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_changelog_builder.py +0 -0
  186. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_chat_backend.py +0 -0
  187. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_cli.py +0 -0
  188. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_schema.py +0 -0
  189. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_store.py +0 -0
  190. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_suggest_reviewers.py +0 -0
  191. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_config_validation.py +0 -0
  192. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_core.py +0 -0
  193. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_diff_parser.py +0 -0
  194. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_explain_command.py +0 -0
  195. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_i18n.py +0 -0
  196. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_install_wizard.py +0 -0
  197. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_issue_engine.py +0 -0
  198. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_linter_metrics.py +0 -0
  199. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_linter_presets.py +0 -0
  200. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_main_suggest_reviewers.py +0 -0
  201. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_mcp_prompts.py +0 -0
  202. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_mcp_server_e2e.py +0 -0
  203. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_net_timeouts.py +0 -0
  204. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_plugins.py +0 -0
  205. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_pr_publish_app.py +0 -0
  206. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_pr_publish_linter_modal.py +0 -0
  207. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_pre_save.py +0 -0
  208. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_release_cli.py +0 -0
  209. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_reviewer_resolution.py +0 -0
  210. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_reviewer_suggestion.py +0 -0
  211. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_security_ruleset.py +0 -0
  212. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_skill_command.py +0 -0
  213. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_skill_context.py +0 -0
  214. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_smart_excludes.py +0 -0
  215. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_suggest_reviewers.py +0 -0
  216. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_tests_command.py +0 -0
  217. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_thinking_words.py +0 -0
  218. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_updater.py +0 -0
  219. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/tests/test_version_bump.py +0 -0
  220. {gitpr_cli-1.3.0 → gitpr_cli-1.4.0}/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.0
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,15 @@ 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)
168
173
  * `-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.
174
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
175
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
171
176
  * `-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
177
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
173
178
  * `--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 +184,7 @@ You can pass the following *flags* for specific actions:
179
184
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
180
185
  * `--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
186
  * `--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.
187
+ * `--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
188
  * `--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
189
  * `--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
190
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -237,6 +242,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
237
242
 
238
243
  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
244
 
245
+ ## ⚡ Local Risk Scoring (gitpr risk)
246
+
247
+ 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:
248
+
249
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
250
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
251
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
252
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
253
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
254
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
255
+
256
+ ### Risk Levels & Badges
257
+
258
+ | Level | Score Range | Badge | Meaning |
259
+ |---|---|---|---|
260
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
261
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
262
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
263
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
264
+
265
+ ### Aggregation Formula (50 / 30 / 20)
266
+
267
+ The aggregate PR score combines:
268
+ * **50%**: Maximum individual file score
269
+ * **30%**: Weighted average of file scores by lines changed
270
+ * **20%**: Aggregated critical evidence score
271
+
272
+ ### Review Integration
273
+
274
+ 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.
275
+
276
+ ```bash
277
+ gitpr risk # Compute risk for current diff
278
+ gitpr risk --file src/auth.py # Decompose risk for a single file
279
+ gitpr risk --format json # Output JSON for CI/CD pipelines
280
+ gitpr risk --base main # Evaluate against specific git base ref
281
+ ```
282
+
283
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
284
+
285
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
286
+
287
+ 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.
288
+
289
+ ```bash
290
+ gitpr baseline create # Record the findings of the current diff
291
+ gitpr baseline show # The findings, the decisions and the counts
292
+ gitpr baseline validate # Every defect in the file — exit 1 on any
293
+ gitpr baseline update # Re-record today's diff, keeping decisions
294
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
295
+ gitpr baseline unsuppress <id> # Take a decision back
296
+ ```
297
+
298
+ 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.
299
+
300
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
301
+
302
+ | Key | Default | Effect |
303
+ |---|---|---|
304
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
305
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
306
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
307
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
308
+
309
+ 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.
310
+
311
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
312
+
240
313
  ## 🤝 Co-Author Signature
241
314
 
242
315
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -284,6 +357,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
284
357
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
285
358
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
286
359
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
360
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
287
361
 
288
362
  ## 🌐 Internationalization (i18n)
289
363
 
@@ -490,6 +564,9 @@ If you want to implement GitPR as an automated quality barrier in your team, che
490
564
  * [**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
565
  * [**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
566
  * [**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.
567
+ * [**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.
568
+ * [**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.
569
+ * [**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
570
 
494
571
  ### Configuration & Infrastructure
495
572
 
@@ -144,11 +144,15 @@ 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)
149
153
  * `-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.
154
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
155
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
152
156
  * `-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
157
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
154
158
  * `--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 +164,7 @@ You can pass the following *flags* for specific actions:
160
164
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
161
165
  * `--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
166
  * `--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.
167
+ * `--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
168
  * `--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
169
  * `--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
170
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -218,6 +222,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
218
222
 
219
223
  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
224
 
225
+ ## ⚡ Local Risk Scoring (gitpr risk)
226
+
227
+ 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:
228
+
229
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
230
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
231
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
232
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
233
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
234
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
235
+
236
+ ### Risk Levels & Badges
237
+
238
+ | Level | Score Range | Badge | Meaning |
239
+ |---|---|---|---|
240
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
241
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
242
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
243
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
244
+
245
+ ### Aggregation Formula (50 / 30 / 20)
246
+
247
+ The aggregate PR score combines:
248
+ * **50%**: Maximum individual file score
249
+ * **30%**: Weighted average of file scores by lines changed
250
+ * **20%**: Aggregated critical evidence score
251
+
252
+ ### Review Integration
253
+
254
+ 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.
255
+
256
+ ```bash
257
+ gitpr risk # Compute risk for current diff
258
+ gitpr risk --file src/auth.py # Decompose risk for a single file
259
+ gitpr risk --format json # Output JSON for CI/CD pipelines
260
+ gitpr risk --base main # Evaluate against specific git base ref
261
+ ```
262
+
263
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
264
+
265
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
266
+
267
+ 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.
268
+
269
+ ```bash
270
+ gitpr baseline create # Record the findings of the current diff
271
+ gitpr baseline show # The findings, the decisions and the counts
272
+ gitpr baseline validate # Every defect in the file — exit 1 on any
273
+ gitpr baseline update # Re-record today's diff, keeping decisions
274
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
275
+ gitpr baseline unsuppress <id> # Take a decision back
276
+ ```
277
+
278
+ 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.
279
+
280
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
281
+
282
+ | Key | Default | Effect |
283
+ |---|---|---|
284
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
285
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
286
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
287
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
288
+
289
+ 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.
290
+
291
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
292
+
221
293
  ## 🤝 Co-Author Signature
222
294
 
223
295
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -265,6 +337,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
265
337
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
266
338
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
267
339
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
340
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
268
341
 
269
342
  ## 🌐 Internationalization (i18n)
270
343
 
@@ -471,6 +544,9 @@ If you want to implement GitPR as an automated quality barrier in your team, che
471
544
  * [**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
545
  * [**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
546
  * [**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.
547
+ * [**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.
548
+ * [**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.
549
+ * [**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
550
 
475
551
  ### Configuration & Infrastructure
476
552
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpr-cli
3
- Version: 1.3.0
3
+ Version: 1.4.0
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,15 @@ 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)
168
173
  * `-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.
174
+ * `-r` or `--review`: Performs a detailed **Code Review** of local changes. Use with `--mentor` to append pedagogical mentoring explanations for each finding.
175
+ * `-f` or `--fullreview`: Performs a **Full Code Review** analyzing all changes since the remote branch. Use with `--mentor` to append pedagogical mentoring explanations.
171
176
  * `-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
177
  * `--provider <gemini|deepseek|ollama>`: Forces the use of a specific AI only for this execution, ignoring your default saved in `.env`.
173
178
  * `--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 +184,7 @@ You can pass the following *flags* for specific actions:
179
184
  * `--explain`: Includes the Reviewer Guide section ("Explain my PR") in the Pull Request description.
180
185
  * `--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
186
  * `--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.
187
+ * `--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
188
  * `--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
189
  * `--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
190
  * `-ih` or `--installhooks`: Automatically installs **local Git Hooks** (`pre-commit` and `prepare-commit-msg`) in your repository.
@@ -237,6 +242,74 @@ The wizard shows pre-configured presets (PHPCS, ESLint, Stylelint — controlled
237
242
 
238
243
  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
244
 
245
+ ## ⚡ Local Risk Scoring (gitpr risk)
246
+
247
+ 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:
248
+
249
+ * **Critical Paths & Security (`+25`):** Authentication, billing, credentials, and sensitive operational modules.
250
+ * **Database & Infra (`+20`):** Migrations, schema definitions, CI/CD workflows, Docker, and Kubernetes configs.
251
+ * **Missing Tests (`+15`):** Executable production code modified without matching test updates in the diff.
252
+ * **History Signals (`+10` to `+20`):** Files associated with recent bug fixes, reverts, or high commit churn.
253
+ * **Findings:** Blocker (`+25`) or critical (`+15`) findings reported by static linters and secret scanners.
254
+ * **Test Presence (`-10`):** Mitigating credit when test files are added or modified alongside code changes.
255
+
256
+ ### Risk Levels & Badges
257
+
258
+ | Level | Score Range | Badge | Meaning |
259
+ |---|---|---|---|
260
+ | **LOW** | 0.0 – 24.0 | `LOW 🟢` | Routine changes with low regression likelihood |
261
+ | **MEDIUM** | 25.0 – 49.0 | `MEDIUM 🟡` | Moderate changes requiring normal review vigilance |
262
+ | **HIGH** | 50.0 – 79.0 | `HIGH 🟠` | Significant changes touching critical areas or lacking tests |
263
+ | **CRITICAL** | 80.0 – 100.0 | `CRITICAL 🔴` | High regression exposure, blockers, or sensitive architectural impacts |
264
+
265
+ ### Aggregation Formula (50 / 30 / 20)
266
+
267
+ The aggregate PR score combines:
268
+ * **50%**: Maximum individual file score
269
+ * **30%**: Weighted average of file scores by lines changed
270
+ * **20%**: Aggregated critical evidence score
271
+
272
+ ### Review Integration
273
+
274
+ 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.
275
+
276
+ ```bash
277
+ gitpr risk # Compute risk for current diff
278
+ gitpr risk --file src/auth.py # Decompose risk for a single file
279
+ gitpr risk --format json # Output JSON for CI/CD pipelines
280
+ gitpr risk --base main # Evaluate against specific git base ref
281
+ ```
282
+
283
+ 📖 **Full documentation:** [docs/risk-scoring.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/risk-scoring.md)
284
+
285
+ ## 🧾 Adopting GitPR in a Legacy Repository (gitpr baseline)
286
+
287
+ 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.
288
+
289
+ ```bash
290
+ gitpr baseline create # Record the findings of the current diff
291
+ gitpr baseline show # The findings, the decisions and the counts
292
+ gitpr baseline validate # Every defect in the file — exit 1 on any
293
+ gitpr baseline update # Re-record today's diff, keeping decisions
294
+ gitpr baseline suppress <id> --reason "…" # A decision about one finding
295
+ gitpr baseline unsuppress <id> # Take a decision back
296
+ ```
297
+
298
+ 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.
299
+
300
+ Four variables in `~/.gitpr/.env`, also editable through `gitpr config` in the section **Baseline**:
301
+
302
+ | Key | Default | Effect |
303
+ |---|---|---|
304
+ | `GITPR_BASELINE_ENABLED` | `true` | `false` → no run reads the baseline: the behaviour of every earlier version, byte for byte |
305
+ | `GITPR_BASELINE_PATH` | *(empty)* | `.gitpr/baseline.json`; a relative path resolves from the repository root |
306
+ | `GITPR_BASELINE_REQUIRE_LOCKFILE_CHECKSUM_MATCH` | `true` | A divergent checksum makes the record unusable: the blocking flows refuse and exit non-zero |
307
+ | `GITPR_BASELINE_ALLOW_LOCAL_OVERRIDES` | `true` | `false` → `.gitpr/baseline.overrides.yml` is not read |
308
+
309
+ 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.
310
+
311
+ 📖 **Full documentation:** [docs/baseline-suppressions.md](https://github.com/gitpr-cli/gitpr.git/blob/main/docs/baseline-suppressions.md)
312
+
240
313
  ## 🤝 Co-Author Signature
241
314
 
242
315
  Every commit message generated by GitPR automatically carries the co-author trailer:
@@ -284,6 +357,7 @@ Instead of hiding AI instructions in the source code, GitPR uses local Markdown
284
357
  * `.gitpr.filereview.md`: Defines strict cohesion and coupling rules for full file auditing (used with `--input`).
285
358
  * `.gitpr.issue.md`: Defines the structure and level of detail required for generating standardized Issues (used with `--issue`).
286
359
  * `.gitpr.blame.md`: Defines the focus of archaeological analysis for legacy code tracing (used with `--blame`).
360
+ * `.gitpr.mentor.md`: Defines pedagogical coaching style, analogy framing, and tone for Junior Mentor Mode (used with `gitpr mentor` or `--mentor`).
287
361
 
288
362
  ## 🌐 Internationalization (i18n)
289
363
 
@@ -490,6 +564,9 @@ If you want to implement GitPR as an automated quality barrier in your team, che
490
564
  * [**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
565
  * [**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
566
  * [**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.
567
+ * [**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.
568
+ * [**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.
569
+ * [**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
570
 
494
571
  ### Configuration & Infrastructure
495
572
 
@@ -22,6 +22,7 @@ src/doc_links.py
22
22
  src/github_api.py
23
23
  src/i18n.py
24
24
  src/issue_engine.py
25
+ src/ledger.py
25
26
  src/linter_engine.py
26
27
  src/linter_wizard.py
27
28
  src/main.py
@@ -41,8 +42,19 @@ src/usage_log.py
41
42
  src/version_bump.py
42
43
  src/application/__init__.py
43
44
  src/application/use_cases/__init__.py
45
+ src/application/use_cases/activate_policy_pack.py
46
+ src/application/use_cases/baseline_gate.py
47
+ src/application/use_cases/baseline_summary.py
48
+ src/application/use_cases/calculate_risk.py
49
+ src/application/use_cases/compare_against_baseline.py
50
+ src/application/use_cases/create_baseline.py
51
+ src/application/use_cases/generate_mentor_explanation.py
44
52
  src/application/use_cases/generate_pr_explanation.py
45
53
  src/application/use_cases/generate_test_file.py
54
+ src/application/use_cases/install_policy_pack.py
55
+ src/application/use_cases/resolve_effective_policy.py
56
+ src/application/use_cases/suppress_finding.py
57
+ src/application/use_cases/validate_policy_pack.py
46
58
  src/branding/__init__.py
47
59
  src/branding/badge_builder.py
48
60
  src/branding/badge_data.py
@@ -52,10 +64,31 @@ src/demo/fake_ai_provider.py
52
64
  src/demo/scenarios/__init__.py
53
65
  src/demo/scenarios/laravel_bug_fix.py
54
66
  src/demo/scenarios/security_issue.py
67
+ src/domain/baseline/__init__.py
68
+ src/domain/baseline/baseline_comparator.py
69
+ src/domain/baseline/baseline_fingerprint.py
70
+ src/domain/baseline/baseline_manifest.py
71
+ src/domain/baseline/baseline_types.py
72
+ src/domain/baseline/suppression_policy.py
73
+ src/domain/finding/__init__.py
74
+ src/domain/finding/finding_types.py
55
75
  src/domain/linter/__init__.py
56
76
  src/domain/linter/sast_finding_mapper.py
77
+ src/domain/mentor/__init__.py
78
+ src/domain/mentor/mentor_explanation_builder.py
79
+ src/domain/policy/__init__.py
80
+ src/domain/policy/policy_checksum.py
81
+ src/domain/policy/policy_compatibility.py
82
+ src/domain/policy/policy_manifest.py
83
+ src/domain/policy/policy_resolver.py
84
+ src/domain/policy/policy_types.py
57
85
  src/domain/pr/__init__.py
58
86
  src/domain/pr/explain_section_builder.py
87
+ src/domain/risk/__init__.py
88
+ src/domain/risk/risk_calculator.py
89
+ src/domain/risk/risk_explanation.py
90
+ src/domain/risk/risk_rules.py
91
+ src/domain/risk/risk_types.py
59
92
  src/domain/tests_generation/__init__.py
60
93
  src/domain/tests_generation/framework_detector.py
61
94
  src/domain/tests_generation/test_content_types.py
@@ -69,14 +102,22 @@ src/fix/patch_provenance.py
69
102
  src/fix/patch_safety_classifier.py
70
103
  src/fix/rollback_fix.py
71
104
  src/infrastructure/__init__.py
105
+ src/infrastructure/baseline/__init__.py
106
+ src/infrastructure/baseline/local_baseline_repository.py
72
107
  src/infrastructure/git/__init__.py
108
+ src/infrastructure/git/identity.py
73
109
  src/infrastructure/git/patch_applier.py
110
+ src/infrastructure/git/risk_history_reader.py
74
111
  src/infrastructure/git/selective_stager.py
112
+ src/infrastructure/git/test_matcher.py
75
113
  src/infrastructure/linter/external/__init__.py
76
114
  src/infrastructure/linter/external/bandit_bridge.py
77
115
  src/infrastructure/linter/external/base_bridge.py
78
116
  src/infrastructure/linter/external/gitleaks_bridge.py
79
117
  src/infrastructure/linter/external/semgrep_bridge.py
118
+ src/infrastructure/policy/__init__.py
119
+ src/infrastructure/policy/local_policy_repository.py
120
+ src/infrastructure/policy/policy_pack_loader.py
80
121
  src/infrastructure/scm/__init__.py
81
122
  src/infrastructure/scm/azure_devops_provider.py
82
123
  src/infrastructure/scm/base.py
@@ -85,6 +126,19 @@ src/infrastructure/scm/factory.py
85
126
  src/infrastructure/scm/github_provider.py
86
127
  src/infrastructure/scm/gitlab_provider.py
87
128
  src/infrastructure/scm/web_links.py
129
+ src/policy_packs/laravel-quality/CHANGELOG.md
130
+ src/policy_packs/laravel-quality/README.md
131
+ src/policy_packs/laravel-quality/linter.yml
132
+ src/policy_packs/laravel-quality/policy.yml
133
+ src/policy_packs/node-quality/README.md
134
+ src/policy_packs/node-quality/linter.yml
135
+ src/policy_packs/node-quality/policy.yml
136
+ src/policy_packs/php-security/README.md
137
+ src/policy_packs/php-security/linter.yml
138
+ src/policy_packs/php-security/policy.yml
139
+ src/policy_packs/vue-quality/README.md
140
+ src/policy_packs/vue-quality/linter.yml
141
+ src/policy_packs/vue-quality/policy.yml
88
142
  src/review/__init__.py
89
143
  src/review/diff_normalizer.py
90
144
  src/review/diff_source.py
@@ -103,12 +157,14 @@ src/ui/help_screen.py
103
157
  src/ui/issue_app.py
104
158
  src/ui/linter_app.py
105
159
  src/ui/metrics_app.py
160
+ src/ui/metrics_migration_app.py
106
161
  src/ui/pr_publish_app.py
107
162
  src/ui/pr_publish_help.py
108
163
  src/ui/demo/__init__.py
109
164
  src/ui/demo/demo_app.py
110
165
  src/ui/demo/demo_help_screen.py
111
166
  src/ui/demo/demo_screens.py
167
+ tests/test_baseline_cli.py
112
168
  tests/test_blame_engine_ranges.py
113
169
  tests/test_blame_metrics.py
114
170
  tests/test_changelog_builder.py
@@ -133,9 +189,11 @@ tests/test_main_suggest_reviewers.py
133
189
  tests/test_mcp_prompts.py
134
190
  tests/test_mcp_server.py
135
191
  tests/test_mcp_server_e2e.py
192
+ tests/test_mentor_cli.py
136
193
  tests/test_metrics.py
137
194
  tests/test_net_timeouts.py
138
195
  tests/test_plugins.py
196
+ tests/test_policy_cli.py
139
197
  tests/test_pr_publish_app.py
140
198
  tests/test_pr_publish_linter_modal.py
141
199
  tests/test_pre_save.py
@@ -143,6 +201,7 @@ tests/test_release_cli.py
143
201
  tests/test_release_engine.py
144
202
  tests/test_reviewer_resolution.py
145
203
  tests/test_reviewer_suggestion.py
204
+ tests/test_risk_cli.py
146
205
  tests/test_security_ruleset.py
147
206
  tests/test_skill_command.py
148
207
  tests/test_skill_context.py
@@ -7,3 +7,4 @@ pyyaml
7
7
  textual
8
8
  requests
9
9
  mcp>=1.0.0
10
+ packaging>=23.0
@@ -20,7 +20,8 @@ dependencies = [
20
20
  "pyyaml",
21
21
  "textual",
22
22
  "requests",
23
- "mcp>=1.0.0"
23
+ "mcp>=1.0.0",
24
+ "packaging>=23.0"
24
25
  ]
25
26
 
26
27
  [project.scripts]
@@ -31,6 +32,13 @@ gitpr-mcp = "src.mcp_server:main"
31
32
  where = ["."]
32
33
  include = ["src", "src.*"]
33
34
 
35
+ # The bundled policy packs are data, not code: the four directories under
36
+ # src/policy_packs ship inside the wheel, and without this block a built package
37
+ # would find no packs at all while the source tree found four. MANIFEST.in is
38
+ # not used anywhere in this project, so there is one place to look.
39
+ [tool.setuptools.package-data]
40
+ "src.policy_packs" = ["**/*.yml", "**/*.yaml", "**/*.md"]
41
+
34
42
  [tool.setuptools.dynamic]
35
43
  version = {attr = "src.updater.__version__"}
36
44