@stalfh233/omc-cli 0.6.93 → 0.6.94
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/dist/read.js +27 -1
- package/package.json +3 -3
package/dist/read.js
CHANGED
|
@@ -62,7 +62,10 @@ export async function governedRead(ctx, tool, args, execute, options = {}) {
|
|
|
62
62
|
// r44fb: keep small row sets in the first envelope even when each row has
|
|
63
63
|
// useful detail (data.list items or rulelog nodes).
|
|
64
64
|
const smallRowSet = (Array.isArray(result.items) && result.items.length <= 10)
|
|
65
|
-
|| (Array.isArray(result.logs) && result.logs.length <= 10)
|
|
65
|
+
|| (Array.isArray(result.logs) && result.logs.length <= 10)
|
|
66
|
+
// 2026-11-22(0.6.93 真机,kind:"trigger"):触发器清单就是答案本体——
|
|
67
|
+
// 6 条就超 2048B 被折叠到 artifact,agent 还得再取一次。与 items/logs 同口径。
|
|
68
|
+
|| (Array.isArray(result.triggers) && result.triggers.length <= 30);
|
|
66
69
|
const large = !smallRowSet && jsonBytes(result) > 2048;
|
|
67
70
|
const fileName = `${tool.name.replace(/[^a-zA-Z0-9._-]/g, "_")}-${sha256(target).slice(0, 16)}.json`;
|
|
68
71
|
const artifactRef = writeArtifact(ctx, fileName, detail);
|
|
@@ -238,6 +241,14 @@ function compactReadback(result) {
|
|
|
238
241
|
// `applicationResolution: {code, source, applicationCount}` 由此变成
|
|
239
242
|
// `{keys, sha256, omitted}`,而它正是「零命中只代表这一个应用」的唯一证据。
|
|
240
243
|
// 规则:小对象(≤4 键且 ≤200B)原样内联——折叠它是纯损失,不是省字节。
|
|
244
|
+
// 2026-11-22(0.6.93 真机):教学/证据键被 compact 折叠等于把结论吞掉——
|
|
245
|
+
// `notScanned`(4 行字符串)变 {count:4,sha256,omitted}、`scanned`/`coverage`/
|
|
246
|
+
// `applicationResolution` 同样中招,读起来像"有数据",实际一个字都没有。
|
|
247
|
+
// 这些键按设计就是小体量(计数/几行字符串),按上限原样内联;超限才折叠。
|
|
248
|
+
if (ALWAYS_INLINE_KEYS.has(key) && jsonBytes(value) <= ALWAYS_INLINE_KEYS.get(key)) {
|
|
249
|
+
compact[key] = value;
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
241
252
|
const small = value !== null && typeof value === "object" && !Array.isArray(value)
|
|
242
253
|
&& Object.keys(value).length <= 4
|
|
243
254
|
&& Buffer.byteLength(JSON.stringify(value), "utf8") <= 200;
|
|
@@ -262,6 +273,21 @@ function compactReadback(result) {
|
|
|
262
273
|
}
|
|
263
274
|
return compact;
|
|
264
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* 2026-11-22(0.6.93 真机):compact 路径必须原样保留的**教学/证据**键及其上限
|
|
278
|
+
* (JSON 字节)。这些键不是数据正文,体量由设计保证;折叠它们只会把结论变成
|
|
279
|
+
* `{count,sha256,omitted}`(`notScanned`/`scanned`/`coverage` 真机实证)。
|
|
280
|
+
*/
|
|
281
|
+
const ALWAYS_INLINE_KEYS = new Map([
|
|
282
|
+
["notScanned", 2000],
|
|
283
|
+
["note", 1200],
|
|
284
|
+
["scanNote", 1200],
|
|
285
|
+
["doNot", 600],
|
|
286
|
+
["scanned", 600],
|
|
287
|
+
["coverage", 1200],
|
|
288
|
+
["applicationResolution", 600],
|
|
289
|
+
["summaryHint", 600],
|
|
290
|
+
]);
|
|
265
291
|
/** Config-inventory keys that compact to a code list (not a bare count). */
|
|
266
292
|
const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "datarules", "buttons", "views", "sheets"]);
|
|
267
293
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.94",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.94",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.94"
|
|
78
78
|
}
|
|
79
79
|
}
|