Skip to content

Commit eabada8

Browse files
committed
fix: harden analysis API and polish repository
1 parent 03d98b7 commit eabada8

36 files changed

Lines changed: 1034 additions & 681 deletions
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Bug report
2+
description: Report a reproducible problem in PureAutoCodeQL.
3+
title: "bug: "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to report this. Please remove secrets and private target details before submitting.
11+
- type: textarea
12+
id: summary
13+
attributes:
14+
label: Summary
15+
description: What went wrong?
16+
placeholder: The analysis fails when...
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: reproduce
21+
attributes:
22+
label: Reproduction steps
23+
description: Include commands, case layout, and relevant configuration.
24+
placeholder: |
25+
1. Run `uv run python Analyze.py ...`
26+
2. Observe ...
27+
validations:
28+
required: true
29+
- type: textarea
30+
id: expected
31+
attributes:
32+
label: Expected behavior
33+
description: What did you expect to happen?
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: logs
38+
attributes:
39+
label: Logs or output
40+
description: Paste the smallest useful snippet. Redact tokens and private paths if needed.
41+
render: shell
42+
- type: input
43+
id: python
44+
attributes:
45+
label: Python version
46+
placeholder: "3.13.x"
47+
- type: input
48+
id: codeql
49+
attributes:
50+
label: CodeQL CLI version
51+
placeholder: "`codeql version` output"
52+
- type: dropdown
53+
id: language
54+
attributes:
55+
label: Target language
56+
options:
57+
- Java
58+
- Python
59+
- C/C++
60+
- Other
61+
- type: textarea
62+
id: extra
63+
attributes:
64+
label: Additional context
65+
description: Anything else that may help diagnose the issue.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Security issue
4+
url: https://github.com/Fruit-Guardians/PureAutoCodeql/security/policy
5+
about: Please avoid public exploit details. Review the security policy first.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Feature request
2+
description: Suggest an improvement or new capability.
3+
title: "feat: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: Problem
11+
description: What research or workflow problem would this solve?
12+
placeholder: I need PureAutoCodeQL to...
13+
validations:
14+
required: true
15+
- type: textarea
16+
id: proposal
17+
attributes:
18+
label: Proposed solution
19+
description: Describe the behavior you want.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: alternatives
24+
attributes:
25+
label: Alternatives considered
26+
description: Other approaches or workarounds you tried.
27+
- type: dropdown
28+
id: area
29+
attributes:
30+
label: Area
31+
options:
32+
- CLI
33+
- API
34+
- CodeQL generation
35+
- Project import
36+
- Path selection
37+
- Configuration
38+
- Documentation
39+
- Other
40+
- type: textarea
41+
id: context
42+
attributes:
43+
label: Additional context
44+
description: Sample inputs, target languages, or links to related docs.

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Summary
2+
3+
-
4+
5+
## Validation
6+
7+
- [ ] `uv run pytest -q`
8+
- [ ] `uv lock --check`
9+
- [ ] `git diff --check`
10+
11+
## Notes
12+
13+
Describe any skipped checks, follow-up work, or operational impact.

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ env/
3333
*.swp
3434
*.swo
3535
*~
36-
config/keys.toml
37-
config\\keys.toml
36+
config/keys*.toml
37+
config\\keys*.toml
38+
!config/keys.example.toml
39+
!config\\keys.example.toml
3840

3941
# 配置文件 - 敏感信息
4042
.env
@@ -71,4 +73,4 @@ projects/CVE*
7173
*.zip
7274
projects/*.zip
7375
projects/C_Qi
74-
utils/lsp
76+
utils/lsp

Analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def parse_arguments() -> argparse.Namespace:
652652
使用示例:
653653
%(prog)s --case CVE-2021-21985 # 分析已导入的案例
654654
%(prog)s --case "C:\\Targets\\java\\CVE-2023-51444" # Java项目:自动导入+建库+分析
655-
%(prog)s --case CVE-2021-21985 --stream # 显示AI思考过程
655+
%(prog)s --case CVE-2021-21985 --no-stream # 禁用AI思考过程显示
656656
%(prog)s --import-project "C:\\Targets\\CVE-2023-51444" --import-language java # 仅导入Java项目
657657
%(prog)s --md-file vulnerability.md # 从MD文件直接生成CodeQL
658658
%(prog)s --md-file vulnerability.md --src-path /path/to/source # 从MD文件生成source点分析报告

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing
2+
3+
Thanks for helping improve PureAutoCodeQL.
4+
5+
## Development Setup
6+
7+
```bash
8+
git clone https://github.com/Fruit-Guardians/PureAutoCodeql.git
9+
cd PureAutoCodeql
10+
uv sync
11+
```
12+
13+
Build the MCP ripgrep tool when you need agent-side code search:
14+
15+
```bash
16+
chmod +x build_mcp.sh
17+
./build_mcp.sh
18+
```
19+
20+
## Before Opening a Pull Request
21+
22+
Please run the focused checks that match your change. For broad changes, run:
23+
24+
```bash
25+
uv run pytest -q
26+
uv lock --check
27+
uv run python -m compileall -q Analyze.py api core services utils agents tools
28+
```
29+
30+
For documentation-only changes, at minimum check Markdown links and run:
31+
32+
```bash
33+
git diff --check
34+
```
35+
36+
## Pull Request Guidance
37+
38+
- Keep the change focused and explain why it is needed.
39+
- Include reproduction steps for bug fixes.
40+
- Include sample input or output when behavior changes.
41+
- Do not commit secrets, generated local reports, or private target projects.
42+
- Follow existing module boundaries and local coding style.
43+
44+
## Commit Message Examples
45+
46+
```text
47+
fix: harden project import path validation
48+
feat: add source-sink fallback query mode
49+
docs: refresh API quickstart
50+
test: cover unsafe case id rejection
51+
```

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Fruit Guardians
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)