@remnic/core 9.50.2 → 9.51.0
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 +13 -11
- package/dist/access-admin-ops-surface.js +41 -39
- package/dist/access-authorization-probe.d.ts +13 -11
- package/dist/access-authorization-probe.js +42 -40
- package/dist/access-boundary.d.ts +13 -11
- package/dist/access-boundary.js +41 -39
- package/dist/access-cli.js +109 -104
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +3 -1
- package/dist/access-extraction-force-flush.d.ts +13 -11
- package/dist/access-extraction-force-flush.js +41 -39
- package/dist/access-health-types.d.ts +3 -1
- package/dist/access-http-lcm-compaction.d.ts +13 -11
- package/dist/access-http-lifecycle-flush.d.ts +13 -11
- package/dist/access-http-offline-stream.d.ts +13 -11
- package/dist/access-http-query.js +41 -39
- package/dist/access-http.d.ts +13 -11
- package/dist/access-http.js +52 -50
- package/dist/access-identity-continuity-surface.d.ts +11 -9
- package/dist/access-identity-continuity-surface.js +41 -39
- package/dist/access-lcm-surface.d.ts +13 -11
- package/dist/access-lcm-surface.js +41 -39
- package/dist/access-mcp.d.ts +13 -11
- package/dist/access-mcp.js +47 -45
- package/dist/access-memory-search-fanout.d.ts +4 -2
- package/dist/{access-namespace-preflight-Dj2QolFE.d.ts → access-namespace-preflight-Ds6CGlCP.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +5 -3
- package/dist/access-namespace-preflight.js +41 -39
- package/dist/access-observe-write-surface.d.ts +13 -11
- package/dist/access-observe-write-surface.js +41 -39
- package/dist/access-offline-manifest.d.ts +11 -9
- package/dist/access-operations-batch.js +43 -41
- package/dist/access-operations.d.ts +13 -11
- package/dist/access-operations.js +46 -44
- package/dist/access-recall-concurrency.d.ts +13 -11
- package/dist/access-recall-concurrency.js +41 -39
- package/dist/access-recall-response.d.ts +13 -11
- package/dist/access-recall-response.js +41 -39
- package/dist/access-recall-surface.d.ts +13 -11
- package/dist/access-recall-surface.js +41 -39
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DesbnTSa.d.ts → access-service-BY0KJ44c.d.ts} +7 -7
- package/dist/access-service-helpers.d.ts +13 -11
- package/dist/access-service.d.ts +13 -11
- package/dist/access-service.js +41 -39
- package/dist/access-surface-catalog.d.ts +13 -11
- package/dist/access-wearables-meetings-surface.d.ts +5 -3
- package/dist/action-confidence.d.ts +3 -1
- package/dist/active-memory-bridge.d.ts +3 -1
- package/dist/active-recall.d.ts +3 -1
- package/dist/active-recall.js +5 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +3 -1
- package/dist/archive-mutation-version.d.ts +9 -0
- package/dist/archive-mutation-version.js +20 -0
- package/dist/artifact-search.d.ts +3 -1
- package/dist/behavior-learner.d.ts +3 -1
- package/dist/behavior-signals.d.ts +3 -1
- package/dist/bootstrap.d.ts +11 -9
- package/dist/briefing.d.ts +4 -2
- package/dist/briefing.js +10 -9
- package/dist/buffer-surprise-report.d.ts +3 -1
- package/dist/buffer-turn-helpers.d.ts +3 -1
- package/dist/buffer.d.ts +4 -2
- package/dist/buffer.js +5 -5
- package/dist/bulk-import/index.d.ts +5 -3
- package/dist/calibration.d.ts +3 -1
- package/dist/capabilities.d.ts +3 -1
- package/dist/{catalog-D-G7RgXR.d.ts → catalog-D3B4RDy1.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +3 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +3 -1
- package/dist/causal-consolidation.js +13 -12
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +4 -2
- package/dist/causal-trajectory-graph.js +2 -1
- package/dist/causal-trajectory-graph.js.map +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-KDG2KTWW.js → chunk-33SV3E43.js} +4 -4
- package/dist/{chunk-2HGUDBRJ.js → chunk-37ZO6LLJ.js} +2 -2
- package/dist/{chunk-QW3WFHKU.js → chunk-45BRYON6.js} +2 -2
- package/dist/{chunk-GZICBRWK.js → chunk-4F6X3RXW.js} +2 -2
- package/dist/{chunk-7BAYBYY5.js → chunk-4PC4PRJE.js} +2 -2
- package/dist/{chunk-VJXY5ZCT.js → chunk-52UKFTUK.js} +2 -2
- package/dist/{chunk-ESG7Z255.js → chunk-5UDMFE3Q.js} +2 -2
- package/dist/{chunk-JPHEOE6Z.js → chunk-6MTSFX7A.js} +15 -15
- package/dist/chunk-6ZN34ISG.js +44 -0
- package/dist/chunk-6ZN34ISG.js.map +1 -0
- package/dist/{chunk-M4MP34AQ.js → chunk-AHZOMHWN.js} +1 -1
- package/dist/{chunk-Z3RHPGSY.js → chunk-AIUBBHSF.js} +3 -3
- package/dist/{chunk-S3AYIQCU.js → chunk-AXIDQG5A.js} +12 -12
- package/dist/{chunk-QN7NTKRC.js → chunk-AZ2QBGYB.js} +1 -1
- package/dist/{chunk-47J4EDGR.js → chunk-AZM4CCAC.js} +8 -8
- package/dist/{chunk-IXXABW5A.js → chunk-BHXYAVUM.js} +11 -5
- package/dist/chunk-BHXYAVUM.js.map +1 -0
- package/dist/{chunk-L2DPF4DF.js → chunk-BIJAWZYW.js} +54 -12
- package/dist/chunk-BIJAWZYW.js.map +1 -0
- package/dist/{chunk-LEJPSMKM.js → chunk-C5QLI33R.js} +3 -3
- package/dist/{chunk-SV3PSA7Y.js → chunk-CV6BBVYV.js} +5 -5
- package/dist/{chunk-V7X767RT.js → chunk-DCZBSE4F.js} +52 -52
- package/dist/chunk-FC67T4E6.js +70 -0
- package/dist/chunk-FC67T4E6.js.map +1 -0
- package/dist/{chunk-7PKFPLLZ.js → chunk-FXTYIA46.js} +2 -2
- package/dist/{chunk-64BHFFKZ.js → chunk-HLYR2TQL.js} +5 -5
- package/dist/{chunk-5C2HNJMO.js → chunk-J5LLX6IL.js} +32 -32
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/{chunk-PLKFO2HJ.js → chunk-JL43BVDE.js} +2 -2
- package/dist/{chunk-2S72LWKX.js → chunk-JYL3BVVZ.js} +2 -2
- package/dist/{chunk-IPLYGWQF.js → chunk-KQAFEZQX.js} +5 -5
- package/dist/chunk-LXY5VVGM.js +61 -0
- package/dist/chunk-LXY5VVGM.js.map +1 -0
- package/dist/{chunk-PYKKWQZ2.js → chunk-M7BXDKPR.js} +6 -6
- package/dist/{chunk-Z54EM5YZ.js → chunk-MAXVH44E.js} +7 -7
- package/dist/{chunk-LYMNZZIM.js → chunk-NIS256NW.js} +2 -2
- package/dist/{chunk-67QG75MJ.js → chunk-NLK2VZYZ.js} +2 -2
- package/dist/{chunk-A4QMKFFO.js → chunk-O5FFBO2M.js} +14 -28
- package/dist/chunk-O5FFBO2M.js.map +1 -0
- package/dist/{chunk-JYIFGGEM.js → chunk-OUKBMQ2O.js} +2 -2
- package/dist/{chunk-75XOWNRS.js → chunk-OYESWJ43.js} +4 -4
- package/dist/{chunk-TS4AJ2GI.js → chunk-PA45XCUD.js} +3 -3
- package/dist/{chunk-BJYET5TX.js → chunk-PRDJMOST.js} +7 -1
- package/dist/chunk-PRDJMOST.js.map +1 -0
- package/dist/{chunk-4MBPIL4V.js → chunk-PUSLMZBQ.js} +2 -2
- package/dist/{chunk-RVO6TCTU.js → chunk-QCECHYZL.js} +6 -6
- package/dist/{chunk-GFIKG4FR.js → chunk-QGR6OVGT.js} +2 -2
- package/dist/{chunk-NSGU76YO.js → chunk-QHFV6VNU.js} +6 -2
- package/dist/chunk-QHFV6VNU.js.map +1 -0
- package/dist/{chunk-PDEKQWDV.js → chunk-QT2FRYI4.js} +18 -2
- package/dist/chunk-QT2FRYI4.js.map +1 -0
- package/dist/{chunk-HNZKVLAN.js → chunk-S354QO4R.js} +2 -2
- package/dist/{chunk-NO37MR45.js → chunk-SOEN6KCF.js} +2 -2
- package/dist/{chunk-FXX6RQYC.js → chunk-TPTECFWR.js} +2 -2
- package/dist/{chunk-GDDGZVFI.js → chunk-UEVLYVNW.js} +2 -2
- package/dist/{chunk-YQ4IQ2GA.js → chunk-UT5BV5OG.js} +2 -2
- package/dist/{chunk-LAQ33B5D.js → chunk-UU3G6GUP.js} +1 -1
- package/dist/chunk-UU3G6GUP.js.map +1 -0
- package/dist/{chunk-LNTUXKBT.js → chunk-UYYW2KPU.js} +2 -2
- package/dist/{chunk-BOFVT6P3.js → chunk-VBHPOWBJ.js} +175 -98
- package/dist/chunk-VBHPOWBJ.js.map +1 -0
- package/dist/{chunk-QSYL5CXK.js → chunk-VKXWK44Q.js} +3 -3
- package/dist/{chunk-KMWYZTIE.js → chunk-VMMQDEN5.js} +2 -2
- package/dist/{chunk-JB6D7EFB.js → chunk-VVG2BOKA.js} +2 -2
- package/dist/chunk-W5BIQOAJ.js +69 -0
- package/dist/chunk-W5BIQOAJ.js.map +1 -0
- package/dist/{chunk-V5H6OJCR.js → chunk-W5XVQFLM.js} +2 -2
- package/dist/{chunk-OIOZ6MOP.js → chunk-W6FNX2LP.js} +2 -2
- package/dist/{chunk-6QPHF6RR.js → chunk-WQM326GS.js} +2 -2
- package/dist/{chunk-TQFHQPWD.js → chunk-XADV5IZ3.js} +8 -8
- package/dist/{chunk-DATDLJAO.js → chunk-XAPMEU3K.js} +2 -2
- package/dist/chunk-XXSOVESA.js +42 -0
- package/dist/chunk-XXSOVESA.js.map +1 -0
- package/dist/{chunk-IK6X5QPO.js → chunk-ZHY5TMJG.js} +1193 -443
- package/dist/chunk-ZHY5TMJG.js.map +1 -0
- package/dist/{chunk-N3LL5NEU.js → chunk-ZMYDYNI4.js} +2 -2
- package/dist/{cli-D4vvtxjY.d.ts → cli-CnOkH9hA.d.ts} +6 -6
- package/dist/cli.d.ts +15 -13
- package/dist/cli.js +74 -70
- package/dist/coding/pre-action-gate.d.ts +3 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +4 -2
- package/dist/compounding/engine.js +10 -9
- package/dist/compounding/preference-consolidator.d.ts +3 -1
- package/dist/compression-optimizer.d.ts +3 -1
- package/dist/config.d.ts +3 -1
- package/dist/config.js +5 -3
- package/dist/connectors/codex-materialize-runner.d.ts +3 -1
- package/dist/connectors/codex-materialize-runner.js +10 -9
- package/dist/connectors/codex-materialize.d.ts +3 -1
- package/dist/connectors/index.d.ts +3 -1
- package/dist/connectors/index.js +10 -9
- package/dist/consolidation-provenance-check.d.ts +4 -2
- package/dist/consolidation-undo.d.ts +4 -2
- package/dist/contradiction/index.d.ts +4 -2
- package/dist/contradiction-config.d.ts +29 -0
- package/dist/contradiction-config.js +12 -0
- package/dist/contradiction-config.js.map +1 -0
- package/dist/converge-config.d.ts +3 -1
- package/dist/convergence-refresh.d.ts +4 -2
- package/dist/convergence-refresh.js +12 -11
- package/dist/conversation-index/backend.d.ts +3 -1
- package/dist/conversation-index/chunker.d.ts +3 -1
- package/dist/conversation-index/faiss-adapter.d.ts +3 -1
- package/dist/conversation-index/indexer.d.ts +3 -1
- package/dist/conversation-index/search.d.ts +3 -1
- package/dist/corpus-watermark.d.ts +3 -1
- package/dist/corpus-watermark.js +21 -20
- package/dist/day-summary.d.ts +3 -1
- package/dist/delinearize.d.ts +3 -1
- package/dist/dependency-propagation-config.d.ts +3 -1
- package/dist/direct-answer-wiring.d.ts +3 -1
- package/dist/direct-answer.d.ts +3 -1
- package/dist/embedding-fallback.d.ts +3 -1
- package/dist/enrichment/index.d.ts +3 -1
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +10 -9
- package/dist/entity-schema.d.ts +3 -1
- package/dist/explicit-capture.d.ts +11 -9
- package/dist/explicit-capture.js +3 -2
- package/dist/external-wiki-access.d.ts +13 -11
- package/dist/external-wiki-access.js +42 -40
- package/dist/external-wiki-collection-registration.d.ts +3 -1
- package/dist/external-wiki-collection.d.ts +3 -1
- package/dist/external-wiki-mcp-tools.d.ts +13 -11
- package/dist/extraction-error-classification.d.ts +3 -1
- package/dist/extraction-faithfulness.d.ts +3 -1
- package/dist/extraction-judge-telemetry.d.ts +3 -1
- package/dist/extraction-judge-training.d.ts +3 -1
- package/dist/extraction-judge.d.ts +3 -1
- package/dist/extraction-liveness.d.ts +3 -1
- package/dist/extraction-normalization.d.ts +3 -1
- package/dist/extraction-prompt.d.ts +3 -1
- package/dist/extraction-source-grounding-rules.d.ts +3 -1
- package/dist/extraction-source-grounding.d.ts +3 -1
- package/dist/extraction.d.ts +3 -1
- package/dist/extraction.js +22 -21
- package/dist/fallback-llm.d.ts +3 -1
- package/dist/graph-444E-DrF.d.ts +349 -0
- package/dist/graph-dashboard-diff.d.ts +4 -2
- package/dist/graph-dashboard-key.d.ts +4 -2
- package/dist/graph-dashboard-parser.d.ts +4 -2
- package/dist/{graph-edge-decay-Z6ENALU2.js → graph-edge-decay-65KMOJWY.js} +4 -3
- package/dist/graph-edge-decay-65KMOJWY.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +4 -2
- package/dist/graph-path-reconstruction.d.ts +10 -0
- package/dist/graph-path-reconstruction.js +12 -0
- package/dist/graph-path-reconstruction.js.map +1 -0
- package/dist/graph-path-scoring-config.d.ts +8 -0
- package/dist/graph-path-scoring-config.js +10 -0
- package/dist/graph-path-scoring-config.js.map +1 -0
- package/dist/graph-path-scoring.d.ts +36 -0
- package/dist/graph-path-scoring.js +11 -0
- package/dist/graph-path-scoring.js.map +1 -0
- package/dist/graph-snapshot.d.ts +4 -2
- package/dist/graph-snapshot.js +3 -2
- package/dist/graph.d.ts +5 -318
- package/dist/graph.js +5 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +3 -1
- package/dist/importers/index.d.ts +3 -1
- package/dist/in-flight-reads.d.ts +3 -1
- package/dist/index.d.ts +22 -20
- package/dist/index.js +149 -144
- package/dist/intent.d.ts +3 -1
- package/dist/lcm/engine.d.ts +3 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +3 -1
- package/dist/lcm/index.js +6 -6
- package/dist/lcm/tools.d.ts +3 -1
- package/dist/lifecycle.d.ts +3 -1
- package/dist/live-connectors-runner.d.ts +3 -1
- package/dist/local-llm.d.ts +3 -1
- package/dist/local-model-endpoint.d.ts +3 -1
- package/dist/maintenance/memory-governance.d.ts +3 -1
- package/dist/maintenance/memory-governance.js +10 -9
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +4 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -9
- package/dist/maintenance/rebuild-memory-projection.d.ts +4 -2
- package/dist/maintenance/rebuild-memory-projection.js +11 -10
- package/dist/{maintenance-ClmUVpGI.d.ts → maintenance-CKwxpdRx.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +13 -11
- package/dist/memory-action-policy.d.ts +3 -1
- package/dist/memory-cache.d.ts +3 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +3 -1
- package/dist/memory-projection-store.d.ts +3 -1
- package/dist/memory-provenance.d.ts +3 -1
- package/dist/memory-snapshot.d.ts +3 -1
- package/dist/memory-worth-outcomes.d.ts +4 -2
- package/dist/models-json.d.ts +3 -1
- package/dist/namespaces/migrate.d.ts +5 -3
- package/dist/namespaces/migrate.js +20 -19
- package/dist/namespaces/principal.d.ts +3 -1
- package/dist/namespaces/search.d.ts +3 -1
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.d.ts +5 -3
- package/dist/namespaces/storage.js +10 -9
- package/dist/native-knowledge.d.ts +3 -1
- package/dist/offline-sync-impression-drain.d.ts +3 -1
- package/dist/operator-doctor-corpus.d.ts +3 -1
- package/dist/operator-doctor-corpus.js +22 -21
- package/dist/operator-doctor-replica.d.ts +3 -1
- package/dist/operator-toolkit.d.ts +6 -4
- package/dist/operator-toolkit.js +33 -29
- package/dist/orchestration/compression-guideline-coordinator.d.ts +4 -2
- package/dist/orchestration/maintenance.d.ts +6 -4
- package/dist/orchestration/maintenance.js +15 -14
- package/dist/{orchestrator-qJ07zI8H.d.ts → orchestrator-BshGam-o.d.ts} +45 -19
- package/dist/orchestrator.d.ts +11 -9
- package/dist/orchestrator.js +109 -104
- package/dist/patterns-cli.d.ts +3 -1
- package/dist/{pipeline-WFCxhHOn.d.ts → pipeline-D21Rs6gW.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +3 -1
- package/dist/proactive-contention.d.ts +3 -1
- package/dist/provenance.d.ts +3 -1
- package/dist/{qmd-5tzkQ44y.d.ts → qmd-Dhle1P4X.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +4 -2
- package/dist/qmd-recall-cache.d.ts +3 -1
- package/dist/qmd.d.ts +4 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-concurrency-config.d.ts +3 -1
- package/dist/recall-disclosure-escalation.d.ts +3 -1
- package/dist/recall-explain-renderer.d.ts +3 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +3 -1
- package/dist/recall-planner-llm.d.ts +3 -1
- package/dist/recall-planner-llm.js +3 -3
- package/dist/recall-state.d.ts +7 -1
- package/dist/recall-state.js +1 -1
- package/dist/recall-tag-filter.d.ts +3 -1
- package/dist/recall-timings.d.ts +3 -1
- package/dist/recall-xray-cli.d.ts +3 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +3 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +7 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +3 -1
- package/dist/reconcile/manifest.d.ts +3 -1
- package/dist/reconcile/plan.d.ts +3 -1
- package/dist/replay/normalizers/chatgpt.d.ts +3 -1
- package/dist/replay/normalizers/claude.d.ts +3 -1
- package/dist/replay/normalizers/openclaw.d.ts +3 -1
- package/dist/replay/normalizers/shared.d.ts +3 -1
- package/dist/replay/runner.d.ts +3 -1
- package/dist/replay/types.d.ts +3 -1
- package/dist/replica-divergence.d.ts +3 -1
- package/dist/replica-peers-config.d.ts +3 -1
- package/dist/resolve-auth-token.d.ts +3 -1
- package/dist/resume-bundles.js +6 -4
- package/dist/retrieval-agents.d.ts +4 -2
- package/dist/retrieval-tiers.d.ts +3 -1
- package/dist/routing/engine.d.ts +3 -1
- package/dist/routing/store.d.ts +3 -1
- package/dist/salvage-envelope.d.ts +3 -1
- package/dist/{scope-profiles--vfXPl3X.d.ts → scope-profiles-NzGPDXLn.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +3 -1
- package/dist/search/factory.d.ts +3 -1
- package/dist/search/factory.js +6 -6
- package/dist/search/index.d.ts +3 -1
- package/dist/search/index.js +12 -12
- package/dist/search/lancedb-backend.d.ts +3 -1
- package/dist/search/meilisearch-backend.d.ts +3 -1
- package/dist/search/noop-backend.d.ts +3 -1
- package/dist/search/orama-backend.d.ts +3 -1
- package/dist/search/port.d.ts +3 -1
- package/dist/search/remote-backend.d.ts +3 -1
- package/dist/{semantic-consolidation-BBDuP9nJ.d.ts → semantic-consolidation-DLDKvyy5.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +4 -2
- package/dist/semantic-consolidation.js +11 -10
- package/dist/semantic-rule-promotion.js +10 -9
- package/dist/semantic-rule-verifier.d.ts +3 -1
- package/dist/semantic-rule-verifier.js +10 -9
- package/dist/{service-B8DtbpCM.d.ts → service-BIgVM7fL.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +3 -1
- package/dist/session-observer-state.d.ts +3 -1
- package/dist/shared-context/manager.d.ts +3 -1
- package/dist/signal.d.ts +3 -1
- package/dist/source-agent-qualifier.d.ts +3 -1
- package/dist/source-agent-qualifier.js +18 -17
- package/dist/{storage-BkYN1RIy.d.ts → storage-CVfGWqCI.d.ts} +7 -6
- package/dist/storage.d.ts +4 -2
- package/dist/storage.js +9 -8
- package/dist/summarizer.d.ts +3 -1
- package/dist/summary-snapshot.d.ts +3 -1
- package/dist/temporal-supersession.d.ts +4 -2
- package/dist/temporal-timeline-recall.d.ts +3 -1
- package/dist/temporal-validity.d.ts +3 -1
- package/dist/threading.d.ts +3 -1
- package/dist/tier-migration.d.ts +4 -2
- package/dist/tier-routing.d.ts +3 -1
- package/dist/topics.d.ts +3 -1
- package/dist/transcript.d.ts +3 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/trust-score-stage.d.ts +3 -1
- package/dist/trust-score.d.ts +3 -1
- package/dist/{types-u2s9j1uD.d.ts → types-CkiDUorT.d.ts} +10 -16
- package/dist/types.d.ts +3 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +3 -1
- package/dist/verified-recall.js +10 -9
- package/dist/write-envelope.d.ts +3 -1
- package/package.json +2 -2
- package/src/archive-mutation-version.ts +59 -0
- package/src/config.test.ts +45 -0
- package/src/config.ts +10 -30
- package/src/contradiction/contradiction.test.ts +86 -1
- package/src/contradiction-config.ts +92 -0
- package/src/graph-path-reconstruction.ts +91 -0
- package/src/graph-path-scoring-config.ts +55 -0
- package/src/graph-path-scoring.test.ts +238 -0
- package/src/graph-path-scoring.ts +77 -0
- package/src/graph.test.ts +225 -5
- package/src/graph.ts +72 -5
- package/src/orchestration/contradiction-linking-coordinator.ts +246 -76
- package/src/orchestration/contradiction-localization.integration.test.ts +1953 -0
- package/src/orchestration/extraction-anchor-snapshot.ts +83 -0
- package/src/orchestration/extraction-persist-deps.ts +8 -2
- package/src/orchestration/extraction-persist.ts +43 -34
- package/src/orchestration/graph-path-state-loader.test.ts +801 -0
- package/src/orchestration/graph-path-state-loader.ts +318 -0
- package/src/orchestration/graph-recall-coordinator.integration.test.ts +1163 -0
- package/src/orchestration/graph-recall-coordinator.ts +206 -29
- package/src/orchestration/graph-recall-seam.ts +19 -0
- package/src/orchestration/recall-internal-deps.ts +7 -13
- package/src/orchestration/recall-internal.ts +5 -0
- package/src/orchestration/recall-introspection.ts +9 -1
- package/src/orchestration/recall-search-pipeline.ts +8 -13
- package/src/orchestration/update-localization.test.ts +784 -0
- package/src/orchestration/update-localization.ts +173 -0
- package/src/orchestrator.ts +19 -18
- package/src/recall-state.test.ts +29 -1
- package/src/recall-state.ts +13 -0
- package/src/recall-xray-renderer.test.ts +45 -0
- package/src/recall-xray-renderer.ts +16 -0
- package/src/recall-xray.ts +13 -0
- package/src/storage/supersession-side-effects.ts +97 -0
- package/src/storage/tombstone-blocked-capture-sync.ts +13 -5
- package/src/storage-contract/cache-coherence.test.ts +299 -0
- package/src/storage.ts +86 -88
- package/src/types.ts +12 -15
- package/dist/chunk-A4QMKFFO.js.map +0 -1
- package/dist/chunk-BJYET5TX.js.map +0 -1
- package/dist/chunk-BOFVT6P3.js.map +0 -1
- package/dist/chunk-IK6X5QPO.js.map +0 -1
- package/dist/chunk-IXXABW5A.js.map +0 -1
- package/dist/chunk-L2DPF4DF.js.map +0 -1
- package/dist/chunk-LAQ33B5D.js.map +0 -1
- package/dist/chunk-NSGU76YO.js.map +0 -1
- package/dist/chunk-PDEKQWDV.js.map +0 -1
- /package/dist/{graph-edge-decay-Z6ENALU2.js.map → archive-mutation-version.js.map} +0 -0
- /package/dist/{chunk-KDG2KTWW.js.map → chunk-33SV3E43.js.map} +0 -0
- /package/dist/{chunk-2HGUDBRJ.js.map → chunk-37ZO6LLJ.js.map} +0 -0
- /package/dist/{chunk-QW3WFHKU.js.map → chunk-45BRYON6.js.map} +0 -0
- /package/dist/{chunk-GZICBRWK.js.map → chunk-4F6X3RXW.js.map} +0 -0
- /package/dist/{chunk-7BAYBYY5.js.map → chunk-4PC4PRJE.js.map} +0 -0
- /package/dist/{chunk-VJXY5ZCT.js.map → chunk-52UKFTUK.js.map} +0 -0
- /package/dist/{chunk-ESG7Z255.js.map → chunk-5UDMFE3Q.js.map} +0 -0
- /package/dist/{chunk-JPHEOE6Z.js.map → chunk-6MTSFX7A.js.map} +0 -0
- /package/dist/{chunk-M4MP34AQ.js.map → chunk-AHZOMHWN.js.map} +0 -0
- /package/dist/{chunk-Z3RHPGSY.js.map → chunk-AIUBBHSF.js.map} +0 -0
- /package/dist/{chunk-S3AYIQCU.js.map → chunk-AXIDQG5A.js.map} +0 -0
- /package/dist/{chunk-QN7NTKRC.js.map → chunk-AZ2QBGYB.js.map} +0 -0
- /package/dist/{chunk-47J4EDGR.js.map → chunk-AZM4CCAC.js.map} +0 -0
- /package/dist/{chunk-LEJPSMKM.js.map → chunk-C5QLI33R.js.map} +0 -0
- /package/dist/{chunk-SV3PSA7Y.js.map → chunk-CV6BBVYV.js.map} +0 -0
- /package/dist/{chunk-V7X767RT.js.map → chunk-DCZBSE4F.js.map} +0 -0
- /package/dist/{chunk-7PKFPLLZ.js.map → chunk-FXTYIA46.js.map} +0 -0
- /package/dist/{chunk-64BHFFKZ.js.map → chunk-HLYR2TQL.js.map} +0 -0
- /package/dist/{chunk-5C2HNJMO.js.map → chunk-J5LLX6IL.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-PLKFO2HJ.js.map → chunk-JL43BVDE.js.map} +0 -0
- /package/dist/{chunk-2S72LWKX.js.map → chunk-JYL3BVVZ.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-PYKKWQZ2.js.map → chunk-M7BXDKPR.js.map} +0 -0
- /package/dist/{chunk-Z54EM5YZ.js.map → chunk-MAXVH44E.js.map} +0 -0
- /package/dist/{chunk-LYMNZZIM.js.map → chunk-NIS256NW.js.map} +0 -0
- /package/dist/{chunk-67QG75MJ.js.map → chunk-NLK2VZYZ.js.map} +0 -0
- /package/dist/{chunk-JYIFGGEM.js.map → chunk-OUKBMQ2O.js.map} +0 -0
- /package/dist/{chunk-75XOWNRS.js.map → chunk-OYESWJ43.js.map} +0 -0
- /package/dist/{chunk-TS4AJ2GI.js.map → chunk-PA45XCUD.js.map} +0 -0
- /package/dist/{chunk-4MBPIL4V.js.map → chunk-PUSLMZBQ.js.map} +0 -0
- /package/dist/{chunk-RVO6TCTU.js.map → chunk-QCECHYZL.js.map} +0 -0
- /package/dist/{chunk-GFIKG4FR.js.map → chunk-QGR6OVGT.js.map} +0 -0
- /package/dist/{chunk-HNZKVLAN.js.map → chunk-S354QO4R.js.map} +0 -0
- /package/dist/{chunk-NO37MR45.js.map → chunk-SOEN6KCF.js.map} +0 -0
- /package/dist/{chunk-FXX6RQYC.js.map → chunk-TPTECFWR.js.map} +0 -0
- /package/dist/{chunk-GDDGZVFI.js.map → chunk-UEVLYVNW.js.map} +0 -0
- /package/dist/{chunk-YQ4IQ2GA.js.map → chunk-UT5BV5OG.js.map} +0 -0
- /package/dist/{chunk-LNTUXKBT.js.map → chunk-UYYW2KPU.js.map} +0 -0
- /package/dist/{chunk-QSYL5CXK.js.map → chunk-VKXWK44Q.js.map} +0 -0
- /package/dist/{chunk-KMWYZTIE.js.map → chunk-VMMQDEN5.js.map} +0 -0
- /package/dist/{chunk-JB6D7EFB.js.map → chunk-VVG2BOKA.js.map} +0 -0
- /package/dist/{chunk-V5H6OJCR.js.map → chunk-W5XVQFLM.js.map} +0 -0
- /package/dist/{chunk-OIOZ6MOP.js.map → chunk-W6FNX2LP.js.map} +0 -0
- /package/dist/{chunk-6QPHF6RR.js.map → chunk-WQM326GS.js.map} +0 -0
- /package/dist/{chunk-TQFHQPWD.js.map → chunk-XADV5IZ3.js.map} +0 -0
- /package/dist/{chunk-DATDLJAO.js.map → chunk-XAPMEU3K.js.map} +0 -0
- /package/dist/{chunk-N3LL5NEU.js.map → chunk-ZMYDYNI4.js.map} +0 -0
package/src/graph.test.ts
CHANGED
|
@@ -4,7 +4,15 @@ import os from "node:os";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import test from "node:test";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
type ActivationPredecessor,
|
|
9
|
+
type GraphConfig,
|
|
10
|
+
type GraphEdge,
|
|
11
|
+
GraphIndex,
|
|
12
|
+
graphFilePath,
|
|
13
|
+
readEdges,
|
|
14
|
+
reconstructActivationPath,
|
|
15
|
+
} from "./graph.js";
|
|
8
16
|
|
|
9
17
|
function makeGraphConfig(): GraphConfig {
|
|
10
18
|
return {
|
|
@@ -116,24 +124,236 @@ test("spreadingActivation propagates same-depth alternate path activation", asyn
|
|
|
116
124
|
await rm(memoryDir, { recursive: true, force: true });
|
|
117
125
|
}
|
|
118
126
|
});
|
|
127
|
+
test("spreadingActivation records seed-first paths with aligned edge metadata", async () => {
|
|
128
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-order-"));
|
|
129
|
+
try {
|
|
130
|
+
await writeGraphEdges(memoryDir, [makeEdge("seed", "middle", "entity", 0.8)]);
|
|
131
|
+
await writeGraphEdges(memoryDir, [makeEdge("middle", "candidate", "causal", 0.7)], "causal");
|
|
132
|
+
|
|
133
|
+
const graph = new GraphIndex(memoryDir, {
|
|
134
|
+
...makeGraphConfig(),
|
|
135
|
+
causalGraphEnabled: true,
|
|
136
|
+
maxGraphTraversalSteps: 2,
|
|
137
|
+
});
|
|
138
|
+
const activated = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
139
|
+
|
|
140
|
+
assert.deepEqual(activated.find((candidate) => candidate.path === "candidate")?.activationPath, {
|
|
141
|
+
nodeIds: ["seed", "middle", "candidate"],
|
|
142
|
+
edgeConfidences: [0.8, 0.7],
|
|
143
|
+
graphTypes: ["entity", "causal"],
|
|
144
|
+
});
|
|
145
|
+
} finally {
|
|
146
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("spreadingActivation keeps the first shortest predecessor path", async () => {
|
|
151
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-shortest-"));
|
|
152
|
+
try {
|
|
153
|
+
await writeGraphEdges(memoryDir, [
|
|
154
|
+
makeEdge("seed", "long"),
|
|
155
|
+
makeEdge("seed", "short"),
|
|
156
|
+
makeEdge("long", "candidate"),
|
|
157
|
+
makeEdge("short", "candidate"),
|
|
158
|
+
]);
|
|
159
|
+
|
|
160
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 2 });
|
|
161
|
+
const activated = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
162
|
+
|
|
163
|
+
assert.deepEqual(activated.find((candidate) => candidate.path === "candidate")?.activationPath, {
|
|
164
|
+
nodeIds: ["seed", "long", "candidate"],
|
|
165
|
+
edgeConfidences: [1, 1],
|
|
166
|
+
graphTypes: ["entity", "entity"],
|
|
167
|
+
});
|
|
168
|
+
} finally {
|
|
169
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
test("spreadingActivation records the stronger equal-hop predecessor", async () => {
|
|
173
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-strength-"));
|
|
174
|
+
try {
|
|
175
|
+
await writeGraphEdges(memoryDir, [
|
|
176
|
+
makeEdge("seed", "weak"),
|
|
177
|
+
makeEdge("seed", "strong"),
|
|
178
|
+
makeEdge("weak", "candidate", "entity", 0.4),
|
|
179
|
+
makeEdge("strong", "candidate", "entity", 0.9),
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 2 });
|
|
183
|
+
const activated = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
184
|
+
|
|
185
|
+
assert.deepEqual(activated.find((candidate) => candidate.path === "candidate")?.activationPath, {
|
|
186
|
+
nodeIds: ["seed", "strong", "candidate"],
|
|
187
|
+
edgeConfidences: [1, 0.9],
|
|
188
|
+
graphTypes: ["entity", "entity"],
|
|
189
|
+
});
|
|
190
|
+
} finally {
|
|
191
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test("spreadingActivation uses a lexical predecessor tie-break", async () => {
|
|
196
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-lexical-"));
|
|
197
|
+
try {
|
|
198
|
+
await writeGraphEdges(memoryDir, [
|
|
199
|
+
makeEdge("seed", "zulu"),
|
|
200
|
+
makeEdge("seed", "alpha"),
|
|
201
|
+
makeEdge("zulu", "candidate"),
|
|
202
|
+
makeEdge("alpha", "candidate"),
|
|
203
|
+
]);
|
|
204
|
+
|
|
205
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 2 });
|
|
206
|
+
const activated = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
207
|
+
|
|
208
|
+
assert.deepEqual(activated.find((candidate) => candidate.path === "candidate")?.activationPath, {
|
|
209
|
+
nodeIds: ["seed", "alpha", "candidate"],
|
|
210
|
+
edgeConfidences: [1, 1],
|
|
211
|
+
graphTypes: ["entity", "entity"],
|
|
212
|
+
});
|
|
213
|
+
} finally {
|
|
214
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
119
218
|
|
|
120
|
-
|
|
219
|
+
test("spreadingActivation keeps predecessor paths isolated per seed", async () => {
|
|
220
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-seeds-"));
|
|
221
|
+
try {
|
|
222
|
+
await writeGraphEdges(memoryDir, [
|
|
223
|
+
makeEdge("seed-a", "middle-a"),
|
|
224
|
+
makeEdge("seed-b", "middle-b"),
|
|
225
|
+
makeEdge("middle-a", "shared"),
|
|
226
|
+
makeEdge("middle-b", "shared"),
|
|
227
|
+
]);
|
|
228
|
+
|
|
229
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 2 });
|
|
230
|
+
const activated = await graph.spreadingActivation(["seed-a", "seed-b"], undefined, { recordPaths: true });
|
|
231
|
+
|
|
232
|
+
assert.deepEqual(activated.find((candidate) => candidate.path === "shared")?.activationPath, {
|
|
233
|
+
nodeIds: ["seed-a", "middle-a", "shared"],
|
|
234
|
+
edgeConfidences: [1, 1],
|
|
235
|
+
graphTypes: ["entity", "entity"],
|
|
236
|
+
});
|
|
237
|
+
} finally {
|
|
238
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
test("spreadingActivation reconstructs bounded paths through cycles without looping", async () => {
|
|
243
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-cycle-"));
|
|
244
|
+
try {
|
|
245
|
+
await writeGraphEdges(memoryDir, [
|
|
246
|
+
makeEdge("seed", "a"),
|
|
247
|
+
makeEdge("a", "b"),
|
|
248
|
+
makeEdge("b", "a"),
|
|
249
|
+
makeEdge("b", "candidate"),
|
|
250
|
+
]);
|
|
251
|
+
|
|
252
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 3 });
|
|
253
|
+
const activated = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
254
|
+
const candidatePath = activated.find((candidate) => candidate.path === "candidate")?.activationPath;
|
|
255
|
+
|
|
256
|
+
assert.deepEqual(candidatePath, {
|
|
257
|
+
nodeIds: ["seed", "a", "b", "candidate"],
|
|
258
|
+
edgeConfidences: [1, 1, 1],
|
|
259
|
+
graphTypes: ["entity", "entity", "entity"],
|
|
260
|
+
});
|
|
261
|
+
assert.ok(activated.every((candidate) => (candidate.activationPath?.nodeIds.length ?? 0) <= 4));
|
|
262
|
+
} finally {
|
|
263
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
test("spreadingActivation path recording is deterministic and opt-in output stays unchanged", async () => {
|
|
268
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-graph-path-determinism-"));
|
|
269
|
+
try {
|
|
270
|
+
await writeGraphEdges(memoryDir, [
|
|
271
|
+
makeEdge("seed", "left"),
|
|
272
|
+
makeEdge("seed", "right"),
|
|
273
|
+
makeEdge("left", "candidate"),
|
|
274
|
+
makeEdge("right", "candidate"),
|
|
275
|
+
]);
|
|
276
|
+
|
|
277
|
+
const graph = new GraphIndex(memoryDir, { ...makeGraphConfig(), maxGraphTraversalSteps: 2 });
|
|
278
|
+
const baseline = await graph.spreadingActivation(["seed"]);
|
|
279
|
+
const explicitDisabled = await graph.spreadingActivation(["seed"], undefined, { recordPaths: false });
|
|
280
|
+
const first = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
281
|
+
const second = await graph.spreadingActivation(["seed"], undefined, { recordPaths: true });
|
|
282
|
+
|
|
283
|
+
assert.deepEqual(explicitDisabled, baseline);
|
|
284
|
+
assert.ok(baseline.every((candidate) => !("activationPath" in candidate)));
|
|
285
|
+
assert.deepEqual(second, first);
|
|
286
|
+
} finally {
|
|
287
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
test("reconstructActivationPath returns a zero-hop path for a seed candidate", () => {
|
|
292
|
+
assert.deepEqual(reconstructActivationPath("seed", "seed", new Map(), 0), {
|
|
293
|
+
nodeIds: ["seed"],
|
|
294
|
+
edgeConfidences: [],
|
|
295
|
+
graphTypes: [],
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
test("reconstructActivationPath fails closed when a predecessor is missing", () => {
|
|
300
|
+
const predecessors = new Map<string, ActivationPredecessor>([
|
|
301
|
+
[
|
|
302
|
+
"seed\0candidate",
|
|
303
|
+
{ prev: "middle", edgeConfidence: 0.8, graphType: "entity" },
|
|
304
|
+
],
|
|
305
|
+
]);
|
|
306
|
+
|
|
307
|
+
assert.equal(reconstructActivationPath("seed", "candidate", predecessors, 2), null);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
test("reconstructActivationPath fails closed on a cycle beyond the step cap", () => {
|
|
311
|
+
const predecessors = new Map<string, ActivationPredecessor>([
|
|
312
|
+
[
|
|
313
|
+
"seed\0candidate",
|
|
314
|
+
{ prev: "cycle-a", edgeConfidence: 0.8, graphType: "entity" },
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
"seed\0cycle-a",
|
|
318
|
+
{ prev: "cycle-b", edgeConfidence: 0.7, graphType: "time" },
|
|
319
|
+
],
|
|
320
|
+
[
|
|
321
|
+
"seed\0cycle-b",
|
|
322
|
+
{ prev: "cycle-a", edgeConfidence: 0.6, graphType: "causal" },
|
|
323
|
+
],
|
|
324
|
+
]);
|
|
325
|
+
|
|
326
|
+
assert.equal(reconstructActivationPath("seed", "candidate", predecessors, 4), null);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
function makeEdge(
|
|
330
|
+
from: string,
|
|
331
|
+
to: string,
|
|
332
|
+
type: GraphEdge["type"] = "entity",
|
|
333
|
+
confidence?: number,
|
|
334
|
+
): GraphEdge {
|
|
121
335
|
return {
|
|
122
336
|
from,
|
|
123
337
|
to,
|
|
124
|
-
type
|
|
338
|
+
type,
|
|
125
339
|
weight: 1,
|
|
340
|
+
...(confidence === undefined ? {} : { confidence }),
|
|
126
341
|
label: "test",
|
|
127
342
|
ts: "2026-01-01T00:00:00.000Z",
|
|
128
343
|
};
|
|
129
344
|
}
|
|
130
345
|
|
|
131
|
-
async function writeGraphEdges(
|
|
132
|
-
|
|
346
|
+
async function writeGraphEdges(
|
|
347
|
+
memoryDir: string,
|
|
348
|
+
edges: GraphEdge[],
|
|
349
|
+
type: GraphEdge["type"] = "entity",
|
|
350
|
+
): Promise<void> {
|
|
351
|
+
const filePath = graphFilePath(memoryDir, type);
|
|
133
352
|
await mkdir(path.dirname(filePath), { recursive: true });
|
|
134
353
|
await writeFile(filePath, `${edges.map((edge) => JSON.stringify(edge)).join("\n")}\n`, "utf-8");
|
|
135
354
|
}
|
|
136
355
|
|
|
356
|
+
|
|
137
357
|
// ---------------------------------------------------------------------------
|
|
138
358
|
// Incremental edge cache (issue #1904). onMemoryWritten pushes single-writer
|
|
139
359
|
// appends into the warm cache in place and reloads only on a peer append.
|
package/src/graph.ts
CHANGED
|
@@ -16,9 +16,26 @@ import * as path from "node:path";
|
|
|
16
16
|
import { readEdgeConfidence } from "./graph-edge-reinforcement.js";
|
|
17
17
|
import { emitGraphEvent } from "./graph-events.js";
|
|
18
18
|
import type { GraphConstructionCapabilitySet } from "./capabilities.js";
|
|
19
|
+
import {
|
|
20
|
+
ActivationPathTracker,
|
|
21
|
+
compareActivationPathCandidates,
|
|
22
|
+
reconstructActivationPath,
|
|
23
|
+
type ActivationPathCandidate,
|
|
24
|
+
type ActivationPredecessor,
|
|
25
|
+
} from "./graph-path-reconstruction.js";
|
|
26
|
+
export { reconstructActivationPath, type ActivationPredecessor };
|
|
19
27
|
|
|
20
28
|
export type GraphType = "entity" | "time" | "causal";
|
|
21
29
|
|
|
30
|
+
export interface ActivationPath {
|
|
31
|
+
/** Node ids from the seed (inclusive) to the reached node (inclusive). */
|
|
32
|
+
nodeIds: string[];
|
|
33
|
+
/** Edge confidences, parallel to the hops in {@link nodeIds}. */
|
|
34
|
+
edgeConfidences: number[];
|
|
35
|
+
/** Graph types, parallel to the hops in {@link nodeIds}. */
|
|
36
|
+
graphTypes: GraphType[];
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
export interface GraphEdge {
|
|
23
40
|
from: string; // relative memory path (e.g. "facts/2026-02-22/abc.md")
|
|
24
41
|
to: string; // relative memory path
|
|
@@ -791,6 +808,8 @@ export class GraphIndex {
|
|
|
791
808
|
* Default `false` (floor from config is applied).
|
|
792
809
|
*/
|
|
793
810
|
includeLowConfidence?: boolean;
|
|
811
|
+
/** Record one shortest seed-to-candidate path in each result. */
|
|
812
|
+
recordPaths?: boolean;
|
|
794
813
|
/** Absolute deadline in ms-since-epoch for post-retrieval assembly. */
|
|
795
814
|
deadlineAtMs?: number;
|
|
796
815
|
}
|
|
@@ -808,6 +827,7 @@ export class GraphIndex {
|
|
|
808
827
|
* In `[0, 1]`. Legacy edges without `confidence` surface as 1.0.
|
|
809
828
|
*/
|
|
810
829
|
edgeConfidence: number;
|
|
830
|
+
activationPath?: ActivationPath | null;
|
|
811
831
|
}>
|
|
812
832
|
> {
|
|
813
833
|
if (!this.cfg.multiGraphMemoryEnabled) return [];
|
|
@@ -821,6 +841,7 @@ export class GraphIndex {
|
|
|
821
841
|
const floor =
|
|
822
842
|
opts?.includeLowConfidence === true ? 0 : clampConfidenceFloor(this.cfg.graphTraversalConfidenceFloor);
|
|
823
843
|
const iterations = clampPageRankIterations(this.cfg.graphTraversalPageRankIterations);
|
|
844
|
+
const recordPaths = opts?.recordPaths === true;
|
|
824
845
|
const deadlineAtMs = opts?.deadlineAtMs;
|
|
825
846
|
const deadlineExpired = (): boolean =>
|
|
826
847
|
typeof deadlineAtMs === "number" && Date.now() >= deadlineAtMs;
|
|
@@ -847,9 +868,9 @@ export class GraphIndex {
|
|
|
847
868
|
adj.get(edge.to)!.push({ ...edge, from: edge.to, to: edge.from });
|
|
848
869
|
}
|
|
849
870
|
}
|
|
850
|
-
|
|
851
871
|
const seedSet = new Set(seeds);
|
|
852
872
|
const scores = new Map<string, number>(); // candidate path → accumulated activation score
|
|
873
|
+
|
|
853
874
|
const provenance = new Map<
|
|
854
875
|
string,
|
|
855
876
|
{
|
|
@@ -858,16 +879,19 @@ export class GraphIndex {
|
|
|
858
879
|
decayedWeight: number;
|
|
859
880
|
graphType: "entity" | "time" | "causal";
|
|
860
881
|
edgeConfidence: number;
|
|
882
|
+
pathKey: string;
|
|
861
883
|
}
|
|
862
884
|
>();
|
|
863
885
|
let frontier = new Map<string, { node: string; seed: string; activation: number }>();
|
|
864
886
|
const reachedBySeed = new Map<string, Set<string>>();
|
|
887
|
+
const pathTracker = recordPaths ? new ActivationPathTracker(seeds) : null;
|
|
888
|
+
const predecessors = pathTracker?.predecessors ?? null;
|
|
865
889
|
for (const seed of seeds) {
|
|
866
890
|
frontier.set(`${seed}\0${seed}`, { node: seed, seed, activation: 1 });
|
|
867
891
|
reachedBySeed.set(seed, new Set([seed]));
|
|
868
892
|
}
|
|
869
|
-
const finalizeScores = () =>
|
|
870
|
-
Array.from(scores.entries())
|
|
893
|
+
const finalizeScores = () => {
|
|
894
|
+
const results = Array.from(scores.entries())
|
|
871
895
|
.map(([p, score]) => ({
|
|
872
896
|
path: p,
|
|
873
897
|
score,
|
|
@@ -877,7 +901,21 @@ export class GraphIndex {
|
|
|
877
901
|
graphType: provenance.get(p)?.graphType ?? "entity",
|
|
878
902
|
edgeConfidence: provenance.get(p)?.edgeConfidence ?? 1,
|
|
879
903
|
}))
|
|
880
|
-
.sort((a, b) =>
|
|
904
|
+
.sort((a, b) => {
|
|
905
|
+
const scoreDelta = b.score - a.score;
|
|
906
|
+
if (scoreDelta !== 0 || !recordPaths) return scoreDelta;
|
|
907
|
+
return a.path < b.path ? -1 : a.path > b.path ? 1 : 0;
|
|
908
|
+
});
|
|
909
|
+
if (!recordPaths || !predecessors) return results;
|
|
910
|
+
return results.map((result) => {
|
|
911
|
+
const seed = provenance.get(result.path)?.seed;
|
|
912
|
+
return {
|
|
913
|
+
...result,
|
|
914
|
+
activationPath:
|
|
915
|
+
seed === undefined ? null : reconstructActivationPath(seed, result.path, predecessors, steps),
|
|
916
|
+
};
|
|
917
|
+
});
|
|
918
|
+
};
|
|
881
919
|
|
|
882
920
|
for (let hop = 0; hop < steps && frontier.size > 0; hop++) {
|
|
883
921
|
if (deadlineExpired()) return finalizeScores();
|
|
@@ -899,22 +937,51 @@ export class GraphIndex {
|
|
|
899
937
|
if (reachedForSeed?.has(neighbor)) {
|
|
900
938
|
continue;
|
|
901
939
|
}
|
|
940
|
+
const candidatePathKey =
|
|
941
|
+
pathTracker && !seedSet.has(neighbor)
|
|
942
|
+
? pathTracker.consider(
|
|
943
|
+
sourceSeed,
|
|
944
|
+
node,
|
|
945
|
+
neighbor,
|
|
946
|
+
hop + 1,
|
|
947
|
+
score,
|
|
948
|
+
conf,
|
|
949
|
+
edge.type,
|
|
950
|
+
)
|
|
951
|
+
: "";
|
|
902
952
|
|
|
903
953
|
if (!seedSet.has(neighbor)) {
|
|
904
954
|
const existing = scores.get(neighbor) ?? 0;
|
|
905
955
|
scores.set(neighbor, existing + score);
|
|
906
956
|
|
|
907
957
|
const prev = provenance.get(neighbor);
|
|
908
|
-
|
|
958
|
+
const candidateWinner: ActivationPathCandidate = {
|
|
959
|
+
hopDepth: hop + 1,
|
|
960
|
+
landingStrength: score,
|
|
961
|
+
pathKey: candidatePathKey,
|
|
962
|
+
};
|
|
963
|
+
const shouldReplace =
|
|
964
|
+
!prev ||
|
|
965
|
+
(recordPaths
|
|
966
|
+
? compareActivationPathCandidates(candidateWinner, {
|
|
967
|
+
hopDepth: prev.hopDepth,
|
|
968
|
+
landingStrength: prev.decayedWeight,
|
|
969
|
+
pathKey: prev.pathKey,
|
|
970
|
+
}) > 0
|
|
971
|
+
: hop + 1 < prev.hopDepth ||
|
|
972
|
+
(hop + 1 === prev.hopDepth && score > prev.decayedWeight));
|
|
973
|
+
if (shouldReplace) {
|
|
909
974
|
provenance.set(neighbor, {
|
|
910
975
|
seed: sourceSeed,
|
|
911
976
|
hopDepth: hop + 1,
|
|
912
977
|
decayedWeight: score,
|
|
913
978
|
graphType: edge.type,
|
|
914
979
|
edgeConfidence: conf,
|
|
980
|
+
pathKey: candidatePathKey,
|
|
915
981
|
});
|
|
916
982
|
}
|
|
917
983
|
|
|
984
|
+
|
|
918
985
|
if (hop + 1 < steps) {
|
|
919
986
|
const frontierKey = `${sourceSeed}\0${neighbor}`;
|
|
920
987
|
const existingFrontier = nextFrontier.get(frontierKey);
|