omnius 1.0.860 → 1.0.862

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 37501867 bytes
4
- sha256: c8a6351bd6377859e05a76c5a058d67f79dae585b8be315c2c53b921ad995ba7
3
+ size: 37313510 bytes
4
+ sha256: 5c20a01a63c4bcaf31b8ea3415b36cf30425a6186e3b7c442fd0fda4c53eb29a
package/dist/library.js CHANGED
@@ -65868,17 +65868,17 @@ ${record9.provenance.sourceUri ?? ""}`.toLowerCase();
65868
65868
  const retired = new Set(input.retireRecordIds);
65869
65869
  const active = this.materializeWorkingSet({ epoch: input.epoch, activeRecordIds: input.activeRecordIds });
65870
65870
  const blockedRecordIds = active.records.filter((record9) => retired.has(record9.id)).map((record9) => record9.id);
65871
- const reasons3 = blockedRecordIds.map((id5) => `record ${id5} is in the active dependency closure`);
65871
+ const reasons4 = blockedRecordIds.map((id5) => `record ${id5} is in the active dependency closure`);
65872
65872
  for (const transactionId2 of active.transactionIds) {
65873
65873
  const transaction = this.getTransaction(transactionId2);
65874
65874
  if (!transaction)
65875
65875
  continue;
65876
65876
  if (transaction.recordIds.some((id5) => retired.has(id5)) && transaction.recordIds.some((id5) => !retired.has(id5))) {
65877
65877
  blockedRecordIds.push(`transaction:${transactionId2}`);
65878
- reasons3.push(`transaction ${transactionId2} would be split across the graph cut`);
65878
+ reasons4.push(`transaction ${transactionId2} would be split across the graph cut`);
65879
65879
  }
65880
65880
  }
65881
- return { valid: blockedRecordIds.length === 0, blockedRecordIds, reasons: reasons3 };
65881
+ return { valid: blockedRecordIds.length === 0, blockedRecordIds, reasons: reasons4 };
65882
65882
  }
65883
65883
  };
65884
65884
  }
@@ -81614,30 +81614,30 @@ function shouldTriggerContextConsolidation(snapshot, forgetting, opts = {}) {
81614
81614
  const minRawTokens = opts.minRawTokens ?? snapshot.targetRawTokenBudget;
81615
81615
  const maxRawRatio = opts.maxRawRatio ?? 0.35;
81616
81616
  const minRetention = opts.minRetention ?? 0.7;
81617
- const reasons3 = [];
81617
+ const reasons4 = [];
81618
81618
  let score = 0;
81619
81619
  if (snapshot.rawTokens > minRawTokens) {
81620
- reasons3.push(`raw tokens ${snapshot.rawTokens} exceed target ${minRawTokens}`);
81620
+ reasons4.push(`raw tokens ${snapshot.rawTokens} exceed target ${minRawTokens}`);
81621
81621
  score += 0.4;
81622
81622
  }
81623
81623
  if (snapshot.rawRatio > maxRawRatio) {
81624
- reasons3.push(`raw ratio ${snapshot.rawRatio.toFixed(2)} exceeds ${maxRawRatio.toFixed(2)}`);
81624
+ reasons4.push(`raw ratio ${snapshot.rawRatio.toFixed(2)} exceeds ${maxRawRatio.toFixed(2)}`);
81625
81625
  score += 0.25;
81626
81626
  }
81627
81627
  if (snapshot.rawTokensToTarget > 0) {
81628
- reasons3.push(`${snapshot.rawTokensToTarget} raw tokens must move to reach target`);
81628
+ reasons4.push(`${snapshot.rawTokensToTarget} raw tokens must move to reach target`);
81629
81629
  score += Math.min(0.25, snapshot.rawTokensToTarget / Math.max(1, snapshot.rawTokens));
81630
81630
  }
81631
81631
  if (forgetting && forgetting.activeRetentionEstimate < minRetention) {
81632
- reasons3.push(`active retention estimate ${forgetting.activeRetentionEstimate.toFixed(2)} below ${minRetention.toFixed(2)}`);
81632
+ reasons4.push(`active retention estimate ${forgetting.activeRetentionEstimate.toFixed(2)} below ${minRetention.toFixed(2)}`);
81633
81633
  score += 0.25;
81634
81634
  }
81635
81635
  if (forgetting && forgetting.interferencePairs.length > 0) {
81636
- reasons3.push(`${forgetting.interferencePairs.length} interference pair(s) detected`);
81636
+ reasons4.push(`${forgetting.interferencePairs.length} interference pair(s) detected`);
81637
81637
  score += Math.min(0.2, forgetting.interferencePairs.length * 0.04);
81638
81638
  }
81639
81639
  const minScore = opts.minScore ?? 0.45;
81640
- return { shouldConsolidate: score >= minScore, reasons: reasons3, score: clamp0112(score) };
81640
+ return { shouldConsolidate: score >= minScore, reasons: reasons4, score: clamp0112(score) };
81641
81641
  }
81642
81642
  function shouldTriggerConsolidation(input, opts = {}) {
81643
81643
  const snapshot = "rawTokens" in input ? input : input.pressure ?? input.snapshot;
@@ -231053,23 +231053,23 @@ ${lanes.join("\n")}
231053
231053
  let fileIncludeReasonDetails;
231054
231054
  let redirectInfo;
231055
231055
  let chain;
231056
- const reasons3 = file && fileReasons.get(file.path);
231056
+ const reasons4 = file && fileReasons.get(file.path);
231057
231057
  let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
231058
231058
  let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
231059
231059
  if (cachedChain) {
231060
231060
  if (cachedChain.fileIncludeReasonDetails) {
231061
- seenReasons = new Set(reasons3);
231062
- reasons3 == null ? void 0 : reasons3.forEach(populateRelatedInfo);
231061
+ seenReasons = new Set(reasons4);
231062
+ reasons4 == null ? void 0 : reasons4.forEach(populateRelatedInfo);
231063
231063
  } else {
231064
- reasons3 == null ? void 0 : reasons3.forEach(processReason);
231064
+ reasons4 == null ? void 0 : reasons4.forEach(processReason);
231065
231065
  }
231066
231066
  redirectInfo = cachedChain.redirectInfo;
231067
231067
  } else {
231068
- reasons3 == null ? void 0 : reasons3.forEach(processReason);
231068
+ reasons4 == null ? void 0 : reasons4.forEach(processReason);
231069
231069
  redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file));
231070
231070
  }
231071
231071
  if (fileProcessingReason) processReason(fileProcessingReason);
231072
- const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons3 == null ? void 0 : reasons3.length);
231072
+ const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons4 == null ? void 0 : reasons4.length);
231073
231073
  if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0;
231074
231074
  if (seenReasons && cachedChain) {
231075
231075
  if (cachedChain.details && !processedExtraReason) {
@@ -231079,13 +231079,13 @@ ${lanes.join("\n")}
231079
231079
  if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
231080
231080
  fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
231081
231081
  } else {
231082
- fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons3.length);
231082
+ fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons4.length);
231083
231083
  }
231084
231084
  } else {
231085
231085
  if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
231086
231086
  fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
231087
231087
  } else {
231088
- fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons3.length), fileIncludeReasons[0]);
231088
+ fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons4.length), fileIncludeReasons[0]);
231089
231089
  }
231090
231090
  }
231091
231091
  }
@@ -231125,7 +231125,7 @@ ${lanes.join("\n")}
231125
231125
  }
231126
231126
  function cachedFileIncludeDetailsHasProcessedExtraReason() {
231127
231127
  var _a3;
231128
- return ((_a3 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a3.length) !== (reasons3 == null ? void 0 : reasons3.length);
231128
+ return ((_a3 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a3.length) !== (reasons4 == null ? void 0 : reasons4.length);
231129
231129
  }
231130
231130
  }
231131
231131
  function getFileIncludeReasonToRelatedInformation(program, reason) {
@@ -234509,11 +234509,11 @@ ${lanes.join("\n")}
234509
234509
  }
234510
234510
  function explainFiles(program, write) {
234511
234511
  var _a3, _b;
234512
- const reasons3 = program.getFileIncludeReasons();
234512
+ const reasons4 = program.getFileIncludeReasons();
234513
234513
  const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
234514
234514
  for (const file of program.getSourceFiles()) {
234515
234515
  write(`${toFileName(file, relativeFileName)}`);
234516
- (_a3 = reasons3.get(file.path)) == null ? void 0 : _a3.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
234516
+ (_a3 = reasons4.get(file.path)) == null ? void 0 : _a3.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
234517
234517
  (_b = explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file), relativeFileName)) == null ? void 0 : _b.forEach((d) => write(` ${d.messageText}`));
234518
234518
  }
234519
234519
  }
@@ -336607,7 +336607,7 @@ function classifyOllamaProcesses(processes, options = {}) {
336607
336607
  const cpuThresholdPct = options.cpuThresholdPct ?? DEFAULT_CPU_THRESHOLD_PCT;
336608
336608
  const activeRefs = activePoolRefs(options.poolStatus ?? null);
336609
336609
  return processes.map((proc) => {
336610
- const reasons3 = [];
336610
+ const reasons4 = [];
336611
336611
  const hasProtectedPort = proc.ports.some((p) => protectedPorts.has(p));
336612
336612
  const isSystemdMain = options.systemdOllamaMainPid !== null && options.systemdOllamaMainPid !== void 0 && proc.pid === options.systemdOllamaMainPid;
336613
336613
  const tracked = activeRefs.pids.has(proc.pid) || proc.ports.some((p) => activeRefs.ports.has(p));
@@ -336622,44 +336622,44 @@ function classifyOllamaProcesses(processes, options = {}) {
336622
336622
  if (parentIsLiveServe) {
336623
336623
  return decision(proc, "keep", "active-pool-owned", true, false, "deterministic", [`runner managed by live ollama serve pid=${proc.ppid}`]);
336624
336624
  }
336625
- reasons3.push(`orphan ollama runner (ppid=${proc.ppid ?? "?"} is not a live ollama serve)`);
336625
+ reasons4.push(`orphan ollama runner (ppid=${proc.ppid ?? "?"} is not a live ollama serve)`);
336626
336626
  if (proc.runnerModelBlob)
336627
- reasons3.push(`holds model blob ${basename14(proc.runnerModelBlob)}`);
336627
+ reasons4.push(`holds model blob ${basename14(proc.runnerModelBlob)}`);
336628
336628
  if (proc.gpuMemoryMb !== null && proc.gpuMemoryMb > 0) {
336629
- reasons3.push(`holding ${proc.gpuMemoryMb} MB GPU memory`);
336629
+ reasons4.push(`holding ${proc.gpuMemoryMb} MB GPU memory`);
336630
336630
  }
336631
- return decision(proc, "terminate", "orphan-runner", false, true, "deterministic", reasons3);
336631
+ return decision(proc, "terminate", "orphan-runner", false, true, "deterministic", reasons4);
336632
336632
  }
336633
336633
  if (!proc.isOllamaServe) {
336634
336634
  return decision(proc, "keep", "unknown-ollama", false, false, "deterministic", ["not an ollama serve process"]);
336635
336635
  }
336636
336636
  if (isSystemdMain)
336637
- reasons3.push("systemd ollama.service main PID");
336637
+ reasons4.push("systemd ollama.service main PID");
336638
336638
  if (hasProtectedPort)
336639
- reasons3.push(`owns protected port ${proc.ports.filter((p) => protectedPorts.has(p)).join(",")}`);
336639
+ reasons4.push(`owns protected port ${proc.ports.filter((p) => protectedPorts.has(p)).join(",")}`);
336640
336640
  if (isSystemdMain || hasProtectedPort) {
336641
- return decision(proc, "keep", "base-service", true, false, "deterministic", reasons3);
336641
+ return decision(proc, "keep", "base-service", true, false, "deterministic", reasons4);
336642
336642
  }
336643
336643
  if (tracked) {
336644
336644
  return decision(proc, "keep", "active-pool-owned", true, false, "deterministic", ["tracked by live in-memory pool"]);
336645
336645
  }
336646
336646
  if (!hasPortEvidence)
336647
- reasons3.push("no verified Ollama API listening port for this PID");
336647
+ reasons4.push("no verified Ollama API listening port for this PID");
336648
336648
  if (!inPoolPortRange && !envPort)
336649
- reasons3.push(`not in pool port range ${poolPortStart}-${poolPortEnd} and no OLLAMA_HOST evidence`);
336649
+ reasons4.push(`not in pool port range ${poolPortStart}-${poolPortEnd} and no OLLAMA_HOST evidence`);
336650
336650
  if (!lowCpu)
336651
- reasons3.push(`CPU ${proc.cpuPct?.toFixed(1)}% exceeds ${cpuThresholdPct}%`);
336651
+ reasons4.push(`CPU ${proc.cpuPct?.toFixed(1)}% exceeds ${cpuThresholdPct}%`);
336652
336652
  if (!oldEnough)
336653
- reasons3.push(`age ${proc.elapsedMs}ms below ${minAgeMs}ms`);
336653
+ reasons4.push(`age ${proc.elapsedMs}ms below ${minAgeMs}ms`);
336654
336654
  const eligible = hasPortEvidence && (inPoolPortRange || envPort) && lowCpu && oldEnough;
336655
336655
  if (!eligible) {
336656
- return decision(proc, "keep", "unknown-ollama", false, false, "deterministic", reasons3);
336656
+ return decision(proc, "keep", "unknown-ollama", false, false, "deterministic", reasons4);
336657
336657
  }
336658
- reasons3.push("old low-utilization untracked pool-range Ollama runner");
336659
- return decision(proc, "terminate", "stale-pool-runner", false, true, "deterministic", reasons3);
336658
+ reasons4.push("old low-utilization untracked pool-range Ollama runner");
336659
+ return decision(proc, "terminate", "stale-pool-runner", false, true, "deterministic", reasons4);
336660
336660
  });
336661
336661
  }
336662
- function decision(proc, action, classification, protectedProc, eligible, source, reasons3) {
336662
+ function decision(proc, action, classification, protectedProc, eligible, source, reasons4) {
336663
336663
  return {
336664
336664
  pid: proc.pid,
336665
336665
  action,
@@ -336668,7 +336668,7 @@ function decision(proc, action, classification, protectedProc, eligible, source,
336668
336668
  protected: protectedProc,
336669
336669
  eligible,
336670
336670
  source,
336671
- reasons: reasons3
336671
+ reasons: reasons4
336672
336672
  };
336673
336673
  }
336674
336674
  function signalOllamaProcess(system, proc, signal) {
@@ -345423,6 +345423,44 @@ function restoreUnreadSourceCarrierIdentity(before, after) {
345423
345423
  }
345424
345424
  }
345425
345425
 
345426
+ // packages/orchestrator/dist/local-inference-diagnostics.js
345427
+ var reasons3 = Object.freeze({
345428
+ operator_inference_hold: ["Local loading paused by operator", true],
345429
+ gpu_recovery_required: ["Local GPU requires operator recovery", true],
345430
+ gpu_health_unavailable: ["Local GPU health could not be verified", true],
345431
+ gpu_runtime_unavailable: ["Local CUDA runtime unavailable", true],
345432
+ gpu_placement_unverified: ["Local GPU placement could not be verified", true],
345433
+ gpu_policy_conflict: ["Selected GPU conflicts with host policy", true],
345434
+ gpu_constraint_empty: ["Selected GPU is outside the broker allowlist", true],
345435
+ gpu_constraint_unavailable: ["Selected GPU is unavailable", true],
345436
+ invalid_gpu_constraint: ["Selected GPU scope is invalid", true],
345437
+ gpu_unregistered_workload: ["Local GPU has an unregistered workload", true],
345438
+ queue_admission_timeout: ["Local GPU admission timed out", false],
345439
+ lane_capacity_wait: ["Waiting for local model capacity", false],
345440
+ lease_transition: ["Local GPU lease is changing", false],
345441
+ queue_full: ["Local inference queue is full", false],
345442
+ backend_rejected_model: ["Local backend rejected the selected model", true],
345443
+ backend_start_failed: ["Local model service failed to start", true],
345444
+ model_context_memory_exceeded: ["Local model context exceeds reserved memory", true],
345445
+ model_not_found: ["Selected local model is not installed", true],
345446
+ model_not_installed: ["Selected local model is not installed", true],
345447
+ warm_preflight_required: ["Local GPU placement needs a fresh preflight", true]
345448
+ });
345449
+ var categories = Object.freeze({
345450
+ access_denied: "Local inference access denied",
345451
+ request_rejected: "Local inference request rejected",
345452
+ authentication: "Local inference authentication failed",
345453
+ rate_limit: "Local inference rate limited",
345454
+ upstream_unavailable: "Local inference service unavailable",
345455
+ timeout: "Local inference timed out",
345456
+ empty_response: "Local model returned no usable answer",
345457
+ invalid_response: "Local model returned an invalid answer",
345458
+ transport: "Local inference connection failed"
345459
+ });
345460
+ function localInferenceBrokerReason(value) {
345461
+ return typeof value === "string" && Object.prototype.hasOwnProperty.call(reasons3, value) ? value : void 0;
345462
+ }
345463
+
345426
345464
  // packages/orchestrator/dist/remote-inference-fallback.js
345427
345465
  var completedCapacityRoutes = /* @__PURE__ */ new WeakMap();
345428
345466
  function completedCapacityBinding(request) {
@@ -345610,9 +345648,9 @@ function safeFailure(error, request, route, streamFrames) {
345610
345648
  } : {}
345611
345649
  };
345612
345650
  }
345613
- async function* observeStreamFrames(stream, categories) {
345651
+ async function* observeStreamFrames(stream, categories2) {
345614
345652
  for await (const chunk of stream) {
345615
- categories.add(chunk.type === "tool_call_delta" ? "tool_call" : chunk.type === "content" && chunk.content ? chunk.thinking ? "thinking" : "visible_content" : "metadata");
345653
+ categories2.add(chunk.type === "tool_call_delta" ? "tool_call" : chunk.type === "content" && chunk.content ? chunk.thinking ? "thinking" : "visible_content" : "metadata");
345616
345654
  yield chunk;
345617
345655
  }
345618
345656
  }
@@ -345830,21 +345868,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
345830
345868
  }
345831
345869
  localBrokerReason(error) {
345832
345870
  const reason = this.options.localBroker?.admissionFailure(error)?.reason_code;
345833
- return reason && [
345834
- "operator_inference_hold",
345835
- "gpu_recovery_required",
345836
- "gpu_health_unavailable",
345837
- "gpu_runtime_unavailable",
345838
- "gpu_placement_unverified",
345839
- "gpu_policy_conflict",
345840
- "queue_admission_timeout",
345841
- "lane_capacity_wait",
345842
- "lease_transition",
345843
- "backend_rejected_model",
345844
- "model_context_memory_exceeded",
345845
- "model_not_found",
345846
- "warm_preflight_required"
345847
- ].includes(reason) ? reason : void 0;
345871
+ return localInferenceBrokerReason(reason);
345848
345872
  }
345849
345873
  builtInScope() {
345850
345874
  if (this.primary.providerId !== "builtin-free" || this.primary.baseUrl !== OPENCODE_INFERENCE_BASE_URL)
@@ -349363,16 +349387,16 @@ function claimDiscoveryStateFromSurvey(input) {
349363
349387
  const requestedRequiredPaths = input.requiredArtifactPaths === void 0 ? paths2 : input.requiredArtifactPaths;
349364
349388
  const requiredPathSet = new Set((Array.isArray(requestedRequiredPaths) ? requestedRequiredPaths : []).map((value) => normalizeEvidencePath(value)).filter((path7) => paths2.includes(path7)));
349365
349389
  const requiredArtifactPaths = paths2.filter((path7) => requiredPathSet.has(path7));
349366
- const reasons3 = /* @__PURE__ */ Object.create(null);
349390
+ const reasons4 = /* @__PURE__ */ Object.create(null);
349367
349391
  for (const [rawPath, rawReason] of Object.entries(input.pathReasons ?? {})) {
349368
349392
  const path7 = normalizeEvidencePath(rawPath);
349369
349393
  const reason = cleanText(rawReason, 220);
349370
349394
  if (path7)
349371
- reasons3[path7] = reason || "candidate selected from bounded workspace inventory";
349395
+ reasons4[path7] = reason || "candidate selected from bounded workspace inventory";
349372
349396
  }
349373
349397
  const openDeltas = requiredArtifactPaths.map((path7) => ({
349374
349398
  path: path7,
349375
- reason: reasons3[path7] || "candidate selected from bounded workspace inventory"
349399
+ reason: reasons4[path7] || "candidate selected from bounded workspace inventory"
349376
349400
  }));
349377
349401
  const unresolved = Array.isArray(input.unresolvedQuestions) ? input.unresolvedQuestions.map((item) => cleanText(item, 260)).filter(Boolean) : [];
349378
349402
  const blockers = Array.isArray(input.survivingBlockers) ? input.survivingBlockers.map((item) => cleanText(item, 220)).filter(Boolean) : [];
@@ -349388,7 +349412,7 @@ function claimDiscoveryStateFromSurvey(input) {
349388
349412
  boundedInventory: normalizedInventory,
349389
349413
  candidatePaths: paths2,
349390
349414
  requiredArtifactPaths,
349391
- pathReasons: reasons3,
349415
+ pathReasons: reasons4,
349392
349416
  unresolvedQuestions: unresolved.slice(0, 10),
349393
349417
  openDeltas,
349394
349418
  survivingBlockers: blockers.slice(0, 8),
@@ -354086,12 +354110,12 @@ function assessBranchRead(input) {
354086
354110
  const pending = Math.max(0, Math.ceil(input.pendingInlineReadTokens ?? 0));
354087
354111
  const safeCeiling = Math.max(0, Math.min(contextWindowTokens, Math.floor(input.safeContextTokens ?? contextWindowTokens)));
354088
354112
  const availableHeadroomTokens = Math.max(0, safeCeiling - resident - reserved - pending);
354089
- const reasons3 = [];
354113
+ const reasons4 = [];
354090
354114
  if (projectedReadTokens > availableHeadroomTokens)
354091
- reasons3.push("headroom");
354115
+ reasons4.push("headroom");
354092
354116
  return {
354093
- branch: reasons3.includes("headroom"),
354094
- reasons: [...new Set(reasons3)],
354117
+ branch: reasons4.includes("headroom"),
354118
+ reasons: [...new Set(reasons4)],
354095
354119
  projectedReadTokens,
354096
354120
  fractionLimitTokens,
354097
354121
  availableHeadroomTokens,
@@ -378960,11 +378984,11 @@ function trustedRetainFullCandidate(record9, rationale = "Trusted host policy pr
378960
378984
  ...artifact2 ? { artifact: artifact2 } : {}
378961
378985
  };
378962
378986
  }
378963
- function hold(reasons3, retainedIds = /* @__PURE__ */ new Set()) {
378987
+ function hold(reasons4, retainedIds = /* @__PURE__ */ new Set()) {
378964
378988
  return {
378965
378989
  accepted: false,
378966
378990
  appliedDecision: "hold",
378967
- reasons: reasons3,
378991
+ reasons: reasons4,
378968
378992
  retainedIds,
378969
378993
  archivedIds: /* @__PURE__ */ new Set()
378970
378994
  };
@@ -379058,11 +379082,11 @@ function memoryCompilationTargetReachability(input) {
379058
379082
  targetMaximumTokens
379059
379083
  };
379060
379084
  }
379061
- function planHold(input, reasons3, candidates = /* @__PURE__ */ new Map()) {
379085
+ function planHold(input, reasons4, candidates = /* @__PURE__ */ new Map()) {
379062
379086
  return {
379063
379087
  accepted: false,
379064
379088
  appliedDecision: "hold",
379065
- reasons: reasons3,
379089
+ reasons: reasons4,
379066
379090
  // A rejected plan can never cause a partial materialization. Preserve the
379067
379091
  // entire candidate set until a new exact request is compiled.
379068
379092
  retainedIds: new Set(input.candidateRecords.map((record9) => record9.id)),
@@ -381891,16 +381915,16 @@ function evaluateUnitResult(input) {
381891
381915
  diagnosticsCount: 0
381892
381916
  };
381893
381917
  }
381894
- const reasons3 = [];
381918
+ const reasons4 = [];
381895
381919
  if (!spec.pass)
381896
- reasons3.push(spec.summary);
381920
+ reasons4.push(spec.summary);
381897
381921
  if (structural.length > 0) {
381898
381922
  const syms = [...new Set(structural.map((d) => d.symbol).filter(Boolean))];
381899
- reasons3.push(`${structural.length} compiler diagnostic(s)${syms.length ? ` on ${syms.slice(0, 4).join(", ")}` : ""}`);
381923
+ reasons4.push(`${structural.length} compiler diagnostic(s)${syms.length ? ` on ${syms.slice(0, 4).join(", ")}` : ""}`);
381900
381924
  }
381901
381925
  return {
381902
381926
  decision: "reject_regenerate",
381903
- rejectReason: `Unit ${input.unit.path}${input.unit.symbol ? ` (${input.unit.symbol})` : ""} does not verify — regenerate against the locked contract: ${reasons3.join("; ")}`,
381927
+ rejectReason: `Unit ${input.unit.path}${input.unit.symbol ? ` (${input.unit.symbol})` : ""} does not verify — regenerate against the locked contract: ${reasons4.join("; ")}`,
381904
381928
  violations: spec.violations,
381905
381929
  diagnosticsCount: structural.length
381906
381930
  };
@@ -386526,32 +386550,32 @@ function claimDiscoveryFallbackCandidates(files, maxCandidates) {
386526
386550
  continue;
386527
386551
  const chunks = normalized4.split("/").filter(Boolean);
386528
386552
  const depth = chunks.length || 1;
386529
- const reasons3 = [];
386553
+ const reasons4 = [];
386530
386554
  let score = 0;
386531
386555
  score += Math.max(1, 12 - Math.min(depth, 10));
386532
- reasons3.push("generic workspace proximity");
386556
+ reasons4.push("generic workspace proximity");
386533
386557
  if (raw.bytes !== void 0) {
386534
386558
  if (raw.bytes > 5e5)
386535
386559
  score -= 3;
386536
386560
  else if (raw.bytes > 8e4)
386537
386561
  score -= 1;
386538
386562
  if (raw.bytes > 5e5)
386539
- reasons3.push("large artifact");
386563
+ reasons4.push("large artifact");
386540
386564
  else if (raw.bytes > 8e4)
386541
- reasons3.push("moderate artifact");
386565
+ reasons4.push("moderate artifact");
386542
386566
  else
386543
- reasons3.push("light payload");
386567
+ reasons4.push("light payload");
386544
386568
  }
386545
386569
  if (raw.mtimeMs !== void 0 && raw.mtimeMs > 0) {
386546
386570
  const age = nowMs - raw.mtimeMs;
386547
386571
  if (age >= 0 && age < maxAgeMs) {
386548
386572
  score += 2;
386549
- reasons3.push("recently modified");
386573
+ reasons4.push("recently modified");
386550
386574
  } else if (age < 0) {
386551
386575
  score += 1;
386552
- reasons3.push("fresh metadata");
386576
+ reasons4.push("fresh metadata");
386553
386577
  } else {
386554
- reasons3.push("older artifact");
386578
+ reasons4.push("older artifact");
386555
386579
  }
386556
386580
  }
386557
386581
  const pathSignal = chunks.join("/");
@@ -386560,7 +386584,7 @@ function claimDiscoveryFallbackCandidates(files, maxCandidates) {
386560
386584
  ranked.push({
386561
386585
  path: pathSignal,
386562
386586
  score,
386563
- reasons: [...new Set(reasons3)].slice(0, 3)
386587
+ reasons: [...new Set(reasons4)].slice(0, 3)
386564
386588
  });
386565
386589
  }
386566
386590
  ranked.sort((left, right) => right.score !== left.score ? right.score - left.score : left.path.localeCompare(right.path));
@@ -386997,27 +387021,27 @@ function buildFallbackSemanticChunks(items, maxChunks = 7) {
386997
387021
  return chunks.slice(0, maxChunks);
386998
387022
  }
386999
387023
  function shouldRunDynamicContextConsolidation(input) {
387000
- const reasons3 = [];
387024
+ const reasons4 = [];
387001
387025
  const rawRatio = input.snapshot.rawRatio;
387002
387026
  if (input.snapshot.rawTokens > input.snapshot.targetTokens)
387003
- reasons3.push("raw_tokens_over_target");
387027
+ reasons4.push("raw_tokens_over_target");
387004
387028
  if (rawRatio >= 0.85)
387005
- reasons3.push("raw_ratio_high");
387029
+ reasons4.push("raw_ratio_high");
387006
387030
  const dropped = input.frameDiagnostics?.droppedSignals ?? input.snapshot.droppedSignals ?? 0;
387007
387031
  const truncated = input.frameDiagnostics?.truncatedSignals ?? input.snapshot.truncatedSignals ?? 0;
387008
387032
  if (dropped > 0 || truncated > 0)
387009
- reasons3.push("fabric_pressure");
387033
+ reasons4.push("fabric_pressure");
387010
387034
  const retention = Number(input.forgettingReport?.["retentionScore"] ?? input.forgettingReport?.["retention"] ?? NaN);
387011
387035
  const interference = Number(input.forgettingReport?.["interferenceScore"] ?? input.forgettingReport?.["interference"] ?? NaN);
387012
387036
  if (Number.isFinite(retention) && retention < 0.45)
387013
- reasons3.push("low_retention");
387037
+ reasons4.push("low_retention");
387014
387038
  if (Number.isFinite(interference) && interference > 0.65)
387015
- reasons3.push("high_interference");
387039
+ reasons4.push("high_interference");
387016
387040
  if (input.memoryHelperDecision === true)
387017
- reasons3.push("memory_helper_trigger");
387041
+ reasons4.push("memory_helper_trigger");
387018
387042
  return {
387019
- shouldRun: reasons3.length > 0,
387020
- reasons: [...new Set(reasons3)],
387043
+ shouldRun: reasons4.length > 0,
387044
+ reasons: [...new Set(reasons4)],
387021
387045
  rawRatio
387022
387046
  };
387023
387047
  }
@@ -409797,13 +409821,13 @@ ${rawTask}`;
409797
409821
  const lowerBase = (path7.split("/").at(-1) ?? "").toLowerCase();
409798
409822
  const chunks = lowerPath.split("/").filter(Boolean);
409799
409823
  let score = 0;
409800
- const reasons3 = [];
409824
+ const reasons4 = [];
409801
409825
  for (const hint of explicitPathHints) {
409802
409826
  if (!matchHintToInventoryPath(path7, hint))
409803
409827
  continue;
409804
409828
  unmatchedHints.delete(hint);
409805
409829
  score += 120;
409806
- reasons3.push(`explicit path hint "${hint}" matches path`);
409830
+ reasons4.push(`explicit path hint "${hint}" matches path`);
409807
409831
  }
409808
409832
  for (const token5 of meaningfulTaskTokens) {
409809
409833
  const lowerToken = token5.toLowerCase();
@@ -409811,20 +409835,20 @@ ${rawTask}`;
409811
409835
  continue;
409812
409836
  if (chunks.some((chunk) => chunk === lowerToken)) {
409813
409837
  score += 40;
409814
- reasons3.push(`segment token match (${lowerToken})`);
409838
+ reasons4.push(`segment token match (${lowerToken})`);
409815
409839
  } else if (lowerPath.includes(lowerToken)) {
409816
409840
  score += 14;
409817
- reasons3.push(`path includes task token (${lowerToken})`);
409841
+ reasons4.push(`path includes task token (${lowerToken})`);
409818
409842
  } else if (chunkHasSymbolMatch(lowerToken, lowerBase)) {
409819
409843
  score += 6;
409820
- reasons3.push(`base symbol overlap (${lowerToken})`);
409844
+ reasons4.push(`base symbol overlap (${lowerToken})`);
409821
409845
  }
409822
409846
  }
409823
409847
  if (score > 0) {
409824
409848
  scored.push({
409825
409849
  path: path7,
409826
409850
  score,
409827
- reasons: [...new Set(reasons3)].slice(0, 3)
409851
+ reasons: [...new Set(reasons4)].slice(0, 3)
409828
409852
  });
409829
409853
  }
409830
409854
  }
@@ -427389,7 +427413,7 @@ function computeEffectiveThink(params) {
427389
427413
  if (params.suppressed)
427390
427414
  return false;
427391
427415
  if (params.hasTools)
427392
- return params.requestThink ?? params.defaultThink;
427416
+ return false;
427393
427417
  const userOptedIn = params.requestThink === true || params.requestThink === void 0 && params.defaultThink === true;
427394
427418
  if (userOptedIn)
427395
427419
  return true;