@remnic/core 10.0.97 → 10.0.99

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 (47) 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.js +1 -1
  4. package/dist/access-http-briefing.js +1 -1
  5. package/dist/access-http-query.js +1 -1
  6. package/dist/access-http.js +1 -1
  7. package/dist/access-identity-continuity-surface.js +1 -1
  8. package/dist/access-lcm-surface.js +1 -1
  9. package/dist/access-mcp.js +1 -1
  10. package/dist/access-observe-write-surface.js +1 -1
  11. package/dist/access-operations-batch.js +1 -1
  12. package/dist/access-operations.js +1 -1
  13. package/dist/access-recall-concurrency.js +1 -1
  14. package/dist/access-recall-response.js +1 -1
  15. package/dist/access-recall-surface.js +1 -1
  16. package/dist/access-service.js +1 -1
  17. package/dist/{chunk-AMRGZOIP.js → chunk-UBJ5RPDM.js} +2 -2
  18. package/dist/{chunk-3ETADXEP.js → chunk-VZMRKYNR.js} +40 -3
  19. package/dist/chunk-VZMRKYNR.js.map +1 -0
  20. package/dist/cli.js +1 -1
  21. package/dist/explicit-capture.js +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/orchestration/backlog-scheduler.d.ts +6 -1
  24. package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
  25. package/dist/orchestration/backlog-scheduler.js +20 -4
  26. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  27. package/dist/orchestration/buffer-drain-runner.js +2 -2
  28. package/dist/orchestration/orchestrator-init.d.ts +3 -0
  29. package/dist/orchestration/orchestrator-init.d.ts.map +1 -1
  30. package/dist/orchestration/task-exit.d.ts +15 -0
  31. package/dist/orchestration/task-exit.d.ts.map +1 -0
  32. package/dist/orchestration/turn-ingestion.d.ts +1 -7
  33. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  34. package/dist/orchestrator.d.ts.map +1 -1
  35. package/dist/orchestrator.js +1 -1
  36. package/dist/recall-navigation.js +1 -1
  37. package/package.json +2 -2
  38. package/src/backlog-scheduler.test.ts +48 -0
  39. package/src/orchestration/backlog-scheduler.ts +23 -2
  40. package/src/orchestration/extraction-queue-bounded-retention.test.ts +20 -0
  41. package/src/orchestration/orchestrator-init.ts +25 -0
  42. package/src/orchestration/task-exit.ts +27 -0
  43. package/src/orchestration/turn-ingestion.ts +7 -9
  44. package/src/orchestrator-init.test.ts +132 -1
  45. package/src/orchestrator.ts +3 -0
  46. package/dist/chunk-3ETADXEP.js.map +0 -1
  47. /package/dist/{chunk-AMRGZOIP.js.map → chunk-UBJ5RPDM.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessAdminOpsSurface
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessService,
3
3
  Orchestrator
4
- } from "./chunk-3ETADXEP.js";
4
+ } from "./chunk-VZMRKYNR.js";
5
5
  import "./chunk-6P7U3HWG.js";
6
6
  import "./chunk-PQM3B54K.js";
7
7
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  extractionForceFlush
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  respondBriefingHttp
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -3,7 +3,7 @@ import {
3
3
  optionalNamespaceKindQueryParam,
4
4
  optionalQueryString,
5
5
  positiveIntQueryParam
6
- } from "./chunk-3ETADXEP.js";
6
+ } from "./chunk-VZMRKYNR.js";
7
7
  import "./chunk-6P7U3HWG.js";
8
8
  import "./chunk-PQM3B54K.js";
9
9
  import "./chunk-B3DR2JBZ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EngramAccessHttpServer,
3
3
  resolveDefaultAdminConsolePublicDir
4
- } from "./chunk-3ETADXEP.js";
4
+ } from "./chunk-VZMRKYNR.js";
5
5
  import "./chunk-6P7U3HWG.js";
6
6
  import "./chunk-PQM3B54K.js";
7
7
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessIdentityContinuitySurface
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessLcmSurface
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -2,7 +2,7 @@ import {
2
2
  EngramMcpServer,
3
3
  MCP_MIGRATED_OPERATIONS,
4
4
  MCP_SUPPORTED_PROTOCOL_VERSIONS
5
- } from "./chunk-3ETADXEP.js";
5
+ } from "./chunk-VZMRKYNR.js";
6
6
  import "./chunk-6P7U3HWG.js";
7
7
  import "./chunk-PQM3B54K.js";
8
8
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessObserveWriteSurface
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -1,4 +1,4 @@
1
- import "./chunk-3ETADXEP.js";
1
+ import "./chunk-VZMRKYNR.js";
2
2
  import "./chunk-6P7U3HWG.js";
3
3
  import "./chunk-PQM3B54K.js";
4
4
  import "./chunk-B3DR2JBZ.js";
@@ -22,7 +22,7 @@ import {
22
22
  memoryGetOperation,
23
23
  memorySearchOperation,
24
24
  memoryStoreOperation
25
- } from "./chunk-3ETADXEP.js";
25
+ } from "./chunk-VZMRKYNR.js";
26
26
  import "./chunk-6P7U3HWG.js";
27
27
  import "./chunk-PQM3B54K.js";
28
28
  import "./chunk-B3DR2JBZ.js";
@@ -4,7 +4,7 @@ import {
4
4
  createAndStartFlight,
5
5
  leadRecallFlight,
6
6
  withRecallConcurrency
7
- } from "./chunk-3ETADXEP.js";
7
+ } from "./chunk-VZMRKYNR.js";
8
8
  import "./chunk-6P7U3HWG.js";
9
9
  import "./chunk-PQM3B54K.js";
10
10
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  assembleRecallResponse
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AccessRecallSurface
3
- } from "./chunk-3ETADXEP.js";
3
+ } from "./chunk-VZMRKYNR.js";
4
4
  import "./chunk-6P7U3HWG.js";
5
5
  import "./chunk-PQM3B54K.js";
6
6
  import "./chunk-B3DR2JBZ.js";
@@ -4,7 +4,7 @@ import {
4
4
  buildProjectedGovernanceProposedActions,
5
5
  hasGroupedGovernanceActions,
6
6
  shapeMemorySummary
7
- } from "./chunk-3ETADXEP.js";
7
+ } from "./chunk-VZMRKYNR.js";
8
8
  import "./chunk-6P7U3HWG.js";
9
9
  import "./chunk-PQM3B54K.js";
10
10
  import "./chunk-B3DR2JBZ.js";
@@ -2,7 +2,7 @@ import {
2
2
  ExtractionDrain,
3
3
  TurnIngestionCoordinator,
4
4
  shouldSkipImplicitExtraction
5
- } from "./chunk-3ETADXEP.js";
5
+ } from "./chunk-VZMRKYNR.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-AMRGZOIP.js.map
450
+ //# sourceMappingURL=chunk-UBJ5RPDM.js.map
@@ -21076,6 +21076,26 @@ var ExtractionSnapshotSharingRegistry = class {
21076
21076
  }
21077
21077
  };
21078
21078
 
21079
+ // src/orchestration/task-exit.ts
21080
+ function createTaskExit(onExit) {
21081
+ let started = false;
21082
+ let reported = false;
21083
+ const report = () => {
21084
+ if (reported) return;
21085
+ reported = true;
21086
+ onExit?.();
21087
+ };
21088
+ return {
21089
+ start: () => {
21090
+ started = true;
21091
+ },
21092
+ settled: () => {
21093
+ if (!started) report();
21094
+ },
21095
+ report
21096
+ };
21097
+ }
21098
+
21079
21099
  // src/orchestration/turn-ingestion.ts
21080
21100
  function isFlushPlanRecoveryTurn(turn) {
21081
21101
  const provenance = turn.importProvenance;
@@ -21527,6 +21547,7 @@ var TurnIngestionCoordinator = class {
21527
21547
  const extractionDeadlineMs = typeof options.extractionDeadlineMs === "number" && Number.isFinite(options.extractionDeadlineMs) ? options.extractionDeadlineMs : void 0;
21528
21548
  let timeout;
21529
21549
  let settled = false;
21550
+ const exit = createTaskExit(options.onTaskExit);
21530
21551
  const clearQueueWaitTimer = () => {
21531
21552
  if (timeout) {
21532
21553
  clearTimeout(timeout);
@@ -21546,6 +21567,7 @@ var TurnIngestionCoordinator = class {
21546
21567
  clearQueueWaitTimer();
21547
21568
  clearAbortListener();
21548
21569
  options.onTaskSettled?.(error, result);
21570
+ exit.settled();
21549
21571
  return true;
21550
21572
  };
21551
21573
  if (options.abortSignal) {
@@ -21581,6 +21603,7 @@ var TurnIngestionCoordinator = class {
21581
21603
  const sharingNode = automaticSnapshotSharingEligible(options) && turnsToExtract.length > 0 ? this.snapshotSharing.admit(bufferKey, turnsToExtract) : void 0;
21582
21604
  const queuedTurnsSource = sharingNode ? { chain: sharingNode } : { direct: turnsToExtract };
21583
21605
  const accepted = this.deps.extractionQueueCoordinator.enqueue(async (preemptHandle) => {
21606
+ exit.start();
21584
21607
  try {
21585
21608
  await this.deps.extractionQueueCoordinator.runPreemptable(preemptHandle, preemptable, options.abortSignal, async (abortSignal) => {
21586
21609
  if (settled) return;
@@ -21709,13 +21732,13 @@ var TurnIngestionCoordinator = class {
21709
21732
  });
21710
21733
  } finally {
21711
21734
  if (sharingNode) this.snapshotSharing.release(sharingNode);
21712
- options.onTaskExit?.();
21735
+ exit.report();
21713
21736
  }
21714
21737
  }, { front: options.preemptRunning === true, key: bufferKey });
21715
21738
  if (!accepted) {
21716
21739
  if (sharingNode) this.snapshotSharing.release(sharingNode);
21717
21740
  settleTask(new Error("extraction queue is stopped"));
21718
- options.onTaskExit?.();
21741
+ exit.report();
21719
21742
  return;
21720
21743
  }
21721
21744
  log.debug(`queued extraction from ${reason}`);
@@ -22578,6 +22601,7 @@ var OrchestratorInitCoordinator = class {
22578
22601
  correctionRecoveryChain = Promise.resolve();
22579
22602
  startupEpochAbort;
22580
22603
  startupStorageWrites = /* @__PURE__ */ new Set();
22604
+ startupWarmups = /* @__PURE__ */ new Set();
22581
22605
  /** Retire the current lifecycle without constructing a lazy coordinator. */
22582
22606
  retireStartupEpoch() {
22583
22607
  this.startupEpochAbort?.controller.abort();
@@ -22594,6 +22618,10 @@ var OrchestratorInitCoordinator = class {
22594
22618
  this.startupStorageWrites.delete(write);
22595
22619
  }
22596
22620
  }
22621
+ /** Wait for background startup warm-ups; destroy() only, never the deferredReady gate. */
22622
+ async drainStartupWarmups() {
22623
+ await Promise.allSettled([...this.startupWarmups]);
22624
+ }
22597
22625
  async drainEntityMigrations() {
22598
22626
  await Promise.allSettled([...this.startupStorageWrites]);
22599
22627
  const drains = [this.deps.storage.drainEntityCanonicalIdMigration()];
@@ -22991,6 +23019,14 @@ var OrchestratorInitCoordinator = class {
22991
23019
  this.deps.deferredSyncSucceeded = true;
22992
23020
  }
22993
23021
  if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
23022
+ const factHashWarm = (async () => {
23023
+ const storage = await this.deps.storageRouter.storageFor(this.deps.config.defaultNamespace);
23024
+ await storage.isFactContentHashAuthoritative();
23025
+ })().catch((err) => {
23026
+ log.debug(`fact-hash index startup warm-up failed (non-fatal): ${err}`);
23027
+ });
23028
+ this.startupWarmups.add(factHashWarm);
23029
+ void factHashWarm.finally(() => this.startupWarmups.delete(factHashWarm));
22994
23030
  const warmupPromises = [];
22995
23031
  if (this.deps.qmd.isAvailable()) {
22996
23032
  const warmupNs = this.deps.config.defaultNamespace;
@@ -28052,6 +28088,7 @@ var Orchestrator = class {
28052
28088
  } catch (err) {
28053
28089
  bufferFlushError = err;
28054
28090
  }
28091
+ await this._orchestratorInitCoordinator?.drainStartupWarmups();
28055
28092
  const extractionDrainError = await drainExtractionAndShutdownDependencyPropagation(
28056
28093
  this.extractionQueueCoordinator,
28057
28094
  this._dependencyPropagationDelivery
@@ -67163,4 +67200,4 @@ export {
67163
67200
  EngramAccessService,
67164
67201
  AccessAdminOpsSurface
67165
67202
  };
67166
- //# sourceMappingURL=chunk-3ETADXEP.js.map
67203
+ //# sourceMappingURL=chunk-VZMRKYNR.js.map