progmune-runtime 3.7.66 → 3.7.67
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.7.67] — 2026-10-12
|
|
4
|
+
|
|
5
|
+
### 词撞类豁免(修冤枉第八刀:mutation/access trigger 词段碰撞)
|
|
6
|
+
|
|
7
|
+
**根因**:mutation/access trigger 的 `/i` 标志让 `[A-Z]\w*` 退化为
|
|
8
|
+
`[A-Za-z]\w*`——第二分支 `(?:[A-Z]\w*|_\w+)(Add|Create|Update|...)`
|
|
9
|
+
实际匹配任何**含** mutation 词段的 camelCase 词:`for+Update`(Kysely
|
|
10
|
+
悲观锁)、`create+Cipheriv`(crypto AEAD 构造器)、`Last+UpdatedBy`
|
|
11
|
+
(select 子查询构建器)、`getConfig`(存储驱动配置)全数误命中。
|
|
12
|
+
与 3.7.63 第四刀(NIS 触发词收窄)同族,但 mutation 动词是核心词
|
|
13
|
+
不能删,改为 excludePatterns 精确豁免。
|
|
14
|
+
|
|
15
|
+
- **Mutation 规则 excludePatterns 增补**:`/\bforUpdate\b/`(Kysely/
|
|
16
|
+
TypeORM SELECT … FOR UPDATE 锁子句——逐条核对纯 SELECT 非变更)、
|
|
17
|
+
`/\bcreateCipheriv\b|\bcreateDecipheriv\b/`(crypto 构造器)、
|
|
18
|
+
`/\bwith[A-Z]\w*UpdatedBy\b/`(select 子查询构建器)
|
|
19
|
+
- **Access 规则增补**:`/\bgetConfig\b/`(存储驱动配置读取,
|
|
20
|
+
snake_case 形态已有 /get_config/)
|
|
21
|
+
- **已知 FN 边界(记录在案)**:excludePatterns 是函数级豁免——
|
|
22
|
+
若未来出现「锁后写/加密后存」形态(函数同时含撞词与真实写调用),
|
|
23
|
+
会被整体豁免。docmost 全 IR 扫描 12 个含撞词函数中唯一「写调用」
|
|
24
|
+
是 cipher.update()(加密流 API),TP 0;盲测语料 0 个函数含候选
|
|
25
|
+
token ⇒ 零漂移由构造保证(knife8-replay-probe.ts 复核)
|
|
26
|
+
- **同条件 A/B(docmost,同一 fresh IR)**:主告警流 697→685
|
|
27
|
+
(−12 = Mutation 9 + Access 3,消失清单与离线重放预测逐条一致,
|
|
28
|
+
新增 0);suppressed 140 不变;**主路径 violations 11=11 内容级
|
|
29
|
+
零差 / score 84=84 / NEEDS_REVIEW 不变**
|
|
30
|
+
- **回归锁定**:单测 6 例(protocol-detector-knife8-word-collision
|
|
31
|
+
.test.ts:四个词撞形状 + updateTable/getUserData 反例照常触发);
|
|
32
|
+
检测器套件 49/49;引擎套件 27/27;taintpath 160 / webshape 72 /
|
|
33
|
+
fr-007 5-0 / fr-016 7-0 维持;TS 盲测对 HEAD 基线 LOST 0/ADDED 0
|
|
34
|
+
- **预研探针(可复跑)**:knife8-word-collision-probe.ts(577 条授权
|
|
35
|
+
族分类:词撞类仅 ~15 条=2.6%,主力是 repo-update 149/ getter 198
|
|
36
|
+
语义类——下刀候选)+ knife8-trigger-origin-probe.ts(触发来源定位:
|
|
37
|
+
/i 退化机制)+ knife8-replay-probe.ts(离线重放预测 12=实际 12)
|
|
38
|
+
|
|
3
39
|
## [3.7.66] — 2026-10-12
|
|
4
40
|
|
|
5
41
|
### 队列作业调用方传播(修冤枉第七刀:授权族告警的「只被作业调用的函数没有请求面」根因)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const protocol_detector_1 = require("./protocol-detector");
|
|
5
|
+
/**
|
|
6
|
+
* 修冤枉第八刀(2026-10-12)词撞类回归测试。
|
|
7
|
+
*
|
|
8
|
+
* 根因:mutation/access trigger 的 /i 标志让 [A-Z]\w* 退化为 [A-Za-z]\w*,
|
|
9
|
+
* 「for+Update」「create+Cipheriv」「Last+UpdatedBy」等非变更词段全数命中。
|
|
10
|
+
* 修法:excludePatterns 增补四个形状(docmost 12 条告警逐条核过 TP 0——
|
|
11
|
+
* forUpdate=Kysely 悲观锁 SELECT、createCipheriv/Decipheriv=crypto 构造器、
|
|
12
|
+
* withLastUpdatedBy=select 子查询构建器、getConfig=存储驱动配置读取)。
|
|
13
|
+
* 已知 FN 边界(记录在案):函数若同时含撞词与真实写调用(锁后写/
|
|
14
|
+
* 加密后存),excludePatterns 会整体豁免该函数——docmost 与盲测语料
|
|
15
|
+
* 均无此形态(knife8-replay-probe.ts 复核)。
|
|
16
|
+
*/
|
|
17
|
+
(0, vitest_1.describe)("修冤枉第八刀:词撞类 excludePatterns", () => {
|
|
18
|
+
(0, vitest_1.it)("forUpdate(Kysely 悲观锁 SELECT)不再触发 Unauthenticated Mutation", () => {
|
|
19
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)(["select", "selectFrom", "where", "forUpdate"], "PageRepo.findById", "typescript");
|
|
20
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Mutation)")).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.it)("createCipheriv/createDecipheriv(crypto 构造器)不再触发 Mutation", () => {
|
|
23
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)(["randomBytes", "createCipheriv", "concat", "update", "final"], "EncryptionService.encrypt", "typescript");
|
|
24
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Mutation)")).toBe(false);
|
|
25
|
+
const v2 = (0, protocol_detector_1.detectSafeguardViolations)(["createDecipheriv", "setAuthTag", "concat", "update"], "EncryptionService.decrypt", "typescript");
|
|
26
|
+
(0, vitest_1.expect)(v2.some((x) => x.rule === "Authorization (Unauthenticated Mutation)")).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
(0, vitest_1.it)("withLastUpdatedBy(select 子查询构建器)不再触发 Mutation", () => {
|
|
29
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)(["as", "jsonObjectFrom", "whereRef", "select"], "PageRepo.withLastUpdatedBy", "typescript");
|
|
30
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Mutation)")).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.it)("getConfig(存储驱动配置读取)不再触发 Unauthenticated Access", () => {
|
|
33
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)([], "S3Driver.getConfig", "typescript");
|
|
34
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Access)")).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.it)("反例:真实写调用(updateTable/insertInto)照常触发 Mutation", () => {
|
|
37
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)(["dbOrTx", "updateTable", "set", "where", "execute"], "PageRepo.updatePages", "typescript");
|
|
38
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Mutation)")).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
(0, vitest_1.it)("反例:真实数据读取(getUserData)照常触发 Access", () => {
|
|
41
|
+
const v = (0, protocol_detector_1.detectSafeguardViolations)(["selectFrom", "where", "executeTakeFirst"], "UserRepo.getUserData", "typescript");
|
|
42
|
+
(0, vitest_1.expect)(v.some((x) => x.rule === "Authorization (Unauthenticated Access)")).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -451,6 +451,9 @@ const SAFEGUARD_RULES = [
|
|
|
451
451
|
/findBig|findKey|findPk/, // internal search (not API)
|
|
452
452
|
/get_cache\w*/, // cache machinery (get_cache_alias — not data access)
|
|
453
453
|
/get_context_data/, // Django CBV context assembly — framework verb
|
|
454
|
+
/\bgetConfig\b/, // 修冤枉第八刀(2026-10-12):存储驱动配置读取
|
|
455
|
+
// (S3/Azure/Local driver getConfig,无 DB 调用——
|
|
456
|
+
// 配置非用户数据;snake_case 形态已有 /get_config/)
|
|
454
457
|
],
|
|
455
458
|
},
|
|
456
459
|
// Mutations without any authentication. The Unauthenticated Access rule above
|
|
@@ -491,6 +494,15 @@ const SAFEGUARD_RULES = [
|
|
|
491
494
|
/set_config/, // configuration setter
|
|
492
495
|
/set_option/, // option setter
|
|
493
496
|
/\bsetup\b/, // framework/component setup — configuration, not data mutation
|
|
497
|
+
// 修冤枉第八刀(2026-10-12):词撞类——trigger 的 /i 让 [A-Z]\w* 退化为
|
|
498
|
+
// [A-Za-z]\w*,「for+Update」「create+Cipheriv」等非变更词段全数命中。
|
|
499
|
+
// 逐条核对(docmost 12 函数):forUpdate=Kysely 悲观锁 SELECT 非变更、
|
|
500
|
+
// createCipheriv/createDecipheriv=crypto AEAD 构造器、withLastUpdatedBy=
|
|
501
|
+
// select 子查询构建器。锁后写/加密后存形态在 docmost 与盲测语料均不存在
|
|
502
|
+
// (FN 风险记录在案:真出现时 excludePatterns 会整体豁免该函数)。
|
|
503
|
+
/\bforUpdate\b/, // Kysely/TypeORM SELECT … FOR UPDATE 锁子句
|
|
504
|
+
/\bcreateCipheriv\b|\bcreateDecipheriv\b/, // node crypto AEAD 构造器(加密流非数据变更)
|
|
505
|
+
/\bwith[A-Z]\w*UpdatedBy\b/, // select 子查询构建器名("LastUpdatedBy" 词段撞 Updated)
|
|
494
506
|
],
|
|
495
507
|
},
|
|
496
508
|
// ── Data Integrity (Foreign Key Validation) ──
|
package/dist/sdk.js
CHANGED
|
@@ -20,7 +20,7 @@ const risk_model_1 = require("./risk-model");
|
|
|
20
20
|
const protocol_knowledge_1 = require("./protocol-knowledge");
|
|
21
21
|
const evidence_repository_1 = require("./evidence-repository");
|
|
22
22
|
/** Runtime version — stable public identifier. Internal layers evolve underneath. */
|
|
23
|
-
exports.RUNTIME_VERSION = "3.7.
|
|
23
|
+
exports.RUNTIME_VERSION = "3.7.67";
|
|
24
24
|
function verify(filePath) {
|
|
25
25
|
const cert = (0, certify_1.certify)(filePath);
|
|
26
26
|
const kb = (0, protocol_knowledge_1.buildKnowledgeBase)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "progmune-runtime",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.67",
|
|
4
4
|
"description": "Progmune — AI Trust Decision Engine. Verify AI-generated code before it reaches production. Outputs APPROVED / NEEDS_REVIEW / BLOCKED with evidence.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|