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 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 detectExplicitDegradedCompletion(i2) {
568273
- const original = i2.originalGoal.toLowerCase();
568274
- const summary = i2.proposedSummary.toLowerCase();
568275
- const evidence = `${i2.actionsDigest}
568276
- ${i2.evidenceDigest}`.toLowerCase();
568277
- const permitsFallback = /\bif\b[\s\S]{0,160}\b(?:fails?|failed|failure|blocked|unavailable|cannot|can't|unable)\b[\s\S]{0,180}\b(?:document|report|note|record|summari[sz]e|explain)\b/.test(original) || /\b(?:document|report|note|record|summari[sz]e|explain)\b[\s\S]{0,180}\b(?:fails?|failed|failure|blocked|unavailable|cannot|can't|unable)\b/.test(original) || /\b(?:fallback|degraded|best effort|best-effort|honestly document|document honestly)\b/.test(original);
568278
- if (!permitsFallback)
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 disclosesFailure = /\b(?:fail(?:ed|ure)?|blocked|unable|could not|couldn't|cannot|can't|degraded|partial|not available|unavailable)\b/.test(summary);
568281
- if (!disclosesFailure)
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
- const hasFallbackEvidence = /\b(?:passed|success|succeeded|verified|wrote|created|saved|report|artifact|file changed|files changed|last test outcome: passed|exit code 0)\b/.test(evidence) || /\b(?:verifier|verification|report)\b/.test(summary);
568284
- if (!hasFallbackEvidence)
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
- reason: "original request explicitly allowed a degraded/failure-report fallback and the completion disclosed the failure with fallback evidence"
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 = detectExplicitDegradedCompletion({
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({
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.370",
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.370",
9
+ "version": "1.0.371",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.370",
3
+ "version": "1.0.371",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",