patchwise 0.9.5__tar.gz → 0.9.6__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 (147) hide show
  1. {patchwise-0.9.5 → patchwise-0.9.6}/PKG-INFO +75 -6
  2. {patchwise-0.9.5 → patchwise-0.9.6}/README.md +72 -1
  3. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/default_config.yaml +36 -0
  4. patchwise-0.9.6/patchwise/docker.py +711 -0
  5. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/main.py +37 -5
  6. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/agent.py +112 -82
  7. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/ai_fix.py +15 -45
  8. patchwise-0.9.6/patchwise/patch_review/ai_fix/checkpatch_fixer.py +538 -0
  9. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/sparse_fixer.py +40 -95
  10. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ai_code_review.py +11 -4
  11. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ts_indexer.py +82 -45
  12. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/checkpatch.py +32 -1
  13. patchwise-0.9.6/patchwise/patch_review/static_analysis/checkpatch_filter.py +208 -0
  14. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/static_analysis.py +3 -2
  15. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/utils/config.py +61 -3
  16. patchwise-0.9.6/patchwise/utils/config_tui.py +688 -0
  17. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/PKG-INFO +75 -6
  18. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/SOURCES.txt +5 -1
  19. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/requires.txt +2 -4
  20. {patchwise-0.9.5 → patchwise-0.9.6}/pyproject.toml +3 -6
  21. patchwise-0.9.6/tests/test_config.py +74 -0
  22. patchwise-0.9.6/tests/test_docker.py +560 -0
  23. patchwise-0.9.6/tests/test_docker_exec.py +286 -0
  24. patchwise-0.9.5/patchwise/docker.py +0 -903
  25. patchwise-0.9.5/patchwise/patch_review/ai_fix/checkpatch_fixer.py +0 -688
  26. patchwise-0.9.5/patchwise/patch_review/ai_fix/kernel_docs_rag.py +0 -469
  27. {patchwise-0.9.5 → patchwise-0.9.6}/LICENSE.txt +0 -0
  28. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/__init__.py +0 -0
  29. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/AiCodeReview.Dockerfile +0 -0
  30. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/Checkpatch.Dockerfile +0 -0
  31. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/Coccicheck.Dockerfile +0 -0
  32. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/CrashdumpAgent.Dockerfile +0 -0
  33. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/DtCheck.Dockerfile +0 -0
  34. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/DtbsCheck.Dockerfile +0 -0
  35. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/LLMCommitAudit.Dockerfile +0 -0
  36. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/Sparse.Dockerfile +0 -0
  37. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/dockerfiles/base.Dockerfile +0 -0
  38. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/logger_setup.py +0 -0
  39. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/__init__.py +0 -0
  40. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/ai_models.py +0 -0
  41. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/cli.py +0 -0
  42. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/config.py +0 -0
  43. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/handler.py +0 -0
  44. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/mail_client.py +0 -0
  45. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/mail_handler/utils.py +0 -0
  46. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/__init__.py +0 -0
  47. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/__init__.py +0 -0
  48. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/tool_definitions.py +0 -0
  49. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/__init__.py +0 -0
  50. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/ai_patch_fix.py +0 -0
  51. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/__init__.py +0 -0
  52. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ai_review.py +0 -0
  53. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/fetch_reviewer_comment.py +0 -0
  54. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/llm_commit_audit.py +0 -0
  55. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/review_prompts.py +0 -0
  56. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/root_cause_analysis.py +0 -0
  57. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ts_cache.py +0 -0
  58. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/decorators.py +0 -0
  59. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/kernel_tree.py +0 -0
  60. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/patch_review.py +0 -0
  61. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/__init__.py +0 -0
  62. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/coccicheck.py +0 -0
  63. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/dt_check.py +0 -0
  64. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/dtbs_check.py +0 -0
  65. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/sparse.py +0 -0
  66. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/stats/__init__.py +0 -0
  67. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/stats/dashboard.py +0 -0
  68. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/ui/__init__.py +0 -0
  69. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/ui/dashboard.py +0 -0
  70. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/ui/events.py +0 -0
  71. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/ui/screen.py +0 -0
  72. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/utils/decorators.py +0 -0
  73. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/utils/lru_cache.py +0 -0
  74. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/utils/repo_workspace.py +0 -0
  75. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise/utils/tui.py +0 -0
  76. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/dependency_links.txt +0 -0
  77. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/entry_points.txt +0 -0
  78. {patchwise-0.9.5 → patchwise-0.9.6}/patchwise.egg-info/top_level.txt +0 -0
  79. {patchwise-0.9.5 → patchwise-0.9.6}/setup.cfg +0 -0
  80. {patchwise-0.9.5 → patchwise-0.9.6}/tests/test_mail_handler_series_refs.py +0 -0
  81. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/false-positive-guide.md +0 -0
  82. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/alignment.md +0 -0
  83. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/arm64.md +0 -0
  84. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/ata.md +0 -0
  85. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/block.md +0 -0
  86. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/bluetooth.md +0 -0
  87. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/boot-params.md +0 -0
  88. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/bpf.md +0 -0
  89. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/btf.md +0 -0
  90. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/btrfs.md +0 -0
  91. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/build.md +0 -0
  92. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/cleanup.md +0 -0
  93. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/cxl.md +0 -0
  94. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/dax.md +0 -0
  95. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/drm.md +0 -0
  96. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/dt-bindings.md +0 -0
  97. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/fscrypt.md +0 -0
  98. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/gic-v3.md +0 -0
  99. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/gic-v5.md +0 -0
  100. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/hid.md +0 -0
  101. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/hyp-arm64.md +0 -0
  102. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/i2c.md +0 -0
  103. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/input.md +0 -0
  104. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/io-accessors.md +0 -0
  105. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/io_uring.md +0 -0
  106. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kconfig.md +0 -0
  107. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kho.md +0 -0
  108. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kvm-arm64.md +0 -0
  109. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kvm.md +0 -0
  110. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/libbpf.md +0 -0
  111. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/locking.md +0 -0
  112. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mips.md +0 -0
  113. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-alloc.md +0 -0
  114. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-folio.md +0 -0
  115. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-largepage.md +0 -0
  116. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-pagetable.md +0 -0
  117. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-reclaim.md +0 -0
  118. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-vma.md +0 -0
  119. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/netlink.md +0 -0
  120. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/networking-core.md +0 -0
  121. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/networking-drivers.md +0 -0
  122. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/nfsd.md +0 -0
  123. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/objtool.md +0 -0
  124. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/of.md +0 -0
  125. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pci.md +0 -0
  126. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/perf.md +0 -0
  127. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pm.md +0 -0
  128. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pmdomain.md +0 -0
  129. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/rcu.md +0 -0
  130. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/rust.md +0 -0
  131. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/scheduler.md +0 -0
  132. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/selftests.md +0 -0
  133. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/smb-ksmbd.md +0 -0
  134. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subjective-review.md +0 -0
  135. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subsystem-template.md +0 -0
  136. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subsystem.md +0 -0
  137. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/sunrpc.md +0 -0
  138. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/syscall.md +0 -0
  139. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/sysfs.md +0 -0
  140. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/timers.md +0 -0
  141. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/tracing.md +0 -0
  142. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/tty.md +0 -0
  143. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/usb-storage.md +0 -0
  144. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/vfs.md +0 -0
  145. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/wireless.md +0 -0
  146. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/workqueue.md +0 -0
  147. {patchwise-0.9.5 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/technical-patterns.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchwise
3
- Version: 0.9.5
3
+ Version: 0.9.6
4
4
  Summary: AI Code Review, Root Cause Analysis and Static Analysis for the Linux kernel
5
5
  Author-email: "Qualcomm Technologies, Inc." <qc.opensource@qti.qualcomm.com>
6
6
  Maintainer-email: Aditya Chillara <achillar@qti.qualcomm.com>
@@ -10,9 +10,8 @@ Requires-Python: >=3.10
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: LICENSE.txt
12
12
  Requires-Dist: Sphinx>=8.1.3
13
- Requires-Dist: litellm<=1.105.4,>=1.103.0
13
+ Requires-Dist: litellm==1.105.4
14
14
  Requires-Dist: cachetools>=5.5.2
15
- Requires-Dist: chromadb>=0.4.0
16
15
  Requires-Dist: yamllint>=1.26.3
17
16
  Requires-Dist: ply>=3.11
18
17
  Requires-Dist: GitPython>=3.1.44
@@ -24,8 +23,6 @@ Requires-Dist: blessed>=1.20
24
23
  Requires-Dist: tqdm>=4.67.1
25
24
  Requires-Dist: platformdirs>=4.3.8
26
25
  Requires-Dist: requests>=2.31.0
27
- Requires-Dist: sentence-transformers>=5.6.0
28
- Requires-Dist: chromadb>=1.5.9
29
26
  Requires-Dist: imapclient>=3.0.0
30
27
  Requires-Dist: fastapi>=0.110
31
28
  Requires-Dist: uvicorn>=0.29
@@ -33,6 +30,7 @@ Requires-Dist: pygments>=2.19.0
33
30
  Requires-Dist: redis>=5
34
31
  Requires-Dist: tree-sitter>=0.24
35
32
  Requires-Dist: tree-sitter-c>=0.23
33
+ Requires-Dist: docker<8.0.0,>=7.1.0
36
34
  Dynamic: license-file
37
35
 
38
36
  # PatchWise
@@ -50,11 +48,11 @@ Dynamic: license-file
50
48
  - [Getting Started](#getting-started)
51
49
  - [Prerequisites](#prerequisites)
52
50
  - [Installation](#installation)
51
+ - [Configuration](#configuration)
53
52
  - [Usage](#usage)
54
53
  - [AI Code Review](#ai-code-review)
55
54
  - [Crashdump Root-Cause Analysis](#crashdump-root-cause-analysis)
56
55
  - [Mail Mode](#mail-mode)
57
- - [Configuration](#configuration)
58
56
  - [Command-Line Options](#command-line-options)
59
57
  - [Development](#development)
60
58
  - [Getting in Contact](#getting-in-contact)
@@ -80,6 +78,7 @@ Dynamic: license-file
80
78
  ### Prerequisites
81
79
 
82
80
  - Python 3.10 or newer
81
+ - `uv` for source installs from the checked-in lockfile
83
82
  - Access to a Linux kernel git repository
84
83
  - Docker installed, with permissions to run Docker commands (PatchWise runs reviews inside Docker containers)
85
84
 
@@ -104,6 +103,18 @@ Dynamic: license-file
104
103
  pip install git+https://github.com/qualcomm/PatchWise.git@main
105
104
  ```
106
105
 
106
+ For a source install using the checked-in `uv.lock`, clone the repository
107
+ and sync the environment from its root:
108
+
109
+ ```bash
110
+ git clone https://github.com/qualcomm/PatchWise.git
111
+ cd PatchWise
112
+ uv sync --locked
113
+ uv run --locked patchwise --help
114
+ ```
115
+
116
+ `uv sync --locked` installs PatchWise and its dependencies using the lockfile.
117
+
107
118
  1. **Set up your API key:**
108
119
 
109
120
  Obtain your API key from your provider and set it as an environment variable:
@@ -130,6 +141,10 @@ Dynamic: license-file
130
141
  patchwise --help
131
142
  ```
132
143
 
144
+ ### Configuration
145
+
146
+ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml) (shipped defaults) under `~/.config/patchwise_config.yaml` (user overrides) — see that file for all available options. Run `patchwise --config` for an interactive menuconfig-style TUI to browse and edit these options instead of hand-editing the YAML.
147
+
133
148
  ## Usage
134
149
 
135
150
  1. **Run PatchWise:**
@@ -330,6 +345,25 @@ mail:
330
345
 
331
346
  PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml) (shipped defaults) under `~/.config/patchwise_config.yaml` (user overrides) — see that file for all available options.
332
347
 
348
+ To include the false-positive filter's severity rating in code-review findings, set:
349
+
350
+ ```yaml
351
+ ai:
352
+ code_review:
353
+ output_severity: true
354
+ ```
355
+
356
+ This adds `[low]`, `[medium]`, or `[high]` before each rated finding in inline and
357
+ Gerrit output, alongside `[likely false positive]` when applicable. Findings with
358
+ missing or unrecognized ratings remain unlabeled. The default is `false`; this
359
+ option does not change which findings are kept or dropped.
360
+
361
+ After merging defaults and user overrides, `ai.code_review` must be a mapping
362
+ and `output_severity` must be a boolean (`true` or `false`, without quotes).
363
+ Other types raise a configuration error.
364
+
365
+ Set `static_analysis.Checkpatch.ai_filter.enabled` to `true` to enable AI filtering of Checkpatch false positives (off by default).
366
+
333
367
  ## Command-Line Options
334
368
 
335
369
  - `-h`, `--help`: Show help message and exit
@@ -337,6 +371,7 @@ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml
337
371
  - `--rca`: Root-cause a kernel crashdump folder instead of reviewing commits. See [Crashdump Root-Cause Analysis](#crashdump-root-cause-analysis).
338
372
  - `--plain`: Disable the live dashboard and use plain log output.
339
373
  - `--stats`: Serve the observability web dashboard instead of running a review, computed from the artifacts under the sandbox.
374
+ - `--config`: Launch an interactive menuconfig-style TUI to view and edit `~/.config/patchwise_config.yaml` instead of running a review.
340
375
  - `--output-dir`: Directory to save the review/RCA results. (default: `/tmp/patchwise/output`, overridable via `PATCHWISE_OUTPUT_PATH`)
341
376
 
342
377
  ### Patch Review Options
@@ -406,6 +441,40 @@ If you'd like to develop new features or fix existing issues:
406
441
 
407
442
  Please make sure to follow our contribution guidelines before submitting a pull request. [CONTRIBUTING.md](CONTRIBUTING.md)
408
443
 
444
+ ### Docker Execution API
445
+
446
+ Code integrating with `DockerManager` should use `exec_command()` instead of the
447
+ removed `run_command()`, `run_stdin_command()`, `run_interactive_command()` and
448
+ `DockerExecProcess` compatibility adapter. Supply complete buffered stdin through
449
+ `input=` rather than `communicate(input=...)`:
450
+
451
+ ```python
452
+ result = manager.exec_command(["git", "hash-object", "--stdin"], input="content")
453
+ if result.exit_code != 0:
454
+ raise RuntimeError(result.stderr_text())
455
+ sha = result.stdout_text().strip()
456
+ ```
457
+
458
+ `DockerExecResult` is immutable and keeps `stdout` and `stderr` as bytes. Use
459
+ `stdout_text()` and `stderr_text()` for decoding (UTF-8 with replacement by
460
+ default), or keep the bytes for binary output. String input is encoded as UTF-8;
461
+ bytes are sent unchanged. Stdin is closed when no input is supplied.
462
+
463
+ `wait_timeout=` limits the client wait, **not** the container command's lifetime.
464
+ Enforce command deadlines inside the container. At the wait boundary, a worker
465
+ that is complete when checked can still supply its result or original exception;
466
+ this is intentionally best-effort, not a strict result cutoff. Otherwise a client
467
+ wait expiration raises `TimeoutError` without complete output or an exit code.
468
+ The worker may remain alive, and the command is **not cancelled**. Do not retry
469
+ such failures automatically. The progress timer in `run_cmd_with_timer()` is
470
+ independent of command deadlines and retains both stdout and stderr debug logs.
471
+
472
+ **Docker safety invariants:** Keep image builds on the Docker CLI to preserve
473
+ BuildKit and registry-specific credential lookup. Preserve review-container
474
+ network isolation and read-only default mounts, with explicit writable mounts
475
+ for managed volumes. Remove containers before releasing their overlay volumes.
476
+ Never stop a shared container to handle an individual exec timeout.
477
+
409
478
  ## Getting in Contact
410
479
 
411
480
  - [Report an Issue on GitHub](../../issues/new/choose)
@@ -13,11 +13,11 @@
13
13
  - [Getting Started](#getting-started)
14
14
  - [Prerequisites](#prerequisites)
15
15
  - [Installation](#installation)
16
+ - [Configuration](#configuration)
16
17
  - [Usage](#usage)
17
18
  - [AI Code Review](#ai-code-review)
18
19
  - [Crashdump Root-Cause Analysis](#crashdump-root-cause-analysis)
19
20
  - [Mail Mode](#mail-mode)
20
- - [Configuration](#configuration)
21
21
  - [Command-Line Options](#command-line-options)
22
22
  - [Development](#development)
23
23
  - [Getting in Contact](#getting-in-contact)
@@ -43,6 +43,7 @@
43
43
  ### Prerequisites
44
44
 
45
45
  - Python 3.10 or newer
46
+ - `uv` for source installs from the checked-in lockfile
46
47
  - Access to a Linux kernel git repository
47
48
  - Docker installed, with permissions to run Docker commands (PatchWise runs reviews inside Docker containers)
48
49
 
@@ -67,6 +68,18 @@
67
68
  pip install git+https://github.com/qualcomm/PatchWise.git@main
68
69
  ```
69
70
 
71
+ For a source install using the checked-in `uv.lock`, clone the repository
72
+ and sync the environment from its root:
73
+
74
+ ```bash
75
+ git clone https://github.com/qualcomm/PatchWise.git
76
+ cd PatchWise
77
+ uv sync --locked
78
+ uv run --locked patchwise --help
79
+ ```
80
+
81
+ `uv sync --locked` installs PatchWise and its dependencies using the lockfile.
82
+
70
83
  1. **Set up your API key:**
71
84
 
72
85
  Obtain your API key from your provider and set it as an environment variable:
@@ -93,6 +106,10 @@
93
106
  patchwise --help
94
107
  ```
95
108
 
109
+ ### Configuration
110
+
111
+ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml) (shipped defaults) under `~/.config/patchwise_config.yaml` (user overrides) — see that file for all available options. Run `patchwise --config` for an interactive menuconfig-style TUI to browse and edit these options instead of hand-editing the YAML.
112
+
96
113
  ## Usage
97
114
 
98
115
  1. **Run PatchWise:**
@@ -293,6 +310,25 @@ mail:
293
310
 
294
311
  PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml) (shipped defaults) under `~/.config/patchwise_config.yaml` (user overrides) — see that file for all available options.
295
312
 
313
+ To include the false-positive filter's severity rating in code-review findings, set:
314
+
315
+ ```yaml
316
+ ai:
317
+ code_review:
318
+ output_severity: true
319
+ ```
320
+
321
+ This adds `[low]`, `[medium]`, or `[high]` before each rated finding in inline and
322
+ Gerrit output, alongside `[likely false positive]` when applicable. Findings with
323
+ missing or unrecognized ratings remain unlabeled. The default is `false`; this
324
+ option does not change which findings are kept or dropped.
325
+
326
+ After merging defaults and user overrides, `ai.code_review` must be a mapping
327
+ and `output_severity` must be a boolean (`true` or `false`, without quotes).
328
+ Other types raise a configuration error.
329
+
330
+ Set `static_analysis.Checkpatch.ai_filter.enabled` to `true` to enable AI filtering of Checkpatch false positives (off by default).
331
+
296
332
  ## Command-Line Options
297
333
 
298
334
  - `-h`, `--help`: Show help message and exit
@@ -300,6 +336,7 @@ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml
300
336
  - `--rca`: Root-cause a kernel crashdump folder instead of reviewing commits. See [Crashdump Root-Cause Analysis](#crashdump-root-cause-analysis).
301
337
  - `--plain`: Disable the live dashboard and use plain log output.
302
338
  - `--stats`: Serve the observability web dashboard instead of running a review, computed from the artifacts under the sandbox.
339
+ - `--config`: Launch an interactive menuconfig-style TUI to view and edit `~/.config/patchwise_config.yaml` instead of running a review.
303
340
  - `--output-dir`: Directory to save the review/RCA results. (default: `/tmp/patchwise/output`, overridable via `PATCHWISE_OUTPUT_PATH`)
304
341
 
305
342
  ### Patch Review Options
@@ -369,6 +406,40 @@ If you'd like to develop new features or fix existing issues:
369
406
 
370
407
  Please make sure to follow our contribution guidelines before submitting a pull request. [CONTRIBUTING.md](CONTRIBUTING.md)
371
408
 
409
+ ### Docker Execution API
410
+
411
+ Code integrating with `DockerManager` should use `exec_command()` instead of the
412
+ removed `run_command()`, `run_stdin_command()`, `run_interactive_command()` and
413
+ `DockerExecProcess` compatibility adapter. Supply complete buffered stdin through
414
+ `input=` rather than `communicate(input=...)`:
415
+
416
+ ```python
417
+ result = manager.exec_command(["git", "hash-object", "--stdin"], input="content")
418
+ if result.exit_code != 0:
419
+ raise RuntimeError(result.stderr_text())
420
+ sha = result.stdout_text().strip()
421
+ ```
422
+
423
+ `DockerExecResult` is immutable and keeps `stdout` and `stderr` as bytes. Use
424
+ `stdout_text()` and `stderr_text()` for decoding (UTF-8 with replacement by
425
+ default), or keep the bytes for binary output. String input is encoded as UTF-8;
426
+ bytes are sent unchanged. Stdin is closed when no input is supplied.
427
+
428
+ `wait_timeout=` limits the client wait, **not** the container command's lifetime.
429
+ Enforce command deadlines inside the container. At the wait boundary, a worker
430
+ that is complete when checked can still supply its result or original exception;
431
+ this is intentionally best-effort, not a strict result cutoff. Otherwise a client
432
+ wait expiration raises `TimeoutError` without complete output or an exit code.
433
+ The worker may remain alive, and the command is **not cancelled**. Do not retry
434
+ such failures automatically. The progress timer in `run_cmd_with_timer()` is
435
+ independent of command deadlines and retains both stdout and stderr debug logs.
436
+
437
+ **Docker safety invariants:** Keep image builds on the Docker CLI to preserve
438
+ BuildKit and registry-specific credential lookup. Preserve review-container
439
+ network isolation and read-only default mounts, with explicit writable mounts
440
+ for managed volumes. Remove containers before releasing their overlay volumes.
441
+ Never stop a shared container to handle an individual exec timeout.
442
+
372
443
  ## Getting in Contact
373
444
 
374
445
  - [Report an Issue on GitHub](../../issues/new/choose)
@@ -32,25 +32,61 @@ ai:
32
32
  models: {}
33
33
  # Accepts: "inline" or "gerrit".
34
34
  output_format: "inline"
35
+ code_review:
36
+ # Prefix findings with the filter's low/medium/high impact rating.
37
+ output_severity: false
38
+ # Shown once before the first review, asking the user to confirm their API key
39
+ # may be used. Suppressed permanently once "Yes. Don't show again" is chosen.
35
40
  api_key_disclaimer:
41
+ # Text shown in the disclaimer prompt.
36
42
  message: "PatchWise uses LiteLLM to interact with your preferred model provider (default: OpenAI). LiteLLM will automatically retrieve the API key from your environment variables if it is set based on the API URL provided to LiteLLM (default: OpenAI). Please confirm that you acknowledge that your API key may be used, if set in your environment. Select 'Yes' to proceed, 'No' to abort, and 'Yes. Don't show again' to proceed and disable this prompt."
43
+ # Selectable responses to the disclaimer prompt. Not user-editable in
44
+ # practice; changing this list changes what display_prompt_with_options()
45
+ # can return.
37
46
  options: ["Yes", "No", "Yes. Don't show again"]
47
+ # Set to true (via "Yes. Don't show again") to stop showing the disclaimer.
38
48
  no_reprompt: false
49
+ # Mailing-list mode (--mail): mailbox credentials and reply routing/filtering.
39
50
  mail:
51
+ # IMAP/SMTP login address.
40
52
  email: "patchwise@qualcomm.com"
53
+ # IMAP/SMTP password (or app password).
41
54
  password: ""
55
+ # From: address used on outgoing review replies.
42
56
  from_email: "Patchwise <patchwise@qualcomm.com>"
57
+ # Only process mail whose sender's domain is in this list.
43
58
  accepted_sender_domains: []
59
+ # Only process mail addressed to one of these mailing lists.
44
60
  accepted_lists: []
61
+ # Mailing-list addresses that have moved; mail sent to one of these gets an
62
+ # automatic "please use the new list" reply instead of a review.
45
63
  deprecated_lists: {}
64
+ # Addresses always CC'd on review replies, regardless of send_mode.
46
65
  always_cc: []
66
+ # Extra addresses CC'd on review replies when send_mode is 2.
47
67
  additional_cc: []
68
+ # Who review replies are addressed to: 0 = always_cc only (falls back to
69
+ # the sender if empty); 1 = sender + always_cc; 2 = sender + original
70
+ # To/Cc (filtered to accepted_sender_domains) + always_cc + additional_cc.
48
71
  send_mode: 2
49
72
  imap:
73
+ # IMAP server hostname.
50
74
  server: "imap.gmail.com"
75
+ # IMAP server port.
51
76
  port: 993
77
+ # Whether to connect to IMAP over SSL.
52
78
  ssl: true
53
79
  smtp:
80
+ # SMTP server hostname.
54
81
  server: "smtp.gmail.com"
82
+ # SMTP server port.
55
83
  port: 465
84
+ # Whether to connect to SMTP over SSL.
56
85
  ssl: true
86
+
87
+ static_analysis:
88
+ Checkpatch:
89
+ ai_filter:
90
+ # Optional AI suppression of clear false positives. Failures keep raw output.
91
+ enabled: false
92
+ # model: "openai/responses/Pro" # defaults to the active AI model