@remnic/core 9.3.689 → 9.3.691

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 (322) hide show
  1. package/dist/access-boundary.d.ts +7 -6
  2. package/dist/access-boundary.js +19 -18
  3. package/dist/access-cli.js +111 -47
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +6 -5
  6. package/dist/access-http.js +25 -24
  7. package/dist/access-mcp.d.ts +13 -5
  8. package/dist/access-mcp.js +22 -21
  9. package/dist/access-operations.d.ts +13 -7
  10. package/dist/access-operations.js +23 -20
  11. package/dist/access-schema.js +3 -3
  12. package/dist/{access-service-DmCHJ4cH.d.ts → access-service-CKnFdxH-.d.ts} +63 -3
  13. package/dist/access-service.d.ts +6 -5
  14. package/dist/access-service.js +18 -17
  15. package/dist/access-surface-catalog.d.ts +6 -5
  16. package/dist/access-surface-catalog.js +2 -0
  17. package/dist/access-surface-catalog.js.map +1 -1
  18. package/dist/action-confidence.d.ts +1 -1
  19. package/dist/active-memory-bridge.d.ts +1 -1
  20. package/dist/active-recall.d.ts +1 -1
  21. package/dist/active-recall.js +1 -1
  22. package/dist/adapters/index.js +4 -4
  23. package/dist/adapters/registry.js +2 -2
  24. package/dist/{auto-sync-NUQWSFQD.js → auto-sync-RWXT6P5M.js} +5 -5
  25. package/dist/behavior-learner.d.ts +1 -1
  26. package/dist/behavior-signals.d.ts +1 -1
  27. package/dist/bootstrap.d.ts +5 -4
  28. package/dist/briefing.d.ts +2 -1
  29. package/dist/briefing.js +6 -5
  30. package/dist/buffer-surprise-report.d.ts +1 -1
  31. package/dist/buffer.d.ts +2 -1
  32. package/dist/calibration.d.ts +1 -1
  33. package/dist/calibration.js +2 -2
  34. package/dist/capabilities.d.ts +1 -1
  35. package/dist/{catalog-COqWZlZ6.d.ts → catalog-BEWLjdOr.d.ts} +2 -2
  36. package/dist/causal-behavior.d.ts +1 -1
  37. package/dist/causal-consolidation.d.ts +1 -1
  38. package/dist/causal-consolidation.js +9 -8
  39. package/dist/causal-consolidation.js.map +1 -1
  40. package/dist/{chunk-GTDH3IUH.js → chunk-2D27ODNX.js} +2 -2
  41. package/dist/{chunk-3K37VPM3.js → chunk-3BRA3N5A.js} +2 -2
  42. package/dist/{chunk-4FE2K57M.js → chunk-3VVH6ZQW.js} +2 -2
  43. package/dist/{chunk-FIVDN2SM.js → chunk-4RGWCRIJ.js} +4 -4
  44. package/dist/{chunk-AGJH5ISO.js → chunk-5KBNNUXS.js} +2 -2
  45. package/dist/{chunk-OV4D5T7V.js → chunk-66HROLW5.js} +2 -2
  46. package/dist/{chunk-Z2M6YTAJ.js → chunk-7UVDIWLL.js} +34 -5
  47. package/dist/chunk-7UVDIWLL.js.map +1 -0
  48. package/dist/{chunk-QANVLERJ.js → chunk-ADUAF5EV.js} +2 -2
  49. package/dist/{chunk-LLONI6PY.js → chunk-AFWEUTMS.js} +2 -2
  50. package/dist/{chunk-W63OY3J7.js → chunk-D3DNGQNQ.js} +3 -3
  51. package/dist/{chunk-T422SYM6.js → chunk-DCWIQFNA.js} +5 -5
  52. package/dist/{chunk-NGFEWFNK.js → chunk-DQHZA7Y3.js} +1 -1
  53. package/dist/chunk-DQHZA7Y3.js.map +1 -0
  54. package/dist/{chunk-OBXTMFZQ.js → chunk-ECZPWSB5.js} +2 -2
  55. package/dist/{chunk-BFVPIKDY.js → chunk-GCOSQBQ2.js} +3 -3
  56. package/dist/{chunk-SAEZIIID.js → chunk-IPJD7WJH.js} +2 -2
  57. package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
  58. package/dist/{chunk-MDYG7VI7.js → chunk-IREVVFTM.js} +10 -1
  59. package/dist/{chunk-MDYG7VI7.js.map → chunk-IREVVFTM.js.map} +1 -1
  60. package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
  61. package/dist/{chunk-RHXFYIHA.js → chunk-K7I24ZO2.js} +42 -27
  62. package/dist/chunk-K7I24ZO2.js.map +1 -0
  63. package/dist/{chunk-XU7363OX.js → chunk-KO6OL4I7.js} +617 -23
  64. package/dist/chunk-KO6OL4I7.js.map +1 -0
  65. package/dist/{chunk-UTYBJR7M.js → chunk-MCV2DD6F.js} +2 -2
  66. package/dist/{chunk-3FC6LW6T.js → chunk-MRFVMSTR.js} +2 -2
  67. package/dist/{chunk-WDXCNJSF.js → chunk-MXZWKOOR.js} +2 -2
  68. package/dist/{chunk-QSQW54U5.js → chunk-NCRDCTEJ.js} +33 -10
  69. package/dist/chunk-NCRDCTEJ.js.map +1 -0
  70. package/dist/{chunk-6O6A6YUO.js → chunk-NUZ3N445.js} +7 -7
  71. package/dist/{chunk-UHUZXWDX.js → chunk-OOO7ZKOD.js} +16 -5
  72. package/dist/chunk-OOO7ZKOD.js.map +1 -0
  73. package/dist/{chunk-GS55WYRL.js → chunk-QFG23CRE.js} +2 -2
  74. package/dist/{chunk-UDJLF3BO.js → chunk-QLRYXOAD.js} +2 -2
  75. package/dist/chunk-QNG35H27.js +2190 -0
  76. package/dist/chunk-QNG35H27.js.map +1 -0
  77. package/dist/{chunk-A4HH2EWA.js → chunk-QVG4LAQO.js} +2 -2
  78. package/dist/{chunk-4N3TFFPH.js → chunk-SAC5V6JT.js} +2 -2
  79. package/dist/chunk-SVOZFLIQ.js +16 -0
  80. package/dist/chunk-SVOZFLIQ.js.map +1 -0
  81. package/dist/{chunk-JZBFL7RI.js → chunk-TJ5IIQIR.js} +468 -2265
  82. package/dist/chunk-TJ5IIQIR.js.map +1 -0
  83. package/dist/{chunk-UXLZOVCN.js → chunk-TSGREOYY.js} +38 -6
  84. package/dist/chunk-TSGREOYY.js.map +1 -0
  85. package/dist/{chunk-B4XVLHJA.js → chunk-U2OBZSGG.js} +2 -2
  86. package/dist/{chunk-STOEE37X.js → chunk-UOCLRM74.js} +2 -2
  87. package/dist/{chunk-A7UZR6RA.js → chunk-UTUYAPLY.js} +14 -1
  88. package/dist/chunk-UTUYAPLY.js.map +1 -0
  89. package/dist/{chunk-JPETDXED.js → chunk-UUMYB3FR.js} +2 -2
  90. package/dist/{chunk-BLIWOONZ.js → chunk-VFVG4NS2.js} +33 -20
  91. package/dist/chunk-VFVG4NS2.js.map +1 -0
  92. package/dist/{chunk-OWFY6NGQ.js → chunk-VH2DHBHG.js} +2 -2
  93. package/dist/chunk-VH2DHBHG.js.map +1 -0
  94. package/dist/{chunk-WIHPNY65.js → chunk-W4ELOUNX.js} +2 -2
  95. package/dist/{chunk-VX6OBUDW.js → chunk-WIKNVFBS.js} +2 -2
  96. package/dist/{chunk-2SNKUSQC.js → chunk-X5J3JZR3.js} +4 -4
  97. package/dist/{chunk-PH3HOKYW.js → chunk-ZLXGFAML.js} +2 -2
  98. package/dist/{cli-D8nZ2MPH.d.ts → cli-CrSW_KRq.d.ts} +3 -3
  99. package/dist/cli.d.ts +7 -6
  100. package/dist/cli.js +40 -38
  101. package/dist/compounding/engine.d.ts +2 -1
  102. package/dist/compounding/engine.js +6 -5
  103. package/dist/compounding/preference-consolidator.d.ts +1 -1
  104. package/dist/compression-optimizer.d.ts +1 -1
  105. package/dist/config.d.ts +1 -1
  106. package/dist/config.js +1 -1
  107. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  108. package/dist/connectors/codex-materialize-runner.js +6 -5
  109. package/dist/connectors/codex-materialize.d.ts +1 -1
  110. package/dist/connectors/index.d.ts +1 -1
  111. package/dist/connectors/index.js +6 -5
  112. package/dist/consolidation-provenance-check.d.ts +2 -1
  113. package/dist/consolidation-undo.d.ts +2 -1
  114. package/dist/contradiction/index.d.ts +2 -1
  115. package/dist/contradiction/index.js +4 -4
  116. package/dist/conversation-index/backend.d.ts +1 -1
  117. package/dist/conversation-index/backend.js +2 -2
  118. package/dist/conversation-index/chunker.d.ts +1 -1
  119. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  120. package/dist/conversation-index/indexer.d.ts +1 -1
  121. package/dist/conversation-index/search.d.ts +1 -1
  122. package/dist/day-summary.d.ts +1 -1
  123. package/dist/delinearize.d.ts +1 -1
  124. package/dist/direct-answer-wiring.d.ts +1 -1
  125. package/dist/direct-answer.d.ts +1 -1
  126. package/dist/embedding-fallback.d.ts +1 -1
  127. package/dist/enrichment/index.d.ts +1 -1
  128. package/dist/entity-retrieval.d.ts +2 -1
  129. package/dist/entity-retrieval.js +6 -5
  130. package/dist/entity-schema.d.ts +1 -1
  131. package/dist/event-time.d.ts +35 -0
  132. package/dist/event-time.js +325 -0
  133. package/dist/event-time.js.map +1 -0
  134. package/dist/explicit-capture.d.ts +5 -4
  135. package/dist/extraction-judge-telemetry.d.ts +1 -1
  136. package/dist/extraction-judge-training.d.ts +1 -1
  137. package/dist/extraction-judge.d.ts +1 -1
  138. package/dist/extraction-judge.js +3 -3
  139. package/dist/extraction.d.ts +1 -1
  140. package/dist/extraction.js +3 -3
  141. package/dist/fallback-llm.d.ts +1 -1
  142. package/dist/fallback-llm.js +2 -2
  143. package/dist/identity-continuity.d.ts +1 -1
  144. package/dist/importance.d.ts +1 -1
  145. package/dist/index.d.ts +10 -9
  146. package/dist/index.js +78 -75
  147. package/dist/index.js.map +1 -1
  148. package/dist/intent.d.ts +1 -1
  149. package/dist/lcm/engine.d.ts +1 -1
  150. package/dist/lcm/engine.js +2 -2
  151. package/dist/lcm/index.d.ts +1 -1
  152. package/dist/lcm/index.js +2 -2
  153. package/dist/lcm/tools.d.ts +1 -1
  154. package/dist/lifecycle.d.ts +1 -1
  155. package/dist/live-connectors-runner.d.ts +1 -1
  156. package/dist/local-llm.d.ts +1 -1
  157. package/dist/maintenance/memory-governance.d.ts +1 -1
  158. package/dist/maintenance/memory-governance.js +6 -5
  159. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -5
  160. package/dist/maintenance/rebuild-memory-projection.js +7 -6
  161. package/dist/mcp-memory-inspector-app.d.ts +6 -5
  162. package/dist/memory-action-policy.d.ts +1 -1
  163. package/dist/memory-cache.d.ts +1 -1
  164. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  165. package/dist/memory-projection-store.d.ts +1 -1
  166. package/dist/memory-provenance.d.ts +1 -1
  167. package/dist/memory-worth-outcomes.d.ts +2 -1
  168. package/dist/models-json.d.ts +1 -1
  169. package/dist/namespaces/migrate.d.ts +3 -2
  170. package/dist/namespaces/migrate.js +11 -10
  171. package/dist/namespaces/principal.d.ts +1 -1
  172. package/dist/namespaces/search.d.ts +1 -1
  173. package/dist/namespaces/search.js +4 -4
  174. package/dist/namespaces/storage.d.ts +3 -2
  175. package/dist/namespaces/storage.js +6 -5
  176. package/dist/native-knowledge.d.ts +1 -1
  177. package/dist/operator-toolkit.d.ts +2 -1
  178. package/dist/operator-toolkit.js +15 -13
  179. package/dist/{orchestrator-CA6ouzBn.d.ts → orchestrator-DvswGK76.d.ts} +147 -3
  180. package/dist/orchestrator.d.ts +5 -4
  181. package/dist/orchestrator.js +37 -35
  182. package/dist/patterns-cli.d.ts +1 -1
  183. package/dist/policy-runtime.d.ts +1 -1
  184. package/dist/provenance.d.ts +1 -1
  185. package/dist/qmd-recall-cache.d.ts +1 -1
  186. package/dist/qmd.d.ts +1 -1
  187. package/dist/recall-disclosure-escalation.d.ts +1 -1
  188. package/dist/recall-explain-renderer.d.ts +1 -1
  189. package/dist/recall-explain-renderer.js +3 -3
  190. package/dist/recall-planner-llm.d.ts +1 -1
  191. package/dist/recall-planner-llm.js +2 -2
  192. package/dist/recall-state.d.ts +1 -1
  193. package/dist/recall-tag-filter.d.ts +1 -1
  194. package/dist/recall-xray-cli.d.ts +1 -1
  195. package/dist/recall-xray-cli.js +4 -4
  196. package/dist/recall-xray-renderer.d.ts +1 -1
  197. package/dist/recall-xray-renderer.js +3 -3
  198. package/dist/recall-xray.d.ts +1 -1
  199. package/dist/recall-xray.js +2 -2
  200. package/dist/resolve-auth-token.d.ts +1 -1
  201. package/dist/resume-bundles.js +2 -2
  202. package/dist/retrieval-agents.d.ts +1 -1
  203. package/dist/retrieval-tiers.d.ts +1 -1
  204. package/dist/routing/engine.d.ts +1 -1
  205. package/dist/routing/store.d.ts +1 -1
  206. package/dist/schemas.d.ts +10 -10
  207. package/dist/search/embed-helper.d.ts +1 -1
  208. package/dist/search/factory.d.ts +1 -1
  209. package/dist/search/factory.js +3 -3
  210. package/dist/search/index.d.ts +1 -1
  211. package/dist/search/index.js +3 -3
  212. package/dist/search/lancedb-backend.d.ts +1 -1
  213. package/dist/search/meilisearch-backend.d.ts +1 -1
  214. package/dist/search/noop-backend.d.ts +1 -1
  215. package/dist/search/orama-backend.d.ts +1 -1
  216. package/dist/search/port.d.ts +1 -1
  217. package/dist/search/remote-backend.d.ts +1 -1
  218. package/dist/{semantic-consolidation-CWch5uM7.d.ts → semantic-consolidation-D5U0Mrdb.d.ts} +1 -1
  219. package/dist/semantic-consolidation.d.ts +2 -2
  220. package/dist/semantic-consolidation.js +7 -6
  221. package/dist/semantic-rule-promotion.js +6 -5
  222. package/dist/semantic-rule-verifier.d.ts +1 -1
  223. package/dist/semantic-rule-verifier.js +6 -5
  224. package/dist/session-observer-bands.d.ts +1 -1
  225. package/dist/session-observer-state.d.ts +1 -1
  226. package/dist/shared-context/manager.d.ts +1 -1
  227. package/dist/signal.d.ts +1 -1
  228. package/dist/storage.d.ts +6 -28
  229. package/dist/storage.js +8 -6
  230. package/dist/structured-attributes.d.ts +29 -0
  231. package/dist/structured-attributes.js +8 -0
  232. package/dist/structured-attributes.js.map +1 -0
  233. package/dist/summarizer.d.ts +1 -1
  234. package/dist/summarizer.js +3 -3
  235. package/dist/summary-snapshot.d.ts +1 -1
  236. package/dist/temporal-supersession.d.ts +2 -1
  237. package/dist/temporal-supersession.js +2 -2
  238. package/dist/temporal-validity.d.ts +22 -2
  239. package/dist/temporal-validity.js +3 -1
  240. package/dist/threading.d.ts +1 -1
  241. package/dist/tier-migration.d.ts +2 -1
  242. package/dist/tier-routing.d.ts +1 -1
  243. package/dist/topics.d.ts +1 -1
  244. package/dist/transcript.d.ts +1 -1
  245. package/dist/transfer/autodetect.js +1 -1
  246. package/dist/transfer/backup.js +1 -1
  247. package/dist/transfer/capsule-export.js +2 -2
  248. package/dist/{types-Dm5xxVrr.d.ts → types-2NoBoRBM.d.ts} +38 -0
  249. package/dist/types.d.ts +1 -1
  250. package/dist/types.js +1 -1
  251. package/dist/utility-runtime.d.ts +1 -1
  252. package/dist/verified-recall.js +6 -5
  253. package/package.json +2 -2
  254. package/src/access-boundary.ts +2 -1
  255. package/src/access-cli.test.ts +40 -0
  256. package/src/access-cli.ts +90 -2
  257. package/src/access-http.ts +35 -6
  258. package/src/access-mcp.ts +34 -0
  259. package/src/access-operations.ts +45 -0
  260. package/src/access-service.ts +60 -0
  261. package/src/access-surface-catalog.test.ts +1 -1
  262. package/src/access-surface-catalog.ts +2 -0
  263. package/src/bitemporal-frontmatter.test.ts +177 -0
  264. package/src/cli.ts +18 -0
  265. package/src/coding/architecture-card.test.ts +544 -0
  266. package/src/coding/architecture-card.ts +687 -0
  267. package/src/coding/architecture-surfaces.test.ts +579 -0
  268. package/src/coding/architecture-surfaces.ts +457 -0
  269. package/src/config.ts +13 -0
  270. package/src/event-time.test.ts +514 -0
  271. package/src/event-time.ts +548 -0
  272. package/src/maintenance/namespace-maintenance-fanout.test.ts +595 -0
  273. package/src/maintenance/namespace-maintenance-fanout.ts +318 -0
  274. package/src/maintenance/namespace-planner.ts +74 -16
  275. package/src/operator-toolkit.ts +25 -0
  276. package/src/orchestrator.ts +171 -1
  277. package/src/storage.ts +40 -20
  278. package/src/structured-attributes.ts +39 -0
  279. package/src/temporal-validity.ts +34 -0
  280. package/src/types.ts +38 -0
  281. package/dist/chunk-A7UZR6RA.js.map +0 -1
  282. package/dist/chunk-BLIWOONZ.js.map +0 -1
  283. package/dist/chunk-JZBFL7RI.js.map +0 -1
  284. package/dist/chunk-NGFEWFNK.js.map +0 -1
  285. package/dist/chunk-OWFY6NGQ.js.map +0 -1
  286. package/dist/chunk-QSQW54U5.js.map +0 -1
  287. package/dist/chunk-RHXFYIHA.js.map +0 -1
  288. package/dist/chunk-UHUZXWDX.js.map +0 -1
  289. package/dist/chunk-UXLZOVCN.js.map +0 -1
  290. package/dist/chunk-XU7363OX.js.map +0 -1
  291. package/dist/chunk-Z2M6YTAJ.js.map +0 -1
  292. /package/dist/{auto-sync-NUQWSFQD.js.map → auto-sync-RWXT6P5M.js.map} +0 -0
  293. /package/dist/{chunk-GTDH3IUH.js.map → chunk-2D27ODNX.js.map} +0 -0
  294. /package/dist/{chunk-3K37VPM3.js.map → chunk-3BRA3N5A.js.map} +0 -0
  295. /package/dist/{chunk-4FE2K57M.js.map → chunk-3VVH6ZQW.js.map} +0 -0
  296. /package/dist/{chunk-FIVDN2SM.js.map → chunk-4RGWCRIJ.js.map} +0 -0
  297. /package/dist/{chunk-AGJH5ISO.js.map → chunk-5KBNNUXS.js.map} +0 -0
  298. /package/dist/{chunk-OV4D5T7V.js.map → chunk-66HROLW5.js.map} +0 -0
  299. /package/dist/{chunk-QANVLERJ.js.map → chunk-ADUAF5EV.js.map} +0 -0
  300. /package/dist/{chunk-LLONI6PY.js.map → chunk-AFWEUTMS.js.map} +0 -0
  301. /package/dist/{chunk-W63OY3J7.js.map → chunk-D3DNGQNQ.js.map} +0 -0
  302. /package/dist/{chunk-T422SYM6.js.map → chunk-DCWIQFNA.js.map} +0 -0
  303. /package/dist/{chunk-OBXTMFZQ.js.map → chunk-ECZPWSB5.js.map} +0 -0
  304. /package/dist/{chunk-BFVPIKDY.js.map → chunk-GCOSQBQ2.js.map} +0 -0
  305. /package/dist/{chunk-SAEZIIID.js.map → chunk-IPJD7WJH.js.map} +0 -0
  306. /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
  307. /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
  308. /package/dist/{chunk-UTYBJR7M.js.map → chunk-MCV2DD6F.js.map} +0 -0
  309. /package/dist/{chunk-3FC6LW6T.js.map → chunk-MRFVMSTR.js.map} +0 -0
  310. /package/dist/{chunk-WDXCNJSF.js.map → chunk-MXZWKOOR.js.map} +0 -0
  311. /package/dist/{chunk-6O6A6YUO.js.map → chunk-NUZ3N445.js.map} +0 -0
  312. /package/dist/{chunk-GS55WYRL.js.map → chunk-QFG23CRE.js.map} +0 -0
  313. /package/dist/{chunk-UDJLF3BO.js.map → chunk-QLRYXOAD.js.map} +0 -0
  314. /package/dist/{chunk-A4HH2EWA.js.map → chunk-QVG4LAQO.js.map} +0 -0
  315. /package/dist/{chunk-4N3TFFPH.js.map → chunk-SAC5V6JT.js.map} +0 -0
  316. /package/dist/{chunk-B4XVLHJA.js.map → chunk-U2OBZSGG.js.map} +0 -0
  317. /package/dist/{chunk-STOEE37X.js.map → chunk-UOCLRM74.js.map} +0 -0
  318. /package/dist/{chunk-JPETDXED.js.map → chunk-UUMYB3FR.js.map} +0 -0
  319. /package/dist/{chunk-WIHPNY65.js.map → chunk-W4ELOUNX.js.map} +0 -0
  320. /package/dist/{chunk-VX6OBUDW.js.map → chunk-WIKNVFBS.js.map} +0 -0
  321. /package/dist/{chunk-2SNKUSQC.js.map → chunk-X5J3JZR3.js.map} +0 -0
  322. /package/dist/{chunk-PH3HOKYW.js.map → chunk-ZLXGFAML.js.map} +0 -0
package/dist/topics.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { g as MemoryFile, T as TopicScore } from './types-Dm5xxVrr.js';
1
+ import { g as MemoryFile, T as TopicScore } from './types-2NoBoRBM.js';
2
2
  import './types-ByK7T3L6.js';
3
3
  import './index-DJ9QWMw-.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { P as PluginConfig, _ as TranscriptEntry, $ as Checkpoint } from './types-Dm5xxVrr.js';
1
+ import { P as PluginConfig, _ as TranscriptEntry, $ as Checkpoint } from './types-2NoBoRBM.js';
2
2
  import { SessionIntegrityReport } from './session-integrity.js';
3
3
  import './types-ByK7T3L6.js';
4
4
  import './index-DJ9QWMw-.js';
@@ -4,8 +4,8 @@ import {
4
4
  import "../chunk-2DL3OFLD.js";
5
5
  import "../chunk-G4IAEX6D.js";
6
6
  import "../chunk-765K3SAT.js";
7
- import "../chunk-WEHSQBFR.js";
8
7
  import "../chunk-J4EB7DNW.js";
8
+ import "../chunk-WEHSQBFR.js";
9
9
  import "../chunk-UI3NYK34.js";
10
10
  import "../chunk-GCGJW34D.js";
11
11
  import "../chunk-PZ5AY32C.js";
@@ -2,8 +2,8 @@ import {
2
2
  backupMemoryDir
3
3
  } from "../chunk-2NLLXCJG.js";
4
4
  import "../chunk-765K3SAT.js";
5
- import "../chunk-X7Y7WX73.js";
6
5
  import "../chunk-J4EB7DNW.js";
6
+ import "../chunk-X7Y7WX73.js";
7
7
  import "../chunk-BJMBJZ2Y.js";
8
8
  import "../chunk-UKJAGEXH.js";
9
9
  import "../chunk-FP2373TW.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  exportCapsule,
3
3
  isValidCapsuleSince
4
- } from "../chunk-KQAFEZQX.js";
4
+ } from "../chunk-IPLYGWQF.js";
5
+ import "../chunk-J4EB7DNW.js";
5
6
  import "../chunk-WEHSQBFR.js";
6
7
  import "../chunk-X7Y7WX73.js";
7
- import "../chunk-J4EB7DNW.js";
8
8
  import "../chunk-BJMBJZ2Y.js";
9
9
  import "../chunk-UKJAGEXH.js";
10
10
  import "../chunk-FP2373TW.js";
@@ -1062,6 +1062,25 @@ interface PluginConfig {
1062
1062
  * filtered out.
1063
1063
  */
1064
1064
  temporalSupersessionIncludeInRecall: boolean;
1065
+ /**
1066
+ * Bi-temporal validity master gate (issue #1578). When `false` (default),
1067
+ * the recall validity-injection filter and `asOf` semantics behave
1068
+ * byte-identically to pre-#1578.
1069
+ *
1070
+ * Turn on to exclude validity-expired facts from default injection
1071
+ * candidates (they remain findable by explicit search and `as_of`
1072
+ * queries). Storage round-trips `observedAt`/`eventTimeSource`; the
1073
+ * extraction prompt → `resolveEventTime` write-time wiring lands in a
1074
+ * follow-on PR, so new extractions are not yet event-time-resolved.
1075
+ */
1076
+ temporalBiTemporal: boolean;
1077
+ /**
1078
+ * Escape hatch for the bi-temporal injection filter (issue #1578). When
1079
+ * `true`, facts whose `[valid_at, invalid_at)` interval ended before now
1080
+ * are kept in injection candidates even with `temporalBiTemporal` on — some
1081
+ * deployments prefer the older (always-inject) behavior. Default `false`.
1082
+ */
1083
+ temporalExpiredInInjection: boolean;
1065
1084
  /**
1066
1085
  * When true, recall checks whether a single validated memory in a
1067
1086
  * high-trust taxonomy bucket can answer the query before invoking QMD.
@@ -2570,6 +2589,25 @@ interface MemoryFrontmatter {
2570
2589
  * point in time.
2571
2590
  */
2572
2591
  invalid_at?: string;
2592
+ /**
2593
+ * Ingestion time (issue #1578) — when Remnic *learned* this fact.
2594
+ * Distinct from `created` (file creation) and `valid_at` (event-time
2595
+ * start). Aligns with the source turn timestamp (#1575
2596
+ * `sources[].observedAt`). When `eventTimeSource === "assumed"`,
2597
+ * `valid_at` is copied from this value.
2598
+ */
2599
+ observedAt?: string;
2600
+ /**
2601
+ * Provenance of the event-time interval (issue #1578).
2602
+ * - `"extracted"` — a per-fact `eventTime` expression was resolved
2603
+ * against the source turn's timestamp and produced `valid_at` /
2604
+ * `invalid_at`.
2605
+ * - `"assumed"` — no resolvable expression; `valid_at` was copied from
2606
+ * `observedAt` (the ingestion anchor).
2607
+ * Absent on memories written before #1578; readers treat absent as
2608
+ * `"assumed"` for display purposes.
2609
+ */
2610
+ eventTimeSource?: "extracted" | "assumed";
2573
2611
  /**
2574
2612
  * Timestamp when the operator explicitly forgot this memory
2575
2613
  * (issue #686 PR 4/6). Set by `remnic forget <id>`. Memories with
package/dist/types.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import './types-ByK7T3L6.js';
2
2
  import './index-DJ9QWMw-.js';
3
- export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken, b6 as AgentAccessHttpConfig, b7 as AgentDefaultsConfig, b8 as AgentPersona, f as AgentPersonaModelConfig, b9 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, ba as BehaviorSignalDirection, B as BehaviorSignalEvent, bb as BehaviorSignalType, aL as BootstrapOptions, aM as BootstrapResult, W as BriefingActiveThread, bc as BriefingCalendarSourceError, aS as BriefingConfig, S as BriefingFocus, O as BriefingFollowup, aT as BriefingOpenCommitment, Y as BriefingRecentEntity, X as BriefingResult, N as BriefingSections, aU as BriefingWindow, bd as BufferEntryState, k as BufferState, o as BufferSurpriseEvent, Z as BufferTurn, V as CalendarEvent, U as CalendarSource, be as CaptureMode, $ as Checkpoint, bf as CodexCliReasoningEffort, bg as CodexCompactionFlushMode, aV as CodexCompatConfig, bh as CodexConnectorConfig, aK as CodingContext, bi as CodingKnowledgeConfig, aP as CodingModeConfig, bj as CompressionGuidelineActivationState, a9 as CompressionGuidelineOptimizerActionSummary, a8 as CompressionGuidelineOptimizerEventCounts, aa as CompressionGuidelineOptimizerRuleUpdate, bk as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, bl as ConfidenceTier, bm as ConsolidationAction, bn as ConsolidationItem, aN as ConsolidationObservation, ag as ConsolidationResult, s as ContinuityImprovementLoop, r as ContinuityIncidentCloseInput, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, bo as ContinuityIncidentState, bp as ContinuityLoopCadence, u as ContinuityLoopReviewInput, bq as ContinuityLoopStatus, t as ContinuityLoopUpsertInput, br as ContradictionScanConfig, au as ConversationThread, bs as CronConversationRecallMode, bt as CronRecallMode, aW as DEFAULT_RECALL_DISCLOSURE, ah as DaySummaryResult, bu as DreamingConfig, bv as DreamingNarrativePromptStyle, bw as DreamsDeepSleepConfig, bx as DreamsLightSleepConfig, ay as DreamsPhase, by as DreamsPhaseStatus, bz as DreamsPhasesConfig, bA as DreamsRemConfig, az as DreamsRunResult, ax as DreamsStatusResult, bB as EngramTraceEvent, w as EntityActivityEntry, x as EntityFile, ac as EntityMention, v as EntityRelationship, ad as EntitySchemaDefinition, ae as EntitySchemaSectionDefinition, E as EntityStructuredSection, aO as EntityTimelineEntry, aX as ExtractedFact, bC as ExtractedProcedureStep, bD as ExtractedQuestion, bE as ExtractedReasoningTrace, bF as ExtractedReasoningTraceStep, bG as ExtractedRelationship, bH as ExtractionPassSource, af as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bI as GitHubLiveConnectorConfig, bJ as GmailLiveConnectorConfig, bK as GoogleDriveLiveConnectorConfig, bL as HeartbeatConfig, bM as HeartbeatDetectionMode, a0 as HourlySummary, J as IdentityInjectionMode, a5 as ImportanceLevel, I as ImportanceScore, a2 as LifecycleState, L as LiveConnectorsConfig, bN as LlmTraceCallback, bO as LlmTraceEvent, ak as MemoryActionEligibilityContext, aY as MemoryActionEligibilitySource, m as MemoryActionEvent, bP as MemoryActionOutcome, bQ as MemoryActionPolicyDecision, al as MemoryActionPolicyResult, bR as MemoryActionStatus, ab as MemoryActionType, M as MemoryCategory, g as MemoryFile, j as MemoryFrontmatter, ai as MemoryIntent, n as MemoryLifecycleEvent, am as MemoryLifecycleEventType, an as MemoryLifecycleStateSummary, i as MemoryLink, bS as MemoryLinkType, aZ as MemoryObservation, bT as MemoryOsPresetName, z as MemoryProjectionCurrentState, a_ as MemoryScope, h as MemoryStatus, D as MemorySummary, l as MetaState, bU as ModelApi, bV as ModelDefinitionConfig, bW as ModelProviderAuthMode, ao as ModelProviderConfig, bX as NamespacePolicy, ap as NativeKnowledgeConfig, bY as NativeKnowledgeFolderRuleConfig, bZ as NativeKnowledgeObsidianVaultConfig, b_ as NativeKnowledgeOpenClawWorkspaceConfig, b$ as NotionLiveConnectorConfig, P as PluginConfig, a4 as PolicyClass, c0 as PrincipalFromSessionKeyMode, c1 as PrincipalRule, c2 as ProceduralConfig, aq as ProvenanceConfig, ar as ProvenanceSource, aj as QmdSearchExplain, Q as QmdSearchResult, c3 as QuestionEntry, a$ as RECALL_DISCLOSURE_LEVELS, c4 as ReasoningEffort, K as RecallDisclosure, c5 as RecallPipelineConfig, H as RecallPlanMode, c6 as RecallSectionConfig, R as RecallTierExplain, c7 as RecallTraceEvent, c8 as RelevanceFeedback, as as RetrievalTier, c9 as SPECULATIVE_TTL_DAYS, ca as ScopeProfileAutoPromoteConfig, cb as ScopeProfileConfig, av as ScopeProfileLayerId, aw as ScopeProfilePromotionTarget, cc as ScopeProfileTeamProjectConfig, cd as ScopeTeamConfig, ce as ScoredEntity, a6 as SecretRef, cf as SemanticChunkingConfigShape, a1 as SessionObserverBandConfig, cg as SignalLevel, at as SignalScanResult, ch as SlotBehaviorConfig, ci as SlotMismatchMode, T as TopicScore, _ as TranscriptEntry, cj as TriggerMode, a3 as VerificationState, ck as confidenceTier, b5 as isRecallDisclosure } from './types-Dm5xxVrr.js';
3
+ export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken, b6 as AgentAccessHttpConfig, b7 as AgentDefaultsConfig, b8 as AgentPersona, f as AgentPersonaModelConfig, b9 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, ba as BehaviorSignalDirection, B as BehaviorSignalEvent, bb as BehaviorSignalType, aL as BootstrapOptions, aM as BootstrapResult, W as BriefingActiveThread, bc as BriefingCalendarSourceError, aS as BriefingConfig, S as BriefingFocus, O as BriefingFollowup, aT as BriefingOpenCommitment, Y as BriefingRecentEntity, X as BriefingResult, N as BriefingSections, aU as BriefingWindow, bd as BufferEntryState, k as BufferState, o as BufferSurpriseEvent, Z as BufferTurn, V as CalendarEvent, U as CalendarSource, be as CaptureMode, $ as Checkpoint, bf as CodexCliReasoningEffort, bg as CodexCompactionFlushMode, aV as CodexCompatConfig, bh as CodexConnectorConfig, aK as CodingContext, bi as CodingKnowledgeConfig, aP as CodingModeConfig, bj as CompressionGuidelineActivationState, a9 as CompressionGuidelineOptimizerActionSummary, a8 as CompressionGuidelineOptimizerEventCounts, aa as CompressionGuidelineOptimizerRuleUpdate, bk as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, bl as ConfidenceTier, bm as ConsolidationAction, bn as ConsolidationItem, aN as ConsolidationObservation, ag as ConsolidationResult, s as ContinuityImprovementLoop, r as ContinuityIncidentCloseInput, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, bo as ContinuityIncidentState, bp as ContinuityLoopCadence, u as ContinuityLoopReviewInput, bq as ContinuityLoopStatus, t as ContinuityLoopUpsertInput, br as ContradictionScanConfig, au as ConversationThread, bs as CronConversationRecallMode, bt as CronRecallMode, aW as DEFAULT_RECALL_DISCLOSURE, ah as DaySummaryResult, bu as DreamingConfig, bv as DreamingNarrativePromptStyle, bw as DreamsDeepSleepConfig, bx as DreamsLightSleepConfig, ay as DreamsPhase, by as DreamsPhaseStatus, bz as DreamsPhasesConfig, bA as DreamsRemConfig, az as DreamsRunResult, ax as DreamsStatusResult, bB as EngramTraceEvent, w as EntityActivityEntry, x as EntityFile, ac as EntityMention, v as EntityRelationship, ad as EntitySchemaDefinition, ae as EntitySchemaSectionDefinition, E as EntityStructuredSection, aO as EntityTimelineEntry, aX as ExtractedFact, bC as ExtractedProcedureStep, bD as ExtractedQuestion, bE as ExtractedReasoningTrace, bF as ExtractedReasoningTraceStep, bG as ExtractedRelationship, bH as ExtractionPassSource, af as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bI as GitHubLiveConnectorConfig, bJ as GmailLiveConnectorConfig, bK as GoogleDriveLiveConnectorConfig, bL as HeartbeatConfig, bM as HeartbeatDetectionMode, a0 as HourlySummary, J as IdentityInjectionMode, a5 as ImportanceLevel, I as ImportanceScore, a2 as LifecycleState, L as LiveConnectorsConfig, bN as LlmTraceCallback, bO as LlmTraceEvent, ak as MemoryActionEligibilityContext, aY as MemoryActionEligibilitySource, m as MemoryActionEvent, bP as MemoryActionOutcome, bQ as MemoryActionPolicyDecision, al as MemoryActionPolicyResult, bR as MemoryActionStatus, ab as MemoryActionType, M as MemoryCategory, g as MemoryFile, j as MemoryFrontmatter, ai as MemoryIntent, n as MemoryLifecycleEvent, am as MemoryLifecycleEventType, an as MemoryLifecycleStateSummary, i as MemoryLink, bS as MemoryLinkType, aZ as MemoryObservation, bT as MemoryOsPresetName, z as MemoryProjectionCurrentState, a_ as MemoryScope, h as MemoryStatus, D as MemorySummary, l as MetaState, bU as ModelApi, bV as ModelDefinitionConfig, bW as ModelProviderAuthMode, ao as ModelProviderConfig, bX as NamespacePolicy, ap as NativeKnowledgeConfig, bY as NativeKnowledgeFolderRuleConfig, bZ as NativeKnowledgeObsidianVaultConfig, b_ as NativeKnowledgeOpenClawWorkspaceConfig, b$ as NotionLiveConnectorConfig, P as PluginConfig, a4 as PolicyClass, c0 as PrincipalFromSessionKeyMode, c1 as PrincipalRule, c2 as ProceduralConfig, aq as ProvenanceConfig, ar as ProvenanceSource, aj as QmdSearchExplain, Q as QmdSearchResult, c3 as QuestionEntry, a$ as RECALL_DISCLOSURE_LEVELS, c4 as ReasoningEffort, K as RecallDisclosure, c5 as RecallPipelineConfig, H as RecallPlanMode, c6 as RecallSectionConfig, R as RecallTierExplain, c7 as RecallTraceEvent, c8 as RelevanceFeedback, as as RetrievalTier, c9 as SPECULATIVE_TTL_DAYS, ca as ScopeProfileAutoPromoteConfig, cb as ScopeProfileConfig, av as ScopeProfileLayerId, aw as ScopeProfilePromotionTarget, cc as ScopeProfileTeamProjectConfig, cd as ScopeTeamConfig, ce as ScoredEntity, a6 as SecretRef, cf as SemanticChunkingConfigShape, a1 as SessionObserverBandConfig, cg as SignalLevel, at as SignalScanResult, ch as SlotBehaviorConfig, ci as SlotMismatchMode, T as TopicScore, _ as TranscriptEntry, cj as TriggerMode, a3 as VerificationState, ck as confidenceTier, b5 as isRecallDisclosure } from './types-2NoBoRBM.js';
package/dist/types.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  SPECULATIVE_TTL_DAYS,
5
5
  confidenceTier,
6
6
  isRecallDisclosure
7
- } from "./chunk-NGFEWFNK.js";
7
+ } from "./chunk-DQHZA7Y3.js";
8
8
  import "./chunk-PZ5AY32C.js";
9
9
  export {
10
10
  DEFAULT_RECALL_DISCLOSURE,
@@ -1,5 +1,5 @@
1
1
  import { TierRoutingPolicy } from './tier-routing.js';
2
- import './types-Dm5xxVrr.js';
2
+ import './types-2NoBoRBM.js';
3
3
  import './types-ByK7T3L6.js';
4
4
  import './index-DJ9QWMw-.js';
5
5
  import './lifecycle.js';
@@ -1,22 +1,23 @@
1
1
  import {
2
2
  compareVerifiedEpisodeResults,
3
3
  searchVerifiedEpisodes
4
- } from "./chunk-4FE2K57M.js";
4
+ } from "./chunk-3VVH6ZQW.js";
5
5
  import "./chunk-7FL4CNPV.js";
6
- import "./chunk-BLIWOONZ.js";
6
+ import "./chunk-VFVG4NS2.js";
7
7
  import "./chunk-M7XQSUBB.js";
8
8
  import "./chunk-5UZXUTVO.js";
9
9
  import "./chunk-5GPPACXK.js";
10
+ import "./chunk-SVOZFLIQ.js";
10
11
  import "./chunk-J6A3CX5N.js";
11
- import "./chunk-NGFEWFNK.js";
12
+ import "./chunk-DQHZA7Y3.js";
13
+ import "./chunk-SCU65EZI.js";
12
14
  import "./chunk-MB5RSUW6.js";
13
15
  import "./chunk-6KYMPV2O.js";
14
16
  import "./chunk-AWJ2FHCF.js";
15
17
  import "./chunk-42JKGUFJ.js";
16
18
  import "./chunk-RULE4VG5.js";
17
- import "./chunk-SCU65EZI.js";
18
- import "./chunk-DM2T26WE.js";
19
19
  import "./chunk-LDXUBPMO.js";
20
+ import "./chunk-DM2T26WE.js";
20
21
  import "./chunk-FVQJYWH7.js";
21
22
  import "./chunk-G7D6GZ5J.js";
22
23
  import "./chunk-VF4XKTX3.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "9.3.689",
3
+ "version": "9.3.691",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2931,7 +2931,7 @@
2931
2931
  "core"
2932
2932
  ],
2933
2933
  "peerDependencies": {
2934
- "@remnic/coding-graph": "^9.3.689"
2934
+ "@remnic/coding-graph": "^9.3.691"
2935
2935
  },
2936
2936
  "peerDependenciesMeta": {
2937
2937
  "@remnic/coding-graph": {
@@ -34,7 +34,8 @@ export type OperationName =
34
34
  | "memory_get"
35
35
  | "memory_search"
36
36
  | "memory_store"
37
- | "coding_decision";
37
+ | "coding_decision"
38
+ | "coding_architecture";
38
39
 
39
40
  // ---------------------------------------------------------------------------
40
41
  // Operation context — what every handler receives
@@ -522,3 +522,43 @@ test("access-cli rejects adjacent option-looking values", async () => {
522
522
 
523
523
  assert.match(output, /missing required option: --content/);
524
524
  });
525
+
526
+ // ──────────────────────────────────────────────────────────────────────────
527
+ // architecture command — wired through the boundary operation (#1548 PR3)
528
+ // ──────────────────────────────────────────────────────────────────────────
529
+
530
+ test("access-cli architecture is a known command (unknown options rejected, not unsupported-command)", async () => {
531
+ const output = await captureRunCliFailure(["architecture", "--typo", "x"]);
532
+ assert.match(output, /unknown option: --typo/);
533
+ });
534
+
535
+ test("access-cli architecture accepts its documented value options", async () => {
536
+ // Valid option spellings parse cleanly; the invocation only fails once it
537
+ // reaches the runtime (no OpenClaw config here), proving the options were
538
+ // accepted by parseArgs rather than rejected as unknown.
539
+ const output = await captureRunCliFailure([
540
+ "architecture",
541
+ "--subcommand",
542
+ "get",
543
+ "--session-key",
544
+ "s1",
545
+ "--namespace",
546
+ "ns",
547
+ "--project-tag",
548
+ "myproj",
549
+ ]);
550
+ assert.doesNotMatch(output, /unknown option/);
551
+ assert.doesNotMatch(output, /unsupported command/);
552
+ });
553
+
554
+ test("access-cli usage lists the architecture command and its options", async () => {
555
+ const output = await captureRunCliFailure(["architecture", "--typo"]);
556
+ assert.match(output, /engram-access architecture \[options\]/);
557
+ assert.match(output, /Architecture options:/);
558
+ assert.match(output, /--subcommand <get\|refresh>/);
559
+ });
560
+
561
+ test("access-cli still rejects truly unknown commands as unsupported", async () => {
562
+ const output = await captureRunCliFailure(["bogus-command"]);
563
+ assert.match(output, /unsupported command/);
564
+ });
package/src/access-cli.ts CHANGED
@@ -15,7 +15,7 @@ import { projectTagProjectId } from "./coding/coding-namespace.js";
15
15
 
16
16
  const OPENCLAW_REMNIC_PLUGIN_IDS = ["openclaw-remnic", "openclaw-engram"] as const;
17
17
 
18
- type CommandName = "browse" | "store" | "decision";
18
+ type CommandName = "browse" | "store" | "decision" | "architecture";
19
19
 
20
20
  type ParsedArgs = {
21
21
  command: CommandName;
@@ -137,6 +137,7 @@ function usage(): string {
137
137
  " engram-access browse [options]",
138
138
  " engram-access store [options]",
139
139
  " engram-access decision [options]",
140
+ " engram-access architecture [options]",
140
141
  "",
141
142
  "Browse options:",
142
143
  " --namespace <name>",
@@ -176,6 +177,14 @@ function usage(): string {
176
177
  " --entity-ref <ref> (repeatable)",
177
178
  " --project-tag <tag> (attach coding context for this invocation)",
178
179
  " --supersedes-id <id> (alias for --id on supersede)",
180
+ "",
181
+ "Architecture options:",
182
+ " --subcommand <get|refresh>",
183
+ " --namespace <name>",
184
+ " --session-key <key>",
185
+ " --principal <principal>",
186
+ " --project-tag <tag> (attach coding context for this invocation)",
187
+ " --repo-root <path> (repo to scan for refresh; defaults to the current directory)",
179
188
  ].join("\n");
180
189
  }
181
190
 
@@ -228,6 +237,17 @@ const COMMAND_SPECS: Record<CommandName, CommandSpec> = {
228
237
  ]),
229
238
  flagOptions: new Set(),
230
239
  },
240
+ architecture: {
241
+ valueOptions: new Set([
242
+ "subcommand",
243
+ "namespace",
244
+ "session-key",
245
+ "principal",
246
+ "project-tag",
247
+ "repo-root",
248
+ ]),
249
+ flagOptions: new Set(),
250
+ },
231
251
  };
232
252
  const BROWSE_SORT_VALUES = Object.freeze([
233
253
  "updated_desc",
@@ -238,9 +258,19 @@ const BROWSE_SORT_VALUES = Object.freeze([
238
258
 
239
259
  type BrowseSort = (typeof BROWSE_SORT_VALUES)[number];
240
260
 
261
+ /**
262
+ * Type guard for {@link CommandName}. Enumerating the union (rather than a
263
+ * bare `value in COMMAND_SPECS`) is what lets TypeScript NARROW the string
264
+ * to `CommandName` — the `in` operator alone yields TS2322 on the
265
+ * `command: commandRaw` assignment below (codex review P2).
266
+ */
267
+ function isCommandName(value: string): value is CommandName {
268
+ return value === "browse" || value === "store" || value === "decision" || value === "architecture";
269
+ }
270
+
241
271
  function parseArgs(argv: string[]): ParsedArgs {
242
272
  const [commandRaw, ...rest] = argv;
243
- if (commandRaw !== "browse" && commandRaw !== "store" && commandRaw !== "decision") {
273
+ if (!isCommandName(commandRaw)) {
244
274
  throw new UsageError("unsupported-command");
245
275
  }
246
276
  const spec = COMMAND_SPECS[commandRaw];
@@ -552,6 +582,60 @@ async function runDecision(args: ParsedArgs, preferredId?: string): Promise<void
552
582
  console.log(JSON.stringify(output.result, null, 2));
553
583
  }
554
584
 
585
+ /**
586
+ * Architecture-card surface (issue #1548 Track A PR 3). Dispatches through
587
+ * the same `coding_architecture` operation as the MCP tool and HTTP route —
588
+ * one validation boundary, three transports.
589
+ */
590
+ async function runArchitecture(args: ParsedArgs, preferredId?: string): Promise<void> {
591
+ const subcommand = requireOption(args, "subcommand");
592
+ const { config, service } = buildRuntime(preferredId);
593
+ // Same coding-context attachment as runDecision (review P2): the CLI's
594
+ // fresh Orchestrator has an empty session coding-context map, so attach
595
+ // a context BEFORE dispatching when --project-tag + --session-key are
596
+ // given, so the gate passes and writes resolve to the right namespace.
597
+ const projectTag = getLastOption(args, "project-tag");
598
+ const sessionKey = getLastOption(args, "session-key");
599
+ if (sessionKey && sessionKey.trim().length > 0) {
600
+ // refresh scans codingContext.rootPath, so it must be a REAL checkout
601
+ // path. Default to the CWD (or an explicit --repo-root) so a one-shot
602
+ // CLI refresh scans the caller's repo, not a non-existent tag path.
603
+ const repoRoot = expandOptionalPath(getLastOption(args, "repo-root")) ?? process.cwd();
604
+ // --project-tag supplies the context id (namespace); when absent, derive
605
+ // a default from the repo-root basename so refresh works with just
606
+ // --session-key + --repo-root (codex review).
607
+ const projectId =
608
+ projectTag && projectTag.trim().length > 0
609
+ ? projectTagProjectId(projectTag.trim())
610
+ : projectTagProjectId(path.basename(repoRoot));
611
+ service.setCodingContext({
612
+ sessionKey,
613
+ codingContext: {
614
+ projectId,
615
+ branch: null,
616
+ rootPath: repoRoot,
617
+ defaultBranch: null,
618
+ },
619
+ });
620
+ }
621
+ const op = getOperation("coding_architecture");
622
+ if (!op) {
623
+ throw new Error("access-boundary: operation not registered: coding_architecture");
624
+ }
625
+ const output = (await op.run(
626
+ {
627
+ subcommand,
628
+ namespace: getLastOption(args, "namespace"),
629
+ sessionKey,
630
+ },
631
+ {
632
+ service,
633
+ authenticatedPrincipal: getLastOption(args, "principal") ?? config.agentAccessHttp.principal,
634
+ },
635
+ )) as { result: unknown };
636
+ console.log(JSON.stringify(output.result, null, 2));
637
+ }
638
+
555
639
  export async function main(
556
640
  argv: string[] = process.argv.slice(2),
557
641
  options: AccessCliOptions = {},
@@ -565,6 +649,10 @@ export async function main(
565
649
  await runDecision(args, options.preferredId);
566
650
  return;
567
651
  }
652
+ if (args.command === "architecture") {
653
+ await runArchitecture(args, options.preferredId);
654
+ return;
655
+ }
568
656
  await runStore(args, options.preferredId);
569
657
  }
570
658
 
@@ -316,6 +316,7 @@ export class EngramAccessHttpServer {
316
316
  citationsAutoDetect: options.citationsAutoDetect,
317
317
  emitLegacyTools: options.emitLegacyTools,
318
318
  codingDecisionVisible: this.service.decisionRecordSurfaceVisible,
319
+ architectureCardVisible: this.service.architectureCardSurfaceVisible,
319
320
  });
320
321
  }
321
322
 
@@ -1361,6 +1362,30 @@ export class EngramAccessHttpServer {
1361
1362
  return;
1362
1363
  }
1363
1364
 
1365
+ if (req.method === "POST" && pathname === "/engram/v1/coding/architecture") {
1366
+ // Migrated through the access boundary (issue #1525/#1548 PR3):
1367
+ // refresh persists the card, so it is gated by the 30/min write quota;
1368
+ // get is a pure read and stays uncounted.
1369
+ const body = await this.readJsonBody(req);
1370
+ const isWriteSubcommand = body.subcommand === "refresh";
1371
+ if (isWriteSubcommand) {
1372
+ this.ensureWriteRateLimitAvailable();
1373
+ }
1374
+ const op = getOperation("coding_architecture");
1375
+ if (!op) {
1376
+ throw new EngramAccessInputError("access-boundary: operation not registered: coding_architecture");
1377
+ }
1378
+ const output = (await op.run(body, {
1379
+ service: this.service,
1380
+ authenticatedPrincipal: this.resolveRequestPrincipal(req),
1381
+ })) as { result: unknown };
1382
+ if (isWriteSubcommand) {
1383
+ this.recordWriteRateLimitHit();
1384
+ }
1385
+ this.respondJson(res, 200, output.result);
1386
+ return;
1387
+ }
1388
+
1364
1389
  if (req.method === "POST" && pathname === "/engram/v1/suggestions") {
1365
1390
  const body = await this.readValidatedBody(req, "suggestionSubmit");
1366
1391
  const request = {
@@ -2213,13 +2238,16 @@ export class EngramAccessHttpServer {
2213
2238
  typeof toolArgs === "object" &&
2214
2239
  !Array.isArray(toolArgs) &&
2215
2240
  (toolArgs as { dryRun?: unknown }).dryRun === true;
2241
+ const toolArgsSubcommand =
2242
+ toolArgs !== null && typeof toolArgs === "object" && !Array.isArray(toolArgs) && "subcommand" in toolArgs
2243
+ ? toolArgs.subcommand
2244
+ : undefined;
2216
2245
  const codingDecisionWrite =
2217
2246
  (toolName === "engram.coding_decision" || toolName === "remnic.coding_decision") &&
2218
- toolArgs !== null &&
2219
- typeof toolArgs === "object" &&
2220
- !Array.isArray(toolArgs) &&
2221
- ((toolArgs as { subcommand?: unknown }).subcommand === "record" ||
2222
- (toolArgs as { subcommand?: unknown }).subcommand === "supersede");
2247
+ (toolArgsSubcommand === "record" || toolArgsSubcommand === "supersede");
2248
+ const codingArchitectureWrite =
2249
+ (toolName === "engram.coding_architecture" || toolName === "remnic.coding_architecture") &&
2250
+ toolArgsSubcommand === "refresh";
2223
2251
  const isMcpWrite =
2224
2252
  request.method === "tools/call" &&
2225
2253
  (
@@ -2248,7 +2276,8 @@ export class EngramAccessHttpServer {
2248
2276
  toolName === "remnic.memory_action_apply"
2249
2277
  )
2250
2278
  ) ||
2251
- codingDecisionWrite
2279
+ codingDecisionWrite ||
2280
+ codingArchitectureWrite
2252
2281
  );
2253
2282
  if (isMcpWrite) {
2254
2283
  this.ensureWriteRateLimitAvailable();
package/src/access-mcp.ts CHANGED
@@ -110,6 +110,7 @@ const MCP_MIGRATED_OPERATIONS: Readonly<Record<string, OperationName>> = {
110
110
  "engram.memory_search": "memory_search",
111
111
  "engram.memory_store": "memory_store",
112
112
  "engram.coding_decision": "coding_decision",
113
+ "engram.coding_architecture": "coding_architecture",
113
114
  };
114
115
 
115
116
  function resolveChatGptInspectorRecallSessionKey(
@@ -324,6 +325,12 @@ export class EngramMcpServer {
324
325
  * pre-feature.
325
326
  */
326
327
  private readonly codingDecisionVisible: boolean;
328
+ /**
329
+ * Whether the `coding_architecture` tool should appear in `tools/list`.
330
+ * Gated on `codingKnowledge.enabled && codingKnowledge.architectureCard`
331
+ * (issue #1548 Track A PR 3, rule 39).
332
+ */
333
+ private readonly architectureCardVisible: boolean;
327
334
 
328
335
  constructor(
329
336
  private readonly service: EngramAccessService,
@@ -333,12 +340,14 @@ export class EngramMcpServer {
333
340
  citationsAutoDetect?: boolean;
334
341
  emitLegacyTools?: boolean;
335
342
  codingDecisionVisible?: boolean;
343
+ architectureCardVisible?: boolean;
336
344
  } = {},
337
345
  ) {
338
346
  this.citationsEnabled = options.citationsEnabled === true;
339
347
  this.citationsAutoDetect = options.citationsAutoDetect !== false;
340
348
  this.emitLegacyTools = options.emitLegacyTools !== false;
341
349
  this.codingDecisionVisible = options.codingDecisionVisible === true;
350
+ this.architectureCardVisible = options.architectureCardVisible === true;
342
351
  this.authenticatedPrincipal =
343
352
  options.principal?.trim() ||
344
353
  readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() ||
@@ -1999,6 +2008,31 @@ export class EngramMcpServer {
1999
2008
  );
2000
2009
  this.tools = [...this.tools, ...codingDecisionTools];
2001
2010
  }
2011
+ if (this.architectureCardVisible) {
2012
+ const architectureTools = withToolAliases(
2013
+ {
2014
+ name: "engram.coding_architecture",
2015
+ description:
2016
+ "Get or refresh the architecture card for the session's coding namespace (issue #1548 Track A PR 3). Subcommands: get, refresh.",
2017
+ inputSchema: {
2018
+ type: "object",
2019
+ properties: {
2020
+ subcommand: {
2021
+ type: "string",
2022
+ enum: ["get", "refresh"],
2023
+ description: "Which architecture-card operation to run.",
2024
+ },
2025
+ sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
2026
+ namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." },
2027
+ },
2028
+ required: ["subcommand"],
2029
+ additionalProperties: false,
2030
+ },
2031
+ },
2032
+ this.emitLegacyTools,
2033
+ );
2034
+ this.tools = [...this.tools, ...architectureTools];
2035
+ }
2002
2036
  }
2003
2037
 
2004
2038
  /** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
@@ -25,6 +25,10 @@ import {
25
25
  type DecisionSurfaceRequest,
26
26
  type DecisionSurfaceResponse,
27
27
  } from "./coding/decision-surfaces.js";
28
+ import {
29
+ type ArchitectureSurfaceRequest,
30
+ type ArchitectureSurfaceResponse,
31
+ } from "./coding/architecture-surfaces.js";
28
32
 
29
33
  // ---------------------------------------------------------------------------
30
34
  // memory_get — fetch one memory by id
@@ -206,6 +210,46 @@ export const codingDecisionOperation = defineOperation<
206
210
  },
207
211
  });
208
212
 
213
+ // ---------------------------------------------------------------------------
214
+ // coding_architecture — architecture-card surfaces (issue #1548 Track A PR 3)
215
+ // ---------------------------------------------------------------------------
216
+
217
+ const codingArchitectureSchema = z.preprocess(
218
+ (data) => {
219
+ if (data !== null && typeof data === "object" && !Array.isArray(data)) {
220
+ const obj = data as Record<string, unknown>;
221
+ const cleaned: Record<string, unknown> = {};
222
+ for (const [key, value] of Object.entries(obj)) {
223
+ if (value !== null) cleaned[key] = value;
224
+ }
225
+ return cleaned;
226
+ }
227
+ return data;
228
+ },
229
+ z.object({
230
+ subcommand: z.enum(["get", "refresh"]),
231
+ sessionKey: z.string().optional(),
232
+ namespace: z.string().optional(),
233
+ }),
234
+ );
235
+
236
+ export type CodingArchitectureInput = ArchitectureSurfaceRequest;
237
+ export type CodingArchitectureOutput = { result: ArchitectureSurfaceResponse };
238
+
239
+ export const codingArchitectureOperation = defineOperation<
240
+ CodingArchitectureInput,
241
+ CodingArchitectureOutput
242
+ >({
243
+ name: "coding_architecture",
244
+ description:
245
+ "Get or refresh the architecture card for the session's coding namespace (issue #1548 Track A PR 3).",
246
+ schema: codingArchitectureSchema as z.ZodType<CodingArchitectureInput>,
247
+ handler: async (input, ctx) => {
248
+ const result = await ctx.service.codingArchitecture(input, ctx.authenticatedPrincipal);
249
+ return { result };
250
+ },
251
+ });
252
+
209
253
  // ---------------------------------------------------------------------------
210
254
  // Surface registration map — what each transport calls the pilot ops
211
255
  // ---------------------------------------------------------------------------
@@ -220,4 +264,5 @@ export const REGISTERED_OPERATIONS = [
220
264
  memorySearchOperation.spec.name,
221
265
  memoryStoreOperation.spec.name,
222
266
  codingDecisionOperation.spec.name,
267
+ codingArchitectureOperation.spec.name,
223
268
  ] as const;
@@ -19,6 +19,16 @@ import {
19
19
  type DecisionSurfaceRequest,
20
20
  type DecisionSurfaceResponse,
21
21
  } from "./coding/decision-surfaces.js";
22
+ import {
23
+ handleCodingArchitecture,
24
+ type ArchitectureSurfaceRequest,
25
+ type ArchitectureSurfaceResponse,
26
+ type ArchitectureSurfaceStorage,
27
+ createArchitectureVersioningHook,
28
+ ARCHITECTURE_CARD_TAG,
29
+ } from "./coding/architecture-surfaces.js";
30
+ import { buildArchitectureCard, createArchitectureCardSummariser } from "./coding/architecture-card.js";
31
+ import { createVersion } from "./page-versioning.js";
22
32
  import { WorkStorage } from "./work/storage.js";
23
33
  import {
24
34
  exportWorkBoardMarkdown,
@@ -4485,6 +4495,56 @@ export class EngramAccessService {
4485
4495
  });
4486
4496
  }
4487
4497
 
4498
+ /** Whether the coding_architecture tool should appear in tools/list (rule 39). */
4499
+ get architectureCardSurfaceVisible(): boolean {
4500
+ return this.orchestrator.config.codingKnowledge?.enabled === true
4501
+ && this.orchestrator.config.codingKnowledge?.architectureCard === true;
4502
+ }
4503
+ /**
4504
+ * Thin delegate — handler logic in coding/architecture-surfaces.ts (#1548 PR3).
4505
+ * All three surfaces (MCP/HTTP/CLI) arrive here via the boundary operation.
4506
+ * Namespace resolution uses the SAME coding-scoped path as decision records.
4507
+ */
4508
+ async codingArchitecture(
4509
+ request: ArchitectureSurfaceRequest,
4510
+ authenticatedPrincipal?: string,
4511
+ ): Promise<ArchitectureSurfaceResponse> {
4512
+ const resolvedConfig = this.orchestrator.config;
4513
+ return handleCodingArchitecture(request, {
4514
+ codingKnowledge: this.orchestrator.config.codingKnowledge,
4515
+ getCodingContext: (sk) => this.orchestrator.getCodingContextForSession(sk),
4516
+ resolveStorage: async (req) => {
4517
+ const isWrite = req.subcommand === "refresh";
4518
+ const ns = isWrite
4519
+ ? await this.resolveCodingScopedWriteNamespace({
4520
+ namespace: req.namespace,
4521
+ sessionKey: req.sessionKey,
4522
+ authenticatedPrincipal,
4523
+ })
4524
+ : await this.resolveCodingScopedReadableNamespace({
4525
+ namespace: req.namespace,
4526
+ sessionKey: req.sessionKey,
4527
+ authenticatedPrincipal,
4528
+ });
4529
+ const storage = await this.orchestrator.getStorage(ns);
4530
+ return Object.assign(storage, { namespace: ns }) as ArchitectureSurfaceStorage;
4531
+ },
4532
+ buildCard: async (repoRoot) => buildArchitectureCard(repoRoot, {
4533
+ llmSummary: this.orchestrator.config.codingKnowledge?.architectureCardLlmSummary === true,
4534
+ summariser: createArchitectureCardSummariser(this.fallbackLlmRef ?? this.localLlmRef),
4535
+ }),
4536
+ versioning: createArchitectureVersioningHook(
4537
+ resolvedConfig.versioningEnabled === true,
4538
+ resolvedConfig.versioningMaxPerPage,
4539
+ resolvedConfig.versioningSidecarDir,
4540
+ resolvedConfig.memoryDir,
4541
+ (p) => nodeFs.readFile(p, "utf-8"),
4542
+ createVersion,
4543
+ ),
4544
+ throwInputError: (msg) => { throw new EngramAccessInputError(msg); },
4545
+ });
4546
+ }
4547
+
4488
4548
  async memoryBrowse(
4489
4549
  request: EngramAccessMemoryBrowseRequest = {},
4490
4550
  ): Promise<EngramAccessMemoryBrowseResponse> {