patchwise 0.9.4__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.
- {patchwise-0.9.4 → patchwise-0.9.6}/PKG-INFO +80 -11
- {patchwise-0.9.4 → patchwise-0.9.6}/README.md +77 -6
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/default_config.yaml +38 -2
- patchwise-0.9.6/patchwise/docker.py +711 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/main.py +37 -5
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/__init__.py +5 -2
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/agent.py +115 -83
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/ai_fix.py +15 -45
- patchwise-0.9.6/patchwise/patch_review/ai_fix/checkpatch_fixer.py +538 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/sparse_fixer.py +40 -95
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ai_code_review.py +61 -88
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ts_indexer.py +82 -45
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/patch_review.py +4 -1
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/checkpatch.py +32 -1
- patchwise-0.9.6/patchwise/patch_review/static_analysis/checkpatch_filter.py +208 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/static_analysis.py +3 -2
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/utils/config.py +61 -3
- patchwise-0.9.6/patchwise/utils/config_tui.py +688 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/PKG-INFO +80 -11
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/SOURCES.txt +5 -1
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/requires.txt +2 -4
- {patchwise-0.9.4 → patchwise-0.9.6}/pyproject.toml +3 -6
- patchwise-0.9.6/tests/test_config.py +74 -0
- patchwise-0.9.6/tests/test_docker.py +560 -0
- patchwise-0.9.6/tests/test_docker_exec.py +286 -0
- patchwise-0.9.4/patchwise/docker.py +0 -902
- patchwise-0.9.4/patchwise/patch_review/ai_fix/checkpatch_fixer.py +0 -688
- patchwise-0.9.4/patchwise/patch_review/ai_fix/kernel_docs_rag.py +0 -469
- {patchwise-0.9.4 → patchwise-0.9.6}/LICENSE.txt +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/AiCodeReview.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/Checkpatch.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/Coccicheck.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/CrashdumpAgent.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/DtCheck.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/DtbsCheck.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/LLMCommitAudit.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/Sparse.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/dockerfiles/base.Dockerfile +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/logger_setup.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/ai_models.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/cli.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/config.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/handler.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/mail_client.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/mail_handler/utils.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_agent/tool_definitions.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_fix/ai_patch_fix.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ai_review.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/fetch_reviewer_comment.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/llm_commit_audit.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/review_prompts.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/root_cause_analysis.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/ai_review/ts_cache.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/decorators.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/kernel_tree.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/coccicheck.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/dt_check.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/dtbs_check.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/patch_review/static_analysis/sparse.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/stats/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/stats/dashboard.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/ui/__init__.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/ui/dashboard.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/ui/events.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/ui/screen.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/utils/decorators.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/utils/lru_cache.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/utils/repo_workspace.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise/utils/tui.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/dependency_links.txt +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/entry_points.txt +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/patchwise.egg-info/top_level.txt +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/setup.cfg +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/tests/test_mail_handler_series_refs.py +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/false-positive-guide.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/alignment.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/arm64.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/ata.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/block.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/bluetooth.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/boot-params.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/bpf.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/btf.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/btrfs.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/build.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/cleanup.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/cxl.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/dax.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/drm.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/dt-bindings.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/fscrypt.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/gic-v3.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/gic-v5.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/hid.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/hyp-arm64.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/i2c.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/input.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/io-accessors.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/io_uring.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kconfig.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kho.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kvm-arm64.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/kvm.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/libbpf.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/locking.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mips.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-alloc.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-folio.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-largepage.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-pagetable.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-reclaim.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/mm-vma.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/netlink.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/networking-core.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/networking-drivers.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/nfsd.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/objtool.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/of.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pci.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/perf.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pm.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/pmdomain.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/rcu.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/rust.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/scheduler.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/selftests.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/smb-ksmbd.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subjective-review.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subsystem-template.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/subsystem.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/sunrpc.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/syscall.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/sysfs.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/timers.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/tracing.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/tty.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/usb-storage.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/vfs.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/wireless.md +0 -0
- {patchwise-0.9.4 → patchwise-0.9.6}/thirdparty/review-prompts/kernel/subsystem/workqueue.md +0 -0
- {patchwise-0.9.4 → 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.
|
|
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
|
|
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:**
|
|
@@ -167,8 +182,8 @@ Dynamic: license-file
|
|
|
167
182
|
### AI Code Review
|
|
168
183
|
|
|
169
184
|
`AiCodeReview` reviews a patch in three phases: **PLAN** (a planner ↔ critic
|
|
170
|
-
loop splits the diff into analysis angles), **EXEC** (a
|
|
171
|
-
|
|
185
|
+
loop splits the diff into analysis angles), **EXEC** (a single reviewer covers
|
|
186
|
+
all the angles in one pass against the real code), and **FILTER** (drops
|
|
172
187
|
proven false positives) before rendering the final inline review.
|
|
173
188
|
|
|
174
189
|
```bash
|
|
@@ -186,7 +201,7 @@ flowchart TD
|
|
|
186
201
|
end
|
|
187
202
|
|
|
188
203
|
B(( )) --> P
|
|
189
|
-
C -->|converged| D["EXEC\n(
|
|
204
|
+
C -->|converged| D["EXEC\n(review)"]
|
|
190
205
|
D --> E["FILTER\n(drop false positives)"]
|
|
191
206
|
E --> F(["Inline review"])
|
|
192
207
|
```
|
|
@@ -195,7 +210,7 @@ Each phase has its own iteration budget, each overridable via env:
|
|
|
195
210
|
|
|
196
211
|
| Phase | Default cap | Override env |
|
|
197
212
|
|-------|-------------|---------------|
|
|
198
|
-
| Critic loop | `MAX_PLAN_ITERATIONS =
|
|
213
|
+
| Critic loop | `MAX_PLAN_ITERATIONS = 5` rounds | `PATCHWISE_MAX_PLAN_ITERATIONS` |
|
|
199
214
|
| Critic (per round) | `CRITIC_ITER_CAP = 10` | `PATCHWISE_CRITIC_ITER_CAP` |
|
|
200
215
|
| Execution | `EXEC_ITER_CAP = 100` | `PATCHWISE_EXEC_ITER_CAP` |
|
|
201
216
|
| FP filter | `FP_ITER_CAP = 50` | `PATCHWISE_FP_ITER_CAP` |
|
|
@@ -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
|
|
@@ -377,7 +412,7 @@ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml
|
|
|
377
412
|
|
|
378
413
|
### Ai Review Options
|
|
379
414
|
|
|
380
|
-
- `--model`: Specify the AI model to use for code review. (default: `openai/Pro`).
|
|
415
|
+
- `--model`: Specify the AI model to use for code review. (default: `openai/responses/Pro`). Use the `openai/responses/` prefix for OpenAI models, e.g. `openai/responses/gpt-6.1-sol`, which routes requests through the `/v1/responses`.
|
|
381
416
|
- `--provider`: The base URL for the AI model API. (default: `https://api.openai.com/v1`)
|
|
382
417
|
- `--reasoning-effort`: Reasoning-effort hint for reasoning models, e.g. `low`/`medium`/`high`. Unset uses the model default.
|
|
383
418
|
- `--additional-context`: Extra text injected into the review/analysis prompt (e.g. a known reproducer or debugging notes). Shared across review and `--rca` modes.
|
|
@@ -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:**
|
|
@@ -130,8 +147,8 @@
|
|
|
130
147
|
### AI Code Review
|
|
131
148
|
|
|
132
149
|
`AiCodeReview` reviews a patch in three phases: **PLAN** (a planner ↔ critic
|
|
133
|
-
loop splits the diff into analysis angles), **EXEC** (a
|
|
134
|
-
|
|
150
|
+
loop splits the diff into analysis angles), **EXEC** (a single reviewer covers
|
|
151
|
+
all the angles in one pass against the real code), and **FILTER** (drops
|
|
135
152
|
proven false positives) before rendering the final inline review.
|
|
136
153
|
|
|
137
154
|
```bash
|
|
@@ -149,7 +166,7 @@ flowchart TD
|
|
|
149
166
|
end
|
|
150
167
|
|
|
151
168
|
B(( )) --> P
|
|
152
|
-
C -->|converged| D["EXEC\n(
|
|
169
|
+
C -->|converged| D["EXEC\n(review)"]
|
|
153
170
|
D --> E["FILTER\n(drop false positives)"]
|
|
154
171
|
E --> F(["Inline review"])
|
|
155
172
|
```
|
|
@@ -158,7 +175,7 @@ Each phase has its own iteration budget, each overridable via env:
|
|
|
158
175
|
|
|
159
176
|
| Phase | Default cap | Override env |
|
|
160
177
|
|-------|-------------|---------------|
|
|
161
|
-
| Critic loop | `MAX_PLAN_ITERATIONS =
|
|
178
|
+
| Critic loop | `MAX_PLAN_ITERATIONS = 5` rounds | `PATCHWISE_MAX_PLAN_ITERATIONS` |
|
|
162
179
|
| Critic (per round) | `CRITIC_ITER_CAP = 10` | `PATCHWISE_CRITIC_ITER_CAP` |
|
|
163
180
|
| Execution | `EXEC_ITER_CAP = 100` | `PATCHWISE_EXEC_ITER_CAP` |
|
|
164
181
|
| FP filter | `FP_ITER_CAP = 50` | `PATCHWISE_FP_ITER_CAP` |
|
|
@@ -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
|
|
@@ -340,7 +377,7 @@ PatchWise merges [`patchwise/default_config.yaml`](patchwise/default_config.yaml
|
|
|
340
377
|
|
|
341
378
|
### Ai Review Options
|
|
342
379
|
|
|
343
|
-
- `--model`: Specify the AI model to use for code review. (default: `openai/Pro`).
|
|
380
|
+
- `--model`: Specify the AI model to use for code review. (default: `openai/responses/Pro`). Use the `openai/responses/` prefix for OpenAI models, e.g. `openai/responses/gpt-6.1-sol`, which routes requests through the `/v1/responses`.
|
|
344
381
|
- `--provider`: The base URL for the AI model API. (default: `https://api.openai.com/v1`)
|
|
345
382
|
- `--reasoning-effort`: Reasoning-effort hint for reasoning models, e.g. `low`/`medium`/`high`. Unset uses the model default.
|
|
346
383
|
- `--additional-context`: Extra text injected into the review/analysis prompt (e.g. a known reproducer or debugging notes). Shared across review and `--rca` modes.
|
|
@@ -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)
|
|
@@ -17,7 +17,7 @@ git_committer:
|
|
|
17
17
|
name: "Patchwise"
|
|
18
18
|
email: "patchwise@qualcomm.com"
|
|
19
19
|
ai:
|
|
20
|
-
model: "openai/Pro"
|
|
20
|
+
model: "openai/responses/Pro"
|
|
21
21
|
provider: "https://api.openai.com/v1"
|
|
22
22
|
# API key for the AI model API. Leave empty to fall back to the provider's
|
|
23
23
|
# usual environment variable (e.g. OPENAI_API_KEY). Override in
|
|
@@ -28,29 +28,65 @@ ai:
|
|
|
28
28
|
# ~/.config/patchwise_config.yaml, e.g.:
|
|
29
29
|
# ai:
|
|
30
30
|
# models:
|
|
31
|
-
# openai/Pro: "
|
|
31
|
+
# openai/responses/Pro: "The Pro model"
|
|
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
|