Skip to content

ai_review: Add deep review mode#99

Open
jiegan0107 wants to merge 1 commit into
qualcomm:mainfrom
jiegan0107:main
Open

ai_review: Add deep review mode#99
jiegan0107 wants to merge 1 commit into
qualcomm:mainfrom
jiegan0107:main

Conversation

@jiegan0107

Copy link
Copy Markdown

Use --deep-review with --repo-path to run prompt-backed AI review against a Linux kernel codebase.

@jiegan0107 jiegan0107 requested a review from aditya-qti as a code owner June 1, 2026 12:51
@jiegan0107 jiegan0107 force-pushed the main branch 2 times, most recently from cfe1662 to ced048a Compare June 2, 2026 01:40
@aditya-qti

aditya-qti commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution!

Can you please remove memory/ from this PR? It makes it very difficult to review. We can consider it a separate effort.

@jiegan0107

Copy link
Copy Markdown
Author

Thank you for your contribution!

Can you please remove memory/ from this PR? It makes it very difficult to review. We can consider it a separate effort.

removed memory and updated to the latest version.

@jiegan0107 jiegan0107 force-pushed the main branch 4 times, most recently from fca1488 to d544ddc Compare June 7, 2026 11:56
@aditya-qti

aditya-qti commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Please take a look at this initial AI review:

Findings

[BUG] Deep-review artifacts are not visible inside the agent container

patchwise/patch_review/ai_review/deep_review.py:382 writes tmp/patch_1_rules.md, tmp/patch_1_diff.txt, tmp/review_runtime_config.json, and related artifacts into the host kernel tree during setup(), after the Docker overlay/container has already been prepared by PatchReview.__init__. The agent is then instructed to read those files via container tools, but they can be absent from /home/patchwise/kernel/tmp/....

I reproduced this with a stubbed DeepReview: docker_manager.read_file("/home/patchwise/kernel/tmp/patch_1_rules.md") returned False.

Suggested fix: generate these artifacts before mounting the overlay, write them through docker_manager into the container tree, or store them in a mounted per-run sandbox.

[BUG] The new prompt bundle fails its own self-check

patchwise/patch_review/ai_review/prompts/scripts/self_check.py:404 runs memory_lint.py, and patchwise/patch_review/ai_review/prompts/scripts/memory_lint.py:131 rejects flat memory files when split layout exists. PR #99 adds refs/memory/{commit-message,dt-bindings,patch-scope,subsystem-specific}.md alongside refs/memory/{active,draft,deprecated}/..., so python3 scripts/self_check.py fails with:

Memory lint failed:
- .../refs/memory: split layout is active; remove legacy flat topic files: commit-message.md, dt-bindings.md, patch-scope.md, subsystem-specific.md

Suggested fix: remove the four legacy flat files or adjust the layout/lint contract.

[CONCERN] DeepReview dirties the user’s kernel checkout

patchwise/patch_review/ai_review/deep_review.py:382 uses <repo>/tmp and never cleans it, leaving generated review artifacts in the target kernel repo. Even if the container-visibility issue is fixed by copying files, this still pollutes git status and risks collisions between concurrent runs.

Suggested fix: use SANDBOX_PATH, output-dir, or a per-run ignored temp directory with cleanup.

[CONCERN] Group selectors may pull in DeepReview unexpectedly

patchwise/patch_review/decorators.py:58 registers DeepReview as an LLM review, so llm_reviews and all_reviews paths in patchwise/patch_review/__init__.py:314 include it. The early CLI validation in patchwise/main.py:73 only checks --deep-review or explicit DeepReview. Non-CLI/shared entry points using those selectors may suddenly require a Linux kernel tree and run the heavier deep-review flow.

Suggested fix: keep DeepReview out of broad groups unless explicitly requested, or ensure every selector path applies the same Linux-tree validation and documents the behavior change.

@jiegan0107

Copy link
Copy Markdown
Author

fixed mentioned issues. Please have a review again.

The pushed skill switched to a new architecture with better performance and less token costs

Use --deep-review with --repo-path to run prompt-backed AI review against a Linux kernel codebase.

Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants