@remnic/core 10.0.194 → 10.0.196
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 +65 -66
- package/dist/access-cli.js +65 -66
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.js +2 -2
- package/dist/access-extraction-force-flush-preempt.js +65 -66
- package/dist/access-extraction-force-flush.js +65 -66
- package/dist/access-http-briefing.js +65 -66
- package/dist/access-http-query.js +65 -66
- package/dist/access-http.js +65 -66
- package/dist/access-identity-continuity-surface.js +65 -66
- package/dist/access-lcm-surface.js +65 -66
- package/dist/access-mcp.d.ts.map +1 -1
- package/dist/access-mcp.js +65 -66
- package/dist/access-observe-write-category.js +2 -2
- package/dist/access-observe-write-surface.js +65 -66
- package/dist/access-operations-batch.js +65 -66
- package/dist/access-operations.js +65 -66
- package/dist/access-recall-concurrency.d.ts +4 -0
- package/dist/access-recall-concurrency.d.ts.map +1 -1
- package/dist/access-recall-concurrency.js +65 -66
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.d.ts.map +1 -1
- package/dist/access-recall-response.js +65 -66
- package/dist/access-recall-surface.d.ts.map +1 -1
- package/dist/access-recall-surface.js +65 -66
- package/dist/access-schema.d.ts +1 -0
- package/dist/access-schema.d.ts.map +1 -1
- package/dist/access-schema.js +1 -1
- package/dist/access-service.d.ts.map +1 -1
- package/dist/access-service.js +65 -66
- package/dist/active-recall.js +7 -6
- package/dist/active-recall.js.map +1 -1
- package/dist/{auto-sync-BJUAGKI5.js → auto-sync-BEW65FDT.js} +6 -5
- package/dist/{auto-sync-BJUAGKI5.js.map → auto-sync-BEW65FDT.js.map} +1 -1
- package/dist/briefing.js +7 -6
- package/dist/buffer.d.ts +1 -0
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +3 -3
- package/dist/calibration.js +5 -4
- package/dist/calibration.js.map +1 -1
- package/dist/causal-consolidation.js +8 -7
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-FZU62GIV.js → chunk-2X5I5C3M.js} +27 -10
- package/dist/chunk-2X5I5C3M.js.map +1 -0
- package/dist/{chunk-F2MVWUNF.js → chunk-374E2HYZ.js} +10 -2
- package/dist/chunk-374E2HYZ.js.map +1 -0
- package/dist/{chunk-3ZS3NUEI.js → chunk-3DSLTUK6.js} +2 -2
- package/dist/{chunk-DYUPSTCV.js → chunk-3EXG2KPK.js} +3 -3
- package/dist/{chunk-FGFU6J26.js → chunk-4FTYKZ77.js} +3 -3
- package/dist/{chunk-QIPRDRGM.js → chunk-4HEJDVPU.js} +1 -1
- package/dist/chunk-4HEJDVPU.js.map +1 -0
- package/dist/{chunk-EEA2RM4B.js → chunk-4I6A3SDL.js} +2 -2
- package/dist/{chunk-SKJM4PKE.js → chunk-4JI5PPFW.js} +2 -2
- package/dist/{chunk-TDG5NZAZ.js → chunk-65JA7LWV.js} +2 -2
- package/dist/{chunk-3YID7KZ6.js → chunk-6QMKUWXH.js} +2 -2
- package/dist/{chunk-7SOKOEAZ.js → chunk-6RRHTHKQ.js} +2 -2
- package/dist/{chunk-VHQNJW4Q.js → chunk-6W62D4MC.js} +2 -2
- package/dist/{chunk-CRS2NY44.js → chunk-7O6H7BPW.js} +2 -2
- package/dist/{chunk-VSLV3EEP.js → chunk-7TK5Q6LQ.js} +112 -81
- package/dist/chunk-7TK5Q6LQ.js.map +1 -0
- package/dist/{chunk-NN3LMWKA.js → chunk-7TQ3EDQ3.js} +1 -1
- package/dist/chunk-7TQ3EDQ3.js.map +1 -0
- package/dist/{chunk-KJ65WZHB.js → chunk-A7DIZOTF.js} +2 -2
- package/dist/{chunk-TZ7ZA2LM.js → chunk-AD3JOG2Q.js} +2 -2
- package/dist/{chunk-2QW5HPKU.js → chunk-AUDLHIHI.js} +35 -28
- package/dist/chunk-AUDLHIHI.js.map +1 -0
- package/dist/{chunk-BDFSVUUZ.js → chunk-C3H2QZOZ.js} +2 -1
- package/dist/chunk-C3H2QZOZ.js.map +1 -0
- package/dist/{chunk-7EP4FURO.js → chunk-C72YQM7E.js} +2 -2
- package/dist/{chunk-4EAVEDLG.js → chunk-CRKT2JXN.js} +9 -9
- package/dist/{chunk-CJSTQNE5.js → chunk-CTOMDCCA.js} +2 -2
- package/dist/{chunk-PSQ347YP.js → chunk-DSKII2W4.js} +3 -3
- package/dist/{chunk-KOVQZJ27.js → chunk-E7LDTUWK.js} +2 -2
- package/dist/{chunk-SPAKBUJY.js → chunk-EWLMEYLF.js} +2 -2
- package/dist/{chunk-JJ42IDJU.js → chunk-FEGQI5KR.js} +2 -2
- package/dist/{chunk-3BICT225.js → chunk-FGNBUUPX.js} +2 -2
- package/dist/{chunk-QZMGZBTF.js → chunk-HBG6CQEX.js} +2 -2
- package/dist/{chunk-7V6GNQC2.js → chunk-HINQENZG.js} +2 -2
- package/dist/{chunk-WRVKI6ZO.js → chunk-HLQXSX4F.js} +2 -2
- package/dist/{chunk-KQIOW3TG.js → chunk-HUDE2SQA.js} +2 -2
- package/dist/{chunk-T765HQ5U.js → chunk-IIDAN7XJ.js} +2 -2
- package/dist/{chunk-M7Q7Z6V5.js → chunk-JDZ5JPYG.js} +38 -8
- package/dist/chunk-JDZ5JPYG.js.map +1 -0
- package/dist/{chunk-VMNX2UV7.js → chunk-JRUOIEFL.js} +5 -5
- package/dist/{chunk-JKMIGCK6.js → chunk-KDGEEZOI.js} +3 -2
- package/dist/chunk-KDGEEZOI.js.map +1 -0
- package/dist/{chunk-MMRTPH3J.js → chunk-KQYGUFMQ.js} +5 -3
- package/dist/chunk-KQYGUFMQ.js.map +1 -0
- package/dist/{chunk-TWYYUMYO.js → chunk-KXAGZRJV.js} +2 -2
- package/dist/{chunk-JITK24KX.js → chunk-LJNCJK7B.js} +10 -10
- package/dist/{chunk-Z6EFSXU3.js → chunk-LMM2LRVQ.js} +2 -2
- package/dist/{chunk-V65H7MI6.js → chunk-M42UFQZY.js} +51 -4
- package/dist/chunk-M42UFQZY.js.map +1 -0
- package/dist/{chunk-KZ4BJRGQ.js → chunk-ODGVLSCQ.js} +2 -2
- package/dist/{chunk-AALJHIKH.js → chunk-OHJ5PNYB.js} +3 -3
- package/dist/{chunk-XZMQLON4.js → chunk-OK726OF4.js} +7 -5
- package/dist/chunk-OK726OF4.js.map +1 -0
- package/dist/{chunk-Q6S67LHR.js → chunk-OOMFFMX3.js} +2 -2
- package/dist/{chunk-YCJJODER.js → chunk-PNDTRIOI.js} +10 -3
- package/dist/chunk-PNDTRIOI.js.map +1 -0
- package/dist/{chunk-3RZ4GDOH.js → chunk-PX4AMRAN.js} +93 -23
- package/dist/chunk-PX4AMRAN.js.map +1 -0
- package/dist/{chunk-JNDMIAJ4.js → chunk-QEVZKJM6.js} +2 -2
- package/dist/{chunk-ZNCCX7P6.js → chunk-QO5QZR2U.js} +2 -2
- package/dist/{chunk-NFQKIZK3.js → chunk-QXEF66SC.js} +2 -2
- package/dist/{chunk-NKHRIDYP.js → chunk-RTXW6E6X.js} +3 -3
- package/dist/{chunk-5WDUY2ZZ.js → chunk-S4QWAWR6.js} +4 -4
- package/dist/{chunk-HEJFE3BC.js → chunk-SJCN7ESG.js} +2 -2
- package/dist/{chunk-AJ7JHHRY.js → chunk-SPPWVMP4.js} +2 -2
- package/dist/{chunk-QSF5SJAM.js → chunk-STQNKDKZ.js} +9 -3
- package/dist/chunk-STQNKDKZ.js.map +1 -0
- package/dist/{chunk-QFKNIKUF.js → chunk-SXR7L57Z.js} +2 -2
- package/dist/{chunk-GYCUX3N4.js → chunk-TGMIJABS.js} +2 -2
- package/dist/{chunk-GH7IKABD.js → chunk-UFJJMQDV.js} +2 -2
- package/dist/{chunk-FKHXXL42.js → chunk-VAE6QCZQ.js} +2 -2
- package/dist/{chunk-UH2VY2QQ.js → chunk-WCW7I7ZM.js} +2 -2
- package/dist/{chunk-5GIYIYJI.js → chunk-WLP3XJCO.js} +2 -2
- package/dist/{chunk-STSORBX5.js → chunk-XII23FXP.js} +1 -1
- package/dist/chunk-XII23FXP.js.map +1 -0
- package/dist/{chunk-LR6LWX33.js → chunk-XXDIPAUE.js} +2 -2
- package/dist/{chunk-G2MS56KM.js → chunk-YQUGYQRY.js} +2 -2
- package/dist/{chunk-WEI6HEUX.js → chunk-YXAH5TSN.js} +2 -2
- package/dist/{chunk-75K6DRPN.js → chunk-ZAVFAGBE.js} +2 -2
- package/dist/{chunk-7KTORRIK.js → chunk-ZNJU3NBJ.js} +2 -2
- package/dist/cli.js +65 -66
- package/dist/coding/export-okf-codegraph.js +9 -8
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/compounding/engine.js +8 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -6
- package/dist/connectors/codex-materialize-runner.js +7 -6
- package/dist/connectors/index.js +7 -6
- package/dist/convergence-refresh.js +9 -8
- package/dist/corpus-watermark.js +9 -8
- package/dist/deep-recall-http-glue.js +2 -2
- package/dist/deep-recall-policy-llm.js +4 -3
- package/dist/entity-retrieval.js +7 -6
- package/dist/eval-trajectory-store.js +2 -2
- package/dist/eval-trajectory.js +2 -2
- package/dist/evals.d.ts.map +1 -1
- package/dist/evals.js +1 -1
- package/dist/explicit-capture.js +65 -66
- package/dist/extraction-error-classification.d.ts +40 -5
- package/dist/extraction-error-classification.d.ts.map +1 -1
- package/dist/extraction-error-classification.js +5 -2
- package/dist/extraction-faithfulness.js +4 -3
- package/dist/extraction-judge.js +4 -3
- package/dist/extraction.d.ts.map +1 -1
- package/dist/extraction.js +17 -18
- package/dist/fallback-llm-codex-subscription.d.ts +3 -1
- package/dist/fallback-llm-codex-subscription.d.ts.map +1 -1
- package/dist/fallback-llm-codex-subscription.js +2 -1
- package/dist/fallback-llm.d.ts.map +1 -1
- package/dist/fallback-llm.js +3 -2
- package/dist/harmonic-retrieval.js +7 -6
- package/dist/index.js +65 -66
- package/dist/live-connectors-runner.js +1 -2
- package/dist/local-llm-helpers.d.ts +1 -0
- package/dist/local-llm-helpers.d.ts.map +1 -1
- package/dist/local-llm-helpers.js +1 -1
- package/dist/local-llm.d.ts.map +1 -1
- package/dist/local-llm.js +4 -3
- package/dist/location/index.js +8 -7
- package/dist/maintenance/memory-governance.js +7 -6
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -6
- package/dist/maintenance/rebuild-memory-projection-runner.js +9 -8
- package/dist/maintenance/rebuild-memory-projection.js +8 -7
- package/dist/memory-browse.js +3 -3
- package/dist/namespaces/migrate.js +8 -7
- package/dist/namespaces/storage.js +7 -6
- package/dist/operator-doctor-corpus.js +10 -9
- package/dist/operator-toolkit.js +15 -14
- package/dist/orchestration/backlog-scheduler.js +66 -67
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +66 -67
- package/dist/orchestration/extraction-drain.d.ts +1 -0
- package/dist/orchestration/extraction-drain.d.ts.map +1 -1
- package/dist/orchestration/extraction-run-helpers.d.ts +41 -4
- package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
- package/dist/orchestration/extraction-run.d.ts +4 -0
- package/dist/orchestration/extraction-run.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +17 -16
- package/dist/orchestration/orchestrator-helpers.d.ts +2 -0
- package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -1
- package/dist/orchestration/recall-entry.d.ts +2 -2
- package/dist/orchestration/recall-entry.d.ts.map +1 -1
- package/dist/orchestration/recall-internal.d.ts.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +65 -66
- 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 +65 -66
- package/dist/recall-planner-llm.js +3 -2
- package/dist/recall-planner-llm.js.map +1 -1
- package/dist/recall-state-view-admission.js +3 -3
- package/dist/recall-why-service.js +3 -3
- 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/resume-bundles.js +8 -7
- package/dist/semantic-consolidation.js +8 -7
- package/dist/semantic-rule-promotion.js +7 -6
- package/dist/semantic-rule-verifier.js +7 -6
- package/dist/source-agent-qualifier.js +10 -9
- package/dist/standup/build.js +7 -6
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +6 -5
- package/dist/summarizer.js +6 -5
- package/dist/support-passport/index.js +6 -5
- package/dist/transfer/export-okf.js +7 -6
- package/dist/types-extraction-failure.d.ts +7 -1
- package/dist/types-extraction-failure.d.ts.map +1 -1
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +7 -6
- package/dist/who-knows-cli.js +8 -7
- package/dist/who-knows.js +7 -6
- package/package.json +2 -2
- package/src/access-mcp.ts +8 -0
- package/src/access-recall-concurrency.ts +35 -2
- package/src/access-recall-response.ts +3 -1
- package/src/access-recall-surface.ts +1 -0
- package/src/access-schema.ts +8 -0
- package/src/access-service-recall-concurrency.test.ts +65 -0
- package/src/access-service.ts +4 -3
- package/src/buffer-incremental-persistence.test.ts +23 -0
- package/src/buffer.ts +30 -28
- package/src/config.ts +2 -0
- package/src/evals.ts +6 -6
- package/src/extraction-error-classification.ts +88 -8
- package/src/extraction-local-failure-class.test.ts +117 -3
- package/src/extraction-reply-diagnostic-wiring.test.ts +3 -1
- package/src/extraction.test.ts +73 -3
- package/src/extraction.ts +26 -25
- package/src/fallback-llm-codex-subscription.ts +17 -3
- package/src/fallback-llm.test.ts +70 -0
- package/src/fallback-llm.ts +17 -18
- package/src/local-llm-headers-timeout.test.ts +151 -0
- package/src/local-llm-helpers.ts +1 -1
- package/src/local-llm.ts +44 -43
- package/src/orchestration/extraction-drain.ts +11 -5
- package/src/orchestration/extraction-run-helpers.ts +110 -4
- package/src/orchestration/extraction-run.test.ts +408 -3
- package/src/orchestration/extraction-run.ts +75 -75
- package/src/orchestration/orchestrator-helpers.ts +2 -0
- package/src/orchestration/recall-entry.ts +7 -7
- package/src/orchestration/recall-internal.ts +14 -4
- package/src/orchestrator.ts +3 -2
- package/src/recall-client-deadline-trace.test.ts +209 -0
- package/src/storage.ts +5 -4
- package/src/types-extraction-failure.ts +12 -1
- package/src/types.ts +6 -6
- package/dist/chunk-2QW5HPKU.js.map +0 -1
- package/dist/chunk-3RZ4GDOH.js.map +0 -1
- package/dist/chunk-BDFSVUUZ.js.map +0 -1
- package/dist/chunk-C7SRUWBW.js +0 -54
- package/dist/chunk-C7SRUWBW.js.map +0 -1
- package/dist/chunk-F2MVWUNF.js.map +0 -1
- package/dist/chunk-FZU62GIV.js.map +0 -1
- package/dist/chunk-JKMIGCK6.js.map +0 -1
- package/dist/chunk-M7Q7Z6V5.js.map +0 -1
- package/dist/chunk-MMRTPH3J.js.map +0 -1
- package/dist/chunk-NN3LMWKA.js.map +0 -1
- package/dist/chunk-QIPRDRGM.js.map +0 -1
- package/dist/chunk-QSF5SJAM.js.map +0 -1
- package/dist/chunk-STSORBX5.js.map +0 -1
- package/dist/chunk-V65H7MI6.js.map +0 -1
- package/dist/chunk-VSLV3EEP.js.map +0 -1
- package/dist/chunk-XZMQLON4.js.map +0 -1
- package/dist/chunk-YCJJODER.js.map +0 -1
- /package/dist/{chunk-3ZS3NUEI.js.map → chunk-3DSLTUK6.js.map} +0 -0
- /package/dist/{chunk-DYUPSTCV.js.map → chunk-3EXG2KPK.js.map} +0 -0
- /package/dist/{chunk-FGFU6J26.js.map → chunk-4FTYKZ77.js.map} +0 -0
- /package/dist/{chunk-EEA2RM4B.js.map → chunk-4I6A3SDL.js.map} +0 -0
- /package/dist/{chunk-SKJM4PKE.js.map → chunk-4JI5PPFW.js.map} +0 -0
- /package/dist/{chunk-TDG5NZAZ.js.map → chunk-65JA7LWV.js.map} +0 -0
- /package/dist/{chunk-3YID7KZ6.js.map → chunk-6QMKUWXH.js.map} +0 -0
- /package/dist/{chunk-7SOKOEAZ.js.map → chunk-6RRHTHKQ.js.map} +0 -0
- /package/dist/{chunk-VHQNJW4Q.js.map → chunk-6W62D4MC.js.map} +0 -0
- /package/dist/{chunk-CRS2NY44.js.map → chunk-7O6H7BPW.js.map} +0 -0
- /package/dist/{chunk-KJ65WZHB.js.map → chunk-A7DIZOTF.js.map} +0 -0
- /package/dist/{chunk-TZ7ZA2LM.js.map → chunk-AD3JOG2Q.js.map} +0 -0
- /package/dist/{chunk-7EP4FURO.js.map → chunk-C72YQM7E.js.map} +0 -0
- /package/dist/{chunk-4EAVEDLG.js.map → chunk-CRKT2JXN.js.map} +0 -0
- /package/dist/{chunk-CJSTQNE5.js.map → chunk-CTOMDCCA.js.map} +0 -0
- /package/dist/{chunk-PSQ347YP.js.map → chunk-DSKII2W4.js.map} +0 -0
- /package/dist/{chunk-KOVQZJ27.js.map → chunk-E7LDTUWK.js.map} +0 -0
- /package/dist/{chunk-SPAKBUJY.js.map → chunk-EWLMEYLF.js.map} +0 -0
- /package/dist/{chunk-JJ42IDJU.js.map → chunk-FEGQI5KR.js.map} +0 -0
- /package/dist/{chunk-3BICT225.js.map → chunk-FGNBUUPX.js.map} +0 -0
- /package/dist/{chunk-QZMGZBTF.js.map → chunk-HBG6CQEX.js.map} +0 -0
- /package/dist/{chunk-7V6GNQC2.js.map → chunk-HINQENZG.js.map} +0 -0
- /package/dist/{chunk-WRVKI6ZO.js.map → chunk-HLQXSX4F.js.map} +0 -0
- /package/dist/{chunk-KQIOW3TG.js.map → chunk-HUDE2SQA.js.map} +0 -0
- /package/dist/{chunk-T765HQ5U.js.map → chunk-IIDAN7XJ.js.map} +0 -0
- /package/dist/{chunk-VMNX2UV7.js.map → chunk-JRUOIEFL.js.map} +0 -0
- /package/dist/{chunk-TWYYUMYO.js.map → chunk-KXAGZRJV.js.map} +0 -0
- /package/dist/{chunk-JITK24KX.js.map → chunk-LJNCJK7B.js.map} +0 -0
- /package/dist/{chunk-Z6EFSXU3.js.map → chunk-LMM2LRVQ.js.map} +0 -0
- /package/dist/{chunk-KZ4BJRGQ.js.map → chunk-ODGVLSCQ.js.map} +0 -0
- /package/dist/{chunk-AALJHIKH.js.map → chunk-OHJ5PNYB.js.map} +0 -0
- /package/dist/{chunk-Q6S67LHR.js.map → chunk-OOMFFMX3.js.map} +0 -0
- /package/dist/{chunk-JNDMIAJ4.js.map → chunk-QEVZKJM6.js.map} +0 -0
- /package/dist/{chunk-ZNCCX7P6.js.map → chunk-QO5QZR2U.js.map} +0 -0
- /package/dist/{chunk-NFQKIZK3.js.map → chunk-QXEF66SC.js.map} +0 -0
- /package/dist/{chunk-NKHRIDYP.js.map → chunk-RTXW6E6X.js.map} +0 -0
- /package/dist/{chunk-5WDUY2ZZ.js.map → chunk-S4QWAWR6.js.map} +0 -0
- /package/dist/{chunk-HEJFE3BC.js.map → chunk-SJCN7ESG.js.map} +0 -0
- /package/dist/{chunk-AJ7JHHRY.js.map → chunk-SPPWVMP4.js.map} +0 -0
- /package/dist/{chunk-QFKNIKUF.js.map → chunk-SXR7L57Z.js.map} +0 -0
- /package/dist/{chunk-GYCUX3N4.js.map → chunk-TGMIJABS.js.map} +0 -0
- /package/dist/{chunk-GH7IKABD.js.map → chunk-UFJJMQDV.js.map} +0 -0
- /package/dist/{chunk-FKHXXL42.js.map → chunk-VAE6QCZQ.js.map} +0 -0
- /package/dist/{chunk-UH2VY2QQ.js.map → chunk-WCW7I7ZM.js.map} +0 -0
- /package/dist/{chunk-5GIYIYJI.js.map → chunk-WLP3XJCO.js.map} +0 -0
- /package/dist/{chunk-LR6LWX33.js.map → chunk-XXDIPAUE.js.map} +0 -0
- /package/dist/{chunk-G2MS56KM.js.map → chunk-YQUGYQRY.js.map} +0 -0
- /package/dist/{chunk-WEI6HEUX.js.map → chunk-YXAH5TSN.js.map} +0 -0
- /package/dist/{chunk-75K6DRPN.js.map → chunk-ZAVFAGBE.js.map} +0 -0
- /package/dist/{chunk-7KTORRIK.js.map → chunk-ZNJU3NBJ.js.map} +0 -0
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
countRequestedDurableOutputs,
|
|
135
135
|
deriveSourceConnector,
|
|
136
136
|
deriveTopicsFromExtraction, emptyExtractionResult, extractChunkedExtraction,
|
|
137
|
-
extractionFailureLongParks,
|
|
137
|
+
extractionFailureLongParks, maybeDeadLetterPermanentExtractionFailure,
|
|
138
138
|
runExtractionPostPersist,
|
|
139
139
|
runExtractionPostPersistBestEffort,
|
|
140
140
|
EXTRACTION_RETRY_STATE_MAX_ENTRIES,
|
|
@@ -159,13 +159,10 @@ export type { ExtractionResilienceStatus };
|
|
|
159
159
|
*/
|
|
160
160
|
export class ExtractionRunCoordinator {
|
|
161
161
|
private readonly recentExtractionFingerprints = new Map<string, number>();
|
|
162
|
-
// Per-fingerprint extraction retry/backoff state
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
// meta.json). The breaker below is intentionally per-process in-memory
|
|
167
|
-
// (mirrors local-llm.cooldownUntilMs); a restart clears it but the persisted
|
|
168
|
-
// backoff still throttles, so a restart can't resurrect the hot loop.
|
|
162
|
+
// Per-fingerprint extraction retry/backoff state. Outer key = namespace,
|
|
163
|
+
// inner key = fingerprint; hydrated lazily from namespace-scoped meta so the
|
|
164
|
+
// hot path is a Map lookup. The breaker below is per-process in-memory by
|
|
165
|
+
// design — a restart clears it but persisted backoff still throttles.
|
|
169
166
|
private readonly extractionRetryState = new Map<string, Map<string, ExtractionRetryStateEntry>>();
|
|
170
167
|
private readonly hydratedRetryNamespaces = new Set<string>();
|
|
171
168
|
private readonly providerBreaker: ProviderCircuitBreaker;
|
|
@@ -248,9 +245,7 @@ export class ExtractionRunCoordinator {
|
|
|
248
245
|
return true;
|
|
249
246
|
}
|
|
250
247
|
|
|
251
|
-
//
|
|
252
|
-
// Processed-fingerprint recording
|
|
253
|
-
// -------------------------------------------------------------------------
|
|
248
|
+
// ---- Processed-fingerprint recording ----
|
|
254
249
|
|
|
255
250
|
async recordProcessedExtractionFingerprint(
|
|
256
251
|
storage: StorageManager,
|
|
@@ -292,6 +287,7 @@ export class ExtractionRunCoordinator {
|
|
|
292
287
|
nextEligibleAtMs: Number.isFinite(nextEligibleAtMs) ? nextEligibleAtMs : 0,
|
|
293
288
|
firstFailedAtMs: Number.isFinite(firstFailedAtMs) ? firstFailedAtMs : Date.now(),
|
|
294
289
|
lastFailureClass: entry.lastFailureClass,
|
|
290
|
+
permanentAttempts: entry.permanentAttempts,
|
|
295
291
|
});
|
|
296
292
|
}
|
|
297
293
|
this.extractionRetryState.set(namespace, nsMap);
|
|
@@ -308,6 +304,7 @@ export class ExtractionRunCoordinator {
|
|
|
308
304
|
nextEligibleAt: new Date(st.nextEligibleAtMs).toISOString(),
|
|
309
305
|
firstFailedAt: new Date(st.firstFailedAtMs).toISOString(),
|
|
310
306
|
lastFailureClass: st.lastFailureClass,
|
|
307
|
+
permanentAttempts: st.permanentAttempts,
|
|
311
308
|
}))
|
|
312
309
|
: [];
|
|
313
310
|
const capped = capExtractionRetryStateEntries(entries, EXTRACTION_RETRY_STATE_MAX_ENTRIES);
|
|
@@ -351,9 +348,13 @@ export class ExtractionRunCoordinator {
|
|
|
351
348
|
const nsMap = this.extractionRetryState.get(namespace) ?? new Map<string, ExtractionRetryStateEntry>();
|
|
352
349
|
const prev = nsMap.get(fingerprint);
|
|
353
350
|
const attempts = (prev?.attempts ?? 0) + 1;
|
|
351
|
+
// Terminal refusals count separately — transient/setup failures must not consume the allowance (#3757).
|
|
352
|
+
const permanentAttempts = (prev?.permanentAttempts ?? 0) + (cls === "provider_permanent" ? 1 : 0);
|
|
354
353
|
const firstFailedAtMs = prev?.firstFailedAtMs ?? now;
|
|
355
|
-
//
|
|
356
|
-
const nextEligibleAtMs = extractionFailureLongParks(cls,
|
|
354
|
+
// Past its cap → long-park; the window survives a raised ceiling (#3521).
|
|
355
|
+
const nextEligibleAtMs = extractionFailureLongParks(cls,
|
|
356
|
+
cls === "provider_permanent" ? permanentAttempts : attempts,
|
|
357
|
+
this.config.extractionParseEmptyMaxAttempts, this.config.extractionProviderPermanentMaxAttempts)
|
|
357
358
|
? now + Math.max(0, this.config.extractionRetryMaxBackoffMs)
|
|
358
359
|
: computeExtractionRetryNextEligibleMs(
|
|
359
360
|
attempts,
|
|
@@ -362,7 +363,7 @@ export class ExtractionRunCoordinator {
|
|
|
362
363
|
this.config.extractionRetryJitterRatio,
|
|
363
364
|
now,
|
|
364
365
|
);
|
|
365
|
-
nsMap.set(fingerprint, { attempts, nextEligibleAtMs, firstFailedAtMs, lastFailureClass: cls });
|
|
366
|
+
nsMap.set(fingerprint, { attempts, nextEligibleAtMs, firstFailedAtMs, lastFailureClass: cls, permanentAttempts });
|
|
366
367
|
this.extractionRetryState.set(namespace, nsMap);
|
|
367
368
|
this.providerBreaker.failure(cls, now, {
|
|
368
369
|
failureThreshold: this.config.extractionBreakerFailureThreshold,
|
|
@@ -439,6 +440,10 @@ export class ExtractionRunCoordinator {
|
|
|
439
440
|
* gate (extraction hot-loop hardening). Set by explicit flush paths.
|
|
440
441
|
*/
|
|
441
442
|
forceExtractionAttempt?: boolean;
|
|
443
|
+
/** Caller drop policy: false → retain a permanently-failing window, never dead-letter (claim drains). Default true. */
|
|
444
|
+
dropFailedChunks?: boolean;
|
|
445
|
+
/** In-flight part copy → its buffered source turn (drain `extractionPartOf` splits). */
|
|
446
|
+
partParents?: ReadonlyMap<BufferTurn, BufferTurn>;
|
|
442
447
|
} = {}
|
|
443
448
|
): Promise<ExtractionRunResult> {
|
|
444
449
|
log.debug(`running extraction on ${turns.length} turns`);
|
|
@@ -511,16 +516,18 @@ export class ExtractionRunCoordinator {
|
|
|
511
516
|
if (deadlineTimer) clearTimeout(deadlineTimer);
|
|
512
517
|
}
|
|
513
518
|
};
|
|
514
|
-
const clearBuffer = async (clearOptions?: { ignoreAbort?: boolean }) => {
|
|
519
|
+
const clearBuffer = async (clearOptions?: { ignoreAbort?: boolean; dropTurns?: readonly BufferTurn[] }) => {
|
|
515
520
|
options.onBeforePersist?.();
|
|
516
521
|
if (clearOptions?.ignoreAbort !== true) {
|
|
517
522
|
throwIfDeadlineExceeded("before_clear_buffer");
|
|
518
523
|
throwIfAborted("before_clear_buffer");
|
|
519
524
|
}
|
|
520
525
|
if (clearBufferAfterExtraction) {
|
|
526
|
+
const dropTurns = clearOptions?.dropTurns;
|
|
521
527
|
await this.deps
|
|
522
528
|
.getBuffer()
|
|
523
|
-
.clearAfterExtraction(bufferKey, turns,
|
|
529
|
+
.clearAfterExtraction(bufferKey, dropTurns ?? turns,
|
|
530
|
+
clearMatchingTurns || dropTurns !== undefined ? { allowNonPrefix: true, dropRetainedTurns: dropTurns !== undefined } : undefined);
|
|
524
531
|
}
|
|
525
532
|
};
|
|
526
533
|
|
|
@@ -584,14 +591,10 @@ export class ExtractionRunCoordinator {
|
|
|
584
591
|
if ((!skipCharThreshold && belowCharThreshold) || belowUserTurnThreshold) {
|
|
585
592
|
log.debug(`skipping extraction: below threshold (totalChars=${totalChars}, userTurns=${userTurns.length})`);
|
|
586
593
|
// Passive correction capture runs even when extraction is skipped for
|
|
587
|
-
// being below
|
|
588
|
-
//
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
// plan as the full extraction path so corrections target the active
|
|
592
|
-
// profile's write layer, not just resolveSelfNamespace (review:
|
|
593
|
-
// "below-threshold wrong namespace"). The ACL in passiveCorrectionService
|
|
594
|
-
// authorizes the actual plan/apply.
|
|
594
|
+
// being below threshold — a short correction like "stop using Vim" is
|
|
595
|
+
// exactly the high-value case this feature exists for. The write
|
|
596
|
+
// namespace resolves through the SAME scope-profile plan as the full
|
|
597
|
+
// path; the ACL in passiveCorrectionService authorizes the apply.
|
|
595
598
|
{
|
|
596
599
|
const capturePrincipal =
|
|
597
600
|
typeof options.principalOverride === "string" && options.principalOverride.length > 0
|
|
@@ -632,13 +635,11 @@ export class ExtractionRunCoordinator {
|
|
|
632
635
|
};
|
|
633
636
|
}
|
|
634
637
|
|
|
635
|
-
// Provenance principal honours the access-surface override (#1495 thread 1
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
// namespace-prefixed key would collapse to `default`. The ORIGINAL,
|
|
641
|
-
// un-prefixed session key still drives threading.
|
|
638
|
+
// Provenance principal honours the access-surface override (#1495 thread 1):
|
|
639
|
+
// surfaces that authenticated the caller pass their resolved principal so
|
|
640
|
+
// provenance uses the SAME identity the surface authorized, instead of
|
|
641
|
+
// `resolvePrincipal(sessionKey)` — which on a namespace-prefixed key would
|
|
642
|
+
// collapse to `default`. The un-prefixed session key still drives threading.
|
|
642
643
|
const principal =
|
|
643
644
|
typeof options.principalOverride === "string" && options.principalOverride.length > 0
|
|
644
645
|
? options.principalOverride
|
|
@@ -787,17 +788,12 @@ export class ExtractionRunCoordinator {
|
|
|
787
788
|
};
|
|
788
789
|
}
|
|
789
790
|
|
|
790
|
-
//
|
|
791
|
-
//
|
|
792
|
-
//
|
|
793
|
-
// failing LLM endpoint is not hammered once per observe. Forced flushes and
|
|
794
|
-
// fail-closed callers bypass the gate (rule 18) but still record failures.
|
|
795
|
-
// On a suppressed attempt the buffer is deliberately NOT cleared, so no
|
|
796
|
-
// extractable turn is dropped — it is retried after cooldown/nextEligibleAt.
|
|
791
|
+
// Retry/backoff + circuit-breaker gate: suppresses re-attempts of a
|
|
792
|
+
// recently-failed fingerprint and all while the breaker is open. On
|
|
793
|
+
// suppression the buffer is NOT cleared — turns retry, never dropped.
|
|
797
794
|
const forcedExtractionAttempt =
|
|
798
795
|
options.failOnExtractionFailure === true || options.forceExtractionAttempt === true;
|
|
799
|
-
// Resolve the gate
|
|
800
|
-
// #1523) rather than reading the raw config flag at each call site.
|
|
796
|
+
// Resolve the gate via the shared lifecycle capability plan (issue #1523).
|
|
801
797
|
const extractionRetryEnabled = resolveMemoryLifecycleCapabilities(this.config).extractionRetry;
|
|
802
798
|
let extractionProbeOwned = false;
|
|
803
799
|
let extractionProbeToken: ProbeOwnerToken | undefined;
|
|
@@ -817,8 +813,7 @@ export class ExtractionRunCoordinator {
|
|
|
817
813
|
if (st && nowMs < st.nextEligibleAtMs) suppressReason = "extraction_backoff";
|
|
818
814
|
}
|
|
819
815
|
if (suppressReason) {
|
|
820
|
-
// Passive correction capture is local
|
|
821
|
-
// provider cooldown. It remains fail-open.
|
|
816
|
+
// Passive correction capture is local — never delayed by a cooldown; fail-open.
|
|
822
817
|
try {
|
|
823
818
|
await runDeadlineAware(
|
|
824
819
|
() => runPassiveCapture(normalizedTurns as BufferTurn[], {
|
|
@@ -848,18 +843,16 @@ export class ExtractionRunCoordinator {
|
|
|
848
843
|
}
|
|
849
844
|
}
|
|
850
845
|
// Lazy entity list. A half-open probe lists first so a slow store cannot
|
|
851
|
-
// reopen the breaker
|
|
852
|
-
//
|
|
853
|
-
// the big try below only covers from the extract call onward.
|
|
846
|
+
// reopen the breaker; the probe owner must release on ANY pre-persistence
|
|
847
|
+
// exit too — the big try below only covers from the extract call onward.
|
|
854
848
|
try {
|
|
855
849
|
let entityNamesPromise: Promise<string[]> | undefined;
|
|
856
850
|
const existingEntities = (): Promise<string[]> =>
|
|
857
851
|
(entityNamesPromise ??= runDeadlineAware(() => storage.listEntityNames(), "during_list_entity_names", false));
|
|
858
852
|
if (extractionProbeOwned) await existingEntities();
|
|
859
853
|
let result: ExtractionResult;
|
|
860
|
-
// The half-open probe is bounded: one that gets no answer in time counts
|
|
861
|
-
// a provider failure
|
|
862
|
-
// attempt until the provider answers or times out.
|
|
854
|
+
// The half-open probe is bounded: one that gets no answer in time counts
|
|
855
|
+
// as a provider failure instead of holding every other attempt.
|
|
863
856
|
const probe = startProbeDeadline(extractionProbeOwned, extractionAbortSignal, this.deps.halfOpenProbeTimeoutMs);
|
|
864
857
|
const engine = this.deps.getExtraction();
|
|
865
858
|
try {
|
|
@@ -891,8 +884,7 @@ export class ExtractionRunCoordinator {
|
|
|
891
884
|
if (options.failOnExtractionFailure) {
|
|
892
885
|
throw new Error("extraction failed: invalid_extraction_result");
|
|
893
886
|
}
|
|
894
|
-
//
|
|
895
|
-
// no-drop contract as a recorded provider failure), never destroyed.
|
|
887
|
+
// Failure: the window is retained for retry (the no-drop contract), never destroyed.
|
|
896
888
|
return {
|
|
897
889
|
status: "skipped",
|
|
898
890
|
reason: "invalid_extraction_result",
|
|
@@ -918,8 +910,7 @@ export class ExtractionRunCoordinator {
|
|
|
918
910
|
if (options.failOnExtractionFailure) {
|
|
919
911
|
throw new Error("extraction failed: invalid_extraction_result");
|
|
920
912
|
}
|
|
921
|
-
//
|
|
922
|
-
// no-drop contract as a recorded provider failure), never destroyed.
|
|
913
|
+
// Failure: the window is retained for retry (the no-drop contract), never destroyed.
|
|
923
914
|
return {
|
|
924
915
|
status: "skipped",
|
|
925
916
|
reason: "invalid_extraction_result",
|
|
@@ -934,8 +925,7 @@ export class ExtractionRunCoordinator {
|
|
|
934
925
|
? result.extractionFailure
|
|
935
926
|
: undefined;
|
|
936
927
|
// Issue #3140: surface extraction-LLM outages on /health and as an
|
|
937
|
-
// ERROR-level deduplicated event
|
|
938
|
-
// every completed attempt so a later success clears the failure.
|
|
928
|
+
// ERROR-level deduplicated event; a later success clears the failure.
|
|
939
929
|
if (extractionFailure) {
|
|
940
930
|
recordExtractionLlmFailure(extractionFailure);
|
|
941
931
|
emitExtractionLlmFailureError(extractionFailure, result.extractionFailureClass);
|
|
@@ -946,37 +936,49 @@ export class ExtractionRunCoordinator {
|
|
|
946
936
|
recordExtractionLlmSuccess();
|
|
947
937
|
}
|
|
948
938
|
let recordedRetryFailure = false;
|
|
949
|
-
|
|
950
|
-
//
|
|
951
|
-
// forced flush still records its failure (rule 18). Gated by
|
|
952
|
-
// extractionRetryEnabled so a disabled feature restores prior behavior.
|
|
939
|
+
let deadLetteredWindow = false;
|
|
940
|
+
// Record failure into backoff/breaker, or heal on success, before the fail-closed throw (rule 18).
|
|
953
941
|
if (extractionFingerprint && extractionRetryEnabled) {
|
|
954
942
|
if (extractionFailure) {
|
|
955
943
|
const failureClass = result.extractionFailureClass ?? "provider_retryable";
|
|
956
944
|
try {
|
|
957
945
|
await runDeadlineAware(
|
|
958
|
-
() =>
|
|
959
|
-
|
|
960
|
-
this.recordExtractionFailure(selfNamespace, extractionFingerprint, failureClass, freshMeta, Date.now(), extractionProbeToken),
|
|
961
|
-
),
|
|
946
|
+
() => storage.updateMeta((freshMeta) =>
|
|
947
|
+
this.recordExtractionFailure(selfNamespace, extractionFingerprint, failureClass, freshMeta, Date.now(), extractionProbeToken)),
|
|
962
948
|
"during_retry_bookkeeping_save",
|
|
963
949
|
false,
|
|
964
950
|
);
|
|
965
951
|
recordedRetryFailure = true;
|
|
966
952
|
} catch (err) {
|
|
967
953
|
if (err instanceof ExtractionDeadlineError) throw err;
|
|
968
|
-
// Fail-open, but retain the turns (a cleared buffer with no retry state drops them). Only a
|
|
969
|
-
// LOCK skip reaches here without the mutator having run — a later save must not double-count.
|
|
954
|
+
// Fail-open, but retain the turns (a cleared buffer with no retry state drops them). Only a LOCK skip reaches here without the mutator — a later save must not double-count.
|
|
970
955
|
if (err instanceof Error && err.message.includes("meta.json.lock not acquired"))
|
|
971
956
|
this.applyExtractionFailureToMemory(selfNamespace, extractionFingerprint, failureClass, Date.now(), extractionProbeToken);
|
|
972
957
|
recordedRetryFailure = true;
|
|
973
958
|
log.warn("runExtraction: retry state kept in memory; meta persist will catch up", err);
|
|
974
959
|
}
|
|
960
|
+
// A provider_permanent failure at its cap dead-letters — a resend can never succeed (drain safety).
|
|
961
|
+
deadLetteredWindow = await maybeDeadLetterPermanentExtractionFailure({
|
|
962
|
+
recorded: recordedRetryFailure, failureClass, storage, bufferKey, runDeadlineAware,
|
|
963
|
+
turns, fingerprint: extractionFingerprint, partParents: options.partParents,
|
|
964
|
+
dropAllowed: options.dropFailedChunks !== false && options.failOnExtractionFailure !== true,
|
|
965
|
+
permanentAttempts: this.extractionRetryState.get(selfNamespace)?.get(extractionFingerprint)?.permanentAttempts ?? 0,
|
|
966
|
+
permanentMaxAttempts: this.config.extractionProviderPermanentMaxAttempts,
|
|
967
|
+
recordProcessed: (st, fp, meta) => this.deps.recordProcessedExtractionFingerprint(st, fp, meta),
|
|
968
|
+
clearBufferedTurns: (ts) => clearBuffer({ dropTurns: ts }),
|
|
969
|
+
clearPersistedRetryEntry: (m) => {
|
|
970
|
+
const n = m.extractionRetryState?.length ?? 0;
|
|
971
|
+
m.extractionRetryState = m.extractionRetryState?.filter((e) => e.fingerprint !== extractionFingerprint);
|
|
972
|
+
return (m.extractionRetryState?.length ?? 0) !== n;
|
|
973
|
+
},
|
|
974
|
+
clearRetryMirror: () => {
|
|
975
|
+
this.extractionRetryState.get(selfNamespace)?.delete(extractionFingerprint);
|
|
976
|
+
},
|
|
977
|
+
isDeadlineError: (err) => err instanceof ExtractionDeadlineError,
|
|
978
|
+
});
|
|
975
979
|
} else if (result.extractionSkippedReason === undefined) {
|
|
976
|
-
// Provider responded without failure → breaker heals; clear any
|
|
977
|
-
//
|
|
978
|
-
// PRRT_kwDORJXyws6zxG6u: pass the run's probe token so the settlement
|
|
979
|
-
// only applies to a probe this run owns.
|
|
980
|
+
// Provider responded without failure → breaker heals; clear any parked backoff.
|
|
981
|
+
// PRRT_kwDORJXyws6zxG6u: pass the run's probe token — only settle a probe this run owns.
|
|
980
982
|
this.providerBreaker.success(extractionProbeToken);
|
|
981
983
|
try {
|
|
982
984
|
await runDeadlineAware(
|
|
@@ -1000,8 +1002,7 @@ export class ExtractionRunCoordinator {
|
|
|
1000
1002
|
if (options.failOnExtractionFailure && extractionFailure) {
|
|
1001
1003
|
throw new Error(`extraction failed: ${extractionFailure}`);
|
|
1002
1004
|
}
|
|
1003
|
-
// #3227: one count covers every enabled durable output kind, so a
|
|
1004
|
-
// reflection-only or relationship-only result reaches persistence.
|
|
1005
|
+
// #3227: one count covers every enabled durable output kind, so a reflection-only or relationship-only result reaches persistence.
|
|
1005
1006
|
const durableOutputCount = countRequestedDurableOutputs(result, this.config);
|
|
1006
1007
|
if (durableOutputCount === 0) {
|
|
1007
1008
|
log.debug("runExtraction: extraction produced no durable outputs; skipping persistence");
|
|
@@ -1031,10 +1032,9 @@ export class ExtractionRunCoordinator {
|
|
|
1031
1032
|
bufferKey,
|
|
1032
1033
|
isLiveSession: clearBufferAfterExtraction,
|
|
1033
1034
|
});
|
|
1034
|
-
// Issue #3415: retention follows the actual extraction failure, not
|
|
1035
|
-
//
|
|
1036
|
-
//
|
|
1037
|
-
// them is silent loss. A successful empty result still clears below.
|
|
1035
|
+
// Issue #3415: retention follows the actual extraction failure, not retry
|
|
1036
|
+
// bookkeeping. With retry disabled no backoff is recorded but the failed
|
|
1037
|
+
// turns are kept — clearing them is silent loss. Success still clears below.
|
|
1038
1038
|
if (extractionFailure) {
|
|
1039
1039
|
log.debug("runExtraction: retaining buffer after failed extraction", { extractionFailure });
|
|
1040
1040
|
} else {
|
|
@@ -1043,7 +1043,7 @@ export class ExtractionRunCoordinator {
|
|
|
1043
1043
|
if (!shouldPersistProcessedFingerprint) {
|
|
1044
1044
|
await commitEmptySuccessExtraction(emptySuccessCommit);
|
|
1045
1045
|
}
|
|
1046
|
-
return emptyExtractionResult(Boolean(extractionFailure), result.extractionFailureClass);
|
|
1046
|
+
return emptyExtractionResult(Boolean(extractionFailure) && !deadLetteredWindow, result.extractionFailureClass);
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
1049
|
let threadIdForExtraction: string | null = null;
|
|
@@ -273,6 +273,8 @@ export interface RecallInvocationOptions {
|
|
|
273
273
|
* an already-passed deadline behaves like a 0-remaining budget.
|
|
274
274
|
*/
|
|
275
275
|
deadlineMs?: number;
|
|
276
|
+
/** Caller-known trace ID (issue #3499); replaces the derived snapshot `traceId`. */
|
|
277
|
+
traceId?: string;
|
|
276
278
|
onContextComposition?: (composition: RecallContextComposition) => void | PromiseLike<void>;
|
|
277
279
|
}
|
|
278
280
|
|
|
@@ -58,7 +58,7 @@ export interface RecallEntryDeps {
|
|
|
58
58
|
readonly initPromise: Promise<void> | null;
|
|
59
59
|
lastRecallFailureAtMs: number;
|
|
60
60
|
lastRecallFailureLogAtMs: number;
|
|
61
|
-
logRecallFailure(
|
|
61
|
+
logRecallFailure(cause: unknown, traceId?: string): void;
|
|
62
62
|
readonly profiler: ProfilingCollector;
|
|
63
63
|
recallInternal(
|
|
64
64
|
prompt: string,
|
|
@@ -162,7 +162,7 @@ export class RecallEntryCoordinator {
|
|
|
162
162
|
// A fired client deadline is a timeout, not cancellation — the flow
|
|
163
163
|
// below then degrades to the missing-note response instead of "".
|
|
164
164
|
if (gateResult === "aborted" && !clientDeadlineFired) {
|
|
165
|
-
this.deps.logRecallFailure(abortRecallError("recall aborted before init"));
|
|
165
|
+
this.deps.logRecallFailure(abortRecallError("recall aborted before init"), options.traceId);
|
|
166
166
|
if (clientDeadlineHandle) clearTimeout(clientDeadlineHandle);
|
|
167
167
|
return "";
|
|
168
168
|
}
|
|
@@ -305,7 +305,7 @@ export class RecallEntryCoordinator {
|
|
|
305
305
|
|
|
306
306
|
return prefixStandingMemoryBlock(recallResult, standingText, standingBudget);
|
|
307
307
|
} catch (err) {
|
|
308
|
-
this.deps.logRecallFailure(err);
|
|
308
|
+
this.deps.logRecallFailure(err, options.traceId);
|
|
309
309
|
this.deps.profiler.endTrace();
|
|
310
310
|
// A fired client deadline is a timeout, not caller cancellation: the
|
|
311
311
|
// caller still expects the degraded response, not "" (issue #3499).
|
|
@@ -329,9 +329,9 @@ export class RecallEntryCoordinator {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
logRecallFailure(
|
|
332
|
+
logRecallFailure(cause: unknown, traceId?: string): void {
|
|
333
333
|
const now = Date.now();
|
|
334
|
-
const errorMsg =
|
|
334
|
+
const errorMsg = cause instanceof Error ? cause.message : String(cause);
|
|
335
335
|
const LOG_WINDOW_MS = 60_000;
|
|
336
336
|
const idleSinceLastFailureMs = now - this.deps.lastRecallFailureAtMs;
|
|
337
337
|
this.deps.lastRecallFailureAtMs = now;
|
|
@@ -344,14 +344,14 @@ export class RecallEntryCoordinator {
|
|
|
344
344
|
this.deps.suppressedRecallFailures > 0
|
|
345
345
|
? ` (suppressed ${this.deps.suppressedRecallFailures} similar failures in last minute)`
|
|
346
346
|
: "";
|
|
347
|
-
log.warn(`recall timed out or failed: ${errorMsg}${suffix}`);
|
|
347
|
+
log.warn(`recall timed out or failed${traceId ? ` [${traceId}]` : ""}: ${errorMsg}${suffix}`);
|
|
348
348
|
this.deps.lastRecallFailureLogAtMs = now;
|
|
349
349
|
this.deps.suppressedRecallFailures = 0;
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
this.deps.suppressedRecallFailures += 1;
|
|
354
|
-
log.debug(`recall timed out or failed (suppressed): ${errorMsg}`);
|
|
354
|
+
log.debug(`recall timed out or failed (suppressed)${traceId ? ` [${traceId}]` : ""}: ${errorMsg}`);
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
queueEvalShadowRecall(
|
|
@@ -199,10 +199,18 @@ export class RecallInternalCoordinator {
|
|
|
199
199
|
logger: log,
|
|
200
200
|
});
|
|
201
201
|
const promptHash = createHash("sha256").update(prompt).digest("hex");
|
|
202
|
-
|
|
202
|
+
// Caller-supplied traceId (issue #3499) wins: the ID a client logged
|
|
203
|
+
// before dispatch then appears verbatim on response + timing lines.
|
|
204
|
+
const traceId = options.traceId ?? createHash("sha256")
|
|
203
205
|
.update(`${sessionKey ?? "default"}:${recallStart}:${promptHash}`)
|
|
204
206
|
.digest("hex")
|
|
205
207
|
.slice(0, 16);
|
|
208
|
+
// Shadow-eval records are files keyed by this ID; a caller ID reused
|
|
209
|
+
// across runs would overwrite them, so the shadow keeps a per-run key.
|
|
210
|
+
const evalTraceId = `${traceId}-${recallStart}`;
|
|
211
|
+
// Emitted BEFORE the timeout-prone sections so a recall that dies at a
|
|
212
|
+
// deadline still leaves an ID-tagged daemon log line (issue #3499).
|
|
213
|
+
log.info(`recall start [${traceId}]`);
|
|
206
214
|
const sectionBuckets: RecallSectionBuckets = new Map();
|
|
207
215
|
// The effective LCM read session_id SET is computed below from
|
|
208
216
|
// `recallNamespaces` (the SAME read-authorized namespace set normal QMD/file
|
|
@@ -601,7 +609,7 @@ export class RecallInternalCoordinator {
|
|
|
601
609
|
}
|
|
602
610
|
if (sessionKey) {
|
|
603
611
|
this.deps.queueEvalShadowRecall({
|
|
604
|
-
traceId,
|
|
612
|
+
traceId: evalTraceId,
|
|
605
613
|
recordedAt: new Date().toISOString(),
|
|
606
614
|
sessionKey,
|
|
607
615
|
promptHash,
|
|
@@ -4888,7 +4896,9 @@ export class RecallInternalCoordinator {
|
|
|
4888
4896
|
const timingParts = Object.entries(timings)
|
|
4889
4897
|
.map(([k, v]) => `${k}=${v}`)
|
|
4890
4898
|
.join(", ");
|
|
4891
|
-
|
|
4899
|
+
// traceId on the timings line lets a client-side timeout be matched to
|
|
4900
|
+
// this recall by ID, not timestamp proximity (issue #3499).
|
|
4901
|
+
log.info(`recall timings [${traceId}]: ${timingParts}`);
|
|
4892
4902
|
emitRecallTiming(this.deps.config, {
|
|
4893
4903
|
...timings,
|
|
4894
4904
|
...phase2Timings,
|
|
@@ -5268,7 +5278,7 @@ export class RecallInternalCoordinator {
|
|
|
5268
5278
|
}
|
|
5269
5279
|
if (sessionKey) {
|
|
5270
5280
|
this.deps.queueEvalShadowRecall({
|
|
5271
|
-
traceId,
|
|
5281
|
+
traceId: evalTraceId,
|
|
5272
5282
|
recordedAt: new Date().toISOString(),
|
|
5273
5283
|
sessionKey,
|
|
5274
5284
|
promptHash,
|
package/src/orchestrator.ts
CHANGED
|
@@ -2508,11 +2508,12 @@ export class Orchestrator {
|
|
|
2508
2508
|
);
|
|
2509
2509
|
}
|
|
2510
2510
|
|
|
2511
|
-
private logRecallFailure(
|
|
2511
|
+
private logRecallFailure(cause: unknown, traceId?: string): void {
|
|
2512
2512
|
return (this.recallEntryCoordinator ?? new RecallEntryCoordinator(
|
|
2513
2513
|
selfDeps<ConstructorParameters<typeof RecallEntryCoordinator>[0]>(this),
|
|
2514
2514
|
)).logRecallFailure(
|
|
2515
|
-
|
|
2515
|
+
cause,
|
|
2516
|
+
traceId,
|
|
2516
2517
|
);
|
|
2517
2518
|
}
|
|
2518
2519
|
|