@remnic/core 10.0.185 → 10.0.186

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.
Files changed (36) hide show
  1. package/dist/access-admin-ops-surface.js +1 -1
  2. package/dist/access-cli.js +1 -1
  3. package/dist/access-extraction-force-flush-preempt.js +1 -1
  4. package/dist/access-extraction-force-flush.js +1 -1
  5. package/dist/access-http-briefing.js +1 -1
  6. package/dist/access-http-query.js +1 -1
  7. package/dist/access-http.js +1 -1
  8. package/dist/access-identity-continuity-surface.js +1 -1
  9. package/dist/access-lcm-surface.js +1 -1
  10. package/dist/access-mcp.js +1 -1
  11. package/dist/access-observe-write-surface.js +1 -1
  12. package/dist/access-operations-batch.js +1 -1
  13. package/dist/access-operations.js +1 -1
  14. package/dist/access-recall-concurrency.js +1 -1
  15. package/dist/access-recall-response.js +1 -1
  16. package/dist/access-recall-surface.js +1 -1
  17. package/dist/access-service.js +1 -1
  18. package/dist/{chunk-EWLOIHAZ.js → chunk-3GD5SFDT.js} +2 -2
  19. package/dist/{chunk-TCSY74IN.js → chunk-LALPM2DN.js} +43 -6
  20. package/dist/chunk-LALPM2DN.js.map +1 -0
  21. package/dist/cli.js +1 -1
  22. package/dist/explicit-capture.js +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/orchestration/backlog-scheduler.js +2 -2
  25. package/dist/orchestration/buffer-drain-runner.js +2 -2
  26. package/dist/orchestration/extraction-queue-coordinator.d.ts +20 -0
  27. package/dist/orchestration/extraction-queue-coordinator.d.ts.map +1 -1
  28. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  29. package/dist/orchestrator.js +1 -1
  30. package/dist/recall-navigation.js +1 -1
  31. package/package.json +2 -2
  32. package/src/orchestration/extraction-queue-coordinator.ts +64 -3
  33. package/src/orchestration/extraction-queue-lane-bias.test.ts +185 -0
  34. package/src/orchestration/turn-ingestion.ts +7 -1
  35. package/dist/chunk-TCSY74IN.js.map +0 -1
  36. /package/dist/{chunk-EWLOIHAZ.js.map → chunk-3GD5SFDT.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessAdminOpsSurface
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessService,
3
3
  Orchestrator
4
- } from "./chunk-TCSY74IN.js";
4
+ } from "./chunk-LALPM2DN.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-A3HLZMHD.js";
7
7
  import "./chunk-GOZXQNIM.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  forceFlushPreemptCall,
3
3
  forceFlushPreemptCallback
4
- } from "./chunk-TCSY74IN.js";
4
+ } from "./chunk-LALPM2DN.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-A3HLZMHD.js";
7
7
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  extractionForceFlush
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  respondBriefingHttp
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -3,7 +3,7 @@ import {
3
3
  optionalNamespaceKindQueryParam,
4
4
  optionalQueryString,
5
5
  positiveIntQueryParam
6
- } from "./chunk-TCSY74IN.js";
6
+ } from "./chunk-LALPM2DN.js";
7
7
  import "./chunk-PQM3B54K.js";
8
8
  import "./chunk-A3HLZMHD.js";
9
9
  import "./chunk-GOZXQNIM.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessHttpServer,
3
3
  resolveDefaultAdminConsolePublicDir
4
- } from "./chunk-TCSY74IN.js";
4
+ } from "./chunk-LALPM2DN.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-A3HLZMHD.js";
7
7
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessIdentityContinuitySurface
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessLcmSurface
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -2,7 +2,7 @@ import {
2
2
  EngramMcpServer,
3
3
  MCP_MIGRATED_OPERATIONS,
4
4
  MCP_SUPPORTED_PROTOCOL_VERSIONS
5
- } from "./chunk-TCSY74IN.js";
5
+ } from "./chunk-LALPM2DN.js";
6
6
  import "./chunk-PQM3B54K.js";
7
7
  import "./chunk-A3HLZMHD.js";
8
8
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessObserveWriteSurface
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -1,4 +1,4 @@
1
- import "./chunk-TCSY74IN.js";
1
+ import "./chunk-LALPM2DN.js";
2
2
  import "./chunk-PQM3B54K.js";
3
3
  import "./chunk-A3HLZMHD.js";
4
4
  import "./chunk-GOZXQNIM.js";
@@ -22,7 +22,7 @@ import {
22
22
  memoryGetOperation,
23
23
  memorySearchOperation,
24
24
  memoryStoreOperation
25
- } from "./chunk-TCSY74IN.js";
25
+ } from "./chunk-LALPM2DN.js";
26
26
  import "./chunk-PQM3B54K.js";
27
27
  import "./chunk-A3HLZMHD.js";
28
28
  import "./chunk-GOZXQNIM.js";
@@ -4,7 +4,7 @@ import {
4
4
  createAndStartFlight,
5
5
  leadRecallFlight,
6
6
  withRecallConcurrency
7
- } from "./chunk-TCSY74IN.js";
7
+ } from "./chunk-LALPM2DN.js";
8
8
  import "./chunk-PQM3B54K.js";
9
9
  import "./chunk-A3HLZMHD.js";
10
10
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  assembleRecallResponse
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessRecallSurface
3
- } from "./chunk-TCSY74IN.js";
3
+ } from "./chunk-LALPM2DN.js";
4
4
  import "./chunk-PQM3B54K.js";
5
5
  import "./chunk-A3HLZMHD.js";
6
6
  import "./chunk-GOZXQNIM.js";
@@ -4,7 +4,7 @@ import {
4
4
  buildProjectedGovernanceProposedActions,
5
5
  hasGroupedGovernanceActions,
6
6
  shapeMemorySummary
7
- } from "./chunk-TCSY74IN.js";
7
+ } from "./chunk-LALPM2DN.js";
8
8
  import "./chunk-PQM3B54K.js";
9
9
  import "./chunk-A3HLZMHD.js";
10
10
  import "./chunk-GOZXQNIM.js";
@@ -2,7 +2,7 @@ import {
2
2
  ExtractionDrain,
3
3
  TurnIngestionCoordinator,
4
4
  shouldSkipImplicitExtraction
5
- } from "./chunk-TCSY74IN.js";
5
+ } from "./chunk-LALPM2DN.js";
6
6
  import {
7
7
  headerConnector,
8
8
  renderExtractionConversation,
@@ -447,4 +447,4 @@ export {
447
447
  ClaimBufferStorage,
448
448
  BufferDrainRunner
449
449
  };
450
- //# sourceMappingURL=chunk-EWLOIHAZ.js.map
450
+ //# sourceMappingURL=chunk-3GD5SFDT.js.map
@@ -4863,7 +4863,7 @@ var TierMigrationCoordinator = class {
4863
4863
  };
4864
4864
 
4865
4865
  // src/orchestration/extraction-queue-coordinator.ts
4866
- var ExtractionQueueCoordinator = class {
4866
+ var ExtractionQueueCoordinator = class _ExtractionQueueCoordinator {
4867
4867
  /** Maximum tasks that run at the same time (config `extractionQueueConcurrency`). */
4868
4868
  concurrency;
4869
4869
  /**
@@ -4886,6 +4886,15 @@ var ExtractionQueueCoordinator = class {
4886
4886
  /** Preempt slots of the currently running tasks, keyed by slot identity. */
4887
4887
  preemptSlots = /* @__PURE__ */ new Map();
4888
4888
  preemptSeq = 0;
4889
+ /** Running tasks per lane — the backlog share and the foreground floor. */
4890
+ activeBacklog = 0;
4891
+ activeForeground = 0;
4892
+ /**
4893
+ * Slots kept available for foreground (non-backlog) tasks while backlog
4894
+ * work also waits. A floor of one keeps live sessions extracting even at
4895
+ * full backlog pressure; backlog tasks fill the rest.
4896
+ */
4897
+ static FOREGROUND_FLOOR = 1;
4889
4898
  /** Resolves the processor's park while a new task arrives mid-drain. */
4890
4899
  wake;
4891
4900
  constructor(concurrency = 2) {
@@ -4912,7 +4921,7 @@ var ExtractionQueueCoordinator = class {
4912
4921
  enqueue(task, options) {
4913
4922
  if (!this.accepting) return false;
4914
4923
  const key = options?.key;
4915
- const entry = { run: task, key };
4924
+ const entry = { run: task, key, backlog: options?.backlog, front: options?.front };
4916
4925
  if (options?.front) {
4917
4926
  this.preemptRunning(options.key);
4918
4927
  this.queue.unshift(entry);
@@ -4968,7 +4977,8 @@ var ExtractionQueueCoordinator = class {
4968
4977
  const armed = Array.from(this.preemptSlots.values()).filter((slot) => slot.armed !== void 0);
4969
4978
  if (armed.length === 0) return;
4970
4979
  const preferred = preferredKey !== void 0 ? armed.find((slot) => slot.key === preferredKey) : void 0;
4971
- const chosen = preferred ?? armed.reduce((a, b) => (b.armed?.seq ?? -1) > (a.armed?.seq ?? -1) ? b : a);
4980
+ const victims = armed.some((slot) => slot.backlog !== true) ? armed.filter((slot) => slot.backlog !== true) : armed;
4981
+ const chosen = preferred ?? victims.reduce((a, b) => (b.armed?.seq ?? -1) > (a.armed?.seq ?? -1) ? b : a);
4972
4982
  const abort = chosen.armed?.abort;
4973
4983
  chosen.armed = void 0;
4974
4984
  abort?.();
@@ -5053,11 +5063,30 @@ var ExtractionQueueCoordinator = class {
5053
5063
  }
5054
5064
  /** Take the next queue entry whose key is not already running or reserved (FIFO within a key). */
5055
5065
  takeRunnable() {
5066
+ if (this.queue[0]?.front === true) {
5067
+ const front = this.takeFirstMatching((entry) => entry.front === true);
5068
+ if (front) return front;
5069
+ }
5070
+ if (this.activeForeground < _ExtractionQueueCoordinator.FOREGROUND_FLOOR) {
5071
+ const foreground = this.takeFirstMatching((entry) => entry.backlog !== true);
5072
+ if (foreground) return foreground;
5073
+ }
5074
+ if (this.activeBacklog < Math.max(this.concurrency - 1, 1)) {
5075
+ const backlog = this.takeFirstMatching((entry) => entry.backlog === true);
5076
+ if (backlog) return backlog;
5077
+ }
5078
+ return this.takeFirstMatching((entry) => entry.backlog !== true);
5079
+ }
5080
+ /** First queue entry satisfying `match` whose key is free to run. */
5081
+ takeFirstMatching(match) {
5056
5082
  for (let index = 0; index < this.queue.length; index += 1) {
5057
5083
  const entry = this.queue[index];
5084
+ if (!match(entry)) continue;
5058
5085
  if (entry.key !== void 0 && (this.activeKeys.has(entry.key) || this.reservedKeys.has(entry.key))) continue;
5059
5086
  this.queue.splice(index, 1);
5060
5087
  if (entry.key !== void 0) this.activeKeys.add(entry.key);
5088
+ if (entry.backlog === true) this.activeBacklog += 1;
5089
+ else this.activeForeground += 1;
5061
5090
  return entry;
5062
5091
  }
5063
5092
  return void 0;
@@ -5065,13 +5094,15 @@ var ExtractionQueueCoordinator = class {
5065
5094
  /** Run one entry with its own preempt slot; failures are classified + logged. */
5066
5095
  async runEntry(entry) {
5067
5096
  const slot = {};
5068
- this.preemptSlots.set(slot, { key: entry.key });
5097
+ this.preemptSlots.set(slot, { key: entry.key, backlog: entry.backlog });
5069
5098
  try {
5070
5099
  await entry.run(this.createPreemptHandle(slot));
5071
5100
  } catch (err) {
5072
5101
  this.logExtractionQueueFailure(err, "task");
5073
5102
  } finally {
5074
5103
  this.preemptSlots.delete(slot);
5104
+ if (entry.backlog === true) this.activeBacklog -= 1;
5105
+ else this.activeForeground -= 1;
5075
5106
  if (entry.key !== void 0) this.activeKeys.delete(entry.key);
5076
5107
  }
5077
5108
  }
@@ -22113,7 +22144,13 @@ var TurnIngestionCoordinator = class {
22113
22144
  if (sharingNode) this.snapshotSharing.release(sharingNode);
22114
22145
  exit.report();
22115
22146
  }
22116
- }, { front: options.preemptRunning === true, key: bufferKey });
22147
+ }, {
22148
+ front: options.preemptRunning === true,
22149
+ key: bufferKey,
22150
+ // Claim/drain tasks (options.execution carries the claim-backed buffer)
22151
+ // take the backlog lane: biased to fill all-but-foreground-floor slots.
22152
+ backlog: options.execution !== void 0
22153
+ });
22117
22154
  if (!accepted) {
22118
22155
  if (sharingNode) this.snapshotSharing.release(sharingNode);
22119
22156
  settleTask(new Error("extraction queue is stopped"));
@@ -68044,4 +68081,4 @@ export {
68044
68081
  EngramAccessService,
68045
68082
  AccessAdminOpsSurface
68046
68083
  };
68047
- //# sourceMappingURL=chunk-TCSY74IN.js.map
68084
+ //# sourceMappingURL=chunk-LALPM2DN.js.map