@remnic/core 9.63.3 → 9.63.5
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 +23 -23
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +24 -24
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +23 -23
- package/dist/access-cli.js +55 -54
- 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 +23 -23
- 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 +13 -1
- package/dist/access-http-query.js +27 -24
- package/dist/access-http.d.ts +12 -12
- package/dist/access-http.js +34 -33
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +23 -23
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +23 -23
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +28 -28
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-yO4LMGFH.d.ts → access-namespace-preflight-DB0zXFek.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +23 -23
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +23 -23
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-offline-manifest.js +3 -3
- package/dist/access-operations-batch.js +24 -24
- package/dist/access-operations.d.ts +14 -14
- package/dist/access-operations.js +27 -27
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +23 -23
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +23 -23
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +23 -23
- package/dist/access-schema.d.ts +88 -88
- package/dist/{access-service-M4LgO141.d.ts → access-service-cKQrte9Z.d.ts} +71 -77
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +23 -23
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +25 -25
- 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/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 +11 -11
- 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/{capsule-merge-HCJJMLPS.js → capsule-merge-SGIVB3WA.js} +5 -5
- package/dist/{catalog-CyYTf_ok.d.ts → catalog-CCzmf8IH.d.ts} +3 -11
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +12 -12
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-XFCQIQQU.js → chunk-2UM6WHME.js} +3 -3
- package/dist/{chunk-6F2UMP4H.js → chunk-3Z5TGRFA.js} +8 -8
- package/dist/{chunk-JJX5XEIG.js → chunk-77QZW2D6.js} +4 -4
- package/dist/{chunk-X4MGNVOO.js → chunk-7AF243WZ.js} +1 -1
- package/dist/{chunk-2ASAS3CQ.js → chunk-7KQB4EBS.js} +2 -2
- package/dist/{chunk-3LJ2L3T3.js → chunk-7LF2OHIJ.js} +2 -2
- package/dist/{chunk-VAMQU4W7.js → chunk-AYVCKGA6.js} +2 -2
- package/dist/{chunk-GTRGH4ZT.js → chunk-BB2LH5JM.js} +2 -2
- package/dist/{chunk-XMMESCPD.js → chunk-C64XATK7.js} +17 -27
- package/dist/chunk-C64XATK7.js.map +1 -0
- package/dist/{chunk-6UZR7KEK.js → chunk-CUDSA46O.js} +8 -2
- package/dist/chunk-CUDSA46O.js.map +1 -0
- package/dist/{chunk-PADG72LJ.js → chunk-DXDAQZ2K.js} +2 -2
- package/dist/{chunk-EJQXDKYK.js → chunk-DYZR3Z6D.js} +3 -3
- package/dist/{chunk-VN7IIQGS.js → chunk-E4KMY4KR.js} +2 -2
- package/dist/{chunk-ZQKXRKMR.js → chunk-EFKZT6AY.js} +2 -2
- package/dist/{chunk-DNRTKO2U.js → chunk-EJY3HJMT.js} +2 -2
- package/dist/{chunk-RYGJGXL6.js → chunk-ERPBRXVZ.js} +2 -2
- package/dist/{chunk-5UFQCU6M.js → chunk-F6JYBVL6.js} +27 -57
- package/dist/{chunk-5UFQCU6M.js.map → chunk-F6JYBVL6.js.map} +1 -1
- package/dist/{chunk-JWPG65LH.js → chunk-FHKXVTM5.js} +38 -39
- package/dist/chunk-FHKXVTM5.js.map +1 -0
- package/dist/{chunk-RPKJHYVE.js → chunk-FPEZ74F7.js} +2 -2
- package/dist/{chunk-Z334TJRB.js → chunk-GF7RQWXC.js} +2 -2
- package/dist/{chunk-6D7PZKCJ.js → chunk-GG4DN63W.js} +2 -2
- package/dist/{chunk-IM56VPKO.js → chunk-GTD4Q62X.js} +2 -6
- package/dist/{chunk-A73QHOZP.js → chunk-I5FLIB2J.js} +2 -2
- package/dist/{chunk-JJ7JW62R.js → chunk-IVXVLDNT.js} +12 -22
- package/dist/chunk-IVXVLDNT.js.map +1 -0
- package/dist/{chunk-NRFU5MVH.js → chunk-JOEJG4SD.js} +47 -1
- package/dist/chunk-JOEJG4SD.js.map +1 -0
- package/dist/{chunk-EJLTNPRY.js → chunk-KHCUVYCY.js} +3 -3
- package/dist/{chunk-QSIQVC32.js → chunk-KYTRF64R.js} +2 -2
- package/dist/{chunk-R74NCKEY.js → chunk-LX4TNSAE.js} +4 -4
- package/dist/{chunk-H6ZXNH5I.js → chunk-MUJ4QFUQ.js} +3 -3
- package/dist/{chunk-4NMVX5U7.js → chunk-NA56NSKL.js} +2 -2
- package/dist/{chunk-MR5HWQHS.js → chunk-NKB43PGI.js} +2 -2
- package/dist/{chunk-DLQQU4EG.js → chunk-NS5ETDYD.js} +2 -2
- package/dist/{chunk-44KHFMCM.js → chunk-OETHJBAL.js} +76 -53
- package/dist/{chunk-44KHFMCM.js.map → chunk-OETHJBAL.js.map} +1 -1
- package/dist/{chunk-KWN6NOHQ.js → chunk-PB4WVYGC.js} +2 -2
- package/dist/{chunk-Q35XGIEM.js → chunk-PBRCYYO7.js} +2 -2
- package/dist/{chunk-QYN5PXDZ.js → chunk-PMVPCZJZ.js} +4 -4
- package/dist/{chunk-AJSZ2EK6.js → chunk-QI5RDDEL.js} +3 -3
- package/dist/{chunk-I6OQCT3Y.js → chunk-QRWMS6SI.js} +2 -2
- package/dist/{chunk-ITYAXU4S.js → chunk-R6UMNP5C.js} +3 -3
- package/dist/{chunk-5W62VEFH.js → chunk-RWMSMTQP.js} +2 -2
- package/dist/{chunk-FKJVEW6O.js → chunk-SYVGVK4S.js} +2 -2
- package/dist/{chunk-TRPX6F2G.js → chunk-TSTI6A3A.js} +10 -13
- package/dist/chunk-TSTI6A3A.js.map +1 -0
- package/dist/{chunk-XZPSBGHA.js → chunk-UCLMKNHA.js} +2 -2
- package/dist/{chunk-ZMSZVISA.js → chunk-UFKPQBXH.js} +3 -3
- package/dist/{chunk-B2OOJCUX.js → chunk-UGHCZS6K.js} +2 -2
- package/dist/chunk-V3KIRICY.js +727 -0
- package/dist/chunk-V3KIRICY.js.map +1 -0
- package/dist/{chunk-6ZYQ36IB.js → chunk-VPHSMJ2E.js} +15 -2
- package/dist/chunk-VPHSMJ2E.js.map +1 -0
- package/dist/{chunk-E2GYBTSP.js → chunk-VYEPACWY.js} +2 -2
- package/dist/{chunk-5W5N7XJZ.js → chunk-X7LEDA74.js} +20 -753
- package/dist/chunk-X7LEDA74.js.map +1 -0
- package/dist/{chunk-KMAP7SNQ.js → chunk-XCB6QDL6.js} +2 -2
- package/dist/{chunk-WDUG2CH3.js → chunk-YEQCMA5L.js} +2 -2
- package/dist/{chunk-LZCSOUJ7.js → chunk-YFCEBB5P.js} +2 -2
- package/dist/{chunk-IKXUG6KC.js → chunk-YXMHUBN2.js} +2 -2
- package/dist/{chunk-GFNS3BHV.js → chunk-ZUPKNWRZ.js} +3 -3
- package/dist/{chunk-GSTIBXBW.js → chunk-ZVPVTPGI.js} +2 -2
- package/dist/{cli-Bw9z-KqX.d.ts → cli-BFBDYV0D.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +45 -44
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +11 -11
- 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/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +11 -11
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +11 -11
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-provenance-check.js +5 -5
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/consolidation-undo.js +4 -4
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +13 -13
- 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 +13 -13
- 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-BxhvAppj.d.ts → dependency-propagation-delivery-DiY5T63p.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 +11 -11
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +5 -5
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +24 -24
- 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.d.ts +1 -1
- package/dist/extraction.js +14 -14
- 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-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.d.ts +1 -1
- 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.ts +697 -697
- package/dist/index.js +57 -56
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +11 -11
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +11 -11
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +12 -12
- package/dist/{maintenance-uJb74j64.d.ts → maintenance-CaqA4z7V.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-cache.js +1 -1
- package/dist/memory-corpus-version.js +2 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +12 -12
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +11 -11
- 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 +14 -14
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +20 -19
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +17 -16
- package/dist/{orchestrator-CFi-5JSR.d.ts → orchestrator-CSc9GfQv.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +55 -54
- package/dist/page-versioning.js +4 -4
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-BdF3ferY.d.ts → pipeline-X606GdRJ.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-DK-QwaBu.d.ts → public-http-8PcrDIYi.d.ts} +1 -1
- package/dist/{qmd-CBSxevyb.d.ts → qmd-DCKeR-GX.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 +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/manifest.js +2 -2
- 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/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 +108 -108
- package/dist/{scope-profiles-CeMv7pP0.d.ts → scope-profiles-_Y_RHCeE.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 +3 -3
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +3 -3
- 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-B-85brYj.d.ts → semantic-consolidation-DT2VSrU0.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +12 -12
- package/dist/semantic-rule-promotion.js +11 -11
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +11 -11
- package/dist/{service-CoO0HA2E.d.ts → service-BMo-gwDE.d.ts} +3 -3
- 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 +9 -9
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +13 -13
- package/dist/{storage-BVAVitkO.d.ts → storage-CGzJGUUu.d.ts} +49 -24
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +10 -10
- 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 +26 -26
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/capsule-import.js +5 -5
- package/dist/transfer/types.d.ts +66 -66
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DWHOxlZP.d.ts → types-CBEAYU76.d.ts} +112 -128
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +11 -11
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-http-query.ts +12 -0
- package/src/access-http.test.ts +32 -0
- package/src/access-http.ts +3 -7
- package/src/admin/admin-surfaces.test.ts +5 -10
- package/src/admin/admin-surfaces.ts +0 -16
- package/src/binary-lifecycle/pipeline.test.ts +1 -1
- package/src/binary-lifecycle/pipeline.ts +23 -9
- package/src/buffer.ts +6 -0
- package/src/chat/chat-cli.test.ts +53 -0
- package/src/chat/chat-cli.ts +22 -58
- package/src/dedup/index.test.ts +65 -1
- package/src/dedup/index.ts +24 -2
- package/src/maintenance/namespace-planner.ts +0 -2
- package/src/meetings/build.test.ts +20 -4
- package/src/meetings/build.ts +2 -2
- package/src/meetings/day-source.test.ts +3 -1
- package/src/meetings/day-source.ts +1 -12
- package/src/meetings/fuse.test.ts +64 -15
- package/src/meetings/fuse.ts +18 -12
- package/src/meetings/types.ts +4 -19
- package/src/memory-cache-derived.test.ts +90 -0
- package/src/memory-cache.ts +40 -42
- package/src/namespaces/catalog.test.ts +53 -8
- package/src/namespaces/catalog.ts +5 -37
- package/src/orchestration/turn-ingestion-snapshot.test.ts +167 -0
- package/src/orchestration/turn-ingestion.ts +2 -1
- package/src/storage/content-hash-index.ts +54 -0
- package/src/storage-contract/content-hash.test.ts +59 -1
- package/src/storage-fact-hash-index-defer.test.ts +9 -9
- package/src/storage.ts +39 -40
- package/dist/chunk-5W5N7XJZ.js.map +0 -1
- package/dist/chunk-6UZR7KEK.js.map +0 -1
- package/dist/chunk-6ZYQ36IB.js.map +0 -1
- package/dist/chunk-JJ7JW62R.js.map +0 -1
- package/dist/chunk-JWPG65LH.js.map +0 -1
- package/dist/chunk-NRFU5MVH.js.map +0 -1
- package/dist/chunk-TRPX6F2G.js.map +0 -1
- package/dist/chunk-XMMESCPD.js.map +0 -1
- /package/dist/{capsule-merge-HCJJMLPS.js.map → capsule-merge-SGIVB3WA.js.map} +0 -0
- /package/dist/{chunk-XFCQIQQU.js.map → chunk-2UM6WHME.js.map} +0 -0
- /package/dist/{chunk-6F2UMP4H.js.map → chunk-3Z5TGRFA.js.map} +0 -0
- /package/dist/{chunk-JJX5XEIG.js.map → chunk-77QZW2D6.js.map} +0 -0
- /package/dist/{chunk-X4MGNVOO.js.map → chunk-7AF243WZ.js.map} +0 -0
- /package/dist/{chunk-2ASAS3CQ.js.map → chunk-7KQB4EBS.js.map} +0 -0
- /package/dist/{chunk-3LJ2L3T3.js.map → chunk-7LF2OHIJ.js.map} +0 -0
- /package/dist/{chunk-VAMQU4W7.js.map → chunk-AYVCKGA6.js.map} +0 -0
- /package/dist/{chunk-GTRGH4ZT.js.map → chunk-BB2LH5JM.js.map} +0 -0
- /package/dist/{chunk-PADG72LJ.js.map → chunk-DXDAQZ2K.js.map} +0 -0
- /package/dist/{chunk-EJQXDKYK.js.map → chunk-DYZR3Z6D.js.map} +0 -0
- /package/dist/{chunk-VN7IIQGS.js.map → chunk-E4KMY4KR.js.map} +0 -0
- /package/dist/{chunk-ZQKXRKMR.js.map → chunk-EFKZT6AY.js.map} +0 -0
- /package/dist/{chunk-DNRTKO2U.js.map → chunk-EJY3HJMT.js.map} +0 -0
- /package/dist/{chunk-RYGJGXL6.js.map → chunk-ERPBRXVZ.js.map} +0 -0
- /package/dist/{chunk-RPKJHYVE.js.map → chunk-FPEZ74F7.js.map} +0 -0
- /package/dist/{chunk-Z334TJRB.js.map → chunk-GF7RQWXC.js.map} +0 -0
- /package/dist/{chunk-6D7PZKCJ.js.map → chunk-GG4DN63W.js.map} +0 -0
- /package/dist/{chunk-IM56VPKO.js.map → chunk-GTD4Q62X.js.map} +0 -0
- /package/dist/{chunk-A73QHOZP.js.map → chunk-I5FLIB2J.js.map} +0 -0
- /package/dist/{chunk-EJLTNPRY.js.map → chunk-KHCUVYCY.js.map} +0 -0
- /package/dist/{chunk-QSIQVC32.js.map → chunk-KYTRF64R.js.map} +0 -0
- /package/dist/{chunk-R74NCKEY.js.map → chunk-LX4TNSAE.js.map} +0 -0
- /package/dist/{chunk-H6ZXNH5I.js.map → chunk-MUJ4QFUQ.js.map} +0 -0
- /package/dist/{chunk-4NMVX5U7.js.map → chunk-NA56NSKL.js.map} +0 -0
- /package/dist/{chunk-MR5HWQHS.js.map → chunk-NKB43PGI.js.map} +0 -0
- /package/dist/{chunk-DLQQU4EG.js.map → chunk-NS5ETDYD.js.map} +0 -0
- /package/dist/{chunk-KWN6NOHQ.js.map → chunk-PB4WVYGC.js.map} +0 -0
- /package/dist/{chunk-Q35XGIEM.js.map → chunk-PBRCYYO7.js.map} +0 -0
- /package/dist/{chunk-QYN5PXDZ.js.map → chunk-PMVPCZJZ.js.map} +0 -0
- /package/dist/{chunk-AJSZ2EK6.js.map → chunk-QI5RDDEL.js.map} +0 -0
- /package/dist/{chunk-I6OQCT3Y.js.map → chunk-QRWMS6SI.js.map} +0 -0
- /package/dist/{chunk-ITYAXU4S.js.map → chunk-R6UMNP5C.js.map} +0 -0
- /package/dist/{chunk-5W62VEFH.js.map → chunk-RWMSMTQP.js.map} +0 -0
- /package/dist/{chunk-FKJVEW6O.js.map → chunk-SYVGVK4S.js.map} +0 -0
- /package/dist/{chunk-XZPSBGHA.js.map → chunk-UCLMKNHA.js.map} +0 -0
- /package/dist/{chunk-ZMSZVISA.js.map → chunk-UFKPQBXH.js.map} +0 -0
- /package/dist/{chunk-B2OOJCUX.js.map → chunk-UGHCZS6K.js.map} +0 -0
- /package/dist/{chunk-E2GYBTSP.js.map → chunk-VYEPACWY.js.map} +0 -0
- /package/dist/{chunk-KMAP7SNQ.js.map → chunk-XCB6QDL6.js.map} +0 -0
- /package/dist/{chunk-WDUG2CH3.js.map → chunk-YEQCMA5L.js.map} +0 -0
- /package/dist/{chunk-LZCSOUJ7.js.map → chunk-YFCEBB5P.js.map} +0 -0
- /package/dist/{chunk-IKXUG6KC.js.map → chunk-YXMHUBN2.js.map} +0 -0
- /package/dist/{chunk-GFNS3BHV.js.map → chunk-ZUPKNWRZ.js.map} +0 -0
- /package/dist/{chunk-GSTIBXBW.js.map → chunk-ZVPVTPGI.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PluginConfig } from './types-
|
|
1
|
+
import { P as PluginConfig } from './types-CBEAYU76.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Rebuildable namespace catalog (issue #1499).
|
|
@@ -33,16 +33,12 @@ import { P as PluginConfig } from './types-DWHOxlZP.js';
|
|
|
33
33
|
* failure-tolerant append). The internal serialized write chain recovers from
|
|
34
34
|
* rejection so one failed append cannot poison subsequent writes.
|
|
35
35
|
*/
|
|
36
|
-
type NamespaceKind = "default" | "
|
|
36
|
+
type NamespaceKind = "default" | "shared" | "project" | "branch" | "team-project" | "explicit";
|
|
37
37
|
type NamespaceDiscoverySource = "config" | "write" | "read" | "scan" | "migration";
|
|
38
38
|
interface NamespaceRecord {
|
|
39
39
|
namespace: string;
|
|
40
40
|
identityToken: string;
|
|
41
41
|
kind: NamespaceKind;
|
|
42
|
-
principal?: string;
|
|
43
|
-
projectId?: string;
|
|
44
|
-
branch?: string;
|
|
45
|
-
parentNamespace?: string;
|
|
46
42
|
createdAt: string;
|
|
47
43
|
lastReadAt?: string;
|
|
48
44
|
lastWriteAt?: string;
|
|
@@ -59,10 +55,6 @@ interface NamespaceCatalogFilter {
|
|
|
59
55
|
interface NamespaceTouchMetadata {
|
|
60
56
|
discoveredBy?: NamespaceDiscoverySource;
|
|
61
57
|
kind?: NamespaceKind;
|
|
62
|
-
principal?: string;
|
|
63
|
-
projectId?: string;
|
|
64
|
-
branch?: string;
|
|
65
|
-
parentNamespace?: string;
|
|
66
58
|
/** Explicit storage dir (when the caller already resolved it). */
|
|
67
59
|
storageDir?: string;
|
|
68
60
|
/** Override the touch timestamp (mainly for tests / migration replay). */
|
|
@@ -478,4 +470,4 @@ declare class NamespaceCatalog {
|
|
|
478
470
|
private refreshCacheIdentity;
|
|
479
471
|
}
|
|
480
472
|
|
|
481
|
-
export {
|
|
473
|
+
export { type NamespaceKind as N, NamespaceCatalog as a, type NamespaceRecord as b, type NamespaceCatalogFilter as c, type NamespaceCatalogRebuildResult as d, type NamespaceCatalogSkippedRoot as e, type NamespaceDiscoverySource as f, type NamespaceTouchMetadata as g };
|
|
@@ -2,7 +2,7 @@ import { CausalChainIndex } from './causal-chain.js';
|
|
|
2
2
|
import { ConsolidatedPreference } from './compounding/preference-consolidator.js';
|
|
3
3
|
import './causal-trajectory.js';
|
|
4
4
|
import './objective-state.js';
|
|
5
|
-
import './types-
|
|
5
|
+
import './types-CBEAYU76.js';
|
|
6
6
|
import './message-parts/index.js';
|
|
7
7
|
import './bounded-jsonl-state.js';
|
|
8
8
|
import './operator-doctor-types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GatewayConfig, A as AgentPersonaModelConfig, P as PluginConfig, M as MemoryFile } from './types-
|
|
1
|
+
import { G as GatewayConfig, A as AgentPersonaModelConfig, P as PluginConfig, M as MemoryFile } from './types-CBEAYU76.js';
|
|
2
2
|
import { RolloutSummaryInput, MaterializeResult } from './connectors/codex-materialize.js';
|
|
3
3
|
import './message-parts/index.js';
|
|
4
4
|
import './bounded-jsonl-state.js';
|
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
} from "./chunk-2PSX5BJU.js";
|
|
5
5
|
import {
|
|
6
6
|
buildExtensionsBlockForConsolidation
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DXDAQZ2K.js";
|
|
8
8
|
import "./chunk-5JMAGU26.js";
|
|
9
9
|
import "./chunk-B7RWBZXW.js";
|
|
10
10
|
import {
|
|
11
11
|
runPostConsolidationMaterialize
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YEQCMA5L.js";
|
|
13
13
|
import "./chunk-RDFF2NAU.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveCausalTrajectoryStoreDir
|
|
16
16
|
} from "./chunk-GPFZFCRN.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-FHKXVTM5.js";
|
|
18
18
|
import "./chunk-46WM6JX2.js";
|
|
19
19
|
import "./chunk-UHVXE24Y.js";
|
|
20
20
|
import "./chunk-SXIMQLGV.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-GF7RQWXC.js";
|
|
22
|
+
import "./chunk-GG4DN63W.js";
|
|
23
23
|
import "./chunk-OQIRBGUU.js";
|
|
24
24
|
import "./chunk-VANZKHTN.js";
|
|
25
25
|
import "./chunk-CYEPCZN5.js";
|
|
@@ -41,24 +41,24 @@ import "./chunk-DM2T26WE.js";
|
|
|
41
41
|
import "./chunk-LDXUBPMO.js";
|
|
42
42
|
import "./chunk-UG6VXIOK.js";
|
|
43
43
|
import "./chunk-AAD2ZS6P.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-MUJ4QFUQ.js";
|
|
45
45
|
import "./chunk-LCU5R6TQ.js";
|
|
46
46
|
import "./chunk-BT7NVCML.js";
|
|
47
47
|
import "./chunk-YXZG5TVN.js";
|
|
48
48
|
import "./chunk-3ONXXHQO.js";
|
|
49
49
|
import "./chunk-5GINB5LC.js";
|
|
50
50
|
import "./chunk-G7D6GZ5J.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-UFKPQBXH.js";
|
|
52
|
+
import "./chunk-XCB6QDL6.js";
|
|
53
53
|
import "./chunk-RBOJCG4T.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-ZVPVTPGI.js";
|
|
55
55
|
import "./chunk-5WITETWU.js";
|
|
56
56
|
import "./chunk-6CIAGZ6X.js";
|
|
57
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-VYEPACWY.js";
|
|
58
58
|
import "./chunk-URS5GSM7.js";
|
|
59
59
|
import "./chunk-ZLQ37WJX.js";
|
|
60
60
|
import "./chunk-IUM3VSHI.js";
|
|
61
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-C64XATK7.js";
|
|
62
62
|
import "./chunk-42JKGUFJ.js";
|
|
63
63
|
import {
|
|
64
64
|
FallbackLlmClient,
|
|
@@ -87,7 +87,7 @@ import "./chunk-DVYRD4HY.js";
|
|
|
87
87
|
import "./chunk-ZA53AZND.js";
|
|
88
88
|
import "./chunk-GCASGYIO.js";
|
|
89
89
|
import "./chunk-7RJUVTVF.js";
|
|
90
|
-
import "./chunk-
|
|
90
|
+
import "./chunk-JOEJG4SD.js";
|
|
91
91
|
import "./chunk-2LWQSV6A.js";
|
|
92
92
|
import "./chunk-RL6NEVXT.js";
|
|
93
93
|
import "./chunk-5FVVY2EB.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as GraphEdge } from './graph-444E-DrF.js';
|
|
2
2
|
import { CausalTrajectoryRecord } from './causal-trajectory.js';
|
|
3
3
|
import './capabilities.js';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-CBEAYU76.js';
|
|
5
5
|
import './message-parts/index.js';
|
|
6
6
|
import './bounded-jsonl-state.js';
|
|
7
7
|
import './operator-doctor-types.js';
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-B7RWBZXW.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHKXVTM5.js";
|
|
7
7
|
import {
|
|
8
8
|
getCachedEpisodeMap,
|
|
9
9
|
setCachedEpisodeMap
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C64XATK7.js";
|
|
11
11
|
import {
|
|
12
12
|
countRecallTokenOverlap,
|
|
13
13
|
normalizeRecallTokens
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
compareVerifiedEpisodeResults,
|
|
110
110
|
searchVerifiedEpisodes
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-2UM6WHME.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
readNamespaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V3KIRICY.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzeSessionIntegrity,
|
|
9
9
|
applySessionRepair,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-CMTINOFS.js";
|
|
15
15
|
import {
|
|
16
16
|
summarizeCorpusAndReplica
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UGHCZS6K.js";
|
|
18
18
|
import {
|
|
19
19
|
readJudgeVerdictStats
|
|
20
20
|
} from "./chunk-OZKOPQCM.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from "./chunk-2DQ2XREU.js";
|
|
33
33
|
import {
|
|
34
34
|
runConsolidationProvenanceCheck
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-7KQB4EBS.js";
|
|
36
36
|
import {
|
|
37
37
|
reportBufferSurpriseDistribution
|
|
38
38
|
} from "./chunk-YBPYIAA5.js";
|
|
@@ -41,20 +41,20 @@ import {
|
|
|
41
41
|
} from "./chunk-RYST72N5.js";
|
|
42
42
|
import {
|
|
43
43
|
readAggregateExtractionWatermark
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YFCEBB5P.js";
|
|
45
45
|
import {
|
|
46
46
|
listMemoryGovernanceRuns,
|
|
47
47
|
readMemoryGovernanceRunArtifact
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-77QZW2D6.js";
|
|
49
49
|
import {
|
|
50
50
|
listNamespaces
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZUPKNWRZ.js";
|
|
52
52
|
import {
|
|
53
53
|
analyzeGraphHealth
|
|
54
54
|
} from "./chunk-YMOPYG3K.js";
|
|
55
55
|
import {
|
|
56
56
|
StorageManager
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-FHKXVTM5.js";
|
|
58
58
|
import {
|
|
59
59
|
lintWorkspaceFiles
|
|
60
60
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1683,4 +1683,4 @@ export {
|
|
|
1683
1683
|
runBenchmarkRecall,
|
|
1684
1684
|
runOperatorRepair
|
|
1685
1685
|
};
|
|
1686
|
-
//# sourceMappingURL=chunk-
|
|
1686
|
+
//# sourceMappingURL=chunk-3Z5TGRFA.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHKXVTM5.js";
|
|
4
4
|
import {
|
|
5
5
|
bumpMemoryCorpusVersionForDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XCB6QDL6.js";
|
|
7
7
|
import {
|
|
8
8
|
requestEntityCanonicalIdReconcile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZVPVTPGI.js";
|
|
10
10
|
import {
|
|
11
11
|
decideLifecycleTransition
|
|
12
12
|
} from "./chunk-TBBDFYXW.js";
|
|
@@ -765,4 +765,4 @@ export {
|
|
|
765
765
|
listMemoryGovernanceRuns,
|
|
766
766
|
readMemoryGovernanceRunArtifact
|
|
767
767
|
};
|
|
768
|
-
//# sourceMappingURL=chunk-
|
|
768
|
+
//# sourceMappingURL=chunk-77QZW2D6.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-G7D6GZ5J.js";
|
|
5
5
|
import {
|
|
6
6
|
sidecarKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UFKPQBXH.js";
|
|
8
8
|
import {
|
|
9
9
|
RECALL_FALLBACK_DIRS
|
|
10
10
|
} from "./chunk-VS2IYZRU.js";
|
|
@@ -342,4 +342,4 @@ function isPathWithin(candidate, root) {
|
|
|
342
342
|
export {
|
|
343
343
|
runConsolidationProvenanceCheck
|
|
344
344
|
};
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
345
|
+
//# sourceMappingURL=chunk-7KQB4EBS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHKXVTM5.js";
|
|
4
4
|
import {
|
|
5
5
|
composeMemoryEnvelope
|
|
6
6
|
} from "./chunk-LCU5R6TQ.js";
|
|
@@ -546,4 +546,4 @@ export {
|
|
|
546
546
|
setSemanticRulePromotionTestHooks,
|
|
547
547
|
promoteSemanticRuleFromMemory
|
|
548
548
|
};
|
|
549
|
-
//# sourceMappingURL=chunk-
|
|
549
|
+
//# sourceMappingURL=chunk-7LF2OHIJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHKXVTM5.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeEntityName
|
|
6
6
|
} from "./chunk-YXZG5TVN.js";
|
|
@@ -956,4 +956,4 @@ export {
|
|
|
956
956
|
resolveBriefingSaveDir,
|
|
957
957
|
briefingFilename
|
|
958
958
|
};
|
|
959
|
-
//# sourceMappingURL=chunk-
|
|
959
|
+
//# sourceMappingURL=chunk-AYVCKGA6.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-OD4FM2U7.js";
|
|
8
8
|
import {
|
|
9
9
|
parseQmdExplain
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VYEPACWY.js";
|
|
11
11
|
import {
|
|
12
12
|
classifyOrigin
|
|
13
13
|
} from "./chunk-6Q3ZTEF6.js";
|
|
@@ -1698,4 +1698,4 @@ export {
|
|
|
1698
1698
|
ExtractionDeadlineError,
|
|
1699
1699
|
ExtractionRunCoordinator
|
|
1700
1700
|
};
|
|
1701
|
-
//# sourceMappingURL=chunk-
|
|
1701
|
+
//# sourceMappingURL=chunk-BB2LH5JM.js.map
|
|
@@ -11,15 +11,19 @@ function sweepExpiredHotEntries(now) {
|
|
|
11
11
|
if (entry.ttlMs > 0 && now - entry.loadedAt > entry.ttlMs) hotCacheByDir.delete(dir);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function getVersionedCacheEntry(cache, key, currentVersion, keyId, ttlMs) {
|
|
15
15
|
if (currentVersion === 0) return null;
|
|
16
|
-
const entry =
|
|
16
|
+
const entry = cache.get(key);
|
|
17
17
|
if (!entry || entry.version !== currentVersion || entry.keyId !== keyId) return null;
|
|
18
18
|
if (ttlMs > 0 && Date.now() - entry.loadedAt > ttlMs) {
|
|
19
|
-
|
|
19
|
+
cache.delete(key);
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return entry;
|
|
23
|
+
}
|
|
24
|
+
function getCachedMemories(baseDir, currentVersion, keyId = "", ttlMs = 0) {
|
|
25
|
+
const entry = getVersionedCacheEntry(hotCacheByDir, baseDir, currentVersion, keyId, ttlMs);
|
|
26
|
+
return entry ? [...entry.memories.values()] : null;
|
|
23
27
|
}
|
|
24
28
|
function setCachedMemories(baseDir, memories, version, keyId = "", ttlMs = 0) {
|
|
25
29
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -37,10 +41,8 @@ function updateCacheOnDelete(baseDir, filePath, keyId = "") {
|
|
|
37
41
|
if (entry && entry.keyId === keyId) entry.memories.delete(filePath);
|
|
38
42
|
}
|
|
39
43
|
function getCachedArchivedMemories(baseDir, currentVersion, keyId = "") {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!entry || entry.version !== currentVersion || entry.keyId !== keyId) return null;
|
|
43
|
-
return [...entry.memories.values()];
|
|
44
|
+
const entry = getVersionedCacheEntry(archiveCacheByDir, baseDir, currentVersion, keyId, 0);
|
|
45
|
+
return entry ? [...entry.memories.values()] : null;
|
|
44
46
|
}
|
|
45
47
|
function setCachedArchivedMemories(baseDir, memories, version, keyId = "") {
|
|
46
48
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -79,14 +81,8 @@ function invalidateCachedEntities(baseDir) {
|
|
|
79
81
|
var episodeMapByDir = /* @__PURE__ */ new Map();
|
|
80
82
|
var ruleMemoriesByDir = /* @__PURE__ */ new Map();
|
|
81
83
|
function getCachedEpisodeMap(baseDir, currentVersion, keyId = "", ttlMs = 0) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!entry || entry.sourceVersion !== currentVersion || entry.keyId !== keyId) return null;
|
|
85
|
-
if (ttlMs > 0 && Date.now() - entry.loadedAt > ttlMs) {
|
|
86
|
-
episodeMapByDir.delete(baseDir);
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
return entry.data;
|
|
84
|
+
const entry = getVersionedCacheEntry(episodeMapByDir, baseDir, currentVersion, keyId, ttlMs);
|
|
85
|
+
return entry ? entry.data : null;
|
|
90
86
|
}
|
|
91
87
|
function setCachedEpisodeMap(baseDir, memories, version, cache = true, keyId = "") {
|
|
92
88
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -95,18 +91,12 @@ function setCachedEpisodeMap(baseDir, memories, version, cache = true, keyId = "
|
|
|
95
91
|
if (m.frontmatter.memoryKind !== "episode") continue;
|
|
96
92
|
map.set(m.frontmatter.id, m);
|
|
97
93
|
}
|
|
98
|
-
if (cache) episodeMapByDir.set(baseDir, { data: map,
|
|
94
|
+
if (cache) episodeMapByDir.set(baseDir, { data: map, version, keyId, loadedAt: Date.now() });
|
|
99
95
|
return map;
|
|
100
96
|
}
|
|
101
97
|
function getCachedRuleMemories(baseDir, currentVersion, keyId = "", ttlMs = 0) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (!entry || entry.sourceVersion !== currentVersion || entry.keyId !== keyId) return null;
|
|
105
|
-
if (ttlMs > 0 && Date.now() - entry.loadedAt > ttlMs) {
|
|
106
|
-
ruleMemoriesByDir.delete(baseDir);
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
return entry.data;
|
|
98
|
+
const entry = getVersionedCacheEntry(ruleMemoriesByDir, baseDir, currentVersion, keyId, ttlMs);
|
|
99
|
+
return entry ? entry.data : null;
|
|
110
100
|
}
|
|
111
101
|
function setCachedRuleMemories(baseDir, memories, version, cache = true, keyId = "") {
|
|
112
102
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -118,7 +108,7 @@ function setCachedRuleMemories(baseDir, memories, version, cache = true, keyId =
|
|
|
118
108
|
}
|
|
119
109
|
}
|
|
120
110
|
const result = { all, byId };
|
|
121
|
-
if (cache) ruleMemoriesByDir.set(baseDir, { data: result,
|
|
111
|
+
if (cache) ruleMemoriesByDir.set(baseDir, { data: result, version, keyId, loadedAt: Date.now() });
|
|
122
112
|
return result;
|
|
123
113
|
}
|
|
124
114
|
var QMD_CACHE_TTL_MS = 6e4;
|
|
@@ -278,4 +268,4 @@ export {
|
|
|
278
268
|
clearQmdResultCaches,
|
|
279
269
|
getMemoryCacheStats
|
|
280
270
|
};
|
|
281
|
-
//# sourceMappingURL=chunk-
|
|
271
|
+
//# sourceMappingURL=chunk-C64XATK7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/memory-cache.ts"],"sourcesContent":["import type { EntityFile, MemoryFile } from \"./types.js\";\nimport { clearQmdRecallCache, qmdRecallCacheSize } from \"./qmd-recall-cache.js\";\n\ninterface CacheEntry {\n memories: Map<string, MemoryFile>; // keyed by file path\n version: number;\n loadedAt: number;\n // Secure-store key identity that decrypted these memories (issue #1902, Codex\n // P1). \"\" for plaintext/locked stores. A manager only reads an entry whose\n // keyId matches its own, so a locked/unkeyed instance never sees content\n // another instance decrypted under a key for the same baseDir.\n keyId: string;\n // Effective TTL (ms) this entry was stored under (issue #1902, Codex Medium),\n // so the opportunistic sweep can evict abandoned corpora that are never\n // revisited. 0 = no TTL (never swept by age).\n ttlMs: number;\n}\n\n// Module-level singleton — shared across all StorageManager instances and sessions\nconst hotCacheByDir = new Map<string, CacheEntry>();\nconst archiveCacheByDir = new Map<string, CacheEntry>();\n\n/**\n * Evict every hot entry whose own TTL has elapsed (issue #1902, Codex Medium).\n * Called opportunistically on each set so a long-running process that reads many\n * namespace/temporary roots and never revisits some of them still releases their\n * (potentially hundreds-of-MB) corpora within the TTL, instead of holding them\n * resident until an explicit global clear. O(entries) over a small map.\n */\nfunction sweepExpiredHotEntries(now: number): void {\n for (const [dir, entry] of hotCacheByDir) {\n if (entry.ttlMs > 0 && now - entry.loadedAt > entry.ttlMs) hotCacheByDir.delete(dir);\n }\n}\n\n/**\n * Shared read gate for every versioned cache layer (issue #2481): serve an\n * entry only when its version and secure-store keyId match the caller.\n * `currentVersion === 0` means version tracking is unavailable (tests, fresh\n * installs) and always misses so disk is read. The TTL is a safety net for\n * external filesystem edits that bypass the version sentinel (issue #1902):\n * ttlMs <= 0 disables it, and on expiry the entry is evicted — not just\n * skipped — so a stale dir releases its resident corpus instead of lingering\n * until an explicit clear.\n */\nfunction getVersionedCacheEntry<K, E extends { version: number; keyId: string; loadedAt: number }>(\n cache: Map<K, E>,\n key: K,\n currentVersion: number,\n keyId: string,\n ttlMs: number,\n): E | null {\n if (currentVersion === 0) return null;\n const entry = cache.get(key);\n if (!entry || entry.version !== currentVersion || entry.keyId !== keyId) return null;\n if (ttlMs > 0 && Date.now() - entry.loadedAt > ttlMs) {\n cache.delete(key);\n return null;\n }\n return entry;\n}\n\nexport function getCachedMemories(\n baseDir: string,\n currentVersion: number,\n keyId = \"\",\n ttlMs = 0,\n): MemoryFile[] | null {\n const entry = getVersionedCacheEntry(hotCacheByDir, baseDir, currentVersion, keyId, ttlMs);\n return entry ? [...entry.memories.values()] : null;\n}\n\nexport function setCachedMemories(\n baseDir: string,\n memories: MemoryFile[],\n version: number,\n keyId = \"\",\n ttlMs = 0,\n): void {\n const map = new Map<string, MemoryFile>();\n for (const m of memories) map.set(m.path, m);\n const now = Date.now();\n hotCacheByDir.set(baseDir, { memories: map, version, loadedAt: now, keyId, ttlMs });\n // Release abandoned corpora that expired but were never revisited (Codex Medium).\n sweepExpiredHotEntries(now);\n}\n\nexport function updateCacheOnWrite(baseDir: string, memory: MemoryFile, keyId = \"\"): void {\n const entry = hotCacheByDir.get(baseDir);\n // Only mutate an entry that belongs to THIS key identity (issue #1902, Codex\n // Medium). A concurrent differently-keyed manager may have replaced the\n // single hotCacheByDir slot during an awaited parse; inserting our decrypted\n // MemoryFile into its entry would leak plaintext across the key boundary.\n if (entry && entry.keyId === keyId) entry.memories.set(memory.path, memory);\n}\n\nexport function updateCacheOnDelete(baseDir: string, filePath: string, keyId = \"\"): void {\n const entry = hotCacheByDir.get(baseDir);\n if (entry && entry.keyId === keyId) entry.memories.delete(filePath);\n}\n// Archive cache — same pattern, separate store\nexport function getCachedArchivedMemories(\n baseDir: string,\n currentVersion: number,\n keyId = \"\",\n): MemoryFile[] | null {\n // ttlMs 0: the archive cache has no age TTL; it is version-keyed and cleared\n // via invalidation.\n const entry = getVersionedCacheEntry(archiveCacheByDir, baseDir, currentVersion, keyId, 0);\n return entry ? [...entry.memories.values()] : null;\n}\n\nexport function setCachedArchivedMemories(\n baseDir: string,\n memories: MemoryFile[],\n version: number,\n keyId = \"\",\n): void {\n const map = new Map<string, MemoryFile>();\n for (const m of memories) map.set(m.path, m);\n // ttlMs: 0 — the archive cache has no age TTL; it is version-keyed and cleared\n // via invalidation. The field satisfies the shared CacheEntry shape (#1902).\n archiveCacheByDir.set(baseDir, { memories: map, version, loadedAt: Date.now(), keyId, ttlMs: 0 });\n}\n\n// Entity cache — same pattern as memory cache, but keyed by schema-aware parse inputs.\nconst entityCacheByDir = new Map<string, { entities: EntityFile[]; version: number; loadedAt: number }>();\n\n/**\n * Single normalization point for the entity-cache schema key (issue #1535).\n * BOTH the set/get key builder and the prefix invalidation derive from here so\n * `undefined` vs `\"\"` (or any future normalization rule) can never diverge\n * between the write path and the invalidate path (rule 38 cousin).\n */\nfunction normalizeEntitySchemaKey(schemaKey: string | undefined): string {\n return schemaKey ?? \"\";\n}\n\n/** Prefix shared by every entity-cache key for a dir, regardless of schemaKey. */\nfunction entityCacheKeyPrefix(baseDir: string): string {\n return `${baseDir}\\u0000`;\n}\n\nfunction buildEntityCacheKey(baseDir: string, schemaKey?: string): string {\n return `${entityCacheKeyPrefix(baseDir)}${normalizeEntitySchemaKey(schemaKey)}`;\n}\n\nexport function getCachedEntities(\n baseDir: string,\n currentVersion: number,\n schemaKey: string = \"\",\n): EntityFile[] | null {\n if (currentVersion === 0) return null;\n const entry = entityCacheByDir.get(buildEntityCacheKey(baseDir, schemaKey));\n if (!entry || entry.version !== currentVersion) return null;\n return entry.entities;\n}\n\nexport function setCachedEntities(\n baseDir: string,\n entities: EntityFile[],\n version: number,\n schemaKey: string = \"\",\n): void {\n entityCacheByDir.set(buildEntityCacheKey(baseDir, schemaKey), {\n entities,\n version,\n loadedAt: Date.now(),\n });\n}\n\nexport function invalidateCachedEntities(baseDir: string): void {\n const prefix = entityCacheKeyPrefix(baseDir);\n for (const key of entityCacheByDir.keys()) {\n if (key.startsWith(prefix)) entityCacheByDir.delete(key);\n }\n}\n\n// Derived caches — pre-filtered views invalidated alongside the main cache.\n// These avoid O(146K) filter+map on every verified recall/rules call.\ninterface DerivedCacheEntry<T> {\n data: T;\n version: number; // matches the hot cache version it was derived from\n keyId: string; // secure-store key identity of the corpus it was derived from (#1902)\n loadedAt: number; // build time — bounds staleness from external edits via ttlMs (#1902)\n}\n\nconst episodeMapByDir = new Map<string, DerivedCacheEntry<Map<string, MemoryFile>>>();\nconst ruleMemoriesByDir = new Map<string, DerivedCacheEntry<{ all: MemoryFile[]; byId: Map<string, MemoryFile> }>>();\n\nexport function getCachedEpisodeMap(\n baseDir: string,\n currentVersion: number,\n keyId = \"\",\n ttlMs = 0,\n): Map<string, MemoryFile> | null {\n const entry = getVersionedCacheEntry(episodeMapByDir, baseDir, currentVersion, keyId, ttlMs);\n return entry ? entry.data : null;\n}\n\n/** Build and cache the episode memory map from the full memory list. */\nexport function setCachedEpisodeMap(\n baseDir: string,\n memories: MemoryFile[],\n version: number,\n cache = true,\n keyId = \"\",\n): Map<string, MemoryFile> {\n const map = new Map<string, MemoryFile>();\n for (const m of memories) {\n if (m.frontmatter.status === \"archived\" || m.frontmatter.status === \"forgotten\") continue;\n if (m.frontmatter.memoryKind !== \"episode\") continue;\n map.set(m.frontmatter.id, m);\n }\n if (cache) episodeMapByDir.set(baseDir, { data: map, version, keyId, loadedAt: Date.now() });\n return map;\n}\n\n/** Get pre-filtered rule memories. Derived from hot cache. */\nexport function getCachedRuleMemories(\n baseDir: string,\n currentVersion: number,\n keyId = \"\",\n ttlMs = 0,\n): { all: MemoryFile[]; byId: Map<string, MemoryFile> } | null {\n const entry = getVersionedCacheEntry(ruleMemoriesByDir, baseDir, currentVersion, keyId, ttlMs);\n return entry ? entry.data : null;\n}\n\n/** Build and cache the rule memories from the full memory list. */\nexport function setCachedRuleMemories(\n baseDir: string,\n memories: MemoryFile[],\n version: number,\n cache = true,\n keyId = \"\",\n): { all: MemoryFile[]; byId: Map<string, MemoryFile> } {\n const byId = new Map<string, MemoryFile>();\n const all: MemoryFile[] = [];\n for (const m of memories) {\n byId.set(m.frontmatter.id, m);\n if (\n m.frontmatter.category === \"rule\" &&\n m.frontmatter.status !== \"archived\" &&\n m.frontmatter.status !== \"forgotten\"\n ) {\n all.push(m);\n }\n }\n const result = { all, byId };\n if (cache) ruleMemoriesByDir.set(baseDir, { data: result, version, keyId, loadedAt: Date.now() });\n return result;\n}\n\n// QMD search result cache — short-lived (60s TTL) to avoid stale results\n// while reducing redundant daemon calls for repeated/similar queries.\ninterface QmdCacheEntry {\n results: unknown[];\n cachedAt: number;\n}\nconst QMD_CACHE_TTL_MS = 60_000;\nconst qmdSearchCache = new Map<string, QmdCacheEntry>();\n\nexport function getCachedQmdSearch(cacheKey: string): unknown[] | null {\n const entry = qmdSearchCache.get(cacheKey);\n if (!entry) return null;\n if (Date.now() - entry.cachedAt > QMD_CACHE_TTL_MS) {\n qmdSearchCache.delete(cacheKey);\n return null;\n }\n return entry.results;\n}\n\nexport function setCachedQmdSearch(cacheKey: string, results: unknown[]): void {\n qmdSearchCache.set(cacheKey, { results, cachedAt: Date.now() });\n // Evict old entries to prevent unbounded growth\n if (qmdSearchCache.size > 200) {\n const now = Date.now();\n for (const [key, entry] of qmdSearchCache) {\n if (now - entry.cachedAt > QMD_CACHE_TTL_MS) qmdSearchCache.delete(key);\n }\n }\n}\n\n/**\n * Mutation scopes (issue #1904). A cache layer declares (via `evictOn`) which\n * of these mutation kinds evict it, so the invalidation chokepoint can clear\n * only the layers a given write actually affects instead of nuking every\n * layer on every write (the permanently-cold-cache regression #1904 fixes).\n */\nexport type MemoryMutationScope =\n | \"memory-create\" // a new memory doc added; no existing doc's recall-visibility changes\n | \"memory-mutate\" // existing doc changed/moved/removed/status-changed (update, supersede,\n // archive, invalidate, frontmatter, cold-tier change, bulk delete)\n | \"entity-write\" // an entity file changed\n | \"secure-key-change\"; // encryption key rotated; everything is now unreadable → evict all\n\n/**\n * Cache-layer registry (issue #1535).\n *\n * EVERY process-level cache that can serve memory-derived content is\n * enumerated here, and the single invalidation chokepoint\n * (`invalidateAllForDir`) iterates this list. Adding a new cache layer to\n * this module (or qmd-recall-cache.ts) REQUIRES registering it here —\n * otherwise mutations will never invalidate it (the exact bug this registry\n * exists to prevent) and the enumerate-all-layers fitness test in\n * tests/cache-invalidation-coherence.test.ts fails.\n */\nexport interface MemoryCacheLayer {\n /** Stable identifier used by tests and diagnostics. */\n readonly name: string;\n /** \"dir\" layers evict only entries for the given baseDir. \"global\" layers\n * are fully cleared on any mutation: their keys embed queries, namespaces,\n * and strategies rather than a storage dir, so a per-dir selective clear\n * is not possible without recording the dir in each entry. Full clear is\n * the simple-and-correct choice — these caches are re-warmable\n * (issue #1535, implementation guide option (b)). */\n readonly scope: \"dir\" | \"global\";\n /** Which mutation scopes evict this layer (issue #1904). A `memory-create`\n * only refreshes the full-memory-list views (hot + derived episode/rule); a\n * `memory-mutate`/`entity-write`/`secure-key-change` evicts every layer whose\n * content it can affect. Adding a layer REQUIRES declaring this. */\n readonly evictOn: Partial<Record<MemoryMutationScope, true>>;\n /** Evict entries for baseDir (\"dir\" scope) or everything (\"global\" scope). */\n readonly invalidateForDir: (baseDir: string) => void;\n /** Evict every entry across all dirs. */\n readonly clearAll: () => void;\n /** True when the layer still holds entries for baseDir (\"dir\" scope) or\n * any entries at all (\"global\" scope). */\n readonly hasEntriesFor: (baseDir: string) => boolean;\n}\n\nexport const ALL_CACHE_LAYERS: readonly MemoryCacheLayer[] = [\n {\n name: \"hot-memories\",\n scope: \"dir\",\n evictOn: { \"memory-create\": true, \"memory-mutate\": true, \"secure-key-change\": true },\n invalidateForDir: (baseDir) => void hotCacheByDir.delete(baseDir),\n clearAll: () => hotCacheByDir.clear(),\n hasEntriesFor: (baseDir) => hotCacheByDir.has(baseDir),\n },\n {\n name: \"archive-memories\",\n scope: \"dir\",\n evictOn: { \"memory-mutate\": true, \"secure-key-change\": true },\n invalidateForDir: (baseDir) => void archiveCacheByDir.delete(baseDir),\n clearAll: () => archiveCacheByDir.clear(),\n hasEntriesFor: (baseDir) => archiveCacheByDir.has(baseDir),\n },\n {\n name: \"entities\",\n scope: \"dir\",\n evictOn: { \"entity-write\": true, \"secure-key-change\": true },\n invalidateForDir: (baseDir) => invalidateCachedEntities(baseDir),\n clearAll: () => entityCacheByDir.clear(),\n hasEntriesFor: (baseDir) => {\n const prefix = entityCacheKeyPrefix(baseDir);\n for (const key of entityCacheByDir.keys()) {\n if (key.startsWith(prefix)) return true;\n }\n return false;\n },\n },\n {\n name: \"derived-episode-map\",\n scope: \"dir\",\n evictOn: { \"memory-create\": true, \"memory-mutate\": true, \"secure-key-change\": true },\n invalidateForDir: (baseDir) => void episodeMapByDir.delete(baseDir),\n clearAll: () => episodeMapByDir.clear(),\n hasEntriesFor: (baseDir) => episodeMapByDir.has(baseDir),\n },\n {\n name: \"derived-rule-memories\",\n scope: \"dir\",\n evictOn: { \"memory-create\": true, \"memory-mutate\": true, \"secure-key-change\": true },\n invalidateForDir: (baseDir) => void ruleMemoriesByDir.delete(baseDir),\n clearAll: () => ruleMemoriesByDir.clear(),\n hasEntriesFor: (baseDir) => ruleMemoriesByDir.has(baseDir),\n },\n {\n name: \"qmd-search\",\n scope: \"global\",\n evictOn: { \"memory-mutate\": true, \"entity-write\": true, \"secure-key-change\": true },\n invalidateForDir: () => qmdSearchCache.clear(),\n clearAll: () => qmdSearchCache.clear(),\n hasEntriesFor: () => qmdSearchCache.size > 0,\n },\n {\n name: \"qmd-recall\",\n scope: \"global\",\n evictOn: { \"memory-mutate\": true, \"entity-write\": true, \"secure-key-change\": true },\n invalidateForDir: () => clearQmdRecallCache(),\n clearAll: () => clearQmdRecallCache(),\n hasEntriesFor: () => qmdRecallCacheSize() > 0,\n },\n];\n\n/**\n * The single invalidation chokepoint (issue #1535, rule 37).\n *\n * Every memory/entity mutation path must route through this function —\n * storage.ts calls it from its internal invalidation funnels\n * (invalidateAllMemoriesCache / invalidateColdMemoriesCache /\n * bumpMemoryStatusVersion / setSecureStoreKey). Nothing may clear an\n * individual layer ad hoc: partial clears are how the stale-recall bug\n * happened (qmdRecallCache was never invalidated on mutations, so recall\n * served pre-edit bundles for the remainder of its fresh/stale TTL window).\n */\nexport function invalidateAllForDir(baseDir: string): void {\n for (const layer of ALL_CACHE_LAYERS) {\n layer.invalidateForDir(baseDir);\n }\n}\n\n/**\n * Scope-aware invalidation chokepoint (issue #1904). Evicts only the layers\n * whose `evictOn` includes `scope`, so the highest-frequency write\n * (`memory-create`, fired continuously by extraction) stops nuking the QMD\n * result caches and the version-keyed entity cache it cannot affect. This is\n * the single scoped entry point — like `invalidateAllForDir`, it iterates the\n * `ALL_CACHE_LAYERS` registry rather than clearing any layer ad hoc, so the\n * single-chokepoint invariant (#1535) holds: a new layer only participates by\n * declaring `evictOn`.\n */\nexport function invalidateForScope(baseDir: string, scope: MemoryMutationScope): void {\n for (const layer of ALL_CACHE_LAYERS) {\n if (layer.evictOn[scope]) layer.invalidateForDir(baseDir);\n }\n}\n\n/**\n * Companion to {@link invalidateForScope} for the single-file write fast path\n * (issue #1902 + #1904): it patches the hot-memories entry in place and\n * re-keys it, so this evicts every OTHER layer the scope would clear but leaves\n * hot-memories alone. A `memory-create` thus evicts only the derived\n * episode/rule views (hot patched, QMD/entities/archive kept warm), which is\n * the whole point of #1904 — a create must not evict the QMD result caches.\n */\nexport function invalidateForScopeExceptHot(baseDir: string, scope: MemoryMutationScope): void {\n for (const layer of ALL_CACHE_LAYERS) {\n if (layer.name === \"hot-memories\") continue;\n if (layer.evictOn[scope]) layer.invalidateForDir(baseDir);\n }\n}\n\n/**\n * Invalidate every cache layer for `baseDir` EXCEPT the hot-memories layer\n * (issue #1902). Single-file write paths use this instead of\n * `invalidateAllForDir` because they patch the hot-memories entry in place\n * (via `updateCacheOnWrite`/`updateCacheOnDelete`) and re-key it to the bumped\n * version — so dropping it here would defeat the whole warm-cache fast path.\n * The derived episode/rule views and the global QMD caches are cheap to\n * rebuild and are not patched, so they are still evicted here. Every other\n * layer remains reachable for the wholesale `invalidateAllForDir` /\n * `clearMemoryCache` chokepoint used by bulk/ambiguous mutations.\n */\nexport function invalidateDerivedAndGlobalForDir(baseDir: string): void {\n // Preserve the layers a single-file write intentionally keeps warm (issue\n // #1902, Codex Medium): hot-memories is patched + re-keyed in place; the\n // entities layer is keyed on memory-status, which plain create/content writes\n // deliberately do NOT bump (so entity retrieval stays warm); and the\n // archive-memories layer is version-keyed on the archive tier, untouched by a\n // hot-tier write. Evict ONLY the derived (episode/rule) and global (QMD) views.\n for (const layer of ALL_CACHE_LAYERS) {\n if (\n layer.name === \"hot-memories\" ||\n layer.name === \"entities\" ||\n layer.name === \"archive-memories\"\n ) {\n continue;\n }\n layer.invalidateForDir(baseDir);\n }\n}\n\nexport function clearMemoryCache(baseDir?: string): void {\n if (baseDir) {\n invalidateAllForDir(baseDir);\n return;\n }\n for (const layer of ALL_CACHE_LAYERS) {\n layer.clearAll();\n }\n}\n\n/**\n * Clear ONLY the two global QMD result caches (qmd-search + qmd-recall), leaving\n * every dir-scoped layer (hot/archive/entities/derived) untouched. Called after\n * a successful QMD maintenance update+embed (#1904, Codex): a newly-persisted\n * fact becomes searchable at that moment, so any cached pre-index recall/search\n * bundle is now stale and must not be served. This lets the create path keep the\n * QMD caches warm during index lag (perf win) while guaranteeing invalidation\n * the moment the fact is actually indexed — no extended stale window.\n */\nexport function clearQmdResultCaches(): void {\n qmdSearchCache.clear();\n clearQmdRecallCache();\n}\n\nexport function getMemoryCacheStats(baseDir: string): {\n hotSize: number;\n archiveSize: number;\n hotVersion: number | null;\n archiveVersion: number | null;\n} {\n const hot = hotCacheByDir.get(baseDir);\n const archive = archiveCacheByDir.get(baseDir);\n return {\n hotSize: hot?.memories.size ?? 0,\n archiveSize: archive?.memories.size ?? 0,\n hotVersion: hot?.version ?? null,\n archiveVersion: archive?.version ?? null,\n };\n}\n"],"mappings":";;;;;;AAmBA,IAAM,gBAAgB,oBAAI,IAAwB;AAClD,IAAM,oBAAoB,oBAAI,IAAwB;AAStD,SAAS,uBAAuB,KAAmB;AACjD,aAAW,CAAC,KAAK,KAAK,KAAK,eAAe;AACxC,QAAI,MAAM,QAAQ,KAAK,MAAM,MAAM,WAAW,MAAM,MAAO,eAAc,OAAO,GAAG;AAAA,EACrF;AACF;AAYA,SAAS,uBACP,OACA,KACA,gBACA,OACA,OACU;AACV,MAAI,mBAAmB,EAAG,QAAO;AACjC,QAAM,QAAQ,MAAM,IAAI,GAAG;AAC3B,MAAI,CAAC,SAAS,MAAM,YAAY,kBAAkB,MAAM,UAAU,MAAO,QAAO;AAChF,MAAI,QAAQ,KAAK,KAAK,IAAI,IAAI,MAAM,WAAW,OAAO;AACpD,UAAM,OAAO,GAAG;AAChB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,SAAS,kBACd,SACA,gBACA,QAAQ,IACR,QAAQ,GACa;AACrB,QAAM,QAAQ,uBAAuB,eAAe,SAAS,gBAAgB,OAAO,KAAK;AACzF,SAAO,QAAQ,CAAC,GAAG,MAAM,SAAS,OAAO,CAAC,IAAI;AAChD;AAEO,SAAS,kBACd,SACA,UACA,SACA,QAAQ,IACR,QAAQ,GACF;AACN,QAAM,MAAM,oBAAI,IAAwB;AACxC,aAAW,KAAK,SAAU,KAAI,IAAI,EAAE,MAAM,CAAC;AAC3C,QAAM,MAAM,KAAK,IAAI;AACrB,gBAAc,IAAI,SAAS,EAAE,UAAU,KAAK,SAAS,UAAU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AAI,OAAO;AACrC,QAAM,UAAU,kBAAkB,IAAI,OAAO;AAC7C,SAAO;AAAA,IACL,SAAS,KAAK,SAAS,QAAQ;AAAA,IAC/B,aAAa,SAAS,SAAS,QAAQ;AAAA,IACvC,YAAY,KAAK,WAAW;AAAA,IAC5B,gBAAgB,SAAS,WAAW;AAAA,EACtC;AACF;","names":[]}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-2AD5SXO4.js";
|
|
14
14
|
import {
|
|
15
15
|
ExtractionDeadlineError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BB2LH5JM.js";
|
|
17
17
|
import {
|
|
18
18
|
resolvePrincipal
|
|
19
19
|
} from "./chunk-MRV7VSQK.js";
|
|
@@ -410,6 +410,12 @@ var SmartBuffer = class {
|
|
|
410
410
|
log.debug(
|
|
411
411
|
`buffer[${bufferKey}]: ${mutation.turnCountInWindow} turns, signal=${mutation.signalLevel}, decision=${decision}`
|
|
412
412
|
);
|
|
413
|
+
if (decision !== "keep_buffering" && extractionTurns === void 0) {
|
|
414
|
+
extractionTurns = [
|
|
415
|
+
...mutation.retainedTurnsSnapshot,
|
|
416
|
+
...mutation.activeTurnsSnapshot
|
|
417
|
+
];
|
|
418
|
+
}
|
|
413
419
|
return extractionTurns ? { decision, extractionTurns } : { decision };
|
|
414
420
|
}
|
|
415
421
|
async recordTurnUnlocked(bufferKey, turn) {
|
|
@@ -792,4 +798,4 @@ var SmartBuffer = class {
|
|
|
792
798
|
export {
|
|
793
799
|
SmartBuffer
|
|
794
800
|
};
|
|
795
|
-
//# sourceMappingURL=chunk-
|
|
801
|
+
//# sourceMappingURL=chunk-CUDSA46O.js.map
|