@remnic/core 9.3.649 → 9.3.651

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 (176) hide show
  1. package/dist/access-cli.js +36 -35
  2. package/dist/access-cli.js.map +1 -1
  3. package/dist/access-http.d.ts +2 -2
  4. package/dist/access-http.js +16 -16
  5. package/dist/access-mcp.d.ts +2 -2
  6. package/dist/access-mcp.js +15 -15
  7. package/dist/access-schema.js +3 -3
  8. package/dist/{access-service-DFXIlGvZ.d.ts → access-service-DIZRHQ7Q.d.ts} +255 -2
  9. package/dist/access-service.d.ts +2 -2
  10. package/dist/access-service.js +13 -13
  11. package/dist/{auto-sync-54QQHOG5.js → auto-sync-5CJBJMPZ.js} +5 -5
  12. package/dist/bootstrap.d.ts +1 -1
  13. package/dist/briefing.js +3 -3
  14. package/dist/calibration.js +2 -2
  15. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  16. package/dist/causal-consolidation.js +6 -6
  17. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  18. package/dist/{chunk-OAZ5MFUB.js → chunk-3XGWCZ63.js} +45 -28
  19. package/dist/chunk-3XGWCZ63.js.map +1 -0
  20. package/dist/{chunk-QKE4LHNR.js → chunk-4HYSMH7D.js} +2 -2
  21. package/dist/{chunk-NMIOW7XG.js → chunk-4PTKFBST.js} +2 -2
  22. package/dist/{chunk-DDRNDPX4.js → chunk-4SKKVWLQ.js} +2 -2
  23. package/dist/chunk-5FOCXX5E.js +34 -0
  24. package/dist/chunk-5FOCXX5E.js.map +1 -0
  25. package/dist/{chunk-XUGVP7ZU.js → chunk-5WSDHTBO.js} +166 -47
  26. package/dist/chunk-5WSDHTBO.js.map +1 -0
  27. package/dist/{chunk-WPCCNSWO.js → chunk-6UKL6IXM.js} +4 -4
  28. package/dist/{chunk-DB5A3NHS.js → chunk-7LWRCOP7.js} +9 -2
  29. package/dist/chunk-7LWRCOP7.js.map +1 -0
  30. package/dist/{chunk-APJQ6UEA.js → chunk-AGNBY3VG.js} +4 -4
  31. package/dist/{chunk-4BISW7RX.js → chunk-AJE7FJVE.js} +2 -2
  32. package/dist/{chunk-ZXWAQFDE.js → chunk-CFOCZPIQ.js} +2 -2
  33. package/dist/{chunk-NT5TINK5.js → chunk-DHGSZ3UD.js} +2 -2
  34. package/dist/{chunk-OTC2KOZ2.js → chunk-EHQLDFSH.js} +2 -2
  35. package/dist/{chunk-AMACWKM4.js → chunk-IJHLC5CH.js} +2 -2
  36. package/dist/{chunk-OR7R6M5Z.js → chunk-IVYSVAC6.js} +2 -2
  37. package/dist/{chunk-UMKPSD35.js → chunk-JF7SFXTG.js} +2 -2
  38. package/dist/{chunk-MCYT2RNT.js → chunk-KJDKZVF3.js} +3 -3
  39. package/dist/{chunk-BUKK5SWA.js → chunk-KQAFEZQX.js} +2 -2
  40. package/dist/{chunk-PQFUUXWK.js → chunk-KWM33SPU.js} +2 -2
  41. package/dist/{chunk-A3BS64GV.js → chunk-LCC5EZTT.js} +4 -4
  42. package/dist/{chunk-ZT6R3WR3.js → chunk-LFTLXOFX.js} +4 -4
  43. package/dist/{chunk-CNRZ6WJU.js → chunk-MF32AL7N.js} +5 -5
  44. package/dist/{chunk-6GIKAUTN.js → chunk-MMJANTJX.js} +33 -2
  45. package/dist/{chunk-6GIKAUTN.js.map → chunk-MMJANTJX.js.map} +1 -1
  46. package/dist/{chunk-D6WVJIS3.js → chunk-ORGWWNJG.js} +2 -2
  47. package/dist/{chunk-Z3PZRDLW.js → chunk-PRQXUSQV.js} +2 -2
  48. package/dist/{chunk-VWT3F4IV.js → chunk-PS3SYNHP.js} +12 -4
  49. package/dist/chunk-PS3SYNHP.js.map +1 -0
  50. package/dist/{chunk-IMWFHBG2.js → chunk-QWRC7GIO.js} +2 -2
  51. package/dist/{chunk-FQYFMIKG.js → chunk-RKN5J4RO.js} +26 -26
  52. package/dist/{chunk-FUXV6HSO.js → chunk-RSS2KWN6.js} +5 -5
  53. package/dist/{chunk-U3GQ33JC.js → chunk-SLTKP5WJ.js} +2 -2
  54. package/dist/{chunk-5ETA6OAS.js → chunk-SLYD3AH4.js} +617 -89
  55. package/dist/chunk-SLYD3AH4.js.map +1 -0
  56. package/dist/{chunk-6NKAQ74D.js → chunk-UU6MVCJ6.js} +1 -1
  57. package/dist/chunk-UU6MVCJ6.js.map +1 -0
  58. package/dist/{chunk-WEPMT6SC.js → chunk-V25ZAOSB.js} +5 -5
  59. package/dist/{chunk-UMTG2BN2.js → chunk-V4UDXYGG.js} +2 -2
  60. package/dist/{chunk-RRRCNIPK.js → chunk-WJK75OCH.js} +4 -4
  61. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  62. package/dist/{chunk-OZKZ2TRP.js → chunk-XBIACVCO.js} +9 -2
  63. package/dist/chunk-XBIACVCO.js.map +1 -0
  64. package/dist/{chunk-ALUZN7BE.js → chunk-XMN6MMTU.js} +2 -2
  65. package/dist/{chunk-A4BTPHIN.js → chunk-Y7NWBBHV.js} +6 -6
  66. package/dist/{chunk-M75TBFKQ.js → chunk-Z2OXSMZK.js} +2 -2
  67. package/dist/{cli-DrL2Nv4j.d.ts → cli-BG4ybtJr.d.ts} +2 -2
  68. package/dist/cli.d.ts +3 -3
  69. package/dist/cli.js +31 -31
  70. package/dist/compounding/engine.js +3 -3
  71. package/dist/connectors/codex-materialize-runner.js +3 -3
  72. package/dist/connectors/index.js +3 -3
  73. package/dist/entity-retrieval.js +3 -3
  74. package/dist/event-order-recall.js +1 -1
  75. package/dist/explicit-capture.d.ts +1 -1
  76. package/dist/explicit-cue-recall.d.ts +7 -0
  77. package/dist/explicit-cue-recall.js +2 -1
  78. package/dist/extraction-judge.js +3 -3
  79. package/dist/extraction.js +3 -3
  80. package/dist/fallback-llm.js +2 -2
  81. package/dist/focused-list-recall.d.ts +6 -0
  82. package/dist/focused-list-recall.js +2 -1
  83. package/dist/index.d.ts +4 -4
  84. package/dist/index.js +84 -83
  85. package/dist/index.js.map +1 -1
  86. package/dist/lcm/engine.js +2 -2
  87. package/dist/lcm/index.js +5 -5
  88. package/dist/lcm-fallback-read.d.ts +71 -0
  89. package/dist/lcm-fallback-read.js +10 -0
  90. package/dist/lcm-fallback-read.js.map +1 -0
  91. package/dist/maintenance/memory-governance.js +3 -3
  92. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  93. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  94. package/dist/mcp-memory-inspector-app.d.ts +2 -2
  95. package/dist/namespaces/migrate.js +7 -7
  96. package/dist/namespaces/search.js +3 -3
  97. package/dist/namespaces/storage.js +3 -3
  98. package/dist/operator-toolkit.js +9 -9
  99. package/dist/{orchestrator-DEQW9j0Z.d.ts → orchestrator-CX-oqwJq.d.ts} +58 -0
  100. package/dist/orchestrator.d.ts +1 -1
  101. package/dist/orchestrator.js +30 -29
  102. package/dist/recall-planner-llm.js +2 -2
  103. package/dist/response-guidance-recall.d.ts +6 -0
  104. package/dist/response-guidance-recall.js +2 -1
  105. package/dist/schemas.d.ts +22 -22
  106. package/dist/search/factory.js +2 -2
  107. package/dist/search/index.js +4 -4
  108. package/dist/semantic-consolidation.js +4 -4
  109. package/dist/semantic-rule-promotion.js +3 -3
  110. package/dist/semantic-rule-verifier.js +3 -3
  111. package/dist/storage.js +2 -2
  112. package/dist/summarizer.js +3 -3
  113. package/dist/targeted-fact-recall.d.ts +6 -0
  114. package/dist/targeted-fact-recall.js +2 -1
  115. package/dist/transfer/backup.js +2 -2
  116. package/dist/transfer/capsule-export.js +2 -2
  117. package/dist/transfer/capsule-import.js +2 -2
  118. package/dist/transfer/import-sqlite.js +2 -2
  119. package/dist/transfer/types.d.ts +12 -12
  120. package/dist/verified-recall.js +3 -3
  121. package/package.json +1 -1
  122. package/src/access-service-lcm-forgery.test.ts +410 -0
  123. package/src/access-service-observe-lcm-parity.test.ts +1397 -0
  124. package/src/access-service-observe-scope.test.ts +599 -0
  125. package/src/access-service-raw-excerpt-read-gate.test.ts +443 -0
  126. package/src/access-service.ts +1270 -113
  127. package/src/coding/coding-namespace.test.ts +44 -0
  128. package/src/coding/coding-namespace.ts +163 -0
  129. package/src/event-order-recall.ts +8 -0
  130. package/src/explicit-cue-recall.ts +70 -29
  131. package/src/focused-list-recall.ts +23 -1
  132. package/src/lcm-fallback-read.ts +113 -0
  133. package/src/orchestrator.ts +331 -26
  134. package/src/response-guidance-recall.ts +21 -1
  135. package/src/targeted-fact-recall.ts +24 -3
  136. package/dist/chunk-5ETA6OAS.js.map +0 -1
  137. package/dist/chunk-6NKAQ74D.js.map +0 -1
  138. package/dist/chunk-DB5A3NHS.js.map +0 -1
  139. package/dist/chunk-OAZ5MFUB.js.map +0 -1
  140. package/dist/chunk-OZKZ2TRP.js.map +0 -1
  141. package/dist/chunk-VWT3F4IV.js.map +0 -1
  142. package/dist/chunk-XUGVP7ZU.js.map +0 -1
  143. /package/dist/{auto-sync-54QQHOG5.js.map → auto-sync-5CJBJMPZ.js.map} +0 -0
  144. /package/dist/{capsule-crypto-GWVG7LGC.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  145. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  146. /package/dist/{chunk-QKE4LHNR.js.map → chunk-4HYSMH7D.js.map} +0 -0
  147. /package/dist/{chunk-NMIOW7XG.js.map → chunk-4PTKFBST.js.map} +0 -0
  148. /package/dist/{chunk-DDRNDPX4.js.map → chunk-4SKKVWLQ.js.map} +0 -0
  149. /package/dist/{chunk-WPCCNSWO.js.map → chunk-6UKL6IXM.js.map} +0 -0
  150. /package/dist/{chunk-APJQ6UEA.js.map → chunk-AGNBY3VG.js.map} +0 -0
  151. /package/dist/{chunk-4BISW7RX.js.map → chunk-AJE7FJVE.js.map} +0 -0
  152. /package/dist/{chunk-ZXWAQFDE.js.map → chunk-CFOCZPIQ.js.map} +0 -0
  153. /package/dist/{chunk-NT5TINK5.js.map → chunk-DHGSZ3UD.js.map} +0 -0
  154. /package/dist/{chunk-OTC2KOZ2.js.map → chunk-EHQLDFSH.js.map} +0 -0
  155. /package/dist/{chunk-AMACWKM4.js.map → chunk-IJHLC5CH.js.map} +0 -0
  156. /package/dist/{chunk-OR7R6M5Z.js.map → chunk-IVYSVAC6.js.map} +0 -0
  157. /package/dist/{chunk-UMKPSD35.js.map → chunk-JF7SFXTG.js.map} +0 -0
  158. /package/dist/{chunk-MCYT2RNT.js.map → chunk-KJDKZVF3.js.map} +0 -0
  159. /package/dist/{chunk-BUKK5SWA.js.map → chunk-KQAFEZQX.js.map} +0 -0
  160. /package/dist/{chunk-PQFUUXWK.js.map → chunk-KWM33SPU.js.map} +0 -0
  161. /package/dist/{chunk-A3BS64GV.js.map → chunk-LCC5EZTT.js.map} +0 -0
  162. /package/dist/{chunk-ZT6R3WR3.js.map → chunk-LFTLXOFX.js.map} +0 -0
  163. /package/dist/{chunk-CNRZ6WJU.js.map → chunk-MF32AL7N.js.map} +0 -0
  164. /package/dist/{chunk-D6WVJIS3.js.map → chunk-ORGWWNJG.js.map} +0 -0
  165. /package/dist/{chunk-Z3PZRDLW.js.map → chunk-PRQXUSQV.js.map} +0 -0
  166. /package/dist/{chunk-IMWFHBG2.js.map → chunk-QWRC7GIO.js.map} +0 -0
  167. /package/dist/{chunk-FQYFMIKG.js.map → chunk-RKN5J4RO.js.map} +0 -0
  168. /package/dist/{chunk-FUXV6HSO.js.map → chunk-RSS2KWN6.js.map} +0 -0
  169. /package/dist/{chunk-U3GQ33JC.js.map → chunk-SLTKP5WJ.js.map} +0 -0
  170. /package/dist/{chunk-WEPMT6SC.js.map → chunk-V25ZAOSB.js.map} +0 -0
  171. /package/dist/{chunk-UMTG2BN2.js.map → chunk-V4UDXYGG.js.map} +0 -0
  172. /package/dist/{chunk-RRRCNIPK.js.map → chunk-WJK75OCH.js.map} +0 -0
  173. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  174. /package/dist/{chunk-ALUZN7BE.js.map → chunk-XMN6MMTU.js.map} +0 -0
  175. /package/dist/{chunk-A4BTPHIN.js.map → chunk-Y7NWBBHV.js.map} +0 -0
  176. /package/dist/{chunk-M75TBFKQ.js.map → chunk-Z2OXSMZK.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isValidCapsuleSince
3
- } from "./chunk-BUKK5SWA.js";
3
+ } from "./chunk-KQAFEZQX.js";
4
4
  import {
5
5
  CAPSULE_ID_PATTERN
6
6
  } from "./chunk-WEHSQBFR.js";
@@ -432,4 +432,4 @@ export {
432
432
  actionConfidenceRequestSchema,
433
433
  validateRequest
434
434
  };
435
- //# sourceMappingURL=chunk-QKE4LHNR.js.map
435
+ //# sourceMappingURL=chunk-4HYSMH7D.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSearchBackend
3
- } from "./chunk-WPCCNSWO.js";
3
+ } from "./chunk-6UKL6IXM.js";
4
4
  import {
5
5
  namespaceIdentityToken,
6
6
  normalizeNamespaceIdentity
@@ -257,4 +257,4 @@ export {
257
257
  namespaceCollectionName,
258
258
  NamespaceSearchRouter
259
259
  };
260
- //# sourceMappingURL=chunk-NMIOW7XG.js.map
260
+ //# sourceMappingURL=chunk-4PTKFBST.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getVerdictKind
3
- } from "./chunk-M75TBFKQ.js";
3
+ } from "./chunk-Z2OXSMZK.js";
4
4
  import {
5
5
  scoreImportance
6
6
  } from "./chunk-JXS5PDQ7.js";
@@ -1161,4 +1161,4 @@ export {
1161
1161
  syncWearableSource,
1162
1162
  defaultTimezone
1163
1163
  };
1164
- //# sourceMappingURL=chunk-DDRNDPX4.js.map
1164
+ //# sourceMappingURL=chunk-4SKKVWLQ.js.map
@@ -0,0 +1,34 @@
1
+ // src/lcm-fallback-read.ts
2
+ var UNDEFINED_SESSION_SENTINEL = " <lcm-sessionless>";
3
+ function resolveLcmReadSessionIds(target) {
4
+ const source = target.sessionIds && target.sessionIds.length > 0 ? target.sessionIds : [target.sessionId];
5
+ const seen = /* @__PURE__ */ new Set();
6
+ const out = [];
7
+ for (const sessionId of source) {
8
+ const key = sessionId === void 0 ? UNDEFINED_SESSION_SENTINEL : sessionId;
9
+ if (seen.has(key)) continue;
10
+ seen.add(key);
11
+ out.push(sessionId);
12
+ }
13
+ return out.length > 0 ? out : [target.sessionId];
14
+ }
15
+ async function gatherAcrossReadSessions(sessionIds, gather) {
16
+ if (sessionIds.length <= 1) {
17
+ for (const sessionId of sessionIds) {
18
+ await gather(sessionId);
19
+ }
20
+ return;
21
+ }
22
+ for (const sessionId of sessionIds) {
23
+ try {
24
+ await gather(sessionId);
25
+ } catch {
26
+ }
27
+ }
28
+ }
29
+
30
+ export {
31
+ resolveLcmReadSessionIds,
32
+ gatherAcrossReadSessions
33
+ };
34
+ //# sourceMappingURL=chunk-5FOCXX5E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lcm-fallback-read.ts"],"sourcesContent":["/**\n * Shared helper for reading LCM-backed recall sections across the ordered,\n * read-authorized fallback key set (#1505 codex P2 \"Merge LCM fallback reads\n * instead of short-circuiting\").\n *\n * Background: a branch-scoped session archives its LCM rows under whichever\n * coding-overlay namespace was effective at write time, so its evidence can be\n * split across the primary overlay key AND the project / root fallback keys.\n * Normal QMD/file recall already searches the primary namespace PLUS\n * `codingOverlay.readFallbacks` and MERGES the rows. The LCM read path must do\n * the same: query EVERY authorized read key and merge the candidate evidence\n * into each section's existing dedupe + rank + budget pass, instead of stopping\n * at the first key that happens to yield a (possibly weak) hit.\n *\n * Each section already owns a section-appropriate dedupe (a `seen` set or a\n * `rankAndDedupe…` step), so the fan-out only needs to resolve the ordered,\n * deduped read-key set and UNION the per-key candidates into that existing\n * pipeline — the budget is then applied exactly once to the union. Centralizing\n * the key-set resolution here (rather than re-implementing per builder) follows\n * CLAUDE.md rule 22 (scope resolution must be deduplicated).\n */\n\n/** A recall section's LCM read target: either a single key or an ordered set. */\nexport interface LcmReadSessionTarget {\n /**\n * The single LCM read `session_id` (pre-#1505 behavior). `undefined` means a\n * sessionless, archive-wide read with no `session_id` filter.\n */\n sessionId?: string;\n /**\n * The ordered, read-authorized LCM read key set (primary overlay key first,\n * then project / root fallbacks) the orchestrator derived from the same\n * readable namespace set normal recall searches. When present and non-empty,\n * it supersedes `sessionId`.\n */\n sessionIds?: readonly (string | undefined)[];\n}\n\n// `undefined` (a sessionless, archive-wide read) is a distinct, legitimate read\n// target, so it needs a non-string sentinel in the dedupe set. A leading space\n// keeps it disjoint from every real session key / namespaced LCM key (which are\n// `[A-Za-z0-9._-]` plus the U+001F namespace sentinel, never leading-space).\nconst UNDEFINED_SESSION_SENTINEL = \" <lcm-sessionless>\";\n\n/**\n * Resolve the ordered, deduped set of LCM read `session_id`s a recall section\n * must query.\n *\n * When `sessionIds` is provided (the #1505 fallback unification), it is used\n * verbatim, deduped while preserving first-seen order so the caller queries\n * keys in priority order (primary overlay → fallbacks) without re-querying an\n * identical key (e.g. when two namespaces both collapse to the default store).\n * Otherwise the section reads under the single `sessionId`, so the result is\n * `[sessionId]` — byte-for-byte the pre-#1505 single-key behavior, including a\n * single `undefined` for a sessionless archive-wide read.\n */\nexport function resolveLcmReadSessionIds(\n target: LcmReadSessionTarget,\n): Array<string | undefined> {\n const source =\n target.sessionIds && target.sessionIds.length > 0\n ? target.sessionIds\n : [target.sessionId];\n const seen = new Set<string>();\n const out: Array<string | undefined> = [];\n for (const sessionId of source) {\n const key = sessionId === undefined ? UNDEFINED_SESSION_SENTINEL : sessionId;\n if (seen.has(key)) continue;\n seen.add(key);\n out.push(sessionId);\n }\n // Defensive: an all-empty `sessionIds` still collapses to the single-key path.\n return out.length > 0 ? out : [target.sessionId];\n}\n\n/**\n * Run a per-key LCM `gather` across the resolved read-key set with FAULT\n * ISOLATION across keys (#1505 codex P2 review follow-up).\n *\n * A recall section that reads every key in a bare `for…await` loop loses the\n * WHOLE section if any one key throws (e.g. a `SqliteError` from a corrupt or\n * locked fallback index) — even when the primary overlay key already gathered\n * evidence. The pre-#1505 first-non-empty read never had this problem: it\n * returned the primary key's non-empty result without ever touching a failing\n * fallback. This helper restores that resilience for the merged path: when more\n * than one key is read, a per-key failure is contained so the other keys'\n * evidence survives (best-effort recall — a total failure degrades to an empty\n * section, which the orchestrator already treats as \"no evidence\").\n *\n * SINGLE-KEY is byte-for-byte the pre-#1505 behavior: the gather runs directly,\n * so a failure PROPAGATES exactly as before (the caller / orchestrator catch\n * still logs it). Fault isolation only engages once there is a fallback key that\n * could fail independently of the primary.\n */\nexport async function gatherAcrossReadSessions(\n sessionIds: ReadonlyArray<string | undefined>,\n gather: (sessionId: string | undefined) => Promise<void>,\n): Promise<void> {\n if (sessionIds.length <= 1) {\n for (const sessionId of sessionIds) {\n await gather(sessionId);\n }\n return;\n }\n for (const sessionId of sessionIds) {\n try {\n await gather(sessionId);\n } catch {\n // One read key failed; keep the evidence already gathered from the other\n // keys instead of discarding the whole section.\n }\n }\n}\n"],"mappings":";AA0CA,IAAM,6BAA6B;AAc5B,SAAS,yBACd,QAC2B;AAC3B,QAAM,SACJ,OAAO,cAAc,OAAO,WAAW,SAAS,IAC5C,OAAO,aACP,CAAC,OAAO,SAAS;AACvB,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,MAAiC,CAAC;AACxC,aAAW,aAAa,QAAQ;AAC9B,UAAM,MAAM,cAAc,SAAY,6BAA6B;AACnE,QAAI,KAAK,IAAI,GAAG,EAAG;AACnB,SAAK,IAAI,GAAG;AACZ,QAAI,KAAK,SAAS;AAAA,EACpB;AAEA,SAAO,IAAI,SAAS,IAAI,MAAM,CAAC,OAAO,SAAS;AACjD;AAqBA,eAAsB,yBACpB,YACA,QACe;AACf,MAAI,WAAW,UAAU,GAAG;AAC1B,eAAW,aAAa,YAAY;AAClC,YAAM,OAAO,SAAS;AAAA,IACxB;AACA;AAAA,EACF;AACA,aAAW,aAAa,YAAY;AAClC,QAAI;AACF,YAAM,OAAO,SAAS;AAAA,IACxB,QAAQ;AAAA,IAGR;AAAA,EACF;AACF;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  loadSyncState,
5
5
  syncWearableSource,
6
6
  wearableSourceLabel
7
- } from "./chunk-DDRNDPX4.js";
7
+ } from "./chunk-4SKKVWLQ.js";
8
8
  import {
9
9
  migrateFromEngram
10
10
  } from "./chunk-7HYPN2GC.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-666A3MOW.js";
20
20
  import {
21
21
  LcmEngine
22
- } from "./chunk-WEPMT6SC.js";
22
+ } from "./chunk-V25ZAOSB.js";
23
23
  import {
24
24
  chunkTranscriptEntries
25
25
  } from "./chunk-TECVW3JP.js";
@@ -29,7 +29,7 @@ import {
29
29
  import {
30
30
  CompoundingEngine,
31
31
  defaultTierMigrationCycleBudget
32
- } from "./chunk-Z3PZRDLW.js";
32
+ } from "./chunk-PRQXUSQV.js";
33
33
  import {
34
34
  SharedContextManager
35
35
  } from "./chunk-DRD2Q7HQ.js";
@@ -52,11 +52,11 @@ import {
52
52
  } from "./chunk-UHGBNIOS.js";
53
53
  import {
54
54
  HourlySummarizer
55
- } from "./chunk-IMWFHBG2.js";
55
+ } from "./chunk-QWRC7GIO.js";
56
56
  import {
57
57
  buildTargetedFactRecallSection,
58
58
  shouldRecallTargetedFactEvidence
59
- } from "./chunk-VWT3F4IV.js";
59
+ } from "./chunk-PS3SYNHP.js";
60
60
  import {
61
61
  applyTemporalSupersession,
62
62
  normalizeSupersessionKey,
@@ -71,7 +71,7 @@ import {
71
71
  import {
72
72
  buildResponseGuidanceRecallSection,
73
73
  shouldRecallResponseGuidance
74
- } from "./chunk-OZKZ2TRP.js";
74
+ } from "./chunk-XBIACVCO.js";
75
75
  import {
76
76
  mergeWithAgentResults,
77
77
  runDirectAgent,
@@ -154,10 +154,10 @@ import {
154
154
  getVerdictKind,
155
155
  judgeFactDurability,
156
156
  validateProcedureExtraction
157
- } from "./chunk-M75TBFKQ.js";
157
+ } from "./chunk-Z2OXSMZK.js";
158
158
  import {
159
159
  ExtractionEngine
160
- } from "./chunk-U3GQ33JC.js";
160
+ } from "./chunk-SLTKP5WJ.js";
161
161
  import {
162
162
  parseMemoryActionEligibilityContext
163
163
  } from "./chunk-ROZJACKP.js";
@@ -170,19 +170,19 @@ import {
170
170
  import {
171
171
  buildFocusedListRecallSection,
172
172
  shouldRecallFocusedListEvidence
173
- } from "./chunk-DB5A3NHS.js";
173
+ } from "./chunk-7LWRCOP7.js";
174
174
  import {
175
175
  buildEntityRecallSection,
176
176
  entityRecentTranscriptLookbackHours,
177
177
  readRecentEntityTranscriptEntries
178
- } from "./chunk-ALUZN7BE.js";
178
+ } from "./chunk-XMN6MMTU.js";
179
179
  import {
180
180
  buildEventOrderRecallSection,
181
181
  shouldRecallEventOrderEvidence
182
- } from "./chunk-6NKAQ74D.js";
182
+ } from "./chunk-UU6MVCJ6.js";
183
183
  import {
184
184
  buildExplicitCueRecallSection
185
- } from "./chunk-OAZ5MFUB.js";
185
+ } from "./chunk-3XGWCZ63.js";
186
186
  import {
187
187
  formatDaySummaryMemories
188
188
  } from "./chunk-WLEB7WCG.js";
@@ -210,7 +210,7 @@ import {
210
210
  materializeAfterSemanticConsolidation,
211
211
  parseConsolidationResponse,
212
212
  parseOperatorAwareConsolidationResponse
213
- } from "./chunk-ZXWAQFDE.js";
213
+ } from "./chunk-CFOCZPIQ.js";
214
214
  import {
215
215
  normalizeReplaySessionKey
216
216
  } from "./chunk-2PRQG7PV.js";
@@ -219,25 +219,25 @@ import {
219
219
  } from "./chunk-X6IRLNOO.js";
220
220
  import {
221
221
  searchVerifiedEpisodes
222
- } from "./chunk-UMKPSD35.js";
222
+ } from "./chunk-JF7SFXTG.js";
223
223
  import {
224
224
  ThreadingManager
225
225
  } from "./chunk-W4RVMTHR.js";
226
226
  import {
227
227
  searchVerifiedSemanticRules
228
- } from "./chunk-4BISW7RX.js";
228
+ } from "./chunk-AJE7FJVE.js";
229
229
  import {
230
230
  searchWorkProductLedgerEntries
231
231
  } from "./chunk-ZRWB5D4H.js";
232
232
  import {
233
233
  TranscriptManager
234
234
  } from "./chunk-AGRPGAKR.js";
235
- import {
236
- NamespaceStorageRouter
237
- } from "./chunk-D6WVJIS3.js";
238
235
  import {
239
236
  PolicyRuntimeManager
240
237
  } from "./chunk-33JBK2XP.js";
238
+ import {
239
+ NamespaceStorageRouter
240
+ } from "./chunk-ORGWWNJG.js";
241
241
  import {
242
242
  isAboveImportanceThreshold,
243
243
  scoreImportance
@@ -273,7 +273,7 @@ import {
273
273
  FallbackLlmClient,
274
274
  fallbackLlmRuntimeContextFromConfig,
275
275
  gatewayTaskChainOptions
276
- } from "./chunk-A3BS64GV.js";
276
+ } from "./chunk-LCC5EZTT.js";
277
277
  import {
278
278
  compileCorrectionRule,
279
279
  correctionsFilePath,
@@ -303,8 +303,9 @@ import {
303
303
  import {
304
304
  clusterByKey,
305
305
  combineNamespaces,
306
+ lcmReadSessionIdsForNamespaces,
306
307
  resolveCodingNamespaceOverlay
307
- } from "./chunk-6GIKAUTN.js";
308
+ } from "./chunk-MMJANTJX.js";
308
309
  import {
309
310
  listTrustZoneRecords,
310
311
  searchTrustZoneRecords
@@ -317,11 +318,11 @@ import {
317
318
  } from "./chunk-BEMWL2FZ.js";
318
319
  import {
319
320
  NamespaceSearchRouter
320
- } from "./chunk-NMIOW7XG.js";
321
+ } from "./chunk-4PTKFBST.js";
321
322
  import {
322
323
  createConversationIndexRuntime,
323
324
  createSearchBackend
324
- } from "./chunk-WPCCNSWO.js";
325
+ } from "./chunk-6UKL6IXM.js";
325
326
  import {
326
327
  NoopSearchBackend
327
328
  } from "./chunk-CYEPCZN5.js";
@@ -352,7 +353,7 @@ import {
352
353
  } from "./chunk-Y56J7CXW.js";
353
354
  import {
354
355
  buildChainFollowupGenerator
355
- } from "./chunk-AMACWKM4.js";
356
+ } from "./chunk-IJHLC5CH.js";
356
357
  import {
357
358
  ContentHashIndex,
358
359
  StorageManager,
@@ -362,7 +363,7 @@ import {
362
363
  normalizeEntityName,
363
364
  parseEntityFile,
364
365
  stripAttributesSuffix
365
- } from "./chunk-A4BTPHIN.js";
366
+ } from "./chunk-Y7NWBBHV.js";
366
367
  import {
367
368
  isValidTranscriptDate,
368
369
  loadSpeakerRegistry,
@@ -2512,6 +2513,52 @@ var Orchestrator = class _Orchestrator {
2512
2513
  );
2513
2514
  return this.applyCodingNamespaceOverlay(sessionKey, base);
2514
2515
  }
2516
+ /**
2517
+ * Effective namespace a same-session LCM/structured-history READER must use
2518
+ * to find what the access `observe` surface WROTE (#1495 thread 2).
2519
+ *
2520
+ * This MUST mirror the `observe` scope plan's write-namespace resolution, NOT
2521
+ * `resolveSelfNamespace`: when no coding overlay applies, `observe` archives
2522
+ * under `config.defaultNamespace` (an unqualified observed turn is NOT moved
2523
+ * to the principal self namespace — identical to
2524
+ * `resolveCodingScopedWriteNamespace`/`memory_store`, rule 39). Only when a
2525
+ * coding overlay actually changes the namespace does the writer (and so the
2526
+ * reader) use the overlaid `project-*` namespace. Returning the self base for
2527
+ * the no-overlay case would prefix the read key with a namespace the writer
2528
+ * never used, so the reader would miss its own evidence.
2529
+ *
2530
+ * Honours the access-surface `principalOverride` (#1505 thread 2, codex): when
2531
+ * a recall supplies an authenticated principal NOT encoded in the raw
2532
+ * `sessionKey`, `observe` archived LCM under THAT principal's base namespace.
2533
+ * Deriving the base from `resolvePrincipal(sessionKey)` alone could fall back
2534
+ * to `default`, so principal `alice` observing `sess-1` would write under
2535
+ * `alice` but READ under `default`. Threading the override here keeps the read
2536
+ * base identical to the write base.
2537
+ *
2538
+ * READ-AUTHORIZATION gate (#1505 round 3, codex P2 "Gate LCM recall keys by
2539
+ * readable namespaces"): the overlay LCM read key is a `<principal>-project-*`
2540
+ * sub-namespace of the principal SELF base. The normal recall namespace set
2541
+ * below only substitutes the coding overlay when the principal SELF base is
2542
+ * actually in the readable recall set (`recallNamespacesForPrincipal` — gated
2543
+ * by `defaultRecallNamespaces.includes("self")` AND `canReadNamespace`). If a
2544
+ * principal can WRITE but not READ its self namespace (or `defaultRecall-
2545
+ * Namespaces` omits `self`), QMD/file recall never touches those overlay rows,
2546
+ * so neither may the LCM read key. When the self base is NOT readable, fall
2547
+ * back to the default store — exactly what an unqualified, unauthorized recall
2548
+ * resolves to — rather than injecting overlay rows the rest of recall excludes
2549
+ * (rule 42 read/write parity; rule 48 least-privilege).
2550
+ */
2551
+ lcmReadNamespaceForSession(sessionKey, principalOverride) {
2552
+ const principal = typeof principalOverride === "string" && principalOverride.length > 0 ? principalOverride : this.resolvePrincipal(sessionKey);
2553
+ const base = defaultNamespaceForPrincipal(principal, this.config);
2554
+ const overlaid = this.applyCodingNamespaceOverlay(sessionKey, base);
2555
+ if (overlaid === base) return this.config.defaultNamespace;
2556
+ const selfReadableInRecall = recallNamespacesForPrincipal(
2557
+ principal,
2558
+ this.config
2559
+ ).includes(base);
2560
+ return selfReadableInRecall ? overlaid : this.config.defaultNamespace;
2561
+ }
2515
2562
  /**
2516
2563
  * Attach a coding-agent context to a session (issue #569). Called by the
2517
2564
  * Claude Code / Codex / Cursor connectors at session start after
@@ -3378,7 +3425,7 @@ var Orchestrator = class _Orchestrator {
3378
3425
  if (signal.aborted) return;
3379
3426
  if (!this.wearablesAutoSyncHandle && this.config.wearables.enabled && this.config.wearables.autoSyncEnabled && Object.values(this.config.wearables.sources).some((source) => source.enabled)) {
3380
3427
  try {
3381
- const { startWearablesAutoSync } = await import("./auto-sync-54QQHOG5.js");
3428
+ const { startWearablesAutoSync } = await import("./auto-sync-5CJBJMPZ.js");
3382
3429
  if (signal.aborted) return;
3383
3430
  this.wearablesAutoSyncHandle = startWearablesAutoSync(
3384
3431
  {
@@ -6142,6 +6189,30 @@ ${r.snippet.trim()}
6142
6189
  } else {
6143
6190
  recallNamespaces = readableRecallNamespaces;
6144
6191
  }
6192
+ const codingOverlaySelfReadable = codingOverlay !== null && readableRecallNamespaces.includes(principalSelfNamespace);
6193
+ let lcmReadNamespaces;
6194
+ if (namespaceOverride) {
6195
+ lcmReadNamespaces = [namespaceOverride];
6196
+ } else if (codingOverlay && codingSelfNamespace && codingOverlaySelfReadable) {
6197
+ const fallbackNs = codingOverlay.readFallbacks.map(
6198
+ (fallback) => combineNamespaces(principalSelfNamespace, fallback)
6199
+ );
6200
+ lcmReadNamespaces = [codingSelfNamespace, ...fallbackNs];
6201
+ } else {
6202
+ lcmReadNamespaces = [this.config.defaultNamespace];
6203
+ }
6204
+ const lcmReadSessionIds = lcmReadSessionIdsForNamespaces(
6205
+ lcmReadNamespaces,
6206
+ sessionKey,
6207
+ this.config.defaultNamespace
6208
+ );
6209
+ const firstNonEmptyLcmRead = async (read, isEmpty, empty) => {
6210
+ for (const lcmSessionId of lcmReadSessionIds) {
6211
+ const value = await read(lcmSessionId);
6212
+ if (!isEmpty(value)) return value;
6213
+ }
6214
+ return empty;
6215
+ };
6145
6216
  const qmdAvailable = this.qmd.isAvailable();
6146
6217
  let graphDecisionStatus = recallDecision.plannedMode === "graph_mode" ? "skipped" : "not_requested";
6147
6218
  let graphDecisionReason = recallDecision.graphReason;
@@ -7935,7 +8006,13 @@ ${formatted}`;
7935
8006
  try {
7936
8007
  const explicitCueSection = await buildExplicitCueRecallSection({
7937
8008
  engine: this.lcmEngine,
7938
- sessionId: sessionKey,
8009
+ // #1495 thread 3 + #1505 fallback unification: read across the ordered
8010
+ // LCM read key set (primary overlay → coding fallbacks) so a
8011
+ // branch-scoped session finds its own explicit-cue evidence even when
8012
+ // archived at project/root scope (rule 39). #1505 codex P2: the builder
8013
+ // MERGES candidates across every key under its single budget instead of
8014
+ // short-circuiting on the first non-empty key.
8015
+ sessionIds: lcmReadSessionIds,
7939
8016
  query: retrievalQuery,
7940
8017
  maxChars: explicitCueMaxChars,
7941
8018
  maxReferences: this.getRecallSectionNumber("explicit-cue", "maxResults") ?? this.config.explicitCueRecallMaxReferences
@@ -7959,7 +8036,11 @@ ${formatted}`;
7959
8036
  try {
7960
8037
  const targetedFactSection = await buildTargetedFactRecallSection({
7961
8038
  engine: this.lcmEngine,
7962
- sessionId: sessionKey,
8039
+ // #1495 + #1505 fallback unification: read across the ordered LCM read
8040
+ // key set so a branch-scoped session finds its own targeted-fact
8041
+ // evidence even when archived at project/root scope. #1505 codex P2: the
8042
+ // builder MERGES candidates across every key under its single budget.
8043
+ sessionIds: lcmReadSessionIds,
7963
8044
  query: retrievalQuery,
7964
8045
  maxChars: targetedFactMaxChars,
7965
8046
  maxSearchResults: this.getRecallSectionNumber("targeted-facts", "maxResults") ?? this.config.targetedFactRecallMaxResults,
@@ -7985,7 +8066,12 @@ ${formatted}`;
7985
8066
  try {
7986
8067
  const focusedListSection = await buildFocusedListRecallSection({
7987
8068
  engine: this.lcmEngine,
7988
- sessionId: sessionKey,
8069
+ // #1495 thread 3 + #1505 fallback unification: read across the ordered
8070
+ // LCM read key set so a branch-scoped session reads its own
8071
+ // focused-list/count evidence even at project/root scope (rule 39).
8072
+ // #1505 codex P2: the builder MERGES candidates across every key under
8073
+ // its single budget.
8074
+ sessionIds: lcmReadSessionIds,
7989
8075
  query: retrievalQuery,
7990
8076
  maxChars: focusedListMaxChars,
7991
8077
  maxSearchResults: this.getRecallSectionNumber("focused-list", "maxResults") ?? this.config.focusedListRecallMaxResults,
@@ -8014,7 +8100,12 @@ ${formatted}`;
8014
8100
  try {
8015
8101
  const responseGuidanceSection = await buildResponseGuidanceRecallSection({
8016
8102
  engine: this.lcmEngine,
8017
- sessionId: sessionKey,
8103
+ // #1495 thread 3 + #1505 fallback unification: read across the ordered
8104
+ // LCM read key set so a branch-scoped session reads its own
8105
+ // response-guidance evidence even at project/root scope (rule 39).
8106
+ // #1505 codex P2: the builder MERGES candidates across every key under
8107
+ // its single budget.
8108
+ sessionIds: lcmReadSessionIds,
8018
8109
  query: retrievalQuery,
8019
8110
  maxChars: responseGuidanceMaxChars,
8020
8111
  maxSearchResults: this.getRecallSectionNumber("response-guidance", "maxResults") ?? this.config.responseGuidanceRecallMaxResults,
@@ -8039,15 +8130,19 @@ ${formatted}`;
8039
8130
  this.config.eventOrderRecallEnabled
8040
8131
  ) && eventOrderMaxChars !== 0 && this.lcmEngine?.enabled && recallMode !== "no_recall" && shouldRecallEventOrderEvidence(retrievalQuery)) {
8041
8132
  try {
8042
- const eventOrderSection = await buildEventOrderRecallSection({
8043
- engine: this.lcmEngine,
8044
- sessionId: sessionKey,
8045
- query: retrievalQuery,
8046
- maxChars: eventOrderMaxChars,
8047
- maxItems: this.getRecallSectionNumber("event-order", "maxResults") ?? this.config.eventOrderRecallMaxResults,
8048
- maxScanWindowTurns: this.getRecallSectionNumber("event-order", "maxTurns") ?? this.config.eventOrderRecallScanWindowTurns,
8049
- maxScanWindowTokens: this.getRecallSectionNumber("event-order", "maxTokens") ?? this.config.eventOrderRecallScanWindowTokens
8050
- });
8133
+ const eventOrderSection = await firstNonEmptyLcmRead(
8134
+ (lcmSessionId) => buildEventOrderRecallSection({
8135
+ engine: this.lcmEngine,
8136
+ sessionId: lcmSessionId,
8137
+ query: retrievalQuery,
8138
+ maxChars: eventOrderMaxChars,
8139
+ maxItems: this.getRecallSectionNumber("event-order", "maxResults") ?? this.config.eventOrderRecallMaxResults,
8140
+ maxScanWindowTurns: this.getRecallSectionNumber("event-order", "maxTurns") ?? this.config.eventOrderRecallScanWindowTurns,
8141
+ maxScanWindowTokens: this.getRecallSectionNumber("event-order", "maxTokens") ?? this.config.eventOrderRecallScanWindowTokens
8142
+ }),
8143
+ (s) => !s,
8144
+ ""
8145
+ );
8051
8146
  if (eventOrderSection) {
8052
8147
  this.appendRecallSection(
8053
8148
  sectionBuckets,
@@ -8182,9 +8277,26 @@ ${tmtNode.summary}`
8182
8277
  }
8183
8278
  if (this.lcmEngine?.enabled && recallMode !== "minimal" && recallMode !== "no_recall") {
8184
8279
  try {
8185
- const structuredMatches = await this.lcmEngine.searchStructuredParts(
8186
- sessionKey ?? "default",
8187
- retrievalQuery
8280
+ const structuredSettled = await Promise.allSettled(
8281
+ lcmReadSessionIds.map(
8282
+ (lcmSessionId) => this.lcmEngine.searchStructuredParts(lcmSessionId ?? "", retrievalQuery)
8283
+ )
8284
+ );
8285
+ for (const settled of structuredSettled) {
8286
+ if (settled.status === "rejected") {
8287
+ log.debug(
8288
+ `LCM structured-parts read failed for one key: ${settled.reason}`
8289
+ );
8290
+ }
8291
+ }
8292
+ const seenStructuredParts = /* @__PURE__ */ new Set();
8293
+ const structuredMatches = structuredSettled.flatMap((settled) => settled.status === "fulfilled" ? settled.value : []).filter((match) => {
8294
+ const key = `${match.session_id} ${match.turn_index} ${match.part_id}`;
8295
+ if (seenStructuredParts.has(key)) return false;
8296
+ seenStructuredParts.add(key);
8297
+ return true;
8298
+ }).sort(
8299
+ (a, b) => (b.score ?? 0) - (a.score ?? 0) || b.turn_index - a.turn_index
8188
8300
  );
8189
8301
  const structuredSection = this.lcmEngine.formatStructuredRecall(
8190
8302
  structuredMatches,
@@ -8208,9 +8320,13 @@ ${tmtNode.summary}`
8208
8320
  }
8209
8321
  }
8210
8322
  }
8211
- const lcmSection = await this.lcmEngine.assembleRecall(
8212
- sessionKey ?? "default",
8213
- this.config.recallBudgetChars
8323
+ const lcmSection = await firstNonEmptyLcmRead(
8324
+ (lcmSessionId) => this.lcmEngine.assembleRecall(
8325
+ lcmSessionId ?? "",
8326
+ this.config.recallBudgetChars
8327
+ ),
8328
+ (s) => !s,
8329
+ ""
8214
8330
  );
8215
8331
  if (lcmSection) {
8216
8332
  this.appendRecallSection(
@@ -9425,6 +9541,8 @@ _Context: ${topQuestion.context}_`
9425
9541
  bufferKey,
9426
9542
  extractionDeadlineMs: options.deadlineMs,
9427
9543
  abortSignal: options.abortSignal,
9544
+ writeNamespaceOverride: options.writeNamespaceOverride,
9545
+ principalOverride: options.principalOverride,
9428
9546
  onTaskSettled: (err) => err ? reject(err) : resolve()
9429
9547
  }).catch(reject);
9430
9548
  })
@@ -9786,7 +9904,8 @@ _Context: ${topQuestion.context}_`
9786
9904
  bufferKey,
9787
9905
  abortSignal: options.abortSignal,
9788
9906
  failOnExtractionFailure: options.failOnExtractionFailure === true,
9789
- writeNamespaceOverride: options.writeNamespaceOverride
9907
+ writeNamespaceOverride: options.writeNamespaceOverride,
9908
+ principalOverride: options.principalOverride
9790
9909
  });
9791
9910
  settleTask(void 0, result);
9792
9911
  } catch (err) {
@@ -9963,7 +10082,7 @@ ${normalized}`).digest("hex");
9963
10082
  durableOutputCount: 0
9964
10083
  };
9965
10084
  }
9966
- const principal = resolvePrincipal(sessionKey, this.config);
10085
+ const principal = typeof options.principalOverride === "string" && options.principalOverride.length > 0 ? options.principalOverride : resolvePrincipal(sessionKey, this.config);
9967
10086
  const selfNamespace = typeof options.writeNamespaceOverride === "string" && options.writeNamespaceOverride.length > 0 ? options.writeNamespaceOverride : this.applyCodingNamespaceOverlay(
9968
10087
  sessionKey,
9969
10088
  defaultNamespaceForPrincipal(principal, this.config)
@@ -14302,4 +14421,4 @@ export {
14302
14421
  resolvePersistedMemoryRelativePath,
14303
14422
  Orchestrator
14304
14423
  };
14305
- //# sourceMappingURL=chunk-XUGVP7ZU.js.map
14424
+ //# sourceMappingURL=chunk-5WSDHTBO.js.map