omnius 1.0.514 → 1.0.515

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
@@ -576538,7 +576538,13 @@ function violatesDirective(directive, input, cwd4) {
576538
576538
  return false;
576539
576539
  return true;
576540
576540
  case "run_verification":
576541
- return input.toolName !== "shell";
576541
+ if (input.toolName === "shell")
576542
+ return false;
576543
+ if (isEvidenceGatheringTool(input.toolName) || input.isReadLike)
576544
+ return false;
576545
+ if (isEditTool(input.toolName))
576546
+ return false;
576547
+ return true;
576542
576548
  case "report_blocked":
576543
576549
  case "report_incomplete":
576544
576550
  return !isReportTool(input.toolName);
@@ -582003,6 +582009,19 @@ function malformedToolArgsMessage(toolName, raw) {
582003
582009
  function looksLikeShellFileWrite(command) {
582004
582010
  return /\bcat\s+[^|;&\n]*>\s*[^&|;\n]+/.test(command) || /\b(?:tee|dd)\b[\s\S]*(?:\bof=|>\s*[^&|;\n]+)/.test(command) || /\b(?:echo|printf)\b[\s\S]*>\s*[^&|;\n]+/.test(command) || /\bpython(?:3)?\b[\s\S]*(?:write_text|open\([^)]*["']w["'])/.test(command) || /<<\s*['"]?\w+['"]?[\s\S]*>\s*[^&|;\n]+/.test(command);
582005
582011
  }
582012
+ function normalizeShellCommandForFingerprint(command) {
582013
+ let c10 = command.trim().replace(/\s+/g, " ");
582014
+ let prev = "";
582015
+ while (prev !== c10) {
582016
+ prev = c10;
582017
+ c10 = c10.replace(/^echo\s+(?:"[^"]*"|'[^']*')\s*(?:&&|;)\s*/i, "");
582018
+ }
582019
+ c10 = c10.replace(/\s*(?:;|&&)\s*echo\s+(?:"[^"]*\$\?[^"]*"|'[^']*\$\?[^']*'|\S*\$\?\S*)\s*$/i, "");
582020
+ c10 = c10.replace(/\s*\|\s*(?:head|tail)\s+(?:-n\s*)?-?\d+\s*$/i, "");
582021
+ c10 = c10.replace(/\s*\|\s*(?:head|tail)\s+-c\s*\d+\s*$/i, "");
582022
+ c10 = c10.replace(/\s*2>&1\s*$/, "");
582023
+ return c10.trim();
582024
+ }
582006
582025
  function normalizeProviderToolMessage(msg, model) {
582007
582026
  const rawContent2 = typeof msg.content === "string" ? msg.content : "";
582008
582027
  const profile = resolveModelProfile(model);
@@ -582940,9 +582959,13 @@ var init_agenticRunner = __esm({
582940
582959
  // of the same completion gate and terminate as incomplete_verification after a
582941
582960
  // small threshold so the run stops without falsely marking completion.
582942
582961
  // Reset whenever a completion is allowed.
582962
+ // `total` (REG-74) counts EVERY hold this run regardless of gate/summary key —
582963
+ // rotating gate codes or paraphrased summaries reset `count` but never
582964
+ // `total`, so the hard-escape below cannot be starved by variation.
582943
582965
  _completionHoldState = {
582944
582966
  count: 0,
582945
- lastKey: ""
582967
+ lastKey: "",
582968
+ total: 0
582946
582969
  };
582947
582970
  _completionIncompleteVerification = null;
582948
582971
  /**
@@ -586128,7 +586151,7 @@ ${shellLines.join("\n")}` : "Commands run: none"
586128
586151
  }
586129
586152
  if (!verdict)
586130
586153
  return { proceed: true };
586131
- if (verdict.resolved || verdict.confidence < 0.5) {
586154
+ if (verdict.resolved || verdict.confidence < 0.65) {
586132
586155
  this._resolutionGateRejections = 0;
586133
586156
  return { proceed: true };
586134
586157
  }
@@ -588980,6 +589003,11 @@ ${blob}
588980
589003
  }
588981
589004
  _buildToolFingerprint(name10, args) {
588982
589005
  const canonical = this.lookupRegisteredTool(name10)?.name ?? name10;
589006
+ if (canonical === "shell" && typeof args?.["command"] === "string") {
589007
+ const normalized = normalizeShellCommandForFingerprint(args["command"]);
589008
+ const rest = this._buildExactArgsKey({ ...args, command: normalized });
589009
+ return `${canonical}:${rest}`;
589010
+ }
588983
589011
  return `${canonical}:${this._buildExactArgsKey(args)}`;
588984
589012
  }
588985
589013
  // ── REG-71: region-aware read dedup ────────────────────────────────────────
@@ -590743,14 +590771,41 @@ TASK: ${scrubbedTask}` : scrubbedTask;
590743
590771
  const raw = Number(process.env["OMNIUS_COMPLETION_HOLD_MAX"]);
590744
590772
  return Number.isFinite(raw) && raw >= 1 ? Math.floor(raw) : 3;
590745
590773
  })();
590774
+ const completionHoldHardMax = (() => {
590775
+ const raw = Number(process.env["OMNIUS_COMPLETION_HOLD_HARD_MAX"]);
590776
+ if (Number.isFinite(raw) && raw >= 1)
590777
+ return Math.floor(raw);
590778
+ return completionHoldEscapeMax * 2;
590779
+ })();
590746
590780
  const holdTaskCompleteGates = (args, turn) => {
590781
+ if (this._completionHoldState.total >= completionHoldHardMax) {
590782
+ const caveat = [
590783
+ `[UNVERIFIED — completion accepted after ${this._completionHoldState.total} gate holds]`,
590784
+ lastCompletionGateReason ? `Last unresolved gate: ${lastCompletionGateReason.slice(0, 300)}` : ""
590785
+ ].filter(Boolean).join("\n");
590786
+ this._completionCaveat = this._completionCaveat ? `${this._completionCaveat}
590787
+ ${caveat}` : caveat;
590788
+ this.emit({
590789
+ type: "status",
590790
+ content: `Completion hold hard-escape: allowing task_complete after ${this._completionHoldState.total} total holds (caveat recorded)`,
590791
+ turn,
590792
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
590793
+ });
590794
+ this._completionHoldState.count = 0;
590795
+ this._completionHoldState.lastKey = "";
590796
+ this._completionHoldState.total = 0;
590797
+ lastCompletionGateCode = "";
590798
+ return false;
590799
+ }
590747
590800
  const held = holdUnresolvedVerificationTaskComplete(turn) || holdNoProgressTaskComplete(args, turn) || holdProvenanceTaskComplete(args, turn);
590748
590801
  if (!held) {
590749
590802
  this._completionHoldState.count = 0;
590750
590803
  this._completionHoldState.lastKey = "";
590804
+ this._completionHoldState.total = 0;
590751
590805
  lastCompletionGateCode = "";
590752
590806
  return false;
590753
590807
  }
590808
+ this._completionHoldState.total += 1;
590754
590809
  this._focusSupervisor?.markCompletionBlocked({
590755
590810
  turn,
590756
590811
  reason: lastCompletionGateReason || "completion requested before required evidence was present",
@@ -596243,9 +596298,20 @@ Your most recent tool calls SUCCEEDED. If the task is complete, call task_comple
596243
596298
  });
596244
596299
  break;
596245
596300
  }
596246
- const codeBlockMatch = content.match(/```(?:bash|sh|shell|zsh)?\s*\n([\s\S]*?)```/);
596247
- if (codeBlockMatch && codeBlockMatch[1]?.trim()) {
596248
- const shellCommands = codeBlockMatch[1].trim().split("\n").filter((l2) => l2.trim() && !l2.trim().startsWith("#")).join(" && ");
596301
+ const codeBlockMatch = content.match(/```(?:bash|sh|shell|zsh)\s*\n([\s\S]*?)```/);
596302
+ const codeBlockLines = codeBlockMatch?.[1] ? codeBlockMatch[1].trim().split("\n").filter((l2) => l2.trim() && !l2.trim().startsWith("#")) : [];
596303
+ const everyLineLooksExecutable = codeBlockLines.length > 0 && codeBlockLines.every((l2) => {
596304
+ const t2 = l2.trim();
596305
+ if (/^\d+[:.]/.test(t2))
596306
+ return false;
596307
+ if (/^(\/\/|\/\*|\*|→|▶|✔|✖|[│├└╭╰|])/.test(t2))
596308
+ return false;
596309
+ if (/^[<>{}[\]]/.test(t2))
596310
+ return false;
596311
+ return /^[A-Za-z_./~"'$(]/.test(t2);
596312
+ });
596313
+ if (codeBlockMatch && everyLineLooksExecutable) {
596314
+ const shellCommands = codeBlockLines.join(" && ");
596249
596315
  if (shellCommands.length > 0 && shellCommands.length < 2e3) {
596250
596316
  if (looksLikeShellFileWrite(shellCommands)) {
596251
596317
  messages2.push({
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.514",
3
+ "version": "1.0.515",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.514",
9
+ "version": "1.0.515",
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.514",
3
+ "version": "1.0.515",
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",