@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
package/src/model-registry.ts
CHANGED
|
@@ -322,17 +322,6 @@ export class ModelRegistry {
|
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
/**
|
|
326
|
-
* Fetch capabilities from Hugging Face (if available)
|
|
327
|
-
* Returns true if successful
|
|
328
|
-
*/
|
|
329
|
-
async fetchFromHuggingFace(modelId: string): Promise<boolean> {
|
|
330
|
-
// This would be implemented to fetch from HF Hub API
|
|
331
|
-
// For now, we rely on the known models and manual updates
|
|
332
|
-
log.info(`ModelRegistry: fetchFromHuggingFace not yet implemented for ${modelId}`);
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
325
|
/**
|
|
337
326
|
* List all cached models
|
|
338
327
|
*/
|
|
@@ -376,6 +376,7 @@ export class NamespaceStorageRouter {
|
|
|
376
376
|
// (used by extraction and shared-promotion paths) strip citations consistently,
|
|
377
377
|
// matching the behaviour of the primary this.storage instance in the orchestrator.
|
|
378
378
|
sm.citationTemplate = this.config.inlineSourceAttributionFormat;
|
|
379
|
+
sm.citationTemplateHistory = this.config.inlineSourceAttributionFormatHistory;
|
|
379
380
|
// #1522: install the post-write catalog touch at the chokepoint — every
|
|
380
381
|
// successful write on this StorageManager records the namespace touch.
|
|
381
382
|
this.bindCatalogWriteHook(sm, ns);
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
29
29
|
import { hostname } from "node:os";
|
|
30
|
+
import { resolveMaxTurnsPerSession } from "../buffer-session-cap.js";
|
|
30
31
|
import { log } from "../logger.js";
|
|
31
32
|
import type { Orchestrator } from "../orchestrator.js";
|
|
32
33
|
import type { BufferDrainClaims, DrainLease } from "../storage/buffer-drain-claims.js";
|
|
@@ -61,6 +62,10 @@ export interface BacklogSchedulerDeps {
|
|
|
61
62
|
breakerSnapshot?(): ProviderBreakerSnapshot;
|
|
62
63
|
/** Test seam: monotonic-ish clock for backoff windows. */
|
|
63
64
|
now?(): number;
|
|
65
|
+
/** The buffer's per-session turn cap. A live key holding this many turns
|
|
66
|
+
* refuses new captures, so discovery lists it before the claim page.
|
|
67
|
+
* Optional: without it, discovery keeps plain claim-page-first order. */
|
|
68
|
+
maxTurnsPerSession?(): number;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
export interface BacklogSchedulerOptions {
|
|
@@ -285,6 +290,7 @@ export class BacklogScheduler {
|
|
|
285
290
|
|
|
286
291
|
/** Bounded discovery: ONE page of existing claims with pending turns */
|
|
287
292
|
private async discoverCandidates(): Promise<{ key: string; needsClaim: boolean }[]> {
|
|
293
|
+
const capped: { key: string; needsClaim: boolean }[] = [];
|
|
288
294
|
const out: { key: string; needsClaim: boolean }[] = [];
|
|
289
295
|
const seen = new Set<string>();
|
|
290
296
|
const pageLimit = Math.max(this.submissionLimit() * 4, 16);
|
|
@@ -294,13 +300,15 @@ export class BacklogScheduler {
|
|
|
294
300
|
out.push({ key: listed.key, needsClaim: false });
|
|
295
301
|
}
|
|
296
302
|
this.claimCursor = page.nextCursor;
|
|
303
|
+
const turnCap = this.deps.maxTurnsPerSession?.() ?? Number.POSITIVE_INFINITY;
|
|
297
304
|
for (const [key, counts] of await this.deps.liveBufferCounts()) {
|
|
298
|
-
|
|
305
|
+
const held = counts.turns + counts.retainedTurns;
|
|
306
|
+
if (held <= 0) continue;
|
|
299
307
|
if (seen.has(key) || this.deps.claims.isClaimed(key)) continue;
|
|
300
308
|
seen.add(key);
|
|
301
|
-
out.push({ key, needsClaim: true });
|
|
309
|
+
(held >= turnCap ? capped : out).push({ key, needsClaim: true });
|
|
302
310
|
}
|
|
303
|
-
return out;
|
|
311
|
+
return [...capped, ...out];
|
|
304
312
|
}
|
|
305
313
|
|
|
306
314
|
/** Submission bound: the queue's own concurrency limit, read with the
|
|
@@ -529,6 +537,7 @@ export function wireBacklogScheduler(
|
|
|
529
537
|
// The orchestrator's one shared provider breaker (foreground and every
|
|
530
538
|
// claim-backed drain accumulate toward the same threshold).
|
|
531
539
|
breakerSnapshot: () => orchestrator.getExtractionResilienceStatus().breaker,
|
|
540
|
+
maxTurnsPerSession: () => resolveMaxTurnsPerSession(orchestrator.config.bufferMaxTurnsPerSession),
|
|
532
541
|
},
|
|
533
542
|
options
|
|
534
543
|
);
|
|
@@ -11,11 +11,12 @@ export function normalizeStoredHashSource(
|
|
|
11
11
|
raw: string,
|
|
12
12
|
citationEnabled: boolean,
|
|
13
13
|
citationTemplate: string,
|
|
14
|
+
citationHistory: readonly string[] = [],
|
|
14
15
|
): string {
|
|
15
16
|
return ContentHashIndex.normalizeContent(
|
|
16
17
|
sanitizeMemoryContent(
|
|
17
|
-
citationEnabled && hasCitationForTemplate(raw, citationTemplate)
|
|
18
|
-
? stripCitationForTemplate(raw, citationTemplate)
|
|
18
|
+
citationEnabled && hasCitationForTemplate(raw, citationTemplate, citationHistory)
|
|
19
|
+
? stripCitationForTemplate(raw, citationTemplate, citationHistory)
|
|
19
20
|
: raw,
|
|
20
21
|
).text,
|
|
21
22
|
);
|
|
@@ -26,6 +27,7 @@ export function applyInlineCitation(
|
|
|
26
27
|
citationEnabled: boolean,
|
|
27
28
|
citationTemplate: string,
|
|
28
29
|
citationContextBase: Omit<CitationContext, "ts">,
|
|
30
|
+
citationHistory: readonly string[] = [],
|
|
29
31
|
): string {
|
|
30
32
|
if (!citationEnabled) return content;
|
|
31
33
|
if (typeof content !== "string" || content.length === 0) return content;
|
|
@@ -33,5 +35,5 @@ export function applyInlineCitation(
|
|
|
33
35
|
...citationContextBase,
|
|
34
36
|
ts: new Date().toISOString(),
|
|
35
37
|
};
|
|
36
|
-
return attachCitation(content, citationContext, citationTemplate);
|
|
38
|
+
return attachCitation(content, citationContext, citationTemplate, citationHistory);
|
|
37
39
|
}
|
|
@@ -171,6 +171,7 @@ export class ExtractionPersistCoordinator {
|
|
|
171
171
|
): Promise<ExtractionPersistResult> {
|
|
172
172
|
const citationEnabled = resolvePipelineProcessingCapabilities(this.deps.config).inlineSourceAttribution === true;
|
|
173
173
|
const citationTemplate = this.deps.config.inlineSourceAttributionFormat;
|
|
174
|
+
const citationHistory = this.deps.config.inlineSourceAttributionFormatHistory;
|
|
174
175
|
const factDedupEnabled = resolveRecallAuxiliaryCapabilities(this.deps.config).factDeduplication;
|
|
175
176
|
const harmonicConstructionEnabled = resolveCapabilities(this.deps.config).harmonicRetrieval;
|
|
176
177
|
const harmonicAnchorsEnabled =
|
|
@@ -189,7 +190,7 @@ export class ExtractionPersistCoordinator {
|
|
|
189
190
|
const promotedCopyProbe = createBatchPromotedCopyProbe(this.deps.config, this.deps.getStorageRouter, scopeProfileWritePlan); // #2330 finding F: one promoted-copy scan per namespace per batch
|
|
190
191
|
|
|
191
192
|
const normalizeStoredHashSource = (raw: string): string =>
|
|
192
|
-
normalizeStoredHashSourceContent(raw, citationEnabled, citationTemplate);
|
|
193
|
+
normalizeStoredHashSourceContent(raw, citationEnabled, citationTemplate, citationHistory);
|
|
193
194
|
const citationContextBase: Omit<CitationContext, "ts"> = citationEnabled
|
|
194
195
|
? {
|
|
195
196
|
agent: sourceContext?.principal,
|
|
@@ -197,7 +198,7 @@ export class ExtractionPersistCoordinator {
|
|
|
197
198
|
}
|
|
198
199
|
: {};
|
|
199
200
|
const applyInlineCitation = (content: string): string =>
|
|
200
|
-
applyInlineCitationToContent(content, citationEnabled, citationTemplate, citationContextBase);
|
|
201
|
+
applyInlineCitationToContent(content, citationEnabled, citationTemplate, citationContextBase, citationHistory);
|
|
201
202
|
const persistedIds: string[] = [];
|
|
202
203
|
const memoryPathById = new Map<string, string>();
|
|
203
204
|
const anchorSnapshots = new ExtractionAnchorSnapshot({
|
|
@@ -385,8 +386,8 @@ export class ExtractionPersistCoordinator {
|
|
|
385
386
|
);
|
|
386
387
|
if (targets.length === 0) return [];
|
|
387
388
|
const rawContent =
|
|
388
|
-
citationEnabled && hasCitationForTemplate(options.content, citationTemplate)
|
|
389
|
-
? stripCitationForTemplate(options.content, citationTemplate)
|
|
389
|
+
citationEnabled && hasCitationForTemplate(options.content, citationTemplate, citationHistory)
|
|
390
|
+
? stripCitationForTemplate(options.content, citationTemplate, citationHistory)
|
|
390
391
|
: options.content;
|
|
391
392
|
const citedContent = applyInlineCitation(rawContent);
|
|
392
393
|
const sanitizedBase = sanitizeMemoryContent(rawContent);
|
|
@@ -617,8 +618,8 @@ export class ExtractionPersistCoordinator {
|
|
|
617
618
|
// uses the exact body writeMemory stores (#369/#401, #402 round-6).
|
|
618
619
|
const rawContent =
|
|
619
620
|
citationEnabled &&
|
|
620
|
-
hasCitationForTemplate(options.content, citationTemplate)
|
|
621
|
-
? stripCitationForTemplate(options.content, citationTemplate)
|
|
621
|
+
hasCitationForTemplate(options.content, citationTemplate, citationHistory)
|
|
622
|
+
? stripCitationForTemplate(options.content, citationTemplate, citationHistory)
|
|
622
623
|
: options.content;
|
|
623
624
|
const citedContent = applyInlineCitation(rawContent);
|
|
624
625
|
const sanitizedBase = sanitizeMemoryContent(rawContent);
|
|
@@ -996,8 +997,8 @@ export class ExtractionPersistCoordinator {
|
|
|
996
997
|
// Build the same dedupContent the promotion functions hash on so the
|
|
997
998
|
// content-hash lookup in the helper matches what was stored.
|
|
998
999
|
const rawContent =
|
|
999
|
-
citationEnabled && hasCitationForTemplate(args.content, citationTemplate)
|
|
1000
|
-
? stripCitationForTemplate(args.content, citationTemplate)
|
|
1000
|
+
citationEnabled && hasCitationForTemplate(args.content, citationTemplate, citationHistory)
|
|
1001
|
+
? stripCitationForTemplate(args.content, citationTemplate, citationHistory)
|
|
1001
1002
|
: args.content;
|
|
1002
1003
|
const sanitizedBase = sanitizeMemoryContent(rawContent);
|
|
1003
1004
|
// #2014 round 3: promoted copies were written from SALVAGE envelopes,
|
|
@@ -1659,8 +1660,8 @@ export class ExtractionPersistCoordinator {
|
|
|
1659
1660
|
// the title alone, so distinct step lists are not collapsed (issue #519).
|
|
1660
1661
|
const canonicalContentForHash =
|
|
1661
1662
|
citationEnabled &&
|
|
1662
|
-
hasCitationForTemplate(fact.content, citationTemplate)
|
|
1663
|
-
? stripCitationForTemplate(fact.content, citationTemplate)
|
|
1663
|
+
hasCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
1664
|
+
? stripCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
1664
1665
|
: fact.content;
|
|
1665
1666
|
const contentHashDedupKey =
|
|
1666
1667
|
writeCategory === "procedure"
|
|
@@ -2161,8 +2162,8 @@ export class ExtractionPersistCoordinator {
|
|
|
2161
2162
|
// via stripCitationForTemplate before calling hasFactContentHash.
|
|
2162
2163
|
const rawChunkedContent =
|
|
2163
2164
|
citationEnabled &&
|
|
2164
|
-
hasCitationForTemplate(fact.content, citationTemplate)
|
|
2165
|
-
? stripCitationForTemplate(fact.content, citationTemplate)
|
|
2165
|
+
hasCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
2166
|
+
? stripCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
2166
2167
|
: fact.content;
|
|
2167
2168
|
const citedChunkedContent = applyInlineCitation(rawChunkedContent);
|
|
2168
2169
|
const parentWriteEnvelope = composeSalvagedExtractionEnvelope(
|
|
@@ -2416,8 +2417,8 @@ export class ExtractionPersistCoordinator {
|
|
|
2416
2417
|
try {
|
|
2417
2418
|
const canonicalChunkedContent =
|
|
2418
2419
|
citationEnabled &&
|
|
2419
|
-
hasCitationForTemplate(fact.content, citationTemplate)
|
|
2420
|
-
? stripCitationForTemplate(fact.content, citationTemplate)
|
|
2420
|
+
hasCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
2421
|
+
? stripCitationForTemplate(fact.content, citationTemplate, citationHistory)
|
|
2421
2422
|
: fact.content;
|
|
2422
2423
|
// #1645: do NOT register a tombstone-blocked fact's content in the
|
|
2423
2424
|
// dedup index — writeMemory already skipped it (rule 44). Re-adding
|
|
@@ -1368,9 +1368,8 @@ export class RecallInternalCoordinator {
|
|
|
1368
1368
|
return null;
|
|
1369
1369
|
}
|
|
1370
1370
|
const section = buildCalibrationRecallSection(
|
|
1371
|
-
rules
|
|
1372
|
-
|
|
1373
|
-
this.deps.config.calibrationMaxChars,
|
|
1371
|
+
rules, retrievalQuery, this.deps.config.calibrationMaxChars,
|
|
1372
|
+
this.deps.config.calibrationMaxRulesPerRecall,
|
|
1374
1373
|
);
|
|
1375
1374
|
recordRecallSectionMetric({
|
|
1376
1375
|
section: "calibrationRules",
|
|
@@ -207,7 +207,7 @@ export class SemanticConsolidationCoordinator {
|
|
|
207
207
|
{
|
|
208
208
|
role: "system" as const,
|
|
209
209
|
content: operatorAwareEnabled
|
|
210
|
-
? 'You are a memory consolidation system. Return ONLY a JSON object with
|
|
210
|
+
? 'You are a memory consolidation system. Return ONLY a JSON object with an "operator" key and either "output" or, for split, "outputs". The "operator" value MUST be one of the exact strings "merge", "update", or "split" — never a pipe-separated placeholder, never prose. "output" is the canonical memory text; "outputs" is an array with one canonical memory text per separated fact.'
|
|
211
211
|
: "You are a memory consolidation system. Output only the consolidated memory text.",
|
|
212
212
|
},
|
|
213
213
|
{ role: "user" as const, content: prompt },
|
|
@@ -248,20 +248,20 @@ export class SemanticConsolidationCoordinator {
|
|
|
248
248
|
// wider `ConsolidationOperator` type in #687 PR 2/4 but is
|
|
249
249
|
// reserved for the maintenance job and must never be assignable
|
|
250
250
|
// here (Cursor Bugbot review, PR #730).
|
|
251
|
-
let
|
|
251
|
+
let canonicalOutputs: string[];
|
|
252
252
|
let operator: SemanticConsolidationLlmOperator;
|
|
253
253
|
if (operatorAwareEnabled) {
|
|
254
254
|
const parsed = parseOperatorAwareConsolidationResponse(
|
|
255
255
|
response.content,
|
|
256
256
|
cluster,
|
|
257
257
|
);
|
|
258
|
-
|
|
258
|
+
canonicalOutputs = parsed.outputs;
|
|
259
259
|
operator = parsed.operator;
|
|
260
260
|
} else {
|
|
261
|
-
|
|
261
|
+
canonicalOutputs = [parseConsolidationResponse(response.content)];
|
|
262
262
|
operator = chooseConsolidationOperator(cluster);
|
|
263
263
|
}
|
|
264
|
-
cluster.canonicalContent =
|
|
264
|
+
cluster.canonicalContent = canonicalOutputs.join("\n\n");
|
|
265
265
|
|
|
266
266
|
// Pick the most recent memory's metadata as the basis for lineage
|
|
267
267
|
const sorted = [...cluster.memories].sort(
|
|
@@ -294,36 +294,43 @@ export class SemanticConsolidationCoordinator {
|
|
|
294
294
|
// Sealed-envelope write (issue #1989 PR4): canonical content is
|
|
295
295
|
// LLM-merged and tags are unioned from stored rows — salvage so a
|
|
296
296
|
// limit-violating union cannot abort consolidation (warn-logged).
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
297
|
+
// SPLIT writes one canonical memory per output (#3566); every write shares the lineage.
|
|
298
|
+
const canonicalIds: string[] = [];
|
|
299
|
+
let canonicalBlocked = false;
|
|
300
|
+
for (const canonicalContent of canonicalOutputs) {
|
|
301
|
+
const canonicalEnvelope = composeMemoryEnvelope(
|
|
302
|
+
{
|
|
303
|
+
content: canonicalContent,
|
|
304
|
+
category: newest.frontmatter.category,
|
|
305
|
+
confidence: newest.frontmatter.confidence,
|
|
306
|
+
tags: [
|
|
307
|
+
...new Set(
|
|
308
|
+
cluster.memories.flatMap((m) => m.frontmatter.tags ?? []),
|
|
309
|
+
),
|
|
310
|
+
],
|
|
311
|
+
},
|
|
312
|
+
{ source: "semantic-consolidation" },
|
|
313
|
+
{ salvage: true },
|
|
314
|
+
);
|
|
315
|
+
if (canonicalEnvelope.salvageNotes.length > 0) {
|
|
316
|
+
log.warn(`semantic-consolidation write salvaged invalid fields: ${canonicalEnvelope.salvageNotes.join("; ")}`);
|
|
317
|
+
}
|
|
318
|
+
const written = await targetStorage.writeSealedMemory(
|
|
319
|
+
canonicalEnvelope,
|
|
320
|
+
{
|
|
321
|
+
actor: "semantic-consolidation",
|
|
322
|
+
lineage: lineageIds,
|
|
323
|
+
derivedFrom: derivedFromEntries.length > 0 ? derivedFromEntries : undefined,
|
|
324
|
+
derivedVia: operator,
|
|
325
|
+
},
|
|
326
|
+
);
|
|
327
|
+
canonicalIds.push(written.id);
|
|
328
|
+
if (written.tombstoneBlocked) canonicalBlocked = true;
|
|
313
329
|
}
|
|
314
|
-
const { id: canonicalId, tombstoneBlocked: canonicalBlocked } = await targetStorage.writeSealedMemory(
|
|
315
|
-
canonicalEnvelope,
|
|
316
|
-
{
|
|
317
|
-
actor: "semantic-consolidation",
|
|
318
|
-
lineage: lineageIds,
|
|
319
|
-
derivedFrom: derivedFromEntries.length > 0 ? derivedFromEntries : undefined,
|
|
320
|
-
derivedVia: operator,
|
|
321
|
-
},
|
|
322
|
-
);
|
|
323
330
|
if (canonicalBlocked) {
|
|
324
331
|
// #1645: canonical matched a tombstone (pending_review). Don't archive
|
|
325
332
|
// the sources — consolidation must never delete the only active copy.
|
|
326
|
-
log.info(`[semantic-consolidation] cluster in "${cluster.category}" tombstone-blocked — keeping ${cluster.memories.length} source(s) active (pending_review ${
|
|
333
|
+
log.info(`[semantic-consolidation] cluster in "${cluster.category}" tombstone-blocked — keeping ${cluster.memories.length} source(s) active (pending_review ${canonicalIds.join(", ")})`);
|
|
327
334
|
continue;
|
|
328
335
|
}
|
|
329
336
|
canonicalWriteCompleted = true;
|
|
@@ -340,7 +347,7 @@ export class SemanticConsolidationCoordinator {
|
|
|
340
347
|
const archiveResult = await targetStorage.archiveMemory(m, {
|
|
341
348
|
actor: "semantic-consolidation",
|
|
342
349
|
reasonCode: "semantic-consolidation",
|
|
343
|
-
relatedMemoryIds:
|
|
350
|
+
relatedMemoryIds: canonicalIds,
|
|
344
351
|
});
|
|
345
352
|
if (archiveResult) {
|
|
346
353
|
// Remove from the same storage-scoped content-hash index that
|
|
@@ -392,7 +399,7 @@ export class SemanticConsolidationCoordinator {
|
|
|
392
399
|
}
|
|
393
400
|
|
|
394
401
|
log.info(
|
|
395
|
-
`[semantic-consolidation] consolidated ${cluster.memories.length} memories → ${
|
|
402
|
+
`[semantic-consolidation] consolidated ${cluster.memories.length} memories → ${canonicalIds.join(", ")}`,
|
|
396
403
|
);
|
|
397
404
|
} catch (err) {
|
|
398
405
|
log.warn(
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { parseConfig } from "../config.js";
|
|
5
|
+
import type { LocalLlmClient } from "../local-llm.js";
|
|
6
|
+
import type { StorageManager } from "../storage.js";
|
|
7
|
+
import type { MemoryFile } from "../types.js";
|
|
8
|
+
import { SemanticConsolidationCoordinator } from "./semantic-consolidation-coordinator.js";
|
|
9
|
+
|
|
10
|
+
function makeMemory(index: number): MemoryFile {
|
|
11
|
+
const created = `2026-04-${String(10 + index).padStart(2, "0")}T00:00:00Z`;
|
|
12
|
+
return {
|
|
13
|
+
path: `/memory/facts/m${index}.md`,
|
|
14
|
+
frontmatter: {
|
|
15
|
+
id: `m${index}`,
|
|
16
|
+
category: "fact",
|
|
17
|
+
created,
|
|
18
|
+
updated: created,
|
|
19
|
+
source: "extraction",
|
|
20
|
+
confidence: 0.8,
|
|
21
|
+
confidenceTier: "implied",
|
|
22
|
+
tags: [],
|
|
23
|
+
},
|
|
24
|
+
content: "The deploy runs on Fridays and the release notes go to the team channel.",
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test("a SPLIT response writes one memory per output and archives sources against all of them (#3566)", async () => {
|
|
29
|
+
const memories = Array.from({ length: 10 }, (_, i) => makeMemory(i));
|
|
30
|
+
const written: string[] = [];
|
|
31
|
+
const archived: Array<{ id: string; related: string[] }> = [];
|
|
32
|
+
const fakeStorage = {
|
|
33
|
+
dir: "/memory",
|
|
34
|
+
readAllMemories: async () => memories,
|
|
35
|
+
snapshotForProvenance: async () => null,
|
|
36
|
+
writeSealedMemory: async (envelope: { content: string }) => {
|
|
37
|
+
written.push(envelope.content);
|
|
38
|
+
return { id: `canonical-${written.length}`, tombstoneBlocked: false };
|
|
39
|
+
},
|
|
40
|
+
archiveMemory: async (memory: MemoryFile, lifecycle?: { relatedMemoryIds?: string[] }) => {
|
|
41
|
+
archived.push({ id: memory.frontmatter.id, related: lifecycle?.relatedMemoryIds ?? [] });
|
|
42
|
+
return `/memory/archive/${memory.frontmatter.id}.md`;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const fakeFastLlm = {
|
|
46
|
+
chatCompletion: async () => ({
|
|
47
|
+
content: JSON.stringify({
|
|
48
|
+
operator: "split",
|
|
49
|
+
outputs: ["The deploy runs on Fridays.", "Release notes go to the team channel."],
|
|
50
|
+
}),
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
const coordinator = new SemanticConsolidationCoordinator({
|
|
54
|
+
config: parseConfig({ operatorAwareConsolidationEnabled: true, semanticConsolidationModel: "fast" }),
|
|
55
|
+
// SAFETY: the coordinator only calls the five members the fake defines on this path.
|
|
56
|
+
getStorage: (): StorageManager => fakeStorage as never,
|
|
57
|
+
// SAFETY: the fast-LLM path only calls chatCompletion.
|
|
58
|
+
getFastLlm: (): LocalLlmClient => fakeFastLlm as never,
|
|
59
|
+
// SAFETY: archival only calls removeFromIndex.
|
|
60
|
+
embeddingFallback: { removeFromIndex: async () => {} } as never,
|
|
61
|
+
removeContentHashForMemory: async () => {},
|
|
62
|
+
saveContentHashIndexes: async () => {},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const result = await coordinator.runSemanticConsolidation({ force: true });
|
|
66
|
+
|
|
67
|
+
assert.ok(result.clustersFound >= 1, `expected a cluster, got ${result.clustersFound}`);
|
|
68
|
+
assert.equal(result.errors, 0);
|
|
69
|
+
assert.deepEqual(written, ["The deploy runs on Fridays.", "Release notes go to the team channel."]);
|
|
70
|
+
assert.ok(archived.length > 0);
|
|
71
|
+
for (const entry of archived) assert.deepEqual(entry.related, ["canonical-1", "canonical-2"]);
|
|
72
|
+
});
|
|
@@ -3,8 +3,9 @@ import test from "node:test";
|
|
|
3
3
|
|
|
4
4
|
import { ReplayAdmissionRefusedError, StorageTargetRequiredError } from "../buffer-admission.js";
|
|
5
5
|
import type { AddTurnOutcome } from "../buffer-types.js";
|
|
6
|
+
import { SmartBuffer } from "../buffer.js";
|
|
6
7
|
import { parseConfig } from "../config.js";
|
|
7
|
-
import type { BufferTurn, PluginConfig } from "../types.js";
|
|
8
|
+
import type { BufferEntryState, BufferState, BufferTurn, PluginConfig } from "../types.js";
|
|
8
9
|
import { ingestReplayBatchBuffered } from "./turn-ingestion-buffered.js";
|
|
9
10
|
import type { TurnIngestionDeps } from "./turn-ingestion.js";
|
|
10
11
|
|
|
@@ -222,3 +223,53 @@ test("buffered ingest: LCM archive observes raw turns per session and honors arc
|
|
|
222
223
|
await ingestReplayBatchBuffered(deps, bySession, { writeNamespaceOverride: "ns-work", archiveLcm: false });
|
|
223
224
|
assert.equal(observed.length, 0);
|
|
224
225
|
});
|
|
226
|
+
|
|
227
|
+
function realBufferDeps(config: PluginConfig, entries: Record<string, BufferEntryState>) {
|
|
228
|
+
const initial: BufferState = { turns: [], lastExtractionAt: null, extractionCount: 0, entries };
|
|
229
|
+
const storage = { loadBuffer: async () => structuredClone(initial), saveBuffer: async () => {} };
|
|
230
|
+
// SAFETY: the stub implements the load/save surface SmartBuffer reads; the cast only satisfies StorageManager.
|
|
231
|
+
const buffer = new SmartBuffer(config, storage as never);
|
|
232
|
+
const deps: Deps = { config, buffer, lcmEngine: null, queueBufferedExtraction: async () => {} };
|
|
233
|
+
return deps;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function heldTurns(sessionKey: string, count: number): BufferTurn[] {
|
|
237
|
+
return Array.from({ length: count }, (_, i) => ({ ...turn(`held ${i}`), sessionKey, acceptedCapture: true }));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
test("buffered ingest: a session at its turn cap is refused with the per-session turn cap reason, not entry capacity", async () => {
|
|
241
|
+
const config = parseConfig({ memoryDir: "/tmp/remnic-buffered-test", bufferSaveDebounceMs: 0, bufferMaxTurnsPerSession: 4 });
|
|
242
|
+
const deps = realBufferDeps(config, {
|
|
243
|
+
"pi:full": { turns: heldTurns("pi:full", 4), lastExtractionAt: null, extractionCount: 0 },
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
await assert.rejects(
|
|
247
|
+
ingestReplayBatchBuffered(deps, new Map([["pi:full", [turn("one too many")]]]), { writeNamespaceOverride: "ns-work" }),
|
|
248
|
+
(err: Error) => {
|
|
249
|
+
assert.ok(err instanceof ReplayAdmissionRefusedError, "still the retryable admission class");
|
|
250
|
+
assert.match(err.message, /per-session turn cap \(4\)/);
|
|
251
|
+
assert.match(err.message, /pi:full/);
|
|
252
|
+
assert.doesNotMatch(err.message, /entry capacity/);
|
|
253
|
+
return true;
|
|
254
|
+
},
|
|
255
|
+
);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("buffered ingest: a new session refused at the session-entry cap keeps the entry capacity reason", async () => {
|
|
259
|
+
const config = parseConfig({ memoryDir: "/tmp/remnic-buffered-test", bufferSaveDebounceMs: 0, bufferMaxSessions: 3 });
|
|
260
|
+
const deps = realBufferDeps(config, {
|
|
261
|
+
"pi:a": { turns: heldTurns("pi:a", 1), lastExtractionAt: null, extractionCount: 0 },
|
|
262
|
+
"pi:b": { turns: heldTurns("pi:b", 1), lastExtractionAt: null, extractionCount: 0 },
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
await assert.rejects(
|
|
266
|
+
ingestReplayBatchBuffered(deps, new Map([["pi:new", [turn("new session")]]]), { writeNamespaceOverride: "ns-work" }),
|
|
267
|
+
(err: Error) => {
|
|
268
|
+
assert.ok(err instanceof ReplayAdmissionRefusedError);
|
|
269
|
+
assert.match(err.message, /session-entry cap \(3\)/);
|
|
270
|
+
assert.match(err.message, /entry capacity/, "operators grepping the old text still find entry-cap refusals");
|
|
271
|
+
assert.doesNotMatch(err.message, /per-session turn cap/);
|
|
272
|
+
return true;
|
|
273
|
+
},
|
|
274
|
+
);
|
|
275
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Buffered durable replay ingest (#3368 split from turn-ingestion.ts — 1200-line ratchet). */
|
|
2
2
|
|
|
3
3
|
import { ReplayAdmissionRefusedError, StorageTargetRequiredError } from "../buffer-admission.js";
|
|
4
|
+
import type { BoundedAdmissionRefusal } from "../buffer-add-turns-bounded.js";
|
|
4
5
|
import { resolveNamespaceCapabilities } from "../capabilities.js";
|
|
5
6
|
import type { BufferTurn, CodingContext } from "../types.js";
|
|
6
7
|
import type { ResolvedScopeProfilePlan } from "../namespaces/scope-profiles.js";
|
|
@@ -38,16 +39,15 @@ export async function ingestReplayBatchBuffered(
|
|
|
38
39
|
};
|
|
39
40
|
const admissionKey = options.bufferAdmissionIdempotencyKey?.trim();
|
|
40
41
|
const batches = [...bySession].map(([bufferKey, sessionTurns]) => ({ bufferKey, turns: sessionTurns.map(pin) }));
|
|
42
|
+
let refusal: BoundedAdmissionRefusal | undefined;
|
|
43
|
+
const onRefused = (reason: BoundedAdmissionRefusal): void => {
|
|
44
|
+
refusal = reason;
|
|
45
|
+
};
|
|
41
46
|
const outcomes = admissionKey
|
|
42
|
-
? await deps.buffer.addTurnsBoundedForObserveReplay(batches, admissionKey)
|
|
43
|
-
: await deps.buffer.addTurnsBounded(batches);
|
|
47
|
+
? await deps.buffer.addTurnsBoundedForObserveReplay(batches, admissionKey, onRefused)
|
|
48
|
+
: await deps.buffer.addTurnsBounded(batches, onRefused);
|
|
44
49
|
if (outcomes === "duplicate") return;
|
|
45
|
-
if (outcomes === null)
|
|
46
|
-
const refusedKey = batches.find((batch) => batch.turns.length > 0)?.bufferKey ?? "unknown";
|
|
47
|
-
throw new ReplayAdmissionRefusedError(
|
|
48
|
-
`durable observe capture refused: extraction buffer at entry capacity for batch containing ${refusedKey}`,
|
|
49
|
-
);
|
|
50
|
-
}
|
|
50
|
+
if (outcomes === null) throw replayRefusal(refusal, batches);
|
|
51
51
|
|
|
52
52
|
await deps.buffer.flushPendingSave({ throwOnFailure: true });
|
|
53
53
|
|
|
@@ -72,3 +72,21 @@ export async function ingestReplayBatchBuffered(
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
function replayRefusal(
|
|
77
|
+
refusal: BoundedAdmissionRefusal | undefined,
|
|
78
|
+
batches: readonly { bufferKey: string; turns: readonly BufferTurn[] }[],
|
|
79
|
+
): ReplayAdmissionRefusedError {
|
|
80
|
+
if (refusal?.reason === "session_turn_cap") {
|
|
81
|
+
return new ReplayAdmissionRefusedError(
|
|
82
|
+
`durable observe capture refused: session ${refusal.bufferKey} holds the per-session turn cap ` +
|
|
83
|
+
`(${refusal.maxTurnsPerSession}) of unextracted turns; retry after extraction drains it`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
const refusedKey = batches.find((batch) => batch.turns.length > 0)?.bufferKey ?? "unknown";
|
|
87
|
+
const cap = refusal?.reason === "session_entry_cap" ? ` (${refusal.maxSessionEntries})` : "";
|
|
88
|
+
return new ReplayAdmissionRefusedError(
|
|
89
|
+
`durable observe capture refused: extraction buffer at entry capacity, session-entry cap${cap} ` +
|
|
90
|
+
`full for batch containing ${refusedKey}`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -510,3 +510,26 @@ test("flushAccessTracking tries the plain path before the QMD collection candida
|
|
|
510
510
|
await coordinator.flushAccessTracking();
|
|
511
511
|
assert.deepEqual(out.flushed.map((e) => [e.memoryPath, e.newCount]), [[viaPlainPath, 51]]);
|
|
512
512
|
});
|
|
513
|
+
|
|
514
|
+
test("validateLocalLlmModel warns to update persisted config instead of mutating it — #3562", async () => {
|
|
515
|
+
// The validator detected config.localLlmMaxContext > the loaded model's
|
|
516
|
+
// real window and silently rewrote the shared config object via a cast.
|
|
517
|
+
// The contract: validation warns the user to fix their persisted config;
|
|
518
|
+
// the config object is never mutated behind consumers' backs.
|
|
519
|
+
const config = { localLlmMaxContext: 131072 };
|
|
520
|
+
// SAFETY: validateLocalLlmModel reads only config + localLlm; the
|
|
521
|
+
// remaining WorkspaceOpsDeps members are unused by this method.
|
|
522
|
+
// oxlint-disable-next-line anti-slop/no-chained-type-assertions -- the test stub is a deps partial
|
|
523
|
+
const coordinator = new WorkspaceOpsCoordinator({
|
|
524
|
+
config,
|
|
525
|
+
localLlm: {
|
|
526
|
+
getLoadedModelInfo: async () => ({ id: "qwen-local", contextWindow: 32768 }),
|
|
527
|
+
},
|
|
528
|
+
} as unknown as WorkspaceOpsDeps);
|
|
529
|
+
await coordinator.validateLocalLlmModel();
|
|
530
|
+
assert.equal(
|
|
531
|
+
config.localLlmMaxContext,
|
|
532
|
+
131072,
|
|
533
|
+
"validateLocalLlmModel must not rewrite config.localLlmMaxContext",
|
|
534
|
+
);
|
|
535
|
+
});
|
|
@@ -634,15 +634,16 @@ export class WorkspaceOpsCoordinator {
|
|
|
634
634
|
configuredMaxContext &&
|
|
635
635
|
configuredMaxContext > modelInfo.contextWindow
|
|
636
636
|
) {
|
|
637
|
+
// Warn — never rewrite the shared config behind consumers'
|
|
638
|
+
// backs (#3562). The user owns the persisted value; an
|
|
639
|
+
// oversized localLlmMaxContext stays in effect until they
|
|
640
|
+
// lower it, and prompts may exceed the model's window.
|
|
637
641
|
log.warn(
|
|
638
642
|
`Local LLM context mismatch: engram configured for ${configuredMaxContext.toLocaleString()} tokens, ` +
|
|
639
643
|
`but ${modelInfo.id} only supports ${modelInfo.contextWindow.toLocaleString()}. ` +
|
|
640
|
-
`
|
|
644
|
+
`Set localLlmMaxContext to ${modelInfo.contextWindow.toLocaleString()} or lower in your ` +
|
|
645
|
+
`persisted config to avoid context-length errors.`,
|
|
641
646
|
);
|
|
642
|
-
// Update the config in-memory to match actual capability
|
|
643
|
-
// (This is a temporary fix - user should update their config)
|
|
644
|
-
(this.deps.config as { localLlmMaxContext?: number }).localLlmMaxContext =
|
|
645
|
-
modelInfo.contextWindow;
|
|
646
647
|
}
|
|
647
648
|
} else {
|
|
648
649
|
log.debug(
|
package/src/orchestrator.ts
CHANGED
|
@@ -1520,6 +1520,7 @@ export class Orchestrator {
|
|
|
1520
1520
|
// Propagate the inline-attribution template so the storage layer can strip
|
|
1521
1521
|
// citations from legacy facts during the hash-index rebuild path.
|
|
1522
1522
|
this.storage.citationTemplate = config.inlineSourceAttributionFormat;
|
|
1523
|
+
this.storage.citationTemplateHistory = config.inlineSourceAttributionFormatHistory;
|
|
1523
1524
|
// #1522: bind the post-write catalog touch at the storage chokepoint.
|
|
1524
1525
|
if (config.defaultNamespace) this.storageRouter.bindCatalogWriteHook(this.storage, config.defaultNamespace);
|
|
1525
1526
|
// Wire page-level versioning (issue #371)
|
package/src/peers/index.ts
CHANGED
|
@@ -30,12 +30,12 @@ export {
|
|
|
30
30
|
deletePeer,
|
|
31
31
|
forgetPeer,
|
|
32
32
|
listPeers,
|
|
33
|
-
appendInteractionLog,
|
|
34
33
|
readInteractionLogRaw,
|
|
35
34
|
readPeerInteractionLog,
|
|
36
35
|
readPeerProfile,
|
|
37
36
|
writePeerProfile,
|
|
38
37
|
} from "./storage.js";
|
|
38
|
+
export { appendInteractionLog } from "./interaction-log-append.js";
|
|
39
39
|
|
|
40
40
|
export {
|
|
41
41
|
runPeerProfileReasoner,
|