progmune-runtime 3.7.47 → 3.7.48
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 +13 -0
- package/dist/sdk.js +1 -1
- package/dist/trust/engine.js +47 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.7.48] — 2026-09-22
|
|
4
|
+
|
|
5
|
+
### IR 提取失败必须发声(OOM 杀后的「0 违规假干净」根治)
|
|
6
|
+
|
|
7
|
+
- **事故**:skyvern E1 重扫时 python3 提取器被 OOM 杀(SIGKILL),ir.json 被写成 2 字节空数组——引擎带着空 IR 照样输出「0 违规、85 分 APPROVED」,结果自洽、无任何迹象表明它是废票(静默降级比 R8 陈旧产物更阴)
|
|
8
|
+
- **修复**(`src/trust/engine.ts` + `types.ts`):
|
|
9
|
+
- 提取异常不再静默吞掉——异常信息记入 `extractionWarning`
|
|
10
|
+
- **提取后验尸**:ir.json 存在但函数数=0 且项目确有源码 ⇒ 记失败并 console.warn
|
|
11
|
+
- TrustDecision 新增 `overall.extractionWarning` 字段;失败时 `coverageConfidence` 强制降 LOW,摘要明示「本次扫描是废票,不得据此得出干净结论」
|
|
12
|
+
- **E2E 验证**:空 ir.json + 1 个源文件 → warning 触发 / confidence LOW / 摘要正确
|
|
13
|
+
- 回归:engine 21 + ir-staleness 12 + structural 165 全绿;build ✓
|
|
14
|
+
- 后续:python3 提取分块(skyvern 级项目单进程内存峰值不可控,按目录分批提取、引擎侧合并)——机器资源恢复后按四门验收
|
|
15
|
+
|
|
3
16
|
## [3.7.47] — 2026-09-21
|
|
4
17
|
|
|
5
18
|
### 类方法的真实调用必须进 IR(状态机在 OO 代码上没有输入)
|
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.48";
|
|
24
24
|
function verify(filePath) {
|
|
25
25
|
const cert = (0, certify_1.certify)(filePath);
|
|
26
26
|
const kb = (0, protocol_knowledge_1.buildKnowledgeBase)();
|
package/dist/trust/engine.js
CHANGED
|
@@ -103,7 +103,7 @@ async function evaluateTrust(ctx) {
|
|
|
103
103
|
// ── Phase 5: Build call graph for cross-function propagation ──
|
|
104
104
|
const callGraph = (0, call_graph_propagator_1.buildCallGraphFromIR)(path.join(ctx.projectPath, "ir.json"));
|
|
105
105
|
const enterpriseViolations = collectEnterpriseViolations(ctx);
|
|
106
|
-
const { violations: protocolViolations, coverage: mappingCoverageData, ssgCoverage: ssgCov, annotationSuggestions: cAnnotationSuggestions } = await collectProtocolViolations(ctx, callGraph);
|
|
106
|
+
const { violations: protocolViolations, coverage: mappingCoverageData, ssgCoverage: ssgCov, annotationSuggestions: cAnnotationSuggestions, extractionWarning } = await collectProtocolViolations(ctx, callGraph);
|
|
107
107
|
const expressResult = collectExpressViolations(ctx);
|
|
108
108
|
const nestjsResult = collectNestJSViolations(ctx);
|
|
109
109
|
const trpcResult = collectTRPCViolations(ctx);
|
|
@@ -218,12 +218,20 @@ async function evaluateTrust(ctx) {
|
|
|
218
218
|
score: effectiveScore,
|
|
219
219
|
decision,
|
|
220
220
|
confidence,
|
|
221
|
-
coverageConfidence:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
coverageConfidence: extractionWarning
|
|
222
|
+
? {
|
|
223
|
+
score: 0,
|
|
224
|
+
margin: 25,
|
|
225
|
+
level: "LOW",
|
|
226
|
+
summary: `${extractionWarning}——本次扫描是废票,不得据此得出「干净」结论`,
|
|
227
|
+
}
|
|
228
|
+
: {
|
|
229
|
+
score: coverageConfidence.score,
|
|
230
|
+
margin: coverageConfidence.margin,
|
|
231
|
+
level: coverageConfidence.level,
|
|
232
|
+
summary: coverageConfidence.summary,
|
|
233
|
+
},
|
|
234
|
+
extractionWarning,
|
|
227
235
|
mappingCoverage: mappingCoverageData.totalApis > 0
|
|
228
236
|
? {
|
|
229
237
|
rate: Math.round(((mappingCoverageData.lookupHits + mappingCoverageData.llmHits) /
|
|
@@ -1208,6 +1216,8 @@ async function collectProtocolViolations(ctx, callGraph) {
|
|
|
1208
1216
|
const annotationRuleNames = new Set();
|
|
1209
1217
|
// C 注解建议(函数级作用域——返回值在 try 外组装)
|
|
1210
1218
|
let annotationSuggestions;
|
|
1219
|
+
// 2026-09-22:提取失败标记(跨 try 作用域,随结果返回)
|
|
1220
|
+
let extractionWarning;
|
|
1211
1221
|
try {
|
|
1212
1222
|
// ── P4.5 校准:TS/JS 项目在 ir.json 缺失时先提取 IR ──
|
|
1213
1223
|
// 序列必须来自「函数体内真实调用」而非「文件内函数声明名单」——
|
|
@@ -1255,10 +1265,35 @@ async function collectProtocolViolations(ctx, callGraph) {
|
|
|
1255
1265
|
`需重提取运行 PROGMUNE_IR_REEXTRACT=always 或删除 ir.json)`);
|
|
1256
1266
|
}
|
|
1257
1267
|
if (shouldExtract) {
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1268
|
+
try {
|
|
1269
|
+
const ir = extractFn();
|
|
1270
|
+
// C 走合并形态(与 execute/MCP 写盘一致);TS/Python 保持裸数组形态
|
|
1271
|
+
const payload = lang === "c" ? { typeMap: {}, functions: ir } : ir;
|
|
1272
|
+
fs.writeFileSync(path.join(ctx.projectPath, "ir.json"), JSON.stringify(payload, null, 2));
|
|
1273
|
+
}
|
|
1274
|
+
catch (extractErr) {
|
|
1275
|
+
// 2026-09-22:提取异常不再静默吞掉——OOM 杀(exit 137)等失败
|
|
1276
|
+
// 必须发声,否则引擎带着空 IR 输出「0 违规」的假干净结论
|
|
1277
|
+
extractionWarning = `IR 提取失败(${extractErr?.message || extractErr})——结果不可信`;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
// 2026-09-22:提取后验尸——ir.json 存在但函数数为 0 且项目确有
|
|
1281
|
+
// 源码时,说明提取被静默截断(如 python3 被 OOM 杀后留下 2 字节
|
|
1282
|
+
// 空数组),同样记为失败
|
|
1283
|
+
if (!extractionWarning) {
|
|
1284
|
+
try {
|
|
1285
|
+
const irPath2 = path.join(ctx.projectPath, "ir.json");
|
|
1286
|
+
if (fs.existsSync(irPath2)) {
|
|
1287
|
+
const raw = fs.readFileSync(irPath2, "utf-8");
|
|
1288
|
+
const parsed = JSON.parse(raw);
|
|
1289
|
+
const fnCount = Array.isArray(parsed) ? parsed.length : (parsed.functions || []).length;
|
|
1290
|
+
if (fnCount === 0 && freshness.scannedFiles > 0) {
|
|
1291
|
+
extractionWarning = `IR 提取产物为空(0 函数,但项目有 ${freshness.scannedFiles} 个源文件)——提取可能被 OOM 截断,结果不可信`;
|
|
1292
|
+
console.warn(`[progmune] ⚠️ ${extractionWarning}`);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
catch { /* best-effort */ }
|
|
1262
1297
|
}
|
|
1263
1298
|
}
|
|
1264
1299
|
catch { /* best-effort — 回退正则扫描 */ }
|
|
@@ -1590,6 +1625,7 @@ async function collectProtocolViolations(ctx, callGraph) {
|
|
|
1590
1625
|
},
|
|
1591
1626
|
} : undefined,
|
|
1592
1627
|
annotationSuggestions,
|
|
1628
|
+
extractionWarning,
|
|
1593
1629
|
};
|
|
1594
1630
|
}
|
|
1595
1631
|
function extractCallSequencesFromProject(projectPath, language, keepNames) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "progmune-runtime",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.48",
|
|
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/",
|