@remnic/core 9.66.0 → 9.66.2
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 +11 -11
- package/dist/access-admin-ops-surface.js +31 -31
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +32 -32
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +31 -31
- package/dist/access-cli.js +105 -101
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +11 -11
- package/dist/access-extraction-force-flush.js +31 -31
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +11 -11
- package/dist/access-http-lifecycle-flush.d.ts +11 -11
- package/dist/access-http-offline-stream.d.ts +11 -11
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +33 -33
- package/dist/access-http.d.ts +12 -12
- package/dist/access-http.js +48 -48
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +31 -31
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +31 -31
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +39 -39
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-CLWUoMyW.d.ts → access-namespace-preflight-50VIkPhB.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +31 -31
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +31 -31
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-operations-batch.js +34 -34
- package/dist/access-operations.d.ts +11 -11
- package/dist/access-operations.js +38 -38
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +31 -31
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +31 -31
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +31 -31
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CEUE1Isj.d.ts → access-service-Dz6I9AZ-.d.ts} +13 -13
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +31 -31
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +33 -33
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- 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 +4 -4
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +10 -10
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +4 -4
- 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/{catalog-D1HgugTA.d.ts → catalog-C2jA-gLm.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 +13 -13
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-EZSCW4EM.js → chunk-25OLNWYG.js} +2 -2
- package/dist/{chunk-2LBAFHOQ.js → chunk-2QSGJTDG.js} +10 -10
- package/dist/{chunk-7UTDHQZ5.js → chunk-2VZHB5US.js} +2 -2
- package/dist/{chunk-VQNRICAQ.js → chunk-36HJ36FK.js} +3 -3
- package/dist/{chunk-XKNHFDTT.js → chunk-3A2Z4OOS.js} +2 -2
- package/dist/{chunk-KODXCHXJ.js → chunk-46XR5FNZ.js} +39 -3
- package/dist/chunk-46XR5FNZ.js.map +1 -0
- package/dist/{chunk-56IV4J5W.js → chunk-47WWTCJY.js} +1384 -99
- package/dist/chunk-47WWTCJY.js.map +1 -0
- package/dist/{chunk-RDGKVH6T.js → chunk-4NKIGSJM.js} +2 -2
- package/dist/{chunk-EFQCDJZ2.js → chunk-4PG2CKI6.js} +2 -2
- package/dist/{chunk-HJXA6ZM7.js → chunk-6545JDIM.js} +2 -2
- package/dist/{chunk-J3OND5QT.js → chunk-65HXVEVG.js} +2 -2
- package/dist/{chunk-HNPE66LB.js → chunk-6BYJQ3L2.js} +8 -8
- package/dist/{chunk-ZW4VXELZ.js → chunk-6PUF7LUO.js} +2 -2
- package/dist/{chunk-TVVEYCNW.js → chunk-7K5Q6COX.js} +4 -4
- package/dist/{chunk-MN5NOOI7.js → chunk-AI5M4FVQ.js} +2 -2
- package/dist/{chunk-IHGMRDEE.js → chunk-B4B3QDV3.js} +235 -151
- package/dist/chunk-B4B3QDV3.js.map +1 -0
- package/dist/{chunk-YMOPYG3K.js → chunk-BIJAWZYW.js} +6 -6
- package/dist/{chunk-I5VB44ZK.js → chunk-BLHKR4GJ.js} +2 -2
- package/dist/chunk-BLUYQFRH.js +36 -0
- package/dist/chunk-BLUYQFRH.js.map +1 -0
- package/dist/{chunk-CEH2AFXG.js → chunk-C24UZSFW.js} +6 -6
- package/dist/{chunk-MJRGVXPQ.js → chunk-C3ZYZKDJ.js} +2 -2
- package/dist/{chunk-QCRJMU5V.js → chunk-CDLPF3PX.js} +2 -2
- package/dist/{chunk-23CVL7HS.js → chunk-CQ6IWZDI.js} +2 -2
- package/dist/{chunk-KWIGDKM2.js → chunk-D2YNNDML.js} +2 -2
- package/dist/{chunk-FTTJRVB7.js → chunk-D3DUA64S.js} +2 -2
- package/dist/{chunk-7XOG75AU.js → chunk-D6Q5EPOV.js} +2 -2
- package/dist/{chunk-GEJKYA7D.js → chunk-DSEHPUID.js} +6 -6
- package/dist/chunk-E4X2YX2F.js +22 -0
- package/dist/chunk-E4X2YX2F.js.map +1 -0
- package/dist/{chunk-PEBH5DCK.js → chunk-EH7BNIUN.js} +101 -19
- package/dist/chunk-EH7BNIUN.js.map +1 -0
- package/dist/{chunk-OAJMQKQR.js → chunk-EQRD4NMH.js} +2 -2
- package/dist/{chunk-H7VDIF2V.js → chunk-ER2UPUMG.js} +2 -2
- package/dist/{chunk-4FHRZD5T.js → chunk-F2JXJABQ.js} +2 -2
- package/dist/{chunk-FKKGCGYL.js → chunk-F4W5HTED.js} +2 -2
- package/dist/{chunk-DMEHOEC7.js → chunk-FFWONAAW.js} +3 -3
- package/dist/chunk-FYDW33ZB.js +13 -0
- package/dist/chunk-FYDW33ZB.js.map +1 -0
- package/dist/{chunk-TNGH4ZYI.js → chunk-GNWLTCKC.js} +2 -2
- package/dist/{chunk-CFVTRUR3.js → chunk-H6RSANGQ.js} +2 -2
- package/dist/chunk-HVAEXYPL.js +98 -0
- package/dist/chunk-HVAEXYPL.js.map +1 -0
- package/dist/{chunk-CTCGHNWN.js → chunk-J2R275FN.js} +4 -4
- package/dist/{chunk-IVIAHQBR.js → chunk-JJ6ZEFXC.js} +2 -2
- package/dist/{chunk-KXIXO76C.js → chunk-JMXHVJ2V.js} +14 -14
- package/dist/{chunk-7LCGFUMB.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-NACLNNFQ.js → chunk-KSZKQTZS.js} +2 -2
- package/dist/{chunk-NPIBN2VL.js → chunk-LK4TOYPU.js} +2 -2
- package/dist/{chunk-K66OY4EI.js → chunk-LSR5LQXN.js} +2 -2
- package/dist/chunk-MAG6M3B6.js +51 -0
- package/dist/chunk-MAG6M3B6.js.map +1 -0
- package/dist/{chunk-6CEGSTBD.js → chunk-NTFXBILO.js} +5 -5
- package/dist/{chunk-2PSX5BJU.js → chunk-NZPFCP5A.js} +2 -2
- package/dist/{chunk-FYWLSFFS.js → chunk-OERZXNSK.js} +2 -2
- package/dist/{chunk-ZJPM7GZ3.js → chunk-OIDICRH7.js} +2 -2
- package/dist/{chunk-LTBKKSCX.js → chunk-OLBZ2WGG.js} +2 -2
- package/dist/{chunk-PD66CVSD.js → chunk-OUKBMQ2O.js} +2 -2
- package/dist/{chunk-GPFZFCRN.js → chunk-PP7R754B.js} +1 -1
- package/dist/{chunk-GX6FTSYH.js → chunk-PRRUK2ZH.js} +2 -2
- package/dist/{chunk-MAH64N55.js → chunk-PW3GKWH3.js} +4 -4
- package/dist/chunk-Q3SHEAXR.js +80 -0
- package/dist/chunk-Q3SHEAXR.js.map +1 -0
- package/dist/{chunk-33MFRY25.js → chunk-R2Q6FTOX.js} +2 -2
- package/dist/{chunk-VCKWULAK.js → chunk-RCPKBW7K.js} +5 -5
- package/dist/{chunk-CN4VKV3S.js → chunk-RH3XLQG4.js} +2 -2
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-YXFCALVT.js → chunk-U4HZEW2B.js} +8 -8
- package/dist/{chunk-RZ3IZIJG.js → chunk-UHQE37NI.js} +2 -2
- package/dist/{chunk-Z3YEGSR4.js → chunk-UMZUKOJU.js} +4 -4
- package/dist/{chunk-72OIT7KS.js → chunk-UVYL5G7A.js} +3 -3
- package/dist/{chunk-4STAANV7.js → chunk-VKDBDJIX.js} +3 -3
- package/dist/{chunk-WKJFIMVN.js → chunk-VSMSYDIH.js} +2 -2
- package/dist/{chunk-GSKINLAK.js → chunk-W5IYHQA5.js} +3 -3
- package/dist/{chunk-FESUGFIL.js → chunk-WKWY7YF3.js} +2 -2
- package/dist/{chunk-UNUMFURP.js → chunk-X5PIDJ3L.js} +3 -3
- package/dist/{chunk-MINHJ55X.js → chunk-XXW32OL7.js} +1 -1
- package/dist/{chunk-MINHJ55X.js.map → chunk-XXW32OL7.js.map} +1 -1
- package/dist/{chunk-6RUHELWR.js → chunk-Y2YM4C75.js} +2 -2
- package/dist/{chunk-L4X4PJYK.js → chunk-YZ5VC2JJ.js} +2 -2
- package/dist/{chunk-VQ4AMTGZ.js → chunk-ZBIEX4XN.js} +1 -1
- package/dist/{chunk-O57GM3FR.js → chunk-ZMVW2HJJ.js} +2 -2
- package/dist/{chunk-6QDXA26G.js → chunk-ZXROBS53.js} +68 -68
- package/dist/{cli-BEkm2MEf.d.ts → cli-BOuEb4Ia.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +76 -76
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +10 -10
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +10 -10
- 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 +4 -4
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +10 -10
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +10 -10
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +3 -3
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +12 -12
- 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/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +12 -12
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-BCpeo14F.d.ts → dependency-propagation-delivery-D4WMbOwA.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-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +10 -10
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +32 -32
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +11 -11
- package/dist/extraction-error-classification.d.ts +1 -1
- 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-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-span-wire.d.ts +17 -0
- package/dist/extraction-span-wire.js +13 -0
- package/dist/extraction-span-wire.js.map +1 -0
- package/dist/extraction-span.d.ts +17 -0
- package/dist/extraction-span.js +8 -0
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +13 -13
- 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-A4SDFMMS.js → graph-edge-decay-FXGELBFA.js} +4 -4
- package/dist/graph-edge-decay-FXGELBFA.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +3 -3
- package/dist/harmonic-retrieval.js +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_pyMUaP.d.ts → index-DuJnzwHv.d.ts} +2 -2
- package/dist/index.d.ts +341 -26
- package/dist/index.js +195 -114
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +7 -7
- 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-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +3 -3
- package/dist/location/index.js +12 -12
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/{maintenance-DDUX9d6D.d.ts → maintenance-BBeaeYRR.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -11
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +1 -1
- 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-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +11 -11
- package/dist/memory-subject.d.ts +11 -11
- 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 +11 -11
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +10 -10
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +24 -24
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +19 -19
- package/dist/{orchestrator-3F4jihCo.d.ts → orchestrator-CaqnwNwM.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +105 -101
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CB1dj6Uh.d.ts → pipeline-CrxVjlJr.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-34-JIAGQ.d.ts → public-http-CmQRjQCD.d.ts} +1 -1
- package/dist/{qmd-edLLZXc5.d.ts → qmd-BZgbJm0g.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 +4 -4
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-deep-access.d.ts +30 -0
- package/dist/recall-deep-access.js +50 -0
- package/dist/recall-deep-access.js.map +1 -0
- package/dist/recall-deep-render.d.ts +11 -0
- package/dist/recall-deep-render.js +28 -0
- package/dist/recall-deep-render.js.map +1 -0
- package/dist/recall-deep.d.ts +37 -0
- package/dist/recall-deep.js +14 -0
- package/dist/recall-deep.js.map +1 -0
- 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-memory-map.d.ts +1 -1
- package/dist/recall-navigate.d.ts +70 -0
- package/dist/recall-navigate.js +15 -0
- package/dist/recall-navigate.js.map +1 -0
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state-view-render.d.ts +18 -0
- package/dist/recall-state-view-render.js +22 -0
- package/dist/recall-state-view-render.js.map +1 -0
- package/dist/recall-state-view-widen.d.ts +13 -0
- package/dist/recall-state-view-widen.js +11 -0
- package/dist/recall-state-view-widen.js.map +1 -0
- package/dist/recall-state-view-wire.d.ts +13 -0
- package/dist/recall-state-view-wire.js +12 -0
- package/dist/recall-state-view-wire.js.map +1 -0
- package/dist/recall-state-view.d.ts +25 -0
- package/dist/recall-state-view.js +22 -0
- package/dist/recall-state-view.js.map +1 -0
- 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/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- 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/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +5 -5
- 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/salvage-envelope.d.ts +1 -1
- package/dist/schemas.d.ts +42 -42
- package/dist/{scope-profiles-BF2lu81V.d.ts → scope-profiles-DFaojvoP.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 +5 -5
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +9 -9
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-5OuWXBRt.d.ts → semantic-consolidation-BiX68wZA.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +11 -11
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/{service-CrqEhLXD.d.ts → service-D5h2zZ0M.d.ts} +2 -2
- 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/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +12 -12
- package/dist/{storage-BQn-xnxm.d.ts → storage-CtsaojWD.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +9 -9
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +14 -14
- package/dist/support-passport/index.js +34 -34
- 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-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +11 -11
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-BRpcNjHZ.d.ts → types-CIpfYz1I.d.ts} +16 -11
- 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 +10 -10
- package/dist/who-knows-cli.d.ts +11 -11
- package/dist/who-knows-cli.js +11 -11
- package/dist/who-knows.d.ts +11 -11
- package/dist/who-knows.js +10 -10
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/activity/config.test.ts +1 -1
- package/src/activity/config.ts +48 -3
- package/src/activity/index.ts +5 -0
- package/src/activity/journal-vault-read.test.ts +153 -0
- package/src/activity/journal-vault-read.ts +214 -0
- package/src/activity/journal.test.ts +97 -0
- package/src/activity/journal.ts +113 -0
- package/src/activity/privacy.test.ts +53 -0
- package/src/activity/privacy.ts +80 -0
- package/src/activity/timeline/analysis-batch.test.ts +56 -0
- package/src/activity/timeline/analysis-batch.ts +45 -0
- package/src/activity/timeline/analysis.test.ts +413 -0
- package/src/activity/timeline/analysis.ts +362 -0
- package/src/activity/timeline/index.ts +7 -0
- package/src/activity/timeline/journal-recap-persist.test.ts +148 -0
- package/src/activity/timeline/journal-recap-persist.ts +37 -0
- package/src/activity/timeline/journal-recap.test.ts +113 -0
- package/src/activity/timeline/journal-recap.ts +130 -0
- package/src/activity/timeline/query.test.ts +198 -0
- package/src/activity/timeline/query.ts +313 -0
- package/src/activity/timeline/weekly-persist.test.ts +121 -0
- package/src/activity/timeline/weekly-persist.ts +103 -0
- package/src/activity/timeline/weekly.test.ts +215 -0
- package/src/activity/timeline/weekly.ts +234 -0
- package/src/activity/types.ts +14 -0
- package/src/activity/vault-path.test.ts +38 -0
- package/src/activity/vault-path.ts +59 -0
- package/src/activity/vault-publish.test.ts +268 -0
- package/src/activity/vault-publish.ts +180 -0
- package/src/config.test.ts +1 -1
- package/src/config.ts +2 -22
- package/src/dedup/merge-on-write-wire.test.ts +101 -0
- package/src/dedup/merge-on-write-wire.ts +34 -0
- package/src/dedup/merge-on-write.test.ts +91 -0
- package/src/dedup/merge-on-write.ts +75 -0
- package/src/dedup/novelty-gate.test.ts +143 -0
- package/src/dedup/novelty-gate.ts +163 -0
- package/src/extraction-span-wire.test.ts +20 -0
- package/src/extraction-span-wire.ts +17 -0
- package/src/extraction-span.test.ts +59 -0
- package/src/extraction-span.ts +39 -0
- package/src/index.ts +1 -0
- package/src/location/recall-exclusion.test.ts +1 -0
- package/src/orchestration/extraction-persist.ts +22 -23
- package/src/orchestration/generic-recall-paths.ts +11 -0
- package/src/orchestration/recall-entry.ts +8 -3
- package/src/recall-deep-access.test.ts +58 -0
- package/src/recall-deep-access.ts +71 -0
- package/src/recall-deep-render.test.ts +68 -0
- package/src/recall-deep-render.ts +32 -0
- package/src/recall-deep.test.ts +72 -0
- package/src/recall-deep.ts +113 -0
- package/src/recall-navigate.test.ts +84 -0
- package/src/recall-navigate.ts +100 -0
- package/src/recall-state-view-render.test.ts +94 -0
- package/src/recall-state-view-render.ts +24 -0
- package/src/recall-state-view-widen.test.ts +66 -0
- package/src/recall-state-view-widen.ts +49 -0
- package/src/recall-state-view-wire.test.ts +35 -0
- package/src/recall-state-view-wire.ts +18 -0
- package/src/recall-state-view.test.ts +131 -0
- package/src/recall-state-view.ts +138 -0
- package/src/shared-context/governance.test.ts +53 -0
- package/src/shared-context/governance.ts +86 -0
- package/src/shared-context/staleness.test.ts +36 -0
- package/src/shared-context/staleness.ts +38 -0
- package/src/shared-context/trajectories.test.ts +77 -0
- package/src/shared-context/trajectories.ts +49 -0
- package/src/types.ts +3 -10
- package/dist/chunk-56IV4J5W.js.map +0 -1
- package/dist/chunk-IHGMRDEE.js.map +0 -1
- package/dist/chunk-KODXCHXJ.js.map +0 -1
- package/dist/chunk-PEBH5DCK.js.map +0 -1
- /package/dist/{chunk-EZSCW4EM.js.map → chunk-25OLNWYG.js.map} +0 -0
- /package/dist/{chunk-2LBAFHOQ.js.map → chunk-2QSGJTDG.js.map} +0 -0
- /package/dist/{chunk-7UTDHQZ5.js.map → chunk-2VZHB5US.js.map} +0 -0
- /package/dist/{chunk-VQNRICAQ.js.map → chunk-36HJ36FK.js.map} +0 -0
- /package/dist/{chunk-XKNHFDTT.js.map → chunk-3A2Z4OOS.js.map} +0 -0
- /package/dist/{chunk-RDGKVH6T.js.map → chunk-4NKIGSJM.js.map} +0 -0
- /package/dist/{chunk-EFQCDJZ2.js.map → chunk-4PG2CKI6.js.map} +0 -0
- /package/dist/{chunk-HJXA6ZM7.js.map → chunk-6545JDIM.js.map} +0 -0
- /package/dist/{chunk-J3OND5QT.js.map → chunk-65HXVEVG.js.map} +0 -0
- /package/dist/{chunk-HNPE66LB.js.map → chunk-6BYJQ3L2.js.map} +0 -0
- /package/dist/{chunk-ZW4VXELZ.js.map → chunk-6PUF7LUO.js.map} +0 -0
- /package/dist/{chunk-TVVEYCNW.js.map → chunk-7K5Q6COX.js.map} +0 -0
- /package/dist/{chunk-MN5NOOI7.js.map → chunk-AI5M4FVQ.js.map} +0 -0
- /package/dist/{chunk-YMOPYG3K.js.map → chunk-BIJAWZYW.js.map} +0 -0
- /package/dist/{chunk-I5VB44ZK.js.map → chunk-BLHKR4GJ.js.map} +0 -0
- /package/dist/{chunk-CEH2AFXG.js.map → chunk-C24UZSFW.js.map} +0 -0
- /package/dist/{chunk-MJRGVXPQ.js.map → chunk-C3ZYZKDJ.js.map} +0 -0
- /package/dist/{chunk-QCRJMU5V.js.map → chunk-CDLPF3PX.js.map} +0 -0
- /package/dist/{chunk-23CVL7HS.js.map → chunk-CQ6IWZDI.js.map} +0 -0
- /package/dist/{chunk-KWIGDKM2.js.map → chunk-D2YNNDML.js.map} +0 -0
- /package/dist/{chunk-FTTJRVB7.js.map → chunk-D3DUA64S.js.map} +0 -0
- /package/dist/{chunk-7XOG75AU.js.map → chunk-D6Q5EPOV.js.map} +0 -0
- /package/dist/{chunk-GEJKYA7D.js.map → chunk-DSEHPUID.js.map} +0 -0
- /package/dist/{chunk-OAJMQKQR.js.map → chunk-EQRD4NMH.js.map} +0 -0
- /package/dist/{chunk-H7VDIF2V.js.map → chunk-ER2UPUMG.js.map} +0 -0
- /package/dist/{chunk-4FHRZD5T.js.map → chunk-F2JXJABQ.js.map} +0 -0
- /package/dist/{chunk-FKKGCGYL.js.map → chunk-F4W5HTED.js.map} +0 -0
- /package/dist/{chunk-DMEHOEC7.js.map → chunk-FFWONAAW.js.map} +0 -0
- /package/dist/{chunk-TNGH4ZYI.js.map → chunk-GNWLTCKC.js.map} +0 -0
- /package/dist/{chunk-CFVTRUR3.js.map → chunk-H6RSANGQ.js.map} +0 -0
- /package/dist/{chunk-CTCGHNWN.js.map → chunk-J2R275FN.js.map} +0 -0
- /package/dist/{chunk-IVIAHQBR.js.map → chunk-JJ6ZEFXC.js.map} +0 -0
- /package/dist/{chunk-KXIXO76C.js.map → chunk-JMXHVJ2V.js.map} +0 -0
- /package/dist/{chunk-7LCGFUMB.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-NACLNNFQ.js.map → chunk-KSZKQTZS.js.map} +0 -0
- /package/dist/{chunk-NPIBN2VL.js.map → chunk-LK4TOYPU.js.map} +0 -0
- /package/dist/{chunk-K66OY4EI.js.map → chunk-LSR5LQXN.js.map} +0 -0
- /package/dist/{chunk-6CEGSTBD.js.map → chunk-NTFXBILO.js.map} +0 -0
- /package/dist/{chunk-2PSX5BJU.js.map → chunk-NZPFCP5A.js.map} +0 -0
- /package/dist/{chunk-FYWLSFFS.js.map → chunk-OERZXNSK.js.map} +0 -0
- /package/dist/{chunk-ZJPM7GZ3.js.map → chunk-OIDICRH7.js.map} +0 -0
- /package/dist/{chunk-LTBKKSCX.js.map → chunk-OLBZ2WGG.js.map} +0 -0
- /package/dist/{chunk-PD66CVSD.js.map → chunk-OUKBMQ2O.js.map} +0 -0
- /package/dist/{chunk-GPFZFCRN.js.map → chunk-PP7R754B.js.map} +0 -0
- /package/dist/{chunk-GX6FTSYH.js.map → chunk-PRRUK2ZH.js.map} +0 -0
- /package/dist/{chunk-MAH64N55.js.map → chunk-PW3GKWH3.js.map} +0 -0
- /package/dist/{chunk-33MFRY25.js.map → chunk-R2Q6FTOX.js.map} +0 -0
- /package/dist/{chunk-VCKWULAK.js.map → chunk-RCPKBW7K.js.map} +0 -0
- /package/dist/{chunk-CN4VKV3S.js.map → chunk-RH3XLQG4.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-YXFCALVT.js.map → chunk-U4HZEW2B.js.map} +0 -0
- /package/dist/{chunk-RZ3IZIJG.js.map → chunk-UHQE37NI.js.map} +0 -0
- /package/dist/{chunk-Z3YEGSR4.js.map → chunk-UMZUKOJU.js.map} +0 -0
- /package/dist/{chunk-72OIT7KS.js.map → chunk-UVYL5G7A.js.map} +0 -0
- /package/dist/{chunk-4STAANV7.js.map → chunk-VKDBDJIX.js.map} +0 -0
- /package/dist/{chunk-WKJFIMVN.js.map → chunk-VSMSYDIH.js.map} +0 -0
- /package/dist/{chunk-GSKINLAK.js.map → chunk-W5IYHQA5.js.map} +0 -0
- /package/dist/{chunk-FESUGFIL.js.map → chunk-WKWY7YF3.js.map} +0 -0
- /package/dist/{chunk-UNUMFURP.js.map → chunk-X5PIDJ3L.js.map} +0 -0
- /package/dist/{chunk-6RUHELWR.js.map → chunk-Y2YM4C75.js.map} +0 -0
- /package/dist/{chunk-L4X4PJYK.js.map → chunk-YZ5VC2JJ.js.map} +0 -0
- /package/dist/{chunk-VQ4AMTGZ.js.map → chunk-ZBIEX4XN.js.map} +0 -0
- /package/dist/{chunk-O57GM3FR.js.map → chunk-ZMVW2HJJ.js.map} +0 -0
- /package/dist/{chunk-6QDXA26G.js.map → chunk-ZXROBS53.js.map} +0 -0
- /package/dist/{graph-edge-decay-A4SDFMMS.js.map → extraction-span.js.map} +0 -0
|
@@ -83,6 +83,7 @@ import {
|
|
|
83
83
|
} from "../fallback-llm.js";
|
|
84
84
|
import { EmbeddingFallback } from "../embedding-fallback.js";
|
|
85
85
|
import { decideSemanticDedup, type SemanticDedupDecision, type SemanticDedupHit } from "../dedup/semantic.js";
|
|
86
|
+
import { applyNoveltyGate, embeddingsFromCosineHits } from "../dedup/novelty-gate.js";
|
|
86
87
|
import { selectRouteRule, type RouteRule, type RoutingEngineOptions } from "../routing/engine.js";
|
|
87
88
|
import { ThreadingManager } from "../threading.js";
|
|
88
89
|
import { NamespaceStorageRouter } from "../namespaces/storage.js";
|
|
@@ -1919,26 +1920,24 @@ export class ExtractionPersistCoordinator {
|
|
|
1919
1920
|
: undefined;
|
|
1920
1921
|
const faithfulnessEnforceStatus = faithfulnessGateStatus ?? requireSpansPendingStatus ?? injectionScreenStatus;
|
|
1921
1922
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
// a high-similarity update/correction is linked as a superseding
|
|
1939
|
-
// contradiction rather than silently dropped.
|
|
1923
|
+
const novelty = await applyNoveltyGate({
|
|
1924
|
+
enabled: this.deps.config["noveltyGateEnabled"] === true,
|
|
1925
|
+
addThreshold: this.deps.config.noveltyAddThreshold,
|
|
1926
|
+
noopThreshold: this.deps.config.noveltyNoopThreshold,
|
|
1927
|
+
lookup: async () =>
|
|
1928
|
+
embeddingsFromCosineHits(
|
|
1929
|
+
await this.deps.semanticDedupLookup(
|
|
1930
|
+
fact.content,
|
|
1931
|
+
this.deps.config.semanticDedupCandidates,
|
|
1932
|
+
targetStorage,
|
|
1933
|
+
),
|
|
1934
|
+
// Same connector scoping as decideSemanticDedup below: a
|
|
1935
|
+
// cross-connector neighbor must not noop this candidate.
|
|
1936
|
+
{ candidateConnector: sourceContext?.sourceConnector },
|
|
1937
|
+
),
|
|
1938
|
+
});
|
|
1940
1939
|
let pendingSemanticSkip: (SemanticDedupDecision & { action: "skip" }) | null = null;
|
|
1941
|
-
if (resolvePipelineProcessingCapabilities(this.deps.config).semanticDedup && injectionScreenStatus !== "pending_review") {
|
|
1940
|
+
if (novelty.decision !== "add" && resolvePipelineProcessingCapabilities(this.deps.config).semanticDedup && injectionScreenStatus !== "pending_review") {
|
|
1942
1941
|
let semanticDecision: SemanticDedupDecision;
|
|
1943
1942
|
// UUI2: skip embedding lookup for the rest of this batch once we know
|
|
1944
1943
|
// the backend is unavailable. The flag is reset per-batch (set to false
|
|
@@ -2100,17 +2099,17 @@ export class ExtractionPersistCoordinator {
|
|
|
2100
2099
|
// gate's contract is "persists with status: pending_review, never
|
|
2101
2100
|
// silently dropped" (issue #1576).
|
|
2102
2101
|
if (
|
|
2103
|
-
pendingSemanticSkip &&
|
|
2102
|
+
(pendingSemanticSkip || novelty.decision === "noop") &&
|
|
2104
2103
|
!contradictionDetected &&
|
|
2105
2104
|
!isCorrection &&
|
|
2106
2105
|
faithfulnessEnforceStatus !== "pending_review"
|
|
2107
2106
|
) {
|
|
2108
2107
|
log.debug(
|
|
2109
|
-
`dedup: skipping semantic near-duplicate fact "${fact.content
|
|
2108
|
+
`dedup: skipping ${pendingSemanticSkip ? "semantic near-duplicate" : "novelty-noop"} fact "${fact.content
|
|
2110
2109
|
.slice(0, 60)
|
|
2111
|
-
.replace(/\s+/g, " ")}…" score=${pendingSemanticSkip
|
|
2110
|
+
.replace(/\s+/g, " ")}…" score=${(pendingSemanticSkip?.topScore ?? novelty.score).toFixed(
|
|
2112
2111
|
3,
|
|
2113
|
-
)} neighbor=${pendingSemanticSkip.
|
|
2112
|
+
)} neighbor=${pendingSemanticSkip?.topId ?? novelty.neighborId}`,
|
|
2114
2113
|
);
|
|
2115
2114
|
dedupedCount++;
|
|
2116
2115
|
// Do NOT add fact.content to contentHashIndex here. No memory was
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
isLocationDayPath,
|
|
10
10
|
isMeetingRecordPath,
|
|
11
11
|
} from "./orchestrator-helpers.js";
|
|
12
|
+
import { isJournalDayPath } from "../activity/journal.js";
|
|
12
13
|
import { OKF_RESERVED_BASENAMES } from "../okf/type-mapping.js";
|
|
13
14
|
|
|
14
15
|
|
|
@@ -137,6 +138,7 @@ export function isSearchExcludedPath(
|
|
|
137
138
|
isArtifactMemoryPath(candidate) ||
|
|
138
139
|
isNamespacedActivityDigestPath(candidate, policy.memoryDir) ||
|
|
139
140
|
isNamespacedLocationDayPath(candidate, policy.memoryDir) ||
|
|
141
|
+
isNamespacedJournalDayPath(candidate, policy.memoryDir) ||
|
|
140
142
|
isMeetingRecordPath(candidate)
|
|
141
143
|
) {
|
|
142
144
|
return true;
|
|
@@ -179,6 +181,15 @@ function isNamespacedLocationDayPath(candidate: string, memoryDir?: string): boo
|
|
|
179
181
|
return isLocationDayPath(namespaced[2] ?? "", memoryDir);
|
|
180
182
|
}
|
|
181
183
|
|
|
184
|
+
function isNamespacedJournalDayPath(candidate: string, memoryDir?: string): boolean {
|
|
185
|
+
if (isJournalDayPath(candidate, memoryDir)) return true;
|
|
186
|
+
if (memoryDir === undefined || memoryDir.length === 0) return false;
|
|
187
|
+
const relative = path.relative(memoryDir, path.resolve(memoryDir, candidate));
|
|
188
|
+
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative);
|
|
189
|
+
if (namespaced === null) return false;
|
|
190
|
+
return isJournalDayPath(namespaced[2] ?? "", memoryDir);
|
|
191
|
+
}
|
|
192
|
+
|
|
182
193
|
/** A path as given, plus its form with a leading COLLECTION segment removed. */
|
|
183
194
|
function collectionSpellings(
|
|
184
195
|
filePath: string,
|
|
@@ -20,6 +20,7 @@ import { ProfilingCollector } from "../profiling.js";
|
|
|
20
20
|
import { trustResultFor, type TrustStageResultItem } from "../trust-score-stage.js";
|
|
21
21
|
import type { RecallResultFormatter } from "./recall-result-formatter.js";
|
|
22
22
|
import type { IdentityInjectionMode, PluginConfig, QmdSearchResult } from "../types.js";
|
|
23
|
+
import { applyRecallStateViews } from "../recall-state-view-wire.js";
|
|
23
24
|
|
|
24
25
|
export interface RecallEntryDeps {
|
|
25
26
|
appendRecallSection(
|
|
@@ -274,9 +275,13 @@ export class RecallEntryCoordinator {
|
|
|
274
275
|
}): void {
|
|
275
276
|
const sectionId = "memories";
|
|
276
277
|
const trustByPath = options.trustByPath ?? null;
|
|
277
|
-
const injectable =
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
const injectable = applyRecallStateViews(
|
|
279
|
+
trustByPath
|
|
280
|
+
? options.results.filter((r) => !trustResultFor(trustByPath, r)?.quarantined)
|
|
281
|
+
: options.results,
|
|
282
|
+
options.retrievalQuery,
|
|
283
|
+
this.deps.config,
|
|
284
|
+
);
|
|
280
285
|
if (injectable.length === 0) return;
|
|
281
286
|
|
|
282
287
|
const formatted = this.deps.recallResultFormatter.formatQmdResultEntries(
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { runDeepRecallAccess } from "./recall-deep-access.js";
|
|
5
|
+
|
|
6
|
+
const QUERY = "who met at the cafe";
|
|
7
|
+
|
|
8
|
+
test("budget 0 stops immediately with a tagged refusal", () => {
|
|
9
|
+
const result = runDeepRecallAccess({ query: QUERY, budget: 0, policyName: "expand-once" });
|
|
10
|
+
assert.equal(result.ok, false);
|
|
11
|
+
assert.deepEqual(result.refusal, { tag: "budget_exhausted" });
|
|
12
|
+
assert.equal(result.trace.length, 1);
|
|
13
|
+
assert.equal(result.trace[0]?.action, "stop");
|
|
14
|
+
assert.equal(result.state.budget, 0);
|
|
15
|
+
assert.equal(result.state.query, QUERY);
|
|
16
|
+
assert.deepEqual(result.state.workingSet, []);
|
|
17
|
+
assert.deepEqual(result.state.frontier, []);
|
|
18
|
+
assert.equal(result.traceJson, JSON.stringify(result.trace));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("unknown policyName is rejected", () => {
|
|
22
|
+
assert.throws(
|
|
23
|
+
() => runDeepRecallAccess({ query: QUERY, budget: 2, policyName: "refine-twice" }),
|
|
24
|
+
/unknown deep recall access policy/,
|
|
25
|
+
);
|
|
26
|
+
assert.throws(
|
|
27
|
+
() => runDeepRecallAccess({ query: QUERY, budget: 2, policyName: "refine-twice" }),
|
|
28
|
+
/stop, expand-once/,
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("stop policy ends without expanding", () => {
|
|
33
|
+
const result = runDeepRecallAccess({ query: QUERY, budget: 3, policyName: "stop" });
|
|
34
|
+
assert.equal(result.ok, true);
|
|
35
|
+
assert.equal(result.refusal, undefined);
|
|
36
|
+
assert.equal(result.trace.length, 1);
|
|
37
|
+
assert.equal(result.trace[0]?.action, "stop");
|
|
38
|
+
assert.equal(result.state.budget, 3);
|
|
39
|
+
assert.deepEqual(result.state.workingSet, []);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("expand-once expands once then stops", () => {
|
|
43
|
+
const result = runDeepRecallAccess({ query: QUERY, budget: 3, policyName: "expand-once" });
|
|
44
|
+
assert.equal(result.ok, true);
|
|
45
|
+
assert.deepEqual(
|
|
46
|
+
result.trace.map((step) => step.action),
|
|
47
|
+
["expand", "stop"],
|
|
48
|
+
);
|
|
49
|
+
assert.equal(result.state.budget, 2);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("same input produces the same trace JSON", () => {
|
|
53
|
+
const input = { query: QUERY, budget: 4, policyName: "expand-once" as const };
|
|
54
|
+
const first = runDeepRecallAccess(input);
|
|
55
|
+
const second = runDeepRecallAccess(input);
|
|
56
|
+
assert.equal(first.traceJson, second.traceJson);
|
|
57
|
+
assert.equal(first.traceJson, JSON.stringify(first.trace));
|
|
58
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named-policy access facade for the deep-recall stepper (issue #2332 leftover).
|
|
3
|
+
*
|
|
4
|
+
* Not the hot path. Surfaces and parseConfig wait. Policy names are
|
|
5
|
+
* allow-listed. Budget 0 returns a tagged refusal without a policy call.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { runDeepRecall, type DeepRecallResult, type DeepRecallState } from "./recall-deep.js";
|
|
9
|
+
|
|
10
|
+
export const DEEP_RECALL_ACCESS_POLICIES = ["stop", "expand-once"] as const;
|
|
11
|
+
|
|
12
|
+
export type DeepRecallAccessPolicyName = (typeof DEEP_RECALL_ACCESS_POLICIES)[number];
|
|
13
|
+
|
|
14
|
+
export interface DeepRecallAccessInput {
|
|
15
|
+
query: string;
|
|
16
|
+
budget: number;
|
|
17
|
+
policyName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DeepRecallAccessRefusal {
|
|
21
|
+
tag: "budget_exhausted";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DeepRecallAccessResult {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
refusal?: DeepRecallAccessRefusal;
|
|
27
|
+
state: DeepRecallState;
|
|
28
|
+
trace: DeepRecallResult["trace"];
|
|
29
|
+
traceJson: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isDeepRecallAccessPolicyName(value: unknown): value is DeepRecallAccessPolicyName {
|
|
33
|
+
return typeof value === "string" && (DEEP_RECALL_ACCESS_POLICIES as readonly string[]).includes(value);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function runDeepRecallAccess(input: DeepRecallAccessInput): DeepRecallAccessResult {
|
|
37
|
+
if (!isDeepRecallAccessPolicyName(input.policyName)) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`unknown deep recall access policy: ${JSON.stringify(input.policyName)}. Valid: ${DEEP_RECALL_ACCESS_POLICIES.join(", ")}`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const start: DeepRecallState = { query: input.query, workingSet: [], frontier: [], budget: input.budget };
|
|
44
|
+
if (!Number.isFinite(input.budget) || input.budget <= 0) {
|
|
45
|
+
const result = runDeepRecall(start, () => {
|
|
46
|
+
throw new Error("policy must not run when budget is 0");
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
ok: false,
|
|
50
|
+
refusal: { tag: "budget_exhausted" },
|
|
51
|
+
state: result.state,
|
|
52
|
+
trace: result.trace,
|
|
53
|
+
traceJson: JSON.stringify(result.trace),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let expanded = false;
|
|
58
|
+
const result = runDeepRecall(start, () => {
|
|
59
|
+
if (input.policyName === "expand-once" && !expanded) {
|
|
60
|
+
expanded = true;
|
|
61
|
+
return "expand";
|
|
62
|
+
}
|
|
63
|
+
return "stop";
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
ok: true,
|
|
67
|
+
state: result.state,
|
|
68
|
+
trace: result.trace,
|
|
69
|
+
traceJson: JSON.stringify(result.trace),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
runDeepRecall,
|
|
6
|
+
type DeepRecallState,
|
|
7
|
+
} from "./recall-deep.js";
|
|
8
|
+
import { renderDeepRecallTrace } from "./recall-deep-render.js";
|
|
9
|
+
|
|
10
|
+
function seed(extra: Partial<DeepRecallState> = {}): DeepRecallState {
|
|
11
|
+
return {
|
|
12
|
+
query: "who met at the cafe",
|
|
13
|
+
workingSet: [],
|
|
14
|
+
frontier: ["m-b", "m-c"],
|
|
15
|
+
budget: 2,
|
|
16
|
+
...extra,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
test("empty working set prints (empty)", () => {
|
|
21
|
+
const result = runDeepRecall(seed({ budget: 0 }), () => {
|
|
22
|
+
throw new Error("policy must not run when budget is 0");
|
|
23
|
+
});
|
|
24
|
+
assert.equal(
|
|
25
|
+
renderDeepRecallTrace(result),
|
|
26
|
+
[
|
|
27
|
+
"# Deep recall",
|
|
28
|
+
"",
|
|
29
|
+
"- query: who met at the cafe",
|
|
30
|
+
"- budget: 0",
|
|
31
|
+
"- stop: budget exhausted",
|
|
32
|
+
"",
|
|
33
|
+
"## Steps",
|
|
34
|
+
"",
|
|
35
|
+
"1. stop budget=0 workingSet=(empty) frontier=m-b, m-c",
|
|
36
|
+
"",
|
|
37
|
+
].join("\n"),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("expand then stop snapshot", () => {
|
|
42
|
+
const result = runDeepRecall(seed({ workingSet: ["m-seed"], budget: 2 }), (state) =>
|
|
43
|
+
state.workingSet.includes("m-b") ? "stop" : "expand",
|
|
44
|
+
);
|
|
45
|
+
assert.equal(
|
|
46
|
+
renderDeepRecallTrace(result),
|
|
47
|
+
[
|
|
48
|
+
"# Deep recall",
|
|
49
|
+
"",
|
|
50
|
+
"- query: who met at the cafe",
|
|
51
|
+
"- budget: 1",
|
|
52
|
+
"- stop: stop",
|
|
53
|
+
"",
|
|
54
|
+
"## Steps",
|
|
55
|
+
"",
|
|
56
|
+
"1. expand budget=1 workingSet=m-seed, m-b frontier=m-c",
|
|
57
|
+
"2. stop budget=1 workingSet=m-seed, m-b frontier=m-c",
|
|
58
|
+
"",
|
|
59
|
+
].join("\n"),
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("same result renders the same bytes", () => {
|
|
64
|
+
const policy = () => "stop";
|
|
65
|
+
const first = renderDeepRecallTrace(runDeepRecall(seed({ budget: 3 }), policy));
|
|
66
|
+
const second = renderDeepRecallTrace(runDeepRecall(seed({ budget: 3 }), policy));
|
|
67
|
+
assert.equal(first, second);
|
|
68
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown renderer for a deep-recall trace (issue #2332 leftover).
|
|
3
|
+
*
|
|
4
|
+
* Deterministic. Surfaces wait. Empty working set prints (empty).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { DeepRecallResult } from "./recall-deep.js";
|
|
8
|
+
|
|
9
|
+
export function renderDeepRecallTrace(result: DeepRecallResult): string {
|
|
10
|
+
const last = result.trace[result.trace.length - 1];
|
|
11
|
+
const stop = !last ? "none" : last.budget <= 0 ? "budget exhausted" : last.action;
|
|
12
|
+
const steps =
|
|
13
|
+
result.trace.length === 0
|
|
14
|
+
? ["(empty)"]
|
|
15
|
+
: result.trace.map((step, index) => {
|
|
16
|
+
const workingSet = step.workingSet.length === 0 ? "(empty)" : step.workingSet.join(", ");
|
|
17
|
+
const frontier = step.frontier.length === 0 ? "(empty)" : step.frontier.join(", ");
|
|
18
|
+
return `${index + 1}. ${step.action} budget=${step.budget} workingSet=${workingSet} frontier=${frontier}`;
|
|
19
|
+
});
|
|
20
|
+
return [
|
|
21
|
+
"# Deep recall",
|
|
22
|
+
"",
|
|
23
|
+
`- query: ${result.state.query}`,
|
|
24
|
+
`- budget: ${result.state.budget}`,
|
|
25
|
+
`- stop: ${stop}`,
|
|
26
|
+
"",
|
|
27
|
+
"## Steps",
|
|
28
|
+
"",
|
|
29
|
+
...steps,
|
|
30
|
+
"",
|
|
31
|
+
].join("\n");
|
|
32
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
runDeepRecall,
|
|
6
|
+
runDeepRecallStep,
|
|
7
|
+
type DeepRecallState,
|
|
8
|
+
} from "./recall-deep.js";
|
|
9
|
+
|
|
10
|
+
function seed(extra: Partial<DeepRecallState> = {}): DeepRecallState {
|
|
11
|
+
return {
|
|
12
|
+
query: "who met at the cafe",
|
|
13
|
+
workingSet: ["m-seed"],
|
|
14
|
+
frontier: ["m-b", "m-c"],
|
|
15
|
+
budget: 2,
|
|
16
|
+
...extra,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
test("budget 0 stops without calling the policy", () => {
|
|
21
|
+
const result = runDeepRecall(seed({ budget: 0 }), () => {
|
|
22
|
+
throw new Error("policy must not run when budget is 0");
|
|
23
|
+
});
|
|
24
|
+
assert.equal(result.trace.length, 1);
|
|
25
|
+
assert.equal(result.trace[0]?.action, "stop");
|
|
26
|
+
assert.equal(result.state.budget, 0);
|
|
27
|
+
assert.deepEqual(result.state.workingSet, ["m-seed"]);
|
|
28
|
+
assert.deepEqual(result.state.frontier, ["m-b", "m-c"]);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("expand consumes budget and pulls the next frontier item", () => {
|
|
32
|
+
const result = runDeepRecallStep(seed({ budget: 2 }), "expand");
|
|
33
|
+
assert.equal(result.step.action, "expand");
|
|
34
|
+
assert.equal(result.state.budget, 1);
|
|
35
|
+
assert.deepEqual(result.state.workingSet, ["m-seed", "m-b"]);
|
|
36
|
+
assert.deepEqual(result.state.frontier, ["m-c"]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("stop ends while budget remains", () => {
|
|
40
|
+
let calls = 0;
|
|
41
|
+
const result = runDeepRecall(seed({ budget: 4 }), () => {
|
|
42
|
+
calls += 1;
|
|
43
|
+
return "stop";
|
|
44
|
+
});
|
|
45
|
+
assert.equal(calls, 1);
|
|
46
|
+
assert.equal(result.trace.length, 1);
|
|
47
|
+
assert.equal(result.trace[0]?.action, "stop");
|
|
48
|
+
assert.equal(result.state.budget, 4);
|
|
49
|
+
assert.deepEqual(result.state.workingSet, ["m-seed"]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("unknown action throws", () => {
|
|
53
|
+
assert.throws(() => runDeepRecallStep(seed(), "rewrite"), /unknown deep recall action/);
|
|
54
|
+
assert.throws(
|
|
55
|
+
() => runDeepRecall(seed(), () => "rewrite"),
|
|
56
|
+
/unknown deep recall action/,
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("same state and policy produce the same trace", () => {
|
|
61
|
+
const policy = (state: DeepRecallState) => (state.budget > 1 ? "expand" : "refine");
|
|
62
|
+
const start = seed({ budget: 3, frontier: ["m-z", "m-a"] });
|
|
63
|
+
const first = runDeepRecall(start, policy);
|
|
64
|
+
const second = runDeepRecall(start, policy);
|
|
65
|
+
assert.deepEqual(first, second);
|
|
66
|
+
assert.deepEqual(
|
|
67
|
+
first.trace.map((step) => step.action),
|
|
68
|
+
["expand", "expand", "refine", "stop"],
|
|
69
|
+
);
|
|
70
|
+
assert.equal(start.budget, 3);
|
|
71
|
+
assert.deepEqual(start.frontier, ["m-z", "m-a"]);
|
|
72
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Budgeted REFINE/EXPAND/STOP loop (issue #2332 first slice).
|
|
3
|
+
*
|
|
4
|
+
* Pure state stepper. Policy is injected. No LLM, no orchestrator recall,
|
|
5
|
+
* no IO. Surfaces and parseConfig wait for a later PR — config.ts is at
|
|
6
|
+
* its fileSizeGrandfather ceiling.
|
|
7
|
+
*
|
|
8
|
+
* Budget 0 stops without calling the policy. Unknown actions throw.
|
|
9
|
+
*/
|
|
10
|
+
export const DEEP_RECALL_ACTIONS = ["refine", "expand", "stop"] as const;
|
|
11
|
+
|
|
12
|
+
export type DeepRecallAction = (typeof DEEP_RECALL_ACTIONS)[number];
|
|
13
|
+
|
|
14
|
+
export interface DeepRecallState {
|
|
15
|
+
query: string;
|
|
16
|
+
workingSet: readonly string[];
|
|
17
|
+
frontier: readonly string[];
|
|
18
|
+
budget: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface DeepRecallTraceStep {
|
|
22
|
+
action: DeepRecallAction;
|
|
23
|
+
budget: number;
|
|
24
|
+
workingSet: readonly string[];
|
|
25
|
+
frontier: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface DeepRecallStepResult {
|
|
29
|
+
state: DeepRecallState;
|
|
30
|
+
step: DeepRecallTraceStep;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface DeepRecallResult {
|
|
34
|
+
state: DeepRecallState;
|
|
35
|
+
trace: readonly DeepRecallTraceStep[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type DeepRecallPolicy = (state: DeepRecallState) => string;
|
|
39
|
+
|
|
40
|
+
export function isDeepRecallAction(value: unknown): value is DeepRecallAction {
|
|
41
|
+
return typeof value === "string" && (DEEP_RECALL_ACTIONS as readonly string[]).includes(value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function snapshot(state: DeepRecallState): DeepRecallState {
|
|
45
|
+
return {
|
|
46
|
+
query: state.query,
|
|
47
|
+
workingSet: [...state.workingSet],
|
|
48
|
+
frontier: [...state.frontier],
|
|
49
|
+
budget: state.budget,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function runDeepRecallStep(state: DeepRecallState, action: string): DeepRecallStepResult {
|
|
54
|
+
if (!isDeepRecallAction(action)) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`unknown deep recall action: ${JSON.stringify(action)}. Valid: ${DEEP_RECALL_ACTIONS.join(", ")}`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (!Number.isFinite(state.budget) || state.budget <= 0 || action === "stop") {
|
|
60
|
+
const stopped = snapshot(state);
|
|
61
|
+
return {
|
|
62
|
+
state: stopped,
|
|
63
|
+
step: {
|
|
64
|
+
action: "stop",
|
|
65
|
+
budget: stopped.budget,
|
|
66
|
+
workingSet: stopped.workingSet,
|
|
67
|
+
frontier: stopped.frontier,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const next = snapshot(state);
|
|
73
|
+
next.budget = state.budget - 1;
|
|
74
|
+
if (action === "expand") {
|
|
75
|
+
const [head, ...rest] = next.frontier;
|
|
76
|
+
if (head !== undefined && !next.workingSet.includes(head)) {
|
|
77
|
+
next.workingSet = [...next.workingSet, head];
|
|
78
|
+
}
|
|
79
|
+
next.frontier = rest;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
state: next,
|
|
83
|
+
step: {
|
|
84
|
+
action,
|
|
85
|
+
budget: next.budget,
|
|
86
|
+
workingSet: next.workingSet,
|
|
87
|
+
frontier: next.frontier,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function runDeepRecall(state: DeepRecallState, policy: DeepRecallPolicy): DeepRecallResult {
|
|
93
|
+
const trace: DeepRecallTraceStep[] = [];
|
|
94
|
+
let current = snapshot(state);
|
|
95
|
+
while (true) {
|
|
96
|
+
if (!Number.isFinite(current.budget) || current.budget <= 0) {
|
|
97
|
+
const stopped = snapshot(current);
|
|
98
|
+
trace.push({
|
|
99
|
+
action: "stop",
|
|
100
|
+
budget: stopped.budget,
|
|
101
|
+
workingSet: stopped.workingSet,
|
|
102
|
+
frontier: stopped.frontier,
|
|
103
|
+
});
|
|
104
|
+
return { state: stopped, trace };
|
|
105
|
+
}
|
|
106
|
+
const stepped = runDeepRecallStep(current, policy(current));
|
|
107
|
+
trace.push(stepped.step);
|
|
108
|
+
current = stepped.state;
|
|
109
|
+
if (stepped.step.action === "stop") {
|
|
110
|
+
return { state: current, trace };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
expandRecallNode,
|
|
6
|
+
traverseRecallLink,
|
|
7
|
+
type RecallNavNode,
|
|
8
|
+
} from "./recall-navigate.js";
|
|
9
|
+
|
|
10
|
+
function node(extra: Partial<RecallNavNode> = {}): RecallNavNode {
|
|
11
|
+
return {
|
|
12
|
+
id: "m1",
|
|
13
|
+
disclosure: "chunk",
|
|
14
|
+
...extra,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
test("expandRecallNode budget 0 is a no-op unavailable", () => {
|
|
19
|
+
const source = node({
|
|
20
|
+
payloads: { section: "full section body" },
|
|
21
|
+
});
|
|
22
|
+
const result = expandRecallNode(source, { budget: 0 });
|
|
23
|
+
assert.equal(result.status, "unavailable");
|
|
24
|
+
if (result.status === "unavailable") {
|
|
25
|
+
assert.equal(result.reason, "budget_off");
|
|
26
|
+
}
|
|
27
|
+
assert.equal("node" in result, false);
|
|
28
|
+
assert.equal(source.disclosure, "chunk");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("traverseRecallLink budget 0 is a no-op unavailable", () => {
|
|
32
|
+
const result = traverseRecallLink(
|
|
33
|
+
node({
|
|
34
|
+
links: [{ targetId: "m2", linkType: "supports" }],
|
|
35
|
+
}),
|
|
36
|
+
"supports",
|
|
37
|
+
{ budget: 0 },
|
|
38
|
+
);
|
|
39
|
+
assert.equal(result.status, "unavailable");
|
|
40
|
+
if (result.status === "unavailable") {
|
|
41
|
+
assert.equal(result.reason, "budget_off");
|
|
42
|
+
}
|
|
43
|
+
assert.equal("neighbors" in result, false);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("unknown linkType throws", () => {
|
|
47
|
+
assert.throws(
|
|
48
|
+
() => traverseRecallLink(node({ links: [] }), "related", { budget: 10 }),
|
|
49
|
+
/unknown recall nav linkType/,
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("traverseRecallLink returns neighbors in deterministic targetId order", () => {
|
|
54
|
+
const result = traverseRecallLink(
|
|
55
|
+
node({
|
|
56
|
+
links: [
|
|
57
|
+
{ targetId: "z-mem", linkType: "contradicts" },
|
|
58
|
+
{ targetId: "a-mem", linkType: "contradicts" },
|
|
59
|
+
{ targetId: "m-mem", linkType: "contradicts" },
|
|
60
|
+
{ targetId: "skip-me", linkType: "supports" },
|
|
61
|
+
],
|
|
62
|
+
}),
|
|
63
|
+
"contradicts",
|
|
64
|
+
{ budget: 100 },
|
|
65
|
+
);
|
|
66
|
+
assert.equal(result.status, "ok");
|
|
67
|
+
if (result.status !== "ok") return;
|
|
68
|
+
assert.deepEqual(
|
|
69
|
+
result.neighbors.map((row) => row.id),
|
|
70
|
+
["a-mem", "m-mem", "z-mem"],
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("no matching links is empty, not unavailable", () => {
|
|
75
|
+
const result = traverseRecallLink(
|
|
76
|
+
node({
|
|
77
|
+
links: [{ targetId: "x", linkType: "supports" }],
|
|
78
|
+
}),
|
|
79
|
+
"contradicts",
|
|
80
|
+
{ budget: 10 },
|
|
81
|
+
);
|
|
82
|
+
assert.equal(result.status, "empty");
|
|
83
|
+
assert.equal("neighbors" in result, false);
|
|
84
|
+
});
|