omnius 1.0.473 → 1.0.474

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,22 @@ 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 actionFamily(toolName, args, cwd4) {
576099
576114
  if (isEditTool(toolName)) {
576100
576115
  const path13 = primaryPath(args);
576101
576116
  const target2 = editTargetDescriptor(toolName, args);
@@ -576103,14 +576118,14 @@ function actionFamily(toolName, args) {
576103
576118
  }
576104
576119
  if (toolName === "shell") {
576105
576120
  const command = args?.["command"] ?? args?.["cmd"] ?? "";
576106
- return `${toolName}:${compactTarget(String(command ?? "") || "no-command", 120)}`;
576121
+ return `${toolName}:${compactTarget(normalizeShellForFamily(String(command ?? ""), cwd4) || "no-command", 120)}`;
576107
576122
  }
576108
576123
  const target = primaryPath(args) ?? "";
576109
576124
  return `${toolName}:${compactTarget(String(target ?? "")) || "no-target"}`;
576110
576125
  }
576111
- function failureFamilyKey(toolName, args, error, output) {
576126
+ function failureFamilyKey(toolName, args, error, output, cwd4) {
576112
576127
  const errorClass = failureErrorClass(error || output || "");
576113
- return `${actionFamily(toolName, args)}:${errorClass}`;
576128
+ return `${actionFamily(toolName, args, cwd4)}:${errorClass}`;
576114
576129
  }
576115
576130
  function cleanFailureSample(text2) {
576116
576131
  return String(text2 || "").replace(/\s+/g, " ").trim().slice(0, 180);
@@ -576245,6 +576260,10 @@ var init_focusSupervisor = __esm({
576245
576260
  convergenceBreaker = null;
576246
576261
  /** WO-3: set when a mutation lands, consumed by the next observed failure. */
576247
576262
  sawMutationSinceFailure = false;
576263
+ /** WO-9: run cwd for shell family path-form canonicalization. */
576264
+ familyCwd = void 0;
576265
+ /** WO-9b: within-session repeat count per coarse action-identity family. */
576266
+ convergenceFamilyCounts = /* @__PURE__ */ new Map();
576248
576267
  ignoredDirectiveStreak = 0;
576249
576268
  lastIgnoredDirectiveTurn = null;
576250
576269
  availableTools = null;
@@ -576254,6 +576273,7 @@ var init_focusSupervisor = __esm({
576254
576273
  this.repeatGateMax = Math.max(0, Math.floor(options2.repeatGateMax ?? 3));
576255
576274
  this.availableTools = options2.availableTools ? new Set(Array.from(options2.availableTools)) : null;
576256
576275
  this.convergenceBreaker = options2.convergenceBreaker ?? null;
576276
+ this.familyCwd = options2.cwd;
576257
576277
  }
576258
576278
  get enabled() {
576259
576279
  return this.mode !== "off";
@@ -576314,9 +576334,9 @@ var init_focusSupervisor = __esm({
576314
576334
  this.ignoredDirectiveStreak = 0;
576315
576335
  }
576316
576336
  }
576317
- const family = actionFamily(input.toolName, input.args);
576337
+ const family = actionFamily(input.toolName, input.args, this.familyCwd);
576318
576338
  const prior = this.directive;
576319
- if (prior && violatesDirective(prior, input)) {
576339
+ if (prior && violatesDirective(prior, input, this.familyCwd)) {
576320
576340
  if (prior.state === "warn") {
576321
576341
  this.lastDecision = "warn_not_enforced";
576322
576342
  this.lastReason = prior.reason;
@@ -576484,6 +576504,11 @@ var init_focusSupervisor = __esm({
576484
576504
  return;
576485
576505
  }
576486
576506
  if (input.toolName === "shell" && input.success) {
576507
+ if (this.convergenceBreaker) {
576508
+ const fam = actionFamily(input.toolName, input.args, this.familyCwd);
576509
+ this.convergenceBreaker.resolve(fam);
576510
+ this.convergenceFamilyCounts.delete(fam);
576511
+ }
576487
576512
  if (this.directive?.requiredNextAction === "run_verification") {
576488
576513
  this.clearSatisfiedDirective("verification ran successfully", input.turn);
576489
576514
  } else if (input.isReadLike && this.directive?.requiredNextAction === "read_authoritative_target") {
@@ -576495,7 +576520,7 @@ var init_focusSupervisor = __esm({
576495
576520
  }
576496
576521
  if (input.success)
576497
576522
  return;
576498
- const family = failureFamilyKey(input.toolName, input.args, input.error, input.output);
576523
+ const family = failureFamilyKey(input.toolName, input.args, input.error, input.output, this.familyCwd);
576499
576524
  const existing = this.failureFamilies.get(family);
576500
576525
  const next = {
576501
576526
  count: (existing?.count ?? 0) + 1,
@@ -576507,10 +576532,10 @@ var init_focusSupervisor = __esm({
576507
576532
  if (next.count >= 2) {
576508
576533
  const ambiguousEditFailure = isEditTool(input.toolName) && next.errorClass === "stale_ambiguous_target";
576509
576534
  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),
576535
+ const forbidden = staleEditFailure ? ambiguousEditFailure ? [actionFamily(input.toolName, input.args, this.familyCwd)] : uniqueLimited([
576536
+ actionFamily(input.toolName, input.args, this.familyCwd),
576512
576537
  input.toolName
576513
- ]) : input.toolName === "shell" ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)];
576538
+ ]) : input.toolName === "shell" ? [actionFamily(input.toolName, input.args, this.familyCwd)] : [actionFamily(input.toolName, input.args, this.familyCwd)];
576514
576539
  const requiredNextAction = ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "use_cached_evidence" : this.resolveRequiredNextAction("update_todos");
576515
576540
  this.setDirective({
576516
576541
  turn: input.turn,
@@ -576529,13 +576554,16 @@ var init_focusSupervisor = __esm({
576529
576554
  state: shellFailure ? "cached_evidence" : "warn",
576530
576555
  reason: `first ${input.toolName} failure (${next.errorClass}): ${next.sample}`,
576531
576556
  requiredNextAction,
576532
- forbiddenActionFamilies: shellFailure ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)]
576557
+ forbiddenActionFamilies: shellFailure ? [actionFamily(input.toolName, input.args, this.familyCwd)] : [actionFamily(input.toolName, input.args, this.familyCwd)]
576533
576558
  });
576534
576559
  }
576535
576560
  if (this.convergenceBreaker) {
576561
+ const convergenceFamily = actionFamily(input.toolName, input.args, this.familyCwd);
576562
+ const convCount = (this.convergenceFamilyCounts.get(convergenceFamily) ?? 0) + 1;
576563
+ this.convergenceFamilyCounts.set(convergenceFamily, convCount);
576536
576564
  const verdict = this.convergenceBreaker.observe({
576537
- family,
576538
- sessionCount: next.count,
576565
+ family: convergenceFamily,
576566
+ sessionCount: convCount,
576539
576567
  turn: input.turn,
576540
576568
  sample: next.sample,
576541
576569
  errorClass: next.errorClass,
@@ -576550,7 +576578,7 @@ var init_focusSupervisor = __esm({
576550
576578
  state: "forced_replan",
576551
576579
  reason: verdict.reason,
576552
576580
  requiredNextAction: this.resolveRequiredNextAction("run_verification"),
576553
- forbiddenActionFamilies: [actionFamily(input.toolName, input.args)]
576581
+ forbiddenActionFamilies: [actionFamily(input.toolName, input.args, this.familyCwd)]
576554
576582
  });
576555
576583
  }
576556
576584
  }
@@ -587163,7 +587191,10 @@ Respond with your assessment, then take action.`;
587163
587191
  // WO-3: convergence circuit-breaker escalates a non-converging
587164
587192
  // failure family past forced_replan to a terminal report, with
587165
587193
  // cross-session carry persisted under .omnius/convergence-ledger.json.
587166
- convergenceBreaker: this._longHaul?.convergenceBreaker ?? null
587194
+ convergenceBreaker: this._longHaul?.convergenceBreaker ?? null,
587195
+ // WO-9: run cwd so shell family keys canonicalize absolute↔relative
587196
+ // path form and command variants collapse into one family.
587197
+ cwd: this.authoritativeWorkingDirectory()
587167
587198
  });
587168
587199
  if (!this._workingDirectory) {
587169
587200
  this._workingDirectory = _pathResolve(process.cwd());
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.473",
3
+ "version": "1.0.474",
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.474",
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.474",
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",