@remnic/core 9.65.6 → 9.65.8
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 +15 -13
- package/dist/access-admin-ops-surface.js +54 -54
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +15 -13
- package/dist/access-authorization-probe.js +55 -55
- package/dist/access-boundary.d.ts +15 -13
- package/dist/access-boundary.js +54 -54
- package/dist/access-cli.js +156 -148
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -1
- package/dist/access-extraction-force-flush.d.ts +15 -13
- package/dist/access-extraction-force-flush.js +54 -54
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-lcm-compaction.d.ts +15 -13
- package/dist/access-http-lifecycle-flush.d.ts +15 -13
- package/dist/access-http-offline-stream.d.ts +15 -13
- package/dist/access-http-query.d.ts +3 -2
- package/dist/access-http-query.js +56 -56
- package/dist/access-http.d.ts +17 -20
- package/dist/access-http.js +75 -73
- package/dist/access-identity-continuity-surface.d.ts +13 -11
- package/dist/access-identity-continuity-surface.js +54 -54
- package/dist/access-lcm-surface.d.ts +15 -13
- package/dist/access-lcm-surface.js +54 -54
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +15 -13
- package/dist/access-mcp.js +66 -64
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-D_6mo8ms.d.ts → access-namespace-preflight-CpAOrS-9.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +54 -54
- package/dist/access-observe-write-surface.d.ts +15 -13
- package/dist/access-observe-write-surface.js +54 -54
- package/dist/access-offline-manifest.d.ts +13 -11
- package/dist/access-offline-manifest.js +6 -6
- package/dist/access-operations-batch.js +58 -58
- package/dist/access-operations.d.ts +21 -19
- package/dist/access-operations.js +63 -61
- package/dist/access-recall-concurrency.d.ts +15 -13
- package/dist/access-recall-concurrency.js +54 -54
- package/dist/access-recall-response.d.ts +15 -13
- package/dist/access-recall-response.js +54 -54
- package/dist/access-recall-surface.d.ts +15 -13
- package/dist/access-recall-surface.js +54 -54
- package/dist/access-schema.d.ts +83 -83
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-sbiNS5UB.d.ts → access-service-Diu61Cfv.d.ts} +72 -72
- package/dist/access-service-helpers.d.ts +15 -13
- package/dist/access-service.d.ts +15 -13
- package/dist/access-service.js +54 -54
- package/dist/access-surface-catalog.d.ts +15 -13
- package/dist/access-surface-catalog.js +66 -56
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +6 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-context-config.d.ts +27 -0
- package/dist/active-context-config.js +14 -0
- package/dist/active-context-transform.d.ts +267 -0
- package/dist/active-context-transform.js +31 -0
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +13 -12
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +2 -1
- package/dist/artifact-search.d.ts +2 -1
- package/dist/{auto-sync-XVMLL2RH.js → auto-sync-2YPITIWN.js} +6 -6
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +13 -11
- package/dist/briefing-window.d.ts +5 -2
- package/dist/briefing.d.ts +5 -2
- package/dist/briefing.js +25 -25
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +5 -2
- package/dist/buffer.js +6 -6
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-DO_7zfkv.d.ts → catalog-9f-vEQLS.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +4 -3
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +28 -28
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-NZPFCP5A.js → chunk-2PSX5BJU.js} +2 -2
- package/dist/{chunk-RKNJBZ55.js → chunk-2QSZNTDO.js} +4 -4
- package/dist/{chunk-X2DWBWOX.js → chunk-3A2NJP2U.js} +2 -2
- package/dist/chunk-3BCULS4U.js +1093 -0
- package/dist/chunk-3BCULS4U.js.map +1 -0
- package/dist/{chunk-JGG5HVI2.js → chunk-3PKAS6VL.js} +2 -2
- package/dist/{chunk-LSYD7GHZ.js → chunk-3SZD4CYO.js} +3 -3
- package/dist/chunk-43HUVDTD.js +114 -0
- package/dist/chunk-43HUVDTD.js.map +1 -0
- package/dist/{chunk-5TG4MU2U.js → chunk-4F4AQFWL.js} +8 -8
- package/dist/{chunk-D35XLYQ7.js → chunk-4QEYREAV.js} +12 -12
- package/dist/{chunk-46WM6JX2.js → chunk-4ZWCQJNM.js} +5 -5
- package/dist/{chunk-DVYRD4HY.js → chunk-5ACCD4L7.js} +30 -1
- package/dist/chunk-5ACCD4L7.js.map +1 -0
- package/dist/{chunk-W6J4POB6.js → chunk-5DHKCO52.js} +2 -2
- package/dist/{chunk-IRXMJLTW.js → chunk-5HK3CJAR.js} +2 -2
- package/dist/{chunk-NLUCDKLT.js → chunk-5RWZH6PH.js} +2 -2
- package/dist/{chunk-H7BZBSP6.js → chunk-645WOU5I.js} +4 -4
- package/dist/{chunk-AYAZWXJI.js → chunk-76DIF5KT.js} +2 -2
- package/dist/{chunk-OPPBTPUU.js → chunk-7KQB4EBS.js} +4 -4
- package/dist/{chunk-I2HTKOOP.js → chunk-7VZFRUQU.js} +3 -3
- package/dist/{chunk-DPNXADEI.js → chunk-7WOWGRAU.js} +11 -7
- package/dist/chunk-7WOWGRAU.js.map +1 -0
- package/dist/{chunk-JCWY73FK.js → chunk-AHPIFKNG.js} +2 -2
- package/dist/{chunk-FC7TIRFS.js → chunk-AX7UXCHJ.js} +6 -1
- package/dist/chunk-AX7UXCHJ.js.map +1 -0
- package/dist/{chunk-3I22VWB3.js → chunk-AZMLH5UT.js} +2 -2
- package/dist/chunk-B32WYRXX.js +77 -0
- package/dist/chunk-B32WYRXX.js.map +1 -0
- package/dist/{chunk-JOEJG4SD.js → chunk-BEC4YBNA.js} +4 -4
- package/dist/chunk-BWGCOLEL.js +61 -0
- package/dist/chunk-BWGCOLEL.js.map +1 -0
- package/dist/{chunk-BXXOPKT5.js → chunk-CAMNRAJF.js} +2 -2
- package/dist/{chunk-C24UZSFW.js → chunk-CEH2AFXG.js} +6 -6
- package/dist/{chunk-YOXVZJFM.js → chunk-CFVTRUR3.js} +2 -2
- package/dist/{chunk-SVSRPG6M.js → chunk-CPA5NBHN.js} +2 -2
- package/dist/{chunk-7BEPVIH3.js → chunk-CRML27CO.js} +3 -3
- package/dist/{chunk-AXGFOFNY.js → chunk-DA7ITC5Z.js} +2 -2
- package/dist/{chunk-5W7MKXMU.js → chunk-DEACDKE3.js} +144 -78
- package/dist/chunk-DEACDKE3.js.map +1 -0
- package/dist/{chunk-FEO2CDXR.js → chunk-DPCXDG7G.js} +2 -2
- package/dist/{chunk-HZNYJN77.js → chunk-F3NVYTTA.js} +2 -2
- package/dist/{chunk-7SSRXEZJ.js → chunk-F7XUD3PL.js} +2 -2
- package/dist/{chunk-LDBFXD4F.js → chunk-FP7YTTVO.js} +3 -1
- package/dist/chunk-FP7YTTVO.js.map +1 -0
- package/dist/{chunk-XZBXINXZ.js → chunk-GIC6BASP.js} +4 -4
- package/dist/{chunk-PP7R754B.js → chunk-GPFZFCRN.js} +1 -1
- package/dist/{chunk-53MZQEBD.js → chunk-GTO56JY5.js} +2 -2
- package/dist/{chunk-RAIUTAZZ.js → chunk-H2YSH3DG.js} +2 -2
- package/dist/{chunk-HWVNYNIV.js → chunk-HMZKGHMD.js} +2 -2
- package/dist/{chunk-ZXUZ54Z5.js → chunk-HRHO3ZNG.js} +2 -2
- package/dist/{chunk-SDEPLF7V.js → chunk-IBJ6U753.js} +2 -2
- package/dist/chunk-JCCWJHOP.js +240 -0
- package/dist/chunk-JCCWJHOP.js.map +1 -0
- package/dist/{chunk-T3JQTCCO.js → chunk-JI7U6AS3.js} +4 -4
- package/dist/{chunk-TR7DGXGI.js → chunk-JOZUBF4A.js} +5 -5
- package/dist/{chunk-YWBOOBDP.js → chunk-JYSN42VN.js} +71 -71
- package/dist/{chunk-ZPUIRTIZ.js → chunk-KOLJJN5G.js} +12 -75
- package/dist/chunk-KOLJJN5G.js.map +1 -0
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-D2YNNDML.js → chunk-KWIGDKM2.js} +2 -2
- package/dist/{chunk-YUTTMSC7.js → chunk-KZIF6XHX.js} +93 -30
- package/dist/chunk-KZIF6XHX.js.map +1 -0
- package/dist/chunk-LB7WCZHY.js +553 -0
- package/dist/chunk-LB7WCZHY.js.map +1 -0
- package/dist/{chunk-RIAM7DND.js → chunk-LDKPDODJ.js} +2 -2
- package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
- package/dist/{chunk-2JHRCWHT.js → chunk-LKYIOCWL.js} +107 -107
- package/dist/{chunk-XAWIL7TC.js → chunk-LOXHYCVS.js} +2 -2
- package/dist/{chunk-OMZLBT4B.js → chunk-LPNCR4QK.js} +48 -27
- package/dist/chunk-LPNCR4QK.js.map +1 -0
- package/dist/{chunk-OLBZ2WGG.js → chunk-LTBKKSCX.js} +2 -2
- package/dist/{chunk-O4BAGJDN.js → chunk-MDD2RINF.js} +2 -2
- package/dist/{chunk-H63EDPFJ.js → chunk-MI2OTWV5.js} +15 -2
- package/dist/{chunk-H63EDPFJ.js.map → chunk-MI2OTWV5.js.map} +1 -1
- package/dist/{chunk-LBFFNDFM.js → chunk-MINHJ55X.js} +1 -1
- package/dist/chunk-MINHJ55X.js.map +1 -0
- package/dist/{chunk-ROEAEANL.js → chunk-MY2BC6UE.js} +15 -15
- package/dist/{chunk-RACZB5HT.js → chunk-N37X5RU7.js} +4 -4
- package/dist/{chunk-AG46P24C.js → chunk-NNBZS3DY.js} +4 -4
- package/dist/{chunk-PGW64IFQ.js → chunk-NPFUNWNX.js} +2 -2
- package/dist/{chunk-MFOSZUIT.js → chunk-NPIBN2VL.js} +2 -2
- package/dist/{chunk-IF4EY26E.js → chunk-OA2O2GJ4.js} +3 -3
- package/dist/{chunk-6FUMA6AA.js → chunk-ODU2CNNX.js} +2 -2
- package/dist/{chunk-PNAGNVGK.js → chunk-OXRRJXPR.js} +42 -37
- package/dist/chunk-OXRRJXPR.js.map +1 -0
- package/dist/{chunk-TWBQQ3FT.js → chunk-P36Z4JRA.js} +2 -2
- package/dist/{chunk-OUKBMQ2O.js → chunk-PD66CVSD.js} +2 -2
- package/dist/{chunk-MVIYRRVJ.js → chunk-PMVPCZJZ.js} +5 -5
- package/dist/{chunk-US4IRASK.js → chunk-PU56CXZA.js} +6 -6
- package/dist/{chunk-IDQ6DKXC.js → chunk-S5XOSTYM.js} +3 -3
- package/dist/{chunk-DYO24BNB.js → chunk-SEEJOGQX.js} +5 -5
- package/dist/{chunk-7OZSHBWK.js → chunk-SNOIKAHM.js} +2 -2
- package/dist/{chunk-SR7JIRAR.js → chunk-T6ILXUAH.js} +2 -2
- package/dist/{chunk-2RXUZVPU.js → chunk-T7XP6IZE.js} +2 -2
- package/dist/{chunk-KBOG7FJV.js → chunk-TFR3HG4K.js} +3 -3
- package/dist/{chunk-XUZ5CIEE.js → chunk-TUHBYJXL.js} +1 -1
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-ZK4BFABK.js → chunk-U7EW2W4W.js} +13 -13
- package/dist/{chunk-4K7IW3F7.js → chunk-UD7UNYRD.js} +34 -3
- package/dist/chunk-UD7UNYRD.js.map +1 -0
- package/dist/{chunk-VFYRYFLL.js → chunk-UEBDCMOO.js} +2 -2
- package/dist/{chunk-JFWZRUKP.js → chunk-UENKPWCS.js} +4 -4
- package/dist/{chunk-AAXJNINV.js → chunk-UL4MKZHI.js} +2 -2
- package/dist/chunk-ULM7JCDH.js +154 -0
- package/dist/chunk-ULM7JCDH.js.map +1 -0
- package/dist/{chunk-R2MZCYA6.js → chunk-UNUMFURP.js} +3 -3
- package/dist/{chunk-5GIZM4RX.js → chunk-UPFNQJC7.js} +2 -2
- package/dist/{chunk-W4BMEGQA.js → chunk-UTQUEHC7.js} +2 -2
- package/dist/{chunk-I32NKXE2.js → chunk-V4IDF3EZ.js} +2 -2
- package/dist/{chunk-6LS5OX3U.js → chunk-W2BAGGEW.js} +50 -18
- package/dist/chunk-W2BAGGEW.js.map +1 -0
- package/dist/chunk-W2UOAATB.js +521 -0
- package/dist/chunk-W2UOAATB.js.map +1 -0
- package/dist/{chunk-QMZY3GG6.js → chunk-WNXYT4MK.js} +3 -3
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-T42L3S6A.js → chunk-XBGHAAKR.js} +2 -2
- package/dist/{chunk-RQ2EQRRR.js → chunk-XNWXSGHS.js} +80 -7
- package/dist/chunk-XNWXSGHS.js.map +1 -0
- package/dist/{chunk-THG4GYIE.js → chunk-YEUXERJ6.js} +5 -5
- package/dist/{chunk-BIJAWZYW.js → chunk-YMOPYG3K.js} +6 -6
- package/dist/{chunk-M4AHBM72.js → chunk-Z3YEGSR4.js} +2 -2
- package/dist/{cli-Bfgo0n1L.d.ts → cli-O3F-ht3i.d.ts} +5 -5
- package/dist/cli.d.ts +17 -15
- package/dist/cli.js +106 -104
- package/dist/coding/pre-action-gate.d.ts +2 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +5 -2
- package/dist/compounding/engine.js +26 -26
- package/dist/compounding/preference-consolidator.d.ts +4 -3
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config-security.js +2 -2
- package/dist/config.d.ts +2 -1
- package/dist/config.js +13 -12
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +25 -25
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +25 -25
- package/dist/consolidation-provenance-check.d.ts +5 -2
- package/dist/consolidation-provenance-check.js +2 -2
- package/dist/consolidation-undo.d.ts +5 -2
- package/dist/context-summary.d.ts +43 -0
- package/dist/context-summary.js +14 -0
- package/dist/context-summary.js.map +1 -0
- package/dist/contradiction/index.d.ts +6 -3
- package/dist/contradiction/index.js +5 -5
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +5 -2
- package/dist/convergence-refresh.js +28 -28
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +27 -27
- package/dist/cross-lingual-recall.d.ts +2 -1
- package/dist/day-summary.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/dependency-propagation-config.d.ts +2 -1
- package/dist/{dependency-propagation-delivery-D23_x-s5.d.ts → dependency-propagation-delivery-CL6RWXTA.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-origin-fields.d.ts +2 -1
- package/dist/entity-retrieval.d.ts +5 -2
- package/dist/entity-retrieval.js +26 -26
- package/dist/entity-schema.d.ts +2 -1
- package/dist/episodic-context.d.ts +2 -1
- package/dist/eval-trajectory-contracts.d.ts +257 -0
- package/dist/eval-trajectory-contracts.js +56 -0
- package/dist/eval-trajectory-contracts.js.map +1 -0
- package/dist/eval-trajectory-store.d.ts +40 -0
- package/dist/eval-trajectory-store.js +19 -0
- package/dist/eval-trajectory-store.js.map +1 -0
- package/dist/eval-trajectory.d.ts +68 -0
- package/dist/eval-trajectory.js +46 -0
- package/dist/eval-trajectory.js.map +1 -0
- package/dist/event-order-recall.js +2 -2
- package/dist/explicit-capture.d.ts +13 -11
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.d.ts +15 -13
- package/dist/external-wiki-access.js +55 -55
- package/dist/external-wiki-collection-registration.d.ts +2 -1
- package/dist/external-wiki-collection.d.ts +2 -1
- package/dist/external-wiki-mcp-tools.d.ts +15 -13
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +2 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-normalization.d.ts +2 -1
- package/dist/extraction-prompt.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +33 -33
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/{forget-SZ2BXDGF.js → forget-2AE4MDK3.js} +3 -3
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/{graph-edge-decay-FXGELBFA.js → graph-edge-decay-A4SDFMMS.js} +4 -4
- package/dist/graph-edge-decay-A4SDFMMS.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-path-reconstruction.d.ts +2 -1
- package/dist/graph-path-scoring.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.d.ts +2 -1
- package/dist/graph.js +3 -3
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/{index--QhGIXF2.d.ts → index-C7Xep6S9.d.ts} +2 -2
- package/dist/index.d.ts +706 -701
- package/dist/index.js +271 -200
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +3 -2
- package/dist/lcm/engine.js +3 -2
- package/dist/lcm/index.d.ts +4 -2
- package/dist/lcm/index.js +6 -5
- package/dist/lcm/summarizer.d.ts +4 -6
- package/dist/lcm/summarizer.js +2 -1
- package/dist/lcm/tools.d.ts +4 -3
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/location/index.d.ts +128 -1
- package/dist/location/index.js +60 -750
- package/dist/location/index.js.map +1 -1
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +26 -26
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +5 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +25 -25
- package/dist/maintenance/rebuild-memory-projection.d.ts +5 -2
- package/dist/maintenance/rebuild-memory-projection.js +27 -27
- package/dist/{maintenance-PFvY1Pw_.d.ts → maintenance-CJ-xqFp0.d.ts} +4 -3
- package/dist/mcp-memory-inspector-app.d.ts +15 -13
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +18 -2
- package/dist/memory-action-policy.js +3 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-controller.d.ts +2 -1
- package/dist/memory-controller.js +2 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-snapshot.d.ts +2 -1
- package/dist/memory-subject-cli.d.ts +15 -13
- package/dist/memory-subject.d.ts +15 -13
- package/dist/memory-subject.js +3 -3
- package/dist/memory-worth-outcomes.d.ts +50 -3
- package/dist/memory-worth-outcomes.js +5 -3
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +6 -3
- package/dist/namespaces/migrate.js +26 -26
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +11 -11
- package/dist/namespaces/storage.d.ts +6 -3
- package/dist/namespaces/storage.js +25 -25
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/offline-sync-impression-drain.js +2 -2
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +28 -28
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-toolkit.d.ts +6 -3
- package/dist/operator-toolkit.js +45 -44
- package/dist/orchestration/compression-guideline-coordinator.d.ts +5 -2
- package/dist/orchestration/maintenance.d.ts +7 -4
- package/dist/orchestration/maintenance.js +34 -32
- package/dist/{orchestrator-4wzJrPVm.d.ts → orchestrator-BsntWxLy.d.ts} +8 -8
- package/dist/orchestrator.d.ts +13 -11
- package/dist/orchestrator.js +156 -148
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-CgXgdIrF.d.ts → pipeline-CVoysPm2.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/{public-http-BP3VQDl5.d.ts → public-http-CuOxlTC2.d.ts} +1 -1
- package/dist/{qmd-BppGGxsi.d.ts → qmd-DWMAGA5l.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +3 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +2 -1
- package/dist/reconcile/manifest.d.ts +2 -1
- package/dist/reconcile/manifest.js +3 -3
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/{resolution-4552BNRV.js → resolution-XWBPKYFB.js} +6 -6
- package/dist/resolution-XWBPKYFB.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +14 -13
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/salvage-envelope.js +5 -5
- package/dist/schemas.d.ts +124 -124
- package/dist/{scope-profiles-ChZUtxDU.d.ts → scope-profiles-CPWkW_dI.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/factory.d.ts +2 -1
- package/dist/search/factory.js +10 -10
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +15 -15
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +2 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/{semantic-consolidation-mSPwQSmF.d.ts → semantic-consolidation-CNFVBXFc.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +31 -31
- package/dist/semantic-rule-promotion.js +25 -25
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +25 -25
- package/dist/{service-BICWLwSP.d.ts → service-Bb-JIdQ0.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +8 -7
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +29 -29
- package/dist/{storage-B7urx1K3.d.ts → storage-CukrlNKk.d.ts} +4 -1
- package/dist/storage.d.ts +5 -2
- package/dist/storage.js +24 -24
- package/dist/subject-config.d.ts +2 -1
- package/dist/subject-config.js +4 -4
- package/dist/summarizer.d.ts +2 -1
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/support-passport/index.d.ts +18 -16
- package/dist/support-passport/index.js +57 -57
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +5 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/types.d.ts +78 -78
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-ETU5N6nB.d.ts → types-djxQlxJ7.d.ts} +3 -2
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +25 -25
- package/dist/who-knows-cli.d.ts +15 -13
- package/dist/who-knows-cli.js +26 -26
- package/dist/who-knows.d.ts +15 -13
- package/dist/who-knows.js +25 -25
- package/dist/write-envelope.d.ts +2 -1
- package/dist/write-envelope.js +4 -4
- package/package.json +22 -2
- package/src/access-boundary.ts +5 -0
- package/src/access-http.ts +15 -16
- package/src/access-mcp-output-schemas.ts +5 -0
- package/src/access-mcp.ts +6 -6
- package/src/access-operations.ts +2 -0
- package/src/access-surface-catalog.ts +10 -0
- package/src/active-context-config.ts +98 -0
- package/src/active-context-transform.test.ts +533 -0
- package/src/active-context-transform.ts +981 -0
- package/src/config.ts +3 -5
- package/src/context-summary.ts +182 -0
- package/src/eval-trajectory-contracts.ts +411 -0
- package/src/eval-trajectory-store.ts +306 -0
- package/src/eval-trajectory.test.ts +534 -0
- package/src/eval-trajectory.ts +773 -0
- package/src/index.ts +6 -11
- package/src/lcm/summarizer.ts +14 -93
- package/src/location/access-operations.ts +84 -0
- package/src/location/http-glue.test.ts +100 -0
- package/src/location/http-glue.ts +85 -0
- package/src/location/index.ts +3 -0
- package/src/location/mcp-tools.ts +82 -0
- package/src/location/provider-setup.test.ts +106 -0
- package/src/location/provider-setup.ts +103 -0
- package/src/location/scheduler.test.ts +113 -0
- package/src/location/scheduler.ts +98 -0
- package/src/location/surfaces.test.ts +241 -0
- package/src/location/surfaces.ts +329 -0
- package/src/maintenance/day-summary-cron.ts +45 -0
- package/src/mcp-read-only-tools.ts +2 -0
- package/src/memory-action-policy.ts +28 -0
- package/src/memory-worth-outcomes.test.ts +53 -18
- package/src/memory-worth-outcomes.ts +91 -9
- package/src/orchestration/maintenance.ts +22 -30
- package/src/storage/context-transform-ledger.ts +39 -0
- package/src/storage/secure-line-reader.ts +50 -1
- package/src/storage.ts +4 -1
- package/src/types.ts +2 -3
- package/src/wearables/http-glue.ts +28 -0
- package/dist/chunk-4K7IW3F7.js.map +0 -1
- package/dist/chunk-5W7MKXMU.js.map +0 -1
- package/dist/chunk-6LS5OX3U.js.map +0 -1
- package/dist/chunk-DPNXADEI.js.map +0 -1
- package/dist/chunk-DVYRD4HY.js.map +0 -1
- package/dist/chunk-FC7TIRFS.js.map +0 -1
- package/dist/chunk-LBFFNDFM.js.map +0 -1
- package/dist/chunk-LDBFXD4F.js.map +0 -1
- package/dist/chunk-OMZLBT4B.js.map +0 -1
- package/dist/chunk-PNAGNVGK.js.map +0 -1
- package/dist/chunk-RQ2EQRRR.js.map +0 -1
- package/dist/chunk-YUTTMSC7.js.map +0 -1
- package/dist/chunk-ZPUIRTIZ.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → active-context-config.js.map} +0 -0
- /package/dist/{graph-edge-decay-FXGELBFA.js.map → active-context-transform.js.map} +0 -0
- /package/dist/{auto-sync-XVMLL2RH.js.map → auto-sync-2YPITIWN.js.map} +0 -0
- /package/dist/{resolution-4552BNRV.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-NZPFCP5A.js.map → chunk-2PSX5BJU.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-X2DWBWOX.js.map → chunk-3A2NJP2U.js.map} +0 -0
- /package/dist/{chunk-JGG5HVI2.js.map → chunk-3PKAS6VL.js.map} +0 -0
- /package/dist/{chunk-LSYD7GHZ.js.map → chunk-3SZD4CYO.js.map} +0 -0
- /package/dist/{chunk-5TG4MU2U.js.map → chunk-4F4AQFWL.js.map} +0 -0
- /package/dist/{chunk-D35XLYQ7.js.map → chunk-4QEYREAV.js.map} +0 -0
- /package/dist/{chunk-46WM6JX2.js.map → chunk-4ZWCQJNM.js.map} +0 -0
- /package/dist/{chunk-W6J4POB6.js.map → chunk-5DHKCO52.js.map} +0 -0
- /package/dist/{chunk-IRXMJLTW.js.map → chunk-5HK3CJAR.js.map} +0 -0
- /package/dist/{chunk-NLUCDKLT.js.map → chunk-5RWZH6PH.js.map} +0 -0
- /package/dist/{chunk-H7BZBSP6.js.map → chunk-645WOU5I.js.map} +0 -0
- /package/dist/{chunk-AYAZWXJI.js.map → chunk-76DIF5KT.js.map} +0 -0
- /package/dist/{chunk-OPPBTPUU.js.map → chunk-7KQB4EBS.js.map} +0 -0
- /package/dist/{chunk-I2HTKOOP.js.map → chunk-7VZFRUQU.js.map} +0 -0
- /package/dist/{chunk-JCWY73FK.js.map → chunk-AHPIFKNG.js.map} +0 -0
- /package/dist/{chunk-3I22VWB3.js.map → chunk-AZMLH5UT.js.map} +0 -0
- /package/dist/{chunk-JOEJG4SD.js.map → chunk-BEC4YBNA.js.map} +0 -0
- /package/dist/{chunk-BXXOPKT5.js.map → chunk-CAMNRAJF.js.map} +0 -0
- /package/dist/{chunk-C24UZSFW.js.map → chunk-CEH2AFXG.js.map} +0 -0
- /package/dist/{chunk-YOXVZJFM.js.map → chunk-CFVTRUR3.js.map} +0 -0
- /package/dist/{chunk-SVSRPG6M.js.map → chunk-CPA5NBHN.js.map} +0 -0
- /package/dist/{chunk-7BEPVIH3.js.map → chunk-CRML27CO.js.map} +0 -0
- /package/dist/{chunk-AXGFOFNY.js.map → chunk-DA7ITC5Z.js.map} +0 -0
- /package/dist/{chunk-FEO2CDXR.js.map → chunk-DPCXDG7G.js.map} +0 -0
- /package/dist/{chunk-HZNYJN77.js.map → chunk-F3NVYTTA.js.map} +0 -0
- /package/dist/{chunk-7SSRXEZJ.js.map → chunk-F7XUD3PL.js.map} +0 -0
- /package/dist/{chunk-XZBXINXZ.js.map → chunk-GIC6BASP.js.map} +0 -0
- /package/dist/{chunk-PP7R754B.js.map → chunk-GPFZFCRN.js.map} +0 -0
- /package/dist/{chunk-53MZQEBD.js.map → chunk-GTO56JY5.js.map} +0 -0
- /package/dist/{chunk-RAIUTAZZ.js.map → chunk-H2YSH3DG.js.map} +0 -0
- /package/dist/{chunk-HWVNYNIV.js.map → chunk-HMZKGHMD.js.map} +0 -0
- /package/dist/{chunk-ZXUZ54Z5.js.map → chunk-HRHO3ZNG.js.map} +0 -0
- /package/dist/{chunk-SDEPLF7V.js.map → chunk-IBJ6U753.js.map} +0 -0
- /package/dist/{chunk-T3JQTCCO.js.map → chunk-JI7U6AS3.js.map} +0 -0
- /package/dist/{chunk-TR7DGXGI.js.map → chunk-JOZUBF4A.js.map} +0 -0
- /package/dist/{chunk-YWBOOBDP.js.map → chunk-JYSN42VN.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-D2YNNDML.js.map → chunk-KWIGDKM2.js.map} +0 -0
- /package/dist/{chunk-RIAM7DND.js.map → chunk-LDKPDODJ.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-2JHRCWHT.js.map → chunk-LKYIOCWL.js.map} +0 -0
- /package/dist/{chunk-XAWIL7TC.js.map → chunk-LOXHYCVS.js.map} +0 -0
- /package/dist/{chunk-OLBZ2WGG.js.map → chunk-LTBKKSCX.js.map} +0 -0
- /package/dist/{chunk-O4BAGJDN.js.map → chunk-MDD2RINF.js.map} +0 -0
- /package/dist/{chunk-ROEAEANL.js.map → chunk-MY2BC6UE.js.map} +0 -0
- /package/dist/{chunk-RACZB5HT.js.map → chunk-N37X5RU7.js.map} +0 -0
- /package/dist/{chunk-AG46P24C.js.map → chunk-NNBZS3DY.js.map} +0 -0
- /package/dist/{chunk-PGW64IFQ.js.map → chunk-NPFUNWNX.js.map} +0 -0
- /package/dist/{chunk-MFOSZUIT.js.map → chunk-NPIBN2VL.js.map} +0 -0
- /package/dist/{chunk-IF4EY26E.js.map → chunk-OA2O2GJ4.js.map} +0 -0
- /package/dist/{chunk-6FUMA6AA.js.map → chunk-ODU2CNNX.js.map} +0 -0
- /package/dist/{chunk-TWBQQ3FT.js.map → chunk-P36Z4JRA.js.map} +0 -0
- /package/dist/{chunk-OUKBMQ2O.js.map → chunk-PD66CVSD.js.map} +0 -0
- /package/dist/{chunk-MVIYRRVJ.js.map → chunk-PMVPCZJZ.js.map} +0 -0
- /package/dist/{chunk-US4IRASK.js.map → chunk-PU56CXZA.js.map} +0 -0
- /package/dist/{chunk-IDQ6DKXC.js.map → chunk-S5XOSTYM.js.map} +0 -0
- /package/dist/{chunk-DYO24BNB.js.map → chunk-SEEJOGQX.js.map} +0 -0
- /package/dist/{chunk-7OZSHBWK.js.map → chunk-SNOIKAHM.js.map} +0 -0
- /package/dist/{chunk-SR7JIRAR.js.map → chunk-T6ILXUAH.js.map} +0 -0
- /package/dist/{chunk-2RXUZVPU.js.map → chunk-T7XP6IZE.js.map} +0 -0
- /package/dist/{chunk-KBOG7FJV.js.map → chunk-TFR3HG4K.js.map} +0 -0
- /package/dist/{chunk-XUZ5CIEE.js.map → chunk-TUHBYJXL.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-ZK4BFABK.js.map → chunk-U7EW2W4W.js.map} +0 -0
- /package/dist/{chunk-VFYRYFLL.js.map → chunk-UEBDCMOO.js.map} +0 -0
- /package/dist/{chunk-JFWZRUKP.js.map → chunk-UENKPWCS.js.map} +0 -0
- /package/dist/{chunk-AAXJNINV.js.map → chunk-UL4MKZHI.js.map} +0 -0
- /package/dist/{chunk-R2MZCYA6.js.map → chunk-UNUMFURP.js.map} +0 -0
- /package/dist/{chunk-5GIZM4RX.js.map → chunk-UPFNQJC7.js.map} +0 -0
- /package/dist/{chunk-W4BMEGQA.js.map → chunk-UTQUEHC7.js.map} +0 -0
- /package/dist/{chunk-I32NKXE2.js.map → chunk-V4IDF3EZ.js.map} +0 -0
- /package/dist/{chunk-QMZY3GG6.js.map → chunk-WNXYT4MK.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-T42L3S6A.js.map → chunk-XBGHAAKR.js.map} +0 -0
- /package/dist/{chunk-THG4GYIE.js.map → chunk-YEUXERJ6.js.map} +0 -0
- /package/dist/{chunk-BIJAWZYW.js.map → chunk-YMOPYG3K.js.map} +0 -0
- /package/dist/{chunk-M4AHBM72.js.map → chunk-Z3YEGSR4.js.map} +0 -0
- /package/dist/{forget-SZ2BXDGF.js.map → forget-2AE4MDK3.js.map} +0 -0
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
graphEdgeDecayCadenceToCronExpr,
|
|
52
52
|
} from "../maintenance/memory-governance-cron.js";
|
|
53
53
|
import { rebuildMemoryLifecycleLedger } from "../maintenance/rebuild-memory-lifecycle-ledger.js";
|
|
54
|
+
import { resolveDaySummaryCronModel } from "../maintenance/day-summary-cron.js";
|
|
54
55
|
import {
|
|
55
56
|
createProjectionRebuildScheduleState,
|
|
56
57
|
maybeRebuildMemoryProjectionScheduled,
|
|
@@ -61,6 +62,7 @@ import {
|
|
|
61
62
|
type LifecyclePendingIo,
|
|
62
63
|
} from "../storage/memory-lifecycle-ledger-access.js";
|
|
63
64
|
import { STATE_FILE_MAX_DECRYPT_BYTES } from "../storage/secure-line-reader.js";
|
|
65
|
+
import { startLocationAutoSync, type LocationAutoSyncHandle } from "../location/scheduler.js";
|
|
64
66
|
import { ActivitySyncRegistrar } from "../activity/sync-registration.js";
|
|
65
67
|
import type { ActivitySyncRunSummary } from "../activity/runner.js";
|
|
66
68
|
import { resolveHomeDir } from "../runtime/env.js";
|
|
@@ -152,6 +154,10 @@ export class MaintenanceScheduler {
|
|
|
152
154
|
// ── Activity (screen-capture) sync scheduler (issue #1900) ──
|
|
153
155
|
// The full arm/re-arm/teardown lifecycle lives in ActivitySyncRegistrar.
|
|
154
156
|
private readonly activityRegistrar: ActivitySyncRegistrar;
|
|
157
|
+
// ── Location day-sync scheduler (issue #2047) — master default-off; the
|
|
158
|
+
// timer + lifecycle contract lives in location/scheduler.ts.
|
|
159
|
+
private locationAutoSync: LocationAutoSyncHandle | null = null;
|
|
160
|
+
|
|
155
161
|
|
|
156
162
|
constructor(private readonly deps: MaintenanceSchedulerDeps) {
|
|
157
163
|
this.activityRegistrar = new ActivitySyncRegistrar({
|
|
@@ -226,6 +232,18 @@ export class MaintenanceScheduler {
|
|
|
226
232
|
// master default-off. The registrar owns the arm/re-arm/teardown contract
|
|
227
233
|
// (stop-prior, abort/teardown guards, secure-store refusal, retry latch).
|
|
228
234
|
await this.activityRegistrar.register(signal);
|
|
235
|
+
// Location day sync (issue #2047): same deferred lifecycle as activity;
|
|
236
|
+
// ticks run the SAME shared runner as the CLI/MCP/HTTP surfaces.
|
|
237
|
+
if (
|
|
238
|
+
!signal.aborted &&
|
|
239
|
+
this.deps.config.location.enabled &&
|
|
240
|
+
this.deps.config.location.sources.some((source) => source.enabled)
|
|
241
|
+
) {
|
|
242
|
+
this.locationAutoSync = startLocationAutoSync({
|
|
243
|
+
config: this.deps.config.location,
|
|
244
|
+
memoryDir: this.deps.config.memoryDir,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
229
247
|
}
|
|
230
248
|
|
|
231
249
|
async autoRegisterDaySummaryCron(): Promise<void> {
|
|
@@ -238,36 +256,7 @@ export class MaintenanceScheduler {
|
|
|
238
256
|
return;
|
|
239
257
|
}
|
|
240
258
|
|
|
241
|
-
|
|
242
|
-
// mode, summaryModel is a direct-client model id for Remnic's own LLM
|
|
243
|
-
// calls and may be unroutable as an OpenClaw agentTurn model.
|
|
244
|
-
const rawSummaryModel = this.deps.config.summaryModel;
|
|
245
|
-
const taskPrimary = this.deps.config.taskModelChain?.primary;
|
|
246
|
-
const isGateway = this.deps.config.modelSource === "gateway";
|
|
247
|
-
const model = isGateway ? (rawSummaryModel || taskPrimary || undefined) : undefined;
|
|
248
|
-
// Attach task-chain fallbacks only when the model matches the task-chain
|
|
249
|
-
// primary. If summaryModel is a distinct override, its fallbacks would
|
|
250
|
-
// be unrelated to the task chain. Also append gateway default models as
|
|
251
|
-
// tail fallbacks (de-duped) so a task-chain outage doesn't stop the cron
|
|
252
|
-
// before reaching the gateway default chain. Mirrors hourly cron pattern.
|
|
253
|
-
const fallbacks: string[] = [];
|
|
254
|
-
if (model && taskPrimary && model === taskPrimary) {
|
|
255
|
-
const seen = new Set<string>(model ? [model] : []);
|
|
256
|
-
const addUnique = (value: string | undefined) => {
|
|
257
|
-
if (typeof value !== "string") return;
|
|
258
|
-
const trimmed = value.trim();
|
|
259
|
-
if (trimmed.length > 0 && !seen.has(trimmed)) {
|
|
260
|
-
seen.add(trimmed);
|
|
261
|
-
fallbacks.push(trimmed);
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
for (const fb of this.deps.config.taskModelChain?.fallbacks ?? []) addUnique(fb);
|
|
265
|
-
const gwDefaults = this.deps.config.gatewayConfig?.agents?.defaults?.model;
|
|
266
|
-
addUnique(gwDefaults?.primary);
|
|
267
|
-
if (Array.isArray(gwDefaults?.fallbacks)) {
|
|
268
|
-
for (const fb of gwDefaults.fallbacks) addUnique(fb);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
259
|
+
const { model, fallbacks } = resolveDaySummaryCronModel(this.deps.config);
|
|
271
260
|
|
|
272
261
|
const timezone =
|
|
273
262
|
this.deps.config.daySummaryTimezone ||
|
|
@@ -1183,12 +1172,15 @@ export class MaintenanceScheduler {
|
|
|
1183
1172
|
// re-arm QMD maintenance) and aborts+drains the sync. Capture its drain and
|
|
1184
1173
|
// await it last so the rest of teardown runs while the aborted tick unwinds.
|
|
1185
1174
|
const activityDrain = this.activityRegistrar.dispose();
|
|
1175
|
+
const locationDrain = this.locationAutoSync?.stop() ?? Promise.resolve();
|
|
1176
|
+
this.locationAutoSync = null;
|
|
1186
1177
|
if (this.qmdMaintenanceTimer) {
|
|
1187
1178
|
clearTimeout(this.qmdMaintenanceTimer);
|
|
1188
1179
|
this.qmdMaintenanceTimer = null;
|
|
1189
1180
|
}
|
|
1190
1181
|
this.qmdMaintenancePending = false;
|
|
1191
1182
|
await activityDrain;
|
|
1183
|
+
await locationDrain;
|
|
1192
1184
|
// Belt-and-suspenders: clear anything a late tick armed before the latch.
|
|
1193
1185
|
if (this.qmdMaintenanceTimer) {
|
|
1194
1186
|
clearTimeout(this.qmdMaintenanceTimer);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ContextTransformTelemetryRecord } from "../active-context-transform.js";
|
|
2
|
+
import { readContextTransformRecordRowsFromLines, readMaybeEncryptedLines } from "./secure-line-reader.js";
|
|
3
|
+
|
|
4
|
+
export interface ContextTransformLedgerHost {
|
|
5
|
+
memoryActionsPath: string;
|
|
6
|
+
ensureDirectories(): Promise<void>;
|
|
7
|
+
appendStorageSecureFile(path: string, payload: string): Promise<void>;
|
|
8
|
+
readStorageSecureFile(path: string): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function appendContextTransformRecords(
|
|
12
|
+
host: ContextTransformLedgerHost,
|
|
13
|
+
records: ContextTransformTelemetryRecord[],
|
|
14
|
+
): Promise<number> {
|
|
15
|
+
if (records.length === 0) return 0;
|
|
16
|
+
await host.ensureDirectories();
|
|
17
|
+
await host.appendStorageSecureFile(
|
|
18
|
+
host.memoryActionsPath,
|
|
19
|
+
records.map((record) => `${JSON.stringify(record)}\n`).join(""),
|
|
20
|
+
);
|
|
21
|
+
return records.length;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function readContextTransformRecords(
|
|
25
|
+
host: ContextTransformLedgerHost,
|
|
26
|
+
limit = 200,
|
|
27
|
+
): Promise<ContextTransformTelemetryRecord[]> {
|
|
28
|
+
const cappedLimit = Math.max(0, Math.floor(limit));
|
|
29
|
+
if (cappedLimit === 0 || Number.isNaN(cappedLimit)) return [];
|
|
30
|
+
try {
|
|
31
|
+
const rows = await readContextTransformRecordRowsFromLines(
|
|
32
|
+
readMaybeEncryptedLines(host.memoryActionsPath, () => host.readStorageSecureFile(host.memoryActionsPath)),
|
|
33
|
+
cappedLimit,
|
|
34
|
+
);
|
|
35
|
+
return rows.map((row) => row.record);
|
|
36
|
+
} catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -3,6 +3,7 @@ import { lstat, open } from "node:fs/promises";
|
|
|
3
3
|
import { createInterface } from "node:readline";
|
|
4
4
|
|
|
5
5
|
import { isEncryptedFile, MAGIC_HEADER_SIZE } from "../secure-store/secure-fs.js";
|
|
6
|
+
import type { ContextTransformTelemetryRecord } from "../active-context-transform.js";
|
|
6
7
|
import type { MemoryActionEvent, MemoryLifecycleEvent } from "../types.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -89,7 +90,11 @@ export async function readMemoryActionEventRowsFromLines(
|
|
|
89
90
|
const line = row.trim();
|
|
90
91
|
if (!line) continue;
|
|
91
92
|
try {
|
|
92
|
-
const parsed = JSON.parse(line) as Partial<MemoryActionEvent
|
|
93
|
+
const parsed = JSON.parse(line) as Partial<MemoryActionEvent> & { recordKind?: unknown };
|
|
94
|
+
// Ledger discriminated union (#2347): any row carrying a `recordKind`
|
|
95
|
+
// belongs to another record family (e.g. context_transform) and must
|
|
96
|
+
// be ignored here — the legacy parser stays strict for its own kind.
|
|
97
|
+
if (parsed.recordKind !== undefined) continue;
|
|
93
98
|
const outcome = parsed.outcome === "applied" || parsed.outcome === "skipped" || parsed.outcome === "failed"
|
|
94
99
|
? parsed.outcome
|
|
95
100
|
: null;
|
|
@@ -116,6 +121,50 @@ export async function readMemoryActionEventRowsFromLines(
|
|
|
116
121
|
return writeIndex === 0 ? out : [...out.slice(writeIndex), ...out.slice(0, writeIndex)];
|
|
117
122
|
}
|
|
118
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Tail read for context-transform telemetry rows (#2347). Selects ONLY
|
|
126
|
+
* records discriminated by `recordKind: "context_transform"` — the sibling
|
|
127
|
+
* of `readMemoryActionEventRowsFromLines`, with the same O(limit) ring
|
|
128
|
+
* buffer and line-number semantics. Malformed rows are skipped fail-open;
|
|
129
|
+
* legacy action rows are never returned here.
|
|
130
|
+
*/
|
|
131
|
+
export async function readContextTransformRecordRowsFromLines(
|
|
132
|
+
lines: AsyncIterable<string>,
|
|
133
|
+
limit: number,
|
|
134
|
+
): Promise<Array<{ line: number; record: ContextTransformTelemetryRecord }>> {
|
|
135
|
+
const out: Array<{ line: number; record: ContextTransformTelemetryRecord }> = [];
|
|
136
|
+
let writeIndex = 0;
|
|
137
|
+
let lineNumber = 0;
|
|
138
|
+
for await (const row of lines) {
|
|
139
|
+
lineNumber += 1;
|
|
140
|
+
const line = row.trim();
|
|
141
|
+
if (!line) continue;
|
|
142
|
+
try {
|
|
143
|
+
const parsed = JSON.parse(line) as Partial<ContextTransformTelemetryRecord>;
|
|
144
|
+
if (
|
|
145
|
+
parsed.recordKind === "context_transform" &&
|
|
146
|
+
typeof parsed.timestamp === "string" &&
|
|
147
|
+
typeof parsed.actionId === "string" &&
|
|
148
|
+
typeof parsed.planHash === "string"
|
|
149
|
+
) {
|
|
150
|
+
const entry = {
|
|
151
|
+
line: lineNumber,
|
|
152
|
+
record: parsed as ContextTransformTelemetryRecord,
|
|
153
|
+
};
|
|
154
|
+
if (out.length < limit) {
|
|
155
|
+
out.push(entry);
|
|
156
|
+
} else {
|
|
157
|
+
out[writeIndex] = entry;
|
|
158
|
+
writeIndex = (writeIndex + 1) % limit;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
} catch {
|
|
162
|
+
// Ignore malformed rows (fail-open).
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return writeIndex === 0 ? out : [...out.slice(writeIndex), ...out.slice(0, writeIndex)];
|
|
166
|
+
}
|
|
167
|
+
|
|
119
168
|
/**
|
|
120
169
|
* Validate that a parsed row carries every required lifecycle-event field.
|
|
121
170
|
* Shared by the tail reader and the per-memory reader so both apply the EXACT
|
package/src/storage.ts
CHANGED
|
@@ -29,6 +29,8 @@ import { runCommittedInvalidation } from "./storage/committed-invalidation.js";
|
|
|
29
29
|
import { renderProfileWithLastUpdated, stripOkfProfileFrontmatter, withOkfProfileFrontmatter } from "./storage/profile-header.js";
|
|
30
30
|
import { parseQuestionFile as parseQuestionFileText } from "./storage/questions-file.js";
|
|
31
31
|
import { assertNotOkfReservedBasename, OKF_QUESTION_TYPE, okfTypeForEntityKind, okfTypeForMemory } from "./okf/type-mapping.js";
|
|
32
|
+
import { appendContextTransformRecords, readContextTransformRecords } from "./storage/context-transform-ledger.js";
|
|
33
|
+
import type { ContextTransformTelemetryRecord } from "./active-context-transform.js";
|
|
32
34
|
import { readMaybeEncryptedLines, readMemoryActionEventRowsFromLines } from "./storage/secure-line-reader.js";
|
|
33
35
|
import {
|
|
34
36
|
appendLifecycleEventsSerialized,
|
|
@@ -5595,7 +5597,8 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
5595
5597
|
await this.appendStorageSecureFile(this.memoryActionsPath, payload);
|
|
5596
5598
|
return events.length;
|
|
5597
5599
|
}
|
|
5598
|
-
|
|
5600
|
+
async appendContextTransformRecords(records: ContextTransformTelemetryRecord[]) { return appendContextTransformRecords(this as never, records); }
|
|
5601
|
+
async readContextTransformRecords(limit = 200) { return readContextTransformRecords(this as never, limit); }
|
|
5599
5602
|
async appendMemoryLifecycleEvents(events: MemoryLifecycleEvent[]): Promise<number> {
|
|
5600
5603
|
if (events.length === 0) return 0;
|
|
5601
5604
|
await this.ensureDirectories();
|
package/src/types.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { DriftDetectionSettings, MemoryDriftProvenance, RecallDriftAnnotati
|
|
|
15
15
|
import type { ProceduralMaintenanceConfig } from "./procedural/maintenance-config.js";
|
|
16
16
|
import type { SkillProjectionConfig } from "./procedural/skill-projection.js";
|
|
17
17
|
import type { ActionGateConfig } from "./coding/action-gate.js";
|
|
18
|
-
|
|
18
|
+
import type { ActiveContextConfigFields } from "./active-context-config.js";
|
|
19
19
|
import type { AmbientCaptureProvenance, BufferTurnOwner, SecurityConfig, OriginMetadata } from "./security/types.js";
|
|
20
20
|
export type MemorySubject = "user" | "agent";
|
|
21
21
|
export type SubjectGuardMode = "off" | "warn" | "enforce";
|
|
@@ -682,8 +682,7 @@ export interface SemanticChunkingConfigShape {
|
|
|
682
682
|
fallbackToRecursive: boolean;
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
|
|
686
|
-
export interface PluginConfig extends BoundedJsonlStateConfig, SecurityConfig, DriftDetectionSettings {
|
|
685
|
+
export interface PluginConfig extends BoundedJsonlStateConfig, SecurityConfig, DriftDetectionSettings, ActiveContextConfigFields {
|
|
687
686
|
openaiApiKey: string | undefined;
|
|
688
687
|
openaiBaseUrl: string | undefined;
|
|
689
688
|
model: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wearables HTTP glue (issue #2047) — the wearables-input→400 error mapper
|
|
3
|
+
* extracted from access-http.ts so that size-grandfathered file keeps only
|
|
4
|
+
* thin route branches (same pattern as meetings/http-glue.ts). Returns false
|
|
5
|
+
* for non-wearables faults so backend errors keep flowing to the global 500
|
|
6
|
+
* handler.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { ServerResponse } from "node:http";
|
|
10
|
+
import { WearablesInputError } from "./errors.js";
|
|
11
|
+
|
|
12
|
+
type RespondJson = (res: ServerResponse, status: number, payload: unknown) => void;
|
|
13
|
+
|
|
14
|
+
export function respondWearablesErrorGlue(
|
|
15
|
+
respondJson: RespondJson,
|
|
16
|
+
res: ServerResponse,
|
|
17
|
+
err: unknown,
|
|
18
|
+
): boolean {
|
|
19
|
+
if (err instanceof WearablesInputError) {
|
|
20
|
+
respondJson(res, 400, {
|
|
21
|
+
error: "invalid_request",
|
|
22
|
+
code: "invalid_request",
|
|
23
|
+
message: err.message,
|
|
24
|
+
});
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/memory-worth-outcomes.ts"],"sourcesContent":["/**\n * Issue #560 PR 3 — Memory Worth outcome signal pipeline.\n *\n * PR 1 added `mw_success` / `mw_fail` fields to MemoryFrontmatter. PR 2 added\n * a pure scoring helper. This module adds the one piece tying the two\n * together: a way for callers to record a single outcome observation against\n * a memory, which increments the appropriate counter in frontmatter.\n *\n * The public entry point is `recordMemoryOutcome({ memoryPath, outcome, ... })`.\n * Callers pass the full path to the memory file (not just the ID) because in\n * the usual outcome source — the observation ledger — the memory path is\n * already captured in the event payload, and path-based lookup avoids a\n * full-corpus scan.\n *\n * Intentional properties:\n * - Works on a per-memory basis (no bulk API in this slice). Bulk update is\n * an easy layer on top of this once a second caller needs it.\n * - Reuses the existing `updateMemoryFrontmatter(id, patch)` write path so\n * unrelated fields (confidence, importance, lifecycle hooks, etc.) are\n * preserved. The PR 1 serializer rejects negative / non-integer counters,\n * so we rely on that for defensive validation rather than duplicating it.\n * - Only instruments categories in `MEMORY_WORTH_OUTCOME_ELIGIBLE_CATEGORIES`\n * (currently `fact` and `procedure` — procedures joined in issue #2370 —\n * matching `MEMORY_WORTH_ELIGIBLE_CATEGORIES` in operator-toolkit.ts for\n * the doctor audit). Non-eligible memories return\n * `{ ok: false, reason: \"ineligible_category\" }` rather than throwing so\n * the caller — typically a ledger consumer draining heterogeneous events\n * — doesn't need to pre-filter by category.\n * - Missing / unknown memory IDs return `{ ok: false, reason: \"not_found\" }`\n * rather than throwing, because outcome events may reference memories\n * that were archived/deleted between the session and the ledger drain.\n * That isn't an operator-actionable error.\n * - On success, returns the new counter values so observability surfaces\n * can report the increment without a second read.\n *\n * Out of scope (later PRs):\n * - Recall filter reading the counters (PR 4).\n * - Benchmark + default flip (PR 5).\n * - Automatic increments from extraction or summarization. Only the\n * explicit `MEM_OUTCOME` ledger tag or an MCP tool call drives writes.\n */\n\nimport path from \"node:path\";\n\nimport type { StorageManager } from \"./storage.js\";\nimport type { MemoryFrontmatter } from \"./types.js\";\n\n/**\n * Per-memory-ID serialization of the read-modify-write increment.\n *\n * Codex P1: without this, concurrent calls for the same memory race. Both\n * callers read the same `mw_*` values, each writes +1, and one increment\n * is lost — silently undercounting outcomes. We chain an async promise\n * per memory ID so read-then-write is atomic with respect to other calls\n * into this module.\n *\n * This serializes only THIS module. Direct writers (e.g. hand-rolled\n * frontmatter patches) still bypass the lock, but the documented surface\n * for Memory Worth increments is this function, and the bench only uses\n * this path.\n *\n * The lock map is WeakRef-free by design: the chain self-cleans once the\n * last pending write resolves (we delete the entry inside the `.finally`\n * of the tail), so memory use stays bounded even for long-running\n * processes that touch many different memory IDs.\n */\nconst outcomeLocks = new Map<string, Promise<unknown>>();\n\nfunction runSerialized<T>(key: string, task: () => Promise<T>): Promise<T> {\n const prev = outcomeLocks.get(key) ?? Promise.resolve();\n // Swallow upstream errors so a failed outcome for memory A doesn't\n // permanently poison the chain for memory A. We still propagate our own\n // result/errors to the caller.\n const next = prev.catch(() => undefined).then(task);\n outcomeLocks.set(key, next);\n // Chain the cleanup off `next` BUT attach a `.catch` so the cleanup\n // promise itself never surfaces as an unhandled rejection. The caller\n // gets `next` back and handles it their own way; this detached cleanup\n // chain has no observer, so without the .catch Node would crash the\n // process on a task rejection even when the caller awaited `next` and\n // handled the error correctly.\n next\n .then(\n () => {\n if (outcomeLocks.get(key) === next) outcomeLocks.delete(key);\n },\n () => {\n if (outcomeLocks.get(key) === next) outcomeLocks.delete(key);\n },\n )\n .catch(() => {\n // Defensive no-op in case a hook inside the cleanup branches throws.\n });\n return next;\n}\n\n/**\n * Categories currently instrumented for Memory Worth counters. `procedure`\n * joined in issue #2370 — the procedure library-health maintenance loop\n * retires on failure-dominant `mw_*` counters, so injected procedures must\n * be able to accrue outcomes. Must be kept in sync with\n * `MEMORY_WORTH_ELIGIBLE_CATEGORIES` in `operator-toolkit.ts`. Declared\n * here (not imported) to avoid a circular dep with operator-toolkit, which\n * imports from this file's peers. The two constants are validated by a\n * test to stay in lockstep.\n */\nconst MEMORY_WORTH_OUTCOME_ELIGIBLE_CATEGORIES: ReadonlySet<MemoryFrontmatter[\"category\"]> =\n new Set([\"fact\", \"procedure\"]);\n\n/**\n * Exported so downstream tests / operators can query the allowlist without\n * re-declaring it. Returned as a frozen copy so consumers cannot mutate the\n * module-internal set.\n */\nexport function memoryWorthOutcomeEligibleCategories(): ReadonlySet<MemoryFrontmatter[\"category\"]> {\n return new Set(MEMORY_WORTH_OUTCOME_ELIGIBLE_CATEGORIES);\n}\n\n/**\n * The direction of an outcome — whether the session that consumed this\n * memory succeeded or failed. Restricted to a string literal union so\n * callers in TypeScript land can't pass arbitrary tags.\n */\nexport type MemoryOutcomeKind = \"success\" | \"failure\";\n\n/**\n * Arguments to `recordMemoryOutcome`.\n *\n * `memoryPath` is the filesystem path to the memory; we derive the ID from\n * the basename, matching how the operator-toolkit and recall layers map\n * paths to IDs.\n */\nexport interface RecordMemoryOutcomeInput {\n /**\n * Absolute or repo-relative path to the memory file. Typically the value\n * of `MemoryFile.path` for a memory returned by `readAllMemories`.\n */\n memoryPath: string;\n /** Outcome direction — \"success\" bumps mw_success; \"failure\" bumps mw_fail. */\n outcome: MemoryOutcomeKind;\n /**\n * Optional observation timestamp for audit / telemetry. This PR doesn't\n * persist the timestamp (PR 4/5 will use `lastAccessed`, which already\n * covers the recency-decay requirement), but accepting it here keeps the\n * call shape stable so future ledger integrations don't need a breaking\n * change.\n */\n timestamp?: Date | string;\n}\n\n/**\n * Outcome of a `recordMemoryOutcome` call.\n *\n * `ok: true` means the counter was incremented and flushed. The returned\n * values reflect the post-increment state, so callers can log\n * `\"fact-xyz: 4/1 → 5/1\"` without re-reading.\n *\n * `ok: false` carries a short machine-readable `reason` so a ledger drainer\n * can aggregate metrics (\"how many events hit not_found this hour?\"). The\n * human-readable `message` is a friendlier version for logs.\n */\nexport type RecordMemoryOutcomeResult =\n | {\n ok: true;\n memoryId: string;\n /** New value of `mw_success` after the increment. */\n mw_success: number;\n /** New value of `mw_fail` after the increment. */\n mw_fail: number;\n }\n | {\n ok: false;\n reason:\n | \"not_found\"\n | \"ineligible_category\"\n | \"invalid_outcome\"\n | \"invalid_path\";\n message: string;\n };\n\n/**\n * Extract the memory ID from a file path. Memory files are stored as\n * `<id>.md`, matching the rest of the system (see `getMemoryById`, which\n * infers paths from IDs).\n *\n * Returns `null` for any path that does not end in `.md`. The check is\n * unconditional — `path.basename` strips directory components before the\n * suffix check, so previous conditional logic silently accepted\n * directory-prefixed paths like `/tmp/facts/2026-01-01/not-a-memory`\n * (the basename `not-a-memory` is not equal to the input, so the `.md`\n * guard was skipped). The new check looks at the raw input once.\n */\nfunction memoryIdFromPath(memoryPath: string): string | null {\n if (!memoryPath || typeof memoryPath !== \"string\") return null;\n if (!memoryPath.endsWith(\".md\")) return null;\n const basename = path.basename(memoryPath, \".md\");\n if (!basename) return null;\n return basename;\n}\n\n/**\n * Record a single outcome observation against a memory. Increments\n * `mw_success` or `mw_fail` on the memory's frontmatter (preserving all\n * other fields) via the existing `updateMemoryFrontmatter` write path.\n *\n * See the top-of-file doc comment for policy details (eligible categories,\n * error semantics, and what is intentionally out of scope).\n */\nexport async function recordMemoryOutcome(\n storage: StorageManager,\n input: RecordMemoryOutcomeInput,\n): Promise<RecordMemoryOutcomeResult> {\n if (input.outcome !== \"success\" && input.outcome !== \"failure\") {\n return {\n ok: false,\n reason: \"invalid_outcome\",\n message: `outcome must be \"success\" or \"failure\"; got ${JSON.stringify(input.outcome)}`,\n };\n }\n\n const memoryId = memoryIdFromPath(input.memoryPath);\n if (memoryId === null) {\n return {\n ok: false,\n reason: \"invalid_path\",\n message: `memoryPath must end in .md; got ${JSON.stringify(input.memoryPath)}`,\n };\n }\n\n // Serialize the read-modify-write per memory ID so concurrent callers\n // (parallel ledger drain, multiple MCP clients, etc.) can't each read\n // the same snapshot and race to write `+1`, losing an increment.\n return runSerialized(memoryId, async () => {\n const memory = await storage.getMemoryById(memoryId);\n if (!memory) {\n return {\n ok: false,\n reason: \"not_found\",\n message: `no memory with id ${memoryId}`,\n };\n }\n\n if (!MEMORY_WORTH_OUTCOME_ELIGIBLE_CATEGORIES.has(memory.frontmatter.category)) {\n return {\n ok: false,\n reason: \"ineligible_category\",\n message: `category ${memory.frontmatter.category} is not instrumented for Memory Worth`,\n };\n }\n\n // Absent counters are treated as 0 (matching the PR 1 semantics — legacy\n // memories implicitly have Beta(1,1) priors). Increments land on the\n // actual counter regardless of whether the field was previously set.\n const currentSuccess = memory.frontmatter.mw_success ?? 0;\n const currentFail = memory.frontmatter.mw_fail ?? 0;\n\n const nextSuccess = input.outcome === \"success\" ? currentSuccess + 1 : currentSuccess;\n const nextFail = input.outcome === \"failure\" ? currentFail + 1 : currentFail;\n\n // `updateMemoryFrontmatter` goes through `writeMemoryFrontmatter`, which\n // routes through the PR 1 serializer — so a stored corrupt value (e.g., a\n // pre-existing float) would be rejected here. That is intentional: we\n // refuse to layer a fresh increment on top of garbage. Operators should\n // use `remnic doctor` to find and fix those rows before PR 4 ships.\n //\n // `updateMemoryFrontmatter` returns `false` when the memory is no\n // longer present (archived / deleted between `getMemoryById` and the\n // write). Surface that as `not_found` so callers see an honest result\n // — silently returning `ok: true` with a counter that never landed\n // would skew downstream worth scoring.\n const updated = await storage.updateMemoryFrontmatter(memoryId, {\n mw_success: nextSuccess,\n mw_fail: nextFail,\n });\n if (!updated) {\n return {\n ok: false,\n reason: \"not_found\",\n message: `memory ${memoryId} disappeared between read and write`,\n };\n }\n\n return {\n ok: true,\n memoryId,\n mw_success: nextSuccess,\n mw_fail: nextFail,\n };\n });\n}\n"],"mappings":";AA0CA,OAAO,UAAU;AAwBjB,IAAM,eAAe,oBAAI,IAA8B;AAEvD,SAAS,cAAiB,KAAa,MAAoC;AACzE,QAAM,OAAO,aAAa,IAAI,GAAG,KAAK,QAAQ,QAAQ;AAItD,QAAM,OAAO,KAAK,MAAM,MAAM,MAAS,EAAE,KAAK,IAAI;AAClD,eAAa,IAAI,KAAK,IAAI;AAO1B,OACG;AAAA,IACC,MAAM;AACJ,UAAI,aAAa,IAAI,GAAG,MAAM,KAAM,cAAa,OAAO,GAAG;AAAA,IAC7D;AAAA,IACA,MAAM;AACJ,UAAI,aAAa,IAAI,GAAG,MAAM,KAAM,cAAa,OAAO,GAAG;AAAA,IAC7D;AAAA,EACF,EACC,MAAM,MAAM;AAAA,EAEb,CAAC;AACH,SAAO;AACT;AAYA,IAAM,2CACJ,oBAAI,IAAI,CAAC,QAAQ,WAAW,CAAC;AAOxB,SAAS,uCAAmF;AACjG,SAAO,IAAI,IAAI,wCAAwC;AACzD;AA4EA,SAAS,iBAAiB,YAAmC;AAC3D,MAAI,CAAC,cAAc,OAAO,eAAe,SAAU,QAAO;AAC1D,MAAI,CAAC,WAAW,SAAS,KAAK,EAAG,QAAO;AACxC,QAAM,WAAW,KAAK,SAAS,YAAY,KAAK;AAChD,MAAI,CAAC,SAAU,QAAO;AACtB,SAAO;AACT;AAUA,eAAsB,oBACpB,SACA,OACoC;AACpC,MAAI,MAAM,YAAY,aAAa,MAAM,YAAY,WAAW;AAC9D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,SAAS,+CAA+C,KAAK,UAAU,MAAM,OAAO,CAAC;AAAA,IACvF;AAAA,EACF;AAEA,QAAM,WAAW,iBAAiB,MAAM,UAAU;AAClD,MAAI,aAAa,MAAM;AACrB,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,SAAS,mCAAmC,KAAK,UAAU,MAAM,UAAU,CAAC;AAAA,IAC9E;AAAA,EACF;AAKA,SAAO,cAAc,UAAU,YAAY;AACzC,UAAM,SAAS,MAAM,QAAQ,cAAc,QAAQ;AACnD,QAAI,CAAC,QAAQ;AACX,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,SAAS,qBAAqB,QAAQ;AAAA,MACxC;AAAA,IACF;AAEA,QAAI,CAAC,yCAAyC,IAAI,OAAO,YAAY,QAAQ,GAAG;AAC9E,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,SAAS,YAAY,OAAO,YAAY,QAAQ;AAAA,MAClD;AAAA,IACF;AAKA,UAAM,iBAAiB,OAAO,YAAY,cAAc;AACxD,UAAM,cAAc,OAAO,YAAY,WAAW;AAElD,UAAM,cAAc,MAAM,YAAY,YAAY,iBAAiB,IAAI;AACvE,UAAM,WAAW,MAAM,YAAY,YAAY,cAAc,IAAI;AAajE,UAAM,UAAU,MAAM,QAAQ,wBAAwB,UAAU;AAAA,MAC9D,YAAY;AAAA,MACZ,SAAS;AAAA,IACX,CAAC;AACD,QAAI,CAAC,SAAS;AACZ,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,QAAQ;AAAA,QACR,SAAS,UAAU,QAAQ;AAAA,MAC7B;AAAA,IACF;AAEA,WAAO;AAAA,MACL,IAAI;AAAA,MACJ;AAAA,MACA,YAAY;AAAA,MACZ,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AACH;","names":[]}
|