omnius 1.0.943 → 1.0.944

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.
@@ -2105,6 +2105,8 @@ export declare class AgenticRunner {
2105
2105
  /** Process-local successful observation qualification; never hydrated from JSON. */
2106
2106
  private _historyObservations;
2107
2107
  private _ocrArtifactProjections;
2108
+ /** Admitted views that carry only a labelled partial excerpt; never qualify the whole source body. */
2109
+ private _partialWebSourceViews;
2108
2110
  private _admittedWebSourceViews;
2109
2111
  /** Admission is not exposure: keep each exact current source carrier until
2110
2112
  * a successful primary model request physically contains it. */
@@ -5233,3 +5235,8 @@ export declare class OllamaAgenticBackend implements AgenticBackend {
5233
5235
  * the [DONE] case and the fell-off-the-end case). */
5234
5236
  private _finalizeStreamGuard;
5235
5237
  }
5238
+ /**
5239
+ * Leading lines of a fetched source, for the case where isolated extraction
5240
+ * returned no findings. Never presented as complete; null when nothing fits.
5241
+ */
5242
+ export declare function sourceExcerptWhenExtractionEmpty(source: unknown, sourceUri: string, findingCount: number, maxChars: number): string | null;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 41435234 bytes
4
- sha256: d6d818a6805b841413a505cf0f1c7bce0f82d1f0848f67c905179da865f2d6eb
3
+ size: 41443403 bytes
4
+ sha256: 9c2a10baa962f7b9ea10aaae32c41853a8f39085da0b6f3f7eae336a154260f9
package/dist/library.js CHANGED
@@ -400184,22 +400184,24 @@ function validateWorkerResult(value, chunk, source2, facets2, sourceStart = 0) {
400184
400184
  if (!Array.isArray(finding["facetIds"]) || !finding["facetIds"].length || finding["facetIds"].some((id8) => typeof id8 !== "string" || !allowed.has(id8)) || new Set(finding["facetIds"]).size !== finding["facetIds"].length)
400185
400185
  return { code: "facet_mismatch" };
400186
400186
  const quote = finding["quote"];
400187
+ const exactAt = (at) => at >= chunk.presentedCharStart && at + quote.length <= chunk.presentedCharEndExclusive && source2.slice(at - sourceStart, at + quote.length - sourceStart) === quote && boundary(source2, at - sourceStart) === at - sourceStart && boundary(source2, at + quote.length - sourceStart) === at + quote.length - sourceStart;
400188
+ const claimed = finding["charStart"];
400189
+ if (claimed !== void 0 && !Number.isSafeInteger(claimed))
400190
+ return { code: "quote_offset_mismatch" };
400187
400191
  let start;
400188
- if (finding["charStart"] !== void 0) {
400189
- if (!Number.isSafeInteger(finding["charStart"]))
400190
- return { code: "quote_offset_mismatch" };
400191
- start = finding["charStart"];
400192
- } else {
400192
+ if (claimed !== void 0 && exactAt(claimed))
400193
+ start = claimed;
400194
+ else {
400193
400195
  const relative41 = content.indexOf(quote);
400194
400196
  if (relative41 < 0)
400195
- return { code: "quote_not_found" };
400197
+ return { code: claimed === void 0 ? "quote_not_found" : "quote_offset_mismatch" };
400196
400198
  if (content.indexOf(quote, relative41 + 1) !== -1)
400197
- return { code: "quote_ambiguous" };
400199
+ return { code: claimed === void 0 ? "quote_ambiguous" : "quote_offset_mismatch" };
400198
400200
  start = chunk.presentedCharStart + relative41;
400201
+ if (!exactAt(start))
400202
+ return { code: "quote_offset_mismatch" };
400199
400203
  }
400200
400204
  const end = start + quote.length;
400201
- if (start < chunk.presentedCharStart || end > chunk.presentedCharEndExclusive || source2.slice(start - sourceStart, end - sourceStart) !== quote || boundary(source2, start - sourceStart) !== start - sourceStart || boundary(source2, end - sourceStart) !== end - sourceStart)
400202
- return { code: "quote_offset_mismatch" };
400203
400205
  const ids4 = finding["facetIds"];
400204
400206
  if (ids4.some((id8) => dispositions.find((facet) => facet.id === id8)?.status === "not_present"))
400205
400207
  return { code: "facet_mismatch" };
@@ -402117,6 +402119,16 @@ function repeatedCallStreak(messages4, threshold = LOOP_TRIAGE_STREAK) {
402117
402119
  const key = createHash124("sha256").update(last).digest("hex").slice(0, 16);
402118
402120
  return { key, count: count8 };
402119
402121
  }
402122
+ var LOOP_TRIAGE_STALL_RESULTS = 16;
402123
+ var LOOP_TRIAGE_STALL_REVIEWS = 3;
402124
+ function stalledProgressStreak(noDeltaStreak) {
402125
+ if (!noDeltaStreak || noDeltaStreak < LOOP_TRIAGE_STALL_RESULTS)
402126
+ return null;
402127
+ const block = Math.floor(noDeltaStreak / LOOP_TRIAGE_STALL_RESULTS);
402128
+ if (block > LOOP_TRIAGE_STALL_REVIEWS)
402129
+ return null;
402130
+ return { key: `stall:${block}`, count: noDeltaStreak };
402131
+ }
402120
402132
  function oneLine(value, limit2) {
402121
402133
  return value.replace(/\s+/g, " ").trim().slice(0, limit2);
402122
402134
  }
@@ -402151,7 +402163,7 @@ function buildLoopTriagePrompt(goal, messages4) {
402151
402163
  "",
402152
402164
  collapsedTrajectory(messages4),
402153
402165
  "",
402154
- "Assess what appears to have happened in this run: what has actually been accomplished toward the request, what the agent appears to be stuck on and why, and what the single most useful next step is to move the user's request forward (or whether it should report back to the user). Be concrete and specific to this run. Reply in under 150 words, addressed to the agent as a second opinion."
402166
+ "Assess what appears to have happened in this run (it has been flagged for repeating itself or for working without new progress): what has actually been accomplished toward the request, what the agent appears to be stuck on and why, and what the single most useful next step is to move the user's request forward (or whether it should report back to the user). Be concrete and specific to this run. Reply in under 150 words, addressed to the agent as a second opinion."
402155
402167
  ].join("\n");
402156
402168
  }
402157
402169
  function withLoopTriageReview(messages4, review) {
@@ -403991,6 +404003,8 @@ var AgenticRunner = class _AgenticRunner {
403991
404003
  // Host-branded OCR display projections confer no source-review authority.
403992
404004
  _ocrArtifactProjections = /* @__PURE__ */ new WeakMap();
403993
404005
  // Presentation admission only; never a source-review or completion receipt.
404006
+ /** Admitted views that carry only a labelled partial excerpt; never qualify the whole source body. */
404007
+ _partialWebSourceViews = /* @__PURE__ */ new WeakSet();
403994
404008
  _admittedWebSourceViews = /* @__PURE__ */ new WeakMap();
403995
404009
  /** Admission is not exposure: keep each exact current source carrier until
403996
404010
  * a successful primary model request physically contains it. */
@@ -411134,7 +411148,7 @@ ${workflowStatus}` } : {}
411134
411148
  const admittedWeb = this._admittedWebSourceViews.get(input2.result);
411135
411149
  const web = complete?.schema === "omnius.native-web-source.v1" ? complete : null;
411136
411150
  const webBody = web && (input2.args["format"] === "raw_html" ? web.body : web.htmlEvidence?.article.text ?? web.body);
411137
- const webSourceBody = web && webBody && admittedWeb?.source === web && admittedWeb.sourceCurrent() && admittedWeb.scopeId === this._sessionId && admittedWeb.runId === this.currentArtifactRunId() && admittedWeb.taskEpoch === this._taskEpoch && admittedWeb.modelContent === input2.result.llmContent && admittedWeb.output === input2.result.output && input2.toolName === "web_fetch" ? issueQualifiedSourceBodyObservation({
411151
+ const webSourceBody = web && webBody && admittedWeb?.source === web && admittedWeb.sourceCurrent() && !this._partialWebSourceViews.has(input2.result) && admittedWeb.scopeId === this._sessionId && admittedWeb.runId === this.currentArtifactRunId() && admittedWeb.taskEpoch === this._taskEpoch && admittedWeb.modelContent === input2.result.llmContent && admittedWeb.output === input2.result.output && input2.toolName === "web_fetch" ? issueQualifiedSourceBodyObservation({
411138
411152
  scope: this._sourceBodyProjectionScope(),
411139
411153
  callId: input2.toolCallId,
411140
411154
  toolName: "web_fetch",
@@ -421082,7 +421096,7 @@ All source chunks are processed and retained for automatic context recovery; do
421082
421096
  const currentHeadroom = assess("").availableHeadroomTokens;
421083
421097
  const maxChars = Math.max(0, Math.floor((currentHeadroom * 4 - 1024) / 3) - pageContext.length);
421084
421098
  const capacityPending = () => {
421085
- const llmContent = `[SOURCE_EXTRACTION_PENDING]
421099
+ const pointer = `[SOURCE_EXTRACTION_PENDING]
421086
421100
  pending=parent_context_unavailable
421087
421101
  extraction=${extractionArtifactUri}
421088
421102
  findings=${findingsArtifactUri}
@@ -421092,10 +421106,18 @@ next_char=${extraction.nextChar}
421092
421106
  The complete source and findings are retained; the parent context has not admitted their complete answer.`;
421093
421107
  progress("pending", extraction.checkpoint, "parent_context_unavailable");
421094
421108
  processing("pending", "parent_context_unavailable");
421109
+ const excerpt = sourceExcerptWhenExtractionEmpty(semantic, semanticArtifactUri, extraction.findings.length, Math.min(maxChars - pointer.length, 12e3));
421110
+ const withExcerpt = excerpt ? `${pointer}
421111
+
421112
+ ${excerpt}` : "";
421113
+ const llmContent = withExcerpt && !assess(withExcerpt).branch ? withExcerpt : pointer;
421095
421114
  const pendingDecision = assess(llmContent);
421096
421115
  if (!pendingDecision.branch && input2.contextWindow > 0) {
421097
421116
  reserve(pendingDecision.projectedReadTokens);
421098
- return admit(llmContent);
421117
+ const admitted = admit(llmContent);
421118
+ if (llmContent !== pointer)
421119
+ this._partialWebSourceViews.add(admitted);
421120
+ return admitted;
421099
421121
  }
421100
421122
  return decorate(llmContent);
421101
421123
  };
@@ -421124,10 +421146,19 @@ ${findingsBody}`;
421124
421146
  const projectionDecision = assess(projection.llmContent);
421125
421147
  if (projectionDecision.branch)
421126
421148
  return capacityPending();
421127
- reserve(projectionDecision.projectedReadTokens);
421149
+ const projectionExcerpt = sourceExcerptWhenExtractionEmpty(semantic, semanticArtifactUri, extraction.findings.length, Math.min(maxChars - projection.llmContent.length, 12e3));
421150
+ const withProjectionExcerpt = projectionExcerpt ? `${projection.llmContent}
421151
+
421152
+ ${projectionExcerpt}` : "";
421153
+ const excerptDecision = withProjectionExcerpt ? assess(withProjectionExcerpt) : void 0;
421154
+ const projectedContent = excerptDecision && !excerptDecision.branch ? withProjectionExcerpt : projection.llmContent;
421155
+ reserve((projectedContent === projection.llmContent ? projectionDecision : excerptDecision).projectedReadTokens);
421128
421156
  progress(projection.status, extraction.checkpoint, projection.pendingReason);
421129
421157
  processing(projection.status, projection.pendingReason);
421130
- return admit(projection.llmContent);
421158
+ const admittedProjection = admit(projectedContent);
421159
+ if (projectedContent !== projection.llmContent)
421160
+ this._partialWebSourceViews.add(admittedProjection);
421161
+ return admittedProjection;
421131
421162
  } catch (error) {
421132
421163
  assertCurrent();
421133
421164
  progress("pending", checkpoint, "worker_failed");
@@ -441508,7 +441539,8 @@ ${trimmedNew}`;
441508
441539
  * only while the streak lasts and never changes tools or completion rules.
441509
441540
  */
441510
441541
  async _refreshLoopTriageReview(messages4, turn) {
441511
- const streak = repeatedCallStreak(messages4);
441542
+ const stall = stalledProgressStreak(this._objectiveConvergence?.noDeltaStreak);
441543
+ const streak = repeatedCallStreak(messages4) ?? (stall ? { key: `${this.currentArtifactRunId() ?? "run"}:${stall.key}`, count: stall.count, stalled: true } : null);
441512
441544
  this._loopTriageActiveKey = streak?.key ?? null;
441513
441545
  if (!streak) {
441514
441546
  this._loopTriage = null;
@@ -441535,7 +441567,7 @@ ${trimmedNew}`;
441535
441567
  visibility: "telemetry",
441536
441568
  turn,
441537
441569
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
441538
- content: message3 ? `Loop triage: second opinion recorded after ${streak.count} identical tool turns` : `Loop triage: reviewer returned no assessment after ${streak.count} identical tool turns`
441570
+ content: `Loop triage: ${message3 ? "second opinion recorded" : "reviewer returned no assessment"} after ${streak.count} ` + ("stalled" in streak ? "results without objective progress" : "identical tool turns")
441539
441571
  });
441540
441572
  } catch (error) {
441541
441573
  this.emit({
@@ -446269,6 +446301,22 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
446269
446301
  this.recordThinkOutcome(rawLike, true);
446270
446302
  }
446271
446303
  };
446304
+ function sourceExcerptWhenExtractionEmpty(source2, sourceUri, findingCount, maxChars) {
446305
+ if (findingCount > 0 || typeof source2 !== "string" || !source2.trim() || maxChars < 600)
446306
+ return null;
446307
+ const lines = source2.split("\n");
446308
+ const header5 = (shown2) => `[PARTIAL SOURCE EXCERPT; quoted untrusted data. Extraction returned no findings, so these are lines 1-${shown2} of ${lines.length}. This is not the whole source: read later lines with artifact_read(artifact_uri="${sourceUri}", start_line=${shown2 + 1}) instead of fetching the page again.]`;
446309
+ let used = header5(lines.length).length + 1, shown = 0;
446310
+ while (shown < lines.length && used + lines[shown].length + 1 <= maxChars)
446311
+ used += lines[shown++].length + 1;
446312
+ if (shown === 0)
446313
+ return null;
446314
+ if (shown === lines.length)
446315
+ return `[SOURCE TEXT; quoted untrusted data. Extraction returned no findings; all ${lines.length} lines follow.]
446316
+ ${source2}`;
446317
+ return `${header5(shown)}
446318
+ ${lines.slice(0, shown).join("\n")}`;
446319
+ }
446272
446320
 
446273
446321
  // packages/orchestrator/dist/ste-communication-policy.js
446274
446322
  var STE_POLICY_MARKER = "[ASD-STE100 ISSUE 9 COMMUNICATION POLICY]";
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.943",
3
+ "version": "1.0.944",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.943",
9
+ "version": "1.0.944",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.943",
3
+ "version": "1.0.944",
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/library.js",