verifact 0.2.0 → 0.2.2

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 (2) hide show
  1. package/README.md +32 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,6 +6,22 @@ Markdown 文档里的性能基准、测试计数、版本号——这些数字
6
6
 
7
7
  Zero external dependencies. Pure Node.js.
8
8
 
9
+ ## 这个工具不做什么
10
+
11
+ 三件容易被误解的事,写在最前面:
12
+
13
+ - **不扫漏洞。** 它不分析代码、不查 CVE、不做污点分析。它只核对「文档里写的数字」与「仓库里的产出物」是否一致。没有产出物可对的声明会落到 `unbound`,那是「缺证据」,不是「安全」。
14
+ - **不保证安全。** `drift 0` 只代表本次扫描范围内没有发现数值漂移。它不是合规结论,也不能替代渗透测试或第三方审计。
15
+ - **不执行被审代码。** 扫描过程只读文件、解析文本与 JSON,不运行仓库里的任何脚本或二进制。
16
+
17
+ 报告长什么样、怎么读:<https://fibemate.net/tools/verifact-demo/>(那个页面只渲染 JSON,不做任何判定)。
18
+
19
+ 判定边界写在 `VERIFACT-DESIGN.md`。绑不上的声明会被列出来,工具不会替你补一个数字。
20
+
21
+ ## 与 OWASP CycloneDX 规范的关系
22
+
23
+ 本工具对「字段缺失」与「显式零值」的区分,与 OWASP CycloneDX 密码学属性(cryptoProperties)语义澄清的方向一致。作者就该语义向上游规范仓库提交了澄清提案,已获规范维护者评审通过;**提案尚未合并,合并前不代表规范文本已变更**。
24
+
9
25
  ## 核心流程
10
26
 
11
27
  ```
@@ -25,36 +41,39 @@ Zero external dependencies. Pure Node.js.
25
41
  | `ref-matched` | 声明引用 `lg-XXX` 等实体,在扫描范围内找到 | 绿 |
26
42
  | `ref-missing` | 引用实体不在扫描范围内 | 交人工 |
27
43
 
28
- ## 用法
44
+ ## 安装
29
45
 
46
+ ```bash
47
+ npm i -g verifact # 全局安装,得到 verifact 命令
48
+ npx verifact --help # 免安装试用
30
49
  ```
31
- npm install # 零依赖,仅安装
32
- ```
50
+
51
+ 零外部依赖。从源码检出运行时,下文的 `verifact` 可替换为 `node bin/verifact.js`。
33
52
 
34
53
  ### 核验文档
35
54
 
36
55
  ```bash
37
- node bin/verifact.js verify # 默认配置,drift 即退出码 1
38
- node bin/verifact.js verify --fail-on none # 仅报告,不拦截
39
- node bin/verifact.js verify --format md --out report.md
56
+ verifact verify # 默认配置,drift 即退出码 1
57
+ verifact verify --fail-on none # 仅报告,不拦截
58
+ verifact verify --format md --out report.md
40
59
  ```
41
60
 
42
61
  ### 审查单条声明
43
62
 
44
63
  ```bash
45
- node bin/verifact.js explain <claimId>
64
+ verifact explain <claimId>
46
65
  ```
47
66
 
48
67
  ### 历史对比
49
68
 
50
69
  ```bash
51
- node bin/verifact.js diff --since 3 # 最近 3 次运行的状态迁移
70
+ verifact diff --since 3 # 最近 3 次运行的状态迁移
52
71
  ```
53
72
 
54
73
  ### 本地看板
55
74
 
56
75
  ```bash
57
- node bin/verifact.js serve --port 8080
76
+ verifact serve --port 8080
58
77
  ```
59
78
 
60
79
  ## 退出码
@@ -84,12 +103,12 @@ node bin/verifact.js serve --port 8080
84
103
 
85
104
  | 项 | 状态 |
86
105
  |---|-------|
87
- | 回归测试 | ✅ 15 项 (`node test/run.js`) |
88
- | CI 集成 | ✅ sentinel 门禁(`fail-on-drift`) |
106
+ | 回归测试 | ✅ 74 项 (`node test/run.js`) |
107
+ | CI 集成 | ✅ sentinel 门禁(`fail-on-drift`)+ 语料门禁(变异必红) |
89
108
  | 平台 | Node.js ≥18,零外部依赖 |
90
- | 发布 | 私有包(`@fibemate/verifact`),未发布 npm |
109
+ | 发布 | npm 公共包 `verifact`(无 scope,公开;`npm i -g verifact`) |
91
110
  | 许可证 | Apache-2.0 |
92
111
 
93
112
  ## LICENSE
94
113
 
95
- Apache-2.0 — see [LICENSE](../LICENSE).
114
+ Apache-2.0 — see [LICENSE](./LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verifact",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "事实哨兵 — 把文档里的硬数字声明绑定到真实产出物上逐条核验,漂移即红。",
5
5
  "license": "Apache-2.0",
6
6
  "author": "刘天赫 <research@fibemate.net>",