@remnic/core 9.7.13 → 9.7.15
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.
- package/dist/access-admin-ops-surface.d.ts +6 -6
- package/dist/access-admin-ops-surface.js +22 -22
- package/dist/access-boundary.d.ts +6 -6
- package/dist/access-boundary.js +23 -23
- package/dist/access-cli.js +51 -51
- package/dist/access-http.d.ts +6 -6
- package/dist/access-http.js +28 -28
- package/dist/access-identity-continuity-surface.d.ts +5 -5
- package/dist/access-identity-continuity-surface.js +22 -22
- package/dist/access-lcm-surface.d.ts +6 -6
- package/dist/access-lcm-surface.js +22 -22
- package/dist/access-mcp.d.ts +6 -6
- package/dist/access-mcp.js +27 -27
- package/dist/access-observe-write-surface.d.ts +6 -6
- package/dist/access-observe-write-surface.js +22 -22
- package/dist/access-operations-batch.js +25 -25
- package/dist/access-operations.d.ts +6 -6
- package/dist/access-operations.js +26 -26
- package/dist/access-recall-surface.d.ts +6 -6
- package/dist/access-recall-surface.js +22 -22
- package/dist/{access-service-tHd3eQpd.d.ts → access-service-DpcYZ9Nl.d.ts} +4 -4
- package/dist/access-service.d.ts +6 -6
- package/dist/access-service.js +22 -22
- package/dist/access-surface-catalog.d.ts +6 -6
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +5 -5
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +6 -6
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-merge-Z2HUO6IK.js → capsule-merge-5KKJQBWQ.js} +4 -4
- package/dist/{catalog-DEMiw6HZ.d.ts → catalog-C9444P10.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +9 -9
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory-graph.js +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-2RSL6YRA.js → chunk-2AZXIZEN.js} +3 -3
- package/dist/{chunk-OBMR4VIX.js → chunk-2S6QHZGJ.js} +186 -15
- package/dist/chunk-2S6QHZGJ.js.map +1 -0
- package/dist/{chunk-5S7Z5SHA.js → chunk-34RC5RT7.js} +2 -2
- package/dist/{chunk-JKLJ6A7W.js → chunk-3D6AFGQR.js} +2 -2
- package/dist/{chunk-2AL7N3BH.js → chunk-3IY64MV6.js} +4 -2
- package/dist/chunk-3IY64MV6.js.map +1 -0
- package/dist/{chunk-VZ5OJE4X.js → chunk-5VQJBH2G.js} +2 -2
- package/dist/{chunk-N3JDIRBW.js → chunk-74F5STS4.js} +2 -2
- package/dist/{chunk-OC35KQIN.js → chunk-A5UXZRRM.js} +3 -3
- package/dist/{chunk-OKUEZOGW.js → chunk-AITCS2RC.js} +2 -2
- package/dist/{chunk-7XGSIUP5.js → chunk-AJLLIIML.js} +1 -1
- package/dist/{chunk-CE3GMHT4.js → chunk-BS4SGLWV.js} +2 -2
- package/dist/{chunk-2V5QI6NQ.js → chunk-DCFV7A7H.js} +6 -6
- package/dist/{chunk-I3GKTDM2.js → chunk-DMSDUGDM.js} +3 -3
- package/dist/{chunk-D4TLWDYR.js → chunk-DPAENM7O.js} +2 -2
- package/dist/{chunk-AHLPZ2SF.js → chunk-DYP3YYJJ.js} +7 -3
- package/dist/chunk-DYP3YYJJ.js.map +1 -0
- package/dist/{chunk-7MW3CVLD.js → chunk-DZKHSDOM.js} +2 -2
- package/dist/{chunk-HG32URJJ.js → chunk-E6CBU7XP.js} +2 -2
- package/dist/{chunk-675YU5IK.js → chunk-EHCONI6E.js} +2 -2
- package/dist/{chunk-NVXQTRBL.js → chunk-FDCTQWLW.js} +2 -2
- package/dist/{chunk-PA6DMYEK.js → chunk-FIJUY7GG.js} +9 -9
- package/dist/{chunk-UTRJFDP2.js → chunk-FNZQGN76.js} +2 -2
- package/dist/{chunk-V53GJUSL.js → chunk-G4CN3ZXL.js} +6 -6
- package/dist/{chunk-IQULRIZM.js → chunk-G6XXLKC5.js} +3 -3
- package/dist/{chunk-CLFY35ED.js → chunk-HDTQVNWD.js} +3 -3
- package/dist/{chunk-TMGK6YE7.js → chunk-HF77M34J.js} +2 -2
- package/dist/{chunk-6N7R7TR2.js → chunk-INELTPRG.js} +15 -1
- package/dist/chunk-INELTPRG.js.map +1 -0
- package/dist/{chunk-ZC3HG22I.js → chunk-JREB6UFH.js} +2 -2
- package/dist/{chunk-TRH533CA.js → chunk-K7LOWSLU.js} +38 -9
- package/dist/chunk-K7LOWSLU.js.map +1 -0
- package/dist/{chunk-TWGGNUWJ.js → chunk-KDXVOFYY.js} +2 -2
- package/dist/{chunk-RT7IP3D3.js → chunk-KSNVDPDF.js} +2 -2
- package/dist/{chunk-ZIDSD6VC.js → chunk-LRNMRXJO.js} +2 -2
- package/dist/{chunk-QPZCAVDC.js → chunk-LZOV7MX7.js} +12 -12
- package/dist/{chunk-VY6LKKVN.js → chunk-NWTGD4AN.js} +6 -1
- package/dist/chunk-NWTGD4AN.js.map +1 -0
- package/dist/{chunk-Z6WN2KSH.js → chunk-OAZVR2BV.js} +3 -3
- package/dist/{chunk-KQMKF4G2.js → chunk-OVJ2HIPE.js} +21 -21
- package/dist/{chunk-OCY3CRPG.js → chunk-PBNZVPFS.js} +3 -3
- package/dist/{chunk-G5PVJJRA.js → chunk-PBSAPHHA.js} +1 -1
- package/dist/chunk-PBSAPHHA.js.map +1 -0
- package/dist/{chunk-XVLEGMJI.js → chunk-PLQE6MJA.js} +2 -2
- package/dist/{chunk-NKCPUHCI.js → chunk-PQVK2S3J.js} +2 -2
- package/dist/{chunk-OIFZII6J.js → chunk-Q5WG43OP.js} +3 -3
- package/dist/{chunk-YI7XUXLX.js → chunk-QKQYXZVS.js} +28 -26
- package/dist/chunk-QKQYXZVS.js.map +1 -0
- package/dist/{chunk-XUQUBZ7O.js → chunk-QQGPUKMT.js} +2 -2
- package/dist/{chunk-XUQUBZ7O.js.map → chunk-QQGPUKMT.js.map} +1 -1
- package/dist/{chunk-WU46YPY6.js → chunk-RAR2BSEM.js} +1 -1
- package/dist/{chunk-WU46YPY6.js.map → chunk-RAR2BSEM.js.map} +1 -1
- package/dist/{chunk-3SIC3E65.js → chunk-RO4LQGT3.js} +2 -2
- package/dist/{chunk-BQTSGK5Y.js → chunk-RVZRYUQH.js} +2 -2
- package/dist/{chunk-T6U7HDIY.js → chunk-T7Y5KPLN.js} +2 -2
- package/dist/{chunk-HLTAPHZZ.js → chunk-UDQUSU27.js} +2 -2
- package/dist/{chunk-2ZPQUTMW.js → chunk-VDW4VU7B.js} +5 -5
- package/dist/{chunk-ZRXSHGXT.js → chunk-VJVNLNDQ.js} +3 -3
- package/dist/{chunk-UTZW3X2R.js → chunk-XDSXEKYK.js} +2 -2
- package/dist/{chunk-X47LWMKA.js → chunk-XMMESCPD.js} +26 -1
- package/dist/chunk-XMMESCPD.js.map +1 -0
- package/dist/{chunk-FUUF7FMX.js → chunk-ZHIVCODT.js} +2 -2
- package/dist/{cli-D8Tsa4Sh.d.ts → cli-Cd5fMmhq.d.ts} +5 -5
- package/dist/cli.d.ts +8 -8
- package/dist/cli.js +42 -42
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +6 -6
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +6 -6
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +6 -6
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-provenance-check.js +4 -4
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/consolidation-undo.js +3 -3
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +6 -6
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +5 -5
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +2 -2
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/{graph-edge-decay-FO7AM4UR.js → graph-edge-decay-IOGBBAGC.js} +3 -3
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph-snapshot.js +2 -2
- package/dist/graph.d.ts +55 -10
- package/dist/graph.js +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.js +51 -51
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-llm.js +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +6 -6
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -6
- package/dist/maintenance/rebuild-memory-projection.js +7 -7
- package/dist/mcp-memory-inspector-app.d.ts +6 -6
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +44 -2
- package/dist/memory-cache.js +7 -1
- package/dist/memory-corpus-version.js +2 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +15 -15
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +6 -6
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +2 -2
- package/dist/operator-toolkit.js +21 -21
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +8 -8
- package/dist/{orchestrator-B_WXBmuE.d.ts → orchestrator-Bp_jeBHK.d.ts} +4 -4
- package/dist/orchestrator.d.ts +5 -5
- package/dist/orchestrator.js +51 -51
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-Dvtvt141.d.ts → pipeline-BAj5bx7g.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-DwBLh_hl.d.ts → qmd-_MDSlj1m.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/qmd.js +3 -3
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +2 -2
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +8 -8
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +12 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/{semantic-consolidation-Dia_6FOn.d.ts → semantic-consolidation-C2m5eHHE.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +7 -7
- package/dist/semantic-rule-promotion.js +6 -6
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +6 -6
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/{storage-RshM7i8-.d.ts → storage-hr_Y2z5R.d.ts} +17 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +5 -5
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +2 -2
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/capsule-import.js +4 -4
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-CHSXOq7s.d.ts → types-Cg8q7W7_.d.ts} +16 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +6 -6
- package/package.json +2 -2
- package/src/config.ts +18 -0
- package/src/graph.test.ts +137 -1
- package/src/graph.ts +274 -17
- package/src/local-llm-thinking.test.ts +55 -1
- package/src/local-llm.ts +14 -0
- package/src/memory-cache.ts +70 -0
- package/src/namespaces/storage.ts +2 -0
- package/src/orchestration/maintenance.ts +7 -0
- package/src/orchestration/workspace-ops.ts +4 -0
- package/src/orchestrator.ts +6 -1
- package/src/qmd.test.ts +22 -0
- package/src/qmd.ts +13 -1
- package/src/search/port.ts +11 -0
- package/src/storage.ts +60 -13
- package/src/types.ts +21 -0
- package/dist/chunk-2AL7N3BH.js.map +0 -1
- package/dist/chunk-6N7R7TR2.js.map +0 -1
- package/dist/chunk-AHLPZ2SF.js.map +0 -1
- package/dist/chunk-G5PVJJRA.js.map +0 -1
- package/dist/chunk-OBMR4VIX.js.map +0 -1
- package/dist/chunk-TRH533CA.js.map +0 -1
- package/dist/chunk-VY6LKKVN.js.map +0 -1
- package/dist/chunk-X47LWMKA.js.map +0 -1
- package/dist/chunk-YI7XUXLX.js.map +0 -1
- /package/dist/{capsule-merge-Z2HUO6IK.js.map → capsule-merge-5KKJQBWQ.js.map} +0 -0
- /package/dist/{chunk-2RSL6YRA.js.map → chunk-2AZXIZEN.js.map} +0 -0
- /package/dist/{chunk-5S7Z5SHA.js.map → chunk-34RC5RT7.js.map} +0 -0
- /package/dist/{chunk-JKLJ6A7W.js.map → chunk-3D6AFGQR.js.map} +0 -0
- /package/dist/{chunk-VZ5OJE4X.js.map → chunk-5VQJBH2G.js.map} +0 -0
- /package/dist/{chunk-N3JDIRBW.js.map → chunk-74F5STS4.js.map} +0 -0
- /package/dist/{chunk-OC35KQIN.js.map → chunk-A5UXZRRM.js.map} +0 -0
- /package/dist/{chunk-OKUEZOGW.js.map → chunk-AITCS2RC.js.map} +0 -0
- /package/dist/{chunk-7XGSIUP5.js.map → chunk-AJLLIIML.js.map} +0 -0
- /package/dist/{chunk-CE3GMHT4.js.map → chunk-BS4SGLWV.js.map} +0 -0
- /package/dist/{chunk-2V5QI6NQ.js.map → chunk-DCFV7A7H.js.map} +0 -0
- /package/dist/{chunk-I3GKTDM2.js.map → chunk-DMSDUGDM.js.map} +0 -0
- /package/dist/{chunk-D4TLWDYR.js.map → chunk-DPAENM7O.js.map} +0 -0
- /package/dist/{chunk-7MW3CVLD.js.map → chunk-DZKHSDOM.js.map} +0 -0
- /package/dist/{chunk-HG32URJJ.js.map → chunk-E6CBU7XP.js.map} +0 -0
- /package/dist/{chunk-675YU5IK.js.map → chunk-EHCONI6E.js.map} +0 -0
- /package/dist/{chunk-NVXQTRBL.js.map → chunk-FDCTQWLW.js.map} +0 -0
- /package/dist/{chunk-PA6DMYEK.js.map → chunk-FIJUY7GG.js.map} +0 -0
- /package/dist/{chunk-UTRJFDP2.js.map → chunk-FNZQGN76.js.map} +0 -0
- /package/dist/{chunk-V53GJUSL.js.map → chunk-G4CN3ZXL.js.map} +0 -0
- /package/dist/{chunk-IQULRIZM.js.map → chunk-G6XXLKC5.js.map} +0 -0
- /package/dist/{chunk-CLFY35ED.js.map → chunk-HDTQVNWD.js.map} +0 -0
- /package/dist/{chunk-TMGK6YE7.js.map → chunk-HF77M34J.js.map} +0 -0
- /package/dist/{chunk-ZC3HG22I.js.map → chunk-JREB6UFH.js.map} +0 -0
- /package/dist/{chunk-TWGGNUWJ.js.map → chunk-KDXVOFYY.js.map} +0 -0
- /package/dist/{chunk-RT7IP3D3.js.map → chunk-KSNVDPDF.js.map} +0 -0
- /package/dist/{chunk-ZIDSD6VC.js.map → chunk-LRNMRXJO.js.map} +0 -0
- /package/dist/{chunk-QPZCAVDC.js.map → chunk-LZOV7MX7.js.map} +0 -0
- /package/dist/{chunk-Z6WN2KSH.js.map → chunk-OAZVR2BV.js.map} +0 -0
- /package/dist/{chunk-KQMKF4G2.js.map → chunk-OVJ2HIPE.js.map} +0 -0
- /package/dist/{chunk-OCY3CRPG.js.map → chunk-PBNZVPFS.js.map} +0 -0
- /package/dist/{chunk-XVLEGMJI.js.map → chunk-PLQE6MJA.js.map} +0 -0
- /package/dist/{chunk-NKCPUHCI.js.map → chunk-PQVK2S3J.js.map} +0 -0
- /package/dist/{chunk-OIFZII6J.js.map → chunk-Q5WG43OP.js.map} +0 -0
- /package/dist/{chunk-3SIC3E65.js.map → chunk-RO4LQGT3.js.map} +0 -0
- /package/dist/{chunk-BQTSGK5Y.js.map → chunk-RVZRYUQH.js.map} +0 -0
- /package/dist/{chunk-T6U7HDIY.js.map → chunk-T7Y5KPLN.js.map} +0 -0
- /package/dist/{chunk-HLTAPHZZ.js.map → chunk-UDQUSU27.js.map} +0 -0
- /package/dist/{chunk-2ZPQUTMW.js.map → chunk-VDW4VU7B.js.map} +0 -0
- /package/dist/{chunk-ZRXSHGXT.js.map → chunk-VJVNLNDQ.js.map} +0 -0
- /package/dist/{chunk-UTZW3X2R.js.map → chunk-XDSXEKYK.js.map} +0 -0
- /package/dist/{chunk-FUUF7FMX.js.map → chunk-ZHIVCODT.js.map} +0 -0
- /package/dist/{graph-edge-decay-FO7AM4UR.js.map → graph-edge-decay-IOGBBAGC.js.map} +0 -0
package/src/orchestrator.ts
CHANGED
|
@@ -1338,12 +1338,16 @@ export class Orchestrator {
|
|
|
1338
1338
|
// — including the ephemeral ones recall sub-stages build over the same dir
|
|
1339
1339
|
// — honors the operator's setting. Destructured (not `config.<flag>`) so
|
|
1340
1340
|
// this single access-layer read stays off the scattered-flag ratchet.
|
|
1341
|
-
const { hotMemoriesCacheEnabled } = config;
|
|
1341
|
+
const { hotMemoriesCacheEnabled, scopedCacheInvalidationEnabled } = config;
|
|
1342
1342
|
StorageManager.setHotMemoriesCacheDefault(
|
|
1343
1343
|
config.memoryDir,
|
|
1344
1344
|
hotMemoriesCacheEnabled,
|
|
1345
1345
|
config.hotMemoriesCacheTtlMs,
|
|
1346
1346
|
);
|
|
1347
|
+
// Register the #1904 scope-invalidation gate for this dir so every
|
|
1348
|
+
// StorageManager over it (including ephemeral recall sub-stage instances)
|
|
1349
|
+
// honors the operator's rollback lever.
|
|
1350
|
+
StorageManager.setScopedCacheInvalidationDefault(config.memoryDir, scopedCacheInvalidationEnabled);
|
|
1347
1351
|
this.profiler = new ProfilingCollector({
|
|
1348
1352
|
enabled: resolvePipelineProcessingCapabilities(this.config).profiling,
|
|
1349
1353
|
storageDir: config.profilingStorageDir || path.join(config.memoryDir, "profiling"),
|
|
@@ -1512,6 +1516,7 @@ export class Orchestrator {
|
|
|
1512
1516
|
config.hotMemoriesCacheEnabled,
|
|
1513
1517
|
config.hotMemoriesCacheTtlMs,
|
|
1514
1518
|
);
|
|
1519
|
+
StorageManager.setScopedCacheInvalidationDefault(parentDir, scopedCacheInvalidationEnabled);
|
|
1515
1520
|
return new StorageManager(parentDir, config.entitySchemas, config.hotMemoriesCacheEnabled);
|
|
1516
1521
|
},
|
|
1517
1522
|
});
|
package/src/qmd.test.ts
CHANGED
|
@@ -357,6 +357,28 @@ test("QmdClient keeps legacy --json for older QMD query subprocess output", asyn
|
|
|
357
357
|
]);
|
|
358
358
|
});
|
|
359
359
|
|
|
360
|
+
test("QmdClient clears the global QMD result caches on a successful refresh (#1904)", async () => {
|
|
361
|
+
// The centralized invalidation lives in QmdClient.runUpdateForCollection /
|
|
362
|
+
// runEmbedForCollection so every refresh path (direct update, namespace
|
|
363
|
+
// router, wearable/OpenClaw sync) invalidates the cached pre-refresh bundles
|
|
364
|
+
// without each caller having to remember. Defend that contract.
|
|
365
|
+
const { QmdClient } = await import("./qmd.js");
|
|
366
|
+
const { setCachedQmdSearch, getCachedQmdSearch } = await import("./memory-cache.js");
|
|
367
|
+
const client = new QmdClient("test", 5) as any;
|
|
368
|
+
client.available = true;
|
|
369
|
+
client.runQmdCommand = async () => ({ stdout: "", stderr: "" });
|
|
370
|
+
setCachedQmdSearch("stale-bundle", [{ path: "facts/old.md" }]);
|
|
371
|
+
assert.notEqual(getCachedQmdSearch("stale-bundle"), null, "cache populated before refresh");
|
|
372
|
+
// updateCollectionStrict uses force=true, bypassing throttle/backoff gates so
|
|
373
|
+
// the refresh deterministically reaches the success point that clears caches.
|
|
374
|
+
await client.updateCollectionStrict("test");
|
|
375
|
+
assert.equal(
|
|
376
|
+
getCachedQmdSearch("stale-bundle"),
|
|
377
|
+
null,
|
|
378
|
+
"a successful refresh must clear the cached pre-refresh QMD bundle",
|
|
379
|
+
);
|
|
380
|
+
});
|
|
381
|
+
|
|
360
382
|
test("parseQmdExplain preserves qmd 2.5 nested RRF trace fields", () => {
|
|
361
383
|
assert.deepEqual(
|
|
362
384
|
parseQmdExplain({
|
package/src/qmd.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { log } from "./logger.js";
|
|
5
|
-
import { getCachedQmdSearch, setCachedQmdSearch } from "./memory-cache.js";
|
|
5
|
+
import { clearQmdResultCaches, getCachedQmdSearch, setCachedQmdSearch } from "./memory-cache.js";
|
|
6
6
|
import {
|
|
7
7
|
abortError,
|
|
8
8
|
isAbortError,
|
|
@@ -2739,6 +2739,13 @@ export class QmdClient implements SearchBackend {
|
|
|
2739
2739
|
this.lastUpdateRunAtMs = at;
|
|
2740
2740
|
globalState.lastGlobalUpdateRunAtMs = at;
|
|
2741
2741
|
}
|
|
2742
|
+
// A successful index refresh makes newly-persisted facts searchable, so
|
|
2743
|
+
// any cached pre-refresh QMD search/recall bundle is now stale. Clear the
|
|
2744
|
+
// global QMD result caches here, at the single success point EVERY update
|
|
2745
|
+
// path funnels through (direct calls, wearable/OpenClaw sync reindex, and
|
|
2746
|
+
// the namespace router's per-backend update), so no caller can forget and
|
|
2747
|
+
// serve a stale bundle past the refresh (#1904, Codex/Cursor).
|
|
2748
|
+
clearQmdResultCaches();
|
|
2742
2749
|
log.debug(`QMD update completed for collection=${name}`);
|
|
2743
2750
|
} catch (err) {
|
|
2744
2751
|
const at = Date.now();
|
|
@@ -2853,6 +2860,9 @@ export class QmdClient implements SearchBackend {
|
|
|
2853
2860
|
globalState.lastEmbedByCollectionMs[name] = at;
|
|
2854
2861
|
}
|
|
2855
2862
|
globalState.lastGlobalEmbedRunAtMs = at;
|
|
2863
|
+
// A successful embed changes vector searchability, so cached pre-embed
|
|
2864
|
+
// bundles may now be stale. Clear at this single success point (#1904).
|
|
2865
|
+
clearQmdResultCaches();
|
|
2856
2866
|
log.debug(`QMD embed completed for collection=${name}`);
|
|
2857
2867
|
} catch (err) {
|
|
2858
2868
|
let failure: unknown = err;
|
|
@@ -2869,6 +2879,8 @@ export class QmdClient implements SearchBackend {
|
|
|
2869
2879
|
}
|
|
2870
2880
|
globalState.lastGlobalEmbedRunAtMs = recoveredAt;
|
|
2871
2881
|
globalState.lastGlobalEmbedFailAtMs = null;
|
|
2882
|
+
// Recovery also changed vector searchability — clear cached bundles.
|
|
2883
|
+
clearQmdResultCaches();
|
|
2872
2884
|
log.warn(`QMD embed for collection ${name} recovered by forcing a full vector rebuild`);
|
|
2873
2885
|
return;
|
|
2874
2886
|
} catch (retryErr) {
|
package/src/search/port.ts
CHANGED
|
@@ -119,6 +119,17 @@ export interface SearchBackend {
|
|
|
119
119
|
|
|
120
120
|
// ── Maintenance ──
|
|
121
121
|
update(execution?: SearchExecutionOptions): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Wall-clock ms of the most recent SUCCESSFUL index refresh, or null when the
|
|
124
|
+
* backend has never run one. Ordinary update() is fail-open: it returns
|
|
125
|
+
* silently (without throwing or advancing this timestamp) when the backend is
|
|
126
|
+
* unavailable or the call is suppressed by a min-interval / failure backoff.
|
|
127
|
+
* Callers that must know whether update() actually indexed — so they can
|
|
128
|
+
* invalidate dependent caches only on a real refresh — snapshot this before
|
|
129
|
+
* the call and treat the backend as refreshed iff the value advanced. Optional
|
|
130
|
+
* because not every backend tracks it; absent means "assume refreshed".
|
|
131
|
+
*/
|
|
132
|
+
readonly lastUpdateRanAtMs?: number | null;
|
|
122
133
|
/**
|
|
123
134
|
* Optional strict refresh used by callers that must know whether the backend
|
|
124
135
|
* was actually refreshed before writing success markers. Ordinary update
|
package/src/storage.ts
CHANGED
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
getCachedMemories,
|
|
34
34
|
invalidateAllForDir,
|
|
35
35
|
invalidateDerivedAndGlobalForDir,
|
|
36
|
+
invalidateForScope,
|
|
37
|
+
invalidateForScopeExceptHot,
|
|
36
38
|
setCachedEntities,
|
|
37
39
|
setCachedMemories,
|
|
38
40
|
updateCacheOnDelete,
|
|
@@ -2385,6 +2387,17 @@ export class StorageManager {
|
|
|
2385
2387
|
*/
|
|
2386
2388
|
private static hotMemoriesCacheProcessDefaultSeeded = false;
|
|
2387
2389
|
|
|
2390
|
+
/**
|
|
2391
|
+
* Per-memory-directory gate for scope-aware cache invalidation (issue #1904).
|
|
2392
|
+
* Registered from config by the orchestrator via
|
|
2393
|
+
* setScopedCacheInvalidationDefault() so every StorageManager built over a
|
|
2394
|
+
* memory dir — including ephemeral recall sub-stage instances — honors the
|
|
2395
|
+
* operator's setting. Unregistered dirs default to `true` (scoped on). Set
|
|
2396
|
+
* `false` to restore the pre-#1904 full-clear-per-write behavior (rollback
|
|
2397
|
+
* lever). Read once per write via isScopedCacheInvalidationEnabled().
|
|
2398
|
+
*/
|
|
2399
|
+
private static readonly scopedCacheInvalidationByDir = new Map<string, boolean>();
|
|
2400
|
+
|
|
2388
2401
|
// Module-level maps for readAllMemories() keyed by base directory, shared
|
|
2389
2402
|
// across all StorageManager instances (static) so concurrent callers over
|
|
2390
2403
|
// the same dir cooperate.
|
|
@@ -2752,6 +2765,15 @@ export class StorageManager {
|
|
|
2752
2765
|
}
|
|
2753
2766
|
}
|
|
2754
2767
|
|
|
2768
|
+
/** Register the operator's scope-aware cache invalidation gate for a memory
|
|
2769
|
+
* dir (issue #1904). The orchestrator/access layer calls this with
|
|
2770
|
+
* the operator's scopedCacheInvalidationEnabled flag so the setting reaches every
|
|
2771
|
+
* StorageManager built over the dir, including ephemeral recall-sub-stage
|
|
2772
|
+
* instances. Only an explicit `false` disables; `undefined` leaves it on. */
|
|
2773
|
+
static setScopedCacheInvalidationDefault(memoryDir: string, enabled: boolean | undefined): void {
|
|
2774
|
+
StorageManager.scopedCacheInvalidationByDir.set(memoryDir, enabled !== false);
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2755
2777
|
/**
|
|
2756
2778
|
* The LIVE class object of this instance (issue #1809 review of the
|
|
2757
2779
|
* storage decomposition): extracted store modules must read/write the
|
|
@@ -4110,7 +4132,7 @@ export class StorageManager {
|
|
|
4110
4132
|
|
|
4111
4133
|
await this.snapshotBeforeWrite(filePath, "write");
|
|
4112
4134
|
await this.writeStorageSecureFile(filePath, fileContent);
|
|
4113
|
-
await this.patchHotMemoriesCache({ addedPath: filePath });
|
|
4135
|
+
await this.patchHotMemoriesCache({ addedPath: filePath }, "memory-create");
|
|
4114
4136
|
await this.appendGeneratedMemoryLifecycleEventFailOpen("storage.writeMemory", {
|
|
4115
4137
|
memoryId: id,
|
|
4116
4138
|
eventType: "created",
|
|
@@ -4559,6 +4581,10 @@ export class StorageManager {
|
|
|
4559
4581
|
StorageManager.hotMemoriesCacheDefault = true;
|
|
4560
4582
|
StorageManager.hotMemoriesCacheTtlMs = 60_000;
|
|
4561
4583
|
StorageManager.hotMemoriesCacheProcessDefaultSeeded = false;
|
|
4584
|
+
// Reset the #1904 scope-invalidation gate so a legacy-mode (=false) test
|
|
4585
|
+
// dir cannot leak its setting into a later test constructing over a reused
|
|
4586
|
+
// temp path.
|
|
4587
|
+
StorageManager.scopedCacheInvalidationByDir.clear();
|
|
4562
4588
|
}
|
|
4563
4589
|
|
|
4564
4590
|
/** Cancel any in-flight concurrent read so the next readAllMemories()
|
|
@@ -4579,13 +4605,21 @@ export class StorageManager {
|
|
|
4579
4605
|
// corpus sentinel too so PEER processes rescan instead of serving a warm
|
|
4580
4606
|
// pre-mutation corpus entry (issue #1902 cross-process coherence).
|
|
4581
4607
|
this.bumpMemoryCorpusVersion();
|
|
4582
|
-
// Invalidation chokepoint (issue #1535):
|
|
4583
|
-
//
|
|
4584
|
-
//
|
|
4585
|
-
//
|
|
4586
|
-
//
|
|
4587
|
-
//
|
|
4588
|
-
|
|
4608
|
+
// Invalidation chokepoint (issue #1535 / #1904): evict the layers a
|
|
4609
|
+
// memory-mutate can affect — hot, archive, derived episode/rule views, and
|
|
4610
|
+
// both QMD result caches (qmdSearchCache and qmdRecallCache). Before the QMD
|
|
4611
|
+
// caches were invalidated on mutations, recall served pre-edit bundles for
|
|
4612
|
+
// the remainder of its fresh/stale TTL window. The `entities` layer is NOT
|
|
4613
|
+
// in memory-mutate scope: these funnel callers (update/frontmatter/move/
|
|
4614
|
+
// archive/invalidate/bulk/offline-sync) never rewrite entity files, and the
|
|
4615
|
+
// ones that touch entity-derived state additionally bump the status version
|
|
4616
|
+
// (which does the full clear). scopedCacheInvalidationEnabled=false restores
|
|
4617
|
+
// the pre-#1904 full clear of every layer (rollback lever).
|
|
4618
|
+
if (StorageManager.scopedCacheInvalidationByDir.get(this.baseDir) ?? true) {
|
|
4619
|
+
invalidateForScope(this.baseDir, "memory-mutate");
|
|
4620
|
+
} else {
|
|
4621
|
+
invalidateAllForDir(this.baseDir);
|
|
4622
|
+
}
|
|
4589
4623
|
// Issue #1579 — tombstone store is a cache layer too (rule 25: clear ALL
|
|
4590
4624
|
// cache layers). A tombstone append from another path (supersession /
|
|
4591
4625
|
// correction) must be visible to the next writeMemory lookup on this
|
|
@@ -4614,7 +4648,10 @@ export class StorageManager {
|
|
|
4614
4648
|
* coherence is preserved. Bulk/ambiguous mutations keep the wholesale
|
|
4615
4649
|
* invalidateAllMemoriesCache() drop instead (issue #1902 Step 5).
|
|
4616
4650
|
*/
|
|
4617
|
-
private async patchHotMemoriesCache(
|
|
4651
|
+
private async patchHotMemoriesCache(
|
|
4652
|
+
opts: { addedPath?: string; removedPath?: string },
|
|
4653
|
+
scope: "memory-create" | "memory-mutate" = "memory-mutate",
|
|
4654
|
+
): Promise<void> {
|
|
4618
4655
|
const prevVersion = this.getMemoryCorpusVersion();
|
|
4619
4656
|
// Snapshot the key identity once (issue #1902, Codex Medium): a mid-await
|
|
4620
4657
|
// setSecureStoreKey change would otherwise let the post-await patch/re-key
|
|
@@ -4684,9 +4721,19 @@ export class StorageManager {
|
|
|
4684
4721
|
const patched = getCachedMemories(this.baseDir, prevVersion, keyId);
|
|
4685
4722
|
if (patched) setCachedMemories(this.baseDir, patched, produced, keyId, this.hotCacheTtlMs());
|
|
4686
4723
|
}
|
|
4687
|
-
// Evict
|
|
4688
|
-
// to be version-rejected) above, not dropped here.
|
|
4689
|
-
|
|
4724
|
+
// Evict the non-hot layers; the hot layer is patched (or intentionally left
|
|
4725
|
+
// to be version-rejected) above, not dropped here. Scope-aware (issue #1904):
|
|
4726
|
+
// a `memory-create` evicts ONLY the derived episode/rule views, keeping the
|
|
4727
|
+
// global QMD result caches and the version-keyed entity cache warm (a create
|
|
4728
|
+
// adds a doc that is not yet in the QMD index and changes no existing doc's
|
|
4729
|
+
// recall visibility). A `memory-mutate` (or scoped-off rollback) still evicts
|
|
4730
|
+
// the derived + global QMD views so a superseded/edited memory cannot resurface
|
|
4731
|
+
// from a stale recall bundle (issue #1535 correctness contract).
|
|
4732
|
+
if (scope === "memory-create" && (StorageManager.scopedCacheInvalidationByDir.get(this.baseDir) ?? true)) {
|
|
4733
|
+
invalidateForScopeExceptHot(this.baseDir, "memory-create");
|
|
4734
|
+
} else {
|
|
4735
|
+
invalidateDerivedAndGlobalForDir(this.baseDir);
|
|
4736
|
+
}
|
|
4690
4737
|
if (this.tombstoneStore) {
|
|
4691
4738
|
this.tombstoneStore.invalidate();
|
|
4692
4739
|
this.tombstoneStore = null;
|
|
@@ -6648,7 +6695,7 @@ export class StorageManager {
|
|
|
6648
6695
|
await this.writeStorageSecureFile(filePath, fileContent);
|
|
6649
6696
|
// Keep the version-keyed hot-memories cache coherent with the new chunk
|
|
6650
6697
|
// file (issue #1902) — same single-file patch path writeMemory uses.
|
|
6651
|
-
await this.patchHotMemoriesCache({ addedPath: filePath });
|
|
6698
|
+
await this.patchHotMemoriesCache({ addedPath: filePath }, "memory-create");
|
|
6652
6699
|
log.debug(`wrote chunk ${id} (${chunkIndex + 1}/${chunkTotal}) to ${filePath}`);
|
|
6653
6700
|
return id;
|
|
6654
6701
|
}
|
package/src/types.ts
CHANGED
|
@@ -1054,6 +1054,15 @@ export interface PluginConfig {
|
|
|
1054
1054
|
* pure-daemon deployments with no external edits).
|
|
1055
1055
|
*/
|
|
1056
1056
|
hotMemoriesCacheTtlMs: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* Scope-aware cache invalidation (issue #1904). When true (default), a memory
|
|
1059
|
+
* write evicts only the cache layers it can actually affect — a plain fact
|
|
1060
|
+
* `create` no longer nukes the global QMD result caches or the version-keyed
|
|
1061
|
+
* entity cache, so continuous extraction stops keeping every cache
|
|
1062
|
+
* permanently cold. Set false to restore the pre-#1904 behavior of clearing
|
|
1063
|
+
* every layer on every write (rollback lever; no featureset change).
|
|
1064
|
+
*/
|
|
1065
|
+
scopedCacheInvalidationEnabled: boolean;
|
|
1057
1066
|
// Unified TrustScore recall stage (issue #1577). Combines memory-worth,
|
|
1058
1067
|
// provenance, faithfulness, corroboration, contradiction, feedback, recency,
|
|
1059
1068
|
// and optional domain calibration into one [0,1] trust score applied as a
|
|
@@ -1595,6 +1604,12 @@ export interface PluginConfig {
|
|
|
1595
1604
|
localLlmRetryBackoffMs: number;
|
|
1596
1605
|
localLlm400TripThreshold: number;
|
|
1597
1606
|
localLlm400CooldownMs: number;
|
|
1607
|
+
/** Ollama-backend thinking suppression: `reasoning_effort` value injected on
|
|
1608
|
+
* `/v1/chat/completions` for THINKING_SUPPRESSED_OPERATIONS ("none" | "low" |
|
|
1609
|
+
* "medium" | "high" | "max"; "" disables injection). Ollama ignores
|
|
1610
|
+
* `chat_template_kwargs`, so this is the only think-off dialect it honors.
|
|
1611
|
+
* Issue #1996. */
|
|
1612
|
+
localLlmReasoningEffort: string;
|
|
1598
1613
|
// Extraction retry/backoff + circuit breaker (extraction hot-loop hardening)
|
|
1599
1614
|
/** Master gate. When false, restores pre-change behavior (extractor called on every triggered observe; no gate). */
|
|
1600
1615
|
extractionRetryEnabled: boolean;
|
|
@@ -1987,6 +2002,12 @@ export interface PluginConfig {
|
|
|
1987
2002
|
tagRecallMaxMatches: number;
|
|
1988
2003
|
// v8.2 multi-graph memory (PR 18)
|
|
1989
2004
|
multiGraphMemoryEnabled: boolean;
|
|
2005
|
+
// Incremental GraphIndex edge cache (issue #1904). When true (default), a
|
|
2006
|
+
// single-writer edge append is pushed into the warm edge cache in place
|
|
2007
|
+
// (revalidated by file size for cross-process coherence) instead of nulling
|
|
2008
|
+
// the 6 MB / 30k-edge cache and re-reading + re-parsing it (2-4 s). Set false
|
|
2009
|
+
// to restore the pre-#1904 behavior of nulling the edge cache on every write.
|
|
2010
|
+
graphEdgeCacheIncrementalEnabled: boolean;
|
|
1990
2011
|
// v8.2 PR 19A: graph recall planner gating
|
|
1991
2012
|
graphRecallEnabled: boolean;
|
|
1992
2013
|
graphRecallMaxExpansions: number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/namespaces/storage.ts"],"sourcesContent":["import { resolveNamespaceCapabilities } from \"../capabilities.js\";\nimport path from \"node:path\";\nimport { access, lstat, readdir } from \"node:fs/promises\";\nimport { isSafeRouteNamespace } from \"../routing/engine.js\";\nimport { StorageManager } from \"../storage.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport { ALL_CATEGORY_DIRS } from \"../utils/category-dir.js\";\nimport { namespaceIdentityToken, normalizeNamespaceIdentity } from \"./identity.js\";\nimport type { NamespaceCatalog } from \"./catalog.js\";\nimport { MutationSerializer } from \"../utils/serialize-mutations.js\";\n\nasync function exists(p: string): Promise<boolean> {\n try {\n await access(p);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function hasStoredEntries(p: string): Promise<boolean> {\n try {\n const entry = await lstat(p);\n if (entry.isSymbolicLink()) return true;\n if (!entry.isDirectory()) return true;\n const children = await readdir(p, { withFileTypes: true });\n for (const child of children) {\n const childPath = path.join(p, child.name);\n if (child.isSymbolicLink() || child.isFile()) return true;\n if (child.isDirectory() && (await hasStoredEntries(childPath))) return true;\n }\n return false;\n } catch {\n return false;\n }\n}\n\n// Build a per-namespace directory under `<memoryDir>/namespaces` and assert the\n// resolved path stays inside that base. Namespace identifiers can originate from\n// operator config (config.defaultNamespace) and request-derived routing, so this\n// containment check prevents directory traversal (CodeQL js/path-injection).\n// For safe segments this returns exactly `path.join(base, segment)`, so there is\n// no behavioral change for valid namespaces.\nfunction resolveNamespaceDir(memoryDir: string, segment: string): string {\n // Mirror isSafeRouteNamespace's separator/parent-ref rejection (without its\n // 64-char cap, so identity tokens still pass). Rejecting separators and \"..\"\n // up front keeps the value a single contained child of <memoryDir>/namespaces.\n if (\n segment.length === 0 ||\n segment.includes(\"/\") ||\n segment.includes(\"\\\\\") ||\n segment.includes(\"..\") ||\n path.isAbsolute(segment)\n ) {\n throw new Error(`unsafe namespace path segment: ${segment}`);\n }\n return path.join(memoryDir, \"namespaces\", segment);\n}\n\nconst LEGACY_NAMESPACE_CONTENT_CHILDREN = [\n ...ALL_CATEGORY_DIRS,\n \"entities\",\n \"artifacts\",\n \"identity\",\n \"config\",\n \"summaries\",\n \"profile.md\",\n] as const;\n\nconst LEGACY_NAMESPACE_RUNTIME_CHILDREN = [\"state\"] as const;\n\nasync function hasAnyLegacyData(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await hasStoredEntries(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\nasync function hasAnyNamespaceStorageMarker(\n rootDir: string,\n options: { includeRuntimeState?: boolean } = {},\n): Promise<boolean> {\n const children = options.includeRuntimeState === true\n ? [...LEGACY_NAMESPACE_CONTENT_CHILDREN, ...LEGACY_NAMESPACE_RUNTIME_CHILDREN]\n : LEGACY_NAMESPACE_CONTENT_CHILDREN;\n for (const child of children) {\n if (await exists(path.join(rootDir, child))) return true;\n }\n return false;\n}\n\n/**\n * Storage routing for namespaces.\n *\n * Compatibility note:\n * - When namespaces are enabled, existing raw namespace roots are preserved.\n * New namespace roots use tokenized names under `memoryDir/namespaces/<token>`.\n * - The default namespace continues to use the legacy `memoryDir` root unless the caller\n * has created `memoryDir/namespaces/<defaultNamespace>` (in which case we use that).\n *\n * This avoids surprising \"lost memories\" when an install flips namespaces on without\n * migrating existing data.\n */\n/**\n * Optional hooks for the storage router. `onResolve` fires whenever a namespace's\n * storage is resolved/created, so a downstream consumer (e.g. the namespace\n * catalog, issue #1499) can register the namespace. The hook MUST NOT throw into\n * the router; the router invokes it defensively and a hook failure never affects\n * storage resolution.\n *\n * The hook MAY return (or resolve to) a boolean indicating whether the\n * registration actually PERSISTED (round 6, codex P2 — NEFoX). When it resolves\n * to `false` (a dropped/no-op registration), the router does NOT mark the\n * (namespace, storageDir) pair as notified, so the next resolve RETRIES it\n * instead of suppressing it forever. A `void`/`undefined` result is treated as\n * success (legacy hooks).\n */\nexport interface NamespaceStorageRouterHooks {\n onResolve?: (\n namespace: string,\n storageDir: string,\n ) => void | boolean | Promise<void | boolean>;\n}\n\n/**\n * Resolve the runtime storage root for the configured DEFAULT namespace.\n *\n * Shared between the live router (`NamespaceStorageRouter.defaultNamespaceRoot`)\n * and the rebuildable catalog (`NamespaceCatalog.rebuildFromDisk`) so the two\n * can never diverge (CLAUDE.md rule #22/#42 — read & write paths resolve through\n * the same logic). The contract is: while legacy memory data still lives\n * directly under `memoryDir`, the default root stays `memoryDir`; only once the\n * legacy root is empty and a `namespaces/<default|token>` dir holds data does\n * the default migrate into that tokenized/legacy-named dir.\n */\nexport async function resolveDefaultNamespaceRoot(config: PluginConfig): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) {\n return config.memoryDir;\n }\n\n // Build the legacy default root from the NORMALIZED (trimmed) name so a\n // whitespace-padded `defaultNamespace` still finds the live `namespaces/default`\n // root (NIabe). `storageFor()` classifies the trimmed value as the default, and\n // the on-disk legacy dir is created under the trimmed name; using the raw spaced\n // name here would look for `namespaces/<spaced>` and miss the real root, falling\n // back to memoryDir/tokenized. `namespaceIdentityToken` already normalizes\n // internally, so the tokenized path is unaffected.\n const defaultIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n const legacyNsDir = resolveNamespaceDir(config.memoryDir, defaultIdentity);\n const tokenizedNsDir = resolveNamespaceDir(\n config.memoryDir,\n namespaceIdentityToken(config.defaultNamespace),\n );\n const tokenizedHasData =\n (await exists(tokenizedNsDir)) &&\n (await hasAnyNamespaceStorageMarker(tokenizedNsDir, { includeRuntimeState: true }));\n const nsDir = tokenizedHasData\n ? tokenizedNsDir\n : (await exists(legacyNsDir))\n ? legacyNsDir\n : tokenizedNsDir;\n return (await exists(nsDir)) && !(await hasAnyLegacyData(config.memoryDir))\n ? nsDir\n : config.memoryDir;\n}\n\n/**\n * Resolve the runtime storage root for ANY namespace exactly as the live router\n * would (`NamespaceStorageRouter.namespaceRoot`). Shared so the rebuildable\n * catalog records the SAME on-disk root the router routes to — a recall/read\n * touch must not guess `namespaces/<token>` when the router actually serves a\n * legacy raw-name dir or a migrated default root (CLAUDE.md rule #22/#42; round\n * 4, cursor Medium). The default namespace delegates to `resolveDefaultNamespaceRoot`;\n * every other namespace prefers the tokenized root when it has a storage marker,\n * else a legacy raw-name dir when present, else the tokenized root.\n */\nexport async function resolveNamespaceStorageRoot(\n config: PluginConfig,\n namespace: string,\n): Promise<string> {\n if (!resolveNamespaceCapabilities(config).namespaces) return config.memoryDir;\n // Compare on NORMALIZED identity so a whitespace-padded configured default name\n // still routes to the default root rather than a tokenized non-default dir\n // (NH-FH). The catalog keys records by the same normalized identity.\n if (normalizeNamespaceIdentity(namespace) === normalizeNamespaceIdentity(config.defaultNamespace)) {\n return resolveDefaultNamespaceRoot(config);\n }\n const legacyRoot = resolveNamespaceDir(config.memoryDir, namespace);\n const tokenizedRoot = resolveNamespaceDir(config.memoryDir, namespaceIdentityToken(namespace));\n if (\n (await exists(tokenizedRoot)) &&\n (await hasAnyNamespaceStorageMarker(tokenizedRoot, { includeRuntimeState: true }))\n ) {\n return tokenizedRoot;\n }\n return (await exists(legacyRoot)) ? legacyRoot : tokenizedRoot;\n}\n\nexport class NamespaceStorageRouter {\n private readonly cache = new Map<string, StorageManager>();\n private defaultNsRootResolved: string | null = null;\n // Dedup the resolve hook (round 6, cursor Medium — NCNL2). Recall/extraction\n // call `storageFor` repeatedly; firing `onResolve` (→ catalog loadCompacted +\n // append) on every cache hit grows `namespaces.jsonl` without bound between\n // rebuilds. We fire the hook only when the (namespace, storageDir) pair is new\n // or its dir changed, so a steady-state cache hit is a no-op for the catalog.\n private readonly notifiedResolved = new Map<string, string>();\n // Instance-scoped serializer for the resolve hook (issue #1524 adoption).\n // Replaces the bespoke `inFlightResolved` marker-then-clear pattern: the\n // serializer's per-key chain strictly orders concurrent notifications for the\n // SAME namespace, and the task re-checks `notifiedResolved` once it runs, so a\n // burst of cache hits before the first hook settles collapses to a single\n // hook invocation (the once-per-namespace intent). Recovery is preserved —\n // one rejected hook never poisons subsequent notifications for that key.\n private readonly resolveSerializer = new MutationSerializer();\n // (namespace, storageDir) pairs whose resolve hook is currently pending. Set SYNCHRONOUSLY in\n // notifyResolved (before queueing) so a burst of concurrent storageFor()\n // cache hits collapses onto the one in-flight hook instead of each enqueuing\n // its own task. Cleared when the queued hook settles. Without this, a dropped\n // hook (returns false on a rebuild-lock timeout) leaves notifiedResolved\n // unset, so every queued sibling task would re-run the hook — N serial lock\n // waits (cursor Medium 06f58a7c, codex P2).\n private readonly inFlightResolveHooks = new Set<string>();\n // Tracks every in-flight resolve-hook promise so callers can deterministically\n // await the fire-and-forget registrations that `storageFor()` kicks off (see\n // `whenResolveHooksSettled`). Entries are removed as each hook settles, so the\n // set holds at most one promise per concurrently-resolving namespace.\n private readonly pendingResolveHooks = new Set<Promise<unknown>>();\n // Pending post-write catalog touch promises (#1522). Like pendingResolveHooks,\n // lets tests await fire-and-forget write touches deterministically.\n private readonly pendingWriteTouches = new Set<Promise<unknown>>();\n\n // Normalized (trimmed) default namespace identity (NH-FH). `storageFor`\n // normalizes its input, so default-namespace branches must compare against the\n // normalized config default too — otherwise a whitespace-padded configured\n // default name routes the default namespace to a tokenized non-default root.\n private readonly defaultNamespaceIdentity: string;\n\n constructor(\n private readonly config: PluginConfig,\n private readonly hooks: NamespaceStorageRouterHooks = {},\n /** Catalog reference for post-write/read touches (issue #1522 chokepoint). */\n private readonly catalog?: NamespaceCatalog,\n ) {\n this.defaultNamespaceIdentity = normalizeNamespaceIdentity(config.defaultNamespace);\n }\n\n private async defaultNamespaceRoot(): Promise<string> {\n this.defaultNsRootResolved = await resolveDefaultNamespaceRoot(this.config);\n return this.defaultNsRootResolved;\n }\n\n private async namespaceRoot(namespace: string): Promise<string> {\n // NOTE: only used after defaultNamespaceRoot() resolution.\n if (!resolveNamespaceCapabilities(this.config).namespaces) return this.config.memoryDir;\n if (normalizeNamespaceIdentity(namespace) === this.defaultNamespaceIdentity) {\n return this.defaultNsRootResolved ?? this.config.memoryDir;\n }\n return resolveNamespaceStorageRoot(this.config, namespace);\n }\n\n async storageFor(namespace: string): Promise<StorageManager> {\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n if (ns !== this.defaultNamespaceIdentity && !isSafeRouteNamespace(ns)) {\n throw new Error(`unsafe namespace: ${ns}`);\n }\n // Even when the default namespace is exempt from the check above, every\n // on-disk path is built through resolveNamespaceDir(), which rejects\n // traversal segments — so an unsafe configured default still cannot escape\n // <memoryDir>/namespaces (CodeQL js/path-injection).\n\n let root: string;\n if (ns === this.defaultNamespaceIdentity) {\n root = await this.defaultNamespaceRoot();\n const cached = this.cache.get(ns);\n if (cached && cached.dir === root) {\n this.notifyResolved(ns, root);\n return cached;\n }\n } else {\n const cached = this.cache.get(ns);\n root = await this.namespaceRoot(ns);\n if (cached && cached.dir === root) {\n this.notifyResolved(ns, root);\n return cached;\n }\n }\n\n // Pass the hot-memories cache gate explicitly (issue #1902, Codex P2): a\n // per-namespace child root is never registered in the per-dir default map,\n // so without this it would fall back to the process-wide default and ignore\n // THIS daemon's hotMemoriesCacheEnabled config. Threading it from config\n // keeps every namespace storage aligned with its owning orchestrator.\n const sm = new StorageManager(\n root,\n this.config.entitySchemas,\n this.config.hotMemoriesCacheEnabled,\n );\n // Register this child root's gate AND TTL in the per-dir maps (issue #1902,\n // Codex P2). The constructor override above fixes the child's own gate, but\n // its TTL is resolved via the per-dir map (hotCacheTtlMs); an unregistered\n // child root would fall back to the last process-wide TTL and could inherit\n // another daemon's value. Registering keyed by root keeps both per-dir.\n StorageManager.setHotMemoriesCacheDefault(\n root,\n this.config.hotMemoriesCacheEnabled,\n this.config.hotMemoriesCacheTtlMs,\n );\n // Propagate the inline-attribution template so that router-created storages\n // (used by extraction and shared-promotion paths) strip citations consistently,\n // matching the behaviour of the primary this.storage instance in the orchestrator.\n sm.citationTemplate = this.config.inlineSourceAttributionFormat;\n // #1522: install the post-write catalog touch at the chokepoint — every\n // successful write on this StorageManager records the namespace touch.\n this.bindCatalogWriteHook(sm, ns);\n // #1579: apply the tombstone non-resurrection config so every namespace\n // storage enforces the invariant at its own writeMemory chokepoint.\n this.applyTombstonesConfig(sm, ns);\n this.cache.set(ns, sm);\n this.notifyResolved(ns, root);\n return sm;\n }\n\n /**\n * Fire the resolve hook defensively. A hook failure (e.g. a catalog write\n * error) MUST NOT crash storage resolution — see CLAUDE.md gotcha #13.\n *\n * Issue #1524 adoption: hook invocations for the SAME namespace are now\n * strictly ordered through the shared `MutationSerializer` rather than the\n * bespoke `inFlightResolved` marker-then-clear pattern. The serializer\n * guarantees one in-flight hook per namespace; a concurrent burst of\n * `storageFor()` cache hits collapses to a single hook invocation because\n * each queued task re-checks `notifiedResolved` before invoking the hook. A\n * dropped (`false`) or rejected hook leaves `notifiedResolved` unset so the\n * next `storageFor()` retries — the serializer recovers from the rejection,\n * so a failed hook never poisons later notifications.\n */\n private notifyResolved(namespace: string, storageDir: string): void {\n const hook = this.hooks.onResolve;\n if (!hook) return;\n // Permanent dedup: skip once we've SUCCESSFULLY notified this exact\n // (namespace, storageDir). A changed dir (rare: migration/realignment)\n // still re-fires once. The mark is set ONLY AFTER the hook succeeds, so a\n // dropped registration (e.g. rebuild-lock timeout) is RETRIED on the next\n // cache hit instead of being suppressed forever (round 6, cursor Medium —\n // ND3EJ).\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n // In-flight dedup (cursor Medium 06f58a7c, codex P2): if a hook for THIS\n // namespace is already pending, collapse this call onto it instead of\n // enqueueing another task. The serializer strictly orders queued tasks, but\n // ordering alone is not enough — when the first hook returns `false`\n // (dropped touch, e.g. rebuild-lock timeout), `notifiedResolved` stays\n // unset, so each queued sibling task would pass its re-check and re-run the\n // hook. With the real catalog hook each retry can spend the full lock wait,\n // so N cache hits during a rebuild leave N serial background lock attempts.\n // Collapsing here means at most ONE hook runs per in-flight registration;\n // its result (set `notifiedResolved` on success, leave unset on drop)\n // decides whether a LATER `storageFor()` retries — collapsing loses\n // nothing because the drop is already retried on the next cache hit.\n // Keyed by the composite (namespace, storageDir) so a CHANGED dir\n // (migration/realignment) for the same namespace still gets its own hook —\n // it is NOT collapsed onto the old dir's pending registration (cursor\n // Medium, codex P2).\n const inFlightKey = namespace + \"\\u0000\" + storageDir;\n if (this.inFlightResolveHooks.has(inFlightKey)) return;\n this.inFlightResolveHooks.add(inFlightKey);\n // Queue through the serializer. Concurrent calls for the same namespace\n // strictly order here; the 2nd call's task runs only after the 1st's hook\n // settles, by which point `notifiedResolved` is either set (no-op) or still\n // unset (retry). The returned promise is tracked for\n // `whenResolveHooksSettled()`. Rejections from the task body are caught so\n // they never reach the caller (best-effort hook contract); the serializer's\n // recovered tail still lets subsequent notifications run.\n const task = async (): Promise<void> => {\n // Re-check after queueing: a prior task in this same chain may have just\n // marked the pair as notified.\n if (this.notifiedResolved.get(namespace) === storageDir) return;\n try {\n // Hook may be sync or async; Promise.resolve normalizes both. A result\n // of `false` means the registration was dropped/no-op (e.g. rebuild-lock\n // timeout) — leave notifiedResolved UNSET so the next storageFor retries\n // (round 6, codex P2 — NEFoX). `void`/`undefined` is success for legacy\n // hooks. A rejection leaves notifiedResolved unset for the same reason.\n const persisted = await Promise.resolve(hook(namespace, storageDir));\n if (persisted !== false) {\n this.notifiedResolved.set(namespace, storageDir);\n }\n } catch {\n // Best-effort: a hook failure MUST NOT crash storage resolution. Leave\n // notifiedResolved unset so a later storageFor retries the registration.\n }\n };\n const queued = this.resolveSerializer.serialize(namespace, task);\n this.pendingResolveHooks.add(queued);\n // Clear the in-flight marker when the hook settles so a subsequent\n // storageFor() can retry after a drop, or short-circuit via notifiedResolved\n // after a success.\n const cleanup = (): void => {\n this.inFlightResolveHooks.delete(inFlightKey);\n this.pendingResolveHooks.delete(queued);\n };\n void queued.then(cleanup, cleanup);\n }\n\n /**\n * Install the post-write catalog touch hook on an externally-constructed\n * StorageManager (issue #1522). Used by the orchestrator for the legacy\n * default-namespace storage (`this.storage`) that bypasses the router.\n */\n bindCatalogWriteHook(sm: StorageManager, namespace: string): void {\n // Issue #1903: pure state-file writes only touch the catalog when explicitly\n // opted in. Router-created storages (storageFor) and the legacy default\n // storage both flow through here, so this is the single wiring point.\n sm.touchStateWrites = this.config.namespacesCatalogTouchStateWrites === true;\n sm.onCatalogWrite = () => this.touchCatalogWrite(namespace, sm.dir);\n }\n\n /**\n * Install the tombstone config on an externally-constructed StorageManager\n * (issue #1579). Mirrors `bindCatalogWriteHook` — used for the legacy\n * default-namespace storage that bypasses the router. Router-created\n * storages are wired inline in `storageFor()` via `applyTombstonesConfig`.\n */\n bindTombstonesConfig(\n sm: StorageManager,\n namespace: string,\n config: { enabled: boolean; semanticMatch: boolean; semanticThreshold: number },\n ): void {\n this.tombstonesGlobalConfig = { ...config };\n sm.setTombstonesConfig({ ...config, namespace });\n }\n\n private tombstonesGlobalConfig: {\n enabled: boolean;\n semanticMatch: boolean;\n semanticThreshold: number;\n } = { enabled: false, semanticMatch: false, semanticThreshold: 0.9 };\n\n /**\n * Apply the tombstone config to a router-created StorageManager. Called\n * inline in `storageFor()` so every namespace storage enforces the\n * non-resurrection invariant, namespace-scoped (rule 42).\n */\n private applyTombstonesConfig(sm: StorageManager, namespace: string): void {\n sm.setTombstonesConfig({ ...this.tombstonesGlobalConfig, namespace });\n }\n\n /**\n * Post-write catalog touch (issue #1522 chokepoint). Called by every\n * StorageManager's post-write hook AFTER a successful write. Best-effort\n * and failure-tolerant — a catalog error MUST NOT affect the primary write\n * (gotcha #13, rule #40). Fire-and-forget by design.\n */\n private touchCatalogWrite(namespace: string, storageDir: string): void {\n if (!this.catalog) return;\n const touch = this.catalog\n .markWrite(namespace, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Record a namespace read in the catalog (issue #1522 chokepoint move).\n * Best-effort and failure-tolerant. Used by recall paths so the read touch\n * lives in the storage layer, not at the caller.\n */\n recordRead(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n void this.catalog\n .markRead(ns, { discoveredBy: \"read\", storageDir })\n .catch(() => undefined);\n }\n /**\n * Record a namespace write touch in the catalog (issue #1522). Best-effort\n * and failure-tolerant. Used by consolidation/cleanup passes that may mutate\n * the store via delete-only paths (e.g. entity-file merges, TTL cleanup) so\n * the namespace's lastWriteAt stays fresh even when no explicit write went\n * through the storage chokepoint. This is NOT a substitute for the chokepoint\n * — it's a belt-and-suspenders for paths the chokepoint doesn't cover.\n */\n recordWrite(namespace: string, storageDir?: string): void {\n if (!this.catalog) return;\n const ns = normalizeNamespaceIdentity(namespace || this.config.defaultNamespace);\n const touch = this.catalog\n .markWrite(ns, { discoveredBy: \"write\", storageDir })\n .catch(() => undefined);\n this.pendingWriteTouches.add(touch);\n void touch.then(\n () => { this.pendingWriteTouches.delete(touch); },\n () => { this.pendingWriteTouches.delete(touch); },\n );\n }\n\n /**\n * Resolve once every in-flight post-write catalog touch has settled (#1522).\n * Mirrors `whenResolveHooksSettled()`: the StorageManager's post-write hook\n * fires the catalog touch fire-and-forget, so tests asserting lastWriteAt\n * moved should await this instead of racing a timer.\n */\n async whenWriteTouchesSettled(): Promise<void> {\n // Flush any coalesced (buffered) touches first so their appends join the\n // pending set below — otherwise this could resolve while a buffered touch's\n // lastWriteAt is still unwritten on disk (#1903, Cursor). No-op when\n // coalescing is disabled (window 0) or the catalog is inert.\n await this.catalog?.flushPendingTouches().catch(() => undefined);\n while (this.pendingWriteTouches.size > 0) {\n await Promise.allSettled([...this.pendingWriteTouches]);\n }\n }\n\n /**\n * Resolve once every in-flight `onResolve` registration has settled.\n *\n * `storageFor()` fires the resolve hook fire-and-forget, so its catalog side\n * effect (e.g. `registerResolved(...)`) is not observable the moment\n * `storageFor()` returns. Callers that must act on that side effect — notably\n * tests asserting the catalog was updated — should await this instead of\n * racing a timer. Resolves immediately when no hook is registered or nothing\n * is in flight. The loop re-checks because a settling hook could, in\n * principle, trigger a follow-on resolution.\n */\n async whenResolveHooksSettled(): Promise<void> {\n while (this.pendingResolveHooks.size > 0) {\n await Promise.allSettled([...this.pendingResolveHooks]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,QAAQ,OAAO,eAAe;AASvC,eAAe,OAAO,GAA6B;AACjD,MAAI;AACF,UAAM,OAAO,CAAC;AACd,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,iBAAiB,GAA6B;AAC3D,MAAI;AACF,UAAM,QAAQ,MAAM,MAAM,CAAC;AAC3B,QAAI,MAAM,eAAe,EAAG,QAAO;AACnC,QAAI,C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