@remnic/core 10.0.168 → 10.0.170
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.js +181 -179
- package/dist/access-cli.js +181 -179
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.js +11 -11
- package/dist/access-extraction-force-flush-preempt.js +181 -179
- package/dist/access-extraction-force-flush.js +181 -179
- package/dist/access-http-briefing.js +181 -179
- package/dist/access-http-query.js +181 -179
- package/dist/access-http.js +181 -179
- package/dist/access-identity-continuity-surface.js +181 -179
- package/dist/access-lcm-surface.js +181 -179
- package/dist/access-mcp.js +181 -179
- package/dist/access-observe-write-category.js +11 -11
- package/dist/access-observe-write-surface.js +181 -179
- package/dist/access-offline-manifest.js +9 -9
- package/dist/access-operations-batch.js +181 -179
- package/dist/access-operations.js +181 -179
- package/dist/access-recall-concurrency.js +181 -179
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-excerpt-attribution.d.ts +19 -0
- package/dist/access-recall-excerpt-attribution.d.ts.map +1 -0
- package/dist/access-recall-excerpt-attribution.js +8 -0
- package/dist/access-recall-response.js +181 -179
- package/dist/access-recall-surface.d.ts.map +1 -1
- package/dist/access-recall-surface.js +181 -179
- package/dist/access-schema.js +10 -10
- package/dist/access-service.js +181 -179
- package/dist/active-recall.js +30 -29
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/{auto-sync-L3M4RKJD.js → auto-sync-ACP5U5A3.js} +3 -3
- package/dist/behavior-learner.js +1 -1
- package/dist/binary-lifecycle/scanner.d.ts +2 -4
- package/dist/binary-lifecycle/scanner.d.ts.map +1 -1
- package/dist/briefing.js +19 -19
- package/dist/buffer-add-turns-bounded.d.ts +11 -1
- package/dist/buffer-add-turns-bounded.d.ts.map +1 -1
- package/dist/buffer-add-turns-bounded.js +3 -3
- package/dist/buffer-session-cap.d.ts +2 -2
- package/dist/buffer-session-cap.d.ts.map +1 -1
- package/dist/buffer-session-cap.js +1 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +13 -13
- package/dist/calibration.d.ts +19 -2
- package/dist/calibration.d.ts.map +1 -1
- package/dist/calibration.js +28 -5
- package/dist/calibration.js.map +1 -1
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{capsule-merge-VHBRF65A.js → capsule-merge-BADOICNP.js} +2 -2
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +23 -23
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-CKELO7Q6.js → chunk-2OAFPBQB.js} +2 -2
- package/dist/{chunk-2DL3OFLD.js → chunk-45GEJRIG.js} +2 -2
- package/dist/{chunk-5IZL4DCV.js → chunk-4DF5LMBJ.js} +2 -2
- package/dist/{chunk-A5UOREWD.js → chunk-4DLGKTM6.js} +2 -2
- package/dist/{chunk-WEFFO2MJ.js → chunk-4E2Z44CV.js} +2 -2
- package/dist/{chunk-X67XNZ64.js → chunk-4LVQSHHN.js} +14 -14
- package/dist/{chunk-RB7NXZ2E.js → chunk-4X7HQKAG.js} +2 -2
- package/dist/{chunk-I74SUMNI.js → chunk-5ACIRCBO.js} +65 -3
- package/dist/chunk-5ACIRCBO.js.map +1 -0
- package/dist/{chunk-LPUEBFX2.js → chunk-5JCYPBY5.js} +2 -2
- package/dist/{chunk-IMULTENA.js → chunk-5SOSQTVE.js} +2 -2
- package/dist/{chunk-D6BOOYNJ.js → chunk-5YIOUS5T.js} +384 -345
- package/dist/chunk-5YIOUS5T.js.map +1 -0
- package/dist/{chunk-5PUZV73Z.js → chunk-6VFMEBXY.js} +12 -12
- package/dist/{chunk-333SBFXB.js → chunk-7AAMJQFW.js} +2 -2
- package/dist/{chunk-BKTCVXMK.js → chunk-7SNEJNA3.js} +96 -23
- package/dist/chunk-7SNEJNA3.js.map +1 -0
- package/dist/{chunk-PFLN6TTW.js → chunk-A2XFG462.js} +2 -2
- package/dist/{chunk-WEHSQBFR.js → chunk-AIF6V2OX.js} +9 -4
- package/dist/chunk-AIF6V2OX.js.map +1 -0
- package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
- package/dist/{chunk-QFTK6EDM.js → chunk-BFZFNXOC.js} +13 -13
- package/dist/{chunk-7OCKK5M5.js → chunk-BJOQQCYC.js} +9 -9
- package/dist/{chunk-ZX546Y3Y.js → chunk-CY2C5LM4.js} +3 -3
- package/dist/{chunk-73TPOGS4.js → chunk-DC55RIEZ.js} +9 -9
- package/dist/{chunk-ZDZJNXL6.js → chunk-DK2VBJ6Q.js} +4 -4
- package/dist/{chunk-CLVILSBR.js → chunk-DNXQVCIC.js} +22 -22
- package/dist/{chunk-7VIJUZYW.js → chunk-E53NLIAP.js} +3 -3
- package/dist/{chunk-2LA3H54D.js → chunk-E5IZTY4W.js} +2 -2
- package/dist/{chunk-J74YOBB3.js → chunk-EBI6FI5U.js} +12 -12
- package/dist/{chunk-YYXYZM2I.js → chunk-ETTV5F53.js} +2 -2
- package/dist/{chunk-FRYCXXTB.js → chunk-FSORYJRP.js} +3 -3
- package/dist/{chunk-TH6OYP6I.js → chunk-GOZXQNIM.js} +3 -3
- package/dist/{chunk-TNRGWJYT.js → chunk-GUF2JKG5.js} +2 -2
- package/dist/{chunk-AL3TCNSJ.js → chunk-H3MLOQ7F.js} +24 -53
- package/dist/chunk-H3MLOQ7F.js.map +1 -0
- package/dist/{chunk-SIONKXLU.js → chunk-H6TCS5XX.js} +18 -15
- package/dist/chunk-H6TCS5XX.js.map +1 -0
- package/dist/{chunk-FEUWI5QH.js → chunk-HHPY5SSE.js} +2 -2
- package/dist/{chunk-QPFM6DHY.js → chunk-HHVK2JRE.js} +2 -2
- package/dist/{chunk-YY57TRKN.js → chunk-HR3DKJCU.js} +2 -2
- package/dist/{chunk-FMFCQRDM.js → chunk-IJKO5RVJ.js} +3 -3
- package/dist/{chunk-UMEUU66X.js → chunk-IK7NPYYU.js} +2 -2
- package/dist/{chunk-ILNPU5W5.js → chunk-IMA4DJ7K.js} +5 -45
- package/dist/chunk-IMA4DJ7K.js.map +1 -0
- package/dist/chunk-IUGOGDCP.js +39 -0
- package/dist/chunk-IUGOGDCP.js.map +1 -0
- package/dist/{chunk-CKZWLAHN.js → chunk-JDH2BA2P.js} +2 -2
- package/dist/{chunk-QVXEXGIM.js → chunk-JNBSTHVT.js} +2 -2
- package/dist/chunk-JVVWCZ2P.js +18 -0
- package/dist/chunk-JVVWCZ2P.js.map +1 -0
- package/dist/{chunk-OBPOIZNR.js → chunk-KBHUGMUW.js} +2 -2
- package/dist/{chunk-OZKVVUJB.js → chunk-KIM5VNZN.js} +2 -2
- package/dist/{chunk-ZWDDY4WF.js → chunk-KW4XA7GM.js} +3 -3
- package/dist/{chunk-OAQRZ4SV.js → chunk-L5EE2CXU.js} +2 -2
- package/dist/{chunk-QNUNAXBE.js → chunk-L7LZDISF.js} +1 -9
- package/dist/{chunk-QNUNAXBE.js.map → chunk-L7LZDISF.js.map} +1 -1
- package/dist/{chunk-RO5EGRAI.js → chunk-LAOJHOTG.js} +2 -2
- package/dist/{chunk-FOTFLHBN.js → chunk-LH57QATU.js} +3 -2
- package/dist/chunk-LH57QATU.js.map +1 -0
- package/dist/{chunk-BFPQJNFZ.js → chunk-LXSDEPEK.js} +60 -11
- package/dist/{chunk-BFPQJNFZ.js.map → chunk-LXSDEPEK.js.map} +1 -1
- package/dist/{chunk-3PNJZTDV.js → chunk-NDPS6OU2.js} +2 -2
- package/dist/{chunk-N7AIFTSH.js → chunk-NJG63FY2.js} +1 -1
- package/dist/{chunk-N7AIFTSH.js.map → chunk-NJG63FY2.js.map} +1 -1
- package/dist/{chunk-BUKK5SWA.js → chunk-NKAGGDSL.js} +3 -3
- package/dist/{chunk-BUKK5SWA.js.map → chunk-NKAGGDSL.js.map} +1 -1
- package/dist/{chunk-U3BCW7GX.js → chunk-OGQL7QC7.js} +3 -3
- package/dist/{chunk-K3FH3LAQ.js → chunk-OJXK5C6Z.js} +4 -4
- package/dist/{chunk-HDLNSDLK.js → chunk-P3XO7HE3.js} +2 -2
- package/dist/{chunk-RFLC6PKQ.js → chunk-PQIFYBUX.js} +2 -2
- package/dist/{chunk-WLT6LTQP.js → chunk-PRRWKTK6.js} +2 -2
- package/dist/{chunk-LWZNSQN3.js → chunk-PUQQPLVV.js} +3 -3
- package/dist/{chunk-LWZNSQN3.js.map → chunk-PUQQPLVV.js.map} +1 -1
- package/dist/{chunk-4L25GAYL.js → chunk-Q7OKGBZY.js} +2 -2
- package/dist/{chunk-ZQUOUPP3.js → chunk-QJBULLKG.js} +4 -4
- package/dist/{chunk-W7N7NWG5.js → chunk-QKAFFVSO.js} +2 -2
- package/dist/{chunk-EZG54YDS.js → chunk-QKBFVLDH.js} +2 -2
- package/dist/{chunk-MOUSHJAR.js → chunk-QMFHKWHN.js} +5 -5
- package/dist/{chunk-QLQUAVVP.js → chunk-QRCE77YX.js} +16 -16
- package/dist/chunk-QRCE77YX.js.map +1 -0
- package/dist/{chunk-4D2EY4WM.js → chunk-R2AJAAHJ.js} +6 -6
- package/dist/{chunk-5BE3FLKL.js → chunk-R3UQIS3F.js} +8 -8
- package/dist/{chunk-B3M56D2A.js → chunk-RDHEBINJ.js} +2 -2
- package/dist/{chunk-L7SEYUHS.js → chunk-RHQL2RIM.js} +3 -3
- package/dist/{chunk-2MWKUVHT.js → chunk-RK7SE3BL.js} +5 -5
- package/dist/{chunk-CUPILBIP.js → chunk-SA2YALFU.js} +2 -2
- package/dist/{chunk-VRHY7Y5A.js → chunk-SAPC7N43.js} +3 -3
- package/dist/{chunk-6QWFZ3X5.js → chunk-SOQOUZ2Y.js} +2 -2
- package/dist/{chunk-VHXRLD6S.js → chunk-T2JZF45K.js} +2 -2
- package/dist/{chunk-HLWXCDUQ.js → chunk-T4MKFTJF.js} +5 -5
- package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
- package/dist/{chunk-YZYAYUJQ.js → chunk-TLRIRISJ.js} +4 -4
- package/dist/{chunk-LVGTH6IQ.js → chunk-UFX24WNJ.js} +14 -14
- package/dist/{chunk-OM5ESBES.js → chunk-UH3FPX3L.js} +2 -2
- package/dist/{chunk-4NBUHYUV.js → chunk-V5W67PQV.js} +3 -3
- package/dist/{chunk-TAD6QMMD.js → chunk-VAQIBC2L.js} +2 -2
- package/dist/{chunk-3Q3XD3NO.js → chunk-W2E2WFXL.js} +3 -3
- package/dist/{chunk-UYIBNDQE.js → chunk-W2UV6VE3.js} +2 -2
- package/dist/{chunk-AVWOULJH.js → chunk-W35ICLYZ.js} +2 -2
- package/dist/{chunk-HDDRVXX4.js → chunk-W5LJ3SJ7.js} +2 -2
- package/dist/{chunk-FGT7CUYZ.js → chunk-WF2LYKOB.js} +2 -2
- package/dist/{chunk-JIF22AXI.js → chunk-WGKIXNLY.js} +5 -2
- package/dist/{chunk-JIF22AXI.js.map → chunk-WGKIXNLY.js.map} +1 -1
- package/dist/{chunk-FFWFFAP3.js → chunk-WI2WTIMY.js} +14 -8
- package/dist/chunk-WI2WTIMY.js.map +1 -0
- package/dist/{chunk-OWM2VWNX.js → chunk-X5MFCZDL.js} +82 -44
- package/dist/chunk-X5MFCZDL.js.map +1 -0
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-22V3CMIW.js → chunk-XJTRIHTH.js} +8 -8
- package/dist/{chunk-3SL52JKD.js → chunk-XVZA6VXC.js} +4 -4
- package/dist/{chunk-WWQMZBDI.js → chunk-XYNUEXLC.js} +7 -7
- package/dist/{chunk-HDWISXFH.js → chunk-Y65XX5PC.js} +2 -2
- package/dist/{chunk-3YOX2BQD.js → chunk-YE77U5HZ.js} +3 -3
- package/dist/{chunk-U2PSE7MB.js → chunk-YLTU2DC4.js} +2 -2
- package/dist/{chunk-BPCR5DZP.js → chunk-YRD525ZO.js} +6 -6
- package/dist/chunk-YRD525ZO.js.map +1 -0
- package/dist/{chunk-SBRUTD5O.js → chunk-YSATDEBY.js} +5 -5
- package/dist/{chunk-TBBDFYXW.js → chunk-YVUNHNB6.js} +2 -3
- package/dist/chunk-YVUNHNB6.js.map +1 -0
- package/dist/{chunk-GBSXTTLP.js → chunk-YY5UXARJ.js} +24 -12
- package/dist/chunk-YY5UXARJ.js.map +1 -0
- package/dist/{chunk-L272A5QW.js → chunk-YYDUBGUF.js} +30 -22
- package/dist/chunk-YYDUBGUF.js.map +1 -0
- package/dist/{chunk-5QDTZIGH.js → chunk-ZJ3CEAJD.js} +2 -2
- package/dist/{chunk-GMO3BGOF.js → chunk-ZOJUWVAU.js} +1 -1
- package/dist/{chunk-T4BT4FQN.js → chunk-ZYP4YEEI.js} +3 -3
- package/dist/cli.js +181 -179
- package/dist/coding/export-okf-codegraph.js +30 -30
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +20 -20
- package/dist/config-deprecations.d.ts +3 -0
- package/dist/config-deprecations.d.ts.map +1 -0
- package/dist/config-deprecations.js +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -29
- package/dist/connectors/codex-marketplace.d.ts.map +1 -1
- package/dist/connectors/codex-materialize-runner.js +20 -20
- package/dist/connectors/codex-materialize.d.ts.map +1 -1
- package/dist/connectors/codex-materialize.js +1 -1
- package/dist/connectors/index.js +21 -21
- package/dist/consolidation-provenance-check.js +2 -2
- package/dist/convergence-refresh.js +22 -22
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +21 -21
- package/dist/deep-recall-http-glue.js +11 -11
- package/dist/deep-recall.js +2 -2
- package/dist/embedding-fallback.js +2 -2
- package/dist/entity-retrieval.js +21 -21
- package/dist/event-order-recall.js +3 -3
- package/dist/explicit-capture.js +181 -179
- package/dist/extraction-judge.js +1 -1
- package/dist/extraction-normalization.js +1 -1
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.js +35 -35
- package/dist/{first-start-migration-BPVJ4HJQ.js → first-start-migration-PPPP54X6.js} +5 -5
- package/dist/{graph-edge-decay-BC3IO2J4.js → graph-edge-decay-EKWXRBWF.js} +6 -6
- package/dist/graph-edge-decay-EKWXRBWF.js.map +1 -0
- package/dist/graph-jsonl.js +4 -4
- package/dist/graph-snapshot.js +4 -4
- package/dist/graph.js +5 -5
- package/dist/harmonic-retrieval.js +19 -19
- package/dist/index.js +272 -269
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +7 -7
- package/dist/lifecycle.d.ts +0 -6
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +1 -1
- package/dist/local-llm.js +2 -2
- package/dist/location/index.js +31 -21
- package/dist/location/provider-setup.d.ts +26 -1
- package/dist/location/provider-setup.d.ts.map +1 -1
- package/dist/maintenance/memory-governance.js +20 -20
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +19 -19
- package/dist/maintenance/rebuild-memory-projection-runner.js +22 -22
- package/dist/maintenance/rebuild-memory-projection.js +21 -21
- package/dist/memory-browse.js +6 -6
- package/dist/memory-controller.d.ts.map +1 -1
- package/dist/memory-controller.js +1 -1
- package/dist/{migrate-from-identity-anchor-MJYB6NNN.js → migrate-from-identity-anchor-TZSZXJ6L.js} +2 -2
- package/dist/migrate-from-identity-anchor-TZSZXJ6L.js.map +1 -0
- package/dist/model-registry.d.ts +0 -5
- package/dist/model-registry.d.ts.map +1 -1
- package/dist/model-registry.js +1 -1
- package/dist/namespaces/migrate.js +20 -20
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts.map +1 -1
- package/dist/namespaces/storage.js +19 -19
- package/dist/offline-sync-changeset-generations.js +4 -4
- package/dist/offline-sync-embedding-generation.js +3 -3
- package/dist/offline-sync-snapshot-stream.js +7 -7
- package/dist/offline-sync.js +6 -6
- package/dist/operator-doctor-corpus.js +22 -22
- package/dist/operator-toolkit.js +42 -41
- package/dist/orchestration/backlog-scheduler.d.ts +4 -0
- package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
- package/dist/orchestration/backlog-scheduler.js +192 -184
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +182 -180
- package/dist/orchestration/extraction-persist-citation.d.ts +2 -2
- package/dist/orchestration/extraction-persist-citation.d.ts.map +1 -1
- package/dist/orchestration/extraction-persist.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +30 -30
- package/dist/orchestration/recall-internal.d.ts.map +1 -1
- package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -1
- package/dist/orchestration/turn-ingestion-buffered.d.ts.map +1 -1
- package/dist/orchestration/workspace-ops.d.ts.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +183 -181
- package/dist/peers/index.d.ts +2 -1
- package/dist/peers/index.d.ts.map +1 -1
- package/dist/peers/index.js +3 -3
- package/dist/peers/interaction-log-append.d.ts +8 -0
- package/dist/peers/interaction-log-append.d.ts.map +1 -0
- package/dist/peers/storage.d.ts +22 -8
- package/dist/peers/storage.d.ts.map +1 -1
- package/dist/policy-runtime.js +2 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation.js +181 -179
- package/dist/recall-state-view-admission.js +6 -6
- package/dist/recall-state-view-packet.d.ts.map +1 -1
- package/dist/recall-state-view-packet.js +30 -8
- package/dist/recall-state-view-packet.js.map +1 -1
- package/dist/recall-why-service.js +6 -6
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/manifest.js +2 -2
- package/dist/resume-bundles.js +31 -30
- package/dist/retrieval.js +2 -2
- package/dist/search/factory.js +8 -8
- package/dist/search/index.js +14 -14
- package/dist/semantic-consolidation.d.ts +10 -16
- package/dist/semantic-consolidation.d.ts.map +1 -1
- package/dist/semantic-consolidation.js +24 -24
- package/dist/semantic-rule-promotion.js +19 -19
- package/dist/semantic-rule-verifier.js +19 -19
- package/dist/source-agent-qualifier.js +25 -25
- package/dist/source-attribution.d.ts +3 -3
- package/dist/source-attribution.d.ts.map +1 -1
- package/dist/source-attribution.js +1 -1
- package/dist/standup/build.js +19 -19
- package/dist/storage/links-frontmatter.d.ts +3 -0
- package/dist/storage/links-frontmatter.d.ts.map +1 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +18 -18
- package/dist/summarizer.d.ts +7 -1
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +4 -4
- package/dist/support-passport/index.js +16 -16
- package/dist/tier-routing.js +2 -2
- package/dist/{tier-stats-FLFKN7Y6.js → tier-stats-XWJSVEHC.js} +5 -5
- package/dist/transfer/autodetect.js +3 -3
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +3 -3
- package/dist/transfer/export-okf.js +19 -19
- package/dist/transfer/import-json.js +2 -2
- package/dist/transfer/import-md.js +2 -2
- package/dist/transfer/types.d.ts +15 -3
- package/dist/transfer/types.d.ts.map +1 -1
- package/dist/transfer/types.js +3 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-learner.js +2 -2
- package/dist/utility-runtime.js +3 -3
- package/dist/verified-recall.js +19 -19
- package/dist/who-knows-cli.js +20 -20
- package/dist/who-knows.js +19 -19
- package/package.json +2 -2
- package/src/access-cli.test.ts +9 -9
- package/src/access-recall-excerpt-attribution.ts +69 -0
- package/src/access-recall-surface.ts +23 -23
- package/src/access-service-raw-excerpt-read-gate.test.ts +192 -11
- package/src/backlog-scheduler.test.ts +31 -0
- package/src/binary-lifecycle/scanner.ts +35 -14
- package/src/buffer-add-turns-bounded.ts +16 -2
- package/src/buffer-session-cap.ts +4 -4
- package/src/buffer.ts +5 -5
- package/src/calibration.ts +56 -4
- package/src/config-deprecations.ts +14 -0
- package/src/config.ts +2 -1
- package/src/connectors/codex-marketplace-git.test.ts +267 -0
- package/src/connectors/codex-marketplace.ts +76 -13
- package/src/connectors/codex-materialize.ts +29 -55
- package/src/lifecycle.ts +0 -8
- package/src/location/provider-setup.test.ts +273 -2
- package/src/location/provider-setup.ts +138 -32
- package/src/memory-controller.test.ts +11 -0
- package/src/memory-controller.ts +5 -1
- package/src/model-registry.ts +0 -11
- package/src/namespaces/storage.ts +1 -0
- package/src/orchestration/backlog-scheduler.ts +12 -3
- package/src/orchestration/extraction-persist-citation.ts +5 -3
- package/src/orchestration/extraction-persist.ts +15 -14
- package/src/orchestration/recall-internal.ts +2 -3
- package/src/orchestration/semantic-consolidation-coordinator.ts +40 -33
- package/src/orchestration/semantic-consolidation-split.test.ts +72 -0
- package/src/orchestration/turn-ingestion-buffered.test.ts +52 -1
- package/src/orchestration/turn-ingestion-buffered.ts +26 -8
- package/src/orchestration/workspace-ops.test.ts +23 -0
- package/src/orchestration/workspace-ops.ts +6 -5
- package/src/orchestrator.ts +1 -0
- package/src/peers/index.ts +1 -1
- package/src/peers/interaction-log-append.ts +132 -0
- package/src/peers/peers.test.ts +30 -0
- package/src/peers/profile-reasoner.ts +1 -1
- package/src/peers/storage.ts +4 -105
- package/src/recall-state-view-packet.test.ts +40 -0
- package/src/recall-state-view-packet.ts +46 -9
- package/src/semantic-consolidation.ts +35 -27
- package/src/source-attribution.test.ts +57 -0
- package/src/source-attribution.ts +46 -43
- package/src/storage/links-frontmatter.ts +69 -0
- package/src/storage-links-parse.test.ts +153 -0
- package/src/storage.ts +8 -21
- package/src/summarizer-shutdown.test.ts +49 -16
- package/src/summarizer.ts +13 -5
- package/src/testing/subjects/dependency-propagation.test.ts +5 -4
- package/src/testing/subjects/memory-maintenance.test.ts +293 -0
- package/src/transfer/capsule-export.ts +2 -1
- package/src/transfer/capsule-taxonomy-version.test.ts +70 -0
- package/src/transfer/types.ts +13 -3
- package/src/types.ts +1 -0
- package/dist/chunk-AL3TCNSJ.js.map +0 -1
- package/dist/chunk-BKTCVXMK.js.map +0 -1
- package/dist/chunk-BPCR5DZP.js.map +0 -1
- package/dist/chunk-D6BOOYNJ.js.map +0 -1
- package/dist/chunk-FFWFFAP3.js.map +0 -1
- package/dist/chunk-FOTFLHBN.js.map +0 -1
- package/dist/chunk-GBSXTTLP.js.map +0 -1
- package/dist/chunk-I74SUMNI.js.map +0 -1
- package/dist/chunk-ILNPU5W5.js.map +0 -1
- package/dist/chunk-L272A5QW.js.map +0 -1
- package/dist/chunk-OWM2VWNX.js.map +0 -1
- package/dist/chunk-QLQUAVVP.js.map +0 -1
- package/dist/chunk-SIONKXLU.js.map +0 -1
- package/dist/chunk-TBBDFYXW.js.map +0 -1
- package/dist/chunk-WEHSQBFR.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-recall-excerpt-attribution.js.map} +0 -0
- /package/dist/{auto-sync-L3M4RKJD.js.map → auto-sync-ACP5U5A3.js.map} +0 -0
- /package/dist/{graph-edge-decay-BC3IO2J4.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{capsule-merge-VHBRF65A.js.map → capsule-merge-BADOICNP.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-CKELO7Q6.js.map → chunk-2OAFPBQB.js.map} +0 -0
- /package/dist/{chunk-2DL3OFLD.js.map → chunk-45GEJRIG.js.map} +0 -0
- /package/dist/{chunk-5IZL4DCV.js.map → chunk-4DF5LMBJ.js.map} +0 -0
- /package/dist/{chunk-A5UOREWD.js.map → chunk-4DLGKTM6.js.map} +0 -0
- /package/dist/{chunk-WEFFO2MJ.js.map → chunk-4E2Z44CV.js.map} +0 -0
- /package/dist/{chunk-X67XNZ64.js.map → chunk-4LVQSHHN.js.map} +0 -0
- /package/dist/{chunk-RB7NXZ2E.js.map → chunk-4X7HQKAG.js.map} +0 -0
- /package/dist/{chunk-LPUEBFX2.js.map → chunk-5JCYPBY5.js.map} +0 -0
- /package/dist/{chunk-IMULTENA.js.map → chunk-5SOSQTVE.js.map} +0 -0
- /package/dist/{chunk-5PUZV73Z.js.map → chunk-6VFMEBXY.js.map} +0 -0
- /package/dist/{chunk-333SBFXB.js.map → chunk-7AAMJQFW.js.map} +0 -0
- /package/dist/{chunk-PFLN6TTW.js.map → chunk-A2XFG462.js.map} +0 -0
- /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
- /package/dist/{chunk-QFTK6EDM.js.map → chunk-BFZFNXOC.js.map} +0 -0
- /package/dist/{chunk-7OCKK5M5.js.map → chunk-BJOQQCYC.js.map} +0 -0
- /package/dist/{chunk-ZX546Y3Y.js.map → chunk-CY2C5LM4.js.map} +0 -0
- /package/dist/{chunk-73TPOGS4.js.map → chunk-DC55RIEZ.js.map} +0 -0
- /package/dist/{chunk-ZDZJNXL6.js.map → chunk-DK2VBJ6Q.js.map} +0 -0
- /package/dist/{chunk-CLVILSBR.js.map → chunk-DNXQVCIC.js.map} +0 -0
- /package/dist/{chunk-7VIJUZYW.js.map → chunk-E53NLIAP.js.map} +0 -0
- /package/dist/{chunk-2LA3H54D.js.map → chunk-E5IZTY4W.js.map} +0 -0
- /package/dist/{chunk-J74YOBB3.js.map → chunk-EBI6FI5U.js.map} +0 -0
- /package/dist/{chunk-YYXYZM2I.js.map → chunk-ETTV5F53.js.map} +0 -0
- /package/dist/{chunk-FRYCXXTB.js.map → chunk-FSORYJRP.js.map} +0 -0
- /package/dist/{chunk-TH6OYP6I.js.map → chunk-GOZXQNIM.js.map} +0 -0
- /package/dist/{chunk-TNRGWJYT.js.map → chunk-GUF2JKG5.js.map} +0 -0
- /package/dist/{chunk-FEUWI5QH.js.map → chunk-HHPY5SSE.js.map} +0 -0
- /package/dist/{chunk-QPFM6DHY.js.map → chunk-HHVK2JRE.js.map} +0 -0
- /package/dist/{chunk-YY57TRKN.js.map → chunk-HR3DKJCU.js.map} +0 -0
- /package/dist/{chunk-FMFCQRDM.js.map → chunk-IJKO5RVJ.js.map} +0 -0
- /package/dist/{chunk-UMEUU66X.js.map → chunk-IK7NPYYU.js.map} +0 -0
- /package/dist/{chunk-CKZWLAHN.js.map → chunk-JDH2BA2P.js.map} +0 -0
- /package/dist/{chunk-QVXEXGIM.js.map → chunk-JNBSTHVT.js.map} +0 -0
- /package/dist/{chunk-OBPOIZNR.js.map → chunk-KBHUGMUW.js.map} +0 -0
- /package/dist/{chunk-OZKVVUJB.js.map → chunk-KIM5VNZN.js.map} +0 -0
- /package/dist/{chunk-ZWDDY4WF.js.map → chunk-KW4XA7GM.js.map} +0 -0
- /package/dist/{chunk-OAQRZ4SV.js.map → chunk-L5EE2CXU.js.map} +0 -0
- /package/dist/{chunk-RO5EGRAI.js.map → chunk-LAOJHOTG.js.map} +0 -0
- /package/dist/{chunk-3PNJZTDV.js.map → chunk-NDPS6OU2.js.map} +0 -0
- /package/dist/{chunk-U3BCW7GX.js.map → chunk-OGQL7QC7.js.map} +0 -0
- /package/dist/{chunk-K3FH3LAQ.js.map → chunk-OJXK5C6Z.js.map} +0 -0
- /package/dist/{chunk-HDLNSDLK.js.map → chunk-P3XO7HE3.js.map} +0 -0
- /package/dist/{chunk-RFLC6PKQ.js.map → chunk-PQIFYBUX.js.map} +0 -0
- /package/dist/{chunk-WLT6LTQP.js.map → chunk-PRRWKTK6.js.map} +0 -0
- /package/dist/{chunk-4L25GAYL.js.map → chunk-Q7OKGBZY.js.map} +0 -0
- /package/dist/{chunk-ZQUOUPP3.js.map → chunk-QJBULLKG.js.map} +0 -0
- /package/dist/{chunk-W7N7NWG5.js.map → chunk-QKAFFVSO.js.map} +0 -0
- /package/dist/{chunk-EZG54YDS.js.map → chunk-QKBFVLDH.js.map} +0 -0
- /package/dist/{chunk-MOUSHJAR.js.map → chunk-QMFHKWHN.js.map} +0 -0
- /package/dist/{chunk-4D2EY4WM.js.map → chunk-R2AJAAHJ.js.map} +0 -0
- /package/dist/{chunk-5BE3FLKL.js.map → chunk-R3UQIS3F.js.map} +0 -0
- /package/dist/{chunk-B3M56D2A.js.map → chunk-RDHEBINJ.js.map} +0 -0
- /package/dist/{chunk-L7SEYUHS.js.map → chunk-RHQL2RIM.js.map} +0 -0
- /package/dist/{chunk-2MWKUVHT.js.map → chunk-RK7SE3BL.js.map} +0 -0
- /package/dist/{chunk-CUPILBIP.js.map → chunk-SA2YALFU.js.map} +0 -0
- /package/dist/{chunk-VRHY7Y5A.js.map → chunk-SAPC7N43.js.map} +0 -0
- /package/dist/{chunk-6QWFZ3X5.js.map → chunk-SOQOUZ2Y.js.map} +0 -0
- /package/dist/{chunk-VHXRLD6S.js.map → chunk-T2JZF45K.js.map} +0 -0
- /package/dist/{chunk-HLWXCDUQ.js.map → chunk-T4MKFTJF.js.map} +0 -0
- /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
- /package/dist/{chunk-YZYAYUJQ.js.map → chunk-TLRIRISJ.js.map} +0 -0
- /package/dist/{chunk-LVGTH6IQ.js.map → chunk-UFX24WNJ.js.map} +0 -0
- /package/dist/{chunk-OM5ESBES.js.map → chunk-UH3FPX3L.js.map} +0 -0
- /package/dist/{chunk-4NBUHYUV.js.map → chunk-V5W67PQV.js.map} +0 -0
- /package/dist/{chunk-TAD6QMMD.js.map → chunk-VAQIBC2L.js.map} +0 -0
- /package/dist/{chunk-3Q3XD3NO.js.map → chunk-W2E2WFXL.js.map} +0 -0
- /package/dist/{chunk-UYIBNDQE.js.map → chunk-W2UV6VE3.js.map} +0 -0
- /package/dist/{chunk-AVWOULJH.js.map → chunk-W35ICLYZ.js.map} +0 -0
- /package/dist/{chunk-HDDRVXX4.js.map → chunk-W5LJ3SJ7.js.map} +0 -0
- /package/dist/{chunk-FGT7CUYZ.js.map → chunk-WF2LYKOB.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-22V3CMIW.js.map → chunk-XJTRIHTH.js.map} +0 -0
- /package/dist/{chunk-3SL52JKD.js.map → chunk-XVZA6VXC.js.map} +0 -0
- /package/dist/{chunk-WWQMZBDI.js.map → chunk-XYNUEXLC.js.map} +0 -0
- /package/dist/{chunk-HDWISXFH.js.map → chunk-Y65XX5PC.js.map} +0 -0
- /package/dist/{chunk-3YOX2BQD.js.map → chunk-YE77U5HZ.js.map} +0 -0
- /package/dist/{chunk-U2PSE7MB.js.map → chunk-YLTU2DC4.js.map} +0 -0
- /package/dist/{chunk-SBRUTD5O.js.map → chunk-YSATDEBY.js.map} +0 -0
- /package/dist/{chunk-5QDTZIGH.js.map → chunk-ZJ3CEAJD.js.map} +0 -0
- /package/dist/{chunk-GMO3BGOF.js.map → chunk-ZOJUWVAU.js.map} +0 -0
- /package/dist/{chunk-T4BT4FQN.js.map → chunk-ZYP4YEEI.js.map} +0 -0
- /package/dist/{migrate-from-identity-anchor-MJYB6NNN.js.map → config-deprecations.js.map} +0 -0
- /package/dist/{first-start-migration-BPVJ4HJQ.js.map → first-start-migration-PPPP54X6.js.map} +0 -0
- /package/dist/{tier-stats-FLFKN7Y6.js.map → tier-stats-XWJSVEHC.js.map} +0 -0
|
@@ -1518,3 +1518,60 @@ test("citation matcher resists polynomial ReDoS on hostile unterminated input (C
|
|
|
1518
1518
|
const valid = parseAllCitations("body [Source: doc-1 , 2026-06-08 ]");
|
|
1519
1519
|
assert.equal(valid.length, 1);
|
|
1520
1520
|
});
|
|
1521
|
+
|
|
1522
|
+
test("#3567 hasCitationForTemplate: default fast path consults configured prior templates", () => {
|
|
1523
|
+
// Fact written while a custom template was configured; config later reverted
|
|
1524
|
+
// to the default. The marker does not match the default shape, so the old
|
|
1525
|
+
// `template === DEFAULT_CITATION_FORMAT` fast path returned false and the
|
|
1526
|
+
// body was double-cited / hash-mismatched on reprocess.
|
|
1527
|
+
const priorTemplate = "[src:{agent}/{session}@{date}]";
|
|
1528
|
+
const body = "Latency improved after the index rebuild.";
|
|
1529
|
+
const cited = attachCitation(
|
|
1530
|
+
body,
|
|
1531
|
+
{ agent: "scout", session: "agent:scout:alpha", ts: "2026-04-10T14:25:07Z" },
|
|
1532
|
+
priorTemplate,
|
|
1533
|
+
);
|
|
1534
|
+
|
|
1535
|
+
// The prior template is out of history: the miss stands (documents the
|
|
1536
|
+
// operator contract — list prior formats in inlineSourceAttributionFormatHistory).
|
|
1537
|
+
assert.equal(hasCitationForTemplate(cited, DEFAULT_CITATION_FORMAT), false);
|
|
1538
|
+
|
|
1539
|
+
// With the prior template declared, the same check detects it.
|
|
1540
|
+
assert.equal(
|
|
1541
|
+
hasCitationForTemplate(cited, DEFAULT_CITATION_FORMAT, [priorTemplate]),
|
|
1542
|
+
true,
|
|
1543
|
+
);
|
|
1544
|
+
});
|
|
1545
|
+
|
|
1546
|
+
test("#3567 stripCitationForTemplate strips a prior-template marker under a reverted config", () => {
|
|
1547
|
+
const priorTemplate = "[src:{agent}/{session}@{date}]";
|
|
1548
|
+
const body = "Latency improved after the index rebuild.";
|
|
1549
|
+
const cited = attachCitation(
|
|
1550
|
+
body,
|
|
1551
|
+
{ agent: "scout", session: "agent:scout:alpha", ts: "2026-04-10T14:25:07Z" },
|
|
1552
|
+
priorTemplate,
|
|
1553
|
+
);
|
|
1554
|
+
|
|
1555
|
+
assert.equal(
|
|
1556
|
+
stripCitationForTemplate(cited, DEFAULT_CITATION_FORMAT, [priorTemplate]),
|
|
1557
|
+
body,
|
|
1558
|
+
);
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
test("#3567 attachCitation does not double-cite a body carrying a prior-template marker", () => {
|
|
1562
|
+
const priorTemplate = "[src:{agent}/{session}@{date}]";
|
|
1563
|
+
const body = "Latency improved after the index rebuild.";
|
|
1564
|
+
const cited = attachCitation(
|
|
1565
|
+
body,
|
|
1566
|
+
{ agent: "scout", session: "agent:scout:alpha", ts: "2026-04-10T14:25:07Z" },
|
|
1567
|
+
priorTemplate,
|
|
1568
|
+
);
|
|
1569
|
+
|
|
1570
|
+
const reattached = attachCitation(
|
|
1571
|
+
cited,
|
|
1572
|
+
{ agent: "planner", session: "agent:planner:main", ts: "2026-06-01T00:00:00Z" },
|
|
1573
|
+
DEFAULT_CITATION_FORMAT,
|
|
1574
|
+
[priorTemplate],
|
|
1575
|
+
);
|
|
1576
|
+
assert.equal(reattached, cited);
|
|
1577
|
+
});
|
|
@@ -407,40 +407,34 @@ function templateMatcher(template: string): RegExp | null {
|
|
|
407
407
|
* `[Source: ...]` marker detection which is always available via
|
|
408
408
|
* {@link hasCitation}.
|
|
409
409
|
*/
|
|
410
|
-
export function hasCitationForTemplate(
|
|
410
|
+
export function hasCitationForTemplate(
|
|
411
|
+
text: string,
|
|
412
|
+
template: string,
|
|
413
|
+
priorTemplates: readonly string[] = [],
|
|
414
|
+
): boolean {
|
|
411
415
|
if (typeof text !== "string" || text.length === 0) return false;
|
|
412
416
|
// Always accept the default format as a fallback so facts tagged before a
|
|
413
417
|
// configuration change are not double-tagged on reprocessing.
|
|
414
418
|
if (hasCitation(text)) return true;
|
|
415
|
-
//
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
420
|
-
//
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
// (missing an old custom citation) produces a benign duplicate citation rather
|
|
424
|
-
// than data loss. A full fix would require storing the citation template used
|
|
425
|
-
// at write time in the frontmatter and checking that here.
|
|
426
|
-
if (template === DEFAULT_CITATION_FORMAT) return false;
|
|
427
|
-
|
|
428
|
-
// Fully-literal template (no placeholders): exact inclusion check.
|
|
429
|
-
if (!PLACEHOLDER_REGEX.test(template)) {
|
|
430
|
-
// Reset lastIndex because PLACEHOLDER_REGEX is declared with /g.
|
|
419
|
+
// Probe the current template plus every declared prior format
|
|
420
|
+
// (`inlineSourceAttributionFormatHistory`, issue #3567). A fact written
|
|
421
|
+
// while a different template was configured is detected here instead of
|
|
422
|
+
// being double-cited or hashed with its marker intact on reprocess.
|
|
423
|
+
// citationTemplatesToRecognize drops undetectable shapes, so an
|
|
424
|
+
// all-placeholder prior cannot false-positive.
|
|
425
|
+
for (const candidate of citationTemplatesToRecognize(template, priorTemplates)) {
|
|
426
|
+
if (candidate === DEFAULT_CITATION_FORMAT) continue;
|
|
431
427
|
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
// docstring — callers should not rely on dedup for this shape.
|
|
441
|
-
return false;
|
|
428
|
+
if (!PLACEHOLDER_REGEX.test(candidate)) {
|
|
429
|
+
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
430
|
+
if (text.includes(candidate)) return true;
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
434
|
+
const matcher = templateMatcher(candidate);
|
|
435
|
+
if (matcher?.test(text)) return true;
|
|
442
436
|
}
|
|
443
|
-
return
|
|
437
|
+
return false;
|
|
444
438
|
}
|
|
445
439
|
|
|
446
440
|
/**
|
|
@@ -573,9 +567,10 @@ export function attachCitation(
|
|
|
573
567
|
text: string,
|
|
574
568
|
ctx: CitationContext,
|
|
575
569
|
template: string = DEFAULT_CITATION_FORMAT,
|
|
570
|
+
priorTemplates: readonly string[] = [],
|
|
576
571
|
): string {
|
|
577
572
|
if (typeof text !== "string") return text as unknown as string;
|
|
578
|
-
if (hasCitationForTemplate(text, template)) return text;
|
|
573
|
+
if (hasCitationForTemplate(text, template, priorTemplates)) return text;
|
|
579
574
|
const trimmedEnd = trimTrailingWhitespace(text);
|
|
580
575
|
if (trimmedEnd.length === 0) return text;
|
|
581
576
|
const citation = formatCitation(ctx, template);
|
|
@@ -730,28 +725,36 @@ export function stripCitation(text: string): string {
|
|
|
730
725
|
export function stripCitationForTemplate(
|
|
731
726
|
text: string,
|
|
732
727
|
template: string,
|
|
728
|
+
priorTemplates: readonly string[] = [],
|
|
733
729
|
): string {
|
|
734
730
|
if (typeof text !== "string" || text.length === 0) return text;
|
|
735
731
|
|
|
736
|
-
// First pass: the default-format marker, if any.
|
|
737
|
-
//
|
|
738
|
-
//
|
|
739
|
-
|
|
732
|
+
// First pass: the default-format marker, if any. Later passes still run —
|
|
733
|
+
// a body can carry the default marker AND markers from the current or a
|
|
734
|
+
// prior configured template, and canonicalization must remove every
|
|
735
|
+
// recognized form.
|
|
736
|
+
let out = hasCitation(text) ? stripCitation(text) : text;
|
|
740
737
|
|
|
741
|
-
|
|
738
|
+
for (const candidate of citationTemplatesToRecognize(template, priorTemplates)) {
|
|
739
|
+
if (candidate === DEFAULT_CITATION_FORMAT) continue;
|
|
740
|
+
out = stripSingleTemplateCitation(out, candidate);
|
|
741
|
+
}
|
|
742
|
+
return out;
|
|
743
|
+
}
|
|
742
744
|
|
|
745
|
+
// Strips every marker `template` produces — literal templates by exact
|
|
746
|
+
// match, placeholder templates via the compiled matcher. Undetectable
|
|
747
|
+
// (all-placeholder) shapes leave the text unchanged.
|
|
748
|
+
function stripSingleTemplateCitation(text: string, template: string): string {
|
|
743
749
|
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
744
750
|
if (!PLACEHOLDER_REGEX.test(template)) {
|
|
745
751
|
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
746
|
-
return stripExactLiteralCitation(
|
|
752
|
+
return stripExactLiteralCitation(text, template);
|
|
747
753
|
}
|
|
748
754
|
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
749
755
|
|
|
750
|
-
// Build the template matcher. hasCitationForTemplate already returned true,
|
|
751
|
-
// which means templateMatcher produced a non-null result. The null branch
|
|
752
|
-
// here is a defensive fallback only — the default pass already ran.
|
|
753
756
|
const matcher = templateMatcher(template);
|
|
754
|
-
if (!matcher) return
|
|
757
|
+
if (!matcher) return text;
|
|
755
758
|
|
|
756
759
|
// The matcher regex was built without the global flag; add it for exec loop.
|
|
757
760
|
const globalMatcher = new RegExp(
|
|
@@ -762,12 +765,12 @@ export function stripCitationForTemplate(
|
|
|
762
765
|
let lastIndex = 0;
|
|
763
766
|
let match: RegExpExecArray | null;
|
|
764
767
|
|
|
765
|
-
while ((match = globalMatcher.exec(
|
|
768
|
+
while ((match = globalMatcher.exec(text)) !== null) {
|
|
766
769
|
const matchEnd = match.index + match[0].length;
|
|
767
|
-
const enclosure = enclosingDelimiterRange(
|
|
770
|
+
const enclosure = enclosingDelimiterRange(text, match.index, matchEnd);
|
|
768
771
|
const removalStart = enclosure?.start ?? match.index;
|
|
769
772
|
const removalEnd = enclosure?.end ?? matchEnd;
|
|
770
|
-
const before =
|
|
773
|
+
const before = text.slice(lastIndex, removalStart).replace(/[ \t]+$/, "");
|
|
771
774
|
result += before;
|
|
772
775
|
lastIndex = removalEnd;
|
|
773
776
|
// Guard against zero-width matches causing an infinite loop.
|
|
@@ -776,7 +779,7 @@ export function stripCitationForTemplate(
|
|
|
776
779
|
}
|
|
777
780
|
}
|
|
778
781
|
|
|
779
|
-
const after =
|
|
782
|
+
const after = text.slice(lastIndex).replace(/^[ \t]+/, "");
|
|
780
783
|
if (after.length > 0) {
|
|
781
784
|
if (result.length > 0) result += " ";
|
|
782
785
|
result += after;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { MemoryLink } from "../types.js";
|
|
2
|
+
|
|
3
|
+
// Parse links: block-sequence items of "key: value" fields under the
|
|
4
|
+
// links: key. Field order is free; an item missing targetId, a known
|
|
5
|
+
// linkType, or a 0-1 strength drops alone (issue #3568). Fields must sit
|
|
6
|
+
// at the item's own key column — deeper lines are nested scalar content
|
|
7
|
+
// (e.g. a "note: |" block), not link fields.
|
|
8
|
+
export function parseFrontmatterLinks(
|
|
9
|
+
fmBlock: string,
|
|
10
|
+
parseReason: (raw: string) => string,
|
|
11
|
+
): MemoryLink[] | undefined {
|
|
12
|
+
const fmLines = fmBlock.split("\n");
|
|
13
|
+
const linksKeyIdx = fmLines.findIndex((l) => l.trimEnd() === "links:");
|
|
14
|
+
if (linksKeyIdx === -1) return undefined;
|
|
15
|
+
|
|
16
|
+
const linksIndent = fmLines[linksKeyIdx].search(/\S/);
|
|
17
|
+
const items: Record<string, string>[] = [];
|
|
18
|
+
let fieldIndent = -1;
|
|
19
|
+
let itemIndent = -1;
|
|
20
|
+
for (let k = linksKeyIdx + 1; k < fmLines.length; k++) {
|
|
21
|
+
const line = fmLines[k];
|
|
22
|
+
const t = line.trim();
|
|
23
|
+
if (!t || t.startsWith("#")) continue;
|
|
24
|
+
const indent = line.search(/\S/);
|
|
25
|
+
if (indent <= linksIndent) break;
|
|
26
|
+
if (t.startsWith("- ")) {
|
|
27
|
+
if (itemIndent === -1) itemIndent = indent;
|
|
28
|
+
if (indent !== itemIndent) continue;
|
|
29
|
+
items.push({});
|
|
30
|
+
const inline = t.slice(2);
|
|
31
|
+
const colon = inline.indexOf(":");
|
|
32
|
+
fieldIndent = colon > 0 ? indent + 2 : -1;
|
|
33
|
+
if (colon > 0) {
|
|
34
|
+
items[items.length - 1][inline.slice(0, colon).trim()] = inline.slice(colon + 1).trim();
|
|
35
|
+
}
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (items.length === 0) continue;
|
|
39
|
+
const colon = t.indexOf(":");
|
|
40
|
+
if (colon <= 0) continue;
|
|
41
|
+
if (fieldIndent === -1) fieldIndent = indent;
|
|
42
|
+
if (indent !== fieldIndent) continue;
|
|
43
|
+
items[items.length - 1][t.slice(0, colon).trim()] = t.slice(colon + 1).trim();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const links: MemoryLink[] = [];
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
const strength = item.strength ? Number(item.strength) : NaN;
|
|
49
|
+
if (
|
|
50
|
+
!item.targetId ||
|
|
51
|
+
!["follows", "references", "contradicts", "supports", "related"].includes(item.linkType ?? "") ||
|
|
52
|
+
!Number.isFinite(strength) ||
|
|
53
|
+
strength < 0 ||
|
|
54
|
+
strength > 1
|
|
55
|
+
) continue;
|
|
56
|
+
links.push({
|
|
57
|
+
targetId: item.targetId,
|
|
58
|
+
// SAFETY: linkType passed the closed literal list in the guard
|
|
59
|
+
// above, so the string narrows to MemoryLink["linkType"].
|
|
60
|
+
linkType: item.linkType as MemoryLink["linkType"],
|
|
61
|
+
strength,
|
|
62
|
+
reason:
|
|
63
|
+
item.reason?.startsWith('"') && item.reason.endsWith('"')
|
|
64
|
+
? parseReason(item.reason.slice(1, -1))
|
|
65
|
+
: item.reason,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return links.length > 0 ? links : undefined;
|
|
69
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import * as assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { parseFrontmatter } from "./storage.js";
|
|
5
|
+
|
|
6
|
+
const BODY = "body text\n";
|
|
7
|
+
|
|
8
|
+
test("links: block items parse regardless of field order (issue #3568)", () => {
|
|
9
|
+
const raw = `---
|
|
10
|
+
links:
|
|
11
|
+
- strength: 0.8
|
|
12
|
+
targetId: mem-a
|
|
13
|
+
linkType: related
|
|
14
|
+
---
|
|
15
|
+
${BODY}`;
|
|
16
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
17
|
+
assert.deepEqual(links, [
|
|
18
|
+
{ targetId: "mem-a", linkType: "related", strength: 0.8, reason: undefined },
|
|
19
|
+
]);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("links: items round-trip in the serializer's own order", () => {
|
|
23
|
+
const raw = `---
|
|
24
|
+
links:
|
|
25
|
+
- targetId: mem-a
|
|
26
|
+
linkType: related
|
|
27
|
+
strength: 0.8
|
|
28
|
+
reason: "because \\"quoted\\""
|
|
29
|
+
- targetId: mem-b
|
|
30
|
+
linkType: contradicts
|
|
31
|
+
strength: 0.2
|
|
32
|
+
---
|
|
33
|
+
${BODY}`;
|
|
34
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
35
|
+
assert.equal(links?.length, 2);
|
|
36
|
+
assert.equal(links?.[0]?.reason, 'because "quoted"');
|
|
37
|
+
assert.equal(links?.[1]?.targetId, "mem-b");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("links: a corrupt item drops without losing its siblings", () => {
|
|
41
|
+
const raw = `---
|
|
42
|
+
links:
|
|
43
|
+
- targetId: mem-a
|
|
44
|
+
linkType: related
|
|
45
|
+
strength: 0.8
|
|
46
|
+
- targetId: mem-b
|
|
47
|
+
linkType: related
|
|
48
|
+
- targetId: mem-c
|
|
49
|
+
linkType: bogus-type
|
|
50
|
+
strength: 0.5
|
|
51
|
+
- targetId: mem-d
|
|
52
|
+
linkType: supports
|
|
53
|
+
strength: 1.5
|
|
54
|
+
---
|
|
55
|
+
${BODY}`;
|
|
56
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
57
|
+
assert.deepEqual(links, [
|
|
58
|
+
{ targetId: "mem-a", linkType: "related", strength: 0.8, reason: undefined },
|
|
59
|
+
]);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("links: a link-shaped string inside another scalar makes no phantom link", () => {
|
|
63
|
+
const raw = `---
|
|
64
|
+
description: "note - targetId: mem-x linkType: related strength: 0.9 inside"
|
|
65
|
+
---
|
|
66
|
+
${BODY}`;
|
|
67
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
68
|
+
assert.equal(links, undefined);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("links: a standalone comment between items does not truncate the list", () => {
|
|
72
|
+
const raw = `---
|
|
73
|
+
links:
|
|
74
|
+
- targetId: mem-a
|
|
75
|
+
linkType: related
|
|
76
|
+
strength: 0.8
|
|
77
|
+
# next link
|
|
78
|
+
- targetId: mem-b
|
|
79
|
+
linkType: supports
|
|
80
|
+
strength: 0.5
|
|
81
|
+
---
|
|
82
|
+
${BODY}`;
|
|
83
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
84
|
+
assert.equal(links?.length, 2);
|
|
85
|
+
assert.equal(links?.[1]?.targetId, "mem-b");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test("links: block-scalar content inside an item cannot overwrite link fields", () => {
|
|
89
|
+
const raw = `---
|
|
90
|
+
links:
|
|
91
|
+
- targetId: mem-a
|
|
92
|
+
linkType: related
|
|
93
|
+
strength: 0.8
|
|
94
|
+
note: |
|
|
95
|
+
targetId: mem-x
|
|
96
|
+
linkType: contradicts
|
|
97
|
+
strength: 0.9
|
|
98
|
+
---
|
|
99
|
+
${BODY}`;
|
|
100
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
101
|
+
assert.deepEqual(links, [
|
|
102
|
+
{ targetId: "mem-a", linkType: "related", strength: 0.8, reason: undefined },
|
|
103
|
+
]);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test("links: a dash line inside nested scalar content is not a new item", () => {
|
|
107
|
+
const raw = `---
|
|
108
|
+
links:
|
|
109
|
+
- targetId: mem-a
|
|
110
|
+
linkType: related
|
|
111
|
+
strength: 0.8
|
|
112
|
+
note: |
|
|
113
|
+
- targetId: mem-x
|
|
114
|
+
linkType: contradicts
|
|
115
|
+
strength: 0.9
|
|
116
|
+
---
|
|
117
|
+
${BODY}`;
|
|
118
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
119
|
+
assert.deepEqual(links, [
|
|
120
|
+
{ targetId: "mem-a", linkType: "related", strength: 0.8, reason: undefined },
|
|
121
|
+
]);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test("links: an empty strength drops the item, strength 0 stays valid", () => {
|
|
125
|
+
const raw = `---
|
|
126
|
+
links:
|
|
127
|
+
- targetId: mem-a
|
|
128
|
+
linkType: related
|
|
129
|
+
strength:
|
|
130
|
+
- targetId: mem-b
|
|
131
|
+
linkType: supports
|
|
132
|
+
strength: 0
|
|
133
|
+
---
|
|
134
|
+
${BODY}`;
|
|
135
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
136
|
+
assert.deepEqual(links, [
|
|
137
|
+
{ targetId: "mem-b", linkType: "supports", strength: 0, reason: undefined },
|
|
138
|
+
]);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("links: unknown keys on an item do not drop the link", () => {
|
|
142
|
+
const raw = `---
|
|
143
|
+
links:
|
|
144
|
+
- targetId: mem-a
|
|
145
|
+
linkType: related
|
|
146
|
+
strength: 0.8
|
|
147
|
+
created: 2026-11-21
|
|
148
|
+
---
|
|
149
|
+
${BODY}`;
|
|
150
|
+
const links = parseFrontmatter(raw)?.frontmatter.links;
|
|
151
|
+
assert.equal(links?.length, 1);
|
|
152
|
+
assert.equal(links?.[0]?.targetId, "mem-a");
|
|
153
|
+
});
|
package/src/storage.ts
CHANGED
|
@@ -29,6 +29,7 @@ import { MemoryReadStore, readWindowedMemories, type WindowedMemoryReadOptions,
|
|
|
29
29
|
import { runCommittedInvalidation } from "./storage/committed-invalidation.js";
|
|
30
30
|
import { renderProfileWithLastUpdated, stripOkfProfileFrontmatter, withOkfProfileFrontmatter } from "./storage/profile-header.js";
|
|
31
31
|
import { appendToProfileSerialized, commitConsolidatedProfileSerialized, type ProfileMutationPorts } from "./storage/profile-mutation.js";
|
|
32
|
+
import { parseFrontmatterLinks } from "./storage/links-frontmatter.js";
|
|
32
33
|
import { parseQuestionFile as parseQuestionFileText } from "./storage/questions-file.js";
|
|
33
34
|
import { assertNotOkfReservedBasename, OKF_QUESTION_TYPE, okfTypeForEntityKind, okfTypeForMemory } from "./okf/type-mapping.js";
|
|
34
35
|
import { appendContextTransformRecords, readContextTransformRecords } from "./storage/context-transform-ledger.js";
|
|
@@ -954,24 +955,9 @@ export function parseFrontmatter(raw: string): { frontmatter: MemoryFrontmatter;
|
|
|
954
955
|
content,
|
|
955
956
|
};
|
|
956
957
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
const links: MemoryLink[] = [];
|
|
961
|
-
const linkMatches = fmBlock.matchAll(
|
|
962
|
-
/- targetId: (\S+)\s+linkType: (\S+)\s+strength: ([\d.]+)(?:\s+reason: "((?:\\.|[^"\\])*)")?/g
|
|
963
|
-
);
|
|
964
|
-
for (const match of linkMatches) {
|
|
965
|
-
links.push({
|
|
966
|
-
targetId: match[1],
|
|
967
|
-
linkType: match[2] as MemoryLink["linkType"],
|
|
968
|
-
strength: parseFloat(match[3]),
|
|
969
|
-
reason: match[4] ? parseLinkReasonValue(match[4]) : undefined,
|
|
970
|
-
});
|
|
971
|
-
}
|
|
972
|
-
if (links.length > 0) {
|
|
973
|
-
result.frontmatter.links = links;
|
|
974
|
-
}
|
|
958
|
+
const links = parseFrontmatterLinks(fmBlock, parseLinkReasonValue);
|
|
959
|
+
if (links) {
|
|
960
|
+
result.frontmatter.links = links;
|
|
975
961
|
}
|
|
976
962
|
|
|
977
963
|
return result;
|
|
@@ -1923,6 +1909,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
1923
1909
|
private offlineSyncDigestCacheWriteTimer: ReturnType<typeof setTimeout> | null = null;
|
|
1924
1910
|
/** Optional: set by the orchestrator after construction to enable template-aware citation stripping during legacy hash rebuild. */
|
|
1925
1911
|
citationTemplate: string = DEFAULT_CITATION_FORMAT;
|
|
1912
|
+
citationTemplateHistory: string[] = [];
|
|
1926
1913
|
/** Post-write catalog hook (#1522). Installed by the namespace router; fire-and-forget. */
|
|
1927
1914
|
onCatalogWrite?: () => void;
|
|
1928
1915
|
/** Post-write embedding hook (#2019). Installed by the orchestrator; fire-and-forget. */
|
|
@@ -3142,7 +3129,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
3142
3129
|
// and the normalized-text tier must match re-extraction, which hashes
|
|
3143
3130
|
// the citation-stripped contentHashSource. Idempotent on pre-stripped
|
|
3144
3131
|
// text (e.g. recordSupersession).
|
|
3145
|
-
const strippedRawContent = stripCitationForTemplate(input.rawContent, this.citationTemplate);
|
|
3132
|
+
const strippedRawContent = stripCitationForTemplate(input.rawContent, this.citationTemplate, this.citationTemplateHistory);
|
|
3146
3133
|
// Canonicalization + post-append recheck (#2213) live in the helper.
|
|
3147
3134
|
return await entityRefs.appendCanonicalizedTombstone(
|
|
3148
3135
|
this.stateDir,
|
|
@@ -3212,7 +3199,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
3212
3199
|
const all = [...(await this.readAllMemories()), ...(await this.readAllColdMemories())];
|
|
3213
3200
|
// Pure projection (lifecycle/tombstones.ts) keeps this method thin (#1520).
|
|
3214
3201
|
const retired = collectRetiredMemoriesForRebuild(all, {
|
|
3215
|
-
stripCitation: (text) => stripCitationForTemplate(text, this.citationTemplate),
|
|
3202
|
+
stripCitation: (text) => stripCitationForTemplate(text, this.citationTemplate, this.citationTemplateHistory),
|
|
3216
3203
|
supersessionKeysForFact,
|
|
3217
3204
|
});
|
|
3218
3205
|
return await store.rebuild(retired);
|
|
@@ -3428,7 +3415,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
3428
3415
|
}
|
|
3429
3416
|
private storedContentIdentityCandidates(content: string): string[] {
|
|
3430
3417
|
return storedContentIdentityCandidates(content, (value) =>
|
|
3431
|
-
hasCitationForTemplate(value, this.citationTemplate) ? stripCitationForTemplate(value, this.citationTemplate) : value
|
|
3418
|
+
hasCitationForTemplate(value, this.citationTemplate, this.citationTemplateHistory) ? stripCitationForTemplate(value, this.citationTemplate, this.citationTemplateHistory) : value
|
|
3432
3419
|
);
|
|
3433
3420
|
}
|
|
3434
3421
|
|
|
@@ -11,6 +11,7 @@ import { parseConfig } from "./config.js";
|
|
|
11
11
|
import { initLogger, resetLogger } from "./logger.js";
|
|
12
12
|
import { HourlySummarizer } from "./summarizer.js";
|
|
13
13
|
import type { LocalLlmChatCompletionOptions } from "./local-llm-helpers.js";
|
|
14
|
+
import type { LocalLlmClient } from "./local-llm.js";
|
|
14
15
|
import type { TranscriptEntry } from "./types.js";
|
|
15
16
|
|
|
16
17
|
function createConfig(memoryDir: string, extended = false) {
|
|
@@ -34,11 +35,9 @@ interface LlmStub {
|
|
|
34
35
|
calls: { signal: AbortSignal | undefined }[];
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// signal aborts (real transport behavior), mirroring a wedged local LLM.
|
|
41
|
-
(summarizer as any).localLlm = {
|
|
38
|
+
|
|
39
|
+
function parkingChatCompletionStub(stub: LlmStub): Pick<LocalLlmClient, "chatCompletion"> {
|
|
40
|
+
return {
|
|
42
41
|
chatCompletion: async (
|
|
43
42
|
messages: Array<{ role: string; content: string }>,
|
|
44
43
|
options: LocalLlmChatCompletionOptions,
|
|
@@ -98,8 +97,8 @@ test("aborting the shutdown signal aborts an in-flight generateSummary and reach
|
|
|
98
97
|
undefined,
|
|
99
98
|
undefined,
|
|
100
99
|
controller.signal,
|
|
100
|
+
{ localLlm: parkingChatCompletionStub(stub) },
|
|
101
101
|
);
|
|
102
|
-
stubLocalLlm(summarizer, stub);
|
|
103
102
|
|
|
104
103
|
const hourStart = new Date(Date.now() - 3_600_000);
|
|
105
104
|
hourStart.setMinutes(0, 0, 0);
|
|
@@ -135,8 +134,8 @@ test("an already-aborted summarizer refuses to start new work and never contacts
|
|
|
135
134
|
undefined,
|
|
136
135
|
undefined,
|
|
137
136
|
controller.signal,
|
|
137
|
+
{ localLlm: parkingChatCompletionStub(stub) },
|
|
138
138
|
);
|
|
139
|
-
stubLocalLlm(summarizer, stub);
|
|
140
139
|
|
|
141
140
|
const hourStart = new Date(Date.now() - 3_600_000);
|
|
142
141
|
hourStart.setMinutes(0, 0, 0);
|
|
@@ -150,6 +149,40 @@ test("an already-aborted summarizer refuses to start new work and never contacts
|
|
|
150
149
|
}
|
|
151
150
|
});
|
|
152
151
|
|
|
152
|
+
|
|
153
|
+
test("an injected local LLM stub receives the summary call through the constructor seam", async () => {
|
|
154
|
+
quietLogger();
|
|
155
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-summary-seam-"));
|
|
156
|
+
const stub: LlmStub = { calls: [] };
|
|
157
|
+
try {
|
|
158
|
+
const controller = new AbortController();
|
|
159
|
+
const summarizer = new HourlySummarizer(
|
|
160
|
+
createConfig(memoryDir),
|
|
161
|
+
undefined,
|
|
162
|
+
undefined,
|
|
163
|
+
undefined,
|
|
164
|
+
controller.signal,
|
|
165
|
+
{ localLlm: parkingChatCompletionStub(stub) },
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const hourStart = new Date(Date.now() - 3_600_000);
|
|
169
|
+
hourStart.setMinutes(0, 0, 0);
|
|
170
|
+
const pending = summarizer.generateSummary("sess-summary-seam", hourStart, entriesFor());
|
|
171
|
+
await withTestDeadline((async () => {
|
|
172
|
+
while (stub.calls.length === 0) {
|
|
173
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
174
|
+
}
|
|
175
|
+
})(), 5_000, "injected LLM stub to be entered");
|
|
176
|
+
controller.abort();
|
|
177
|
+
assert.equal(await withTestDeadline(pending, 2_000, "in-flight summarizer abort"), null);
|
|
178
|
+
assert.equal(stub.calls.length, 1);
|
|
179
|
+
assert.equal(stub.calls[0]?.signal?.aborted, true);
|
|
180
|
+
} finally {
|
|
181
|
+
resetLogger();
|
|
182
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
153
186
|
for (const extended of [false, true]) {
|
|
154
187
|
test(`a shutdown abort during the local call does not start a gateway call (${extended ? "extended" : "standard"} summary)`, async () => {
|
|
155
188
|
quietLogger();
|
|
@@ -164,16 +197,16 @@ for (const extended of [false, true]) {
|
|
|
164
197
|
undefined,
|
|
165
198
|
undefined,
|
|
166
199
|
controller.signal,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
200
|
+
{
|
|
201
|
+
localLlm: parkingChatCompletionStub(stub),
|
|
202
|
+
fallbackLlm: {
|
|
203
|
+
parseWithSchema: async (): Promise<null> => {
|
|
204
|
+
gatewayCalls += 1;
|
|
205
|
+
return null;
|
|
206
|
+
},
|
|
207
|
+
},
|
|
175
208
|
},
|
|
176
|
-
|
|
209
|
+
);
|
|
177
210
|
|
|
178
211
|
const hourStart = new Date(Date.now() - 3_600_000);
|
|
179
212
|
hourStart.setMinutes(0, 0, 0);
|
package/src/summarizer.ts
CHANGED
|
@@ -107,11 +107,16 @@ export function summarizeHourlyStatus(stats: HourlySummarizerRunStats): {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
export type HourlySummarizerLlmClients = {
|
|
111
|
+
localLlm?: Pick<LocalLlmClient, "chatCompletion">;
|
|
112
|
+
fallbackLlm?: Pick<FallbackLlmClient, "parseWithSchema">;
|
|
113
|
+
};
|
|
114
|
+
|
|
110
115
|
export class HourlySummarizer {
|
|
111
116
|
private summariesDir: string;
|
|
112
117
|
private config: PluginConfig;
|
|
113
|
-
private localLlm: LocalLlmClient
|
|
114
|
-
private fallbackLlm: FallbackLlmClient
|
|
118
|
+
private localLlm: Pick<LocalLlmClient, "chatCompletion">;
|
|
119
|
+
private fallbackLlm: Pick<FallbackLlmClient, "parseWithSchema">;
|
|
115
120
|
private modelRegistry: ModelRegistry;
|
|
116
121
|
private transcript?: TranscriptManager;
|
|
117
122
|
/** Orchestrator-owned stop signal: refuses new summaries and aborts the
|
|
@@ -123,7 +128,8 @@ export class HourlySummarizer {
|
|
|
123
128
|
gatewayConfig?: GatewayConfig,
|
|
124
129
|
modelRegistry?: ModelRegistry,
|
|
125
130
|
transcript?: TranscriptManager,
|
|
126
|
-
shutdownSignal?: AbortSignal
|
|
131
|
+
shutdownSignal?: AbortSignal,
|
|
132
|
+
llmClients?: HourlySummarizerLlmClients
|
|
127
133
|
) {
|
|
128
134
|
this.config = config;
|
|
129
135
|
this.summariesDir = path.join(config.memoryDir, "summaries", "hourly");
|
|
@@ -132,10 +138,12 @@ export class HourlySummarizer {
|
|
|
132
138
|
this.shutdownSignal = shutdownSignal;
|
|
133
139
|
|
|
134
140
|
// Initialize local LLM client with shared model registry
|
|
135
|
-
this.localLlm = new LocalLlmClient(config, this.modelRegistry, shutdownSignal);
|
|
141
|
+
this.localLlm = llmClients?.localLlm ?? new LocalLlmClient(config, this.modelRegistry, shutdownSignal);
|
|
136
142
|
|
|
137
143
|
// Initialize fallback client with gateway config
|
|
138
|
-
this.fallbackLlm =
|
|
144
|
+
this.fallbackLlm =
|
|
145
|
+
llmClients?.fallbackLlm ??
|
|
146
|
+
new FallbackLlmClient(gatewayConfig, fallbackLlmRuntimeContextFromConfig(config));
|
|
139
147
|
|
|
140
148
|
if (
|
|
141
149
|
!gatewayConfig?.agents?.defaults?.model?.primary &&
|
|
@@ -123,10 +123,11 @@ function namespaceMemories(namespace: NamespaceName): MemoryFile[] {
|
|
|
123
123
|
|
|
124
124
|
function serializeFixture(memory: MemoryFile): string {
|
|
125
125
|
const links = (memory.frontmatter.links ?? [])
|
|
126
|
-
.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
.flatMap((link) => [
|
|
127
|
+
` - targetId: ${link.targetId}`,
|
|
128
|
+
` linkType: ${link.linkType}`,
|
|
129
|
+
` strength: ${link.strength ?? 0.9}`,
|
|
130
|
+
])
|
|
130
131
|
.join("\n");
|
|
131
132
|
return [
|
|
132
133
|
"---",
|