omnius 1.0.473 → 1.0.475

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
@@ -559107,7 +559107,7 @@ var init_boundary_verifier = __esm({
559107
559107
  "packages/execution/dist/boundary-verifier.js"() {
559108
559108
  "use strict";
559109
559109
  HEADER_EXT = /\.(h|hh|hpp|hxx|d\.ts)$/i;
559110
- CONTRACT_HINT = /(^|\/)(types|interfaces?|contract|schema|protocol|api|pal)\b/i;
559110
+ CONTRACT_HINT = /(^|\/)(types?|interfaces?|contracts?|schemas?|protocols?|api|dto|models?)\b/i;
559111
559111
  }
559112
559112
  });
559113
559113
 
@@ -575946,7 +575946,7 @@ function resolveFocusSupervisorMode(configured, envValue = process.env["OMNIUS_F
575946
575946
  return "strict";
575947
575947
  return "auto";
575948
575948
  }
575949
- function violatesDirective(directive, input) {
575949
+ function violatesDirective(directive, input, cwd4) {
575950
575950
  if (input.toolName === "task_complete") {
575951
575951
  const completionStatus = normalizeCompletionStatus(input.completionStatus ?? input.args?.["status"] ?? input.args?.["completion_status"] ?? input.args?.["completionStatus"]);
575952
575952
  const summaryText = typeof input.args?.["summary"] === "string" ? input.args["summary"] : "";
@@ -575962,7 +575962,7 @@ function violatesDirective(directive, input) {
575962
575962
  }
575963
575963
  if (input.toolName === "ask_user")
575964
575964
  return false;
575965
- const family = actionFamily(input.toolName, input.args);
575965
+ const family = actionFamily(input.toolName, input.args, cwd4);
575966
575966
  if (directive.requiredNextAction !== "update_todos" && directiveExplicitlyForbidsCall(directive, input, family)) {
575967
575967
  return true;
575968
575968
  }
@@ -576095,7 +576095,41 @@ function actionReasonSummary(actionReason) {
576095
576095
  ].filter(Boolean);
576096
576096
  return parts.length > 0 ? `Action reason observed: ${parts.join("; ").slice(0, 700)}` : "";
576097
576097
  }
576098
- function actionFamily(toolName, args) {
576098
+ function normalizeShellForFamily(command, cwd4) {
576099
+ let s2 = String(command || "").replace(/\\\r?\n/g, " ").replace(/\s+/g, " ").trim();
576100
+ if (cwd4 && cwd4.length > 1) {
576101
+ const abs = cwd4.replace(/\/+$/, "");
576102
+ s2 = s2.split(abs + "/").join("");
576103
+ s2 = s2.split(abs).join(".");
576104
+ }
576105
+ s2 = s2.replace(/\s*(?:\d*>&\d+|&>\s*\/dev\/null|\d*>\s*\/dev\/null)/g, "");
576106
+ let prev;
576107
+ do {
576108
+ prev = s2;
576109
+ s2 = s2.replace(/\s*\|\s*(?:tail|head|less|cat|more)\b[^|]*$/i, "");
576110
+ } while (s2 !== prev);
576111
+ return s2.replace(/\s+/g, " ").trim();
576112
+ }
576113
+ function failureProgressSignal(text2) {
576114
+ const s2 = String(text2 || "");
576115
+ if (!s2.trim())
576116
+ return void 0;
576117
+ let explicit;
576118
+ for (const m2 of s2.matchAll(/(\d+)\s+(?:errors?|failures?|failed|problems?)\b/gi)) {
576119
+ const n2 = Number(m2[1]);
576120
+ if (Number.isFinite(n2))
576121
+ explicit = Math.max(explicit ?? 0, n2);
576122
+ }
576123
+ if (explicit != null)
576124
+ return explicit;
576125
+ let lines = 0;
576126
+ for (const line of s2.split(/\r?\n/)) {
576127
+ if (/\b(errors?|fail(?:ed|ure|ures|s)?)\b/i.test(line))
576128
+ lines++;
576129
+ }
576130
+ return lines > 0 ? lines : void 0;
576131
+ }
576132
+ function actionFamily(toolName, args, cwd4) {
576099
576133
  if (isEditTool(toolName)) {
576100
576134
  const path13 = primaryPath(args);
576101
576135
  const target2 = editTargetDescriptor(toolName, args);
@@ -576103,14 +576137,14 @@ function actionFamily(toolName, args) {
576103
576137
  }
576104
576138
  if (toolName === "shell") {
576105
576139
  const command = args?.["command"] ?? args?.["cmd"] ?? "";
576106
- return `${toolName}:${compactTarget(String(command ?? "") || "no-command", 120)}`;
576140
+ return `${toolName}:${compactTarget(normalizeShellForFamily(String(command ?? ""), cwd4) || "no-command", 120)}`;
576107
576141
  }
576108
576142
  const target = primaryPath(args) ?? "";
576109
576143
  return `${toolName}:${compactTarget(String(target ?? "")) || "no-target"}`;
576110
576144
  }
576111
- function failureFamilyKey(toolName, args, error, output) {
576145
+ function failureFamilyKey(toolName, args, error, output, cwd4) {
576112
576146
  const errorClass = failureErrorClass(error || output || "");
576113
- return `${actionFamily(toolName, args)}:${errorClass}`;
576147
+ return `${actionFamily(toolName, args, cwd4)}:${errorClass}`;
576114
576148
  }
576115
576149
  function cleanFailureSample(text2) {
576116
576150
  return String(text2 || "").replace(/\s+/g, " ").trim().slice(0, 180);
@@ -576245,6 +576279,10 @@ var init_focusSupervisor = __esm({
576245
576279
  convergenceBreaker = null;
576246
576280
  /** WO-3: set when a mutation lands, consumed by the next observed failure. */
576247
576281
  sawMutationSinceFailure = false;
576282
+ /** WO-9: run cwd for shell family path-form canonicalization. */
576283
+ familyCwd = void 0;
576284
+ /** WO-9b: within-session repeat count per coarse action-identity family. */
576285
+ convergenceFamilyCounts = /* @__PURE__ */ new Map();
576248
576286
  ignoredDirectiveStreak = 0;
576249
576287
  lastIgnoredDirectiveTurn = null;
576250
576288
  availableTools = null;
@@ -576254,6 +576292,7 @@ var init_focusSupervisor = __esm({
576254
576292
  this.repeatGateMax = Math.max(0, Math.floor(options2.repeatGateMax ?? 3));
576255
576293
  this.availableTools = options2.availableTools ? new Set(Array.from(options2.availableTools)) : null;
576256
576294
  this.convergenceBreaker = options2.convergenceBreaker ?? null;
576295
+ this.familyCwd = options2.cwd;
576257
576296
  }
576258
576297
  get enabled() {
576259
576298
  return this.mode !== "off";
@@ -576314,9 +576353,9 @@ var init_focusSupervisor = __esm({
576314
576353
  this.ignoredDirectiveStreak = 0;
576315
576354
  }
576316
576355
  }
576317
- const family = actionFamily(input.toolName, input.args);
576356
+ const family = actionFamily(input.toolName, input.args, this.familyCwd);
576318
576357
  const prior = this.directive;
576319
- if (prior && violatesDirective(prior, input)) {
576358
+ if (prior && violatesDirective(prior, input, this.familyCwd)) {
576320
576359
  if (prior.state === "warn") {
576321
576360
  this.lastDecision = "warn_not_enforced";
576322
576361
  this.lastReason = prior.reason;
@@ -576484,6 +576523,11 @@ var init_focusSupervisor = __esm({
576484
576523
  return;
576485
576524
  }
576486
576525
  if (input.toolName === "shell" && input.success) {
576526
+ if (this.convergenceBreaker) {
576527
+ const fam = actionFamily(input.toolName, input.args, this.familyCwd);
576528
+ this.convergenceBreaker.resolve(fam);
576529
+ this.convergenceFamilyCounts.delete(fam);
576530
+ }
576487
576531
  if (this.directive?.requiredNextAction === "run_verification") {
576488
576532
  this.clearSatisfiedDirective("verification ran successfully", input.turn);
576489
576533
  } else if (input.isReadLike && this.directive?.requiredNextAction === "read_authoritative_target") {
@@ -576495,7 +576539,7 @@ var init_focusSupervisor = __esm({
576495
576539
  }
576496
576540
  if (input.success)
576497
576541
  return;
576498
- const family = failureFamilyKey(input.toolName, input.args, input.error, input.output);
576542
+ const family = failureFamilyKey(input.toolName, input.args, input.error, input.output, this.familyCwd);
576499
576543
  const existing = this.failureFamilies.get(family);
576500
576544
  const next = {
576501
576545
  count: (existing?.count ?? 0) + 1,
@@ -576507,10 +576551,10 @@ var init_focusSupervisor = __esm({
576507
576551
  if (next.count >= 2) {
576508
576552
  const ambiguousEditFailure = isEditTool(input.toolName) && next.errorClass === "stale_ambiguous_target";
576509
576553
  const staleEditFailure = isEditTool(input.toolName) && next.errorClass.startsWith("stale_");
576510
- const forbidden = staleEditFailure ? ambiguousEditFailure ? [actionFamily(input.toolName, input.args)] : uniqueLimited([
576511
- actionFamily(input.toolName, input.args),
576554
+ const forbidden = staleEditFailure ? ambiguousEditFailure ? [actionFamily(input.toolName, input.args, this.familyCwd)] : uniqueLimited([
576555
+ actionFamily(input.toolName, input.args, this.familyCwd),
576512
576556
  input.toolName
576513
- ]) : input.toolName === "shell" ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)];
576557
+ ]) : input.toolName === "shell" ? [actionFamily(input.toolName, input.args, this.familyCwd)] : [actionFamily(input.toolName, input.args, this.familyCwd)];
576514
576558
  const requiredNextAction = ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "use_cached_evidence" : this.resolveRequiredNextAction("update_todos");
576515
576559
  this.setDirective({
576516
576560
  turn: input.turn,
@@ -576529,17 +576573,24 @@ var init_focusSupervisor = __esm({
576529
576573
  state: shellFailure ? "cached_evidence" : "warn",
576530
576574
  reason: `first ${input.toolName} failure (${next.errorClass}): ${next.sample}`,
576531
576575
  requiredNextAction,
576532
- forbiddenActionFamilies: shellFailure ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)]
576576
+ forbiddenActionFamilies: shellFailure ? [actionFamily(input.toolName, input.args, this.familyCwd)] : [actionFamily(input.toolName, input.args, this.familyCwd)]
576533
576577
  });
576534
576578
  }
576535
576579
  if (this.convergenceBreaker) {
576580
+ const convergenceFamily = actionFamily(input.toolName, input.args, this.familyCwd);
576581
+ const convCount = (this.convergenceFamilyCounts.get(convergenceFamily) ?? 0) + 1;
576582
+ this.convergenceFamilyCounts.set(convergenceFamily, convCount);
576536
576583
  const verdict = this.convergenceBreaker.observe({
576537
- family,
576538
- sessionCount: next.count,
576584
+ family: convergenceFamily,
576585
+ sessionCount: convCount,
576539
576586
  turn: input.turn,
576540
576587
  sample: next.sample,
576541
576588
  errorClass: next.errorClass,
576542
- mutatedSinceLast: this.sawMutationSinceFailure
576589
+ mutatedSinceLast: this.sawMutationSinceFailure,
576590
+ // Root fix: progress = the action's error count dropped, not that an
576591
+ // edit happened. Extract the signal from the action's own output so a
576592
+ // futile edit loop (rebuilding with the same error count) escalates.
576593
+ failureSignal: failureProgressSignal(input.output || input.error)
576543
576594
  });
576544
576595
  this.sawMutationSinceFailure = false;
576545
576596
  if (verdict.tier === "abandon") {
@@ -576550,7 +576601,7 @@ var init_focusSupervisor = __esm({
576550
576601
  state: "forced_replan",
576551
576602
  reason: verdict.reason,
576552
576603
  requiredNextAction: this.resolveRequiredNextAction("run_verification"),
576553
- forbiddenActionFamilies: [actionFamily(input.toolName, input.args)]
576604
+ forbiddenActionFamilies: [actionFamily(input.toolName, input.args, this.familyCwd)]
576554
576605
  });
576555
576606
  }
576556
576607
  }
@@ -576702,6 +576753,8 @@ var init_convergence_breaker = __esm({
576702
576753
  baseline = /* @__PURE__ */ new Map();
576703
576754
  /** Progress decay accumulated this session (one per productive mutation). */
576704
576755
  decay = /* @__PURE__ */ new Map();
576756
+ /** Last verification signal (error count) seen per family, for delta-based progress. */
576757
+ lastSignal = /* @__PURE__ */ new Map();
576705
576758
  constructor(options2 = {}) {
576706
576759
  this.warnRound = Math.max(1, options2.warnRound ?? DEFAULTS.warnRound);
576707
576760
  this.stallRound = Math.max(this.warnRound + 1, options2.stallRound ?? DEFAULTS.stallRound);
@@ -576721,7 +576774,15 @@ var init_convergence_breaker = __esm({
576721
576774
  }
576722
576775
  const base3 = this.baseline.get(obs.family) ?? 0;
576723
576776
  let dec = this.decay.get(obs.family) ?? 0;
576724
- if (obs.mutatedSinceLast) {
576777
+ let madeProgress;
576778
+ if (obs.failureSignal != null) {
576779
+ const prev = this.lastSignal.get(obs.family);
576780
+ madeProgress = prev != null && obs.failureSignal < prev;
576781
+ this.lastSignal.set(obs.family, obs.failureSignal);
576782
+ } else {
576783
+ madeProgress = Boolean(obs.mutatedSinceLast);
576784
+ }
576785
+ if (madeProgress) {
576725
576786
  dec += 1;
576726
576787
  this.decay.set(obs.family, dec);
576727
576788
  }
@@ -576743,6 +576804,7 @@ var init_convergence_breaker = __esm({
576743
576804
  this.live.delete(family);
576744
576805
  this.baseline.delete(family);
576745
576806
  this.decay.delete(family);
576807
+ this.lastSignal.delete(family);
576746
576808
  this.store.save({ family, rounds: 0, updatedAtMs: Date.now() });
576747
576809
  }
576748
576810
  snapshot() {
@@ -587163,7 +587225,10 @@ Respond with your assessment, then take action.`;
587163
587225
  // WO-3: convergence circuit-breaker escalates a non-converging
587164
587226
  // failure family past forced_replan to a terminal report, with
587165
587227
  // cross-session carry persisted under .omnius/convergence-ledger.json.
587166
- convergenceBreaker: this._longHaul?.convergenceBreaker ?? null
587228
+ convergenceBreaker: this._longHaul?.convergenceBreaker ?? null,
587229
+ // WO-9: run cwd so shell family keys canonicalize absolute↔relative
587230
+ // path form and command variants collapse into one family.
587231
+ cwd: this.authoritativeWorkingDirectory()
587167
587232
  });
587168
587233
  if (!this._workingDirectory) {
587169
587234
  this._workingDirectory = _pathResolve(process.cwd());
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.473",
3
+ "version": "1.0.475",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.473",
9
+ "version": "1.0.475",
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.473",
3
+ "version": "1.0.475",
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",