@remnic/core 1.1.4 → 1.1.6

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 (204) hide show
  1. package/dist/access-cli.js +32 -30
  2. package/dist/access-cli.js.map +1 -1
  3. package/dist/access-http.d.ts +7 -7
  4. package/dist/access-http.js +13 -13
  5. package/dist/access-mcp.d.ts +7 -7
  6. package/dist/access-mcp.js +12 -12
  7. package/dist/access-schema.d.ts +89 -4
  8. package/dist/access-schema.js +3 -3
  9. package/dist/{access-service-CtXFnprR.d.ts → access-service-CcKu1Yc0.d.ts} +22 -18
  10. package/dist/access-service.d.ts +7 -7
  11. package/dist/access-service.js +10 -10
  12. package/dist/active-memory-bridge.d.ts +1 -1
  13. package/dist/active-recall.d.ts +1 -1
  14. package/dist/behavior-learner.d.ts +1 -1
  15. package/dist/behavior-signals.d.ts +1 -1
  16. package/dist/bootstrap.d.ts +6 -6
  17. package/dist/briefing.d.ts +2 -2
  18. package/dist/briefing.js +3 -3
  19. package/dist/buffer-surprise-report.d.ts +1 -1
  20. package/dist/buffer.d.ts +2 -2
  21. package/dist/calibration.d.ts +1 -1
  22. package/dist/calibration.js +1 -1
  23. package/dist/{capsule-crypto-5CYAGVC5.js → capsule-crypto-SJS5VVAP.js} +2 -2
  24. package/dist/{capsule-export-NZQPOTQ4.js → capsule-export-LLEVB2RG.js} +3 -3
  25. package/dist/{capsule-import-SDCUXLEV.js → capsule-import-UW45R2MZ.js} +3 -3
  26. package/dist/causal-behavior.d.ts +1 -1
  27. package/dist/causal-consolidation.d.ts +2 -2
  28. package/dist/causal-consolidation.js +4 -4
  29. package/dist/{chunk-CRU27Q4J.js → chunk-3P6TPZM4.js} +64 -5
  30. package/dist/chunk-3P6TPZM4.js.map +1 -0
  31. package/dist/{chunk-LW2NMHDW.js → chunk-5NS6NN5A.js} +2 -2
  32. package/dist/{chunk-KNKUID7G.js → chunk-767ODGE6.js} +1 -1
  33. package/dist/{chunk-V7TEH5I2.js → chunk-7RAW2T4P.js} +2 -2
  34. package/dist/{chunk-RILIVK4O.js → chunk-A4ACKWIW.js} +29 -3
  35. package/dist/chunk-A4ACKWIW.js.map +1 -0
  36. package/dist/{chunk-F5VQOQ2E.js → chunk-AIT53NLG.js} +2 -2
  37. package/dist/chunk-AKV3HOGZ.js +757 -0
  38. package/dist/chunk-AKV3HOGZ.js.map +1 -0
  39. package/dist/{chunk-NZS2BLTP.js → chunk-AOABCJVL.js} +772 -59
  40. package/dist/chunk-AOABCJVL.js.map +1 -0
  41. package/dist/{chunk-B2TL6GA2.js → chunk-BFVBG5XY.js} +2 -2
  42. package/dist/{chunk-43EKP2UK.js → chunk-COAGZQT7.js} +1 -1
  43. package/dist/{chunk-43EKP2UK.js.map → chunk-COAGZQT7.js.map} +1 -1
  44. package/dist/{chunk-USFPPRAF.js → chunk-D7WYTVUQ.js} +5 -3
  45. package/dist/chunk-D7WYTVUQ.js.map +1 -0
  46. package/dist/{chunk-Y4A6M3B6.js → chunk-DLYTYJ43.js} +2 -2
  47. package/dist/{chunk-ZIBOQULP.js → chunk-EONJ7GK3.js} +2 -2
  48. package/dist/{chunk-JWSENLQI.js → chunk-FSWYMUWI.js} +15 -1
  49. package/dist/chunk-FSWYMUWI.js.map +1 -0
  50. package/dist/{chunk-SMA4IMHV.js → chunk-KUIEFH2S.js} +3 -3
  51. package/dist/{chunk-EGEPUGN4.js → chunk-LKJA5MR2.js} +2 -2
  52. package/dist/{chunk-XRCYKJ3V.js → chunk-M3QQ5DRA.js} +61 -18
  53. package/dist/chunk-M3QQ5DRA.js.map +1 -0
  54. package/dist/{chunk-CUI2STX6.js → chunk-MYMOXFMR.js} +12 -6
  55. package/dist/chunk-MYMOXFMR.js.map +1 -0
  56. package/dist/{chunk-AEMBDV7M.js → chunk-OZAFME7S.js} +22 -17
  57. package/dist/chunk-OZAFME7S.js.map +1 -0
  58. package/dist/{chunk-IYY4MCPG.js → chunk-P73JTV34.js} +2 -2
  59. package/dist/{chunk-52PDY6GD.js → chunk-PT2EZWOH.js} +2 -2
  60. package/dist/{chunk-3KIS4VGT.js → chunk-QIGOEM65.js} +2 -2
  61. package/dist/{chunk-47WOM4YW.js → chunk-RXGR3YLU.js} +2 -2
  62. package/dist/{chunk-VTJVUHRK.js → chunk-SRBJUAMP.js} +1 -1
  63. package/dist/chunk-SRBJUAMP.js.map +1 -0
  64. package/dist/{chunk-XQ4EJLUD.js → chunk-TMSHGSIG.js} +2 -2
  65. package/dist/{chunk-X6VBWOVZ.js → chunk-UE2OQNQQ.js} +2 -2
  66. package/dist/{chunk-HIRKCQGF.js → chunk-XOG2FHYW.js} +44 -44
  67. package/dist/{chunk-HIRKCQGF.js.map → chunk-XOG2FHYW.js.map} +1 -1
  68. package/dist/{chunk-MUELDH4F.js → chunk-YELFQNQH.js} +2 -2
  69. package/dist/{chunk-TIFRGAKO.js → chunk-YKGRACQP.js} +5 -5
  70. package/dist/{chunk-AGZHRWPT.js → chunk-ZBZVNWQO.js} +2 -2
  71. package/dist/{chunk-W7WWT4FJ.js → chunk-ZOMA7J3J.js} +2 -2
  72. package/dist/{cli-lMql2FCr.d.ts → cli-WahR0rs-.d.ts} +4 -4
  73. package/dist/cli.d.ts +8 -8
  74. package/dist/cli.js +25 -25
  75. package/dist/{codex-materialize-CQlLTzke.d.ts → codex-materialize-D5d5vvyS.d.ts} +1 -1
  76. package/dist/compression-optimizer.d.ts +1 -1
  77. package/dist/config.d.ts +1 -1
  78. package/dist/config.js +1 -1
  79. package/dist/consolidation-provenance-check.d.ts +2 -2
  80. package/dist/consolidation-undo.d.ts +2 -2
  81. package/dist/day-summary.d.ts +1 -1
  82. package/dist/delinearize.d.ts +1 -1
  83. package/dist/direct-answer-wiring.d.ts +1 -1
  84. package/dist/direct-answer.d.ts +1 -1
  85. package/dist/embedding-fallback.d.ts +1 -1
  86. package/dist/{engine-O6YWKQM3.js → engine-5OTS6GY3.js} +4 -4
  87. package/dist/entity-retrieval.d.ts +2 -2
  88. package/dist/entity-retrieval.js +3 -3
  89. package/dist/entity-schema.d.ts +1 -1
  90. package/dist/explicit-capture.d.ts +6 -6
  91. package/dist/explicit-cue-recall.d.ts +40 -0
  92. package/dist/explicit-cue-recall.js +21 -0
  93. package/dist/extraction-judge-telemetry.d.ts +1 -1
  94. package/dist/extraction-judge-training.d.ts +1 -1
  95. package/dist/extraction-judge.d.ts +1 -1
  96. package/dist/extraction.d.ts +1 -1
  97. package/dist/extraction.js +2 -2
  98. package/dist/fallback-llm.d.ts +3 -1
  99. package/dist/fallback-llm.js +1 -1
  100. package/dist/identity-continuity.d.ts +1 -1
  101. package/dist/importance.d.ts +1 -1
  102. package/dist/index.d.ts +14 -13
  103. package/dist/index.js +191 -52
  104. package/dist/index.js.map +1 -1
  105. package/dist/intent.d.ts +1 -1
  106. package/dist/lifecycle.d.ts +1 -1
  107. package/dist/live-connectors-runner.d.ts +1 -1
  108. package/dist/local-llm.d.ts +1 -1
  109. package/dist/memory-action-policy.d.ts +1 -1
  110. package/dist/memory-cache.d.ts +1 -1
  111. package/dist/{memory-governance-JZHZDOLN.js → memory-governance-7MI7KE35.js} +4 -4
  112. package/dist/memory-governance-7MI7KE35.js.map +1 -0
  113. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  114. package/dist/{memory-projection-store-CY8TU40w.d.ts → memory-projection-store-BQt5VUQ8.d.ts} +1 -1
  115. package/dist/memory-projection-store.d.ts +2 -2
  116. package/dist/memory-worth-outcomes.d.ts +2 -2
  117. package/dist/models-json.d.ts +1 -1
  118. package/dist/native-knowledge.d.ts +1 -1
  119. package/dist/operator-toolkit.d.ts +2 -2
  120. package/dist/operator-toolkit.js +6 -6
  121. package/dist/{orchestrator-ChkesB8U.d.ts → orchestrator-D2lHhFWI.d.ts} +36 -11
  122. package/dist/orchestrator.d.ts +6 -6
  123. package/dist/orchestrator.js +24 -22
  124. package/dist/patterns-cli.d.ts +1 -1
  125. package/dist/policy-runtime.d.ts +1 -1
  126. package/dist/{port-hqGnoStS.d.ts → port-5W-r5SKc.d.ts} +1 -1
  127. package/dist/qmd-recall-cache.d.ts +2 -2
  128. package/dist/qmd.d.ts +2 -2
  129. package/dist/recall-disclosure-escalation.d.ts +1 -1
  130. package/dist/recall-explain-renderer.d.ts +1 -1
  131. package/dist/recall-explain-renderer.js +3 -3
  132. package/dist/recall-state.d.ts +1 -1
  133. package/dist/recall-tag-filter.d.ts +1 -1
  134. package/dist/recall-xray-cli.d.ts +1 -1
  135. package/dist/recall-xray-cli.js +4 -4
  136. package/dist/recall-xray-renderer.d.ts +1 -1
  137. package/dist/recall-xray-renderer.js +3 -3
  138. package/dist/recall-xray.d.ts +2 -2
  139. package/dist/recall-xray.js +2 -2
  140. package/dist/resolve-auth-token.d.ts +1 -1
  141. package/dist/resume-bundles.js +3 -3
  142. package/dist/retrieval-agents.d.ts +2 -2
  143. package/dist/retrieval-tiers.d.ts +1 -1
  144. package/dist/schemas.d.ts +54 -54
  145. package/dist/{semantic-consolidation-ByBXb-sf.d.ts → semantic-consolidation-tDODR2je.d.ts} +2 -2
  146. package/dist/semantic-consolidation.d.ts +3 -3
  147. package/dist/semantic-consolidation.js +3 -3
  148. package/dist/semantic-rule-promotion.js +3 -3
  149. package/dist/semantic-rule-verifier.d.ts +1 -1
  150. package/dist/semantic-rule-verifier.js +3 -3
  151. package/dist/session-observer-bands.d.ts +1 -1
  152. package/dist/session-observer-state.d.ts +1 -1
  153. package/dist/signal.d.ts +1 -1
  154. package/dist/storage.d.ts +2 -2
  155. package/dist/storage.js +2 -2
  156. package/dist/summarizer.d.ts +1 -1
  157. package/dist/summarizer.js +2 -2
  158. package/dist/summary-snapshot.d.ts +1 -1
  159. package/dist/temporal-supersession.d.ts +2 -2
  160. package/dist/temporal-validity.d.ts +1 -1
  161. package/dist/threading.d.ts +1 -1
  162. package/dist/tier-migration.d.ts +3 -3
  163. package/dist/tier-routing.d.ts +1 -1
  164. package/dist/topics.d.ts +1 -1
  165. package/dist/transcript.d.ts +1 -1
  166. package/dist/types-C-USTTAx.d.ts +2713 -0
  167. package/dist/types.d.ts +1 -2668
  168. package/dist/types.js +1 -1
  169. package/dist/utility-runtime.d.ts +1 -1
  170. package/dist/verified-recall.js +3 -3
  171. package/package.json +1 -1
  172. package/dist/chunk-AEMBDV7M.js.map +0 -1
  173. package/dist/chunk-CRU27Q4J.js.map +0 -1
  174. package/dist/chunk-CUI2STX6.js.map +0 -1
  175. package/dist/chunk-JWSENLQI.js.map +0 -1
  176. package/dist/chunk-NZS2BLTP.js.map +0 -1
  177. package/dist/chunk-RILIVK4O.js.map +0 -1
  178. package/dist/chunk-USFPPRAF.js.map +0 -1
  179. package/dist/chunk-VTJVUHRK.js.map +0 -1
  180. package/dist/chunk-XRCYKJ3V.js.map +0 -1
  181. /package/dist/{capsule-crypto-5CYAGVC5.js.map → capsule-crypto-SJS5VVAP.js.map} +0 -0
  182. /package/dist/{capsule-export-NZQPOTQ4.js.map → capsule-export-LLEVB2RG.js.map} +0 -0
  183. /package/dist/{capsule-import-SDCUXLEV.js.map → capsule-import-UW45R2MZ.js.map} +0 -0
  184. /package/dist/{chunk-LW2NMHDW.js.map → chunk-5NS6NN5A.js.map} +0 -0
  185. /package/dist/{chunk-KNKUID7G.js.map → chunk-767ODGE6.js.map} +0 -0
  186. /package/dist/{chunk-V7TEH5I2.js.map → chunk-7RAW2T4P.js.map} +0 -0
  187. /package/dist/{chunk-F5VQOQ2E.js.map → chunk-AIT53NLG.js.map} +0 -0
  188. /package/dist/{chunk-B2TL6GA2.js.map → chunk-BFVBG5XY.js.map} +0 -0
  189. /package/dist/{chunk-Y4A6M3B6.js.map → chunk-DLYTYJ43.js.map} +0 -0
  190. /package/dist/{chunk-ZIBOQULP.js.map → chunk-EONJ7GK3.js.map} +0 -0
  191. /package/dist/{chunk-SMA4IMHV.js.map → chunk-KUIEFH2S.js.map} +0 -0
  192. /package/dist/{chunk-EGEPUGN4.js.map → chunk-LKJA5MR2.js.map} +0 -0
  193. /package/dist/{chunk-IYY4MCPG.js.map → chunk-P73JTV34.js.map} +0 -0
  194. /package/dist/{chunk-52PDY6GD.js.map → chunk-PT2EZWOH.js.map} +0 -0
  195. /package/dist/{chunk-3KIS4VGT.js.map → chunk-QIGOEM65.js.map} +0 -0
  196. /package/dist/{chunk-47WOM4YW.js.map → chunk-RXGR3YLU.js.map} +0 -0
  197. /package/dist/{chunk-XQ4EJLUD.js.map → chunk-TMSHGSIG.js.map} +0 -0
  198. /package/dist/{chunk-X6VBWOVZ.js.map → chunk-UE2OQNQQ.js.map} +0 -0
  199. /package/dist/{chunk-MUELDH4F.js.map → chunk-YELFQNQH.js.map} +0 -0
  200. /package/dist/{chunk-TIFRGAKO.js.map → chunk-YKGRACQP.js.map} +0 -0
  201. /package/dist/{chunk-AGZHRWPT.js.map → chunk-ZBZVNWQO.js.map} +0 -0
  202. /package/dist/{chunk-W7WWT4FJ.js.map → chunk-ZOMA7J3J.js.map} +0 -0
  203. /package/dist/{engine-O6YWKQM3.js.map → engine-5OTS6GY3.js.map} +0 -0
  204. /package/dist/{memory-governance-JZHZDOLN.js.map → explicit-cue-recall.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRecallDisclosure
3
- } from "./chunk-43EKP2UK.js";
3
+ } from "./chunk-COAGZQT7.js";
4
4
 
5
5
  // src/recall-xray.ts
6
6
  import { randomUUID } from "crypto";
@@ -14,7 +14,9 @@ var RECALL_XRAY_SERVED_BY_VALUES = [
14
14
  "graph",
15
15
  "recent-scan",
16
16
  "procedural",
17
- "review-context"
17
+ "review-context",
18
+ "lcm-file-parts",
19
+ "lcm-tool-parts"
18
20
  ];
19
21
  function isRecallXrayServedBy(value) {
20
22
  return typeof value === "string" && RECALL_XRAY_SERVED_BY_VALUES.includes(value);
@@ -260,4 +262,4 @@ export {
260
262
  RecallXrayBuilder,
261
263
  summarizeDisclosureTokens
262
264
  };
263
- //# sourceMappingURL=chunk-USFPPRAF.js.map
265
+ //# sourceMappingURL=chunk-D7WYTVUQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-xray.ts"],"sourcesContent":["/**\n * Recall X-ray snapshot schema (issue #570, PR 1).\n *\n * The X-ray surface is the unified, per-result attribution document that\n * merges the tier that served each memory, its score decomposition, any\n * graph path, an audit entry id, and the exact filter/eligibility ladder\n * that either admitted or rejected each candidate. This file defines the\n * schema and an in-memory builder + builder-state helper.\n *\n * Scope for PR 1 (this slice):\n * - Types only + pure builder functions (no IO, no rendering).\n * - Orchestrator plumbing captures a snapshot when the caller passes\n * `xrayCapture: true`. No behavior change when the flag is absent.\n * - NO new public surfaces here — CLI/HTTP/MCP land in later slices.\n *\n * The shared renderer lands in PR 2 at `recall-xray-renderer.ts`. Do not\n * fork formatting logic into other surfaces; extend the renderer.\n */\n\nimport { randomUUID } from \"node:crypto\";\n\nimport type { RecallDisclosure, RecallTierExplain } from \"./types.js\";\nimport { isRecallDisclosure } from \"./types.js\";\n\n/**\n * Estimate token cost of a payload at the rough ~4 chars/token English\n * heuristic. Non-negative integer; returns 0 for empty / null input.\n * Used by recall surfaces to attach `estimatedTokens` to X-ray results\n * (issue #677 PR 3/4). Identical to the private heuristic in\n * `chunking.ts`; kept self-contained here so X-ray callers don't pull\n * in chunking internals.\n */\nexport function estimateRecallTokens(text: string | null | undefined): number {\n if (typeof text !== \"string\" || text.length === 0) return 0;\n return Math.ceil(text.length / 4);\n}\n\n/**\n * Aggregated per-disclosure token spend summary, computed by the\n * renderer from a snapshot's results. Non-negative integers.\n */\nexport interface RecallXrayDisclosureSummary {\n chunk: { count: number; estimatedTokens: number };\n section: { count: number; estimatedTokens: number };\n raw: { count: number; estimatedTokens: number };\n /** Number of results without a recorded disclosure level. */\n unspecified: { count: number; estimatedTokens: number };\n}\n\n/**\n * Which retrieval source produced a given result. This is the X-ray\n * tier ladder called out in issue #570 and is *distinct* from the\n * `RetrievalTier` enum (which describes issue #518's tier-explain\n * block). Keeping the sets separate lets the two observability\n * surfaces evolve without conflating their vocabularies:\n *\n * - `RetrievalTier` — direct-answer eligibility ladder.\n * - `RecallXrayServedBy` — which source materialized each result.\n */\nexport type RecallXrayServedBy =\n | \"direct-answer\"\n | \"hybrid\"\n | \"graph\"\n | \"recent-scan\"\n | \"procedural\"\n | \"review-context\"\n | \"lcm-file-parts\"\n | \"lcm-tool-parts\";\n\nexport const RECALL_XRAY_SERVED_BY_VALUES: readonly RecallXrayServedBy[] = [\n \"direct-answer\",\n \"hybrid\",\n \"graph\",\n \"recent-scan\",\n \"procedural\",\n \"review-context\",\n \"lcm-file-parts\",\n \"lcm-tool-parts\",\n] as const;\n\nexport function isRecallXrayServedBy(\n value: unknown,\n): value is RecallXrayServedBy {\n return (\n typeof value === \"string\" &&\n (RECALL_XRAY_SERVED_BY_VALUES as readonly string[]).includes(value)\n );\n}\n\n/**\n * Score decomposition for a single X-ray result.\n *\n * All fields are optional because different tiers populate different\n * terms: `hybrid` reports vector + bm25 + mmr penalty, `direct-answer`\n * reports importance + tier prior, etc. The only guaranteed field is\n * `final`, which is the post-combination score used for ordering.\n */\nexport interface RecallXrayScoreDecomposition {\n vector?: number;\n bm25?: number;\n importance?: number;\n mmrPenalty?: number;\n tierPrior?: number;\n /** Additive boost from `reinforcement_count` frontmatter (issue #687 PR 3/4). */\n reinforcementBoost?: number;\n final: number;\n}\n\n/**\n * Per-result breakdown inside an X-ray snapshot.\n */\nexport interface RecallXrayResult {\n memoryId: string;\n path: string;\n servedBy: RecallXrayServedBy;\n scoreDecomposition: RecallXrayScoreDecomposition;\n graphPath?: string[];\n /**\n * Issue #681 PR 3/3 — per-edge confidence values aligned with\n * `graphPath`. When present, `graphEdgeConfidences[i]` is the\n * confidence of the edge between `graphPath[i]` and `graphPath[i+1]`,\n * so the array length is one less than `graphPath`. Legacy edges\n * without a recorded confidence render as `1.0`. Operators use this\n * to attribute floor-pruning and PageRank ranking decisions back to\n * specific edges. The renderer drops the line when the array is\n * empty or absent so legacy snapshots round-trip cleanly.\n */\n graphEdgeConfidences?: number[];\n auditEntryId?: string;\n /** Human-readable list of filters the candidate *passed*. */\n admittedBy: string[];\n /**\n * First filter that *would have* rejected the candidate, or undefined\n * when the candidate was admitted without a rejection trace. When\n * present, `admittedBy` may still contain filters the candidate passed\n * before the rejecting gate; consumers should render both.\n */\n rejectedBy?: string;\n /**\n * Disclosure depth used to render this result's payload (issue #677\n * PR 3/4). Mirrors the per-result disclosure already exposed in the\n * recall response so X-ray consumers can attribute token spend to\n * the depth that produced it.\n */\n disclosure?: RecallDisclosure;\n /**\n * Estimated token cost of the rendered payload at the chosen\n * disclosure depth. Non-negative integer. Computed by callers via\n * `estimateRecallTokens(text)`; the renderer aggregates these into\n * a per-disclosure summary so operators can see where their budget\n * went.\n */\n estimatedTokens?: number;\n /**\n * Free-form tags from the memory's YAML frontmatter (issue #689 PR 3/3).\n * Populated by the X-ray capture path when the caller passes a `tags`\n * filter so per-result tags are available alongside the filter trace\n * in `snapshot.filters`. Also populated without a filter when the\n * orchestrator decorates results via `xrayCapture: true` so all X-ray\n * consumers can inspect memory labels without a separate storage read.\n * Absent (not `[]`) when the frontmatter has no tags or the memory\n * could not be read.\n */\n tags?: string[];\n}\n\n/**\n * Trace entry for a filter the orchestrator evaluated during recall.\n * Captures the name of the filter, how many candidates it saw, and how\n * many it let through. Used by X-ray consumers to render the filter\n * ladder above the per-result breakdown.\n */\nexport interface RecallFilterTrace {\n name: string;\n considered: number;\n admitted: number;\n /** Optional human-readable reason for any rejections. */\n reason?: string;\n}\n\n/**\n * Peer-profile injection annotation (issue #679 completion).\n *\n * When `peerProfileRecallEnabled` is true and a peer is registered for\n * the session, the orchestrator injects a `## Peer Profile` section into\n * the recall context. This annotation records which peer was injected and\n * how many profile fields were included so operators can correlate\n * retrieval quality with peer-context enrichment.\n *\n * `null` means no peer profile was injected (peer not registered, feature\n * disabled, or peer has no profile fields).\n */\nexport interface RecallXrayPeerProfileInjection {\n /** The peer id whose profile was injected. */\n peerId: string;\n /**\n * Number of profile fields included after the `peerProfileRecallMaxFields`\n * cap was applied. Zero means the profile existed but had no fields.\n */\n fieldsInjected: number;\n}\n\n/**\n * The unified X-ray snapshot. CLI, HTTP, and MCP surfaces all render\n * this same shape through the shared renderer (CLAUDE.md rule 22).\n */\nexport interface RecallXraySnapshot {\n /** Stable v1 tag so downstream consumers can version-gate their parsers. */\n schemaVersion: \"1\";\n query: string;\n /** UUID minted per capture; unique across snapshots within a process. */\n snapshotId: string;\n /** Epoch milliseconds the snapshot was captured. */\n capturedAt: number;\n /**\n * Tier-explain block from issue #518, carried verbatim when present.\n * `null` means direct-answer tier did not run (disabled, or another\n * tier served the query).\n */\n tierExplain: RecallTierExplain | null;\n results: RecallXrayResult[];\n filters: RecallFilterTrace[];\n /**\n * Character budget accounting for the final assembled recall payload.\n * `used` is the rendered-context length; `chars` is the cap. Both are\n * non-negative integers in `[0, 2**31)`.\n */\n budget: { chars: number; used: number };\n /** Optional session-scope fields carried for downstream filtering. */\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n /**\n * Peer-profile injection metadata (issue #679 completion).\n * Non-null when `peerProfileRecallEnabled` is true and a peer profile\n * was successfully injected into this recall's context. `null` (or\n * absent) means no peer profile was injected.\n */\n peerProfileInjection?: RecallXrayPeerProfileInjection | null;\n}\n\n// ─── Builder ──────────────────────────────────────────────────────────────\n\nexport interface BuildXraySnapshotInput {\n query: string;\n tierExplain?: RecallTierExplain | null;\n results?: RecallXrayResult[];\n filters?: RecallFilterTrace[];\n budget?: { chars?: number; used?: number };\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n /** Peer-profile injection metadata (issue #679 completion). */\n peerProfileInjection?: RecallXrayPeerProfileInjection | null;\n /** Optional injected timestamp for deterministic tests. */\n now?: () => number;\n /** Optional injected id generator for deterministic tests. */\n snapshotIdGenerator?: () => string;\n}\n\n/**\n * Build a `RecallXraySnapshot` from explicit input fields. Pure\n * function; safe to call from anywhere. All array/object inputs are\n * shallow-copied so caller mutation after build cannot tear the\n * returned snapshot.\n */\nexport function buildXraySnapshot(\n input: BuildXraySnapshotInput,\n): RecallXraySnapshot {\n const now = input.now ?? Date.now;\n const snapshotIdGenerator = input.snapshotIdGenerator ?? randomUUID;\n\n const results = Array.isArray(input.results)\n ? input.results.map(cloneResult)\n : [];\n const filters = Array.isArray(input.filters)\n ? input.filters.map(cloneFilter)\n : [];\n\n const budgetChars = nonNegativeInt(input.budget?.chars);\n const budgetUsed = nonNegativeInt(input.budget?.used);\n\n const tierExplain =\n input.tierExplain && typeof input.tierExplain === \"object\"\n ? cloneTierExplain(input.tierExplain)\n : null;\n\n // Peer-profile injection annotation (issue #679 completion).\n // Deep-copy via structuredClone so the caller can't mutate the snapshot\n // after build. Accept null explicitly (no injection) or a valid object.\n let peerProfileInjection: RecallXrayPeerProfileInjection | null | undefined;\n if (input.peerProfileInjection && typeof input.peerProfileInjection === \"object\") {\n const raw = input.peerProfileInjection;\n const peerId = nonEmptyString(raw.peerId);\n if (peerId !== undefined) {\n peerProfileInjection = {\n peerId,\n fieldsInjected: nonNegativeInt(raw.fieldsInjected),\n };\n }\n } else if (input.peerProfileInjection === null) {\n peerProfileInjection = null;\n }\n\n const out: RecallXraySnapshot = {\n schemaVersion: \"1\",\n query: typeof input.query === \"string\" ? input.query : \"\",\n snapshotId: snapshotIdGenerator(),\n capturedAt: now(),\n tierExplain,\n results,\n filters,\n budget: { chars: budgetChars, used: budgetUsed },\n sessionKey: nonEmptyString(input.sessionKey),\n namespace: nonEmptyString(input.namespace),\n traceId: nonEmptyString(input.traceId),\n };\n if (peerProfileInjection !== undefined) {\n out.peerProfileInjection = peerProfileInjection;\n }\n return out;\n}\n\n/**\n * Mutable builder used by the orchestrator to accumulate X-ray fields\n * as recall progresses. Call `build()` to get the finalized\n * immutable-ish snapshot. All inputs are validated at insert time so\n * a malformed entry cannot poison the snapshot later.\n */\nexport class RecallXrayBuilder {\n private readonly query: string;\n private readonly sessionKey: string | undefined;\n private namespace: string | undefined;\n private traceId: string | undefined;\n private tierExplain: RecallTierExplain | null = null;\n private readonly results: RecallXrayResult[] = [];\n private readonly filters: RecallFilterTrace[] = [];\n private budgetChars = 0;\n private budgetUsed = 0;\n private peerProfileInjection: RecallXrayPeerProfileInjection | null | undefined;\n\n constructor(opts: {\n query: string;\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n }) {\n this.query = typeof opts.query === \"string\" ? opts.query : \"\";\n this.sessionKey = nonEmptyString(opts.sessionKey);\n this.namespace = nonEmptyString(opts.namespace);\n this.traceId = nonEmptyString(opts.traceId);\n }\n\n setNamespace(namespace: string | undefined): void {\n this.namespace = nonEmptyString(namespace);\n }\n\n setTraceId(traceId: string | undefined): void {\n this.traceId = nonEmptyString(traceId);\n }\n\n setTierExplain(tierExplain: RecallTierExplain | null | undefined): void {\n this.tierExplain =\n tierExplain && typeof tierExplain === \"object\"\n ? cloneTierExplain(tierExplain)\n : null;\n }\n\n setBudget(budget: { chars?: number; used?: number }): void {\n this.budgetChars = nonNegativeInt(budget.chars);\n this.budgetUsed = nonNegativeInt(budget.used);\n }\n\n /**\n * Record peer-profile injection metadata for this recall snapshot\n * (issue #679 completion). Pass `null` to explicitly record that no\n * injection happened (feature enabled but no peer / no profile fields).\n */\n setPeerProfileInjection(\n injection: RecallXrayPeerProfileInjection | null,\n ): void {\n this.peerProfileInjection = injection;\n }\n\n recordResult(result: RecallXrayResult): void {\n this.results.push(cloneResult(result));\n }\n\n recordFilter(filter: RecallFilterTrace): void {\n this.filters.push(cloneFilter(filter));\n }\n\n build(opts: {\n now?: () => number;\n snapshotIdGenerator?: () => string;\n } = {}): RecallXraySnapshot {\n return buildXraySnapshot({\n query: this.query,\n tierExplain: this.tierExplain,\n results: this.results,\n filters: this.filters,\n budget: { chars: this.budgetChars, used: this.budgetUsed },\n sessionKey: this.sessionKey,\n namespace: this.namespace,\n traceId: this.traceId,\n peerProfileInjection: this.peerProfileInjection,\n now: opts.now,\n snapshotIdGenerator: opts.snapshotIdGenerator,\n });\n }\n}\n\n// ─── Internals ────────────────────────────────────────────────────────────\n\nfunction cloneResult(result: RecallXrayResult): RecallXrayResult {\n if (!result || typeof result !== \"object\") {\n throw new TypeError(\"RecallXrayResult must be an object\");\n }\n if (!isRecallXrayServedBy(result.servedBy)) {\n throw new TypeError(\n `RecallXrayResult.servedBy must be one of ${RECALL_XRAY_SERVED_BY_VALUES.join(\n \", \",\n )}; got ${JSON.stringify(result.servedBy)}`,\n );\n }\n const memoryId = typeof result.memoryId === \"string\" ? result.memoryId : \"\";\n const path = typeof result.path === \"string\" ? result.path : \"\";\n const admittedBy = Array.isArray(result.admittedBy)\n ? result.admittedBy.filter((x): x is string => typeof x === \"string\")\n : [];\n const graphPath = Array.isArray(result.graphPath)\n ? result.graphPath.filter((x): x is string => typeof x === \"string\")\n : undefined;\n // Issue #681 PR 3/3 — per-edge confidences alongside graph path.\n // Each entry is clamped into [0, 1]; the array is rejected wholesale\n // when alignment cannot be verified so downstream surfaces can rely\n // on `graphEdgeConfidences[i]` describing the edge between\n // `graphPath[i]` and `graphPath[i+1]`.\n //\n // Cursor review (#735): the input array length MUST match\n // `graphPath.length - 1` *before* any per-element filtering. The\n // earlier implementation skipped non-finite entries via `continue`\n // and then length-checked the cleaned array — that would silently\n // shift surviving values to earlier positions. Example: input\n // `[0.5, NaN, 0.7]` for a 3-edge path would collapse to\n // `[0.5, 0.7]`, length-check would pass against `expected = 2`, and\n // the renderer would mis-attribute `0.7` to edge B→C when it really\n // came from edge C→D. Reject on either size mismatch or any\n // non-finite entry so misalignment is impossible.\n let graphEdgeConfidences: number[] | undefined;\n if (Array.isArray(result.graphEdgeConfidences) && graphPath && graphPath.length > 1) {\n const expected = graphPath.length - 1;\n const raw = result.graphEdgeConfidences;\n if (raw.length === expected) {\n const cleaned: number[] = [];\n let allFinite = true;\n for (const value of raw) {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n allFinite = false;\n break;\n }\n cleaned.push(Math.min(1, Math.max(0, value)));\n }\n if (allFinite) {\n graphEdgeConfidences = cleaned;\n }\n }\n }\n const auditEntryId = nonEmptyString(result.auditEntryId);\n const rejectedBy = nonEmptyString(result.rejectedBy);\n const scoreDecomposition = cloneScoreDecomposition(result.scoreDecomposition);\n const out: RecallXrayResult = {\n memoryId,\n path,\n servedBy: result.servedBy,\n scoreDecomposition,\n admittedBy,\n };\n if (graphPath !== undefined) out.graphPath = graphPath;\n if (graphEdgeConfidences !== undefined) {\n out.graphEdgeConfidences = graphEdgeConfidences;\n }\n if (auditEntryId !== undefined) out.auditEntryId = auditEntryId;\n if (rejectedBy !== undefined) out.rejectedBy = rejectedBy;\n // Disclosure + token telemetry (issue #677 PR 3/4). Only attach when\n // present and well-formed; unknown disclosure values are dropped so a\n // bad caller can't poison downstream renderers. Uses the shared\n // `isRecallDisclosure` guard so adding a fourth disclosure level\n // requires touching only `types.ts`.\n if (isRecallDisclosure(result.disclosure)) {\n out.disclosure = result.disclosure;\n }\n if (\n typeof result.estimatedTokens === \"number\" &&\n Number.isFinite(result.estimatedTokens) &&\n result.estimatedTokens >= 0\n ) {\n out.estimatedTokens = Math.floor(result.estimatedTokens);\n }\n // Tags from frontmatter (issue #689 PR 3/3). Normalize identically to\n // the recall-surface path: trim and drop empty strings so consumers can\n // compare tags directly without a secondary normalization step.\n if (Array.isArray(result.tags)) {\n const cleanedTags = result.tags\n .filter((t): t is string => typeof t === \"string\")\n .map((t) => t.trim())\n .filter((t) => t.length > 0);\n if (cleanedTags.length > 0) {\n out.tags = cleanedTags;\n }\n }\n return out;\n}\n\n/**\n * Summarize per-disclosure token spend across an X-ray snapshot's\n * results. Pure helper — used by the markdown renderer to print a\n * \"per-disclosure token spend\" line and exposed for tests / surfaces.\n */\nexport function summarizeDisclosureTokens(\n results: ReadonlyArray<RecallXrayResult>,\n): RecallXrayDisclosureSummary {\n const summary: RecallXrayDisclosureSummary = {\n chunk: { count: 0, estimatedTokens: 0 },\n section: { count: 0, estimatedTokens: 0 },\n raw: { count: 0, estimatedTokens: 0 },\n unspecified: { count: 0, estimatedTokens: 0 },\n };\n for (const result of results) {\n const tokens =\n typeof result.estimatedTokens === \"number\" &&\n Number.isFinite(result.estimatedTokens) &&\n result.estimatedTokens >= 0\n ? Math.floor(result.estimatedTokens)\n : 0;\n const bucket = isRecallDisclosure(result.disclosure)\n ? result.disclosure\n : \"unspecified\";\n summary[bucket].count += 1;\n summary[bucket].estimatedTokens += tokens;\n }\n return summary;\n}\n\nfunction cloneFilter(filter: RecallFilterTrace): RecallFilterTrace {\n if (!filter || typeof filter !== \"object\") {\n throw new TypeError(\"RecallFilterTrace must be an object\");\n }\n const out: RecallFilterTrace = {\n name: typeof filter.name === \"string\" ? filter.name : \"\",\n considered: nonNegativeInt(filter.considered),\n admitted: nonNegativeInt(filter.admitted),\n };\n const reason = nonEmptyString(filter.reason);\n if (reason !== undefined) out.reason = reason;\n return out;\n}\n\nfunction cloneScoreDecomposition(\n value: RecallXrayScoreDecomposition | undefined,\n): RecallXrayScoreDecomposition {\n if (!value || typeof value !== \"object\") {\n return { final: 0 };\n }\n const out: RecallXrayScoreDecomposition = {\n final: finiteNumber(value.final) ?? 0,\n };\n const vector = finiteNumber(value.vector);\n if (vector !== undefined) out.vector = vector;\n const bm25 = finiteNumber(value.bm25);\n if (bm25 !== undefined) out.bm25 = bm25;\n const importance = finiteNumber(value.importance);\n if (importance !== undefined) out.importance = importance;\n const mmrPenalty = finiteNumber(value.mmrPenalty);\n if (mmrPenalty !== undefined) out.mmrPenalty = mmrPenalty;\n const tierPrior = finiteNumber(value.tierPrior);\n if (tierPrior !== undefined) out.tierPrior = tierPrior;\n const reinforcementBoost = finiteNumber(value.reinforcementBoost);\n if (reinforcementBoost !== undefined && reinforcementBoost > 0) {\n out.reinforcementBoost = reinforcementBoost;\n }\n return out;\n}\n\nfunction cloneTierExplain(tierExplain: RecallTierExplain): RecallTierExplain {\n // Use structuredClone so future RecallTierExplain additions do not\n // silently share references through hand-enumerated fields. The\n // payload is JSON-shaped.\n return structuredClone(tierExplain);\n}\n\nfunction nonNegativeInt(value: unknown): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return 0;\n if (value <= 0) return 0;\n return Math.floor(value);\n}\n\nfunction finiteNumber(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return undefined;\n return value;\n}\n\nfunction nonEmptyString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (trimmed.length === 0) return undefined;\n return trimmed;\n}\n"],"mappings":";;;;;AAmBA,SAAS,kBAAkB;AAapB,SAAS,qBAAqB,MAAyC;AAC5E,MAAI,OAAO,SAAS,YAAY,KAAK,WAAW,EAAG,QAAO;AAC1D,SAAO,KAAK,KAAK,KAAK,SAAS,CAAC;AAClC;AAkCO,IAAM,+BAA8D;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,qBACd,OAC6B;AAC7B,SACE,OAAO,UAAU,YAChB,6BAAmD,SAAS,KAAK;AAEtE;AAmLO,SAAS,kBACd,OACoB;AACpB,QAAM,MAAM,MAAM,OAAO,KAAK;AAC9B,QAAM,sBAAsB,MAAM,uBAAuB;AAEzD,QAAM,UAAU,MAAM,QAAQ,MAAM,OAAO,IACvC,MAAM,QAAQ,IAAI,WAAW,IAC7B,CAAC;AACL,QAAM,UAAU,MAAM,QAAQ,MAAM,OAAO,IACvC,MAAM,QAAQ,IAAI,WAAW,IAC7B,CAAC;AAEL,QAAM,cAAc,eAAe,MAAM,QAAQ,KAAK;AACtD,QAAM,aAAa,eAAe,MAAM,QAAQ,IAAI;AAEpD,QAAM,cACJ,MAAM,eAAe,OAAO,MAAM,gBAAgB,WAC9C,iBAAiB,MAAM,WAAW,IAClC;AAKN,MAAI;AACJ,MAAI,MAAM,wBAAwB,OAAO,MAAM,yBAAyB,UAAU;AAChF,UAAM,MAAM,MAAM;AAClB,UAAM,SAAS,eAAe,IAAI,MAAM;AACxC,QAAI,WAAW,QAAW;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GZQT7.js";
16
16
  import {
17
17
  getCachedEntities,
18
18
  invalidateCachedEntities,
@@ -5092,4 +5092,4 @@ export {
5092
5092
  serializeEntityFile,
5093
5093
  StorageManager
5094
5094
  };
5095
- //# sourceMappingURL=chunk-Y4A6M3B6.js.map
5095
+ //# sourceMappingURL=chunk-DLYTYJ43.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  StorageManager,
3
3
  normalizeEntityName
4
- } from "./chunk-Y4A6M3B6.js";
4
+ } from "./chunk-DLYTYJ43.js";
5
5
  import {
6
6
  readEnvVar,
7
7
  resolveHomeDir
@@ -824,4 +824,4 @@ export {
824
824
  resolveBriefingSaveDir,
825
825
  briefingFilename
826
826
  };
827
- //# sourceMappingURL=chunk-ZIBOQULP.js.map
827
+ //# sourceMappingURL=chunk-EONJ7GK3.js.map
@@ -283,6 +283,9 @@ var MEMORY_OS_PRESETS = {
283
283
  contextCompressionActionsEnabled: true,
284
284
  compressionGuidelineLearningEnabled: true,
285
285
  compressionGuidelineSemanticRefinementEnabled: true,
286
+ explicitCueRecallEnabled: true,
287
+ explicitCueRecallMaxChars: 3200,
288
+ lcmEnabled: true,
286
289
  maxProactiveQuestionsPerExtraction: 4,
287
290
  maxCompressionTokensPerHour: 3e3,
288
291
  behaviorLoopAutoTuneEnabled: true
@@ -1579,6 +1582,9 @@ function parseConfig(raw) {
1579
1582
  temporalMemoryTreeEnabled: cfg.temporalMemoryTreeEnabled === true,
1580
1583
  tmtHourlyMinMemories: typeof cfg.tmtHourlyMinMemories === "number" ? cfg.tmtHourlyMinMemories : 3,
1581
1584
  tmtSummaryMaxTokens: typeof cfg.tmtSummaryMaxTokens === "number" ? cfg.tmtSummaryMaxTokens : 300,
1585
+ explicitCueRecallEnabled: coerceBool(cfg.explicitCueRecallEnabled) === true,
1586
+ explicitCueRecallMaxChars: coerceNumber(cfg.explicitCueRecallMaxChars) !== void 0 ? Math.max(0, Math.floor(coerceNumber(cfg.explicitCueRecallMaxChars))) : 2400,
1587
+ explicitCueRecallMaxReferences: coerceNumber(cfg.explicitCueRecallMaxReferences) !== void 0 ? Math.max(0, Math.floor(coerceNumber(cfg.explicitCueRecallMaxReferences))) : 24,
1582
1588
  // Lossless Context Management (LCM)
1583
1589
  lcmEnabled: cfg.lcmEnabled === true,
1584
1590
  lcmLeafBatchSize: typeof cfg.lcmLeafBatchSize === "number" ? Math.max(2, Math.floor(cfg.lcmLeafBatchSize)) : 8,
@@ -1588,6 +1594,8 @@ function parseConfig(raw) {
1588
1594
  lcmRecallBudgetShare: typeof cfg.lcmRecallBudgetShare === "number" ? Math.max(0, Math.min(1, cfg.lcmRecallBudgetShare)) : 0.15,
1589
1595
  lcmDeterministicMaxTokens: typeof cfg.lcmDeterministicMaxTokens === "number" ? Math.max(64, Math.floor(cfg.lcmDeterministicMaxTokens)) : 512,
1590
1596
  lcmArchiveRetentionDays: typeof cfg.lcmArchiveRetentionDays === "number" ? Math.max(1, Math.floor(cfg.lcmArchiveRetentionDays)) : 90,
1597
+ messagePartsEnabled: coerceBooleanLike(cfg.messagePartsEnabled) === true,
1598
+ messagePartsRecallMaxResults: typeof cfg.messagePartsRecallMaxResults === "number" ? Math.max(0, Math.floor(cfg.messagePartsRecallMaxResults)) : 6,
1591
1599
  // v9.1 Parallel Specialized Retrieval
1592
1600
  parallelRetrievalEnabled: cfg.parallelRetrievalEnabled === true,
1593
1601
  parallelAgentWeights: (() => {
@@ -1934,6 +1942,12 @@ function buildDefaultRecallPipeline(cfg) {
1934
1942
  enabled: cfg.sharedContextEnabled === true,
1935
1943
  maxChars: typeof cfg.sharedContextMaxInjectChars === "number" ? Math.max(0, Math.floor(cfg.sharedContextMaxInjectChars)) : 4e3
1936
1944
  },
1945
+ {
1946
+ id: "explicit-cue",
1947
+ enabled: coerceBool(cfg.explicitCueRecallEnabled) === true,
1948
+ maxChars: coerceNumber(cfg.explicitCueRecallMaxChars) !== void 0 ? Math.max(0, Math.floor(coerceNumber(cfg.explicitCueRecallMaxChars))) : 2400,
1949
+ maxResults: coerceNumber(cfg.explicitCueRecallMaxReferences) !== void 0 ? Math.max(0, Math.floor(coerceNumber(cfg.explicitCueRecallMaxReferences))) : 24
1950
+ },
1937
1951
  {
1938
1952
  id: "profile",
1939
1953
  enabled: true,
@@ -2086,4 +2100,4 @@ export {
2086
2100
  VALID_MEMORY_CATEGORIES,
2087
2101
  parseConfig
2088
2102
  };
2089
- //# sourceMappingURL=chunk-JWSENLQI.js.map
2103
+ //# sourceMappingURL=chunk-FSWYMUWI.js.map