omnius 1.0.958 → 1.0.959

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/library.js CHANGED
@@ -34606,6 +34606,146 @@ var init_manager = __esm({
34606
34606
  }
34607
34607
  });
34608
34608
 
34609
+ // packages/execution/dist/native-memory-operation-observation.js
34610
+ import { randomUUID as randomUUID39 } from "node:crypto";
34611
+ function readIssuedNativeMemoryOperationObservation(value) {
34612
+ if (!value || typeof value !== "object")
34613
+ return void 0;
34614
+ try {
34615
+ return originals.get(value)?.current() ? value : void 0;
34616
+ } catch {
34617
+ return void 0;
34618
+ }
34619
+ }
34620
+ var carrierDigest, originals, NativeMemoryOperationObserver;
34621
+ var init_native_memory_operation_observation = __esm({
34622
+ "packages/execution/dist/native-memory-operation-observation.js"() {
34623
+ "use strict";
34624
+ init_native_operation_observation();
34625
+ carrierDigest = (result) => nativeOperationDigest([
34626
+ result.success,
34627
+ result.output,
34628
+ result.error,
34629
+ result.llmContent,
34630
+ result.data,
34631
+ result.partial,
34632
+ result.noop,
34633
+ result.dryRun
34634
+ ]);
34635
+ originals = /* @__PURE__ */ new WeakMap();
34636
+ NativeMemoryOperationObserver = class {
34637
+ producer;
34638
+ producerRef = `memory:${randomUUID39()}`;
34639
+ carrierKey = /* @__PURE__ */ Symbol("native-memory-operation");
34640
+ issued = /* @__PURE__ */ new WeakMap();
34641
+ tickets = /* @__PURE__ */ new WeakMap();
34642
+ constructor(producer) {
34643
+ this.producer = producer;
34644
+ }
34645
+ begin(args, context) {
34646
+ if (args.action !== void 0 && args.action !== "search" || args.source_ref !== void 0 || args.sources !== void 0)
34647
+ return;
34648
+ try {
34649
+ const invocation = context?.nativeOperationInvocation;
34650
+ if (!invocation || invocation.toolName !== this.producer.toolName || !invocation.toolCallId || !invocation.workspaceRoot || !invocation.sessionId || !invocation.runId || !invocation.ownerId || !Number.isSafeInteger(invocation.taskEpoch) || invocation.taskEpoch < 1 || !Number.isSafeInteger(invocation.ownerGeneration) || invocation.ownerGeneration < 1)
34651
+ return;
34652
+ invocation.assertCurrent();
34653
+ invocation.signal?.throwIfAborted();
34654
+ context?.assertCurrent?.();
34655
+ context?.signal?.throwIfAborted();
34656
+ const ticket = Object.freeze({});
34657
+ this.tickets.set(ticket, {
34658
+ invocation,
34659
+ argumentsSha256: nativeOperationDigest(args),
34660
+ toolSchemaSha256: nativeOperationDigest([this.producer.toolName, this.producer.readParameters()])
34661
+ });
34662
+ return ticket;
34663
+ } catch {
34664
+ return void 0;
34665
+ }
34666
+ }
34667
+ observe(ticket, args, result, context) {
34668
+ try {
34669
+ const started = ticket && this.tickets.get(ticket);
34670
+ if (ticket)
34671
+ this.tickets.delete(ticket);
34672
+ if (!started || started.invocation !== context?.nativeOperationInvocation || started.argumentsSha256 !== nativeOperationDigest(args) || started.toolSchemaSha256 !== nativeOperationDigest([this.producer.toolName, this.producer.readParameters()]))
34673
+ return;
34674
+ const { invocation, toolSchemaSha256, argumentsSha256 } = started;
34675
+ invocation.assertCurrent();
34676
+ invocation.signal?.throwIfAborted();
34677
+ context?.assertCurrent?.();
34678
+ context?.signal?.throwIfAborted();
34679
+ const original = this.producer.readIssuedResult(result.data);
34680
+ if (!original)
34681
+ return;
34682
+ const nativeResultSha256 = nativeOperationDigest(original), identity10 = carrierDigest(result);
34683
+ const namespaces = {}, kinds4 = {};
34684
+ for (const match2 of original.matches)
34685
+ namespaces[match2.source.namespace] = (namespaces[match2.source.namespace] ?? 0) + 1;
34686
+ for (const source2 of original.sourceAccess ?? []) {
34687
+ const kind2 = source2.sourceKind ?? "unclassified";
34688
+ kinds4[kind2] = (kinds4[kind2] ?? 0) + 1;
34689
+ }
34690
+ const sourceManifest = original.matches.map((match2) => [
34691
+ match2.source.namespace,
34692
+ match2.source.storeRef,
34693
+ match2.source.scopeRef,
34694
+ match2.source.occurrenceId,
34695
+ match2.source.version,
34696
+ match2.source.contentSha256,
34697
+ match2.source.coverage,
34698
+ match2.source.spans
34699
+ ]).sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)));
34700
+ const memoryRead = Object.freeze({
34701
+ status: original.status,
34702
+ outcome: original.outcome,
34703
+ ...original.reasonCode ? { reasonCode: original.reasonCode } : {},
34704
+ returnedMatchCount: original.matches.length,
34705
+ executedRoutes: Object.freeze([...original.executedRoutes]),
34706
+ sourceNamespaceCounts: Object.freeze(namespaces),
34707
+ declaredSourceKindCounts: Object.freeze(kinds4),
34708
+ sourceManifestSha256: nativeOperationDigest(sourceManifest),
34709
+ authoringProof: "none_from_read"
34710
+ });
34711
+ const { assertCurrent: _guard, signal: _signal, ...scope2 } = invocation;
34712
+ const observation = Object.freeze({
34713
+ schema: "omnius.native-operation-observation.v1",
34714
+ scope: Object.freeze(scope2),
34715
+ producerRef: this.producerRef,
34716
+ toolSchemaSha256,
34717
+ argumentsSha256,
34718
+ nativeResultSha256,
34719
+ coverage: "complete",
34720
+ returnedStatus: result.success ? "success" : "error",
34721
+ observedAt: (/* @__PURE__ */ new Date()).toISOString(),
34722
+ memoryRead
34723
+ });
34724
+ invocation.assertCurrent();
34725
+ invocation.signal?.throwIfAborted();
34726
+ context?.assertCurrent?.();
34727
+ context?.signal?.throwIfAborted();
34728
+ originals.set(observation, { current: () => this.producer.readIssuedResult(result.data) === original && nativeOperationDigest(original) === nativeResultSha256 && carrierDigest(result) === identity10 && nativeOperationDigest([this.producer.toolName, this.producer.readParameters()]) === toolSchemaSha256 });
34729
+ const record11 = { observation, identity: identity10 }, carrier = Object.freeze({});
34730
+ this.issued.set(result, record11);
34731
+ this.issued.set(carrier, record11);
34732
+ Object.defineProperty(result, this.carrierKey, { value: carrier, enumerable: true });
34733
+ } catch {
34734
+ }
34735
+ }
34736
+ read(args, result) {
34737
+ const carrier = result[this.carrierKey];
34738
+ const record11 = this.issued.get(result) ?? (carrier && this.issued.get(carrier));
34739
+ try {
34740
+ return record11 && record11.identity === carrierDigest(result) && record11.observation.argumentsSha256 === nativeOperationDigest(args) ? readIssuedNativeMemoryOperationObservation(record11.observation) : void 0;
34741
+ } catch {
34742
+ return void 0;
34743
+ }
34744
+ }
34745
+ };
34746
+ }
34747
+ });
34748
+
34609
34749
  // packages/execution/dist/native-operation-observation.js
34610
34750
  import { createHash as createHash42 } from "node:crypto";
34611
34751
  function nativeOperationDigest(value) {
@@ -34614,12 +34754,13 @@ function nativeOperationDigest(value) {
34614
34754
  return createHash42("sha256").update(JSON.stringify(canonical10(plain))).digest("hex");
34615
34755
  }
34616
34756
  function readIssuedNativeOperationObservation(value) {
34617
- return readIssuedMcpOperationObservation(value);
34757
+ return readIssuedMcpOperationObservation(value) ?? readIssuedNativeMemoryOperationObservation(value);
34618
34758
  }
34619
34759
  var init_native_operation_observation = __esm({
34620
34760
  "packages/execution/dist/native-operation-observation.js"() {
34621
34761
  "use strict";
34622
34762
  init_manager();
34763
+ init_native_memory_operation_observation();
34623
34764
  }
34624
34765
  });
34625
34766
 
@@ -39155,7 +39296,7 @@ var init_web_source = __esm({
39155
39296
  });
39156
39297
 
39157
39298
  // packages/execution/dist/streamed-web-source.js
39158
- import { createHash as createHash43, randomUUID as randomUUID39 } from "node:crypto";
39299
+ import { createHash as createHash43, randomUUID as randomUUID40 } from "node:crypto";
39159
39300
  import { constants as constants6 } from "node:fs";
39160
39301
  import { chmod, mkdir as mkdir4, mkdtemp as mkdtemp6, open as open5, rename as rename2, rm as rm4, stat } from "node:fs/promises";
39161
39302
  function check(signal) {
@@ -39316,7 +39457,7 @@ var init_web_fetch = __esm({
39316
39457
  });
39317
39458
 
39318
39459
  // packages/execution/dist/page-content-source.js
39319
- import { createHash as createHash44, randomUUID as randomUUID40 } from "node:crypto";
39460
+ import { createHash as createHash44, randomUUID as randomUUID41 } from "node:crypto";
39320
39461
  function canonicalJson(value, ancestors = /* @__PURE__ */ new Set()) {
39321
39462
  if (value === null || typeof value === "string" || typeof value === "boolean")
39322
39463
  return JSON.stringify(value);
@@ -39361,7 +39502,7 @@ function issueNativePageContentSource(input2) {
39361
39502
  urlKind: input2.urlKind,
39362
39503
  ...input2.sessionId !== void 0 ? { sessionId: input2.sessionId } : {},
39363
39504
  ...input2.selector !== void 0 ? { selector: input2.selector } : {},
39364
- captureId: randomUUID40(),
39505
+ captureId: randomUUID41(),
39365
39506
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
39366
39507
  invocationSha256: pageContentSourceInvocationSha256(input2.producerTool, input2.args),
39367
39508
  ...input2.observedUrls !== void 0 ? { observedUrls: Object.freeze([...input2.observedUrls]) } : {},
@@ -84761,7 +84902,7 @@ var init_dom_summary = __esm({
84761
84902
  });
84762
84903
 
84763
84904
  // packages/execution/dist/tools/playwright-download.js
84764
- import { createHash as createHash46, randomUUID as randomUUID41 } from "node:crypto";
84905
+ import { createHash as createHash46, randomUUID as randomUUID42 } from "node:crypto";
84765
84906
  import { createReadStream, createWriteStream } from "node:fs";
84766
84907
  import { link as link2, mkdir as mkdir5, rm as rm5, stat as stat2 } from "node:fs/promises";
84767
84908
  import { basename as basename6, dirname as dirname12, join as join24, resolve as resolve13 } from "node:path";
@@ -84793,8 +84934,8 @@ async function persistBrowserDownload(source2, input2) {
84793
84934
  });
84794
84935
  }, input2.timeoutMs);
84795
84936
  const workingDir = input2.workingDir ?? process.cwd();
84796
- const destination = input2.outputPath ? resolve13(workingDir, input2.outputPath) : resolve13(workingDir, ".omnius", "browser-downloads", input2.sessionId, `${randomUUID41()}-${safeBrowserDownloadFilename(input2.suggestedFilename)}`);
84797
- const temporary = join24(dirname12(destination), `.download-${randomUUID41()}.part`);
84937
+ const destination = input2.outputPath ? resolve13(workingDir, input2.outputPath) : resolve13(workingDir, ".omnius", "browser-downloads", input2.sessionId, `${randomUUID42()}-${safeBrowserDownloadFilename(input2.suggestedFilename)}`);
84938
+ const temporary = join24(dirname12(destination), `.download-${randomUUID42()}.part`);
84798
84939
  let published = false;
84799
84940
  let success = false;
84800
84941
  let receipt;
@@ -86045,7 +86186,7 @@ var init_vision = __esm({
86045
86186
 
86046
86187
  // packages/execution/dist/tools/playwright-browser.js
86047
86188
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
86048
- import { randomUUID as randomUUID42 } from "node:crypto";
86189
+ import { randomUUID as randomUUID43 } from "node:crypto";
86049
86190
  import { isDeepStrictEqual as isDeepStrictEqual5 } from "node:util";
86050
86191
  import { execFileSync } from "node:child_process";
86051
86192
  import { existsSync as existsSync19, mkdirSync as mkdirSync16, readFileSync as readFileSync16, writeFileSync as writeFileSync14 } from "node:fs";
@@ -87989,7 +88130,7 @@ var init_playwright_browser = __esm({
87989
88130
  },
87990
88131
  saveDownload: (element, signal) => browserSessionScope.run(this.session, async () => {
87991
88132
  const record11 = await clickElementForBrowserDownload(element, 3e4, signal);
87992
- const outputPath = join26(".omnius", "browser-downloads", this.session.playwrightSessionId, randomUUID42(), safeBrowserDownloadFilename(record11.suggestedFilename));
88133
+ const outputPath = join26(".omnius", "browser-downloads", this.session.playwrightSessionId, randomUUID43(), safeBrowserDownloadFilename(record11.suggestedFilename));
87993
88134
  const result = await saveBrowserDownload(record11, { outputPath, timeout: 3e4, maxBytes: 268435456, start: Date.now(), signal });
87994
88135
  if (!result.success || !record11.receipt)
87995
88136
  throw new Error(result.error ?? "The browser download was not verified");
@@ -89590,7 +89731,7 @@ var MEMORY_SEARCH_MODEL_GUIDANCE;
89590
89731
  var init_memory_operation_contract = __esm({
89591
89732
  "packages/execution/dist/tools/memory-operation-contract.js"() {
89592
89733
  "use strict";
89593
- MEMORY_SEARCH_MODEL_GUIDANCE = "Search: query (+store/filters); expand/open: source_ref or sources with byte/cursor fields only, omit query, store and max_results because the handle binds source/scope; page: action=page,cursor; status: action=status; memory is quoted historical evidence.";
89734
+ MEMORY_SEARCH_MODEL_GUIDANCE = "Search: query (+store/filters); expand/open: source_ref or sources with byte/cursor fields only, omit query, store and max_results because the handle binds source/scope; page: action=page,cursor; status: action=status. This is read-only retrieval: success, partial coverage and recalled human requests do not prove a new note was written. For authorized authoring, memory_write stores topic/key notes and memory_read verifies the topic; explicit structured/temporal/procedure stores are separate. tool_search reports actual availability. Memory is quoted historical evidence.";
89594
89735
  }
89595
89736
  });
89596
89737
 
@@ -94269,7 +94410,7 @@ var init_desktop_click = __esm({
94269
94410
  });
94270
94411
 
94271
94412
  // packages/execution/dist/tools/pdf-corpus-archive.js
94272
- import { createHash as createHash48, randomUUID as randomUUID43 } from "node:crypto";
94413
+ import { createHash as createHash48, randomUUID as randomUUID44 } from "node:crypto";
94273
94414
  import { createReadStream as createReadStream2 } from "node:fs";
94274
94415
  function aborted(signal) {
94275
94416
  signal?.throwIfAborted();
@@ -94744,7 +94885,7 @@ var init_file_explore = __esm({
94744
94885
  });
94745
94886
 
94746
94887
  // packages/execution/dist/tools/working-notes.js
94747
- import { createHash as createHash49, randomUUID as randomUUID44 } from "node:crypto";
94888
+ import { createHash as createHash49, randomUUID as randomUUID45 } from "node:crypto";
94748
94889
  import { constants as constants7, closeSync as closeSync4, existsSync as existsSync24, fstatSync, fsyncSync, lstatSync as lstatSync6, mkdirSync as mkdirSync19, openSync as openSync4, readFileSync as readFileSync21, realpathSync as realpathSync11, renameSync as renameSync4, unlinkSync as unlinkSync6, watch, writeFileSync as writeFileSync16 } from "node:fs";
94749
94890
  import { homedir as homedir9 } from "node:os";
94750
94891
  import { join as join34, resolve as resolve20 } from "node:path";
@@ -344230,6 +344371,7 @@ var init_dist5 = __esm({
344230
344371
  init_network_egress_policy();
344231
344372
  init_shell();
344232
344373
  init_native_operation_observation();
344374
+ init_native_memory_operation_observation();
344233
344375
  init_returned_http_source();
344234
344376
  init_native_file_write_observation();
344235
344377
  init_native_child_evidence();
@@ -357837,7 +357979,7 @@ var BrokeredToolComposition = class {
357837
357979
  this.auditState.invocations.push(row3);
357838
357980
  while (this.auditState.invocations.length > 16)
357839
357981
  this.auditState.invocations.shift();
357840
- const originals = [];
357982
+ const originals2 = [];
357841
357983
  const slotQueue = [];
357842
357984
  let active = 0, serialActive = false;
357843
357985
  const assertCurrent = () => {
@@ -357916,7 +358058,7 @@ var BrokeredToolComposition = class {
357916
358058
  },
357917
358059
  reserve,
357918
358060
  observed: (actual) => {
357919
- originals.push(actual);
358061
+ originals2.push(actual);
357920
358062
  Object.assign(child, {
357921
358063
  success: actual.result.success,
357922
358064
  effectState: actual.result.externalEffectReceipt?.effectState
@@ -357925,7 +358067,7 @@ var BrokeredToolComposition = class {
357925
358067
  });
357926
358068
  signal.throwIfAborted();
357927
358069
  assertCurrent();
357928
- const source2 = originals.find((actual) => actual.nativeCallId === nativeCallId)?.source;
358070
+ const source2 = originals2.find((actual) => actual.nativeCallId === nativeCallId)?.source;
357929
358071
  if (source2) {
357930
358072
  try {
357931
358073
  const descriptor2 = this.issuer.issueCapability({
@@ -357974,7 +358116,7 @@ var BrokeredToolComposition = class {
357974
358116
  if (child.delivery === "pending")
357975
358117
  child.delivery = "suppressed_or_unavailable";
357976
358118
  assertCurrent();
357977
- const observed = originals.filter((child) => child.source);
358119
+ const observed = originals2.filter((child) => child.source);
357978
358120
  const sourceIssues = /* @__PURE__ */ new Set();
357979
358121
  let memoryView = "", aggregate;
357980
358122
  if (observed.length) {
@@ -358042,7 +358184,7 @@ var BrokeredToolComposition = class {
358042
358184
  });
358043
358185
  }
358044
358186
  }
358045
- const nativeRows = originals.filter((child) => !child.source || sourceIssues.has(child.nativeCallId)).map((child) => {
358187
+ const nativeRows = originals2.filter((child) => !child.source || sourceIssues.has(child.nativeCallId)).map((child) => {
358046
358188
  const receipt = row3.children.find((entry) => entry.nativeCallId === child.nativeCallId);
358047
358189
  return {
358048
358190
  child: "child-" + receipt.ordinal,
@@ -358103,7 +358245,7 @@ var BrokeredToolComposition = class {
358103
358245
  invocationRef: sha3(row3.id),
358104
358246
  guestAuthority: "derived_data_only",
358105
358247
  status: worker.status,
358106
- nativeChildren: Object.freeze(originals.map((child) => Object.freeze({
358248
+ nativeChildren: Object.freeze(originals2.map((child) => Object.freeze({
358107
358249
  nativeCallId: child.nativeCallId,
358108
358250
  name: child.name,
358109
358251
  success: child.result.success,
@@ -364456,7 +364598,7 @@ function withManagedLocalAdmissionBudget(backend, request, sessionTimeoutMs) {
364456
364598
  }
364457
364599
 
364458
364600
  // packages/orchestrator/dist/owned-retained-completion.js
364459
- import { randomUUID as randomUUID45 } from "node:crypto";
364601
+ import { randomUUID as randomUUID46 } from "node:crypto";
364460
364602
  var OwnedRetainedAdmissionError = class extends Error {
364461
364603
  reason;
364462
364604
  logicalRequestId;
@@ -364504,7 +364646,7 @@ async function completeOwnedRetainedCompletion(backend, request, control2) {
364504
364646
  control2.assertCurrent?.();
364505
364647
  };
364506
364648
  assertCurrent();
364507
- request.logicalRequestId ??= randomUUID45();
364649
+ request.logicalRequestId ??= randomUUID46();
364508
364650
  if (signal)
364509
364651
  request.signal = signal;
364510
364652
  request.assertCurrentAtDispatch = assertCurrent;
@@ -364945,7 +365087,7 @@ function projectSemanticVerificationCriterionState(input2) {
364945
365087
  }
364946
365088
 
364947
365089
  // packages/orchestrator/dist/taskSemanticAdmission.js
364948
- import { createHash as createHash67, randomUUID as randomUUID47 } from "node:crypto";
365090
+ import { createHash as createHash67, randomUUID as randomUUID48 } from "node:crypto";
364949
365091
  import { closeSync as closeSync9, existsSync as existsSync31, fsyncSync as fsyncSync4, linkSync, openSync as openSync9, readFileSync as readFileSync30, realpathSync as realpathSync14, renameSync as renameSync9, statSync as statSync13, unlinkSync as unlinkSync12, writeFileSync as writeFileSync22 } from "node:fs";
364950
365092
  import { basename as basename16, dirname as dirname24, isAbsolute as isAbsolute16, join as join48, relative as relative14 } from "node:path";
364951
365093
 
@@ -366176,7 +366318,7 @@ function resumeNeedsInputContractV1(input2) {
366176
366318
 
366177
366319
  // packages/orchestrator/dist/durable-file-guard.js
366178
366320
  import { closeSync as closeSync8, existsSync as existsSync30, fstatSync as fstatSync4, lstatSync as lstatSync8, openSync as openSync8, readFileSync as readFileSync29, unlinkSync as unlinkSync11, writeFileSync as writeFileSync21 } from "node:fs";
366179
- import { randomUUID as randomUUID46 } from "node:crypto";
366321
+ import { randomUUID as randomUUID47 } from "node:crypto";
366180
366322
  function birth(pid) {
366181
366323
  if (process.platform !== "linux")
366182
366324
  return void 0;
@@ -366232,7 +366374,7 @@ function acquireDurableFileGuard(path13) {
366232
366374
  }
366233
366375
  const owner2 = {
366234
366376
  pid: process.pid,
366235
- nonce: randomUUID46(),
366377
+ nonce: randomUUID47(),
366236
366378
  birth: birth(process.pid)
366237
366379
  };
366238
366380
  try {
@@ -366301,7 +366443,7 @@ function renewContinuationClaimOwner(record11) {
366301
366443
  if (mine(claim))
366302
366444
  return;
366303
366445
  const release = acquireDurableFileGuard(`${path13}.owner.lock`);
366304
- const temporary = `${path13}.${process.pid}.${randomUUID47()}.owner.tmp`;
366446
+ const temporary = `${path13}.${process.pid}.${randomUUID48()}.owner.tmp`;
366305
366447
  try {
366306
366448
  assertContinuationClaim(record11);
366307
366449
  claim = JSON.parse(readFileSync30(path13, "utf8"));
@@ -366505,7 +366647,7 @@ function startTaskSemanticContinuationInference(record11, options) {
366505
366647
  const recipient = JSON.parse(readFileSync30(recipientPath, "utf8"));
366506
366648
  if (recipient.runId !== record11.recipientRunId || taskExecutionDigest(recipient.semanticContinuation) !== taskExecutionDigest(record11))
366507
366649
  throw new Error("Semantic continuation requires a durable exact recipient before transport");
366508
- const path13 = continuationClaimPath(record11), temporary = `${path13}.${process.pid}.${randomUUID47()}.tmp`;
366650
+ const path13 = continuationClaimPath(record11), temporary = `${path13}.${process.pid}.${randomUUID48()}.tmp`;
366509
366651
  if (existsSync31(path13)) {
366510
366652
  assertContinuationClaim(record11);
366511
366653
  renewContinuationClaimOwner(record11);
@@ -366572,7 +366714,7 @@ import { readFileSync as readFileSync33, realpathSync as realpathSync15, statSyn
366572
366714
  import { basename as basename17, dirname as dirname27, isAbsolute as isAbsolute17, relative as relative15 } from "node:path";
366573
366715
 
366574
366716
  // packages/orchestrator/dist/completionLedger.js
366575
- import { createHash as createHash70, randomUUID as randomUUID49 } from "node:crypto";
366717
+ import { createHash as createHash70, randomUUID as randomUUID50 } from "node:crypto";
366576
366718
  import { closeSync as closeSync11, fsyncSync as fsyncSync6, mkdirSync as mkdirSync26, openSync as openSync11, readFileSync as readFileSync32, renameSync as renameSync11, writeFileSync as writeFileSync24 } from "node:fs";
366577
366719
  import { dirname as dirname26 } from "node:path";
366578
366720
 
@@ -366580,7 +366722,7 @@ import { dirname as dirname26 } from "node:path";
366580
366722
  import { createHash as createHash69 } from "node:crypto";
366581
366723
 
366582
366724
  // packages/orchestrator/dist/reviewedInterpretation.js
366583
- import { createHash as createHash68, randomUUID as randomUUID48 } from "node:crypto";
366725
+ import { createHash as createHash68, randomUUID as randomUUID49 } from "node:crypto";
366584
366726
  import { closeSync as closeSync10, existsSync as existsSync32, fsyncSync as fsyncSync5, mkdirSync as mkdirSync25, openSync as openSync10, readFileSync as readFileSync31, renameSync as renameSync10, unlinkSync as unlinkSync13, writeFileSync as writeFileSync23 } from "node:fs";
366585
366727
  import { dirname as dirname25 } from "node:path";
366586
366728
  var sha11 = (s) => createHash68("sha256").update(s).digest("hex");
@@ -366731,7 +366873,7 @@ function commitReviewedObjectiveInterpretationRevisionV1(input2) {
366731
366873
  const fd = openSync10(lock, "wx", 384);
366732
366874
  let prepared;
366733
366875
  try {
366734
- writeFileSync23(fd, JSON.stringify({ pid: process.pid, nonce: randomUUID48(), ledgerPath: input2.ledgerPath }));
366876
+ writeFileSync23(fd, JSON.stringify({ pid: process.pid, nonce: randomUUID49(), ledgerPath: input2.ledgerPath }));
366735
366877
  fsyncSync5(fd);
366736
366878
  const raw = readFileSync31(input2.ledgerPath, "utf8");
366737
366879
  if (sha11(raw) !== input2.expectedLedgerSha256)
@@ -366764,7 +366906,7 @@ function commitReviewedObjectiveInterpretationRevisionV1(input2) {
366764
366906
  }
366765
366907
  }
366766
366908
  function writeAtomic(path13, raw) {
366767
- const temp = `${path13}.${randomUUID48()}.tmp`;
366909
+ const temp = `${path13}.${randomUUID49()}.tmp`;
366768
366910
  const fd = openSync10(temp, "wx", 384);
366769
366911
  try {
366770
366912
  writeFileSync23(fd, raw);
@@ -368150,7 +368292,7 @@ function finalizeCompletionLedgerTruth(ledger) {
368150
368292
  }
368151
368293
  function saveCompletionLedger(filePath, ledger) {
368152
368294
  mkdirSync26(dirname26(filePath), { recursive: true });
368153
- const temporary = `${filePath}.${process.pid}.${randomUUID49()}.tmp`;
368295
+ const temporary = `${filePath}.${process.pid}.${randomUUID50()}.tmp`;
368154
368296
  const fd = openSync11(temporary, "wx", 384);
368155
368297
  try {
368156
368298
  writeFileSync24(fd, `${JSON.stringify({ ...ledger, schema: COMPLETION_LEDGER_SCHEMA }, null, 2)}
@@ -368375,7 +368517,7 @@ function resumeCompletionObjectiveFromFile(input2) {
368375
368517
  evidenceId: continuationEvidenceId,
368376
368518
  committedAtIso: nowIso4()
368377
368519
  };
368378
- const temporary = `${receiptPath}.${process.pid}.${randomUUID49()}.tmp`;
368520
+ const temporary = `${receiptPath}.${process.pid}.${randomUUID50()}.tmp`;
368379
368521
  writeFileSync24(temporary, `${JSON.stringify(receipt, null, 2)}
368380
368522
  `, {
368381
368523
  encoding: "utf8",
@@ -370072,7 +370214,7 @@ async function extractStructuredMemoriesWithInference(input2) {
370072
370214
 
370073
370215
  // packages/orchestrator/dist/structured-memory-extraction-worker.js
370074
370216
  init_dist2();
370075
- import { createHash as createHash76, randomUUID as randomUUID50 } from "node:crypto";
370217
+ import { createHash as createHash76, randomUUID as randomUUID51 } from "node:crypto";
370076
370218
  import { lstatSync as lstatSync9, readFileSync as readFileSync35, realpathSync as realpathSync16 } from "node:fs";
370077
370219
  import { isAbsolute as isAbsolute18, resolve as resolve28 } from "node:path";
370078
370220
 
@@ -370447,7 +370589,7 @@ var StructuredMemoryExtractionQueue = class {
370447
370589
  validateContext(options);
370448
370590
  const owner2 = structuredClone(options.owner), profile3 = structuredClone(options.profile);
370449
370591
  const coordinator = options.inferencePressureCoordinator ?? getInferencePressureCoordinator();
370450
- const workerId = randomUUID50();
370592
+ const workerId = randomUUID51();
370451
370593
  let active;
370452
370594
  const run = async (signal) => {
370453
370595
  const result = { claimed: 0, completed: 0, pending: 0, rejected: 0 };
@@ -372548,20 +372690,20 @@ function createNativeMemoryViews(host2) {
372548
372690
  if (scoped.sessionId !== binding.sessionId && scoped.declaredScopeId !== binding.workspaceRef && scoped.declaredScopeId !== root2)
372549
372691
  continue;
372550
372692
  seen.add(String(edge.id));
372551
- const originals = [];
372693
+ const originals2 = [];
372552
372694
  for (const sourceId2 of edge.source.sourceIds) {
372553
372695
  const source2 = episodes.readGraphSource(sourceId2);
372554
372696
  if (!source2 || !isDeepStrictEqual6(source2.source.scope, edge.source.scope) || source2.source.sourceVersions.some((version2) => !edge.source.sourceVersions.some((expected) => expected.sourceId === version2.sourceId && expected.version === version2.version)) || !graph.inspectSource(source2.source).eligible)
372555
372697
  throw new Error("source_scope_unavailable");
372556
372698
  if (source2.source.sourceKind === "observation")
372557
- originals.push(source2);
372699
+ originals2.push(source2);
372558
372700
  }
372559
372701
  const text20 = JSON.stringify({ schema: "omnius.native-temporal-view.v1", validAt: request.validAt, knownAt: request.recordedAsOf, sourceAccess: "current_authorization_required", interpretationTruth: "not_established", edge: { edgeRef: sha17(JSON.stringify([binding.workspaceRef, "temporal", edge.id])), relation: edge.relation, fact: edge.fact, validFrom: edge.validFrom, validUntil: edge.validUntil, recordedAt: edge.recordedAt, recordedUntil: edge.recordedUntil }, rootSourceIds: edge.source.rootSourceIds, distinctOriginalSourceCount: edge.source.rootSourceIds.length });
372560
372702
  if (!graph.inspectSource(edge.source).eligible)
372561
372703
  throw new Error("source_scope_unavailable");
372562
372704
  const parentIds = [];
372563
372705
  let missingParent = false;
372564
- for (const original of originals) {
372706
+ for (const original of originals2) {
372565
372707
  const parent = add(binding.workspaceRef, `original:${original.source.sourceId}`, original.episode.content, "observation", original.source.version, "original_episode_observation");
372566
372708
  if (parent)
372567
372709
  parentIds.push(parent);
@@ -372875,13 +373017,27 @@ import { createHash as createHash82 } from "node:crypto";
372875
373017
  var APPEND_ONLY_FRAME_UPDATE_MARKER = "[ACTIVE TASK FRAME UPDATE v1]";
372876
373018
  var APPEND_ONLY_OBSERVATION_SNAPSHOT_MARKER = "[HOST OBSERVATION SNAPSHOT v1]";
372877
373019
  var APPEND_ONLY_HOST_MESSAGE_MARKER = "[HOST RUNTIME MESSAGE v1: host-authored, not from the user]";
372878
- function hostObservationMessage(content, kind2) {
372879
- return {
373020
+ var issuedHostObservations = /* @__PURE__ */ new WeakMap();
373021
+ function readIssuedAppendOnlyHostObservation(value) {
373022
+ if (!value || typeof value !== "object")
373023
+ return void 0;
373024
+ const issued14 = issuedHostObservations.get(value);
373025
+ return issued14 && JSON.stringify(value) === issued14.fingerprint ? issued14.value : void 0;
373026
+ }
373027
+ function hostObservationMessage(content, kind2, projections = [], original) {
373028
+ const message3 = {
373029
+ ...original,
372880
373030
  role: "user",
372881
373031
  policyScope: "runtime",
372882
373032
  content,
372883
373033
  runtimeOrigin: { schema: "omnius.append-only-host-origin.v1", producer: "append-only-outbound", kind: kind2 }
372884
373034
  };
373035
+ issuedHostObservations.set(message3, { fingerprint: JSON.stringify(message3), value: Object.freeze({
373036
+ kind: kind2,
373037
+ content,
373038
+ projections: Object.freeze(projections.map((projection) => Object.freeze({ ...projection })))
373039
+ }) });
373040
+ return message3;
372885
373041
  }
372886
373042
  function renderObservationSnapshot(projections) {
372887
373043
  return `${APPEND_ONLY_OBSERVATION_SNAPSHOT_MARKER}
@@ -373136,9 +373292,9 @@ ${content}`, "exact_source"));
373136
373292
  return full("frame_update_budget_exceeded", rebase);
373137
373293
  if (frameUpdateCount > maxFrameUpdates)
373138
373294
  return full("frame_update_count_exceeded", rebase);
373139
- const appended = currentUnits.slice(priorUnits.length).flatMap((unit) => unit.messages).map((message3) => projectResidentNativeSource(message3, previous, rawCarriers)).map((message3) => message3.role === "system" && typeof message3.content === "string" ? { ...message3, ...hostObservationMessage(`${APPEND_ONLY_HOST_MESSAGE_MARKER}
373140
- ${message3.content}`, "runtime_message") } : message3);
373141
- const sent = [...previous.sent, ...appended, ...exactAdditions, ...update ? [hostObservationMessage(update, "projection_snapshot")] : []];
373295
+ const appended = currentUnits.slice(priorUnits.length).flatMap((unit) => unit.messages).map((message3) => projectResidentNativeSource(message3, previous, rawCarriers)).map((message3) => message3.role === "system" && typeof message3.content === "string" ? hostObservationMessage(`${APPEND_ONLY_HOST_MESSAGE_MARKER}
373296
+ ${message3.content}`, "runtime_message", [], message3) : message3);
373297
+ const sent = [...previous.sent, ...appended, ...exactAdditions, ...update ? [hostObservationMessage(update, "projection_snapshot", updates)] : []];
373142
373298
  return {
373143
373299
  messages: sent,
373144
373300
  mode: "extended",
@@ -373919,7 +374075,7 @@ async function* parseOpenAIChatStream(response, options = {}) {
373919
374075
  // packages/orchestrator/dist/durable-document-worker.js
373920
374076
  import { constants as constants10 } from "node:fs";
373921
374077
  import { open as open6, realpath as realpath7, stat as stat4 } from "node:fs/promises";
373922
- import { createHash as createHash84, randomUUID as randomUUID51 } from "node:crypto";
374078
+ import { createHash as createHash84, randomUUID as randomUUID52 } from "node:crypto";
373923
374079
  import { isAbsolute as isAbsolute22, relative as relative19, resolve as resolve33 } from "node:path";
373924
374080
 
373925
374081
  // packages/orchestrator/dist/taskWorkDelegation.js
@@ -374201,7 +374357,7 @@ var DurableDocumentWorkerCoordinator = class {
374201
374357
  const claims = options.corpus.claimOperationWork({
374202
374358
  ...this.scope,
374203
374359
  expectedRevision: operation.revision,
374204
- owner: { ownerId: options.grant.parentRunId, runId: `document-attempt:${randomUUID51()}`, taskEpoch: options.grant.definition.taskEpoch },
374360
+ owner: { ownerId: options.grant.parentRunId, runId: `document-attempt:${randomUUID52()}`, taskEpoch: options.grant.definition.taskEpoch },
374205
374361
  leaseMs: options.leaseMs ?? 3e5,
374206
374362
  pageSize: 1,
374207
374363
  sourceIds: remaining
@@ -376136,7 +376292,7 @@ import { homedir as _osHomedir } from "node:os";
376136
376292
 
376137
376293
  // packages/orchestrator/dist/selfImprovement.js
376138
376294
  import { appendFile, mkdir as mkdir6, open as open7, readFile as readFile4, stat as stat5, unlink as unlink3, writeFile as writeFile3 } from "node:fs/promises";
376139
- import { createHash as createHash93, randomUUID as randomUUID52 } from "node:crypto";
376295
+ import { createHash as createHash93, randomUUID as randomUUID53 } from "node:crypto";
376140
376296
  import { dirname as dirname31, join as join54, resolve as resolve36 } from "node:path";
376141
376297
  var SELF_IMPROVEMENT_SCHEMA = "omnius.self-improvement.event.v1";
376142
376298
  function canonical6(value) {
@@ -376336,7 +376492,7 @@ var SelfImprovementArchive = class {
376336
376492
  const previousEventHash = current6.at(-1)?.eventHash;
376337
376493
  const core = {
376338
376494
  schema: SELF_IMPROVEMENT_SCHEMA,
376339
- id: randomUUID52(),
376495
+ id: randomUUID53(),
376340
376496
  kind: kind2,
376341
376497
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
376342
376498
  sessionId,
@@ -376371,7 +376527,7 @@ var SelfImprovementArchive = class {
376371
376527
  };
376372
376528
 
376373
376529
  // packages/orchestrator/dist/conversationReportEvidence.js
376374
- import { createHash as createHash94, randomUUID as randomUUID53 } from "node:crypto";
376530
+ import { createHash as createHash94, randomUUID as randomUUID54 } from "node:crypto";
376375
376531
  import { closeSync as closeSync16, existsSync as existsSync37, fsyncSync as fsyncSync9, mkdirSync as mkdirSync30, openSync as openSync16, readFileSync as readFileSync42, renameSync as renameSync14, unlinkSync as unlinkSync16, writeFileSync as writeFileSync27 } from "node:fs";
376376
376532
  import { dirname as dirname32, join as join55 } from "node:path";
376377
376533
  import { z as z24 } from "zod";
@@ -376731,7 +376887,7 @@ var ConversationReportEvidence = class {
376731
376887
  }
376732
376888
  publish(path13, value) {
376733
376889
  mkdirSync30(dirname32(path13), { recursive: true });
376734
- const temporary = `${path13}.${randomUUID53()}.tmp`;
376890
+ const temporary = `${path13}.${randomUUID54()}.tmp`;
376735
376891
  try {
376736
376892
  writeFileSync27(temporary, JSON.stringify(value), { encoding: "utf8", flag: "wx", mode: 384 });
376737
376893
  this.sync(temporary);
@@ -376859,7 +377015,7 @@ import { dirname as dirname33, isAbsolute as isAbsolute24, join as join57, relat
376859
377015
  import { z as z25 } from "zod";
376860
377016
 
376861
377017
  // packages/orchestrator/dist/contentAddressedArtifactStore.js
376862
- import { createHash as createHash95, randomUUID as randomUUID54 } from "node:crypto";
377018
+ import { createHash as createHash95, randomUUID as randomUUID55 } from "node:crypto";
376863
377019
  import { constants as constants13, closeSync as closeSync17, existsSync as existsSync38, fstatSync as fstatSync7, fsyncSync as fsyncSync10, mkdirSync as mkdirSync31, openSync as openSync17, readFileSync as readFileSync43, readSync as readSync3, readdirSync as readdirSync12, renameSync as renameSync15, statSync as statSync19, unlinkSync as unlinkSync17, writeFileSync as writeFileSync28 } from "node:fs";
376864
377020
  import { open as open8, mkdir as mkdir7, link as link3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
376865
377021
  import { join as join56, resolve as resolve37, sep as sep7 } from "node:path";
@@ -377272,7 +377428,7 @@ var ContentAddressedArtifactStore = class {
377272
377428
  nonnegativeInteger(input2.expectedUtf16Chars, "expected artifact UTF-16 characters");
377273
377429
  const temporaryRoot = safeJoin(this.rootDir, "temporary");
377274
377430
  await mkdir7(temporaryRoot, { recursive: true, mode: 448 });
377275
- const nonce = randomUUID54(), objectTemporary = safeJoin(temporaryRoot, `${nonce}.txt`), indexTemporary = safeJoin(temporaryRoot, `${nonce}.jsonl`);
377431
+ const nonce = randomUUID55(), objectTemporary = safeJoin(temporaryRoot, `${nonce}.txt`), indexTemporary = safeJoin(temporaryRoot, `${nonce}.jsonl`);
377276
377432
  let source2, output, indexOutput;
377277
377433
  try {
377278
377434
  fileFence(options);
@@ -379355,7 +379511,7 @@ function featureWorkflowToolParameters(parameters) {
379355
379511
 
379356
379512
  // packages/orchestrator/dist/interruption-lifecycle.js
379357
379513
  import { closeSync as closeSync19, existsSync as existsSync40, fsyncSync as fsyncSync12, mkdirSync as mkdirSync33, openSync as openSync19, readFileSync as readFileSync46, renameSync as renameSync17, rmSync as rmSync4, writeFileSync as writeFileSync30 } from "node:fs";
379358
- import { randomUUID as randomUUID55 } from "node:crypto";
379514
+ import { randomUUID as randomUUID56 } from "node:crypto";
379359
379515
  import { dirname as dirname34, join as join58, resolve as resolve40 } from "node:path";
379360
379516
  var INTERRUPTION_LIFECYCLE_SCHEMA = "omnius.interruption-lifecycle.v1";
379361
379517
  var TRANSCRIPTION_OBSERVATION_RECONCILIATION = "registered-tool:transcribe_file:cancelled-observation:no-external-action:no-transcript-result";
@@ -380082,7 +380238,7 @@ var InterruptionLifecycle = class {
380082
380238
  }
380083
380239
  const parent = dirname34(this.statePath);
380084
380240
  mkdirSync33(parent, { recursive: true, mode: 448 });
380085
- const tmp = `${this.statePath}.tmp.${process.pid}.${this.state.sequence}.${randomUUID55()}`;
380241
+ const tmp = `${this.statePath}.tmp.${process.pid}.${this.state.sequence}.${randomUUID56()}`;
380086
380242
  let descriptor2;
380087
380243
  let renamed = false;
380088
380244
  try {
@@ -383160,7 +383316,7 @@ function applyWorldPatch(world, patch) {
383160
383316
 
383161
383317
  // packages/orchestrator/dist/operational-world/persistence.js
383162
383318
  import { closeSync as closeSync20, existsSync as existsSync42, fsyncSync as fsyncSync13, mkdirSync as mkdirSync35, linkSync as linkSync3, openSync as openSync20, readFileSync as readFileSync48, renameSync as renameSync18, unlinkSync as unlinkSync19, writeFileSync as writeFileSync31 } from "node:fs";
383163
- import { createHash as createHash104, randomUUID as randomUUID56 } from "node:crypto";
383319
+ import { createHash as createHash104, randomUUID as randomUUID57 } from "node:crypto";
383164
383320
  import { dirname as dirname35, join as join60 } from "node:path";
383165
383321
  import { performance as performance4 } from "node:perf_hooks";
383166
383322
  init_dist();
@@ -383365,7 +383521,7 @@ function syncDirectory2(path13) {
383365
383521
  }
383366
383522
  }
383367
383523
  function atomicWrite2(file, payload2, sync) {
383368
- const temp = `${file}.tmp.${process.pid}.${randomUUID56()}`;
383524
+ const temp = `${file}.tmp.${process.pid}.${randomUUID57()}`;
383369
383525
  let fd;
383370
383526
  try {
383371
383527
  fd = openSync20(temp, "wx", 384);
@@ -383489,7 +383645,7 @@ function saveOperationalWorldState(stateDir, runId, state2, options) {
383489
383645
  if (prior !== payload3)
383490
383646
  throw new Error("Journal digest collision.");
383491
383647
  } else {
383492
- const temp = `${target2}.tmp.${process.pid}.${randomUUID56()}`;
383648
+ const temp = `${target2}.tmp.${process.pid}.${randomUUID57()}`;
383493
383649
  let fd;
383494
383650
  try {
383495
383651
  fd = openSync20(temp, "wx", 384);
@@ -386494,6 +386650,27 @@ function taskValidationAfterVerificationAttempt(evidence, input2) {
386494
386650
  return evidence;
386495
386651
  }
386496
386652
 
386653
+ // packages/orchestrator/dist/native-provider-delivery.js
386654
+ var NativeProviderDeliveryHoldError = class extends Error {
386655
+ reason;
386656
+ workspaceRoot;
386657
+ sessionId;
386658
+ runId;
386659
+ taskEpoch;
386660
+ ledgerPath;
386661
+ code = "native_pending_provider_delivery_hold";
386662
+ constructor(reason, workspaceRoot, sessionId, runId, taskEpoch, ledgerPath) {
386663
+ super(`Native provider delivery remains held: ${reason}`);
386664
+ this.reason = reason;
386665
+ this.workspaceRoot = workspaceRoot;
386666
+ this.sessionId = sessionId;
386667
+ this.runId = runId;
386668
+ this.taskEpoch = taskEpoch;
386669
+ this.ledgerPath = ledgerPath;
386670
+ this.name = "NativeProviderDeliveryHoldError";
386671
+ }
386672
+ };
386673
+
386497
386674
  // packages/orchestrator/dist/completionFinalization.js
386498
386675
  import { existsSync as existsSync43, mkdirSync as mkdirSync36, readFileSync as readFileSync49, renameSync as renameSync19, unlinkSync as unlinkSync20, writeFileSync as writeFileSync32 } from "node:fs";
386499
386676
  import { dirname as dirname36, join as join61 } from "node:path";
@@ -393754,7 +393931,7 @@ function buildDecompositionTodos(modules) {
393754
393931
  }
393755
393932
 
393756
393933
  // packages/orchestrator/dist/modelProfile.js
393757
- import { randomUUID as randomUUID57 } from "node:crypto";
393934
+ import { randomUUID as randomUUID58 } from "node:crypto";
393758
393935
  function resolveModelProfile(model3) {
393759
393936
  const m = model3.toLowerCase();
393760
393937
  if (m.includes("hermes") || m.includes("nousresearch/hermes")) {
@@ -393820,7 +393997,7 @@ function parseToolPayload(payload2) {
393820
393997
  if (typeof name !== "string" || !name.trim() || name.length > 128 || !args || typeof args !== "object" || Array.isArray(args))
393821
393998
  return null;
393822
393999
  return {
393823
- id: "text-tool-" + randomUUID57(),
394000
+ id: "text-tool-" + randomUUID58(),
393824
394001
  name: name.trim(),
393825
394002
  arguments: args
393826
394003
  };
@@ -395926,13 +396103,23 @@ ${body}`);
395926
396103
  audit.modelFacingBytes = Buffer.byteLength(content ?? "", "utf8");
395927
396104
  return { content, audit };
395928
396105
  }
395929
- function renderModelFacingRunObservations(input2) {
396106
+ var MODEL_FACING_ACCEPTED_GOAL_MARKER = "[ACCEPTED NATIVE GOAL v1]";
396107
+ function renderModelFacingAcceptedGoal(acceptedGoal) {
396108
+ return MODEL_FACING_ACCEPTED_GOAL_MARKER + "\n" + JSON.stringify({ acceptedGoal });
396109
+ }
396110
+ function renderModelFacingRunObservations(input2, options) {
395930
396111
  const facts = {};
395931
- if (input2.acceptedGoal)
395932
- facts.acceptedGoal = input2.acceptedGoal;
396112
+ if (input2.acceptedGoal) {
396113
+ if (options?.onAcceptedGoal)
396114
+ options.onAcceptedGoal(input2.acceptedGoal);
396115
+ else
396116
+ facts.acceptedGoal = input2.acceptedGoal;
396117
+ }
395933
396118
  if (input2.operationRepetitions?.length) {
395934
396119
  facts.operationRepetitions = input2.operationRepetitions;
395935
396120
  facts.operationRepetitionMeaning = "The same native operation arguments were executed repeatedly. Different result hashes can be fresh envelopes or handles; no result equality, body consumption or goal fulfillment is asserted.";
396121
+ if (input2.operationRepetitions.some((operation) => operation.latestMemoryRead))
396122
+ facts.memorySearchMeaning = "Memory search is read-only. Successful execution does not prove a new note was authored. Observation coverage concerns native-return custody; query coverage is separately reported in latestMemoryRead.status/outcome. Returned source kinds/namespaces may describe historical messages or prior notes. An unchanged source manifest identifies the same returned records despite fresh query IDs; it does not grant source access or assert complete query coverage.";
395936
396123
  }
395937
396124
  if (input2.operationObservationCoverage)
395938
396125
  facts.operationObservationCoverage = input2.operationObservationCoverage;
@@ -397655,7 +397842,7 @@ function selectReasoningCheckpoint(input2) {
397655
397842
  import { existsSync as existsSync60, mkdirSync as mkdirSync45, readdirSync as readdirSync21, readFileSync as readFileSync65, statSync as statSync30, unlinkSync as unlinkSync23, writeFileSync as writeFileSync41, appendFileSync as appendFileSync8, chmodSync as chmodSync3, closeSync as closeSync23, openSync as openSync23, readSync as readSync4, renameSync as renameSync24 } from "node:fs";
397656
397843
  init_dist2();
397657
397844
  import { join as join77, resolve as resolve45 } from "node:path";
397658
- import { createHash as createHash130, randomUUID as randomUUID59 } from "node:crypto";
397845
+ import { createHash as createHash130, randomUUID as randomUUID60 } from "node:crypto";
397659
397846
 
397660
397847
  // packages/orchestrator/dist/request-budget.js
397661
397848
  import { createHash as createHash128 } from "node:crypto";
@@ -397787,7 +397974,7 @@ function budgetMatchesOutboundRequest(budget, request) {
397787
397974
 
397788
397975
  // packages/orchestrator/dist/context-dump-retention.js
397789
397976
  import { appendFileSync as appendFileSync7, closeSync as closeSync22, existsSync as existsSync59, fsyncSync as fsyncSync15, openSync as openSync22, readFileSync as readFileSync64, readdirSync as readdirSync20, renameSync as renameSync23, statSync as statSync29, unlinkSync as unlinkSync22, writeFileSync as writeFileSync40 } from "node:fs";
397790
- import { createHash as createHash129, randomUUID as randomUUID58 } from "node:crypto";
397977
+ import { createHash as createHash129, randomUUID as randomUUID59 } from "node:crypto";
397791
397978
  import { basename as basename20, join as join76 } from "node:path";
397792
397979
  var FILE = "retention-manifest.json";
397793
397980
  var PIN_KEYS = [
@@ -397802,7 +397989,7 @@ var PIN_KEYS = [
397802
397989
  var MAX_RUNS = 24;
397803
397990
  var DEFAULT_MAX_FILES = 200;
397804
397991
  function atomic(file, value) {
397805
- const temp = `${file}.${process.pid}.${randomUUID58()}.tmp`;
397992
+ const temp = `${file}.${process.pid}.${randomUUID59()}.tmp`;
397806
397993
  let fd;
397807
397994
  try {
397808
397995
  fd = openSync22(temp, "wx", 384);
@@ -397957,7 +398144,7 @@ function recordContextWindowDump(input2) {
397957
398144
  String(input2.turn ?? ""),
397958
398145
  String(input2.attempt ?? "")
397959
398146
  ].join("|");
397960
- const id8 = `${timestamp7.replace(/[:.]/g, "-")}-${input2.agentType}-${shortHash4(stable7)}-${randomUUID59().slice(0, 8)}`;
398147
+ const id8 = `${timestamp7.replace(/[:.]/g, "-")}-${input2.agentType}-${shortHash4(stable7)}-${randomUUID60().slice(0, 8)}`;
397961
398148
  const metrics = analyzeContextWindowDumpRequest(input2.request);
397962
398149
  const invariantErrors = [...input2.requestCompilation?.invariantErrors ?? []];
397963
398150
  const messages4 = Array.isArray(input2.request["messages"]) ? input2.request["messages"] : [];
@@ -399793,7 +399980,7 @@ function validateMemoryCompilationPlan(input2) {
399793
399980
 
399794
399981
  // packages/orchestrator/dist/debugArtifactLibrary.js
399795
399982
  import { appendFileSync as appendFileSync9, existsSync as existsSync61, mkdirSync as mkdirSync46, readFileSync as readFileSync66, statSync as statSync31, writeFileSync as writeFileSync42, closeSync as closeSync24, fsyncSync as fsyncSync16, openSync as openSync24, readSync as readSync5, renameSync as renameSync25, unlinkSync as unlinkSync24 } from "node:fs";
399796
- import { createHash as createHash131, randomUUID as randomUUID60 } from "node:crypto";
399983
+ import { createHash as createHash131, randomUUID as randomUUID61 } from "node:crypto";
399797
399984
  import { basename as basename21, dirname as dirname44, join as join78, relative as relative25, resolve as resolve46 } from "node:path";
399798
399985
  var DEBUG_LIBRARY_DIR = "debug-library";
399799
399986
  var RUN_EVENTS_LIMIT = 40;
@@ -400054,9 +400241,9 @@ function debugRunPaths(cwd, runId, stateDir) {
400054
400241
  eventsJsonlPath: join78(runDir, "events.jsonl")
400055
400242
  };
400056
400243
  }
400057
- var PROCESS_INSTANCE_ID = randomUUID60();
400244
+ var PROCESS_INSTANCE_ID = randomUUID61();
400058
400245
  function writeDebugAtomic(file, payload2) {
400059
- const temp = `${file}.${process.pid}.${randomUUID60()}.tmp`;
400246
+ const temp = `${file}.${process.pid}.${randomUUID61()}.tmp`;
400060
400247
  let fd;
400061
400248
  try {
400062
400249
  fd = openSync24(temp, "wx", 384);
@@ -400163,7 +400350,7 @@ function writeEventAndIndexes(paths3, event, originalPath) {
400163
400350
  if (!Number.isSafeInteger(sequence))
400164
400351
  throw new Error("Debug sequence exhausted.");
400165
400352
  writeDebugAtomic(sequencePath, JSON.stringify({ ...prior, sequence }));
400166
- event.id = `${String(sequence).padStart(10, "0")}-${randomUUID60()}`;
400353
+ event.id = `${String(sequence).padStart(10, "0")}-${randomUUID61()}`;
400167
400354
  event.sequence = sequence;
400168
400355
  event.processInstanceId = PROCESS_INSTANCE_ID;
400169
400356
  if (last?.id)
@@ -405262,7 +405449,7 @@ function auxiliaryOutputBudget(input2) {
405262
405449
  }
405263
405450
 
405264
405451
  // packages/orchestrator/dist/auxiliary-context-operation.js
405265
- import { createHash as createHash138, randomUUID as randomUUID61 } from "node:crypto";
405452
+ import { createHash as createHash138, randomUUID as randomUUID62 } from "node:crypto";
405266
405453
  var pendingDispatchMarkers = /* @__PURE__ */ new WeakMap();
405267
405454
  function readIssuedPendingAuxiliaryOperation(marker) {
405268
405455
  if (typeof marker !== "function")
@@ -405347,7 +405534,7 @@ var AuxiliaryContextOperationController = class {
405347
405534
  this.policy = normalizeHostAuxiliaryPolicy(policy);
405348
405535
  }
405349
405536
  async run(input2) {
405350
- const start = performance.now(), operationId = randomUUID61(), logicalRequestId = input2.logicalRequestId ?? `${this.host.owner.runId}:aux:${operationId}`, budget = this.policy.budget, inputBytes = Buffer.byteLength(input2.payload), inputSha256 = sha29(input2.payload);
405537
+ const start = performance.now(), operationId = randomUUID62(), logicalRequestId = input2.logicalRequestId ?? `${this.host.owner.runId}:aux:${operationId}`, budget = this.policy.budget, inputBytes = Buffer.byteLength(input2.payload), inputSha256 = sha29(input2.payload);
405351
405538
  let sourceSnapshots = [], attempted = false, outputBytes, tokens3, charged = 0, reserved = false;
405352
405539
  let marker;
405353
405540
  let backendPending = 0, hostFinished = false, released = false;
@@ -407654,7 +407841,7 @@ init_dist2();
407654
407841
  import { createHash as createHash146 } from "node:crypto";
407655
407842
 
407656
407843
  // packages/orchestrator/dist/authored-instruction-revisions.js
407657
- import { createHash as createHash145, randomUUID as randomUUID62 } from "node:crypto";
407844
+ import { createHash as createHash145, randomUUID as randomUUID63 } from "node:crypto";
407658
407845
 
407659
407846
  // packages/orchestrator/dist/authored-instruction-sources.js
407660
407847
  import { createHash as createHash144 } from "node:crypto";
@@ -408088,7 +408275,7 @@ ${active ? snapshot2.content : ""}
408088
408275
 
408089
408276
  // packages/orchestrator/dist/explicit-work-mode.js
408090
408277
  init_dist5();
408091
- import { createHash as createHash147, randomUUID as randomUUID63 } from "node:crypto";
408278
+ import { createHash as createHash147, randomUUID as randomUUID64 } from "node:crypto";
408092
408279
  import { existsSync as existsSync63, realpathSync as realpathSync29 } from "node:fs";
408093
408280
  import { basename as basename23, dirname as dirname48, isAbsolute as isAbsolute34, relative as relative30, resolve as resolve51 } from "node:path";
408094
408281
  var EXPLICIT_WORK_MODE_MARKER = "[EXPLICIT WORK MODE v1]";
@@ -409045,6 +409232,7 @@ function withTaskCompleteCloseoutContract(tool) {
409045
409232
  }
409046
409233
  } } };
409047
409234
  }
409235
+ var DEFAULT_AGENTIC_MAX_TOKENS = 16384;
409048
409236
  var OBJECTIVE_READ_BATCH_SCHEMA = "omnius.objective-read-batch-continuation.v1";
409049
409237
  function normalizeObjectiveReadBatchContinuationV1(value) {
409050
409238
  if (!value || typeof value !== "object" || Array.isArray(value))
@@ -409589,6 +409777,14 @@ var MUTATION_SCAFFOLD_CARD_IDS = /* @__PURE__ */ new Set([
409589
409777
  "verify-observed-outcome"
409590
409778
  ]);
409591
409779
  var AgenticRunner = class _AgenticRunner {
409780
+ _readNativeInteractiveDecision;
409781
+ _readNativeProviderDeliveryAck;
409782
+ #pendingProviderDelivery;
409783
+ _nativeInteractiveDecisions = /* @__PURE__ */ new Map();
409784
+ _issuedSteeringReplyPackets = /* @__PURE__ */ new WeakMap();
409785
+ _appendOnlySteeringChains = /* @__PURE__ */ new WeakMap();
409786
+ _appendOnlySteeringSequence = 0;
409787
+ _appendOnlySteeringCarriers = /* @__PURE__ */ new WeakMap();
409592
409788
  backend;
409593
409789
  tools = /* @__PURE__ */ new Map();
409594
409790
  options;
@@ -412947,6 +413143,8 @@ runtime_module_sha256=${record11.runtimeProvenance.module.sha256 ?? "unknown"}`
412947
413143
  _mutationLeases = /* @__PURE__ */ new Map();
412948
413144
  _gitProgress = null;
412949
413145
  constructor(backend, options) {
413146
+ this._readNativeInteractiveDecision = options?.readNativeInteractiveDecision;
413147
+ this._readNativeProviderDeliveryAck = options?.readNativeProviderDeliveryAck;
412950
413148
  const adversaryMode = options?.adversaryMode ?? options?.observerMode ?? "both";
412951
413149
  const disableAdversaryCritic = options?.disableAdversaryCritic ?? options?.disableStepCritic ?? true;
412952
413150
  const expectedOutcomeContract = options?.expectedOutcomeContract ? normalizeExpectedOutcomeContractV1(options.expectedOutcomeContract) : void 0;
@@ -413007,6 +413205,7 @@ runtime_module_sha256=${record11.runtimeProvenance.module.sha256 ?? "unknown"}`
413007
413205
  acceptTextOnlyCompletion: options?.acceptTextOnlyCompletion ?? false,
413008
413206
  admitTextOnlyCompletionCandidate: options?.admitTextOnlyCompletionCandidate,
413009
413207
  readCurrentNativeCompletionDeficit: options?.readCurrentNativeCompletionDeficit,
413208
+ readNativeInteractiveDecision: options?.readNativeInteractiveDecision,
413010
413209
  expectedOutcomeContract,
413011
413210
  taskObjectiveContract,
413012
413211
  taskSemanticAdmissionRequired: options?.taskSemanticAdmissionRequired ?? false,
@@ -413029,7 +413228,7 @@ runtime_module_sha256=${record11.runtimeProvenance.module.sha256 ?? "unknown"}`
413029
413228
  taskObjectiveExternalEffectReceipts,
413030
413229
  taskObjectiveVerificationReceipts,
413031
413230
  taskObjectiveEnforcement: options?.taskObjectiveEnforcement ?? "strict",
413032
- maxTokens: options?.maxTokens ?? 16384,
413231
+ maxTokens: options?.maxTokens ?? DEFAULT_AGENTIC_MAX_TOKENS,
413033
413232
  temperature: options?.temperature ?? 0,
413034
413233
  requestTimeoutMs: options?.requestTimeoutMs ?? 3e5,
413035
413234
  ownedInferenceWaitRuntimeFingerprint: options?.ownedInferenceWaitRuntimeFingerprint ?? "",
@@ -414243,7 +414442,10 @@ ${read2.content}`;
414243
414442
  if (!authority || authority !== this._activeSteering || !slot || this._steeringAuthorityRuns.get(authority) !== this._activeRunId || [authority.input, ...authority.relatedInputs ?? []].some((input2) => input2.taskEpoch !== this._taskEpoch || input2.state === "cancelled" || input2.state === "superseded") || this._renderActiveSteeringSlot(messages4) !== slot)
414244
414443
  return false;
414245
414444
  const framed = this._canonicalSteeringFrames.get(request);
414246
- return messages4.some((message3) => message3.role === "system" && (message3.content === slot || framed?.authority === authority && framed.slot === slot && message3.content === framed.frame));
414445
+ if (messages4.some((message3) => message3.role === "system" && (message3.content === slot || framed?.authority === authority && framed.slot === slot && message3.content === framed.frame)))
414446
+ return true;
414447
+ const projected = this._appendOnlySteeringCarriers.get(request);
414448
+ return projected?.authority === authority && projected.slot === slot && projected.carriers.some((carrier) => !!readIssuedAppendOnlyHostObservation(carrier.original) && messages4.some((message3) => message3.role === carrier.role && message3.content === carrier.content && _isDeepStrictEqual(message3.runtimeOrigin, carrier.runtimeOrigin)));
414247
414449
  }
414248
414450
  /**
414249
414451
  * Mutate only the ephemeral outbound clone after every late request assembly
@@ -417182,13 +417384,35 @@ ${workflowStatus}` } : {}
417182
417384
  return;
417183
417385
  if (process.env["OMNIUS_APPEND_ONLY_OUTBOUND"] !== "1" && this.backend.prefersAppendOnlyPrompts?.() !== true)
417184
417386
  return;
417387
+ const steering = this._activeSteering;
417388
+ const steeringSlot = this._renderActiveSteeringSlot(request.messages);
417389
+ const currentSteeringPresent = !!steeringSlot && this._requestCarriesCurrentSteering(request, steering, steeringSlot);
417390
+ let steeringChain = null;
417391
+ if (steeringSlot && steering) {
417392
+ let identity10 = this._appendOnlySteeringChains.get(steering);
417393
+ if (!identity10)
417394
+ this._appendOnlySteeringChains.set(steering, identity10 = ++this._appendOnlySteeringSequence);
417395
+ steeringChain = [
417396
+ identity10,
417397
+ this._interruptionOwnerId,
417398
+ this.interruptionState?.owner.generation ?? 0,
417399
+ [steering.input, ...steering.relatedInputs ?? []].map((input2) => [
417400
+ input2.inputId,
417401
+ _createHash("sha256").update(input2.content).digest("hex")
417402
+ ])
417403
+ ];
417404
+ }
417185
417405
  const key2 = JSON.stringify([
417186
417406
  this.currentArtifactRunId(),
417187
417407
  this._taskEpoch,
417188
- _createHash("sha256").update(JSON.stringify(request.tools ?? [])).digest("hex")
417408
+ _createHash("sha256").update(JSON.stringify(request.tools ?? [])).digest("hex"),
417409
+ steeringChain
417189
417410
  ]);
417190
- const steering = this._activeSteering;
417191
- const steeringPending = Boolean(this._currentSteeringReplyPending() || steering?.input.taskEpoch === this._taskEpoch && steering.gatesOldPlan && steering.requiresReconciliation && !steering.reconciliation);
417411
+ const steeringUnqualified = !!steeringSlot && !currentSteeringPresent;
417412
+ const priorGoal = this._appendOnlyOutbound?.projections.get(MODEL_FACING_ACCEPTED_GOAL_MARKER);
417413
+ const currentGoal = request.messages.filter((message3) => message3.role === "system" && typeof message3.content === "string" && message3.content.startsWith(MODEL_FACING_ACCEPTED_GOAL_MARKER) && message3.requiredSourceEvidence?.schema === "omnius.required-source-evidence.v1" && message3.requiredSourceEvidence.scope === `${this.currentArtifactRunId()}:${this._taskEpoch}:accepted-native-goal`);
417414
+ const goalResident = priorGoal === void 0 || this._appendOnlyOutbound.sent.some((message3) => message3.role === "system" && message3.content === priorGoal || readIssuedAppendOnlyHostObservation(message3)?.projections.some((projection) => projection.marker === MODEL_FACING_ACCEPTED_GOAL_MARKER && projection.content === priorGoal));
417415
+ const goalRebaseReason = priorGoal === void 0 ? void 0 : currentGoal.length !== 1 ? "accepted_goal_current_carrier_missing" : !goalResident ? "accepted_goal_original_carrier_missing" : currentGoal[0].content !== priorGoal ? "accepted_goal_changed" : void 0;
417192
417416
  const acceptedReceipts = new Map(this._canonicalAcceptedReceipts);
417193
417417
  for (const message3 of request.messages) {
417194
417418
  if (message3.role !== "system")
@@ -417225,7 +417449,7 @@ ${workflowStatus}` } : {}
417225
417449
  const projectionInput = {
417226
417450
  key: key2,
417227
417451
  messages: request.messages,
417228
- previous: steeringPending ? void 0 : this._appendOnlyOutbound,
417452
+ previous: steeringUnqualified || goalRebaseReason ? void 0 : this._appendOnlyOutbound,
417229
417453
  acceptedReceipts,
417230
417454
  exactSources: new Map([...this._canonicalExactSources.get(request) ?? []].filter(([, content]) => request.messages.some((message3) => typeof message3.content === "string" && message3.content.includes(content)))),
417231
417455
  exactSourceCarriers: this._canonicalExactSourceCarriers.get(request),
@@ -417241,17 +417465,21 @@ ${workflowStatus}` } : {}
417241
417465
  { marker: "<world-state", label: "world state" },
417242
417466
  { marker: "[WORLD STATE SUMMARY]", label: "world state summary" },
417243
417467
  { marker: "[RUN OBSERVATIONS v1]", label: "run observations" },
417468
+ { marker: MODEL_FACING_ACCEPTED_GOAL_MARKER, label: "exact accepted native goal" },
417469
+ { marker: "[ACTIVE USER STEERING]", label: "current native user steering" },
417244
417470
  { marker: "[HEALTH CHECK #", label: "progress assessment" },
417245
417471
  { marker: "[FILES KNOWN", label: "file evidence" }
417246
417472
  ]
417247
417473
  };
417248
417474
  const projected = projectAppendOnlyOutbound(projectionInput);
417249
- if (steeringPending)
417250
- projected.reason = "steering_pending";
417475
+ if (steeringUnqualified)
417476
+ projected.reason = "steering_frame_unqualified";
417477
+ else if (goalRebaseReason)
417478
+ projected.reason = goalRebaseReason;
417251
417479
  if (projected.reason === "new_chain" && this._appendOnlyOutbound) {
417252
417480
  const before = JSON.parse(this._appendOnlyOutbound.key);
417253
417481
  const after = JSON.parse(key2);
417254
- projected.reason = before[0] !== after[0] ? "run_changed" : before[1] !== after[1] ? "task_epoch_changed" : "tool_schema_changed";
417482
+ projected.reason = before[0] !== after[0] ? "run_changed" : before[1] !== after[1] ? "task_epoch_changed" : before[2] !== after[2] ? "tool_schema_changed" : "steering_authority_changed";
417255
417483
  }
417256
417484
  const handoff = this._appendOnlyRequiredAuxiliaryHandoff;
417257
417485
  if (projected.reason === "new_chain" && handoff?.runId === this.currentArtifactRunId() && handoff.taskEpoch === this._taskEpoch)
@@ -417271,6 +417499,16 @@ ${workflowStatus}` } : {}
417271
417499
  }
417272
417500
  request.messages = projected.messages;
417273
417501
  }
417502
+ if (currentSteeringPresent && steering && steeringSlot) {
417503
+ const carriers = request.messages.flatMap((message3) => {
417504
+ const original = readIssuedAppendOnlyHostObservation(message3);
417505
+ if (!original || !original.projections.some((projection) => typeof projection.content === "string" && projection.content.includes(steeringSlot)))
417506
+ return [];
417507
+ return [{ original: message3, role: message3.role, content: String(message3.content), runtimeOrigin: message3.runtimeOrigin }];
417508
+ });
417509
+ if (carriers.length)
417510
+ this._appendOnlySteeringCarriers.set(request, { authority: steering, slot: steeringSlot, carriers });
417511
+ }
417274
417512
  this._appendOnlyOutbound = projected.state;
417275
417513
  record11(projected.mode, projected.reason);
417276
417514
  }
@@ -429187,6 +429425,8 @@ ${JSON.stringify({
429187
429425
  * Validates against inputSchema if present and returns the tool result.
429188
429426
  */
429189
429427
  async runToolByName(name, args, origin = "api", originalModelResponse) {
429428
+ if (this.#pendingProviderDelivery && !this.#pendingProviderDelivery.committed)
429429
+ throw new Error("native_provider_delivery_pending");
429190
429430
  if (this._exclusiveTaskOwner === "host")
429191
429431
  return {
429192
429432
  success: false,
@@ -429210,6 +429450,8 @@ ${JSON.stringify({
429210
429450
  }
429211
429451
  }
429212
429452
  async _runDirectToolByName(name, args, origin, originalCapabilities, composed) {
429453
+ if (this.#pendingProviderDelivery && !this.#pendingProviderDelivery.committed)
429454
+ throw new Error("native_provider_delivery_pending");
429213
429455
  const initialPhase = this._interruptionLifecycle?.snapshot().phase;
429214
429456
  if (this.aborted || this._turnAbortController.signal.aborted || initialPhase === "stopping" || initialPhase === "stopped")
429215
429457
  return { success: false, output: "", error: "interruption_stop_admitted", runtimeAuthored: true };
@@ -429671,6 +429913,66 @@ ${notice}`;
429671
429913
  semanticReview.controller.abort(new InputWaitInterruption());
429672
429914
  return this._steeringReceipt(record11);
429673
429915
  }
429916
+ /** Stage a native model decision against its already admitted exact input.
429917
+ * It becomes effective only after the ordinary safe-boundary durable commit. */
429918
+ acceptNativeInteractiveDecision(original) {
429919
+ if (this.aborted || this._abortController.signal.aborted || this._updateRestartCheckpointForced || ["stopping", "stopped", "completed", "failed"].includes(this.interruptionState?.phase ?? ""))
429920
+ return false;
429921
+ let decision2;
429922
+ try {
429923
+ decision2 = this._readNativeInteractiveDecision?.(original);
429924
+ } catch {
429925
+ return false;
429926
+ }
429927
+ if (!decision2 || !["steer", "replace"].includes(decision2.disposition) || decision2.sessionId !== this._sessionId || decision2.runId !== this.currentArtifactRunId() || decision2.taskEpoch !== this._taskEpoch || decision2.ownerGeneration !== (this.interruptionState?.owner.generation ?? 0))
429928
+ return false;
429929
+ const matches = this.pendingSteeringInputs.filter((input3) => input3.inputId === decision2.inputId && input3.taskEpoch === this._taskEpoch && !["cancelled", "superseded", "consumed", "reconciled"].includes(input3.state));
429930
+ if (matches.length !== 1)
429931
+ return false;
429932
+ const input2 = matches[0];
429933
+ if (_createHash("sha256").update(input2.content).digest("hex") !== decision2.inputSha256 || input2.intent === "cancel" || decision2.disposition === "replace" !== (input2.intent === "replace" || input2.intent === "redirect") || decision2.disposition === "replace" && input2.allowTaskReplacement === false)
429934
+ return false;
429935
+ const snapshot2 = Object.freeze({ ...decision2 });
429936
+ this._nativeInteractiveDecisions.set(input2, {
429937
+ original,
429938
+ decision: snapshot2,
429939
+ fingerprint: JSON.stringify(snapshot2),
429940
+ lifecycle: this._interruptionLifecycle,
429941
+ ownerId: this._interruptionOwnerId,
429942
+ sequence: this._inputWaitSequence
429943
+ });
429944
+ return true;
429945
+ }
429946
+ _applyNativeInteractiveDecisionsAtBoundary(messages4, turn) {
429947
+ const active = this._activeSteering;
429948
+ if (!active || this.aborted || this._abortController.signal.aborted || this.taskRequirementInterpretationPending || ["stopping", "stopped", "completed", "failed"].includes(this.interruptionState?.phase ?? ""))
429949
+ return;
429950
+ const inputs = [active.input, ...active.relatedInputs ?? []];
429951
+ const generation = this.interruptionState?.owner.generation ?? 0;
429952
+ for (const input2 of inputs) {
429953
+ const staged = this._nativeInteractiveDecisions.get(input2);
429954
+ if (!staged || staged.lifecycle !== this._interruptionLifecycle || staged.ownerId !== this._interruptionOwnerId || staged.sequence !== this._inputWaitSequence || staged.decision.runId !== this.currentArtifactRunId() || staged.decision.sessionId !== this._sessionId || staged.decision.taskEpoch !== this._taskEpoch || staged.decision.ownerGeneration !== generation || input2.taskEpoch !== this._taskEpoch || ["queued", "acknowledged", "cancelled", "superseded", "consumed"].includes(input2.state) || _createHash("sha256").update(input2.content).digest("hex") !== staged.decision.inputSha256)
429955
+ return;
429956
+ let current6;
429957
+ try {
429958
+ current6 = this._readNativeInteractiveDecision?.(staged.original);
429959
+ } catch {
429960
+ return;
429961
+ }
429962
+ if (!current6 || JSON.stringify(current6) !== staged.fingerprint)
429963
+ return;
429964
+ }
429965
+ if (this._commitSteeringReconciliation({
429966
+ inputId: active.input.inputId,
429967
+ status: "applied",
429968
+ taskDisposition: "continue",
429969
+ changedConstraints: [],
429970
+ revisedNextAction: this._taskState.nextAction ?? ""
429971
+ }, turn - 1, messages4)) {
429972
+ for (const input2 of inputs)
429973
+ this._nativeInteractiveDecisions.delete(input2);
429974
+ }
429975
+ }
429674
429976
  /** A small communication snapshot, independent of atomic tool completion.
429675
429977
  * The full input remains in the ordinary steering and reconciliation path. */
429676
429978
  captureSteeringReply(inputId) {
@@ -429694,7 +429996,7 @@ ${text20.slice(-Math.max(1, Math.floor(size * 0.3)))}`;
429694
429996
  return result;
429695
429997
  };
429696
429998
  const recent = (this._interruptionMessages ?? []).filter((message3) => message3.role !== "system" && typeof message3.content === "string").slice(-4).map((message3) => ({ role: message3.role, text: excerpt(partitionTypedModelOutput(message3.content).visibleText, 600) }));
429697
- return {
429999
+ const packet2 = {
429698
430000
  inputId,
429699
430001
  runId: this.currentArtifactRunId(),
429700
430002
  taskEpoch: this._taskEpoch,
@@ -429715,10 +430017,12 @@ ${text20.slice(-Math.max(1, Math.floor(size * 0.3)))}`;
429715
430017
  }) }
429716
430018
  ]
429717
430019
  };
430020
+ this._issuedSteeringReplyPackets.set(packet2, JSON.stringify(packet2));
430021
+ return packet2;
429718
430022
  }
429719
430023
  isSteeringReplyCurrent(packet2) {
429720
430024
  const pending = this._currentSteeringReplyPending(), state2 = this.interruptionState;
429721
- return !this.aborted && !this._updateRestartCheckpointForced && !this._updateAbortController.signal.aborted && !!pending && pending.input.inputId === packet2.inputId && this.currentArtifactRunId() === packet2.runId && this._taskEpoch === packet2.taskEpoch && (state2?.owner.generation ?? 0) === packet2.ownerGeneration && (!state2 || !["stopping", "stopped", "failed", "completed"].includes(state2.phase)) && _createHash("sha256").update(pending.input.content).digest("hex") === packet2.inputSha256;
430025
+ return !!packet2 && this._issuedSteeringReplyPackets.get(packet2) === JSON.stringify(packet2) && !this.aborted && !this._updateRestartCheckpointForced && !this._updateAbortController.signal.aborted && !!pending && pending.input.inputId === packet2.inputId && this.currentArtifactRunId() === packet2.runId && this._taskEpoch === packet2.taskEpoch && (state2?.owner.generation ?? 0) === packet2.ownerGeneration && (!state2 || !["stopping", "stopped", "failed", "completed"].includes(state2.phase)) && _createHash("sha256").update(pending.input.content).digest("hex") === packet2.inputSha256;
429722
430026
  }
429723
430027
  /** Record real visible prose without satisfying the internal scope gate. */
429724
430028
  recordSteeringReply(packet2, content) {
@@ -430754,10 +431058,29 @@ The previous reviewer response was structurally invalid: ${firstReason}. Return
430754
431058
  }
430755
431059
  return record11.content;
430756
431060
  }
431061
+ /** Retain source/goal/effect history, revoke only this owner's live controls. */
431062
+ _revokeInteractiveControlForStop() {
431063
+ ++this._inputWaitSequence;
431064
+ this._inputWaitPauseReceipt = null;
431065
+ this._inputWaitPaused = false;
431066
+ this._paused = false;
431067
+ this._nativeInteractiveDecisions.clear();
431068
+ this._pendingSteeringReply = null;
431069
+ this._steeringReplyTurn = null;
431070
+ this._pendingSteeringPreemption = null;
431071
+ this._preparedTaskScopeBoundary = null;
431072
+ this._activeSteering = null;
431073
+ this._steeringResolutionNotice = null;
431074
+ for (const input2 of this.pendingSteeringInputs) {
431075
+ if (!["reconciled", "consumed", "superseded", "cancelled"].includes(input2.state))
431076
+ input2.state = "cancelled";
431077
+ }
431078
+ }
430757
431079
  /** Abort the current task run through the generation-bound stop lineage. */
430758
431080
  abort() {
430759
431081
  if (this._updateRestartCheckpointForced) {
430760
431082
  this.aborted = true;
431083
+ this._revokeInteractiveControlForStop();
430761
431084
  this._abortController.abort();
430762
431085
  this._turnAbortController.abort();
430763
431086
  this._releasePauseWaiters();
@@ -430767,6 +431090,7 @@ The previous reviewer response was structurally invalid: ${firstReason}. Return
430767
431090
  if (transition && !transition.accepted)
430768
431091
  return transition;
430769
431092
  this.aborted = true;
431093
+ this._revokeInteractiveControlForStop();
430770
431094
  this._clearCorpusPreparedReads();
430771
431095
  this._pendingStreamAssistantText = null;
430772
431096
  this._pendingPausedStreamTerminal = null;
@@ -430818,6 +431142,170 @@ The previous reviewer response was structurally invalid: ${firstReason}. Return
430818
431142
  get activeRunId() {
430819
431143
  return this._activeRunId;
430820
431144
  }
431145
+ _nativeProviderDeliveryScope() {
431146
+ return recoveryMaterialDigest({
431147
+ binding: this._requestToolBinding(),
431148
+ expected: this.options.expectedOutcomeContract,
431149
+ contract: this._taskObjectiveContract,
431150
+ steering: this.pendingSteeringInputs,
431151
+ generation: this._interruptionLifecycle?.snapshot().owner.generation
431152
+ });
431153
+ }
431154
+ _stageNativeProviderDelivery(input2) {
431155
+ if (!this._readNativeProviderDeliveryAck || !this._completionLedger || this._completionLedger.terminal || _fsExistsSync(completionFinalizationPath(this.omniusStateDir(), this.currentArtifactRunId())))
431156
+ return;
431157
+ const snapshot2 = this.getTaskExecutionSnapshot(), physical2 = this.getTaskEffectEvidence();
431158
+ if (!snapshot2)
431159
+ return;
431160
+ const ticket = Object.freeze({
431161
+ schema: "omnius.native-pending-provider-delivery.v1",
431162
+ id: `provider-pending:${crypto.randomUUID()}`,
431163
+ sessionId: this._sessionId,
431164
+ runId: this.currentArtifactRunId(),
431165
+ taskEpoch: this._taskEpoch,
431166
+ ownerId: this._interruptionOwnerId,
431167
+ ownerGeneration: this._interruptionLifecycle?.snapshot().owner.generation ?? 0,
431168
+ toolCallId: input2.toolCallId,
431169
+ candidateSha256: _createHash("sha256").update(input2.candidate).digest("hex"),
431170
+ scopeSha256: this._nativeProviderDeliveryScope()
431171
+ });
431172
+ const record11 = Object.freeze({
431173
+ ticket,
431174
+ candidate: input2.candidate,
431175
+ evidenceSnapshotSha256: snapshot2.evidenceSnapshotSha256,
431176
+ effectStateSha256: physical2.stateSha256,
431177
+ readinessHash: input2.completionReadiness.readinessHash
431178
+ });
431179
+ this._completionLedger.pendingProviderDelivery = structuredClone(record11);
431180
+ if (!this._saveCompletionLedgerSafe() || !this._objectiveLedgerPath) {
431181
+ throw new NativeProviderDeliveryHoldError("pending_delivery_storage_unavailable", this.authoritativeWorkingDirectory(), this._sessionId, this.currentArtifactRunId(), this._taskEpoch, this._objectiveLedgerPath ?? void 0);
431182
+ }
431183
+ this.#pendingProviderDelivery = {
431184
+ ticket,
431185
+ record: record11,
431186
+ backend: this.backend,
431187
+ capabilities: this._captureRequestToolCapabilities(),
431188
+ toolNames: [...this.tools].filter(([name, tool]) => this.isToolAllowedByProfile(name, tool.aliases)).map(([name]) => name),
431189
+ evidenceSha256: snapshot2.evidenceSnapshotSha256,
431190
+ effectSha256: physical2.stateSha256,
431191
+ recordDigests: /* @__PURE__ */ new Set([recoveryMaterialDigest(record11)]),
431192
+ trajectory: input2.trajectory
431193
+ };
431194
+ return ticket;
431195
+ }
431196
+ /** Original hot custody only. A cold/JSON ticket cannot reissue delivery or completion. */
431197
+ isCurrentPendingProviderDelivery(original) {
431198
+ const state2 = this.#pendingProviderDelivery;
431199
+ if (!state2 || original !== state2.ticket || state2.committed || this.aborted || this._abortController.signal.aborted || this.taskRequirementInterpretationPending || this._hasUnresolvedCurrentSteeringInputs() || this.backend !== state2.backend || state2.ticket.scopeSha256 !== this._nativeProviderDeliveryScope() || this._completionLedger?.terminal || !this._objectiveLedgerPath || _fsExistsSync(completionFinalizationPath(this.omniusStateDir(), state2.ticket.runId)))
431200
+ return false;
431201
+ const lifecycle = this._interruptionLifecycle?.snapshot();
431202
+ if (lifecycle && (lifecycle.phase !== "running" || lifecycle.pendingAcknowledgements.some((item) => item.status === "pending") || lifecycle.ambiguousEffects.some((item) => item.state === "unknown_after_interrupt")))
431203
+ return false;
431204
+ try {
431205
+ const allowedNames = [...this.tools].filter(([name, tool]) => this.isToolAllowedByProfile(name, tool.aliases)).map(([name]) => name);
431206
+ if (recoveryMaterialDigest(allowedNames) !== recoveryMaterialDigest(state2.toolNames) || this._requestToolCapabilityProblem(state2.capabilities, "task_complete"))
431207
+ return false;
431208
+ const persisted = JSON.parse(_fsReadFileSync(this._objectiveLedgerPath, "utf8"));
431209
+ if (persisted.runId !== state2.ticket.runId || persisted.taskEpoch !== state2.ticket.taskEpoch || persisted.terminal || !persisted.pendingProviderDelivery || !state2.recordDigests.has(recoveryMaterialDigest(persisted.pendingProviderDelivery)) || recoveryMaterialDigest(this._completionLedger?.pendingProviderDelivery) !== recoveryMaterialDigest(state2.record))
431210
+ return false;
431211
+ const current6 = this.getTaskExecutionSnapshot();
431212
+ return !!current6 && current6.evidenceSnapshotSha256 === state2.evidenceSha256 && this.getTaskEffectEvidence().stateSha256 === state2.effectSha256;
431213
+ } catch {
431214
+ return false;
431215
+ }
431216
+ }
431217
+ /** No model/tool invocation. The pinned native host issuer proves the whole delivered presentation. */
431218
+ async acknowledgePendingProviderDelivery(pendingOriginal, ackOriginal) {
431219
+ const state2 = this.#pendingProviderDelivery;
431220
+ if (!state2 || pendingOriginal !== state2.ticket || !ackOriginal || typeof ackOriginal !== "object")
431221
+ return null;
431222
+ if (state2.committed)
431223
+ return state2.ackOriginal === ackOriginal ? state2.committed : null;
431224
+ if (!this.isCurrentPendingProviderDelivery(pendingOriginal) || !this._readNativeProviderDeliveryAck)
431225
+ return null;
431226
+ try {
431227
+ const acknowledgement = this._readNativeProviderDeliveryAck(ackOriginal, state2.ticket);
431228
+ if (!acknowledgement || acknowledgement.pending !== state2.ticket || acknowledgement.candidateSha256 !== state2.ticket.candidateSha256 || !/^[a-f0-9]{64}$/.test(acknowledgement.presentationSha256) || typeof acknowledgement.assertCurrent !== "function" || !Array.isArray(acknowledgement.receipts) || !acknowledgement.receipts.length || acknowledgement.receipts.length > 512 || state2.ackOriginal !== void 0 && state2.ackOriginal !== ackOriginal)
431229
+ return null;
431230
+ const receipts = acknowledgement.receipts.map(normalizeCompletionDeliveryReceipt);
431231
+ if (receipts.some((receipt) => !receipt || receipt.provider.toLowerCase() !== "telegram") || new Set(receipts.map((receipt) => `${receipt.provider}\0${receipt.receiptId}`)).size !== receipts.length)
431232
+ return null;
431233
+ const acknowledged = { presentationSha256: acknowledgement.presentationSha256, receipts };
431234
+ if (state2.record.acknowledged && recoveryMaterialDigest(state2.record.acknowledged) !== recoveryMaterialDigest(acknowledged))
431235
+ return null;
431236
+ if (acknowledgement.assertCurrent() !== void 0 || !this.isCurrentPendingProviderDelivery(pendingOriginal))
431237
+ return null;
431238
+ if (state2.ackOriginal === void 0) {
431239
+ state2.ackOriginal = ackOriginal;
431240
+ state2.record = Object.freeze({ ...state2.record, acknowledged: Object.freeze({
431241
+ ...acknowledged,
431242
+ receipts: Object.freeze(acknowledged.receipts.map((receipt) => Object.freeze(receipt)))
431243
+ }) });
431244
+ state2.recordDigests.add(recoveryMaterialDigest(state2.record));
431245
+ this._completionLedger.pendingProviderDelivery = structuredClone(state2.record);
431246
+ for (const receipt of acknowledged.receipts) {
431247
+ this._recordCompletionDeliveryReceipt(receipt);
431248
+ this._settleObjectiveToolResult({
431249
+ toolName: "telegram",
431250
+ callId: `${state2.ticket.id}:${receipt.receiptId}`,
431251
+ argsKey: state2.ticket.candidateSha256,
431252
+ args: {
431253
+ candidateSha256: state2.ticket.candidateSha256,
431254
+ presentationSha256: acknowledged.presentationSha256
431255
+ },
431256
+ result: {
431257
+ success: true,
431258
+ output: `Provider acknowledged the exact complete reply: ${receipt.receiptId}`,
431259
+ completionDeliveryReceipt: receipt,
431260
+ completionVisibleResponse: true,
431261
+ objectiveEvidenceKinds: ["delivery", "visible_response"]
431262
+ }
431263
+ });
431264
+ }
431265
+ this._taskExecutionSnapshot = null;
431266
+ state2.evidenceSha256 = this.getTaskExecutionSnapshot().evidenceSnapshotSha256;
431267
+ state2.effectSha256 = this.getTaskEffectEvidence().stateSha256;
431268
+ }
431269
+ if (!this._saveCompletionLedgerSafe() || acknowledgement.assertCurrent() !== void 0 || !this.isCurrentPendingProviderDelivery(pendingOriginal))
431270
+ return null;
431271
+ const expected = this._currentExpectedOutcomeAssessment();
431272
+ const readiness = this._completionReadinessSnapshot({ requestedTerminalStatus: "completed", expectedOutcomeAssessment: expected });
431273
+ const frontier = this.getTaskExecutionSnapshot()?.frontier;
431274
+ if (expected && !expected.satisfied || !readiness.successfulCompletionAllowed || !frontier || frontier.openCriterionIds.length || frontier.blockedCriterionIds.length)
431275
+ return null;
431276
+ acknowledgement.assertCurrent();
431277
+ if (!this.isCurrentPendingProviderDelivery(pendingOriginal))
431278
+ return null;
431279
+ const committed = this._commitTerminalFinalization({
431280
+ status: "completed",
431281
+ summary: state2.record.candidate,
431282
+ expectedOutcomeAssessment: expected,
431283
+ completionReadiness: readiness,
431284
+ trajectoryPayload: { ...state2.trajectory, outcome: "pass", providerDelivery: acknowledged }
431285
+ });
431286
+ if (!committed) {
431287
+ if (!_fsExistsSync(completionFinalizationPath(this.omniusStateDir(), state2.ticket.runId)) && this._completionLedger) {
431288
+ delete this._completionLedger.terminal;
431289
+ this._saveCompletionLedgerSafe();
431290
+ }
431291
+ return null;
431292
+ }
431293
+ this._completionIncompleteVerification = null;
431294
+ state2.committed = committed;
431295
+ const archive = state2.afterCommit;
431296
+ state2.afterCommit = void 0;
431297
+ if (archive) {
431298
+ try {
431299
+ await archive(committed, readiness);
431300
+ } catch {
431301
+ this._taskProcedureExperience = null;
431302
+ }
431303
+ }
431304
+ return committed;
431305
+ } catch {
431306
+ return null;
431307
+ }
431308
+ }
430821
431309
  /** Detached current-owner evidence for frontend preparation decisions. */
430822
431310
  getCurrentCompletionLedgerSnapshot() {
430823
431311
  const ledger = this._completionLedger;
@@ -431919,6 +432407,7 @@ issuer=${issuerRunId}; evidence=${receipt.id}; raw_ref=${receipt.rawRef ?? "not
431919
432407
  if (record11)
431920
432408
  this._applyNativeTaskRequirementAmendmentAtBoundary(record11);
431921
432409
  }
432410
+ this._applyNativeInteractiveDecisionsAtBoundary(messages4, turn);
431922
432411
  for (const record11 of this.pendingSteeringInputs)
431923
432412
  appendReply(record11);
431924
432413
  while (this.pendingUserMessages.length > 0) {
@@ -432566,6 +433055,12 @@ ${exactSourcesPresent ? exactSourcePointer(related) : related.content}`),
432566
433055
  }
432567
433056
  if (!selected)
432568
433057
  return false;
433058
+ return this._commitSteeringReconciliation(selected, turn, messages4);
433059
+ }
433060
+ _commitSteeringReconciliation(selected, turn, messages4) {
433061
+ const active = this._activeSteering;
433062
+ if (!active || this.aborted || this._abortController.signal.aborted || active.input.taskEpoch !== this._taskEpoch)
433063
+ return false;
432569
433064
  if (selected.status !== "needs_clarification" && !selected.taskDisposition)
432570
433065
  return false;
432571
433066
  if (active.reconciliation?.taskDisposition === "resolve_after_evidence" && selected.status !== "needs_clarification" && active.evidence?.calls.some((call3) => call3.state !== "completed"))
@@ -432885,7 +433380,7 @@ Only the exact pending declared read tickets may execute. Old-plan mutations and
432885
433380
  while (!this.aborted && sequence === this._inputWaitSequence && lifecycle === this._interruptionLifecycle && runId === this.currentArtifactRunId() && lifecycle?.snapshot().phase === "pausing") {
432886
433381
  await new Promise((resolve73) => setTimeout(resolve73, 20));
432887
433382
  }
432888
- if (sequence !== this._inputWaitSequence || lifecycle !== this._interruptionLifecycle || runId !== this.currentArtifactRunId()) {
433383
+ if (this.aborted || this._abortController.signal.aborted || sequence !== this._inputWaitSequence || lifecycle !== this._interruptionLifecycle || runId !== this.currentArtifactRunId()) {
432889
433384
  return pauseReceipt ? {
432890
433385
  ...pauseReceipt,
432891
433386
  accepted: false,
@@ -432904,7 +433399,7 @@ Only the exact pending declared read tickets may execute. Old-plan mutations and
432904
433399
  * Resume a paused task. The run loop continues from where it left off.
432905
433400
  */
432906
433401
  resume() {
432907
- if (this._updateRestartCheckpointForced) {
433402
+ if (this.aborted || this._abortController.signal.aborted || this._updateRestartCheckpointForced) {
432908
433403
  const state2 = this.interruptionState;
432909
433404
  return state2 ? {
432910
433405
  accepted: false,
@@ -432917,10 +433412,10 @@ Only the exact pending declared read tickets may execute. Old-plan mutations and
432917
433412
  runId: state2.runId,
432918
433413
  taskEpoch: state2.taskEpoch,
432919
433414
  ownerGeneration: state2.owner.generation,
432920
- resumable: true,
433415
+ resumable: state2.resumable,
432921
433416
  pendingAcknowledgements: state2.pendingAcknowledgements.filter((item) => item.status === "pending").length,
432922
433417
  unresolvedAmbiguousEffects: state2.ambiguousEffects.filter((item) => item.state === "unknown_after_interrupt").length,
432923
- reason: "This instance was retired for update. Restore its durable checkpoint in the replacement process."
433418
+ reason: "This instance was stopped or retired. An input finalizer cannot resume its owner."
432924
433419
  } : null;
432925
433420
  }
432926
433421
  const transition = this._interruptionLifecycle?.requestResume(this._interruptionLifecycle.snapshot().owner, "resume requested by active owner") ?? null;
@@ -436018,6 +436513,9 @@ Respond with the assessment and take the selected evidence-backed action.`;
436018
436513
  }
436019
436514
  /** Run a task through the agentic loop; a host session may not re-enter it. */
436020
436515
  async run(task, context, actualUserGoal) {
436516
+ if (this.#pendingProviderDelivery && !this.#pendingProviderDelivery.committed)
436517
+ throw new Error("native_provider_delivery_pending");
436518
+ this.#pendingProviderDelivery = void 0;
436021
436519
  if (this._updateRestartCheckpointForced)
436022
436520
  throw new Error("This runner was retired for update; restore its durable checkpoint in a replacement process.");
436023
436521
  if (this._exclusiveTaskOwner || this._activeDirectToolCalls)
@@ -436289,6 +436787,10 @@ Respond with the assessment and take the selected evidence-backed action.`;
436289
436787
  }
436290
436788
  if (this._objectiveResumeSeed && (this._objectiveResumeSeed.runId !== recovered.runId || this._objectiveResumeSeed.taskEpoch !== recovered.taskEpoch))
436291
436789
  throw new Error("paused_run_checkpoint_ledger_identity_mismatch");
436790
+ const pendingDeliveryTicket = this._objectiveResumeSeed?.pendingProviderDelivery?.ticket;
436791
+ if (pendingDeliveryTicket?.runId === recovered.runId && pendingDeliveryTicket.taskEpoch === recovered.taskEpoch) {
436792
+ throw new NativeProviderDeliveryHoldError("cold_pending_delivery_unavailable", this.authoritativeWorkingDirectory(), this._sessionId, recovered.runId, recovered.taskEpoch, _pathJoin(this.omniusStateDir(), "completion-ledgers", `${recovered.runId}.json`));
436793
+ }
436292
436794
  const resumed = lifecycle.requestResume(recovered.owner, "explicit restart recovery requested");
436293
436795
  if (!resumed.accepted)
436294
436796
  throw new Error(resumed.reason);
@@ -436761,6 +437263,10 @@ Respond with the assessment and take the selected evidence-backed action.`;
436761
437263
  this._completionContract = null;
436762
437264
  this._completionLedger = null;
436763
437265
  }
437266
+ const coldPendingDelivery = this._completionLedger?.pendingProviderDelivery?.ticket;
437267
+ if (coldPendingDelivery && coldPendingDelivery.runId === this.currentArtifactRunId() && this._completionLedger?.runId === coldPendingDelivery.runId && coldPendingDelivery.taskEpoch === this._taskEpoch) {
437268
+ throw new NativeProviderDeliveryHoldError("cold_pending_delivery_unavailable", this.authoritativeWorkingDirectory(), this._sessionId, this.currentArtifactRunId(), this._taskEpoch, this._objectiveLedgerPath ?? void 0);
437269
+ }
436764
437270
  if (this._taskObjectiveContinuationRecord)
436765
437271
  await this._restoreTaskObjectiveContinuation();
436766
437272
  this._reconcileRetiredLegacyOperations(recovered);
@@ -443183,7 +443689,11 @@ ${memoryLines.join("\n")}`
443183
443689
  this._stripLegacyControlMessages(requestMessages2);
443184
443690
  this._injectFeatureWorkflowAuthority(requestMessages2);
443185
443691
  {
443186
- const observations = this._buildRecentActionGroundTruth(turn);
443692
+ const observations = this._buildRecentActionGroundTruth(turn, (acceptedGoal) => requestMessages2.push({
443693
+ role: "system",
443694
+ content: renderModelFacingAcceptedGoal(acceptedGoal),
443695
+ requiredSourceEvidence: { schema: "omnius.required-source-evidence.v1", scope: `${this.currentArtifactRunId()}:${this._taskEpoch}:accepted-native-goal` }
443696
+ }));
443187
443697
  if (observations)
443188
443698
  requestMessages2.push({
443189
443699
  role: "system",
@@ -444766,7 +445276,11 @@ ${this.options.maxTurns && this.options.maxTurns > 0 ? `You have ${this.options.
444766
445276
  this._stripLegacyControlMessages(modelFacingMessages);
444767
445277
  this._injectFeatureWorkflowAuthority(modelFacingMessages);
444768
445278
  {
444769
- const observations = this._buildRecentActionGroundTruth(turn);
445279
+ const observations = this._buildRecentActionGroundTruth(turn, (acceptedGoal) => modelFacingMessages.push({
445280
+ role: "system",
445281
+ content: renderModelFacingAcceptedGoal(acceptedGoal),
445282
+ requiredSourceEvidence: { schema: "omnius.required-source-evidence.v1", scope: `${this.currentArtifactRunId()}:${this._taskEpoch}:accepted-native-goal` }
445283
+ }));
444770
445284
  if (observations)
444771
445285
  modelFacingMessages.push({
444772
445286
  role: "system",
@@ -445511,6 +446025,25 @@ ${terminalFeedback.slice(0, 4e3)}`,
445511
446025
  const interruptionPhase = this._interruptionLifecycle?.snapshot().phase;
445512
446026
  const interruptionStopped = this.aborted || interruptionPhase === "stopping" || interruptionPhase === "stopped";
445513
446027
  let terminalReceipt = null;
446028
+ let pendingProviderDelivery;
446029
+ if (!interruptionStopped && !declaredDegradedCompletion && this._readNativeProviderDeliveryAck && acceptedCompletionReply && (providerDeliveryIsOnlyRemainingEffect || providerDeliveryEffectsArePending)) {
446030
+ pendingProviderDelivery = this._stageNativeProviderDelivery({
446031
+ candidate: acceptedCompletionReply.text,
446032
+ toolCallId: acceptedCompletionReply.toolCallId,
446033
+ completionReadiness,
446034
+ trajectory: {
446035
+ task: persistentTaskGoal,
446036
+ outcome: "awaiting_provider_ack",
446037
+ turns: messages4.filter((message3) => message3.role === "assistant").length,
446038
+ totalToolCalls: toolCallCount,
446039
+ totalTokens,
446040
+ filesModified: [...this._taskState.modifiedFiles.keys()],
446041
+ durationMs
446042
+ }
446043
+ });
446044
+ if (pendingProviderDelivery)
446045
+ summary2 = "Accepted task result awaits acknowledgement of the complete provider reply.";
446046
+ }
445514
446047
  if (interruptionStopped) {
445515
446048
  completed = false;
445516
446049
  runStatus = "incomplete";
@@ -445519,7 +446052,7 @@ ${terminalFeedback.slice(0, 4e3)}`,
445519
446052
  if (stopped && !stopped.accepted) {
445520
446053
  this._interruptionLifecycle?.forceStopAfterTimeout("runner terminated after cancellation acknowledgement timeout");
445521
446054
  }
445522
- } else {
446055
+ } else if (!pendingProviderDelivery) {
445523
446056
  terminalReceipt = this._commitTerminalFinalization({
445524
446057
  status: runStatus,
445525
446058
  summary: summary2,
@@ -445547,7 +446080,7 @@ ${terminalFeedback.slice(0, 4e3)}`,
445547
446080
  }
445548
446081
  });
445549
446082
  }
445550
- if (!terminalReceipt && !interruptionStopped) {
446083
+ if (!terminalReceipt && !interruptionStopped && !pendingProviderDelivery) {
445551
446084
  completed = false;
445552
446085
  runStatus = "incomplete_verification";
445553
446086
  const detail = this._terminalInterruptionFailure ?? "Terminal state could not be durably committed; completion was not accepted.";
@@ -445569,7 +446102,7 @@ ${detail}` : detail;
445569
446102
  timestamp: timestamp7
445570
446103
  });
445571
446104
  }
445572
- if (!interruptionStopped) {
446105
+ if (!interruptionStopped && !pendingProviderDelivery) {
445573
446106
  if (terminalReceipt && runStatus === "awaiting_input") {
445574
446107
  const lifecycle2 = this._interruptionLifecycle;
445575
446108
  if (lifecycle2) {
@@ -445718,7 +446251,9 @@ ${detail}` : detail;
445718
446251
  };
445719
446252
  const provPath = path13.join(provenanceDir, `${this._sessionId}.json`);
445720
446253
  fs4.writeFileSync(provPath, JSON.stringify(provenanceGraph, null, 2));
445721
- if (noteScope2 && terminalReceipt && !this.aborted && runStatus !== "awaiting_input") {
446254
+ const archiveProcedure = async (actualTerminal, actualReadiness) => {
446255
+ if (!noteScope2 || this.aborted || actualTerminal.status === "awaiting_input")
446256
+ return;
445722
446257
  try {
445723
446258
  const historicalContext = buildHistoricalProcedureContext({
445724
446259
  runtimeFingerprint: this.options.ownedInferenceWaitRuntimeFingerprint,
@@ -445727,12 +446262,12 @@ ${detail}` : detail;
445727
446262
  });
445728
446263
  const traceBytes = Buffer.from(JSON.stringify({
445729
446264
  schema: "omnius.task-procedure-trace.v1",
445730
- runId: terminalReceipt.runId,
446265
+ runId: actualTerminal.runId,
445731
446266
  taskEpoch: this._taskEpoch,
445732
446267
  scope: noteScope2,
445733
446268
  historicalContext,
445734
446269
  task: this.sanitizeHistoricalProcedureText(persistentTaskGoal),
445735
- outcome: runStatus,
446270
+ outcome: actualTerminal.status,
445736
446271
  actions: toolCallLog.map((entry) => ({
445737
446272
  tool: entry.name,
445738
446273
  success: entry.success === true,
@@ -445740,19 +446275,19 @@ ${detail}` : detail;
445740
446275
  turn: entry.turn
445741
446276
  }))
445742
446277
  }, null, 2));
445743
- const identity10 = _createHash("sha256").update(JSON.stringify([this._sessionId, terminalReceipt.runId, this._taskEpoch])).digest("hex");
446278
+ const identity10 = _createHash("sha256").update(JSON.stringify([this._sessionId, actualTerminal.runId, this._taskEpoch])).digest("hex");
445744
446279
  const immutablePath = path13.join(provenanceDir, `procedure-${identity10}.json`);
445745
446280
  if (fs4.existsSync(immutablePath)) {
445746
446281
  if (!fs4.readFileSync(immutablePath).equals(traceBytes))
445747
446282
  throw new Error("Historical procedure trace identity conflict");
445748
446283
  } else
445749
446284
  fs4.writeFileSync(immutablePath, traceBytes, { flag: "wx", mode: 384 });
445750
- const terminalPath = completionFinalizationPath(stateDir, terminalReceipt.runId);
446285
+ const terminalPath = completionFinalizationPath(stateDir, actualTerminal.runId);
445751
446286
  const actions = toolCallLog.flatMap((entry, traceIndex) => entry.success === true && entry.arguments && !["task_complete", "todo_write", "todo_read", "memory_write", "progress"].includes(entry.name) ? [{ traceIndex, tool: entry.name, success: true, argumentKeys: Object.keys(entry.arguments), arguments: entry.arguments }] : []);
445752
446287
  if (actions.length) {
445753
446288
  this._taskProcedureExperience = {
445754
446289
  scope: noteScope2,
445755
- runId: terminalReceipt.runId,
446290
+ runId: actualTerminal.runId,
445756
446291
  taskEpoch: this._taskEpoch,
445757
446292
  goal: persistentTaskGoal,
445758
446293
  result: acceptedCompletionReply?.text || summary2,
@@ -445768,7 +446303,7 @@ ${detail}` : detail;
445768
446303
  path: terminalPath,
445769
446304
  sha256: _createHash("sha256").update(fs4.readFileSync(terminalPath)).digest("hex")
445770
446305
  } },
445771
- completionReadiness
446306
+ completionReadiness: actualReadiness
445772
446307
  };
445773
446308
  if (!noteScope2.surface.startsWith("telegram") && completed && successfulCompletionAdmitted) {
445774
446309
  const candidate = this.getTaskProcedureExperience();
@@ -445790,7 +446325,19 @@ ${detail}` : detail;
445790
446325
  }
445791
446326
  }
445792
446327
  } catch {
446328
+ this._taskProcedureExperience = null;
446329
+ this.emit({
446330
+ type: "status",
446331
+ visibility: "telemetry",
446332
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
446333
+ content: "Successful procedure archive unavailable; no reusable case was issued."
446334
+ });
445793
446335
  }
446336
+ };
446337
+ if (noteScope2 && pendingProviderDelivery && this.#pendingProviderDelivery) {
446338
+ this.#pendingProviderDelivery.afterCommit = archiveProcedure;
446339
+ } else if (noteScope2 && terminalReceipt && !this.aborted && runStatus !== "awaiting_input") {
446340
+ await archiveProcedure(terminalReceipt, completionReadiness);
445794
446341
  }
445795
446342
  if (noteScope2 && runStatus !== "awaiting_input" && !providerDeliveryEffectsArePending) {
445796
446343
  try {
@@ -446511,8 +447058,10 @@ Result: ${summary2.slice(0, 330)}`,
446511
447058
  const missingRetainedWorkEffects = expectedOutcomeAssessment?.missingEffects.filter((effect) => effect !== "visible_response" && effect !== "delivery") ?? [];
446512
447059
  const retainedWorkReplyIsCurrent = Boolean(this._isTelegramSurface() && retainedWorkCompletionReply && terminalReceipt && !completed && !this.aborted && !this._pendingSteeringPreemption && !terminalReceipt.runtimeFailure && !this.taskRequirementInterpretationPending && !this._hasUnresolvedCurrentSteeringInputs() && !declaredDegradedCompletion && missingRetainedWorkEffects.length > 0 && retainedWorkCompletionReply.runId === this.currentArtifactRunId() && retainedWorkCompletionReply.taskEpoch === this._taskEpoch && retainedWorkCompletionReply.taskEpoch === terminalReceipt.taskEpoch && retainedWorkCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope() && retainedWorkCompletionReply.nativePolicy === currentTelegramCompletionNativePolicy());
446513
447060
  const declaredIncompleteReplyIsCurrent = Boolean((acceptedTaskCompleteStatus === "incomplete" || acceptedTaskCompleteStatus === "needs_input" && !(this._objectiveNeedsInput && !this._objectiveNeedsInput.resumedAtIso)) && runStatus === "incomplete" && !this.aborted && !terminalReceipt?.runtimeFailure && terminalReceipt?.status === "incomplete" && acceptedCompletionReply?.source === "task_complete_user_reply" && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope());
447061
+ const deliveryAuthority = terminalReceipt ?? pendingProviderDelivery;
446514
447062
  return {
446515
447063
  status: runStatus,
447064
+ ...pendingProviderDelivery ? { pendingProviderDelivery } : {},
446516
447065
  completed,
446517
447066
  turns: messages4.filter((m) => m.role === "assistant").length,
446518
447067
  toolCalls: toolCallCount,
@@ -446529,12 +447078,12 @@ Result: ${summary2.slice(0, 330)}`,
446529
447078
  runId: terminalReceipt.runId,
446530
447079
  terminalReceiptId: terminalReceipt.id
446531
447080
  } : void 0,
446532
- deliverableUserReply: terminalReceipt && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text" || acceptedCompletionReply?.source === "host_reviewed_model_visible_text") && (acceptedCompletionReply.source !== "host_reviewed_model_visible_text" || providerDeliveryIsOnlyRemainingEffect || providerDeliveryEffectsArePending) && acceptedCompletionReply.taskEpoch === terminalReceipt.taskEpoch && (declaredIncompleteReplyIsCurrent || !declaredDegradedCompletion && (providerDeliveryEffectsArePending || completionReadinessAllowsExpectedEffectReply(completionReadiness) && (providerDeliveryIsOnlyRemainingEffect || !completionHadIndependentVerificationFailure))) ? {
447081
+ deliverableUserReply: deliveryAuthority && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text" || acceptedCompletionReply?.source === "host_reviewed_model_visible_text") && (acceptedCompletionReply.source !== "host_reviewed_model_visible_text" || providerDeliveryIsOnlyRemainingEffect || providerDeliveryEffectsArePending) && acceptedCompletionReply.taskEpoch === deliveryAuthority.taskEpoch && (declaredIncompleteReplyIsCurrent || !declaredDegradedCompletion && (providerDeliveryEffectsArePending || completionReadinessAllowsExpectedEffectReply(completionReadiness) && (providerDeliveryIsOnlyRemainingEffect || !completionHadIndependentVerificationFailure))) ? {
446533
447082
  text: acceptedCompletionReply.text,
446534
447083
  toolCallId: acceptedCompletionReply.toolCallId,
446535
447084
  taskEpoch: acceptedCompletionReply.taskEpoch,
446536
- runId: terminalReceipt.runId,
446537
- terminalReceiptId: terminalReceipt.id,
447085
+ runId: deliveryAuthority.runId,
447086
+ terminalReceiptId: deliveryAuthority.id,
446538
447087
  authority: declaredIncompleteReplyIsCurrent ? "declared_incomplete" : providerDeliveryIsOnlyRemainingEffect || providerDeliveryEffectsArePending ? "provider_delivery_pending" : "router_expected_effect_mismatch",
446539
447088
  ...declaredIncompleteReplyIsCurrent ? {
446540
447089
  declaredStatus: acceptedTaskCompleteStatus === "needs_input" ? "needs_input" : "incomplete"
@@ -450045,7 +450594,7 @@ ${trimmedNew}`;
450045
450594
  * Ephemeral facts from this run. Replaces prior host observations without
450046
450595
  * changing user messages, assistant history, or linked tool results.
450047
450596
  */
450048
- _buildRecentActionGroundTruth(_turn) {
450597
+ _buildRecentActionGroundTruth(_turn, onAcceptedGoal) {
450049
450598
  const verifier = this._worldFacts.lastTest;
450050
450599
  const snapshot2 = this.getTaskExecutionSnapshot();
450051
450600
  const operationQualifiedReturns = this._recentToolOutcomes.filter((outcome2) => outcome2.nativeOperation && this._nativeOperationProgressIsCurrent(outcome2.nativeOperation) && readIssuedNativeOperationObservation(outcome2.nativeOperation)).length;
@@ -450098,7 +450647,7 @@ ${trimmedNew}`;
450098
450647
  description: criterion.description,
450099
450648
  status: criterion.status
450100
450649
  }))
450101
- }) ?? "";
450650
+ }, onAcceptedGoal ? { onAcceptedGoal } : void 0) ?? "";
450102
450651
  }
450103
450652
  _nativeShellProgressIsCurrent(observation) {
450104
450653
  const scope2 = observation.scope;
@@ -450128,7 +450677,8 @@ ${trimmedNew}`;
450128
450677
  returnedErrorCount: 0,
450129
450678
  distinctNativeResultCount: 0,
450130
450679
  partialOrUnavailableCount: 0,
450131
- hashes: /* @__PURE__ */ new Set()
450680
+ hashes: /* @__PURE__ */ new Set(),
450681
+ memorySourceHashes: /* @__PURE__ */ new Set()
450132
450682
  };
450133
450683
  groups.set(key2, group);
450134
450684
  }
@@ -450144,8 +450694,13 @@ ${trimmedNew}`;
450144
450694
  else
450145
450695
  group.partialOrUnavailableCount++;
450146
450696
  group.distinctNativeResultCount = group.hashes.size;
450697
+ if (native.memoryRead) {
450698
+ group.latestMemoryRead = native.memoryRead;
450699
+ group.memorySourceHashes.add(native.memoryRead.sourceManifestSha256);
450700
+ group.distinctMemorySourceManifestCount = group.memorySourceHashes.size;
450701
+ }
450147
450702
  }
450148
- return [...groups.values()].filter((group) => group.occurrences.count > 1).sort((a, b) => a.occurrences.lastTurn - b.occurrences.lastTurn).slice(-6).map(({ hashes: _hashes, ...facts }) => facts);
450703
+ return [...groups.values()].filter((group) => group.occurrences.count > 1).sort((a, b) => a.occurrences.lastTurn - b.occurrences.lastTurn).slice(-6).map(({ hashes: _hashes, memorySourceHashes: _memorySources, ...facts }) => facts);
450149
450704
  }
450150
450705
  _equivalentNativeObservations() {
450151
450706
  const groups = /* @__PURE__ */ new Map();
@@ -452944,6 +453499,10 @@ ${content}`.trim() };
452944
453499
  function numberFromUnknown(value) {
452945
453500
  return typeof value === "number" && Number.isFinite(value) ? value : void 0;
452946
453501
  }
453502
+ function nativeCachedPromptTokens(data, promptTokens2) {
453503
+ const cached = numberFromUnknown(data["prompt_eval_cached_count"]);
453504
+ return Number.isSafeInteger(promptTokens2) && promptTokens2 >= 0 && cached !== void 0 && Number.isSafeInteger(cached) && cached >= 0 && cached <= promptTokens2 ? cached : void 0;
453505
+ }
452947
453506
  function costUsdFromUnknown(value) {
452948
453507
  const amount = numberFromUnknown(value);
452949
453508
  return amount !== void 0 && amount >= 0 ? amount : void 0;
@@ -453941,6 +454500,8 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
453941
454500
  };
453942
454501
  if (isOllamaTransport) {
453943
454502
  body["think"] = effectiveThink;
454503
+ if (effectiveThink === false)
454504
+ body["reasoning_effort"] = "none";
453944
454505
  }
453945
454506
  if (!isOllamaTransport && request.chatTemplateKwargs)
453946
454507
  body["chat_template_kwargs"] = request.chatTemplateKwargs;
@@ -454281,7 +454842,8 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
454281
454842
  totalTokens: promptTokens2 + completionTokens,
454282
454843
  promptTokens: promptTokens2,
454283
454844
  promptEvalCount: promptTokens2,
454284
- completionTokens
454845
+ completionTokens,
454846
+ cacheReadInputTokens: nativeCachedPromptTokens(data, promptTokens2)
454285
454847
  })
454286
454848
  };
454287
454849
  }
@@ -454458,8 +455020,11 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
454458
455020
  };
454459
455021
  const isOllamaTransport = this._provider.protocol === "ollama";
454460
455022
  const useOllamaPool = !emptyRecovery && request.configuredEndpointOnly !== true && isOllamaTransport && shouldUseOllamaPoolForBaseUrl(this.baseUrl);
454461
- if (isOllamaTransport)
455023
+ if (isOllamaTransport) {
454462
455024
  body["think"] = effectiveThink;
455025
+ if (effectiveThink === false)
455026
+ body["reasoning_effort"] = "none";
455027
+ }
454463
455028
  if (!isOllamaTransport && request.chatTemplateKwargs)
454464
455029
  body["chat_template_kwargs"] = request.chatTemplateKwargs;
454465
455030
  if (responseFormat !== void 0) {
@@ -454618,12 +455183,14 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
454618
455183
  nativeSawDone = true;
454619
455184
  const promptTokens2 = numberFromUnknown(data["prompt_eval_count"]) ?? 0;
454620
455185
  const completionTokens = numberFromUnknown(data["eval_count"]) ?? 0;
455186
+ const cachedPromptTokens = nativeCachedPromptTokens(data, promptTokens2);
454621
455187
  nativeFinalEvents.push({
454622
455188
  type: "usage",
454623
455189
  usage: {
454624
455190
  promptTokens: promptTokens2,
454625
455191
  completionTokens,
454626
- totalTokens: promptTokens2 + completionTokens
455192
+ totalTokens: promptTokens2 + completionTokens,
455193
+ ...cachedPromptTokens !== void 0 ? { cacheReadInputTokens: cachedPromptTokens } : {}
454627
455194
  }
454628
455195
  });
454629
455196
  nativeFinalEvents.push({
@@ -456698,7 +457265,7 @@ function statisticalTrialFromResult(input2) {
456698
457265
  // packages/orchestrator/dist/nol/coordinator.js
456699
457266
  init_dist();
456700
457267
  init_dist5();
456701
- import { createHash as createHash151, randomUUID as randomUUID64 } from "node:crypto";
457268
+ import { createHash as createHash151, randomUUID as randomUUID65 } from "node:crypto";
456702
457269
  var NolComputeTrialError = class extends Error {
456703
457270
  facts;
456704
457271
  constructor(message3, facts) {
@@ -457005,7 +457572,7 @@ var NolCoordinator = class {
457005
457572
  if (prep.cleanupGeneration !== null)
457006
457573
  prep = this.options.store.acknowledgeCleanup(prepId, prep.cleanupGeneration, { phase: "control_preparation", noModelLoaded: true });
457007
457574
  }
457008
- const claimed = this.options.store.claimJob(prepId, `${this.options.ownerId}:preparation:${randomUUID64()}`, this.leaseMs);
457575
+ const claimed = this.options.store.claimJob(prepId, `${this.options.ownerId}:preparation:${randomUUID65()}`, this.leaseMs);
457009
457576
  if (!claimed)
457010
457577
  throw new Error("NOL control preparation is owned by another execution");
457011
457578
  lease = claimed;
@@ -457222,7 +457789,7 @@ var NolCoordinator = class {
457222
457789
  const token5 = this.acquireAdapter(jobId3);
457223
457790
  let lease;
457224
457791
  try {
457225
- lease = this.options.store.claimJob(jobId3, `${this.options.ownerId}:${randomUUID64()}`, this.leaseMs);
457792
+ lease = this.options.store.claimJob(jobId3, `${this.options.ownerId}:${randomUUID65()}`, this.leaseMs);
457226
457793
  } catch (error) {
457227
457794
  this.releaseAdapter(token5);
457228
457795
  throw error;
@@ -457883,7 +458450,7 @@ var NolCoordinator = class {
457883
458450
  const verdict3 = (value) => value === "pass" ? "passed" : value === "fail" ? "failed" : "inconclusive";
457884
458451
  const report3 = NolComparisonReportSchema.parse(sealNolRecord({
457885
458452
  schema: "omnius.nol.comparison.v1",
457886
- id: randomUUID64(),
458453
+ id: randomUUID65(),
457887
458454
  comparisonDigest: ZERO,
457888
458455
  experimentDigest: experiment.experimentDigest,
457889
458456
  baselineVariantDigest: experiment.modelDigest,
@@ -458881,7 +459448,7 @@ async function runNolDiscovery(input2) {
458881
459448
  // packages/orchestrator/dist/nol/model-validation.js
458882
459449
  init_dist();
458883
459450
  init_dist5();
458884
- import { createHash as createHash152, randomUUID as randomUUID65 } from "node:crypto";
459451
+ import { createHash as createHash152, randomUUID as randomUUID66 } from "node:crypto";
458885
459452
  var NOL_MODEL_VALIDATION_KIND = "nol_model_validation";
458886
459453
  function fail5(ok2, message3) {
458887
459454
  if (!ok2)
@@ -459585,7 +460152,7 @@ var NolModelValidationService = class {
459585
460152
  same10(scored.scores.map((s) => s.metricId).sort(), plan.objective.metrics.map((m) => m.id).sort(), "Scorer metric coverage mismatch");
459586
460153
  const trial = NolTrialResultSchema.parse({
459587
460154
  schema: "omnius.nol.trial.v1",
459588
- id: randomUUID65(),
460155
+ id: randomUUID66(),
459589
460156
  experimentDigest: plan.planDigest,
459590
460157
  taskId: task.taskId,
459591
460158
  clusterId: task.clusterId,
@@ -459867,7 +460434,7 @@ var NolModelValidationService = class {
459867
460434
  // packages/orchestrator/dist/nol/variant-registry.js
459868
460435
  init_dist();
459869
460436
  init_dist5();
459870
- import { createHash as createHash153, randomUUID as randomUUID66 } from "node:crypto";
460437
+ import { createHash as createHash153, randomUUID as randomUUID67 } from "node:crypto";
459871
460438
  var contexts = /* @__PURE__ */ new WeakMap();
459872
460439
  var modelContexts = /* @__PURE__ */ new WeakMap();
459873
460440
  var clone6 = (value) => JSON.parse(canonicalNolJson(value));
@@ -460094,7 +460661,7 @@ var NolVariantHostAuthority = class {
460094
460661
  const ticket = Object.freeze(/* @__PURE__ */ Object.create(null));
460095
460662
  this.actions.set(ticket, {
460096
460663
  scope: freeze5(input2.scope),
460097
- id: randomUUID66(),
460664
+ id: randomUUID67(),
460098
460665
  actorId: input2.actorId,
460099
460666
  issuedAt,
460100
460667
  expires: input2.expiresAtMs,
@@ -462450,7 +463017,7 @@ var TelegramActionSessionRegistry = class {
462450
463017
 
462451
463018
  // packages/cli/src/computer-use/host-session.ts
462452
463019
  init_dist5();
462453
- import { randomUUID as randomUUID69 } from "node:crypto";
463020
+ import { randomUUID as randomUUID70 } from "node:crypto";
462454
463021
  import { resolve as resolve54 } from "node:path";
462455
463022
 
462456
463023
  // packages/cli/src/tui/tool-adapter.ts
@@ -462467,6 +463034,25 @@ function generationKindForToolName(toolName) {
462467
463034
  }
462468
463035
 
462469
463036
  // packages/cli/src/tui/tool-adapter.ts
463037
+ function observeNativeMemorySearchTool(tool) {
463038
+ if (tool.name !== "memory_search" || !tool.readIssuedMemoryResult) return tool;
463039
+ const readIssuedResult = tool.readIssuedMemoryResult;
463040
+ const observer = new NativeMemoryOperationObserver({
463041
+ toolName: tool.name,
463042
+ readParameters: () => tool.parameters,
463043
+ readIssuedResult: (data) => readIssuedResult.call(tool, data)
463044
+ });
463045
+ return {
463046
+ ...tool,
463047
+ async execute(args, context) {
463048
+ const ticket = observer.begin(args, context);
463049
+ const result = await tool.execute(args, context);
463050
+ observer.observe(ticket, args, result, context);
463051
+ return result;
463052
+ },
463053
+ readIssuedOperationObservation: (args, result) => observer.read(args, result)
463054
+ };
463055
+ }
462470
463056
  var replAdapters = /* @__PURE__ */ new WeakSet();
462471
463057
  function mapExecutionToolResult(result) {
462472
463058
  return {
@@ -462753,12 +463339,12 @@ function adaptExecutionTool(tool, options = {}) {
462753
463339
  replAdapters.add(adapted);
462754
463340
  }
462755
463341
  adaptNativeWorkModeTool(tool, adapted);
462756
- return adapted;
463342
+ return observeNativeMemorySearchTool(adapted);
462757
463343
  }
462758
463344
 
462759
463345
  // packages/cli/src/computer-use/configured-planner.ts
462760
463346
  init_dist5();
462761
- import { createHash as createHash154, randomUUID as randomUUID67 } from "node:crypto";
463347
+ import { createHash as createHash154, randomUUID as randomUUID68 } from "node:crypto";
462762
463348
  var sha25610 = (text20) => createHash154("sha256").update(text20).digest("hex");
462763
463349
  function createHostUiPlannerResponseSchema(grants) {
462764
463350
  if (!grants?.length) return structuredClone(UI_PLAN_RESPONSE_SCHEMA);
@@ -462813,7 +463399,7 @@ function createConfiguredUiPlannerInfer(profile3, options) {
462813
463399
  void 0,
462814
463400
  pinned.protocol === "ollama" ? "ollama" : "vllm"
462815
463401
  );
462816
- const requestId = `host-ui:planner:${randomUUID67()}`, started = performance.now();
463402
+ const requestId = `host-ui:planner:${randomUUID68()}`, started = performance.now();
462817
463403
  const result = await backend.chatCompletion({
462818
463404
  messages: [{ role: "user", content: prompt }],
462819
463405
  tools: [],
@@ -463191,7 +463777,7 @@ var RunnerUiPort = class {
463191
463777
 
463192
463778
  // packages/cli/src/computer-use/configured-point.ts
463193
463779
  init_dist5();
463194
- import { createHash as createHash155, randomUUID as randomUUID68 } from "node:crypto";
463780
+ import { createHash as createHash155, randomUUID as randomUUID69 } from "node:crypto";
463195
463781
  var hash26 = (value) => createHash155("sha256").update(value).digest("hex");
463196
463782
  var PNG2 = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
463197
463783
  function createConfiguredUiPoint(profile3, options) {
@@ -463246,7 +463832,7 @@ function createConfiguredUiPoint(profile3, options) {
463246
463832
  await bounded6(() => options.assertModelReady(structuredClone(pinned), combined));
463247
463833
  receipt = {
463248
463834
  schema: "omnius.host-ui-point-receipt.v1",
463249
- requestId: `host-ui:point:${randomUUID68()}`,
463835
+ requestId: `host-ui:point:${randomUUID69()}`,
463250
463836
  profile: { endpoint: pinned.endpoint, model: pinned.model, revision: pinned.revision },
463251
463837
  captureSha256,
463252
463838
  captureBytes: bytes5.length,
@@ -463386,7 +463972,7 @@ async function runConfiguredHostUiSession(input2, options) {
463386
463972
  if (spec.scope.kind !== "browser" || spec.scope.headless !== false || options.tool)
463387
463973
  throw new Error("Visible review requires the session's own headed browser.");
463388
463974
  }
463389
- const sessionId = `host-ui-${randomUUID69()}`, trace = new UiTraceRecorder(sessionId);
463975
+ const sessionId = `host-ui-${randomUUID70()}`, trace = new UiTraceRecorder(sessionId);
463390
463976
  const storage = spec.persistence && { directory: spec.persistence.directory, allowPlaintextPersistence: true };
463391
463977
  const workflows = storage && new UiWorkflowStore(storage);
463392
463978
  const noInference = { async chatCompletion() {
@@ -463631,7 +464217,7 @@ import { createHash as createHash167 } from "node:crypto";
463631
464217
  // packages/cli/src/nol/gne-profile.ts
463632
464218
  init_dist();
463633
464219
  init_dist5();
463634
- import { createHash as createHash158, randomUUID as randomUUID72 } from "node:crypto";
464220
+ import { createHash as createHash158, randomUUID as randomUUID73 } from "node:crypto";
463635
464221
  import { realpathSync as realpathSync30, statSync as statSync36 } from "node:fs";
463636
464222
  import { lstat as lstat12, mkdir as mkdir9, realpath as realpath11 } from "node:fs/promises";
463637
464223
  import { dirname as dirname50, isAbsolute as isAbsolute39, join as join84, relative as relative32, resolve as resolve56 } from "node:path";
@@ -463750,7 +464336,7 @@ async function execFileText4(file, args = [], options = {}) {
463750
464336
  }
463751
464337
 
463752
464338
  // packages/cli/src/nol/cuda-lease.ts
463753
- import { randomUUID as randomUUID71 } from "node:crypto";
464339
+ import { randomUUID as randomUUID72 } from "node:crypto";
463754
464340
  import { readFile as readFile5 } from "node:fs/promises";
463755
464341
  import { connect } from "node:net";
463756
464342
 
@@ -463760,7 +464346,7 @@ import {
463760
464346
  createHash as createHash156,
463761
464347
  createHmac as createHmac4,
463762
464348
  randomBytes as randomBytes12,
463763
- randomUUID as randomUUID70,
464349
+ randomUUID as randomUUID71,
463764
464350
  timingSafeEqual as timingSafeEqual4
463765
464351
  } from "node:crypto";
463766
464352
  import { constants as constants15 } from "node:fs";
@@ -463996,7 +464582,7 @@ function createNolCudaMutationJournal(root2) {
463996
464582
  };
463997
464583
  return {
463998
464584
  async begin(input2) {
463999
- const request = requestCopy(input2), nonce = randomUUID70(), now2 = Date.now();
464585
+ const request = requestCopy(input2), nonce = randomUUID71(), now2 = Date.now();
464000
464586
  const body = {
464001
464587
  schema: "omnius.nol.cuda-mutation.v1",
464002
464588
  nonce,
@@ -464664,7 +465250,7 @@ var NolCudaLease = class _NolCudaLease {
464664
465250
  function nolCudaOwner(jobId3, generation) {
464665
465251
  if (!/^[\w.-]{1,100}$/.test(jobId3) || !Number.isSafeInteger(generation) || generation < 1)
464666
465252
  throw new Error("Invalid NOL CUDA owner identity");
464667
- return `omnius:nol:${jobId3}:${generation}:${randomUUID71()}`;
465253
+ return `omnius:nol:${jobId3}:${generation}:${randomUUID72()}`;
464668
465254
  }
464669
465255
 
464670
465256
  // packages/cli/src/nol/orphan-custody.ts
@@ -465545,7 +466131,7 @@ var NolGneProfileService = class {
465545
466131
  if (job2.status === "completed") return this.recoverIssuance(jobId3);
465546
466132
  const lease = this.options.store.claimJob(
465547
466133
  jobId3,
465548
- `${this.options.ownerId}:${randomUUID72()}`,
466134
+ `${this.options.ownerId}:${randomUUID73()}`,
465549
466135
  this.options.leaseMs ?? 3e4
465550
466136
  );
465551
466137
  if (!lease)
@@ -466477,7 +467063,7 @@ init_dist();
466477
467063
  // packages/cli/src/nol/export-service.ts
466478
467064
  init_dist();
466479
467065
  init_dist5();
466480
- import { createHash as createHash159, randomUUID as randomUUID73 } from "node:crypto";
467066
+ import { createHash as createHash159, randomUUID as randomUUID74 } from "node:crypto";
466481
467067
  import { lstatSync as lstatSync15, realpathSync as realpathSync31, statfsSync as statfsSync5 } from "node:fs";
466482
467068
  import { lstat as lstat13, mkdir as mkdir10, mkdtemp as mkdtemp7, readdir as readdir5, realpath as realpath12 } from "node:fs/promises";
466483
467069
  import { isAbsolute as isAbsolute40, join as join85, relative as relative33, resolve as resolve57 } from "node:path";
@@ -466538,7 +467124,7 @@ var NolExportService = class {
466538
467124
  throw new Error("Export work root must be owned and private mode700");
466539
467125
  if (!options.ownerId.trim() || options.ownerId.length > 192)
466540
467126
  throw new Error("Export host owner required");
466541
- this.ownerId = `${options.ownerId}:${randomUUID73()}`;
467127
+ this.ownerId = `${options.ownerId}:${randomUUID74()}`;
466542
467128
  this.projectId = createHash159("sha256").update(this.root).digest("hex");
466543
467129
  if (!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,95}$/.test(options.id))
466544
467130
  throw new Error("Export configuration ID required");
@@ -467284,7 +467870,7 @@ init_dist5();
467284
467870
  // packages/cli/src/nol/neuronary-catalog.ts
467285
467871
  init_dist();
467286
467872
  init_dist5();
467287
- import { createHash as createHash160, randomUUID as randomUUID74 } from "node:crypto";
467873
+ import { createHash as createHash160, randomUUID as randomUUID75 } from "node:crypto";
467288
467874
  import { realpathSync as realpathSync32, statSync as statSync37 } from "node:fs";
467289
467875
  import { isAbsolute as isAbsolute41 } from "node:path";
467290
467876
  import { z as z31 } from "zod";
@@ -467387,7 +467973,7 @@ var NolNeuronaryCatalogService = class {
467387
467973
  if (!statSync37(this.projectRoot).isDirectory())
467388
467974
  throw new Error("Catalog project is not a directory");
467389
467975
  boundedText2(192).parse(options.ownerId);
467390
- this.instanceOwnerId = `${options.ownerId}:${randomUUID74()}`;
467976
+ this.instanceOwnerId = `${options.ownerId}:${randomUUID75()}`;
467391
467977
  this.catalog = freeze7(
467392
467978
  clone9(NolNeuronaryCatalogConfigSchema.parse(options.catalog))
467393
467979
  );
@@ -467488,7 +468074,7 @@ var NolNeuronaryCatalogService = class {
467488
468074
  id: this.scopeId(),
467489
468075
  payload: this.manifest
467490
468076
  });
467491
- const id8 = `neuronary-catalog-${randomUUID74()}`;
468077
+ const id8 = `neuronary-catalog-${randomUUID75()}`;
467492
468078
  let admitted = false;
467493
468079
  for (let slot = 0; slot < this.catalog.limits.maxJobs; slot++) {
467494
468080
  this.authorize(context);
@@ -467982,7 +468568,7 @@ import { z as z35 } from "zod";
467982
468568
  // packages/cli/src/nol/vllm-profile.ts
467983
468569
  init_dist();
467984
468570
  init_dist5();
467985
- import { createHash as createHash166, randomUUID as randomUUID76 } from "node:crypto";
468571
+ import { createHash as createHash166, randomUUID as randomUUID77 } from "node:crypto";
467986
468572
  import { realpathSync as realpathSync34 } from "node:fs";
467987
468573
  import { mkdir as mkdir11, statfs, lstat as lstat14 } from "node:fs/promises";
467988
468574
  import { isAbsolute as isAbsolute44, join as join89, resolve as resolve58 } from "node:path";
@@ -467997,7 +468583,7 @@ init_dist5();
467997
468583
  // packages/cli/src/nol/vllm-startup.ts
467998
468584
  init_dist();
467999
468585
  init_dist5();
468000
- import { createHash as createHash162, randomUUID as randomUUID75 } from "node:crypto";
468586
+ import { createHash as createHash162, randomUUID as randomUUID76 } from "node:crypto";
468001
468587
  import { spawn as spawn10 } from "node:child_process";
468002
468588
  import { constants as constants18 } from "node:fs";
468003
468589
  import { open as open11 } from "node:fs/promises";
@@ -469079,7 +469665,7 @@ var NolVllmStartupSession = class {
469079
469665
  );
469080
469666
  this.current();
469081
469667
  this.state = "loading";
469082
- this.loadNonce = randomUUID75();
469668
+ this.loadNonce = randomUUID76();
469083
469669
  this.loading = this.runLoad();
469084
469670
  return this.loading;
469085
469671
  }
@@ -469270,7 +469856,7 @@ var PipeTransport = class {
469270
469856
  python;
469271
469857
  worker;
469272
469858
  options;
469273
- sessionId = randomUUID75();
469859
+ sessionId = randomUUID76();
469274
469860
  closed;
469275
469861
  resolveClosed;
469276
469862
  child;
@@ -471593,7 +472179,7 @@ var NolVllmProfileService = class {
471593
472179
  );
471594
472180
  const lease = this.options.store.claimJob(
471595
472181
  jobId3,
471596
- `${this.options.ownerId}:${randomUUID76()}`,
472182
+ `${this.options.ownerId}:${randomUUID77()}`,
471597
472183
  this.options.leaseMs ?? 3e4
471598
472184
  );
471599
472185
  need10(lease, "profile not claimable; settle historical cleanup first");
@@ -473578,7 +474164,7 @@ var NolFacade = class {
473578
474164
 
473579
474165
  // packages/cli/src/nol/sqlite-store.ts
473580
474166
  init_dist();
473581
- import { createHash as createHash168, randomUUID as randomUUID77 } from "node:crypto";
474167
+ import { createHash as createHash168, randomUUID as randomUUID78 } from "node:crypto";
473582
474168
  import { mkdirSync as mkdirSync48 } from "node:fs";
473583
474169
  import { createRequire as createRequire6 } from "node:module";
473584
474170
  import { dirname as dirname52 } from "node:path";
@@ -474185,7 +474771,7 @@ var SqliteNolStore = class {
474185
474771
  throw new Error("NOL trial has an unsettled prior owner");
474186
474772
  }
474187
474773
  const attempt = latest ? integer20(object21(latest)["attempt"], "trial attempt", 1) + 1 : 1;
474188
- const id8 = randomUUID77(), now2 = this.time();
474774
+ const id8 = randomUUID78(), now2 = this.time();
474189
474775
  this.db.prepare(
474190
474776
  "INSERT INTO nol_trials VALUES(?,?,?,?,?,?,?,'running',NULL,'[]',NULL,?,NULL)"
474191
474777
  ).run(
@@ -476785,7 +477371,7 @@ function resolveNolVllmWorkRoot(projectRoot, input2) {
476785
477371
 
476786
477372
  // packages/cli/src/nol/vllm-runtime.ts
476787
477373
  init_dist();
476788
- import { randomUUID as randomUUID78 } from "node:crypto";
477374
+ import { randomUUID as randomUUID79 } from "node:crypto";
476789
477375
 
476790
477376
  // packages/cli/src/nol/vllm-authority.ts
476791
477377
  init_dist();
@@ -477297,7 +477883,7 @@ var NolProjectVllmServices = class {
477297
477883
  async prepareAdapter(signal) {
477298
477884
  need12(this.ownedJobIds.length === 0, "settle vLLM conformance before an experiment");
477299
477885
  const epoch3 = this.epoch, context = {
477300
- actorId: `host-metadata-${randomUUID78()}`,
477886
+ actorId: `host-metadata-${randomUUID79()}`,
477301
477887
  ...signal ? { signal } : {},
477302
477888
  assertAuthorized: () => {
477303
477889
  need12(!this.closing && this.epoch === epoch3, "experiment metadata preparation stopped");
@@ -477351,7 +477937,7 @@ import {
477351
477937
  writeFileSync as writeFileSync43
477352
477938
  } from "node:fs";
477353
477939
  import { basename as basename25, dirname as dirname55, isAbsolute as isAbsolute50, join as join94, resolve as resolve61 } from "node:path";
477354
- import { randomUUID as randomUUID79 } from "node:crypto";
477940
+ import { randomUUID as randomUUID80 } from "node:crypto";
477355
477941
 
477356
477942
  // packages/cli/src/config-home.ts
477357
477943
  import { homedir as homedir24 } from "node:os";
@@ -477430,7 +478016,7 @@ function deduplicate(entries) {
477430
478016
  }
477431
478017
  function atomicWrite3(path13, content) {
477432
478018
  mkdirSync49(dirname55(path13), { recursive: true });
477433
- const temporary = `${path13}.${randomUUID79()}.tmp`;
478019
+ const temporary = `${path13}.${randomUUID80()}.tmp`;
477434
478020
  try {
477435
478021
  writeFileSync43(temporary, content, { encoding: "utf8", mode: 384 });
477436
478022
  renameSync26(temporary, path13);
@@ -477463,7 +478049,7 @@ function removeAbandonedLock(path13) {
477463
478049
  }
477464
478050
  function mutate(change) {
477465
478051
  mkdirSync49(omniusConfigDir(), { recursive: true });
477466
- const lockPath = `${projectsPath()}.lock`, token5 = randomUUID79();
478052
+ const lockPath = `${projectsPath()}.lock`, token5 = randomUUID80();
477467
478053
  const deadline = Date.now() + 250;
477468
478054
  let lock;
477469
478055
  while (true) {
@@ -478167,7 +478753,7 @@ import { z as z43 } from "zod";
478167
478753
  // packages/cli/src/nol/peft-model-authority.ts
478168
478754
  init_dist();
478169
478755
  init_dist5();
478170
- import { createHash as createHash177, randomUUID as randomUUID81 } from "node:crypto";
478756
+ import { createHash as createHash177, randomUUID as randomUUID82 } from "node:crypto";
478171
478757
  import { lstatSync as lstatSync21, realpathSync as realpathSync41 } from "node:fs";
478172
478758
  import { mkdir as mkdir15, lstat as lstat20, readFile as readFile6 } from "node:fs/promises";
478173
478759
  import { fileURLToPath as fileURLToPath11 } from "node:url";
@@ -478177,7 +478763,7 @@ import { z as z42 } from "zod";
478177
478763
  // packages/cli/src/nol/peft-profile.ts
478178
478764
  init_dist();
478179
478765
  init_dist5();
478180
- import { createHash as createHash174, randomUUID as randomUUID80 } from "node:crypto";
478766
+ import { createHash as createHash174, randomUUID as randomUUID81 } from "node:crypto";
478181
478767
  import { lstat as lstat18, realpath as realpath15 } from "node:fs/promises";
478182
478768
  import { fileURLToPath as fileURLToPath10 } from "node:url";
478183
478769
  import { isAbsolute as isAbsolute54, relative as relative38, resolve as resolve62 } from "node:path";
@@ -479411,7 +479997,7 @@ var NolPeftProofJob = class _NolPeftProofJob {
479411
479997
  bridgeArtifact: this.host.bridgeArtifact
479412
479998
  };
479413
479999
  this.manifestDigest = nolJsonDigest(this.manifest);
479414
- this.jobId = `nol-peft-profile-${randomUUID80()}`;
480000
+ this.jobId = `nol-peft-profile-${randomUUID81()}`;
479415
480001
  store.createJob({
479416
480002
  id: this.jobId,
479417
480003
  kind: KIND,
@@ -479479,7 +480065,7 @@ var NolPeftProofJob = class _NolPeftProofJob {
479479
480065
  );
479480
480066
  }
479481
480067
  async execute() {
479482
- const { store, host: host2, plan, budgets } = this, lease = store.claimJob(this.jobId, `peft-proof-${randomUUID80()}`, 3e4);
480068
+ const { store, host: host2, plan, budgets } = this, lease = store.claimJob(this.jobId, `peft-proof-${randomUUID81()}`, 3e4);
479483
480069
  need17(lease, "claim unavailable");
479484
480070
  const signal = this.controller.signal, current6 = () => {
479485
480071
  signal.throwIfAborted();
@@ -481805,7 +482391,7 @@ var NolPeftModelAuthorityService = class {
481805
482391
  );
481806
482392
  await this.initialize();
481807
482393
  authorize(context);
481808
- const p = this.profiles.get(input2.profileId), jobId3 = `nol-peft-authority-${randomUUID81()}`, payload2 = {
482394
+ const p = this.profiles.get(input2.profileId), jobId3 = `nol-peft-authority-${randomUUID82()}`, payload2 = {
481809
482395
  schema: "omnius.nol.peft-authority-job.v1",
481810
482396
  authorityId: this.id,
481811
482397
  profileId: p.id,
@@ -481871,7 +482457,7 @@ var NolPeftModelAuthorityService = class {
481871
482457
  );
481872
482458
  const lease = this.options.store.claimJob(
481873
482459
  jobId3,
481874
- `${this.options.ownerId}:${randomUUID81()}`,
482460
+ `${this.options.ownerId}:${randomUUID82()}`,
481875
482461
  this.options.leaseMs ?? 3e4
481876
482462
  );
481877
482463
  need22(lease, "profile job cannot be claimed");
@@ -482925,7 +483511,7 @@ import {
482925
483511
  createHash as createHash179,
482926
483512
  createHmac as createHmac6,
482927
483513
  randomBytes as randomBytes14,
482928
- randomUUID as randomUUID82,
483514
+ randomUUID as randomUUID83,
482929
483515
  timingSafeEqual as timingSafeEqual6
482930
483516
  } from "node:crypto";
482931
483517
  import {
@@ -484645,7 +485231,7 @@ var NolModelValidationHostFactory = class {
484645
485231
  const configured = this.registered(subject.subject), native = this.options.peft?.has(subject.subject) ? this.options.peft.create(subject) : new NolModelWorkerAdapter(
484646
485232
  configured.profile,
484647
485233
  this.options.host
484648
- ), sessionId = randomUUID82(), profileDigest = nolJsonDigest(configured);
485234
+ ), sessionId = randomUUID83(), profileDigest = nolJsonDigest(configured);
484649
485235
  let ownership, begun = false, used = false, lastPrompt;
484650
485236
  const captured = /* @__PURE__ */ new Map();
484651
485237
  const context = (source2) => ({
@@ -487771,7 +488357,7 @@ function createNolPeftModelControlVerifier(options) {
487771
488357
  // packages/cli/src/nol/gguf-cpu-control-reader-service.ts
487772
488358
  init_dist();
487773
488359
  init_dist5();
487774
- import { createHash as createHash183, randomUUID as randomUUID83 } from "node:crypto";
488360
+ import { createHash as createHash183, randomUUID as randomUUID84 } from "node:crypto";
487775
488361
  import { constants as constants26, lstatSync as lstatSync24, realpathSync as realpathSync44, statfsSync as statfsSync6 } from "node:fs";
487776
488362
  import {
487777
488363
  lstat as lstat22,
@@ -487850,7 +488436,7 @@ var NolGgufCpuControlReaderService = class {
487850
488436
  typeof options.ownerId === "string" && options.ownerId === options.ownerId.trim() && options.ownerId.length > 0 && options.ownerId.length <= 160 && !/[\x00-\x1f\x7f]/.test(options.ownerId),
487851
488437
  "explicit host owner required"
487852
488438
  );
487853
- this.ownerId = `${options.ownerId}:${randomUUID83()}`;
488439
+ this.ownerId = `${options.ownerId}:${randomUUID84()}`;
487854
488440
  this.projectId = createHash183("sha256").update(this.root).digest("hex");
487855
488441
  this.scopeId = nolJsonDigest({ projectId: this.projectId, id: options.id });
487856
488442
  this.leaseMs = options.leaseMs ?? 3e4;
@@ -488048,7 +488634,7 @@ var NolGgufCpuControlReaderService = class {
488048
488634
  id: this.scopeId,
488049
488635
  payload: this.scope
488050
488636
  });
488051
- const jobId3 = `nol-gguf-cpu-reader-${randomUUID83()}`;
488637
+ const jobId3 = `nol-gguf-cpu-reader-${randomUUID84()}`;
488052
488638
  let admission;
488053
488639
  for (let slot = 0; slot < this.limits.maxJobs; slot++) {
488054
488640
  this.authorize(context);
@@ -488065,7 +488651,7 @@ var NolGgufCpuControlReaderService = class {
488065
488651
  modelDigest: model3.modelDigest,
488066
488652
  model: modelRef,
488067
488653
  slot,
488068
- nonce: randomUUID83()
488654
+ nonce: randomUUID84()
488069
488655
  };
488070
488656
  try {
488071
488657
  this.options.store.putDocument({
@@ -488196,7 +488782,7 @@ var NolGgufCpuControlReaderService = class {
488196
488782
  jobId: active.lease.jobId,
488197
488783
  generation: active.lease.generation,
488198
488784
  ownerId: active.lease.ownerId,
488199
- nonce: randomUUID83(),
488785
+ nonce: randomUUID84(),
488200
488786
  scopeDigest: this.scopeDigest
488201
488787
  });
488202
488788
  const file = await open17(
@@ -491552,7 +492138,7 @@ function commonVerifier(input2) {
491552
492138
  // packages/cli/src/nol/cpu-control-reader-service.ts
491553
492139
  init_dist();
491554
492140
  init_dist5();
491555
- import { createHash as createHash186, randomUUID as randomUUID84 } from "node:crypto";
492141
+ import { createHash as createHash186, randomUUID as randomUUID85 } from "node:crypto";
491556
492142
  import { constants as constants29, lstatSync as lstatSync27, realpathSync as realpathSync47, statfsSync as statfsSync7 } from "node:fs";
491557
492143
  import {
491558
492144
  lstat as lstat25,
@@ -491631,7 +492217,7 @@ var NolCpuControlReaderService = class {
491631
492217
  typeof options.ownerId === "string" && options.ownerId === options.ownerId.trim() && options.ownerId.length > 0 && options.ownerId.length <= 160 && !/[\x00-\x1f\x7f]/.test(options.ownerId),
491632
492218
  "explicit host owner required"
491633
492219
  );
491634
- this.ownerId = `${options.ownerId}:${randomUUID84()}`;
492220
+ this.ownerId = `${options.ownerId}:${randomUUID85()}`;
491635
492221
  this.projectId = createHash186("sha256").update(this.root).digest("hex");
491636
492222
  this.scopeId = nolJsonDigest({ projectId: this.projectId, id: options.id });
491637
492223
  this.leaseMs = options.leaseMs ?? 3e4;
@@ -491829,7 +492415,7 @@ var NolCpuControlReaderService = class {
491829
492415
  id: this.scopeId,
491830
492416
  payload: this.scope
491831
492417
  });
491832
- const jobId3 = `nol-cpu-reader-${randomUUID84()}`;
492418
+ const jobId3 = `nol-cpu-reader-${randomUUID85()}`;
491833
492419
  let admission;
491834
492420
  for (let slot = 0; slot < this.limits.maxJobs; slot++) {
491835
492421
  this.authorize(context);
@@ -491846,7 +492432,7 @@ var NolCpuControlReaderService = class {
491846
492432
  modelDigest: model3.modelDigest,
491847
492433
  model: modelRef,
491848
492434
  slot,
491849
- nonce: randomUUID84()
492435
+ nonce: randomUUID85()
491850
492436
  };
491851
492437
  try {
491852
492438
  this.options.store.putDocument({
@@ -491977,7 +492563,7 @@ var NolCpuControlReaderService = class {
491977
492563
  jobId: active.lease.jobId,
491978
492564
  generation: active.lease.generation,
491979
492565
  ownerId: active.lease.ownerId,
491980
- nonce: randomUUID84(),
492566
+ nonce: randomUUID85(),
491981
492567
  scopeDigest: this.scopeDigest
491982
492568
  });
491983
492569
  const file = await open20(
@@ -492571,7 +493157,7 @@ var NolCpuControlReaderService = class {
492571
493157
  // packages/cli/src/nol/variant-store.ts
492572
493158
  init_dist();
492573
493159
  init_dist5();
492574
- import { randomUUID as randomUUID85 } from "node:crypto";
493160
+ import { randomUUID as randomUUID86 } from "node:crypto";
492575
493161
  import { mkdirSync as mkdirSync51 } from "node:fs";
492576
493162
  import { createRequire as createRequire9 } from "node:module";
492577
493163
  import { dirname as dirname61 } from "node:path";
@@ -493073,7 +493659,7 @@ var SqliteNolVariantStore = class {
493073
493659
  const value = {
493074
493660
  intentDigest: nolJsonDigest(intent),
493075
493661
  intent,
493076
- nonce: randomUUID85(),
493662
+ nonce: randomUUID86(),
493077
493663
  reservedVersion: target2.version + 1,
493078
493664
  status: "pending",
493079
493665
  bridgeStarted: false,
@@ -498901,7 +499487,7 @@ import {
498901
499487
  writeFile as writeFile5
498902
499488
  } from "node:fs/promises";
498903
499489
  import { join as join108, resolve as resolve70 } from "node:path";
498904
- import { randomUUID as randomUUID86, createHash as createHash194 } from "node:crypto";
499490
+ import { randomUUID as randomUUID87, createHash as createHash194 } from "node:crypto";
498905
499491
  var FILES2 = ["input.json", "result.json"];
498906
499492
  var NAMES = Object.keys(NOL_NATIVE_AGENT_SCHEMAS);
498907
499493
  var BEGIN = "NOL_NATIVE_AGENT_RECEIPT_BEGIN";
@@ -498924,7 +499510,7 @@ async function evaluateNolGneAgent(input2) {
498924
499510
  Number.isSafeInteger(input2.maxEvidenceBytes) && input2.maxEvidenceBytes >= 128 * 1024 + 4096 && input2.maxEvidenceBytes <= 64 * 1024 ** 2,
498925
499511
  "evidence byte limit invalid"
498926
499512
  );
498927
- const nonce = input2.fixtureNonce ?? randomUUID86().replaceAll("-", "");
499513
+ const nonce = input2.fixtureNonce ?? randomUUID87().replaceAll("-", "");
498928
499514
  need37(/^[a-f0-9]{32}$/.test(nonce), "frozen fixture nonce invalid");
498929
499515
  const settlementTimeoutMs = input2.settlementTimeoutMs ?? 6e4;
498930
499516
  need37(
@@ -498941,7 +499527,7 @@ async function evaluateNolGneAgent(input2) {
498941
499527
  const savedEnv = /* @__PURE__ */ new Map();
498942
499528
  const report3 = {
498943
499529
  schema: "omnius.nol.gne-agent-evaluation-result.v1",
498944
- runId: `nol-gne-agent-${randomUUID86()}`,
499530
+ runId: `nol-gne-agent-${randomUUID87()}`,
498945
499531
  directory: "",
498946
499532
  mode: input2.mode,
498947
499533
  backend: "gne",
@@ -499552,7 +500138,7 @@ ${END}`;
499552
500138
  // packages/cli/src/nol/gne-tools-profile.ts
499553
500139
  init_dist();
499554
500140
  init_dist5();
499555
- import { createHash as createHash195, randomUUID as randomUUID87 } from "node:crypto";
500141
+ import { createHash as createHash195, randomUUID as randomUUID88 } from "node:crypto";
499556
500142
  import { mkdir as mkdir21, lstat as lstat26, realpath as realpath19 } from "node:fs/promises";
499557
500143
  import { isAbsolute as isAbsolute69, join as join109, relative as relative48, resolve as resolve71 } from "node:path";
499558
500144
  init_gne_conformance();
@@ -499782,7 +500368,7 @@ var NolGneToolsProofJob = class _NolGneToolsProofJob {
499782
500368
  resolve71(input2.directory),
499783
500369
  host2,
499784
500370
  plan,
499785
- `nol-gne-tools-profile-${randomUUID87()}`
500371
+ `nol-gne-tools-profile-${randomUUID88()}`
499786
500372
  );
499787
500373
  }
499788
500374
  cancel(reason = "Stop requested") {
@@ -499806,7 +500392,7 @@ var NolGneToolsProofJob = class _NolGneToolsProofJob {
499806
500392
  async execute() {
499807
500393
  const { host: host2, plan, store } = this, lease = store.claimJob(
499808
500394
  this.jobId,
499809
- `gne-tools-profile-${randomUUID87()}`,
500395
+ `gne-tools-profile-${randomUUID88()}`,
499810
500396
  3e4
499811
500397
  );
499812
500398
  need38(lease, "private proof job not claimable");