@lmzhen/dsh-evolution-maintenance 0.3.35 → 0.3.37
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/lib/index.js +13 -2
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -325,6 +325,13 @@ function buildMaintainFacts(snapshots, usageObserved, redact) {
|
|
|
325
325
|
signature
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
+
/** V6-38 (0.3.36): a field value carrying its own standalone `Notes:` line is
|
|
329
|
+
* indistinguishable from the plan's section header in the RENDERED text —
|
|
330
|
+
* `beforeNotesHeader` cuts at the first standalone `Notes:` and undercounts
|
|
331
|
+
* recommendations. Mark such lines so they can never read as the header. */
|
|
332
|
+
function sanitizeField(value) {
|
|
333
|
+
return value.split("\n").map((line) => line === "Notes:" ? "> Notes: (inside the field above)" : line).join("\n");
|
|
334
|
+
}
|
|
328
335
|
function formatPlan(validated, runId) {
|
|
329
336
|
const { plan, forcedHuman } = validated;
|
|
330
337
|
const lines = [];
|
|
@@ -341,8 +348,8 @@ function formatPlan(validated, runId) {
|
|
|
341
348
|
item.needs_human ? "HUMAN" : ""
|
|
342
349
|
].filter(Boolean);
|
|
343
350
|
lines.push(`- [${item.kind}] ${item.names.join(", ")} · rule=${item.rule} · ${flags.join(" ")}`);
|
|
344
|
-
lines.push(` finding: ${item.finding}`);
|
|
345
|
-
lines.push(` action: ${item.recommendation}`);
|
|
351
|
+
lines.push(` finding: ${sanitizeField(item.finding)}`);
|
|
352
|
+
lines.push(` action: ${sanitizeField(item.recommendation)}`);
|
|
346
353
|
if (item.undo_path && item.undo_path !== "n/a") lines.push(` undo: ${item.undo_path}`);
|
|
347
354
|
if (item.is_override && item.override_reason) lines.push(` override: ${item.override_reason}`);
|
|
348
355
|
}
|
|
@@ -382,6 +389,10 @@ async function runMaintain(runtime, options = {}) {
|
|
|
382
389
|
|
|
383
390
|
按模板契约输出 JSON 维护计划(verdict/plan/notes);除 skill 工具与维护模板外你无其他工具。`;
|
|
384
391
|
const timeoutMs = options.timeoutMs ?? 6e5;
|
|
392
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 4294967295) return {
|
|
393
|
+
ok: false,
|
|
394
|
+
error: `maintain: --timeout must be a positive integer in ms, at most 4294967295; got ${String(timeoutMs)}`
|
|
395
|
+
};
|
|
385
396
|
const signal = AbortSignal.timeout(timeoutMs);
|
|
386
397
|
abortSignal = signal;
|
|
387
398
|
const agentOptions = { model: options.model ?? runtime.evolutionPolicy?.get()?.curatorModel ?? "deepseek-v4-pro" };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-maintenance",
|
|
3
3
|
"description": "Deterministic maintenance-scan surface: skill-library snapshot assembly, drift signals and mechanical-facts rendering (design 011) (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.37",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
37
|
+
"@lmzhen/dsh-evolution-core": "^0.3.37"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|