omnius 1.0.271 → 1.0.272

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
@@ -564881,7 +564881,7 @@ RECOVERY: cd to the directory containing '${file}', run a plain install with no
564881
564881
 
564882
564882
  // packages/orchestrator/dist/agenticRunner.js
564883
564883
  import { existsSync as _fsExistsSync, readFileSync as _fsReadFileSync, writeFileSync as _fsWriteFileSync, appendFileSync as _fsAppendFileSync, unlinkSync as _fsUnlinkSync, mkdirSync as _fsMkdirSync } from "node:fs";
564884
- import { execFile as _execFile } from "node:child_process";
564884
+ import { execFile as _execFile, spawn as _spawn } from "node:child_process";
564885
564885
  import { createHash as _createHash } from "node:crypto";
564886
564886
  import { join as _pathJoin, resolve as _pathResolve } from "node:path";
564887
564887
  import { tmpdir as _osTmpdir } from "node:os";
@@ -565715,6 +565715,10 @@ var init_agenticRunner = __esm({
565715
565715
  // post-implementation reviewer.
565716
565716
  _fileWritesThisRun = 0;
565717
565717
  _backwardPassCyclesUsed = 0;
565718
+ // Completion compile/verify gate: count of times task_complete was blocked
565719
+ // because the configured verify command failed. Bounded by
565720
+ // OMNIUS_COMPLETION_VERIFY_MAX to avoid an endless verify→fix→verify loop.
565721
+ _completionVerifyRejections = 0;
565718
565722
  _lastBackwardPassVerdict = null;
565719
565723
  _lastBackwardPassCritique = null;
565720
565724
  // Run-local completion contract inferred from the user's ask/context before
@@ -566086,6 +566090,7 @@ ${parts.join("\n")}
566086
566090
  allowTurnExtension: options2?.allowTurnExtension ?? true,
566087
566091
  completionProvenanceGuard: options2?.completionProvenanceGuard ?? true,
566088
566092
  backwardPassReview: options2?.backwardPassReview,
566093
+ completionVerifyCommand: options2?.completionVerifyCommand,
566089
566094
  disableAdversaryCritic,
566090
566095
  disableStepCritic: disableAdversaryCritic,
566091
566096
  modelTier: options2?.modelTier ?? "large",
@@ -567351,7 +567356,114 @@ ${input.answerText ?? ""}`.toLowerCase().trim();
567351
567356
  * up auto-blocking and surfaces a status event so the caller can take
567352
567357
  * a different path (eg. surface to user). max cycles enforced here.
567353
567358
  */
567359
+ /**
567360
+ * Completion compile/verify gate (opt-in). Runs a configured shell command
567361
+ * (e.g. a typecheck/build) before `task_complete` is accepted, but ONLY when
567362
+ * the run actually modified code files. A non-zero exit blocks completion and
567363
+ * feeds the error output back so the model fixes it before retrying. Bounded
567364
+ * by OMNIUS_COMPLETION_VERIFY_MAX rejections so a persistently-failing build
567365
+ * does not trap the run forever (it completes with a caveat instead — the
567366
+ * same anti-collapse philosophy as the backward-pass cycle cap).
567367
+ *
567368
+ * Default OFF: unset command → `{ proceed: true }`, preserving the prior
567369
+ * "no deterministic verification gate" behaviour for every existing caller.
567370
+ */
567371
+ async _runCompletionVerifyGate(turn) {
567372
+ const cmd = this.options.completionVerifyCommand || process.env["OMNIUS_COMPLETION_VERIFY_CMD"] || "";
567373
+ if (!cmd.trim())
567374
+ return { proceed: true };
567375
+ const changed = [...this._taskState.modifiedFiles.keys()];
567376
+ const codeChanged = changed.some((p2) => /\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|kt|c|cc|cpp|h|hpp|swift|rb|php)$/i.test(p2));
567377
+ if (!codeChanged)
567378
+ return { proceed: true };
567379
+ const maxRejections = parseInt(process.env["OMNIUS_COMPLETION_VERIFY_MAX"] || "3", 10) || 3;
567380
+ if (this._completionVerifyRejections >= maxRejections) {
567381
+ this._completionCaveat = [
567382
+ `[COMPLETION CAVEAT] Verify command still failing after ${this._completionVerifyRejections} attempt(s): ${cmd}`,
567383
+ "Completing with unresolved build/verify errors — treat as a follow-up blocker."
567384
+ ].join("\n");
567385
+ this.emit({
567386
+ type: "status",
567387
+ content: `completion verify gate exhausted after ${this._completionVerifyRejections} attempts; completing with caveat`,
567388
+ turn,
567389
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
567390
+ });
567391
+ return { proceed: true };
567392
+ }
567393
+ const timeoutMs = parseInt(process.env["OMNIUS_COMPLETION_VERIFY_TIMEOUT_MS"] || "180000", 10) || 18e4;
567394
+ const wd = this._workingDirectory || process.cwd();
567395
+ this.emit({
567396
+ type: "status",
567397
+ content: `completion verify gate: running '${cmd}' (cwd=${wd})`,
567398
+ turn,
567399
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
567400
+ });
567401
+ const { exitCode, outTail } = await new Promise((resolve70) => {
567402
+ const chunks = [];
567403
+ let settled = false;
567404
+ const child = _spawn(cmd, {
567405
+ cwd: wd,
567406
+ shell: true,
567407
+ env: process.env,
567408
+ stdio: ["ignore", "pipe", "pipe"]
567409
+ });
567410
+ const onData = (d2) => {
567411
+ chunks.push(d2.toString());
567412
+ if (chunks.length > 400)
567413
+ chunks.splice(0, chunks.length - 400);
567414
+ };
567415
+ child.stdout?.on("data", onData);
567416
+ child.stderr?.on("data", onData);
567417
+ const killTimer = setTimeout(() => {
567418
+ try {
567419
+ child.kill("SIGKILL");
567420
+ } catch {
567421
+ }
567422
+ }, timeoutMs);
567423
+ killTimer.unref?.();
567424
+ const finish = (code8) => {
567425
+ if (settled)
567426
+ return;
567427
+ settled = true;
567428
+ clearTimeout(killTimer);
567429
+ resolve70({ exitCode: code8, outTail: chunks.join("").slice(-4e3) });
567430
+ };
567431
+ child.on("error", () => finish(1));
567432
+ child.on("close", (code8) => finish(code8 ?? 1));
567433
+ });
567434
+ if (exitCode === 0) {
567435
+ this.emit({
567436
+ type: "status",
567437
+ content: `completion verify gate PASSED ('${cmd}')`,
567438
+ turn,
567439
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
567440
+ });
567441
+ return { proceed: true };
567442
+ }
567443
+ this._completionVerifyRejections++;
567444
+ this.emit({
567445
+ type: "status",
567446
+ content: `completion verify gate FAILED (exit ${exitCode}); task_complete blocked (attempt ${this._completionVerifyRejections}/${maxRejections})`,
567447
+ turn,
567448
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
567449
+ });
567450
+ const feedback = [
567451
+ `[COMPLETION BLOCKED — verification failed] You modified code, but the verify command exited ${exitCode}:`,
567452
+ ` $ ${cmd}`,
567453
+ "",
567454
+ "You CANNOT call task_complete until this passes. Fix the errors below, then",
567455
+ "re-run the verify command yourself (via shell) to confirm before completing.",
567456
+ `(attempt ${this._completionVerifyRejections}/${maxRejections} — after that the run completes with a caveat)`,
567457
+ "",
567458
+ "--- verify output (tail) ---",
567459
+ outTail || "(no output captured)"
567460
+ ].join("\n");
567461
+ return { proceed: false, feedback };
567462
+ }
567354
567463
  async _runBackwardPassReview(turn, toolCallLog, proposedSummary = "") {
567464
+ const _verify = await this._runCompletionVerifyGate(turn);
567465
+ if (!_verify.proceed)
567466
+ return _verify;
567355
567467
  if (this._completionLedger && proposedSummary) {
567356
567468
  const _newClaims = deriveClaimsFromProposedText({
567357
567469
  text: proposedSummary,
@@ -570196,6 +570308,7 @@ Respond with your assessment, then take action.`;
570196
570308
  this._abortController = new AbortController();
570197
570309
  this._fileWritesThisRun = 0;
570198
570310
  this._backwardPassCyclesUsed = 0;
570311
+ this._completionVerifyRejections = 0;
570199
570312
  this._lastBackwardPassVerdict = null;
570200
570313
  this._lastBackwardPassCritique = null;
570201
570314
  this._completionContract = null;
@@ -609110,15 +609223,10 @@ ${CONTENT_BG_SEQ}`);
609110
609223
  copySessionToClipboard() {
609111
609224
  const lines = this._contentLines;
609112
609225
  if (!lines || lines.length === 0) return;
609113
- const offset = this._contentScrollOffset;
609114
- const visible = this.contentHeight;
609115
- const startIdx = Math.max(0, offset);
609116
- const endIdx = Math.min(lines.length, startIdx + visible);
609117
- const visibleLines = lines.slice(startIdx, endIdx);
609118
- const stripped = visibleLines.map(
609226
+ const stripped = lines.map(
609119
609227
  (line) => line.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "").replace(/\x1B\]?[^\x07]*\x07/g, "")
609120
609228
  );
609121
- const text2 = stripped.join("\n");
609229
+ const text2 = stripped.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd();
609122
609230
  if (text2.length === 0) return;
609123
609231
  const ok3 = copyText(text2);
609124
609232
  const pos = this.rowPositions(termRows());
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.271",
3
+ "version": "1.0.272",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.271",
9
+ "version": "1.0.272",
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.271",
3
+ "version": "1.0.272",
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",