omnius 1.0.370 → 1.0.371
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/index.js +84 -15
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -568269,23 +568269,54 @@ function resolutionSystemPrompt() {
|
|
|
568269
568269
|
"original request. When in doubt, resolved=false and name what is missing."
|
|
568270
568270
|
].join("\n");
|
|
568271
568271
|
}
|
|
568272
|
-
function
|
|
568273
|
-
|
|
568274
|
-
|
|
568275
|
-
|
|
568276
|
-
|
|
568277
|
-
|
|
568278
|
-
|
|
568272
|
+
function buildDegradedCompletionPrompt(i2) {
|
|
568273
|
+
return [
|
|
568274
|
+
"Decide whether this task_complete claim should be accepted as an explicitly permitted degraded/failure-report completion.",
|
|
568275
|
+
"",
|
|
568276
|
+
"Accept only if all three are true:",
|
|
568277
|
+
"1. The original request explicitly permits a fallback where a failed/blocked tool or subtask is documented/reported instead of fully fixed.",
|
|
568278
|
+
"2. The completion claim clearly discloses the failed/blocked/degraded part.",
|
|
568279
|
+
"3. The actions/evidence show the requested fallback artifact/report/verification was actually produced.",
|
|
568280
|
+
"",
|
|
568281
|
+
"Reject if the request merely asks for the main work to be fixed, or if the failure disclosure/fallback evidence is missing.",
|
|
568282
|
+
"",
|
|
568283
|
+
"ORIGINAL REQUEST:",
|
|
568284
|
+
i2.originalGoal.slice(0, 2e3) || "(empty)",
|
|
568285
|
+
"",
|
|
568286
|
+
"ACTIONS:",
|
|
568287
|
+
i2.actionsDigest.slice(0, 3e3) || "(none recorded)",
|
|
568288
|
+
"",
|
|
568289
|
+
"EVIDENCE:",
|
|
568290
|
+
i2.evidenceDigest.slice(0, 2e3) || "(none recorded)",
|
|
568291
|
+
"",
|
|
568292
|
+
"COMPLETION CLAIM:",
|
|
568293
|
+
i2.proposedSummary.slice(0, 1500) || "(empty)",
|
|
568294
|
+
"",
|
|
568295
|
+
'Return only JSON: {"accepted":true|false,"confidence":0.0-1.0,"reason":"one sentence"}'
|
|
568296
|
+
].join("\n");
|
|
568297
|
+
}
|
|
568298
|
+
function parseDegradedCompletionVerdict(raw) {
|
|
568299
|
+
if (!raw)
|
|
568279
568300
|
return null;
|
|
568280
|
-
const
|
|
568281
|
-
|
|
568301
|
+
const text2 = raw.trim().replace(/^```(?:json)?/i, "").replace(/```$/i, "").trim();
|
|
568302
|
+
const start2 = text2.indexOf("{");
|
|
568303
|
+
const end = text2.lastIndexOf("}");
|
|
568304
|
+
if (start2 < 0 || end <= start2)
|
|
568282
568305
|
return null;
|
|
568283
|
-
|
|
568284
|
-
|
|
568306
|
+
let obj;
|
|
568307
|
+
try {
|
|
568308
|
+
obj = JSON.parse(text2.slice(start2, end + 1));
|
|
568309
|
+
} catch {
|
|
568285
568310
|
return null;
|
|
568311
|
+
}
|
|
568312
|
+
let confidence2 = Number(obj["confidence"]);
|
|
568313
|
+
if (!Number.isFinite(confidence2))
|
|
568314
|
+
confidence2 = 0.5;
|
|
568315
|
+
confidence2 = Math.min(1, Math.max(0, confidence2));
|
|
568286
568316
|
return {
|
|
568287
|
-
accepted: true,
|
|
568288
|
-
|
|
568317
|
+
accepted: obj["accepted"] === true,
|
|
568318
|
+
confidence: confidence2,
|
|
568319
|
+
reason: String(obj["reason"] ?? "").slice(0, 500)
|
|
568289
568320
|
};
|
|
568290
568321
|
}
|
|
568291
568322
|
function buildResolutionPrompt(i2) {
|
|
@@ -573007,6 +573038,43 @@ ${input.answerText ?? ""}`.toLowerCase().trim();
|
|
|
573007
573038
|
].join("\n");
|
|
573008
573039
|
return { proceed: false, feedback, reason };
|
|
573009
573040
|
}
|
|
573041
|
+
async _inferExplicitDegradedCompletion(input) {
|
|
573042
|
+
try {
|
|
573043
|
+
this._emitModelResolutionTelemetry("explicit_degraded_completion", input.turn);
|
|
573044
|
+
const backend = this._auxInferenceBackend();
|
|
573045
|
+
const resp = await backend.chatCompletion({
|
|
573046
|
+
messages: [
|
|
573047
|
+
{
|
|
573048
|
+
role: "system",
|
|
573049
|
+
content: "You are a strict completion-contract classifier. Return only JSON."
|
|
573050
|
+
},
|
|
573051
|
+
{
|
|
573052
|
+
role: "user",
|
|
573053
|
+
content: buildDegradedCompletionPrompt({
|
|
573054
|
+
originalGoal: input.originalGoal,
|
|
573055
|
+
actionsDigest: input.actionsDigest,
|
|
573056
|
+
evidenceDigest: input.evidenceDigest,
|
|
573057
|
+
proposedSummary: input.proposedSummary
|
|
573058
|
+
})
|
|
573059
|
+
}
|
|
573060
|
+
],
|
|
573061
|
+
tools: [],
|
|
573062
|
+
temperature: 0,
|
|
573063
|
+
maxTokens: 400,
|
|
573064
|
+
timeoutMs: 2e4
|
|
573065
|
+
});
|
|
573066
|
+
const verdict = parseDegradedCompletionVerdict(resp.choices?.[0]?.message?.content ?? "");
|
|
573067
|
+
if (verdict?.accepted && verdict.confidence >= 0.6) {
|
|
573068
|
+
return {
|
|
573069
|
+
accepted: true,
|
|
573070
|
+
reason: verdict.reason || "inference classified this as an explicitly permitted degraded completion"
|
|
573071
|
+
};
|
|
573072
|
+
}
|
|
573073
|
+
return null;
|
|
573074
|
+
} catch {
|
|
573075
|
+
return null;
|
|
573076
|
+
}
|
|
573077
|
+
}
|
|
573010
573078
|
/**
|
|
573011
573079
|
* REG-47: post-implementation backward-pass review.
|
|
573012
573080
|
*
|
|
@@ -573076,12 +573144,13 @@ ${shellLines.join("\n")}` : "Commands run: none"
|
|
|
573076
573144
|
const failCount = toolCallLog.filter((e2) => e2.success === false).length;
|
|
573077
573145
|
evidenceParts.push(`Failed tool calls this run: ${failCount}`);
|
|
573078
573146
|
const evidenceDigest = evidenceParts.join("\n");
|
|
573079
|
-
const degraded =
|
|
573147
|
+
const degraded = failCount > 0 ? await this._inferExplicitDegradedCompletion({
|
|
573148
|
+
turn,
|
|
573080
573149
|
originalGoal,
|
|
573081
573150
|
actionsDigest,
|
|
573082
573151
|
evidenceDigest,
|
|
573083
573152
|
proposedSummary
|
|
573084
|
-
});
|
|
573153
|
+
}) : null;
|
|
573085
573154
|
if (degraded) {
|
|
573086
573155
|
this._resolutionGateRejections = 0;
|
|
573087
573156
|
this.emit({
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.371",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.371",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED