@remnic/core 9.63.7 → 9.63.9

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 (153) hide show
  1. package/dist/access-admin-ops-surface.d.ts +3 -2
  2. package/dist/access-admin-ops-surface.js +11 -9
  3. package/dist/access-authorization-probe.d.ts +3 -2
  4. package/dist/access-authorization-probe.js +12 -10
  5. package/dist/access-boundary.d.ts +3 -2
  6. package/dist/access-boundary.js +11 -9
  7. package/dist/access-cli.js +46 -45
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-extraction-force-flush.d.ts +3 -2
  10. package/dist/access-extraction-force-flush.js +11 -9
  11. package/dist/access-http-lcm-compaction.d.ts +3 -2
  12. package/dist/access-http-lifecycle-flush.d.ts +3 -2
  13. package/dist/access-http-offline-stream.d.ts +3 -2
  14. package/dist/access-http-query.js +11 -9
  15. package/dist/access-http.d.ts +4 -3
  16. package/dist/access-http.js +24 -22
  17. package/dist/access-identity-continuity-surface.d.ts +2 -1
  18. package/dist/access-identity-continuity-surface.js +11 -9
  19. package/dist/access-lcm-surface.d.ts +3 -2
  20. package/dist/access-lcm-surface.js +11 -9
  21. package/dist/access-mcp-output-schemas.js +1 -1
  22. package/dist/access-mcp.d.ts +3 -2
  23. package/dist/access-mcp.js +19 -17
  24. package/dist/access-namespace-preflight.js +11 -9
  25. package/dist/access-observe-write-surface.d.ts +3 -2
  26. package/dist/access-observe-write-surface.js +11 -9
  27. package/dist/access-offline-manifest.d.ts +2 -1
  28. package/dist/access-offline-manifest.js +3 -3
  29. package/dist/access-operations-batch.js +13 -11
  30. package/dist/access-operations.d.ts +3 -2
  31. package/dist/access-operations.js +17 -15
  32. package/dist/access-recall-concurrency.d.ts +3 -2
  33. package/dist/access-recall-concurrency.js +11 -9
  34. package/dist/access-recall-response.d.ts +3 -2
  35. package/dist/access-recall-response.js +11 -9
  36. package/dist/access-recall-surface.d.ts +3 -2
  37. package/dist/access-recall-surface.js +11 -9
  38. package/dist/access-schema.js +5 -5
  39. package/dist/{access-service-CocW74uA.d.ts → access-service-DwfdjqkZ.d.ts} +1 -1
  40. package/dist/access-service-helpers.d.ts +3 -2
  41. package/dist/access-service.d.ts +3 -2
  42. package/dist/access-service.js +11 -9
  43. package/dist/access-surface-catalog.d.ts +3 -2
  44. package/dist/access-surface-catalog.js +13 -11
  45. package/dist/access-surface-catalog.js.map +1 -1
  46. package/dist/active-recall.js +3 -3
  47. package/dist/bootstrap.d.ts +2 -1
  48. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
  49. package/dist/chunk-2YA5N2BY.js +65 -0
  50. package/dist/chunk-2YA5N2BY.js.map +1 -0
  51. package/dist/{chunk-5S5DUJFJ.js → chunk-3IMYRX3W.js} +2 -2
  52. package/dist/{chunk-QIZOU3FN.js → chunk-5OOTHWGJ.js} +2 -2
  53. package/dist/{chunk-YMQKPSB2.js → chunk-5TF5STAV.js} +4 -4
  54. package/dist/{chunk-PMVPCZJZ.js → chunk-6433HV72.js} +2 -2
  55. package/dist/{chunk-WKJTMXME.js → chunk-BPQ7L27U.js} +44 -42
  56. package/dist/{chunk-WKJTMXME.js.map → chunk-BPQ7L27U.js.map} +1 -1
  57. package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
  58. package/dist/{chunk-IBZQQOM5.js → chunk-DGUVXXAU.js} +3 -3
  59. package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
  60. package/dist/{chunk-HXZNTZ3Y.js → chunk-EDZNW3HE.js} +5 -5
  61. package/dist/{chunk-2L7DKNVE.js → chunk-FZEEWOI2.js} +4 -4
  62. package/dist/{chunk-XNJQZLAP.js → chunk-I2HTKOOP.js} +2 -2
  63. package/dist/{chunk-3S3PNR5H.js → chunk-KXWE62IH.js} +2 -2
  64. package/dist/{chunk-SYJW273H.js → chunk-LTYH2L6E.js} +12 -12
  65. package/dist/{chunk-YIMV2KYM.js → chunk-N7V3P4V5.js} +2 -2
  66. package/dist/{chunk-OOJCXJBN.js → chunk-O52TB5SL.js} +2 -2
  67. package/dist/{chunk-PZKWPXRF.js → chunk-PHKU6BZ2.js} +2 -2
  68. package/dist/{chunk-H4GQ2Y24.js → chunk-PQHNZ63P.js} +4 -4
  69. package/dist/{chunk-7ZAC2C2U.js → chunk-SY5JUJ2X.js} +35 -35
  70. package/dist/{chunk-YYQAKIDJ.js → chunk-VD2OT77P.js} +2 -2
  71. package/dist/chunk-VD2OT77P.js.map +1 -0
  72. package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
  73. package/dist/{chunk-WZDTSBGQ.js → chunk-VYMICVRA.js} +2 -2
  74. package/dist/{chunk-XV6PUXJ5.js → chunk-WBPD6SBZ.js} +52 -59
  75. package/dist/chunk-WBPD6SBZ.js.map +1 -0
  76. package/dist/{chunk-3NZAVWU5.js → chunk-ZOAAY2OE.js} +2 -2
  77. package/dist/{chunk-PRDJMOST.js → chunk-ZVZHG7AI.js} +65 -15
  78. package/dist/chunk-ZVZHG7AI.js.map +1 -0
  79. package/dist/{chunk-IINVXO3U.js → chunk-ZWYXSF2T.js} +2 -2
  80. package/dist/{cli-BTNj5DzK.d.ts → cli-kcUqoV4E.d.ts} +2 -2
  81. package/dist/cli.d.ts +4 -3
  82. package/dist/cli.js +36 -34
  83. package/dist/config.js +3 -3
  84. package/dist/explicit-capture.d.ts +2 -1
  85. package/dist/external-wiki-access.d.ts +3 -2
  86. package/dist/external-wiki-access.js +12 -10
  87. package/dist/external-wiki-mcp-tools.d.ts +3 -2
  88. package/dist/{first-start-migration-Q2VB2E2D.js → first-start-migration-4NETATFF.js} +4 -4
  89. package/dist/included-memories.d.ts +11 -0
  90. package/dist/included-memories.js +14 -0
  91. package/dist/included-memories.js.map +1 -0
  92. package/dist/index.d.ts +6 -5
  93. package/dist/index.js +57 -56
  94. package/dist/lcm/index.js +3 -3
  95. package/dist/mcp-memory-inspector-app.d.ts +3 -2
  96. package/dist/offline-sync.js +2 -2
  97. package/dist/operator-toolkit.js +4 -4
  98. package/dist/{orchestrator-CSc9GfQv.d.ts → orchestrator-Bay_AofR.d.ts} +2 -3
  99. package/dist/orchestrator.d.ts +2 -1
  100. package/dist/orchestrator.js +46 -45
  101. package/dist/{public-http-BmPktTe3.d.ts → public-http-DscQtnCx.d.ts} +1 -1
  102. package/dist/recall-explain-renderer.d.ts +1 -0
  103. package/dist/recall-state.d.ts +6 -2
  104. package/dist/recall-state.js +6 -2
  105. package/dist/resume-bundles.js +4 -4
  106. package/dist/support-passport/index.d.ts +6 -5
  107. package/dist/support-passport/index.js +14 -12
  108. package/dist/transfer/backup.js +2 -2
  109. package/dist/transfer/capsule-export.js +2 -2
  110. package/dist/transfer/capsule-import.js +2 -2
  111. package/package.json +2 -2
  112. package/src/access-mcp-output-schemas.ts +1 -1
  113. package/src/access-recall-response.ts +4 -2
  114. package/src/access-recall-surface.ts +9 -9
  115. package/src/access-service-namespace.test.ts +9 -9
  116. package/src/access-service-raw-excerpt-read-gate.test.ts +1 -1
  117. package/src/included-memories.ts +88 -0
  118. package/src/orchestration/recall-internal-deps.ts +2 -4
  119. package/src/orchestration/recall-internal.ts +9 -13
  120. package/src/orchestration/recall-result-formatter-display-safe.test.ts +13 -16
  121. package/src/orchestration/recall-result-formatter.ts +32 -45
  122. package/src/orchestration/recall-section-coordinator.ts +20 -26
  123. package/src/orchestrator.ts +2 -4
  124. package/src/recall-explain-renderer.test.ts +4 -0
  125. package/src/recall-state.test.ts +108 -5
  126. package/src/recall-state.ts +85 -23
  127. package/src/recall-token-budget.test.ts +1 -1
  128. package/dist/chunk-PRDJMOST.js.map +0 -1
  129. package/dist/chunk-XV6PUXJ5.js.map +0 -1
  130. package/dist/chunk-YYQAKIDJ.js.map +0 -1
  131. /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
  132. /package/dist/{chunk-5S5DUJFJ.js.map → chunk-3IMYRX3W.js.map} +0 -0
  133. /package/dist/{chunk-QIZOU3FN.js.map → chunk-5OOTHWGJ.js.map} +0 -0
  134. /package/dist/{chunk-YMQKPSB2.js.map → chunk-5TF5STAV.js.map} +0 -0
  135. /package/dist/{chunk-PMVPCZJZ.js.map → chunk-6433HV72.js.map} +0 -0
  136. /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
  137. /package/dist/{chunk-IBZQQOM5.js.map → chunk-DGUVXXAU.js.map} +0 -0
  138. /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
  139. /package/dist/{chunk-HXZNTZ3Y.js.map → chunk-EDZNW3HE.js.map} +0 -0
  140. /package/dist/{chunk-2L7DKNVE.js.map → chunk-FZEEWOI2.js.map} +0 -0
  141. /package/dist/{chunk-XNJQZLAP.js.map → chunk-I2HTKOOP.js.map} +0 -0
  142. /package/dist/{chunk-3S3PNR5H.js.map → chunk-KXWE62IH.js.map} +0 -0
  143. /package/dist/{chunk-SYJW273H.js.map → chunk-LTYH2L6E.js.map} +0 -0
  144. /package/dist/{chunk-YIMV2KYM.js.map → chunk-N7V3P4V5.js.map} +0 -0
  145. /package/dist/{chunk-OOJCXJBN.js.map → chunk-O52TB5SL.js.map} +0 -0
  146. /package/dist/{chunk-PZKWPXRF.js.map → chunk-PHKU6BZ2.js.map} +0 -0
  147. /package/dist/{chunk-H4GQ2Y24.js.map → chunk-PQHNZ63P.js.map} +0 -0
  148. /package/dist/{chunk-7ZAC2C2U.js.map → chunk-SY5JUJ2X.js.map} +0 -0
  149. /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
  150. /package/dist/{chunk-WZDTSBGQ.js.map → chunk-VYMICVRA.js.map} +0 -0
  151. /package/dist/{chunk-3NZAVWU5.js.map → chunk-ZOAAY2OE.js.map} +0 -0
  152. /package/dist/{chunk-IINVXO3U.js.map → chunk-ZWYXSF2T.js.map} +0 -0
  153. /package/dist/{first-start-migration-Q2VB2E2D.js.map → first-start-migration-4NETATFF.js.map} +0 -0
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-YBPYIAA5.js";
39
39
  import {
40
40
  parseConfig
41
- } from "./chunk-IINVXO3U.js";
41
+ } from "./chunk-ZWYXSF2T.js";
42
42
  import {
43
43
  readAggregateExtractionWatermark
44
44
  } from "./chunk-QTXNS3HB.js";
@@ -1683,4 +1683,4 @@ export {
1683
1683
  runBenchmarkRecall,
1684
1684
  runOperatorRepair
1685
1685
  };
1686
- //# sourceMappingURL=chunk-3NZAVWU5.js.map
1686
+ //# sourceMappingURL=chunk-ZOAAY2OE.js.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ coerceIncludedMemories
3
+ } from "./chunk-2YA5N2BY.js";
1
4
  import {
2
5
  writeFileAtomically
3
6
  } from "./chunk-AW4QUFQF.js";
@@ -19,6 +22,9 @@ import {
19
22
  import { appendFile, mkdir, readFile, rename, rm, stat, unlink, writeFile } from "fs/promises";
20
23
  import path from "path";
21
24
  import { createHash, randomUUID } from "crypto";
25
+ function isUnsafeStateKey(key) {
26
+ return key === "__proto__" || key === "constructor" || key === "prototype";
27
+ }
22
28
  function clampGraphRecallExpandedEntries(entries, maxEntries = 64) {
23
29
  const limit = Math.max(1, Math.floor(maxEntries));
24
30
  if (!Array.isArray(entries)) return [];
@@ -45,27 +51,42 @@ function clampGraphRecallExpandedEntries(entries, maxEntries = 64) {
45
51
  return out;
46
52
  }).filter((item) => item.path.length > 0 && item.namespace.length > 0).slice(0, limit);
47
53
  }
54
+ function cloneTierExplain(tierExplain) {
55
+ if (!tierExplain) return void 0;
56
+ return structuredClone(tierExplain);
57
+ }
48
58
  function snapshotMatchesExpectedIdentity(current, expected) {
49
59
  if (!expected) return true;
50
60
  if (typeof expected.writeNonce === "string" && expected.writeNonce.length > 0) {
51
61
  return current.writeNonce === expected.writeNonce;
52
62
  }
53
63
  const hasExpectedTraceId = typeof expected.traceId === "string" && expected.traceId.length > 0;
54
- if (hasExpectedTraceId) {
55
- return current.traceId === expected.traceId;
56
- }
57
- if (expected.recordedAt !== void 0) {
64
+ if (hasExpectedTraceId && current.traceId !== expected.traceId) return false;
65
+ if (typeof expected.recordedAt === "string" && expected.recordedAt.length > 0) {
58
66
  return current.recordedAt === expected.recordedAt;
59
67
  }
60
68
  return true;
61
69
  }
62
- function cloneTierExplain(tierExplain) {
63
- if (!tierExplain) return void 0;
64
- return structuredClone(tierExplain);
70
+ function hydrateLastRecallSnapshot(snapshot) {
71
+ const includedMemories = coerceIncludedMemories(snapshot);
72
+ const budgets = snapshot.budgetsApplied ? {
73
+ ...snapshot.budgetsApplied,
74
+ includedMemoryIds: includedMemories.map((memory) => memory.id),
75
+ includedMemoryPaths: includedMemories.map((memory) => memory.path),
76
+ includedMemoryNamespaces: includedMemories.map((memory) => memory.namespace)
77
+ } : void 0;
78
+ return {
79
+ ...snapshot,
80
+ includedMemories,
81
+ memoryIds: includedMemories.map((memory) => memory.id),
82
+ resultPaths: includedMemories.map((memory) => memory.path),
83
+ resultNamespaces: includedMemories.map((memory) => memory.namespace),
84
+ ...budgets ? { budgetsApplied: budgets } : {}
85
+ };
65
86
  }
66
87
  function cloneLastRecallSnapshot(snapshot) {
67
88
  if (!snapshot) return null;
68
- return structuredClone(snapshot);
89
+ return structuredClone(hydrateLastRecallSnapshot(snapshot));
69
90
  }
70
91
  var DEFAULT_TIER_MIGRATION_STATUS = {
71
92
  updatedAt: (/* @__PURE__ */ new Date(0)).toISOString(),
@@ -109,12 +130,27 @@ var LastRecallStore = class {
109
130
  try {
110
131
  const raw = await readFile(this.statePath, "utf-8");
111
132
  const parsed = JSON.parse(raw);
112
- if (parsed && typeof parsed === "object") this.state = parsed;
133
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
134
+ this.state = {};
135
+ return;
136
+ }
137
+ const next = {};
138
+ for (const [sessionKey, snapshot] of Object.entries(parsed)) {
139
+ if (sessionKey === "__proto__" || sessionKey === "constructor" || sessionKey === "prototype") {
140
+ continue;
141
+ }
142
+ if (!snapshot || typeof snapshot !== "object" || Array.isArray(snapshot)) {
143
+ continue;
144
+ }
145
+ next[sessionKey] = hydrateLastRecallSnapshot(snapshot);
146
+ }
147
+ this.state = next;
113
148
  } catch {
114
149
  this.state = {};
115
150
  }
116
151
  }
117
152
  get(sessionKey) {
153
+ if (isUnsafeStateKey(sessionKey)) return null;
118
154
  return cloneLastRecallSnapshot(this.state[sessionKey] ?? null);
119
155
  }
120
156
  getMostRecent() {
@@ -132,15 +168,21 @@ var LastRecallStore = class {
132
168
  * Does not store raw query text; uses a stable hash for correlation.
133
169
  */
134
170
  async record(opts) {
171
+ if (isUnsafeStateKey(opts.sessionKey)) {
172
+ log.debug("last recall record skipped: unsafe session key");
173
+ return;
174
+ }
135
175
  const now = (/* @__PURE__ */ new Date()).toISOString();
136
176
  const queryHash = createHash("sha256").update(opts.query).digest("hex");
177
+ const includedMemories = coerceIncludedMemories(opts);
137
178
  const liveSnapshot = {
138
179
  sessionKey: opts.sessionKey,
139
180
  recordedAt: now,
140
181
  queryHash,
141
182
  writeNonce: randomUUID(),
142
183
  queryLen: opts.query.length,
143
- memoryIds: opts.memoryIds,
184
+ includedMemories,
185
+ memoryIds: includedMemories.map((memory) => memory.id),
144
186
  namespace: opts.namespace,
145
187
  recallNamespaces: opts.recallNamespaces,
146
188
  traceId: opts.traceId,
@@ -151,8 +193,6 @@ var LastRecallStore = class {
151
193
  sourcesUsed: opts.sourcesUsed,
152
194
  budgetsApplied: opts.budgetsApplied,
153
195
  latencyMs: opts.latencyMs,
154
- resultPaths: opts.resultPaths,
155
- resultNamespaces: opts.resultNamespaces,
156
196
  policyVersion: opts.policyVersion,
157
197
  identityInjectionMode: opts.identityInjection?.mode,
158
198
  identityInjectedChars: opts.identityInjection?.injectedChars,
@@ -472,6 +512,7 @@ var LastRecallStore = class {
472
512
  * not need to guard on existence.
473
513
  */
474
514
  async annotateTierExplain(sessionKey, tierExplain, expected) {
515
+ if (isUnsafeStateKey(sessionKey)) return;
475
516
  const current = this.state[sessionKey];
476
517
  if (!current) return;
477
518
  if (!snapshotMatchesExpectedIdentity(current, expected)) return;
@@ -578,7 +619,15 @@ var RecallHandleHistoryStore = class {
578
619
  try {
579
620
  const raw = await readFile(this.statePath, "utf-8");
580
621
  const parsed = JSON.parse(raw);
581
- if (parsed && typeof parsed === "object") this.state = parsed;
622
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
623
+ const next = {};
624
+ for (const [sessionKey, entries] of Object.entries(parsed)) {
625
+ if (isUnsafeStateKey(sessionKey)) continue;
626
+ if (!Array.isArray(entries)) continue;
627
+ next[sessionKey] = entries;
628
+ }
629
+ this.state = next;
630
+ }
582
631
  } catch {
583
632
  this.state = {};
584
633
  }
@@ -588,7 +637,7 @@ var RecallHandleHistoryStore = class {
588
637
  * The ring is capped at {@link maxDepth}; older entries drop off the tail.
589
638
  */
590
639
  async record(sessionKey, memoryIds) {
591
- if (!sessionKey) return;
640
+ if (!sessionKey || isUnsafeStateKey(sessionKey)) return;
592
641
  const ids = memoryIds.filter((id) => typeof id === "string" && id.length > 0);
593
642
  const entry = { at: (/* @__PURE__ */ new Date()).toISOString(), ids };
594
643
  const prior = this.state[sessionKey] ?? [];
@@ -606,6 +655,7 @@ var RecallHandleHistoryStore = class {
606
655
  * Empty array when the session has no recorded history.
607
656
  */
608
657
  recent(sessionKey, depth = this.maxDepth) {
658
+ if (isUnsafeStateKey(sessionKey)) return [];
609
659
  const entries = this.state[sessionKey];
610
660
  if (!entries || entries.length === 0) return [];
611
661
  const limit = Math.max(0, Math.min(depth, entries.length));
@@ -639,4 +689,4 @@ export {
639
689
  TierMigrationStatusStore,
640
690
  RecallHandleHistoryStore
641
691
  };
642
- //# sourceMappingURL=chunk-PRDJMOST.js.map
692
+ //# sourceMappingURL=chunk-ZVZHG7AI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-state.ts"],"sourcesContent":["import { appendFile, mkdir, readFile, rename, rm, stat, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { log } from \"./logger.js\";\nimport { writeFileAtomically } from \"./maintenance/atomic-file.js\";\nimport { isErrnoCode } from \"./utils/errno.js\";\nimport { withHeldFileLock, type HeldFileLockOptions } from \"./utils/serialize-mutations.js\";\nimport { ensureContainedSpillDir, listContainedSpillFiles } from \"./utils/path-containment.js\";\nimport type { SearchDegradation } from \"./search/port.js\";\nimport type {\n IdentityInjectionMode,\n RecallPlanMode,\n RecallTierExplain,\n} from \"./types.js\";\nimport {\n coerceIncludedMemories,\n type IncludedMemory,\n} from \"./included-memories.js\";\n\nexport type { IncludedMemory } from \"./included-memories.js\";\nexport { coerceIncludedMemories } from \"./included-memories.js\";\n\n// Session keys are caller-supplied (host session IDs) and land in indexed\n// assignments on plain-object state. A key matching one of these would\n// pollute Object.prototype (or read junk off it), so every read/write\n// through this module rejects them — same contract load() already enforced.\nfunction isUnsafeStateKey(key: string): boolean {\n return key === \"__proto__\" || key === \"constructor\" || key === \"prototype\";\n}\n\n\nexport interface LastRecallBudgetSummary {\n requestedTopK?: number;\n appliedTopK: number;\n recallBudgetChars: number;\n maxMemoryTokens: number;\n qmdFetchLimit?: number;\n qmdHybridFetchLimit?: number;\n finalContextChars?: number;\n truncated?: boolean;\n includedSections?: string[];\n omittedSections?: string[];\n includedMemoryIds?: string[];\n includedMemoryPaths?: string[];\n includedMemoryNamespaces?: Array<string | undefined>;\n omittedMemoryIds?: string[];\n}\n\nexport interface LastRecallSnapshot {\n sessionKey: string;\n recordedAt: string;\n queryHash: string;\n queryLen: number;\n memoryIds: string[];\n includedMemories?: IncludedMemory[];\n namespace?: string;\n recallNamespaces?: string[];\n traceId?: string;\n plannerMode?: RecallPlanMode;\n requestedMode?: RecallPlanMode;\n source?: string;\n fallbackUsed?: boolean;\n sourcesUsed?: string[];\n budgetsApplied?: LastRecallBudgetSummary;\n latencyMs?: number;\n resultPaths?: string[];\n resultNamespaces?: Array<string | undefined>;\n policyVersion?: string;\n identityInjectionMode?: IdentityInjectionMode | \"none\";\n identityInjectedChars?: number;\n identityInjectionTruncated?: boolean;\n /**\n * Collision-safe write nonce. Random UUID set on every `record()`\n * call so the observation-mode direct-answer hook can detect stale\n * snapshots and avoid annotating a snapshot that a subsequent recall\n * already replaced (issue #518).\n */\n writeNonce?: string;\n /**\n * Optional tier-level explanation of how recall was served\n * (issue #518). Populated by orchestrator call sites that can\n * identify a concrete tier; surfaces expose the block via\n * `engram query --explain`, the `?explain=1` HTTP flag, and the\n * `remnic_recall_explain` MCP tool. Orthogonal to the existing\n * graph-path `recallExplain` operation.\n */\n tierExplain?: RecallTierExplain;\n /**\n * Backend degradations observed while serving this recall (issue #1536).\n * Present only when a search backend reported unavailable/loading/timeout\n * during the recall — distinguishing \"no matches\" from \"backend could not\n * answer\" (CLAUDE.md rule 34). Deliberately independent of `tierExplain`,\n * which is gated behind `recallDirectAnswerEnabled`.\n */\n backendDegradations?: SearchDegradation[];\n}\n\nexport interface GraphRecallExpandedEntry {\n path: string;\n score: number;\n namespace: string;\n seed: string;\n hopDepth: number;\n decayedWeight: number;\n graphType: \"entity\" | \"time\" | \"causal\";\n /**\n * Issue #681 PR 3/3 — confidence of the edge that produced this entry's\n * recorded provenance (strongest edge along the chosen entry path).\n * Range `[0, 1]`. Optional so persisted snapshots from older builds\n * round-trip through `clampGraphRecallExpandedEntries` without dropping.\n */\n edgeConfidence?: number;\n /** Graph-relative activation path node ids when provenance is enabled. */\n pathNodeIds?: string[];\n /** True when a graph path penalty was applied. */\n pathPenaltyApplied?: boolean;\n}\n\nexport function clampGraphRecallExpandedEntries(\n entries: unknown,\n maxEntries: number = 64,\n): GraphRecallExpandedEntry[] {\n const limit = Math.max(1, Math.floor(maxEntries));\n if (!Array.isArray(entries)) return [];\n return entries\n .filter((item): item is Record<string, unknown> => !!item && typeof item === \"object\")\n .map((item) => {\n const graphType: \"entity\" | \"time\" | \"causal\" =\n item.graphType === \"entity\" || item.graphType === \"time\" || item.graphType === \"causal\"\n ? item.graphType\n : \"entity\";\n const out: GraphRecallExpandedEntry = {\n path: typeof item.path === \"string\" ? item.path : \"\",\n score: typeof item.score === \"number\" && Number.isFinite(item.score) ? item.score : 0,\n namespace: typeof item.namespace === \"string\" ? item.namespace : \"\",\n seed: typeof item.seed === \"string\" ? item.seed : \"\",\n hopDepth:\n typeof item.hopDepth === \"number\" && Number.isFinite(item.hopDepth)\n ? Math.max(0, Math.floor(item.hopDepth))\n : 0,\n decayedWeight:\n typeof item.decayedWeight === \"number\" && Number.isFinite(item.decayedWeight)\n ? Math.max(0, item.decayedWeight)\n : 0,\n graphType,\n };\n // Issue #681 PR 3/3: clamp `edgeConfidence` into [0, 1] when present.\n // Older snapshots without the field round-trip cleanly via the\n // optional shape; legacy callers always rendered as 1.0.\n if (\n typeof item.edgeConfidence === \"number\" &&\n Number.isFinite(item.edgeConfidence)\n ) {\n out.edgeConfidence = Math.min(1, Math.max(0, item.edgeConfidence));\n }\n if (\n Array.isArray(item.pathNodeIds) &&\n item.pathNodeIds.every((value): value is string => typeof value === \"string\")\n ) {\n out.pathNodeIds = item.pathNodeIds.slice(0, 64);\n }\n if (typeof item.pathPenaltyApplied === \"boolean\") {\n out.pathPenaltyApplied = item.pathPenaltyApplied;\n }\n return out;\n })\n .filter((item) => item.path.length > 0 && item.namespace.length > 0)\n .slice(0, limit);\n}\n\ntype LastRecallState = Record<string, LastRecallSnapshot>;\ntype StateFileWriter = (filePath: string, content: string) => Promise<void>;\n\n/**\n * Deep-copy a RecallTierExplain block. Used by both the write path\n * (so caller mutation after `record()` cannot tear the persisted\n * snapshot) and the read path (so caller mutation after `get()` /\n * `getMostRecent()` cannot tear the in-memory store).\n *\n * Uses structuredClone so future additions to RecallTierExplain do\n * not silently share references through hand-enumerated fields —\n * matching the pattern used elsewhere in the codebase (e.g.,\n * qmd-recall-cache.ts). The payload is pure JSON-shaped data, so\n * structuredClone is both safe and complete here.\n */\n/**\n * Stale-snapshot identity guard shared by the annotate methods (issue #518):\n * a writeNonce match wins outright; otherwise traceId (when expected) and\n * recordedAt are compared. Extracted so every annotation surface applies\n * identical guards (CLAUDE.md rule 22).\n */\nfunction cloneTierExplain(\n tierExplain: RecallTierExplain | undefined,\n): RecallTierExplain | undefined {\n if (!tierExplain) return undefined;\n return structuredClone(tierExplain);\n}\n\nfunction snapshotMatchesExpectedIdentity(\n current: LastRecallSnapshot,\n expected?: { writeNonce?: string; traceId?: string; recordedAt?: string },\n): boolean {\n if (!expected) return true;\n if (typeof expected.writeNonce === \"string\" && expected.writeNonce.length > 0) {\n return current.writeNonce === expected.writeNonce;\n }\n const hasExpectedTraceId =\n typeof expected.traceId === \"string\" && expected.traceId.length > 0;\n if (hasExpectedTraceId && current.traceId !== expected.traceId) return false;\n if (typeof expected.recordedAt === \"string\" && expected.recordedAt.length > 0) {\n return current.recordedAt === expected.recordedAt;\n }\n return true;\n}\n\nfunction hydrateLastRecallSnapshot(snapshot: LastRecallSnapshot): LastRecallSnapshot {\n const includedMemories = coerceIncludedMemories(snapshot);\n const budgets = snapshot.budgetsApplied\n ? {\n ...snapshot.budgetsApplied,\n includedMemoryIds: includedMemories.map((memory) => memory.id),\n includedMemoryPaths: includedMemories.map((memory) => memory.path),\n includedMemoryNamespaces: includedMemories.map((memory) => memory.namespace),\n }\n : undefined;\n return {\n ...snapshot,\n includedMemories,\n memoryIds: includedMemories.map((memory) => memory.id),\n resultPaths: includedMemories.map((memory) => memory.path),\n resultNamespaces: includedMemories.map((memory) => memory.namespace),\n ...(budgets ? { budgetsApplied: budgets } : {}),\n };\n}\n\nfunction cloneLastRecallSnapshot(\n snapshot: LastRecallSnapshot | null,\n): LastRecallSnapshot | null {\n if (!snapshot) return null;\n return structuredClone(hydrateLastRecallSnapshot(snapshot));\n}\n\n\n\nexport interface TierMigrationCycleSummary {\n trigger: \"extraction\" | \"maintenance\" | \"manual\";\n scanned: number;\n migrated: number;\n promoted: number;\n demoted: number;\n limit: number;\n dryRun: boolean;\n skipped?: string;\n errorCount?: number;\n}\n\nexport interface TierMigrationStatusSnapshot {\n updatedAt: string;\n lastCycle: TierMigrationCycleSummary | null;\n totals: {\n cycles: number;\n scanned: number;\n migrated: number;\n promoted: number;\n demoted: number;\n errors: number;\n };\n}\n\nconst DEFAULT_TIER_MIGRATION_STATUS: TierMigrationStatusSnapshot = {\n updatedAt: new Date(0).toISOString(),\n lastCycle: null,\n totals: {\n cycles: 0,\n scanned: 0,\n migrated: 0,\n promoted: 0,\n demoted: 0,\n errors: 0,\n },\n};\n\n/**\n * Suffix marking an impression spill CLAIMED for commit but not yet deleted.\n * The crash-safe drain renames `<uuid>.jsonl` -> `<uuid>.jsonl.claimed` before\n * committing its rows, mirroring the lifecycle ledger's claim/commit protocol\n * (#2033).\n */\nconst CLAIMED_IMPRESSION_SPILL_SUFFIX = \".claimed\";\n\n/**\n * Outcome of {@link LastRecallStore.drainPendingImpressions}. Distinguishes a\n * completed drain (or nothing pending) from a DEFERRED drain that left durable\n * spills in the offline-sync-EXCLUDED queue, so the caller can tell the\n * data-safe cases apart from the one where an offline-sync snapshot would\n * silently omit recorded impressions (#2033).\n */\nexport interface DrainPendingImpressionsResult {\n /** Pending spill rows were folded into the synced active file this call. */\n folded: boolean;\n /**\n * Durable spill rows remain in the offline-sync-EXCLUDED pending queue after\n * this drain: the rotation lock could not be acquired, a spill could not be\n * claimed, or the drain-only fold left rows that would only fit by rotating\n * into a sync-excluded archive. A snapshot taken now would silently omit them\n * (#2033): the caller MUST treat the active file as INCOMPLETE and retry or\n * abort the snapshot rather than report success. `false` means the active file\n * is complete — every pending row was folded or nothing was pending.\n */\n pendingDeferred: boolean;\n}\n\nexport class LastRecallStore {\n private readonly statePath: string;\n private readonly impressionsPath: string;\n private readonly writeStateFile: StateFileWriter;\n private readonly impressionsRotateBytes: number;\n private readonly impressionsRotateKeep: number;\n // Lock-acquisition timing for the cross-process impression rotation lock.\n // Only tests set this (small maxWaitMs) to force the acquisition-timeout\n // (`acquired=false`) branch deterministically; production uses the defaults.\n private readonly impressionsLockOptions?: Pick<HeldFileLockOptions, \"maxWaitMs\" | \"pollMs\">;\n private state: LastRecallState = {};\n private stateWriteChain: Promise<void> = Promise.resolve();\n // Serializes the rotate-then-append critical section so concurrent record()\n // calls never interleave rotation renames with each other's appends (#1910).\n private impressionsWriteChain: Promise<void> = Promise.resolve();\n\n constructor(\n memoryDir: string,\n options: {\n writeStateFile?: StateFileWriter;\n impressionsRotateBytes?: number;\n impressionsRotateKeep?: number;\n impressionsLockOptions?: Pick<HeldFileLockOptions, \"maxWaitMs\" | \"pollMs\">;\n } = {},\n ) {\n this.statePath = path.join(memoryDir, \"state\", \"last_recall.json\");\n this.impressionsPath = path.join(memoryDir, \"state\", \"recall_impressions.jsonl\");\n // 0 disables rotation (never coerced to a default); keep floors at 1.\n this.impressionsRotateBytes = Math.max(0, Math.floor(options.impressionsRotateBytes ?? 0));\n this.impressionsRotateKeep = Math.max(1, Math.floor(options.impressionsRotateKeep ?? 5));\n this.impressionsLockOptions = options.impressionsLockOptions;\n this.writeStateFile =\n options.writeStateFile ??\n (async (filePath, content) => {\n await writeFileAtomically(filePath, content);\n });\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed: unknown = JSON.parse(raw);\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n this.state = {};\n return;\n }\n const next: LastRecallState = {};\n for (const [sessionKey, snapshot] of Object.entries(parsed)) {\n if (sessionKey === \"__proto__\" || sessionKey === \"constructor\" || sessionKey === \"prototype\") {\n continue;\n }\n if (!snapshot || typeof snapshot !== \"object\" || Array.isArray(snapshot)) {\n continue;\n }\n next[sessionKey] = hydrateLastRecallSnapshot(snapshot as LastRecallSnapshot);\n }\n this.state = next;\n } catch {\n this.state = {};\n }\n }\n\n get(sessionKey: string): LastRecallSnapshot | null {\n // Defensive copy: callers must not be able to mutate internal state\n // by reaching into array/object fields on the returned snapshot.\n if (isUnsafeStateKey(sessionKey)) return null;\n return cloneLastRecallSnapshot(this.state[sessionKey] ?? null);\n }\n\n getMostRecent(): LastRecallSnapshot | null {\n const snapshots = Object.values(this.state);\n if (snapshots.length === 0) return null;\n // Secondary key on sessionKey keeps the sort stable when two\n // snapshots share a recordedAt timestamp (CLAUDE.md rule 19).\n snapshots.sort((a, b) => {\n const byTime = b.recordedAt.localeCompare(a.recordedAt);\n if (byTime !== 0) return byTime;\n return a.sessionKey.localeCompare(b.sessionKey);\n });\n return cloneLastRecallSnapshot(snapshots[0] ?? null);\n }\n\n /**\n * Persist last-recall snapshot and append an impression log entry.\n * Does not store raw query text; uses a stable hash for correlation.\n */\n async record(opts: {\n sessionKey: string;\n query: string;\n memoryIds?: string[];\n includedMemories?: IncludedMemory[];\n namespace?: string;\n recallNamespaces?: string[];\n traceId?: string;\n plannerMode?: RecallPlanMode;\n requestedMode?: RecallPlanMode;\n source?: string;\n fallbackUsed?: boolean;\n sourcesUsed?: string[];\n budgetsApplied?: LastRecallBudgetSummary;\n latencyMs?: number;\n resultPaths?: string[];\n resultNamespaces?: Array<string | undefined>;\n policyVersion?: string;\n appendImpression?: boolean;\n identityInjection?: {\n mode: IdentityInjectionMode | \"none\";\n injectedChars: number;\n truncated: boolean;\n };\n /**\n * Per-tier explain annotation (issue #518). When supplied, the\n * snapshot carries it so downstream surfaces (CLI / HTTP / MCP)\n * can render which retrieval tier served the query.\n */\n tierExplain?: RecallTierExplain;\n /**\n * Backend degradations observed while serving this recall (issue #1536).\n * Passed at record time so the published snapshot is born annotated —\n * a post-record annotation would leave a window where readers see the\n * snapshot without them (codex review on #1544).\n */\n backendDegradations?: SearchDegradation[];\n }): Promise<void> {\n if (isUnsafeStateKey(opts.sessionKey)) {\n log.debug(\"last recall record skipped: unsafe session key\");\n return;\n }\n const now = new Date().toISOString();\n const queryHash = createHash(\"sha256\").update(opts.query).digest(\"hex\");\n\n // Build the snapshot from opts, then deep-copy it via\n // cloneLastRecallSnapshot so caller arrays/objects passed in\n // `opts` cannot retain a live reference to the persisted state and\n // tear it after `record()` returns.\n const includedMemories = coerceIncludedMemories(opts);\n const liveSnapshot: LastRecallSnapshot = {\n sessionKey: opts.sessionKey,\n recordedAt: now,\n queryHash,\n writeNonce: randomUUID(),\n queryLen: opts.query.length,\n includedMemories,\n memoryIds: includedMemories.map((memory) => memory.id),\n namespace: opts.namespace,\n recallNamespaces: opts.recallNamespaces,\n traceId: opts.traceId,\n plannerMode: opts.plannerMode,\n requestedMode: opts.requestedMode,\n source: opts.source,\n fallbackUsed: opts.fallbackUsed,\n sourcesUsed: opts.sourcesUsed,\n budgetsApplied: opts.budgetsApplied,\n latencyMs: opts.latencyMs,\n policyVersion: opts.policyVersion,\n identityInjectionMode: opts.identityInjection?.mode,\n identityInjectedChars: opts.identityInjection?.injectedChars,\n identityInjectionTruncated: opts.identityInjection?.truncated,\n tierExplain: opts.tierExplain,\n backendDegradations:\n opts.backendDegradations && opts.backendDegradations.length > 0\n ? opts.backendDegradations\n : undefined,\n };\n // `cloneLastRecallSnapshot` handles `null` but that never applies\n // at this call site — the non-null assertion keeps the type\n // checker honest.\n const snapshot = cloneLastRecallSnapshot(liveSnapshot)!;\n\n this.state[opts.sessionKey] = snapshot;\n\n // Keep the state bounded; the impression log is append-only.\n const keys = Object.keys(this.state);\n if (keys.length > 50) {\n const ordered = keys\n .map((k) => ({ k, at: this.state[k]?.recordedAt ?? \"\" }))\n .sort((a, b) => b.at.localeCompare(a.at));\n for (const doomed of ordered.slice(50)) {\n delete this.state[doomed.k];\n }\n }\n\n try {\n await this.flushState();\n } catch (err) {\n log.debug(`last recall store write failed: ${err}`);\n }\n\n if (opts.appendImpression !== false) {\n const line = JSON.stringify(snapshot) + \"\\n\";\n // Chain onto the previous impression write so rotation + append run as one\n // serialized critical section — concurrent record() calls can never\n // interleave a rename with another call's append (#1910). `.catch` before\n // the link keeps a prior failure from poisoning the chain.\n const chained = this.impressionsWriteChain\n .catch(() => {})\n .then(() => this.appendImpressionSerialized(line));\n this.impressionsWriteChain = chained;\n try {\n await chained;\n } catch (err) {\n log.debug(`recall impressions append failed: ${err}`);\n }\n }\n }\n\n /**\n * Drain pending spills, rotate (best-effort, sized to the projected payload),\n * then append one impression line under ONE shared cross-process lock (#1910,\n * #2033). Both the archive-shift renames AND the append run inside the same\n * held lock so a peer process holding the lock can never rename the active\n * inode to `.1` between our open and write — which would land the impression in\n * a rotated archive that offline-sync excludes, silently dropping it from\n * active-state/sync consumers.\n *\n * On lock-acquisition timeout the impression is NEVER written to the active\n * file unlocked (#2033): a peer holding the lock is likely mid-rotation, so an\n * unlocked append can land in the inode it is about to rename to `.1` — the\n * exact silent-drop this lock prevents. Instead the row is spilled to a\n * durable node-local per-event file under `<impressions>.pending.d/` and\n * folded back into the active file by the next append that DOES hold the lock,\n * preserving durability without racing rotation. Rotation failure under the\n * held lock is logged and the append still runs. Callers invoke this only\n * through `impressionsWriteChain` so the sequence is serialized in-process.\n */\n private get impressionsPendingDir(): string {\n return `${this.impressionsPath}.pending.d`;\n }\n\n private async spillImpression(line: string): Promise<void> {\n await ensureContainedSpillDir(this.impressionsPendingDir);\n // Write to a temp name the drain's `.jsonl` lister ignores, then atomically\n // rename to the final `<uuid>.jsonl` (#2033). writeFile creates the path\n // before its bytes are durable, so writing straight to the final name lets a\n // concurrent lock holder's drain read/rename/delete a partial spill and\n // append malformed JSON — permanently losing that impression. The temp lives\n // in the SAME contained dir, so the rename is atomic and stays symlink-safe.\n const id = randomUUID();\n const tempPath = path.join(this.impressionsPendingDir, `${id}.jsonl.tmp`);\n const finalPath = path.join(this.impressionsPendingDir, `${id}.jsonl`);\n await writeFile(tempPath, line, \"utf-8\");\n await rename(tempPath, finalPath);\n }\n\n /**\n * Recover a claim a crashed drain left mid-flight (#2033): the crash-safe\n * drain renames `<uuid>.jsonl` -> `<uuid>.jsonl.claimed` BEFORE committing, so\n * a `.claimed` file with no matching commit is the ONLY durable copy of those\n * rows. Rename each orphan back to `<uuid>.jsonl` so it re-enters the normal\n * collect+claim+commit flow. MUST run under the held rotation lock, before\n * collecting. listContainedSpillFiles skips symlinked/escaping entries.\n */\n private async recoverOrphanedImpressionClaims(): Promise<void> {\n const orphans = await listContainedSpillFiles(\n this.impressionsPendingDir,\n `.jsonl${CLAIMED_IMPRESSION_SPILL_SUFFIX}`,\n );\n for (const claimedPath of orphans) {\n const original = claimedPath.slice(0, -CLAIMED_IMPRESSION_SPILL_SUFFIX.length);\n await rename(claimedPath, original).catch(() => undefined);\n }\n }\n\n /**\n * Recover a crash-orphaned spill temp after its write completed but before\n * the atomic `.tmp` → `.jsonl` rename. Valid JSONL temps are promoted back\n * into the normal queue; incomplete temps remain pending and keep offline sync\n * deferred rather than being discarded.\n */\n private async recoverOrphanedImpressionTemps(): Promise<void> {\n const temps = await listContainedSpillFiles(this.impressionsPendingDir, \".jsonl.tmp\");\n for (const tempPath of temps) {\n let content: string;\n try {\n content = await readFile(tempPath, \"utf-8\");\n for (const line of content.split(\"\\n\")) {\n if (line.trim().length > 0) JSON.parse(line);\n }\n } catch {\n continue;\n }\n const finalPath = tempPath.slice(0, -\".tmp\".length);\n await rename(tempPath, finalPath).catch(() => undefined);\n }\n }\n\n private async appendImpressionSerialized(line: string): Promise<void> {\n await mkdir(path.dirname(this.impressionsPath), { recursive: true });\n // Every active-file write goes under the shared cross-process rotation lock,\n // even when THIS writer's local rotation is disabled (`impressionsRotateBytes\n // <= 0`). A peer process with rotation enabled shares this lock and may\n // rename the active inode to `.1` at any moment, so an unlocked append could\n // land in an offline-sync-excluded archive and be silently dropped (#2033).\n // Only the local rotate DECISION is disabled — the bounded fold skips\n // rotation when this writer's limit is 0 — the lock itself is not.\n const lockPath = `${this.impressionsPath}.lock`;\n await withHeldFileLock(\n lockPath,\n { staleMs: 30_000, ...this.impressionsLockOptions },\n async (acquired) => {\n // withHeldFileLock falls back to task(false) when it cannot acquire the\n // lock within the budget. Do NOT append to the active file unlocked: a\n // peer holding the lock may be mid-rotation, so an unlocked append could\n // land in the inode it renames to `.1` (an offline-sync-excluded\n // archive), silently dropping the impression. Spill it to the durable\n // pending queue instead — the next lock holder folds it back in (#2033).\n if (!acquired) {\n log.debug(\"recall impressions rotation lock not acquired; spilling impression to the durable pending queue\");\n await this.spillImpression(line);\n return;\n }\n await this.foldPendingImpressionsAndAppend(line);\n },\n );\n }\n\n /**\n * Fold any durable pending recall-impression spills into the synced active\n * `recall_impressions.jsonl` WITHOUT recording a new impression (#2033).\n *\n * The pending spill dir is offline-sync-excluded, so an impression that a\n * lock-timed-out `record()` spilled there is absent from an offline-sync\n * snapshot and lost if this node is discarded before the next `record()`\n * folds it back. Offline sync calls this before building a snapshot so a\n * recorded impression always reaches the remote. Fast no-op — no lock and no\n * dir/lock-file creation — when nothing is pending.\n *\n * Returns a {@link DrainPendingImpressionsResult}: `folded` is true when rows\n * were folded into the active file; `pendingDeferred` is true when durable\n * spills still remain in the offline-sync-EXCLUDED queue after this call —\n * because the rotation lock could not be acquired, a spill could not be\n * claimed, or the drain-only fold deferred rows that would only fit by\n * rotating into a sync-excluded archive (#2033). A snapshot taken while\n * `pendingDeferred` is true would silently drop those rows, so the caller MUST\n * NOT report a clean snapshot — it either retries or aborts.\n */\n async drainPendingImpressions(): Promise<DrainPendingImpressionsResult> {\n if (!(await this.pendingSpillsRemain())) {\n return { folded: false, pendingDeferred: false };\n }\n const lockPath = `${this.impressionsPath}.lock`;\n let folded = false;\n let acquiredLock = false;\n let spillsRemain = false;\n await withHeldFileLock(\n lockPath,\n { staleMs: 30_000, ...this.impressionsLockOptions },\n async (acquired) => {\n // A peer holds the lock (mid-rotation or mid-append). We MUST NOT touch\n // the active file unlocked (#2033), so the spills stay in the\n // offline-sync-EXCLUDED pending queue. Report the drain as DEFERRED\n // (pendingDeferred=true) so the caller does not build a snapshot that\n // silently omits them; the next lock holder — or a caller retry — folds\n // them in.\n if (!acquired) return;\n acquiredLock = true;\n folded = await this.foldPendingImpressionsAndAppend(null);\n // Even WITH the lock, a spill the fold could not claim or a `.claimed`\n // orphan a failed commit left behind keeps durable rows in the excluded\n // queue. Treat that as an incomplete drain so the caller retries/aborts\n // rather than snapshotting an active file that omits them (#2033).\n spillsRemain = await this.pendingSpillsRemain();\n },\n );\n return { folded, pendingDeferred: !acquiredLock || spillsRemain };\n }\n\n /**\n * Claim/commit fold of durable pending impression spills into the active file\n * under the held rotation lock (#2033). `line` is a new impression to append\n * after the drained rows, or null for a drain-only pre-sync fold.\n *\n * Each spill is folded as an INDEPENDENT claim -> append -> finalize unit\n * rather than materializing the whole queue as one joined payload and\n * splitting it in a single synchronous pass (#2033). A multi-hundred-MB drain\n * done as one join/split blocks the event loop long enough for\n * `withHeldFileLock`'s ownership-refresh timer to miss its window, so a peer\n * stale-breaks the 30s lock and rotates/appends concurrently — defeating the\n * rotation lock this drain relies on. The per-file `await`s keep the payload\n * bounded to one spill at a time and let the refresh timer fire between files.\n *\n * The DRAIN-ONLY path (`line === null`, run before an offline-sync snapshot)\n * NEVER rotates a drained row into an archive. `recall_impressions.jsonl.*`\n * is offline-sync-EXCLUDED, so rotating a just-drained row into `.1`/`.2` and\n * then deleting its spill would leave that row only in a path sync omits —\n * silently lost when the node is discarded after a \"successful\" sync (#2033).\n * It folds only the rows that fit the synced active file under the cap and\n * leaves the rest durable in the pending queue; {@link drainPendingImpressions}\n * then reports the drain DEFERRED so the caller retries or aborts. The\n * record() path (`line !== null`) keeps rotating normally — its archives stay\n * on a live node that is not being discarded.\n *\n * Recovers any crash-orphaned claim first. Each impression carries a unique\n * writeNonce, so a crash-recovered re-commit is a collapsible duplicate, never\n * a lost row. listContainedSpillFiles rejects symlinked/escaping entries; a\n * spill that cannot be claimed is skipped this pass. An append failure rolls\n * that spill's claim back so the row retries on the next lock holder's drain.\n * Returns true when the active file was written. MUST run under the held\n * rotation lock.\n */\n private async foldPendingImpressionsAndAppend(line: string | null): Promise<boolean> {\n await this.recoverOrphanedImpressionTemps();\n await this.recoverOrphanedImpressionClaims();\n const spillFiles = await listContainedSpillFiles(this.impressionsPendingDir);\n const drainOnly = line === null;\n const cap = this.impressionsRotateBytes;\n let activeSize = 0;\n if (cap > 0) {\n try {\n activeSize = (await stat(this.impressionsPath)).size;\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n let wrote = false;\n for (const filePath of spillFiles) {\n const content = await readFile(filePath, \"utf-8\");\n const unit = content.length === 0 || content.endsWith(\"\\n\") ? content : `${content}\\n`;\n const unitBytes = Buffer.byteLength(unit, \"utf-8\");\n // Drain-only fold must never push a drained row into a sync-excluded\n // archive (#2033). Once the active file cannot take this spill under the\n // cap without rotating, stop: the remaining spills stay durable in the\n // pending queue and the drain reports itself deferred. A lone spill larger\n // than the cap on an empty active file is still folded whole (it cannot be\n // split without corrupting JSONL) so it reaches sync rather than stranding.\n if (drainOnly && cap > 0 && activeSize > 0 && activeSize + unitBytes >= cap) break;\n const claimedPath = `${filePath}${CLAIMED_IMPRESSION_SPILL_SUFFIX}`;\n try {\n await rename(filePath, claimedPath);\n } catch {\n continue; // could not claim → do not commit; a later drain retries it.\n }\n try {\n activeSize = await this.appendImpressionUnit(unit, activeSize, drainOnly);\n } catch (err) {\n // Commit failed: roll this spill's claim back so it retries on the next\n // lock holder's drain instead of being lost.\n await rename(claimedPath, filePath).catch(() => undefined);\n throw err;\n }\n // Commit is durable: delete the claimed file. A delete that fails leaves a\n // `.claimed` orphan the next drain recovers and re-commits — a\n // writeNonce-collapsible duplicate, never a lost row (#2033).\n await unlink(claimedPath).catch(() => undefined);\n wrote = true;\n }\n if (line !== null) {\n activeSize = await this.appendImpressionUnit(line, activeSize, false);\n wrote = true;\n }\n return wrote;\n }\n\n /**\n * Append one whole JSONL unit (a claimed spill's rows or a fresh impression\n * line) to the active impressions file, returning the resulting active-file\n * byte size. On the rotating (record) path, when the unit would push the\n * current active generation to/over `impressionsRotateBytes`, the full active\n * file is rotated aside FIRST so no generation exceeds the cap (#2033); a lone\n * unit larger than the cap on an empty active file is written whole because\n * splitting a JSONL row would corrupt it. `drainOnly` and disabled rotation\n * (`impressionsRotateBytes <= 0`) both skip rotation — drain-only defers its\n * overflow in {@link foldPendingImpressionsAndAppend} rather than rotating into\n * a sync-excluded archive. A rotation error is logged and the append still\n * runs so a row is never lost; an append failure propagates so the caller\n * rolls its claim back. MUST run under the held rotation lock.\n */\n private async appendImpressionUnit(\n unit: string,\n activeSize: number,\n drainOnly: boolean,\n ): Promise<number> {\n const cap = this.impressionsRotateBytes;\n const unitBytes = Buffer.byteLength(unit, \"utf-8\");\n if (cap > 0 && !drainOnly && activeSize > 0 && activeSize + unitBytes >= cap) {\n try {\n await this.shiftImpressionArchives();\n activeSize = 0;\n } catch (err) {\n log.debug(`recall impressions rotation failed (append preserved): ${err}`);\n }\n }\n await appendFile(this.impressionsPath, unit, \"utf-8\");\n return activeSize + unitBytes;\n }\n\n /**\n * True when any live `<uuid>.jsonl` spill, crash-orphaned `.claimed` file,\n * or crash-orphaned `.jsonl.tmp` spill remains in the offline-sync-EXCLUDED\n * pending queue (#2033). After a drain acquires the rotation lock, a spill\n * the fold could not claim (rename race / read-only dir) or a `.claimed`\n * orphan a failed commit left behind means durable rows are STILL excluded\n * from a snapshot — the drain must report itself INCOMPLETE so the caller\n * retries or aborts rather than snapshotting an active file that omits them.\n */\n private async pendingSpillsRemain(): Promise<boolean> {\n if ((await listContainedSpillFiles(this.impressionsPendingDir, \".jsonl.tmp\")).length > 0) {\n return true;\n }\n const liveSpills = await listContainedSpillFiles(this.impressionsPendingDir);\n if (liveSpills.length > 0) return true;\n const claimed = await listContainedSpillFiles(\n this.impressionsPendingDir,\n `.jsonl${CLAIMED_IMPRESSION_SPILL_SUFFIX}`,\n );\n return claimed.length > 0;\n }\n\n /**\n * Shift `.1..N` archives down one slot and move the active file to `.1`,\n * dropping anything beyond `keep`. Callers invoke this only while holding the\n * cross-process rotation lock (issue #1910).\n */\n private async shiftImpressionArchives(): Promise<void> {\n const keep = this.impressionsRotateKeep;\n // Drop the archive that would fall off the end, then shift down: .(keep-1)\n // -> .keep, ..., .1 -> .2, active -> .1.\n try {\n await rm(`${this.impressionsPath}.${keep}`, { force: true });\n } catch {\n // best-effort cleanup of the oldest archive\n }\n for (let i = keep - 1; i >= 1; i -= 1) {\n try {\n await rename(`${this.impressionsPath}.${i}`, `${this.impressionsPath}.${i + 1}`);\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n try {\n await rename(this.impressionsPath, `${this.impressionsPath}.1`);\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n\n /**\n * Attach a RecallTierExplain block to the existing snapshot for a\n * session without rewriting the entire snapshot. Used by the\n * post-recall direct-answer annotation path (issue #518 slice 3c):\n * recallInternal records the snapshot first, then the orchestrator\n * fires the direct-answer tier in observation mode and annotates\n * the stored snapshot with whichever tier served the query.\n *\n * No-op when no snapshot exists for the given session; callers do\n * not need to guard on existence.\n */\n async annotateTierExplain(\n sessionKey: string,\n tierExplain: RecallTierExplain,\n expected?: { writeNonce?: string; traceId?: string; recordedAt?: string },\n ): Promise<void> {\n if (isUnsafeStateKey(sessionKey)) return;\n const current = this.state[sessionKey];\n if (!current) return;\n if (!snapshotMatchesExpectedIdentity(current, expected)) return;\n this.state[sessionKey] = {\n ...current,\n tierExplain: cloneTierExplain(tierExplain),\n };\n try {\n await this.flushState();\n } catch (err) {\n log.debug(`last recall tier-explain annotate failed: ${err}`);\n }\n }\n\n\n private flushState(): Promise<void> {\n const run = this.stateWriteChain.catch(() => undefined).then(async () => {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await this.writeStateFile(this.statePath, JSON.stringify(this.state, null, 2));\n });\n this.stateWriteChain = run.then(\n () => undefined,\n () => undefined,\n );\n return run;\n }\n}\n\nexport class TierMigrationStatusStore {\n private readonly statePath: string;\n private state: TierMigrationStatusSnapshot = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n\n constructor(memoryDir: string) {\n this.statePath = path.join(memoryDir, \"state\", \"tier-migration-status.json\");\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw) as Partial<TierMigrationStatusSnapshot> | null;\n if (!parsed || typeof parsed !== \"object\") {\n this.state = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n return;\n }\n const totals = parsed.totals && typeof parsed.totals === \"object\"\n ? parsed.totals\n : DEFAULT_TIER_MIGRATION_STATUS.totals;\n this.state = {\n updatedAt:\n typeof parsed.updatedAt === \"string\" && parsed.updatedAt.length > 0\n ? parsed.updatedAt\n : DEFAULT_TIER_MIGRATION_STATUS.updatedAt,\n lastCycle:\n parsed.lastCycle && typeof parsed.lastCycle === \"object\"\n ? (parsed.lastCycle as TierMigrationCycleSummary)\n : null,\n totals: {\n cycles: typeof totals.cycles === \"number\" && Number.isFinite(totals.cycles) ? totals.cycles : 0,\n scanned: typeof totals.scanned === \"number\" && Number.isFinite(totals.scanned) ? totals.scanned : 0,\n migrated: typeof totals.migrated === \"number\" && Number.isFinite(totals.migrated) ? totals.migrated : 0,\n promoted: typeof totals.promoted === \"number\" && Number.isFinite(totals.promoted) ? totals.promoted : 0,\n demoted: typeof totals.demoted === \"number\" && Number.isFinite(totals.demoted) ? totals.demoted : 0,\n errors: typeof totals.errors === \"number\" && Number.isFinite(totals.errors) ? totals.errors : 0,\n },\n };\n } catch {\n this.state = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n }\n }\n\n get(): TierMigrationStatusSnapshot {\n return {\n updatedAt: this.state.updatedAt,\n lastCycle: this.state.lastCycle ? { ...this.state.lastCycle } : null,\n totals: { ...this.state.totals },\n };\n }\n\n async recordCycle(summary: TierMigrationCycleSummary): Promise<void> {\n const now = new Date().toISOString();\n const migratedDelta = summary.dryRun ? 0 : Math.max(0, summary.migrated);\n const promotedDelta = summary.dryRun ? 0 : Math.max(0, summary.promoted);\n const demotedDelta = summary.dryRun ? 0 : Math.max(0, summary.demoted);\n const next: TierMigrationStatusSnapshot = {\n updatedAt: now,\n lastCycle: { ...summary },\n totals: {\n cycles: this.state.totals.cycles + 1,\n scanned: this.state.totals.scanned + Math.max(0, summary.scanned),\n migrated: this.state.totals.migrated + migratedDelta,\n promoted: this.state.totals.promoted + promotedDelta,\n demoted: this.state.totals.demoted + demotedDelta,\n errors: this.state.totals.errors + Math.max(0, summary.errorCount ?? 0),\n },\n };\n this.state = next;\n try {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await writeFile(this.statePath, JSON.stringify(next, null, 2), \"utf-8\");\n } catch (err) {\n log.debug(`tier migration status write failed: ${err}`);\n }\n }\n}\n\n\n/**\n * Per-session bounded history of recent recall memory-id sets, used ONLY by\n * handle resolution (issue #1582). Distinct from {@link LastRecallStore} —\n * that keeps ONE last snapshot per session; this keeps a small ring (depth N)\n * of the memory-id arrays a session has recalled, newest first, so a handle\n * cited in a later turn still resolves even after a newer recall displaced the\n * \"last\" snapshot.\n *\n * Deliberately lightweight: stores only `string[]` per entry (no full\n * snapshot), capped at `depth` per session and 50 sessions total (rule 27\n * slice/cap guards). Misses are acceptable and tagged at resolution time.\n */\nexport class RecallHandleHistoryStore {\n private readonly statePath: string;\n private readonly writeStateFile: StateFileWriter;\n private state: Record<string, Array<{ at: string; ids: string[] }>> = {};\n private writeChain: Promise<void> = Promise.resolve();\n private readonly maxDepth: number;\n\n constructor(memoryDir: string, options: { writeStateFile?: StateFileWriter; maxDepth?: number } = {}) {\n this.statePath = path.join(memoryDir, \"state\", \"handle_history.json\");\n this.writeStateFile =\n options.writeStateFile ??\n (async (filePath, content) => {\n await writeFileAtomically(filePath, content);\n });\n this.maxDepth =\n typeof options.maxDepth === \"number\" && Number.isFinite(options.maxDepth)\n ? Math.max(1, Math.min(50, Math.floor(options.maxDepth)))\n : 5;\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n const next: Record<string, Array<{ at: string; ids: string[] }>> = {};\n for (const [sessionKey, entries] of Object.entries(parsed)) {\n if (isUnsafeStateKey(sessionKey)) continue;\n if (!Array.isArray(entries)) continue;\n next[sessionKey] = entries;\n }\n this.state = next;\n }\n } catch {\n this.state = {};\n }\n }\n\n /**\n * Record one recall's admitted memory ids for a session, newest first.\n * The ring is capped at {@link maxDepth}; older entries drop off the tail.\n */\n async record(sessionKey: string, memoryIds: readonly string[]): Promise<void> {\n if (!sessionKey || isUnsafeStateKey(sessionKey)) return;\n const ids = memoryIds.filter((id): id is string => typeof id === \"string\" && id.length > 0);\n const entry = { at: new Date().toISOString(), ids };\n const prior = this.state[sessionKey] ?? [];\n const next = [entry, ...prior].slice(0, this.maxDepth);\n this.state[sessionKey] = next;\n this.capSessions();\n try {\n await this.flush();\n } catch (err) {\n log.debug(`recall handle history write failed: ${err}`);\n }\n }\n\n /**\n * Return the memory-id arrays for a session, newest first, capped at `depth`.\n * Empty array when the session has no recorded history.\n */\n recent(sessionKey: string, depth: number = this.maxDepth): Array<readonly string[]> {\n if (isUnsafeStateKey(sessionKey)) return [];\n const entries = this.state[sessionKey];\n if (!entries || entries.length === 0) return [];\n const limit = Math.max(0, Math.min(depth, entries.length));\n return entries.slice(0, limit).map((e) => e.ids);\n }\n\n /** Test seam: drop all history (used by the corpus-scan hygiene test). */\n clearForTest(): void {\n this.state = {};\n }\n\n private capSessions(): void {\n const keys = Object.keys(this.state);\n if (keys.length <= 50) return;\n const ordered = keys\n .map((k) => ({ k, at: this.state[k]?.[0]?.at ?? \"\" }))\n .sort((a, b) => b.at.localeCompare(a.at));\n for (const doomed of ordered.slice(50)) {\n delete this.state[doomed.k];\n }\n }\n\n private flush(): Promise<void> {\n const run = this.writeChain.catch(() => undefined).then(async () => {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await this.writeStateFile(this.statePath, JSON.stringify(this.state, null, 2));\n });\n this.writeChain = run.then(() => undefined, () => undefined);\n return run;\n }\n}\n"],"m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AM,OAAO,CAAC;AAAA,IAC5B;AAAA,EACF;AAAA,EAEQ,QAAuB;AAC7B,UAAM,MAAM,KAAK,WAAW,MAAM,MAAM,MAAS,EAAE,KAAK,YAAY;AAClE,YAAM,MAAM,KAAK,QAAQ,KAAK,SAAS,GAAG,EAAE,WAAW,KAAK,CAAC;AAC7D,YAAM,KAAK,eAAe,KAAK,WAAW,KAAK,UAAU,KAAK,OAAO,MAAM,CAAC,CAAC;AAAA,IAC/E,CAAC;AACD,SAAK,aAAa,IAAI,KAAK,MAAM,QAAW,MAAM,MAAS;AAC3D,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -78,7 +78,7 @@ import {
78
78
  } from "./chunk-HBVPYRDW.js";
79
79
  import {
80
80
  parseOfflineSyncExcludes
81
- } from "./chunk-2L7DKNVE.js";
81
+ } from "./chunk-FZEEWOI2.js";
82
82
  import {
83
83
  expandTildePath
84
84
  } from "./chunk-EYIEWJNI.js";
@@ -3902,4 +3902,4 @@ export {
3902
3902
  VALID_MEMORY_CATEGORIES,
3903
3903
  parseConfig
3904
3904
  };
3905
- //# sourceMappingURL=chunk-IINVXO3U.js.map
3905
+ //# sourceMappingURL=chunk-ZWYXSF2T.js.map
@@ -2,10 +2,10 @@ import { CompoundingPromotionReport } from './compounding/engine.js';
2
2
  import { ConversationIndexBackendInspection } from './conversation-index/backend.js';
3
3
  import { MigrateObservationsResult } from './maintenance/migrate-observations.js';
4
4
  import { M as MemoryFile, l as MemoryFrontmatter, y as MemoryStatus, a6 as BehaviorSignalEvent, Q as QmdSearchResult, ab as BulkImportResult, ag as MemoryActionEvent, J as MemoryLifecycleEvent } from './types-CBEAYU76.js';
5
- import { C as ConversationIndexCoordinator, T as TierMigrationCoordinator, O as Orchestrator } from './orchestrator-CSc9GfQv.js';
5
+ import { C as ConversationIndexCoordinator, T as TierMigrationCoordinator, O as Orchestrator } from './orchestrator-Bay_AofR.js';
6
6
  import { S as StorageManager } from './storage-CGzJGUUu.js';
7
7
  import { TrustZoneDemoSeedResult, TrustZoneName, TrustZonePromotionResult, TrustZoneStoreStatus } from './trust-zones.js';
8
- import { f as EngramAccessService } from './access-service-CocW74uA.js';
8
+ import { f as EngramAccessService } from './access-service-DwfdjqkZ.js';
9
9
  import { Writable, Readable } from 'node:stream';
10
10
  import { ResolveSecretRefFn } from './resolve-auth-token.js';
11
11
  import { CausalTrajectoryStoreStatus } from './causal-trajectory.js';
package/dist/cli.d.ts CHANGED
@@ -2,11 +2,11 @@ import './compounding/engine.js';
2
2
  import './conversation-index/backend.js';
3
3
  import './maintenance/migrate-observations.js';
4
4
  import './types-CBEAYU76.js';
5
- import './orchestrator-CSc9GfQv.js';
5
+ import './orchestrator-Bay_AofR.js';
6
6
  import './storage-CGzJGUUu.js';
7
7
  import './trust-zones.js';
8
- export { c as AccessHttpServeCliCommandOptions, d as ArchiveObservationsCliCommandOptions, e as AuditMemoryCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, g as CliCommand, h as CliProgram, i as CompatCliCommandOptions, j as ConnectorsRunCliOutputOptions, k as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, l as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, m as MemoryActionAuditCliNamespaceSummary, n as MemoryActionAuditCliReport, o as MemoryGovernanceCliCommandOptions, q as MemoryGovernanceReportCliCommandOptions, s as MemoryGovernanceRestoreCliCommandOptions, t as MemoryReviewDispositionCliCommandOptions, u as MemoryTimelineCliCommandOptions, v as MigrateCliOrchestrator, w as MigrateCliReport, x as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, y as PolicyDiffEntry, z as PolicyRollbackCliReport, F as PolicyStatusCliReport, H as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, I as RebuildMemoryProjectionCliCommandOptions, J as RebuildObservationsCliCommandOptions, K as RepairMemoryProjectionCliCommandOptions, L as ReplayCliCommandOptions, N as ReplayCliOrchestrator, O as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, Q as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, U as TailscaleSyncCliCommandOptions, V as TierMigrateCliAdapter, W as TierMigrateCoordinatorCliAdapter, X as TierMigrateLegacyCliAdapter, Y as TierStatusCliAdapter, Z as TierStatusCoordinatorCliAdapter, _ as TierStatusLegacyCliAdapter, $ as TrainingExportCliCommandOptions, a0 as VerifyMemoryProjectionCliCommandOptions, a1 as WebDavServeCliCommandOptions, a2 as WorkProjectCliCommandOptions, a3 as WorkTaskCliCommandOptions, a4 as emitConnectorsRunCliResult, a5 as filterNormalMemorySearchResults, a6 as hasDestructivePurgeFailures, a7 as isNormalRetrievalVisibleMemory, a8 as listMemoryMarkdownFilePaths, a9 as parseDurationToMs, aa as parseStrictCliDate, ab as planAggressiveDuplicateDeletions, ac as planExactDuplicateDeletions, ad as registerCli, ae as resolveAccessPrincipalOverride, af as resolveMemoryDirForNamespace, ag as runAbstractionNodeStatusCliCommand, ah as runAccessHttpServeCliCommand, ai as runAccessHttpStatusCliCommand, aj as runAccessHttpStopCliCommand, ak as runAccessMcpServeCliCommand, al as runArchiveObservationsCliCommand, r as runAuditMemoryCliCommand, am as runBenchmarkBaselineReportCliCommand, an as runBenchmarkBaselineSnapshotCliCommand, ao as runBenchmarkCiGateCliCommand, ap as runBenchmarkImportCliCommand, aq as runBenchmarkStatusCliCommand, ar as runBenchmarkStoredBaselineCiGateCliCommand, as as runBenchmarkValidateCliCommand, b as runBulkImportCliCommand, at as runCausalTrajectoryStatusCliCommand, au as runCommitmentLifecycleCliCommand, av as runCommitmentRecordCliCommand, aw as runCommitmentSetStateCliCommand, ax as runCommitmentStatusCliCommand, ay as runCompatCliCommand, az as runCompoundingPromoteCliCommand, aA as runConversationIndexHealthCliCommand, aB as runConversationIndexInspectCliCommand, aC as runConversationIndexRebuildCliCommand, aD as runCueAnchorStatusCliCommand, aE as runDashboardStartCliCommand, aF as runDashboardStatusCliCommand, aG as runDashboardStopCliCommand, aH as runGraphHealthCliCommand, aI as runHarmonicSearchCliCommand, aJ as runMemoryActionAuditCliCommand, aK as runMemoryGovernanceCliCommand, aL as runMemoryGovernanceReportCliCommand, aM as runMemoryGovernanceRestoreCliCommand, aN as runMemoryReviewDispositionCliCommand, aO as runMemoryTimelineCliCommand, aP as runMigrateNormalizeFrontmatterCliCommand, aQ as runMigrateObservationsCliCommand, aR as runMigrateRechunkCliCommand, aS as runMigrateReextractCliCommand, aT as runMigrateRescoreImportanceCliCommand, aU as runObjectiveStateStatusCliCommand, aV as runPolicyDiffCliCommand, aW as runPolicyRollbackCliCommand, aX as runPolicyStatusCliCommand, aY as runRebuildMemoryLifecycleLedgerCliCommand, aZ as runRebuildMemoryProjectionCliCommand, a_ as runRebuildObservationsCliCommand, a$ as runRepairMemoryProjectionCliCommand, b0 as runReplayCliCommand, b1 as runResumeBundleBuildCliCommand, b2 as runResumeBundleRecordCliCommand, b3 as runResumeBundleStatusCliCommand, b4 as runRouteCliCommand, b5 as runSemanticRulePromoteCliCommand, b6 as runSemanticRuleVerifyCliCommand, b7 as runSessionCheckCliCommand, b8 as runSessionRepairCliCommand, b9 as runTailscaleStatusCliCommand, ba as runTailscaleSyncCliCommand, bb as runTierMigrateCliCommand, bc as runTierStatusCliCommand, bd as runTrainingExportCliCommand, be as runTrustZoneDemoSeedCliCommand, bf as runTrustZonePromoteCliCommand, bg as runTrustZoneStatusCliCommand, bh as runUtilityLearningCliCommand, bi as runUtilityLearningStatusCliCommand, bj as runUtilityTelemetryRecordCliCommand, bk as runUtilityTelemetryStatusCliCommand, bl as runVerifiedRecallSearchCliCommand, bm as runVerifyMemoryProjectionCliCommand, bn as runWebDavServeCliCommand, bo as runWebDavStopCliCommand, bp as runWorkProductRecallSearchCliCommand, bq as runWorkProductRecordCliCommand, br as runWorkProductStatusCliCommand, bs as runWorkProjectCliCommand, bt as runWorkTaskCliCommand } from './cli-BTNj5DzK.js';
9
- import './access-service-CocW74uA.js';
8
+ export { c as AccessHttpServeCliCommandOptions, d as ArchiveObservationsCliCommandOptions, e as AuditMemoryCliCommandOptions, B as BulkImportCliCommandOptions, C as CliApi, g as CliCommand, h as CliProgram, i as CompatCliCommandOptions, j as ConnectorsRunCliOutputOptions, k as ConversationIndexHealthCliOrchestrator, D as DashboardStartCliCommandOptions, l as DedupeCandidate, E as ExactDedupePlan, G as GraphHealthCliCommandOptions, M as MemoryActionAuditCliCommandOptions, m as MemoryActionAuditCliNamespaceSummary, n as MemoryActionAuditCliReport, o as MemoryGovernanceCliCommandOptions, q as MemoryGovernanceReportCliCommandOptions, s as MemoryGovernanceRestoreCliCommandOptions, t as MemoryReviewDispositionCliCommandOptions, u as MemoryTimelineCliCommandOptions, v as MigrateCliOrchestrator, w as MigrateCliReport, x as MigrateObservationsCliCommandOptions, P as PolicyDiffCliReport, y as PolicyDiffEntry, z as PolicyRollbackCliReport, F as PolicyStatusCliReport, H as PolicyTuningCliOrchestrator, R as RebuildMemoryLifecycleLedgerCliCommandOptions, I as RebuildMemoryProjectionCliCommandOptions, J as RebuildObservationsCliCommandOptions, K as RepairMemoryProjectionCliCommandOptions, L as ReplayCliCommandOptions, N as ReplayCliOrchestrator, O as RouteCliCommandOptions, S as SessionIntegrityCliCommandOptions, Q as SessionRepairCliCommandOptions, T as TailscaleStatusCliCommandOptions, U as TailscaleSyncCliCommandOptions, V as TierMigrateCliAdapter, W as TierMigrateCoordinatorCliAdapter, X as TierMigrateLegacyCliAdapter, Y as TierStatusCliAdapter, Z as TierStatusCoordinatorCliAdapter, _ as TierStatusLegacyCliAdapter, $ as TrainingExportCliCommandOptions, a0 as VerifyMemoryProjectionCliCommandOptions, a1 as WebDavServeCliCommandOptions, a2 as WorkProjectCliCommandOptions, a3 as WorkTaskCliCommandOptions, a4 as emitConnectorsRunCliResult, a5 as filterNormalMemorySearchResults, a6 as hasDestructivePurgeFailures, a7 as isNormalRetrievalVisibleMemory, a8 as listMemoryMarkdownFilePaths, a9 as parseDurationToMs, aa as parseStrictCliDate, ab as planAggressiveDuplicateDeletions, ac as planExactDuplicateDeletions, ad as registerCli, ae as resolveAccessPrincipalOverride, af as resolveMemoryDirForNamespace, ag as runAbstractionNodeStatusCliCommand, ah as runAccessHttpServeCliCommand, ai as runAccessHttpStatusCliCommand, aj as runAccessHttpStopCliCommand, ak as runAccessMcpServeCliCommand, al as runArchiveObservationsCliCommand, r as runAuditMemoryCliCommand, am as runBenchmarkBaselineReportCliCommand, an as runBenchmarkBaselineSnapshotCliCommand, ao as runBenchmarkCiGateCliCommand, ap as runBenchmarkImportCliCommand, aq as runBenchmarkStatusCliCommand, ar as runBenchmarkStoredBaselineCiGateCliCommand, as as runBenchmarkValidateCliCommand, b as runBulkImportCliCommand, at as runCausalTrajectoryStatusCliCommand, au as runCommitmentLifecycleCliCommand, av as runCommitmentRecordCliCommand, aw as runCommitmentSetStateCliCommand, ax as runCommitmentStatusCliCommand, ay as runCompatCliCommand, az as runCompoundingPromoteCliCommand, aA as runConversationIndexHealthCliCommand, aB as runConversationIndexInspectCliCommand, aC as runConversationIndexRebuildCliCommand, aD as runCueAnchorStatusCliCommand, aE as runDashboardStartCliCommand, aF as runDashboardStatusCliCommand, aG as runDashboardStopCliCommand, aH as runGraphHealthCliCommand, aI as runHarmonicSearchCliCommand, aJ as runMemoryActionAuditCliCommand, aK as runMemoryGovernanceCliCommand, aL as runMemoryGovernanceReportCliCommand, aM as runMemoryGovernanceRestoreCliCommand, aN as runMemoryReviewDispositionCliCommand, aO as runMemoryTimelineCliCommand, aP as runMigrateNormalizeFrontmatterCliCommand, aQ as runMigrateObservationsCliCommand, aR as runMigrateRechunkCliCommand, aS as runMigrateReextractCliCommand, aT as runMigrateRescoreImportanceCliCommand, aU as runObjectiveStateStatusCliCommand, aV as runPolicyDiffCliCommand, aW as runPolicyRollbackCliCommand, aX as runPolicyStatusCliCommand, aY as runRebuildMemoryLifecycleLedgerCliCommand, aZ as runRebuildMemoryProjectionCliCommand, a_ as runRebuildObservationsCliCommand, a$ as runRepairMemoryProjectionCliCommand, b0 as runReplayCliCommand, b1 as runResumeBundleBuildCliCommand, b2 as runResumeBundleRecordCliCommand, b3 as runResumeBundleStatusCliCommand, b4 as runRouteCliCommand, b5 as runSemanticRulePromoteCliCommand, b6 as runSemanticRuleVerifyCliCommand, b7 as runSessionCheckCliCommand, b8 as runSessionRepairCliCommand, b9 as runTailscaleStatusCliCommand, ba as runTailscaleSyncCliCommand, bb as runTierMigrateCliCommand, bc as runTierStatusCliCommand, bd as runTrainingExportCliCommand, be as runTrustZoneDemoSeedCliCommand, bf as runTrustZonePromoteCliCommand, bg as runTrustZoneStatusCliCommand, bh as runUtilityLearningCliCommand, bi as runUtilityLearningStatusCliCommand, bj as runUtilityTelemetryRecordCliCommand, bk as runUtilityTelemetryStatusCliCommand, bl as runVerifiedRecallSearchCliCommand, bm as runVerifyMemoryProjectionCliCommand, bn as runWebDavServeCliCommand, bo as runWebDavStopCliCommand, bp as runWorkProductRecallSearchCliCommand, bq as runWorkProductRecordCliCommand, br as runWorkProductStatusCliCommand, bs as runWorkProjectCliCommand, bt as runWorkTaskCliCommand } from './cli-kcUqoV4E.js';
9
+ import './access-service-DwfdjqkZ.js';
10
10
  import 'node:stream';
11
11
  import './resolve-auth-token.js';
12
12
  import './causal-trajectory.js';
@@ -91,6 +91,7 @@ import './extraction-error-classification.js';
91
91
  import './harmonic-retrieval.js';
92
92
  import './trust-score-stage.js';
93
93
  import './trust-score.js';
94
+ import './included-memories.js';
94
95
  import './dependency-propagation-delivery-DiY5T63p.js';
95
96
  import './boxes.js';
96
97
  import './namespaces/storage.js';
package/dist/cli.js CHANGED
@@ -91,34 +91,34 @@ import {
91
91
  runWorkProductStatusCliCommand,
92
92
  runWorkProjectCliCommand,
93
93
  runWorkTaskCliCommand
94
- } from "./chunk-7ZAC2C2U.js";
94
+ } from "./chunk-SY5JUJ2X.js";
95
95
  import "./chunk-MMACM5G2.js";
96
96
  import "./chunk-54BGIBCR.js";
97
97
  import "./chunk-H4CKS5B2.js";
98
98
  import "./chunk-FXZTL7F7.js";
99
+ import "./chunk-HDDRVXX4.js";
99
100
  import "./chunk-PYHOAXTI.js";
100
101
  import "./chunk-UP6MOYCB.js";
101
102
  import "./chunk-BV2TIZ4F.js";
102
103
  import "./chunk-Z734BLO3.js";
103
- import "./chunk-HDDRVXX4.js";
104
104
  import "./chunk-OZKVVUJB.js";
105
105
  import "./chunk-2DL3OFLD.js";
106
106
  import "./chunk-G4IAEX6D.js";
107
- import "./chunk-2NLLXCJG.js";
107
+ import "./chunk-BXLOS5AJ.js";
108
108
  import "./chunk-765K3SAT.js";
109
109
  import "./chunk-TBUEE7XF.js";
110
+ import "./chunk-PYIFUBRK.js";
110
111
  import "./chunk-FGDKJJZS.js";
111
112
  import "./chunk-AJVLDJU6.js";
113
+ import "./chunk-DQTCGVFK.js";
112
114
  import "./chunk-EEC4PCG5.js";
113
- import "./chunk-PYIFUBRK.js";
114
115
  import "./chunk-IIFFC3RL.js";
115
- import "./chunk-Q6OL23WM.js";
116
- import "./chunk-DQTCGVFK.js";
117
116
  import "./chunk-AXFWMRKI.js";
117
+ import "./chunk-Q6OL23WM.js";
118
118
  import "./chunk-YLBE6PLR.js";
119
- import "./chunk-CDKHKZL5.js";
120
119
  import "./chunk-HSSERO3E.js";
121
120
  import "./chunk-NOUJNHWG.js";
121
+ import "./chunk-CDKHKZL5.js";
122
122
  import "./chunk-XE2QCCT2.js";
123
123
  import "./chunk-HL4DB7TO.js";
124
124
  import "./chunk-HDQUQBPW.js";
@@ -126,16 +126,16 @@ import "./chunk-6FC3IZ26.js";
126
126
  import "./chunk-OJP3N7UK.js";
127
127
  import "./chunk-BRHKW7GY.js";
128
128
  import "./chunk-3T6HIIKA.js";
129
- import "./chunk-QIZOU3FN.js";
129
+ import "./chunk-5OOTHWGJ.js";
130
130
  import "./chunk-NRLELHAY.js";
131
131
  import "./chunk-AM4T6CHX.js";
132
132
  import "./chunk-7DRSWPUV.js";
133
- import "./chunk-3T74IZB3.js";
134
- import "./chunk-2LA3H54D.js";
135
- import "./chunk-3NZAVWU5.js";
133
+ import "./chunk-ZOAAY2OE.js";
136
134
  import "./chunk-QQYHYW2N.js";
137
135
  import "./chunk-KFY3SGN7.js";
136
+ import "./chunk-3T74IZB3.js";
138
137
  import "./chunk-CMTINOFS.js";
138
+ import "./chunk-2LA3H54D.js";
139
139
  import "./chunk-VFZQXYN5.js";
140
140
  import "./chunk-RMMVQQA6.js";
141
141
  import "./chunk-UR6PBX2J.js";
@@ -159,7 +159,7 @@ import "./chunk-NOB2T2FC.js";
159
159
  import "./chunk-B7RWBZXW.js";
160
160
  import "./chunk-YBPYIAA5.js";
161
161
  import "./chunk-6TBIWIAG.js";
162
- import "./chunk-IINVXO3U.js";
162
+ import "./chunk-ZWYXSF2T.js";
163
163
  import "./chunk-ZKOPY4WW.js";
164
164
  import "./chunk-62OKGIJA.js";
165
165
  import "./chunk-7RAJ3GXO.js";
@@ -175,8 +175,9 @@ import "./chunk-PIG4WJFQ.js";
175
175
  import "./chunk-T3JQTCCO.js";
176
176
  import "./chunk-KFZY2OFH.js";
177
177
  import "./chunk-C6WMSXCJ.js";
178
- import "./chunk-SYJW273H.js";
178
+ import "./chunk-LTYH2L6E.js";
179
179
  import "./chunk-V7IZKJI3.js";
180
+ import "./chunk-TB6CBZ5V.js";
180
181
  import "./chunk-SEDEKFYQ.js";
181
182
  import "./chunk-RKNJBZ55.js";
182
183
  import "./chunk-J64TK33U.js";
@@ -184,60 +185,61 @@ import "./chunk-RSUYKGGZ.js";
184
185
  import "./chunk-42NQ7AVG.js";
185
186
  import "./chunk-TMSXWOBZ.js";
186
187
  import "./chunk-7RXCMVFQ.js";
187
- import "./chunk-TB6CBZ5V.js";
188
188
  import "./chunk-3HSRWJTC.js";
189
- import "./chunk-OOJCXJBN.js";
190
- import "./chunk-YIMV2KYM.js";
189
+ import "./chunk-O52TB5SL.js";
190
+ import "./chunk-N7V3P4V5.js";
191
191
  import "./chunk-JPWSYHLB.js";
192
192
  import "./chunk-KFB4YNXM.js";
193
- import "./chunk-H4GQ2Y24.js";
193
+ import "./chunk-PQHNZ63P.js";
194
194
  import "./chunk-HIEWDJ2O.js";
195
195
  import "./chunk-A5KNZSNA.js";
196
196
  import "./chunk-D24OXEPB.js";
197
- import "./chunk-YMQKPSB2.js";
198
- import "./chunk-WZDTSBGQ.js";
199
- import "./chunk-3S3PNR5H.js";
197
+ import "./chunk-5TF5STAV.js";
198
+ import "./chunk-VYMICVRA.js";
199
+ import "./chunk-KXWE62IH.js";
200
200
  import "./chunk-7T4TOGMS.js";
201
201
  import "./chunk-7YQ6ESEA.js";
202
- import "./chunk-IBZQQOM5.js";
203
- import "./chunk-HXZNTZ3Y.js";
204
- import "./chunk-EQWEIIKQ.js";
202
+ import "./chunk-DGUVXXAU.js";
203
+ import "./chunk-EDZNW3HE.js";
205
204
  import "./chunk-LTBKKSCX.js";
205
+ import "./chunk-EQWEIIKQ.js";
206
206
  import "./chunk-7BY7V4YX.js";
207
207
  import "./chunk-MDVBCPOS.js";
208
208
  import "./chunk-35NN3ZFA.js";
209
209
  import "./chunk-CEN6DW6X.js";
210
210
  import "./chunk-T4WDJPEZ.js";
211
211
  import "./chunk-56BSXSHC.js";
212
- import "./chunk-YYQAKIDJ.js";
212
+ import "./chunk-VD2OT77P.js";
213
213
  import "./chunk-TIDEL77O.js";
214
214
  import "./chunk-GZ3R6XOE.js";
215
215
  import "./chunk-CK5KOVHW.js";
216
216
  import "./chunk-DJUKBGAD.js";
217
217
  import "./chunk-G73MCJKL.js";
218
- import "./chunk-PZKWPXRF.js";
219
- import "./chunk-WKJTMXME.js";
218
+ import "./chunk-PHKU6BZ2.js";
219
+ import "./chunk-BPQ7L27U.js";
220
220
  import "./chunk-GDASG7NC.js";
221
221
  import "./chunk-GDB4J2H3.js";
222
- import "./chunk-PMVPCZJZ.js";
222
+ import "./chunk-6433HV72.js";
223
223
  import "./chunk-VQ7B2Q6M.js";
224
224
  import "./chunk-PJSK6OJM.js";
225
- import "./chunk-5QZR2RA3.js";
226
225
  import "./chunk-GNVZQ5JN.js";
227
226
  import "./chunk-YN2UN7N3.js";
227
+ import "./chunk-5QZR2RA3.js";
228
228
  import "./chunk-P5FPO2BR.js";
229
229
  import "./chunk-S4DDLTPX.js";
230
+ import "./chunk-ZVZHG7AI.js";
230
231
  import "./chunk-H7XKCNR6.js";
231
232
  import "./chunk-3F3CVVDS.js";
232
233
  import "./chunk-SOBJ6NEY.js";
233
234
  import "./chunk-QICOU4RY.js";
234
235
  import "./chunk-QTXNS3HB.js";
235
236
  import "./chunk-CVILPI77.js";
237
+ import "./chunk-EIR5VLIH.js";
236
238
  import "./chunk-2HIJHXB3.js";
237
239
  import "./chunk-AQEJKOKI.js";
238
240
  import "./chunk-HTP6XRUI.js";
239
241
  import "./chunk-IISBCCWR.js";
240
- import "./chunk-EIR5VLIH.js";
242
+ import "./chunk-2YA5N2BY.js";
241
243
  import "./chunk-PD66CVSD.js";
242
244
  import "./chunk-LTHVM4XN.js";
243
245
  import "./chunk-EI6V5UXY.js";
@@ -341,9 +343,9 @@ import "./chunk-Z7L72ZHL.js";
341
343
  import "./chunk-4O4TKIXQ.js";
342
344
  import "./chunk-TBBDFYXW.js";
343
345
  import "./chunk-YCVB7X56.js";
344
- import "./chunk-KQAFEZQX.js";
346
+ import "./chunk-VDX2J7OX.js";
345
347
  import "./chunk-WEHSQBFR.js";
346
- import "./chunk-X7Y7WX73.js";
348
+ import "./chunk-DQEMWVMT.js";
347
349
  import "./chunk-J4EB7DNW.js";
348
350
  import "./chunk-BJMBJZ2Y.js";
349
351
  import "./chunk-UKJAGEXH.js";
@@ -355,7 +357,7 @@ import "./chunk-3QL24R5Y.js";
355
357
  import "./chunk-SYOIVK7K.js";
356
358
  import "./chunk-ZN7SMKAK.js";
357
359
  import "./chunk-LNEWDF2A.js";
358
- import "./chunk-XNJQZLAP.js";
360
+ import "./chunk-I2HTKOOP.js";
359
361
  import "./chunk-T42L3S6A.js";
360
362
  import "./chunk-ZRUEP4IK.js";
361
363
  import "./chunk-HZNYJN77.js";
@@ -377,11 +379,11 @@ import "./chunk-JDSVLVCG.js";
377
379
  import "./chunk-HBVPYRDW.js";
378
380
  import "./chunk-5GKPFL3S.js";
379
381
  import "./chunk-JAKIDQB2.js";
380
- import "./chunk-2L7DKNVE.js";
382
+ import "./chunk-FZEEWOI2.js";
381
383
  import "./chunk-UI3NYK34.js";
382
384
  import "./chunk-GCGJW34D.js";
383
- import "./chunk-LC2BDILZ.js";
384
385
  import "./chunk-AREGMX2J.js";
386
+ import "./chunk-LC2BDILZ.js";
385
387
  import "./chunk-LQWOFU6L.js";
386
388
  import "./chunk-P7FMDTKL.js";
387
389
  import "./chunk-MZWSOLMT.js";
package/dist/config.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  isOpenaiApiKeyDisabled,
5
5
  parseConfig,
6
6
  resolveEnvVars
7
- } from "./chunk-IINVXO3U.js";
7
+ } from "./chunk-ZWYXSF2T.js";
8
8
  import "./chunk-ZKOPY4WW.js";
9
9
  import "./chunk-62OKGIJA.js";
10
10
  import "./chunk-7RAJ3GXO.js";
@@ -34,11 +34,11 @@ import "./chunk-PJKTFXE2.js";
34
34
  import "./chunk-HBVPYRDW.js";
35
35
  import "./chunk-5GKPFL3S.js";
36
36
  import "./chunk-JAKIDQB2.js";
37
- import "./chunk-2L7DKNVE.js";
37
+ import "./chunk-FZEEWOI2.js";
38
38
  import "./chunk-UI3NYK34.js";
39
39
  import "./chunk-GCGJW34D.js";
40
- import "./chunk-LC2BDILZ.js";
41
40
  import "./chunk-AREGMX2J.js";
41
+ import "./chunk-LC2BDILZ.js";
42
42
  import "./chunk-LQWOFU6L.js";
43
43
  import "./chunk-P7FMDTKL.js";
44
44
  import "./chunk-EYIEWJNI.js";