proof-pr 0.1.6 → 0.1.8

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.
package/README.md CHANGED
@@ -1,40 +1,67 @@
1
1
  # proof-pr
2
2
 
3
- ProofPR 的命令行工具。
3
+ ProofPR 是给开源维护者和工程团队使用的 PR 证据门禁。它在投入深度 review 之前,先检查 PR 是否提供了足够证据:测试、复现、截图、changelog、权限理由,以及是否触碰敏感路径、依赖、workflow、MCP 或 secret 风险。
4
4
 
5
- ProofPR 帮助维护者在投入深入 review 之前,先检查 PR 的证据、范围和安全风险。报告会输出风险等级、0-100 证据评分,以及 Review 门禁建议。
5
+ 它不依赖大模型,不上传代码,只基于 diff、PR 描述和配置做确定性判断。
6
6
 
7
- ## 它什么时候运行?
7
+ ## 快速使用
8
8
 
9
- 作为 GitHub Action 使用时,ProofPR 默认在 PR 打开、PR 分支更新、PR 重新打开时运行。普通分支 push 不会单独生成报告。
9
+ 初始化配置和 GitHub Action
10
10
 
11
- 报告会出现在 PR 评论区、GitHub Actions job summary 和 PR checks 状态里。
12
- `v0.1.5` 起还可以输出 GitHub annotations,并通过 `sarif-output` 写出 SARIF 文件。当前版本还会识别依赖大版本升级、包生命周期脚本和 `pull_request_target` workflow 触发器。
13
-
14
- ## 使用
11
+ ```bash
12
+ npx proof-pr@latest init --preset open-source-maintainer
13
+ ```
15
14
 
16
- 可以直接通过 npm 使用:
15
+ 本地扫描当前分支:
17
16
 
18
17
  ```bash
19
- npx proof-pr@latest init
20
- npx proof-pr@latest init --preset security-strict
21
- npx proof-pr@latest scan --base origin/main --head HEAD
22
18
  npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN
23
- npx proof-pr@latest scan --base origin/main --pr-body-file pr-body.md --format json
24
19
  ```
25
20
 
26
- 可用预设:`balanced`、`open-source-maintainer`、`security-strict`、`ai-generated-pr`、`mcp-security`、`dependency-careful`。
21
+ 扫描内置案例:
22
+
23
+ ```bash
24
+ npx proof-pr@latest scan --diff-file examples/cases/workflow-untrusted-checkout.diff --locale zh-CN
25
+ ```
26
+
27
+ 生成独立 HTML 可视化报告:
28
+
29
+ ```bash
30
+ npx proof-pr@latest scan --base origin/main --head HEAD --locale zh-CN --format html > proofpr-report.html
31
+ ```
32
+
33
+ 运行 benchmark:
34
+
35
+ ```bash
36
+ npx proof-pr@latest benchmark --cases benchmarks/cases
37
+ ```
27
38
 
28
39
  ## GitHub Action
29
40
 
30
41
  ```yaml
31
- - uses: linsk27/proof-pr@v0.1.5
42
+ - uses: linsk27/proof-pr@v0.1.8
32
43
  with:
33
44
  fail-on: high
34
45
  comment: "true"
35
46
  annotations: "true"
36
47
  ```
37
48
 
38
- 完整文档见仓库 README:
49
+ ## 输出什么
50
+
51
+ - 风险等级:`low`、`medium`、`high`。
52
+ - 证据评分:0-100 分。
53
+ - Review 门禁:正常 review、重点 review、先补证据、风险处理前不要合并。
54
+ - Review 行动清单:维护者可直接执行的 checklist。
55
+ - 可选输出:GitHub annotations、SARIF、benchmark report、独立 HTML 可视化报告。
56
+
57
+ ## 常用预设
58
+
59
+ - `open-source-maintainer`:开源仓库推荐。
60
+ - `security-strict`:安全敏感项目。
61
+ - `ai-generated-pr`:AI 生成 PR 较多的仓库。
62
+ - `mcp-security`:关注 MCP / agent 配置。
63
+ - `dependency-careful`:关注依赖和锁文件变化。
64
+
65
+ 完整中文文档、截图和从 0 到 1 教程见仓库 README:
39
66
 
40
67
  https://github.com/linsk27/proof-pr
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};