verifact 0.0.0-stage → 0.2.0
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/LICENSE +202 -0
- package/README.md +94 -2
- package/VERIFACT-DESIGN.md +337 -0
- package/bin/verifact.js +463 -0
- package/package.json +49 -4
- package/src/config.js +198 -0
- package/src/core/artifacts.js +275 -0
- package/src/core/cache.js +87 -0
- package/src/core/claims.js +329 -0
- package/src/core/crossdoc.js +97 -0
- package/src/core/dispositions.js +292 -0
- package/src/core/lint.js +111 -0
- package/src/core/normalize.js +178 -0
- package/src/core/resolve.js +307 -0
- package/src/core/stable-key.js +97 -0
- package/src/core/walk.js +99 -0
- package/src/engine.js +467 -0
- package/src/errors.js +35 -0
- package/src/history.js +91 -0
- package/src/logger.js +29 -0
- package/src/pooled-scan.js +109 -0
- package/src/server/api.js +167 -0
- package/src/server/www/app.js +203 -0
- package/src/server/www/index.html +83 -0
- package/src/server/www/style.css +101 -0
- package/src/worker.js +35 -0
- package/verifact.json.example +92 -0
package/src/worker.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { parentPort, workerData } = require('worker_threads');
|
|
6
|
+
const { extractClaims } = require('./core/claims');
|
|
7
|
+
const { lintDoc } = require('./core/lint');
|
|
8
|
+
|
|
9
|
+
const { files, modules, deep, maxBytes, doLint, lintOpts } = workerData;
|
|
10
|
+
const results = [];
|
|
11
|
+
const errors = [];
|
|
12
|
+
|
|
13
|
+
for (const f of files) {
|
|
14
|
+
try {
|
|
15
|
+
let text = fs.readFileSync(f.full, 'utf8');
|
|
16
|
+
if (text.charCodeAt(0) === 0xFEFF) text = text.slice(1);
|
|
17
|
+
if (maxBytes && Buffer.byteLength(text) > maxBytes) {
|
|
18
|
+
errors.push({ rel: f.rel, reason: 'too_large', fatal: false, bytes: Buffer.byteLength(text), limit: maxBytes });
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const claims = extractClaims(text, f.rel, { modules, deep: !!deep });
|
|
22
|
+
const lint = doLint ? lintDoc(text, f.rel, lintOpts) : [];
|
|
23
|
+
results.push({ rel: f.rel, claims, lint });
|
|
24
|
+
} catch (e) {
|
|
25
|
+
if (e && e.name === 'DispositionError') {
|
|
26
|
+
// 与 runInline 同一条规则:声明写错 = 整次运行失败,不允许静默丢文档。
|
|
27
|
+
errors.push({ rel: f.rel, reason: 'disposition_error', detail: e.message, fatal: true });
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
// 同 runInline:崩溃一律 fatal,除非调用方显式开 --allow-scan-errors(#95)。
|
|
31
|
+
errors.push({ rel: f.rel, reason: e && e.message ? e.message : 'read_error', fatal: true });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
parentPort.postMessage({ results, errors });
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "verifact 配置:把 fibemate 相关文档与真实产出物挂钩后逐条核验。deny/ignore 是人工复核后的沉淀,每条都对应一次已确认的误绑。",
|
|
3
|
+
"docs": {
|
|
4
|
+
"roots": [
|
|
5
|
+
"${FIBEMATE}/fibemate",
|
|
6
|
+
"${USERHOME}/Desktop/FIBEMATE-待发布文章",
|
|
7
|
+
"${FIBEMATE}/README.md",
|
|
8
|
+
"${FIBEMATE}/TECHNICAL-VERIFICATION.md",
|
|
9
|
+
"${FIBEMATE}/fibemate-tools",
|
|
10
|
+
"${FIBEMATE}/fibemate-core"
|
|
11
|
+
],
|
|
12
|
+
"include": ["**/*.md"],
|
|
13
|
+
"exclude": [
|
|
14
|
+
"**/node_modules/**",
|
|
15
|
+
"**/.git/**",
|
|
16
|
+
"**/CHANGELOG.md",
|
|
17
|
+
"**/fibemate/scripts/**",
|
|
18
|
+
"**/fibemate/tools/**",
|
|
19
|
+
"**/docs/pr-archive/**",
|
|
20
|
+
"**/verifact/**"
|
|
21
|
+
],
|
|
22
|
+
"maxFileBytes": 2097152,
|
|
23
|
+
"maxFiles": 3000,
|
|
24
|
+
"maxDepth": 14
|
|
25
|
+
},
|
|
26
|
+
"artifacts": {
|
|
27
|
+
"roots": [
|
|
28
|
+
"${FIBEMATE}/fibemate/tools",
|
|
29
|
+
"${FIBEMATE}/fibemate/scripts",
|
|
30
|
+
"${FIBEMATE}/pqc-hw-bench",
|
|
31
|
+
"${FIBEMATE}/fibemate-core",
|
|
32
|
+
"${FIBEMATE}/lookingglass",
|
|
33
|
+
"${FIBEMATE}/ml-kem-768_timestamp_v2",
|
|
34
|
+
"${FIBEMATE}/tsa_v11",
|
|
35
|
+
"${FIBEMATE}/fips205_kat",
|
|
36
|
+
"${FIBEMATE}/pqc_kem1024_mldsa44",
|
|
37
|
+
"${FIBEMATE}/lg-v3.1-20260716.tsr",
|
|
38
|
+
"${FIBEMATE}/vwz-076-20260717.tsr"
|
|
39
|
+
],
|
|
40
|
+
"presenceRoots": [
|
|
41
|
+
"${FIBEMATE}/_backup_2026-07-18",
|
|
42
|
+
"${FIBEMATE}/papers",
|
|
43
|
+
"${FIBEMATE}/tsa_v11",
|
|
44
|
+
"${FIBEMATE}/ml-kem-768_timestamp_v2",
|
|
45
|
+
"${FIBEMATE}/fibemate/www/docs/tsa",
|
|
46
|
+
"${FIBEMATE}/fibemate/docs/tla"
|
|
47
|
+
],
|
|
48
|
+
"exclude": ["**/node_modules/**", "**/.git/**", "**/target/**", "**/verifact/**"],
|
|
49
|
+
"deny": [
|
|
50
|
+
"**/pqc-ecosystem-scan.json::assessment.*.usage*",
|
|
51
|
+
"**/risk-coverage-matrix.json::matrix[*].summary#*",
|
|
52
|
+
"**/ibm-dimensions-scorecard.json::dimensions.d2_*",
|
|
53
|
+
"**/ibm-dimensions-scorecard.json::dimensions.d4_*",
|
|
54
|
+
"**/ibm-dimensions-scorecard.json::dimensions.d6_*",
|
|
55
|
+
"**/pqc-hw-bench/hardware/project/**/runme.log",
|
|
56
|
+
"**/pqc-hw-bench/results/raw/**",
|
|
57
|
+
"**/lookingglass/docs/performance-scheduler.md",
|
|
58
|
+
"**/lookingglass/docs/p0-closure_2026-06-27.md",
|
|
59
|
+
"**/lookingglass/docs/independence-experiment-results.json",
|
|
60
|
+
"**/*#pk",
|
|
61
|
+
"**/*#sk",
|
|
62
|
+
"**/*#du",
|
|
63
|
+
"**/*#dv",
|
|
64
|
+
"**/*#signature-size",
|
|
65
|
+
"**/tsa_v11/**SHA256SUMS*",
|
|
66
|
+
"**/paper/eprint-submission-form.txt"
|
|
67
|
+
],
|
|
68
|
+
"maxFileBytes": 8388608,
|
|
69
|
+
"maxFiles": 4000,
|
|
70
|
+
"maxDepth": 12
|
|
71
|
+
},
|
|
72
|
+
"resolve": { "minScore": 0.45, "relTolerance": 0.005, "absTolerance": 0 },
|
|
73
|
+
"lint": { "enabled": true, "disable": [], "includeCodeBlocks": false },
|
|
74
|
+
"bindings": [],
|
|
75
|
+
"ignore": [
|
|
76
|
+
{ "file": "**/fibemate/README.md", "key": "keygen-s", "note": "RSA-2048 那一行的 60ms,与 ML-KEM kem-keygen 无关" },
|
|
77
|
+
{ "file": "**/fibemate/README.md", "key": "s-vs", "note": "『vs 1.19ms pure JS』的比较值,不是待核验指标" },
|
|
78
|
+
{ "file": "**/gbk-fix-verify-cleanup_2026-08-14.md", "key": "double-ratchet-pq-js", "note": "em-dash 计数,不是 rekey interval" },
|
|
79
|
+
{ "file": "**/RELEASE_NOTES.md", "key": "finding", "note": "26-pt gap 评分,与 d6 的文件数不是一回事" },
|
|
80
|
+
{ "file": "**/README.md", "key": "cost", "note": "BKZ cost 里的耦合计数" },
|
|
81
|
+
{ "key": "差异不足-ns", "note": "假设性数值:『若两次构建相差 2 ns』,不是实测值" },
|
|
82
|
+
{ "key": "次成功-run", "note": "CI 运行时长,不是硬件指标" },
|
|
83
|
+
{ "file": "**/performance-benchmarks-2026-07-18.md", "key": "rsa-keygen", "note": "RSA-2048 的对照列,不与 ML-KEM 比" },
|
|
84
|
+
{ "key": "sigma", "note": "研究稿里的噪声参数,与投稿表单里的取值集合无关" },
|
|
85
|
+
{ "file": "**/fibemate/README.md", "key": "kem-stress", "note": "1,000 次压测总耗时 8.9s,不是单次 keygen 延迟" },
|
|
86
|
+
{ "key": "kem-完整", "note": "完整 KEM 往返耗时,不与 keygen 单步比对" },
|
|
87
|
+
{ "key": "ntt-roundtrip", "note": "NTT 往返耗时 10µs,被键名带到了 WNS 上;应单独立绑定" }
|
|
88
|
+
],
|
|
89
|
+
"gate": { "failOn": "drift" },
|
|
90
|
+
"cache": { "enabled": true, "dir": ".verifact", "maxHistory": 120 },
|
|
91
|
+
"server": { "host": "127.0.0.1", "port": 8787 }
|
|
92
|
+
}
|