@remnic/core 1.1.0 → 1.1.2
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-audit.d.ts +56 -0
- package/dist/access-audit.js +9 -0
- package/dist/access-cli.js +70 -53
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +16 -9
- package/dist/access-http.js +26 -18
- package/dist/access-mcp.d.ts +16 -9
- package/dist/access-mcp.js +30 -8
- package/dist/access-schema.d.ts +124 -33
- package/dist/access-schema.js +5 -1
- package/dist/{access-service-HmO1Trrx.d.ts → access-service-Br8ZydTK.d.ts} +158 -63
- package/dist/access-service.d.ts +13 -6
- package/dist/access-service.js +23 -14
- package/dist/bootstrap.d.ts +6 -3
- package/dist/briefing.d.ts +1 -0
- package/dist/briefing.js +8 -6
- package/dist/buffer-surprise-report.d.ts +70 -0
- package/dist/buffer-surprise-report.js +7 -0
- package/dist/buffer-surprise-report.js.map +1 -0
- package/dist/buffer-surprise.d.ts +98 -0
- package/dist/buffer-surprise.js +11 -0
- package/dist/buffer-surprise.js.map +1 -0
- package/dist/buffer.d.ts +100 -2
- package/dist/buffer.js +1 -1
- package/dist/calibration.js +6 -6
- package/dist/causal-behavior.js +4 -4
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +19 -18
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +4 -4
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-QNJMBKFK.js → chunk-2LGMW3DJ.js} +3 -2
- package/dist/chunk-2LGMW3DJ.js.map +1 -0
- package/dist/{chunk-QDYXG4CS.js → chunk-3FPTCC3Z.js} +4 -3
- package/dist/chunk-3FPTCC3Z.js.map +1 -0
- package/dist/chunk-3GPTTA4J.js +57 -0
- package/dist/chunk-3GPTTA4J.js.map +1 -0
- package/dist/{chunk-ITRLGI2T.js → chunk-3OGMS3PE.js} +2 -2
- package/dist/{chunk-DEPL3635.js → chunk-3YGHKTBF.js} +1446 -196
- package/dist/chunk-3YGHKTBF.js.map +1 -0
- package/dist/{chunk-BLKTA7MM.js → chunk-4HQS2HPX.js} +54 -21
- package/dist/chunk-4HQS2HPX.js.map +1 -0
- package/dist/chunk-54V4BZWP.js +139 -0
- package/dist/chunk-54V4BZWP.js.map +1 -0
- package/dist/chunk-5JRF2PZA.js +67 -0
- package/dist/chunk-5JRF2PZA.js.map +1 -0
- package/dist/chunk-64NJRYU2.js +332 -0
- package/dist/chunk-64NJRYU2.js.map +1 -0
- package/dist/{chunk-OIT5QGG4.js → chunk-6AUUAZEX.js} +72 -2
- package/dist/chunk-6AUUAZEX.js.map +1 -0
- package/dist/{chunk-3QHL5ABG.js → chunk-6YJHX2DL.js} +191 -10
- package/dist/chunk-6YJHX2DL.js.map +1 -0
- package/dist/chunk-AJU4PJGY.js +126 -0
- package/dist/chunk-AJU4PJGY.js.map +1 -0
- package/dist/chunk-ASAITVLA.js +64 -0
- package/dist/chunk-ASAITVLA.js.map +1 -0
- package/dist/{chunk-44ICJRF3.js → chunk-AYXIPSZO.js} +5 -5
- package/dist/{chunk-MBJHSA7F.js → chunk-BECYBZLX.js} +265 -20
- package/dist/chunk-BECYBZLX.js.map +1 -0
- package/dist/chunk-C4SQJZAF.js +486 -0
- package/dist/chunk-C4SQJZAF.js.map +1 -0
- package/dist/{chunk-6UJ47TVX.js → chunk-CUPFXL3J.js} +2 -2
- package/dist/chunk-DF3RVK3X.js +119 -0
- package/dist/chunk-DF3RVK3X.js.map +1 -0
- package/dist/{chunk-N42IWANG.js → chunk-DG6YMRDC.js} +3 -3
- package/dist/chunk-DGVM5SFL.js +69 -0
- package/dist/chunk-DGVM5SFL.js.map +1 -0
- package/dist/{chunk-3SV6CQHO.js → chunk-DIXB44VE.js} +102 -66
- package/dist/chunk-DIXB44VE.js.map +1 -0
- package/dist/chunk-EIR5VLIH.js +90 -0
- package/dist/chunk-EIR5VLIH.js.map +1 -0
- package/dist/{chunk-GV6NLQ4X.js → chunk-F5VP6YCB.js} +374 -16
- package/dist/chunk-F5VP6YCB.js.map +1 -0
- package/dist/{chunk-6ZH4TU6I.js → chunk-FAAFWE4G.js} +2 -1
- package/dist/chunk-FAAFWE4G.js.map +1 -0
- package/dist/{chunk-7WQ6SLIE.js → chunk-FVA6TGI3.js} +2 -2
- package/dist/{chunk-PAORGQRI.js → chunk-GA5P7RST.js} +37 -23
- package/dist/chunk-GA5P7RST.js.map +1 -0
- package/dist/chunk-GDFS42HT.js +206 -0
- package/dist/chunk-GDFS42HT.js.map +1 -0
- package/dist/chunk-IISBCCWR.js +52 -0
- package/dist/chunk-IISBCCWR.js.map +1 -0
- package/dist/chunk-JBMSGZEQ.js +441 -0
- package/dist/chunk-JBMSGZEQ.js.map +1 -0
- package/dist/{chunk-J4IYOZZ5.js → chunk-JXS5PDQ7.js} +3 -1
- package/dist/chunk-JXS5PDQ7.js.map +1 -0
- package/dist/chunk-KVBLZUKV.js +173 -0
- package/dist/chunk-KVBLZUKV.js.map +1 -0
- package/dist/{chunk-4LACOVZX.js → chunk-L7IXWRYE.js} +10 -5
- package/dist/chunk-L7IXWRYE.js.map +1 -0
- package/dist/chunk-LBLXEFWK.js +51 -0
- package/dist/chunk-LBLXEFWK.js.map +1 -0
- package/dist/{chunk-WBSAYXVI.js → chunk-LOIMBRDE.js} +201 -45
- package/dist/chunk-LOIMBRDE.js.map +1 -0
- package/dist/{chunk-3WHVNEN7.js → chunk-LTCGGW2D.js} +1 -1
- package/dist/chunk-LTCGGW2D.js.map +1 -0
- package/dist/{chunk-ZVBB3T7V.js → chunk-NBVAS5MT.js} +25 -23
- package/dist/chunk-NBVAS5MT.js.map +1 -0
- package/dist/{chunk-UEYA6UC7.js → chunk-NZLQTHS5.js} +25 -2
- package/dist/chunk-NZLQTHS5.js.map +1 -0
- package/dist/{chunk-NQEVYWX6.js → chunk-OC5OXUQ4.js} +211 -7
- package/dist/chunk-OC5OXUQ4.js.map +1 -0
- package/dist/{chunk-LK6SGL53.js → chunk-OR64ZGRZ.js} +3 -2
- package/dist/chunk-OR64ZGRZ.js.map +1 -0
- package/dist/{chunk-SYUK3VLY.js → chunk-PVICZTKG.js} +117 -5
- package/dist/chunk-PVICZTKG.js.map +1 -0
- package/dist/chunk-PVPWZSSI.js +37 -0
- package/dist/chunk-PVPWZSSI.js.map +1 -0
- package/dist/{chunk-JL2PU6AI.js → chunk-R2XRID2N.js} +2 -2
- package/dist/{chunk-4NRAJUDS.js → chunk-RBBWYEFJ.js} +1 -1
- package/dist/chunk-RFYAYKTD.js +146 -0
- package/dist/chunk-RFYAYKTD.js.map +1 -0
- package/dist/chunk-SOBJ6NEY.js +18 -0
- package/dist/chunk-SOBJ6NEY.js.map +1 -0
- package/dist/{chunk-JIU55F3X.js → chunk-SPI27QT6.js} +2 -2
- package/dist/{chunk-MVTHXUBX.js → chunk-STGWEHYR.js} +479 -20
- package/dist/chunk-STGWEHYR.js.map +1 -0
- package/dist/{chunk-6LX5ORAS.js → chunk-TMYO7B5P.js} +4 -4
- package/dist/chunk-TVVEYCNW.js +65 -0
- package/dist/chunk-TVVEYCNW.js.map +1 -0
- package/dist/chunk-ULYOGL6R.js +322 -0
- package/dist/chunk-ULYOGL6R.js.map +1 -0
- package/dist/{chunk-37UIFYWO.js → chunk-UWB5LMWY.js} +108 -9
- package/dist/chunk-UWB5LMWY.js.map +1 -0
- package/dist/{chunk-47UU5PU2.js → chunk-VBVG2M5G.js} +18 -3
- package/dist/chunk-VBVG2M5G.js.map +1 -0
- package/dist/{chunk-7ECD5ATE.js → chunk-VDX363PS.js} +2 -2
- package/dist/{chunk-O5ETUNBT.js → chunk-VTU2B4VF.js} +7 -3
- package/dist/chunk-VTU2B4VF.js.map +1 -0
- package/dist/{chunk-MTLYEMJB.js → chunk-WCLICCGB.js} +18 -3
- package/dist/chunk-WCLICCGB.js.map +1 -0
- package/dist/chunk-X6GF3FX2.js +26 -0
- package/dist/chunk-X6GF3FX2.js.map +1 -0
- package/dist/{chunk-3QFQGRHO.js → chunk-XMHBH5H6.js} +4 -4
- package/dist/{chunk-DHHP2Z4X.js → chunk-XXVWLXSG.js} +2 -2
- package/dist/{chunk-XZ2TIKGC.js → chunk-Y7R2XJ5Q.js} +25 -9
- package/dist/chunk-Y7R2XJ5Q.js.map +1 -0
- package/dist/{chunk-ALXMCZEU.js → chunk-Z2E7VW55.js} +6 -3
- package/dist/chunk-Z2E7VW55.js.map +1 -0
- package/dist/chunk-ZAIM4TUE.js +488 -0
- package/dist/chunk-ZAIM4TUE.js.map +1 -0
- package/dist/chunk-ZZTOURJI.js +91 -0
- package/dist/chunk-ZZTOURJI.js.map +1 -0
- package/dist/{cli-BneVIEvh.d.ts → cli-BkeRaYfk.d.ts} +2 -2
- package/dist/cli.d.ts +13 -6
- package/dist/cli.js +42 -31
- package/dist/config.js +2 -2
- package/dist/consolidation-operator.d.ts +41 -0
- package/dist/consolidation-operator.js +11 -0
- package/dist/consolidation-operator.js.map +1 -0
- package/dist/consolidation-provenance-check.d.ts +68 -0
- package/dist/consolidation-provenance-check.js +9 -0
- package/dist/consolidation-provenance-check.js.map +1 -0
- package/dist/consolidation-undo.d.ts +123 -0
- package/dist/consolidation-undo.js +426 -0
- package/dist/consolidation-undo.js.map +1 -0
- package/dist/{contradiction-scan-GR33PONM.js → contradiction-scan-E3GJTI4F.js} +43 -7
- package/dist/contradiction-scan-E3GJTI4F.js.map +1 -0
- package/dist/cross-namespace-budget.d.ts +133 -0
- package/dist/cross-namespace-budget.js +9 -0
- package/dist/cross-namespace-budget.js.map +1 -0
- package/dist/direct-answer-wiring.js +5 -70
- package/dist/direct-answer-wiring.js.map +1 -1
- package/dist/embedding-fallback.js +2 -1
- package/dist/{engine-5TIQBYZR.js → engine-72LSIWQP.js} +8 -7
- package/dist/engine-72LSIWQP.js.map +1 -0
- package/dist/entity-retrieval.d.ts +1 -0
- package/dist/entity-retrieval.js +7 -6
- package/dist/explicit-capture.d.ts +6 -3
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +113 -0
- package/dist/extraction-judge-telemetry.js +14 -0
- package/dist/extraction-judge-telemetry.js.map +1 -0
- package/dist/extraction-judge-training.d.ts +85 -0
- package/dist/extraction-judge-training.js +16 -0
- package/dist/extraction-judge-training.js.map +1 -0
- package/dist/extraction-judge.d.ts +124 -2
- package/dist/extraction-judge.js +11 -1
- package/dist/extraction.js +10 -9
- package/dist/fallback-llm.js +3 -3
- package/dist/graph-recall.d.ts +100 -0
- package/dist/graph-recall.js +8 -0
- package/dist/graph-recall.js.map +1 -0
- package/dist/graph-retrieval.d.ts +271 -0
- package/dist/graph-retrieval.js +21 -0
- package/dist/graph-retrieval.js.map +1 -0
- package/dist/importance.js +1 -1
- package/dist/index.d.ts +585 -20
- package/dist/index.js +542 -344
- package/dist/index.js.map +1 -1
- package/dist/local-llm.js +2 -2
- package/dist/memory-worth-bench.d.ts +51 -0
- package/dist/memory-worth-bench.js +131 -0
- package/dist/memory-worth-bench.js.map +1 -0
- package/dist/memory-worth-filter.d.ts +128 -0
- package/dist/memory-worth-filter.js +10 -0
- package/dist/memory-worth-filter.js.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +118 -0
- package/dist/memory-worth-outcomes.js +9 -0
- package/dist/memory-worth-outcomes.js.map +1 -0
- package/dist/memory-worth.d.ts +102 -0
- package/dist/memory-worth.js +7 -0
- package/dist/memory-worth.js.map +1 -0
- package/dist/operator-toolkit.d.ts +40 -1
- package/dist/operator-toolkit.js +25 -16
- package/dist/{orchestrator-DRYA6_lW.d.ts → orchestrator-CmJ-NTdJ.d.ts} +233 -8
- package/dist/orchestrator.d.ts +6 -3
- package/dist/orchestrator.js +54 -44
- package/dist/page-versioning.d.ts +12 -1
- package/dist/page-versioning.js +5 -3
- package/dist/{port-C1GZFv8h.d.ts → port-BADbLZU5.d.ts} +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +5 -3
- package/dist/qmd.js +3 -3
- package/dist/reasoning-trace-recall.d.ts +90 -0
- package/dist/reasoning-trace-recall.js +13 -0
- package/dist/reasoning-trace-recall.js.map +1 -0
- package/dist/reasoning-trace-types.d.ts +54 -0
- package/dist/reasoning-trace-types.js +17 -0
- package/dist/reasoning-trace-types.js.map +1 -0
- package/dist/recall-audit-anomaly.d.ts +112 -0
- package/dist/recall-audit-anomaly.js +11 -0
- package/dist/recall-audit-anomaly.js.map +1 -0
- package/dist/recall-audit.js +5 -44
- package/dist/recall-audit.js.map +1 -1
- package/dist/recall-explain-renderer.d.ts +49 -0
- package/dist/recall-explain-renderer.js +18 -0
- package/dist/recall-explain-renderer.js.map +1 -0
- package/dist/recall-state.d.ts +12 -1
- package/dist/recall-state.js +1 -1
- package/dist/recall-xray-cli.d.ts +40 -0
- package/dist/recall-xray-cli.js +11 -0
- package/dist/recall-xray-cli.js.map +1 -0
- package/dist/recall-xray-renderer.d.ts +44 -0
- package/dist/recall-xray-renderer.js +18 -0
- package/dist/recall-xray-renderer.js.map +1 -0
- package/dist/recall-xray.d.ts +179 -0
- package/dist/recall-xray.js +13 -0
- package/dist/recall-xray.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +5 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +6 -6
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +17 -0
- package/dist/retrieval-tiers.js +9 -0
- package/dist/retrieval-tiers.js.map +1 -0
- package/dist/schemas.d.ts +309 -53
- package/dist/schemas.js +1 -1
- package/dist/{semantic-consolidation-DrvSYRdB.d.ts → semantic-consolidation-CxJU6MJk.d.ts} +62 -1
- package/dist/semantic-consolidation.d.ts +2 -1
- package/dist/semantic-consolidation.js +22 -7
- package/dist/semantic-rule-promotion.js +7 -6
- package/dist/semantic-rule-verifier.js +7 -6
- package/dist/storage.d.ts +82 -1
- package/dist/storage.js +6 -5
- package/dist/summarizer.js +6 -6
- package/dist/temporal-supersession.d.ts +1 -0
- package/dist/tier-migration.d.ts +2 -1
- package/dist/tokens.js +2 -1
- package/dist/types.d.ts +276 -2
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +7 -6
- package/package.json +1 -1
- package/dist/chunk-37UIFYWO.js.map +0 -1
- package/dist/chunk-3QHL5ABG.js.map +0 -1
- package/dist/chunk-3SV6CQHO.js.map +0 -1
- package/dist/chunk-3WHVNEN7.js.map +0 -1
- package/dist/chunk-47UU5PU2.js.map +0 -1
- package/dist/chunk-4LACOVZX.js.map +0 -1
- package/dist/chunk-6ZH4TU6I.js.map +0 -1
- package/dist/chunk-ALXMCZEU.js.map +0 -1
- package/dist/chunk-BLKTA7MM.js.map +0 -1
- package/dist/chunk-DEPL3635.js.map +0 -1
- package/dist/chunk-GV6NLQ4X.js.map +0 -1
- package/dist/chunk-J4IYOZZ5.js.map +0 -1
- package/dist/chunk-LAYN4LDC.js +0 -267
- package/dist/chunk-LAYN4LDC.js.map +0 -1
- package/dist/chunk-LK6SGL53.js.map +0 -1
- package/dist/chunk-MBJHSA7F.js.map +0 -1
- package/dist/chunk-MTLYEMJB.js.map +0 -1
- package/dist/chunk-MVTHXUBX.js.map +0 -1
- package/dist/chunk-NQEVYWX6.js.map +0 -1
- package/dist/chunk-O5ETUNBT.js.map +0 -1
- package/dist/chunk-OIT5QGG4.js.map +0 -1
- package/dist/chunk-PAORGQRI.js.map +0 -1
- package/dist/chunk-QDYXG4CS.js.map +0 -1
- package/dist/chunk-QNJMBKFK.js.map +0 -1
- package/dist/chunk-SYUK3VLY.js.map +0 -1
- package/dist/chunk-UEYA6UC7.js.map +0 -1
- package/dist/chunk-UVJFDP7P.js +0 -202
- package/dist/chunk-UVJFDP7P.js.map +0 -1
- package/dist/chunk-WBSAYXVI.js.map +0 -1
- package/dist/chunk-XZ2TIKGC.js.map +0 -1
- package/dist/chunk-ZVBB3T7V.js.map +0 -1
- package/dist/contradiction-scan-GR33PONM.js.map +0 -1
- /package/dist/{engine-5TIQBYZR.js.map → access-audit.js.map} +0 -0
- /package/dist/{chunk-ITRLGI2T.js.map → chunk-3OGMS3PE.js.map} +0 -0
- /package/dist/{chunk-44ICJRF3.js.map → chunk-AYXIPSZO.js.map} +0 -0
- /package/dist/{chunk-6UJ47TVX.js.map → chunk-CUPFXL3J.js.map} +0 -0
- /package/dist/{chunk-N42IWANG.js.map → chunk-DG6YMRDC.js.map} +0 -0
- /package/dist/{chunk-7WQ6SLIE.js.map → chunk-FVA6TGI3.js.map} +0 -0
- /package/dist/{chunk-JL2PU6AI.js.map → chunk-R2XRID2N.js.map} +0 -0
- /package/dist/{chunk-4NRAJUDS.js.map → chunk-RBBWYEFJ.js.map} +0 -0
- /package/dist/{chunk-JIU55F3X.js.map → chunk-SPI27QT6.js.map} +0 -0
- /package/dist/{chunk-6LX5ORAS.js.map → chunk-TMYO7B5P.js.map} +0 -0
- /package/dist/{chunk-7ECD5ATE.js.map → chunk-VDX363PS.js.map} +0 -0
- /package/dist/{chunk-3QFQGRHO.js.map → chunk-XMHBH5H6.js.map} +0 -0
- /package/dist/{chunk-DHHP2Z4X.js.map → chunk-XXVWLXSG.js.map} +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { StorageManager } from './storage.js';
|
|
1
2
|
import { EvalHarnessStatus, validateEvalBenchmarkPack, EvalBaselineDeltaReport, EvalCiGateReport } from './evals.js';
|
|
2
3
|
import { GraphHealthReport } from './graph.js';
|
|
3
4
|
import { SessionIntegrityReport, SessionRepairPlan, SessionRepairApplyResult } from './session-integrity.js';
|
|
4
5
|
import { PluginConfig } from './types.js';
|
|
6
|
+
import './page-versioning.js';
|
|
7
|
+
import './consolidation-operator.js';
|
|
8
|
+
import './memory-projection-store-DeSXPh1j.js';
|
|
9
|
+
import 'better-sqlite3';
|
|
5
10
|
|
|
6
11
|
interface QmdRuntimeLike {
|
|
7
12
|
probe(): Promise<boolean>;
|
|
@@ -297,8 +302,42 @@ interface OperatorRepairOptions {
|
|
|
297
302
|
declare function runOperatorSetup(options: OperatorSetupOptions): Promise<OperatorSetupReport>;
|
|
298
303
|
declare function runOperatorConfigReview(options: OperatorConfigReviewOptions): Promise<OperatorConfigReviewReport>;
|
|
299
304
|
declare function runOperatorDoctor(options: OperatorDoctorOptions): Promise<OperatorDoctorReport>;
|
|
305
|
+
/**
|
|
306
|
+
* Count memories that pre-date the Memory Worth counters introduced in issue
|
|
307
|
+
* #560 — i.e., neither `mw_success` nor `mw_fail` is set on the frontmatter.
|
|
308
|
+
*
|
|
309
|
+
* Only memories whose category is eligible for Memory Worth (see
|
|
310
|
+
* `MEMORY_WORTH_ELIGIBLE_CATEGORIES`) are considered. Procedures, corrections,
|
|
311
|
+
* and other kinds that are not instrumented are excluded entirely — they're
|
|
312
|
+
* neither "legacy" nor "instrumented" for the purposes of this audit. The
|
|
313
|
+
* total in the returned details reflects only eligible memories.
|
|
314
|
+
*
|
|
315
|
+
* Returned as an `ok` check regardless of count, since legacy memories are
|
|
316
|
+
* fully functional (readers treat missing counters as zero observations). The
|
|
317
|
+
* numbers are informational for operators following the #560 rollout.
|
|
318
|
+
*
|
|
319
|
+
* Exported so unit tests can exercise the classification logic without
|
|
320
|
+
* booting a full orchestrator.
|
|
321
|
+
*/
|
|
322
|
+
declare function summarizeMemoryWorthLegacyCounters(storage: StorageManager): Promise<OperatorDoctorCheck>;
|
|
323
|
+
/**
|
|
324
|
+
* Summarize the recent buffer-surprise telemetry distribution for the
|
|
325
|
+
* Doctor report (issue #563 PR 3).
|
|
326
|
+
*
|
|
327
|
+
* Reports mean/median/p90 surprise scores and the triggered-flush rate
|
|
328
|
+
* over the most recent window of ledger rows. An empty ledger is the
|
|
329
|
+
* expected state until `bufferSurpriseTriggerEnabled` is turned on — the
|
|
330
|
+
* check never escalates beyond `ok` / `warn` (ledger unreadable).
|
|
331
|
+
*
|
|
332
|
+
* Exported so tests can exercise the formatting without booting a real
|
|
333
|
+
* orchestrator.
|
|
334
|
+
*/
|
|
335
|
+
declare function summarizeBufferSurpriseDistribution(storage: StorageManager, config: PluginConfig): Promise<OperatorDoctorCheck>;
|
|
336
|
+
declare function summarizeConsolidationProvenance(storage: StorageManager, config: Pick<PluginConfig, "memoryDir"> & {
|
|
337
|
+
versioningSidecarDir?: string;
|
|
338
|
+
}): Promise<OperatorDoctorCheck>;
|
|
300
339
|
declare function runOperatorInventory(options: OperatorInventoryOptions): Promise<OperatorInventoryReport>;
|
|
301
340
|
declare function runBenchmarkRecall(options: BenchmarkRecallOptions): Promise<BenchmarkRecallReport>;
|
|
302
341
|
declare function runOperatorRepair(options: OperatorRepairOptions): Promise<OperatorRepairReport>;
|
|
303
342
|
|
|
304
|
-
export { type BenchmarkRecallOptions, type BenchmarkRecallReport, type OperatorConfigLoadResult, type OperatorConfigReviewFinding, type OperatorConfigReviewOptions, type OperatorConfigReviewReport, type OperatorDoctorCheck, type OperatorDoctorOptions, type OperatorDoctorReport, type OperatorInventoryNamespaceSummary, type OperatorInventoryOptions, type OperatorInventoryReport, type OperatorRepairOptions, type OperatorRepairReport, type OperatorSetupOptions, type OperatorSetupReport, type OperatorToolkitOrchestrator, runBenchmarkRecall, runOperatorConfigReview, runOperatorDoctor, runOperatorInventory, runOperatorRepair, runOperatorSetup };
|
|
343
|
+
export { type BenchmarkRecallOptions, type BenchmarkRecallReport, type OperatorConfigLoadResult, type OperatorConfigReviewFinding, type OperatorConfigReviewOptions, type OperatorConfigReviewReport, type OperatorDoctorCheck, type OperatorDoctorOptions, type OperatorDoctorReport, type OperatorInventoryNamespaceSummary, type OperatorInventoryOptions, type OperatorInventoryReport, type OperatorRepairOptions, type OperatorRepairReport, type OperatorSetupOptions, type OperatorSetupReport, type OperatorToolkitOrchestrator, runBenchmarkRecall, runOperatorConfigReview, runOperatorDoctor, runOperatorInventory, runOperatorRepair, runOperatorSetup, summarizeBufferSurpriseDistribution, summarizeConsolidationProvenance, summarizeMemoryWorthLegacyCounters };
|
package/dist/operator-toolkit.js
CHANGED
|
@@ -4,43 +4,52 @@ import {
|
|
|
4
4
|
runOperatorDoctor,
|
|
5
5
|
runOperatorInventory,
|
|
6
6
|
runOperatorRepair,
|
|
7
|
-
runOperatorSetup
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
runOperatorSetup,
|
|
8
|
+
summarizeBufferSurpriseDistribution,
|
|
9
|
+
summarizeConsolidationProvenance,
|
|
10
|
+
summarizeMemoryWorthLegacyCounters
|
|
11
|
+
} from "./chunk-6YJHX2DL.js";
|
|
12
|
+
import "./chunk-ULYOGL6R.js";
|
|
13
|
+
import "./chunk-ASAITVLA.js";
|
|
14
|
+
import "./chunk-NBVAS5MT.js";
|
|
10
15
|
import "./chunk-YRMVARQP.js";
|
|
11
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-4HQS2HPX.js";
|
|
12
17
|
import "./chunk-U66YHYC7.js";
|
|
13
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-OR64ZGRZ.js";
|
|
14
19
|
import "./chunk-7SEAZFFB.js";
|
|
15
20
|
import "./chunk-K6WK37A6.js";
|
|
16
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-BECYBZLX.js";
|
|
17
22
|
import "./chunk-Z5LAYHGJ.js";
|
|
18
23
|
import "./chunk-C2EFFULQ.js";
|
|
19
24
|
import "./chunk-PVGDJXVK.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-QNJMBKFK.js";
|
|
25
|
+
import "./chunk-3OGMS3PE.js";
|
|
26
|
+
import "./chunk-2LGMW3DJ.js";
|
|
23
27
|
import "./chunk-TBBDFYXW.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-3WHVNEN7.js";
|
|
28
|
+
import "./chunk-F5VP6YCB.js";
|
|
29
|
+
import "./chunk-LTCGGW2D.js";
|
|
27
30
|
import "./chunk-4KAN3GZ3.js";
|
|
28
|
-
import "./chunk-6ZH4TU6I.js";
|
|
29
|
-
import "./chunk-SCU65EZI.js";
|
|
30
|
-
import "./chunk-BOUYNNYD.js";
|
|
31
31
|
import "./chunk-6PFRXT4K.js";
|
|
32
32
|
import "./chunk-TP4FZJIZ.js";
|
|
33
|
+
import "./chunk-SCU65EZI.js";
|
|
34
|
+
import "./chunk-BOUYNNYD.js";
|
|
33
35
|
import "./chunk-DM2T26WE.js";
|
|
34
36
|
import "./chunk-QSVPYQPG.js";
|
|
35
37
|
import "./chunk-M62O4P4T.js";
|
|
36
38
|
import "./chunk-4DJQYKMN.js";
|
|
39
|
+
import "./chunk-X6GF3FX2.js";
|
|
40
|
+
import "./chunk-FAAFWE4G.js";
|
|
41
|
+
import "./chunk-MARWOCVP.js";
|
|
37
42
|
import "./chunk-2ODBA7MQ.js";
|
|
43
|
+
import "./chunk-LPSF4OQH.js";
|
|
38
44
|
export {
|
|
39
45
|
runBenchmarkRecall,
|
|
40
46
|
runOperatorConfigReview,
|
|
41
47
|
runOperatorDoctor,
|
|
42
48
|
runOperatorInventory,
|
|
43
49
|
runOperatorRepair,
|
|
44
|
-
runOperatorSetup
|
|
50
|
+
runOperatorSetup,
|
|
51
|
+
summarizeBufferSurpriseDistribution,
|
|
52
|
+
summarizeConsolidationProvenance,
|
|
53
|
+
summarizeMemoryWorthLegacyCounters
|
|
45
54
|
};
|
|
46
55
|
//# sourceMappingURL=operator-toolkit.js.map
|
|
@@ -1,21 +1,91 @@
|
|
|
1
1
|
import { SmartBuffer } from './buffer.js';
|
|
2
|
-
import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions } from './port-
|
|
2
|
+
import { S as SearchBackend, a as SearchQueryOptions, b as SearchExecutionOptions } from './port-BADbLZU5.js';
|
|
3
3
|
import { StorageManager } from './storage.js';
|
|
4
4
|
import { TranscriptManager } from './transcript.js';
|
|
5
5
|
import { HourlySummarizer } from './summarizer.js';
|
|
6
6
|
import { LocalLlmClient } from './local-llm.js';
|
|
7
|
+
import { FallbackLlmClient } from './fallback-llm.js';
|
|
7
8
|
import { ModelRegistry } from './model-registry.js';
|
|
8
9
|
import { RelevanceStore } from './relevance.js';
|
|
9
10
|
import { NegativeExampleStore } from './negative.js';
|
|
10
11
|
import { LastRecallStore, TierMigrationStatusStore, GraphRecallExpandedEntry, TierMigrationStatusSnapshot, TierMigrationCycleSummary, LastRecallSnapshot } from './recall-state.js';
|
|
12
|
+
import { RecallXraySnapshot } from './recall-xray.js';
|
|
11
13
|
import { SessionObserverState } from './session-observer-state.js';
|
|
12
14
|
import { EmbeddingFallback } from './embedding-fallback.js';
|
|
13
|
-
import { PluginConfig, QmdSearchResult, BehaviorLoopPolicyState, BootstrapOptions, BootstrapResult, ConsolidationObservation, MemoryFile, DaySummaryResult, MemoryActionEvent, RecallPlanMode, MemoryIntent, EntityTimelineEntry, ExtractionResult, MemoryFrontmatter, IdentityInjectionMode } from './types.js';
|
|
14
|
-
import { S as SemanticConsolidationResult } from './semantic-consolidation-
|
|
15
|
+
import { PluginConfig, CodingContext, QmdSearchResult, BehaviorLoopPolicyState, BootstrapOptions, BootstrapResult, ConsolidationObservation, MemoryFile, DaySummaryResult, MemoryActionEvent, RecallPlanMode, MemoryIntent, EntityTimelineEntry, ExtractionResult, MemoryFrontmatter, IdentityInjectionMode } from './types.js';
|
|
16
|
+
import { S as SemanticConsolidationResult } from './semantic-consolidation-CxJU6MJk.js';
|
|
15
17
|
import { z } from 'zod';
|
|
16
18
|
import { RuntimePolicyValues } from './policy-runtime.js';
|
|
17
19
|
import { ProfilingCollector } from './profiling.js';
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @remnic/core — Write-time semantic dedup guard
|
|
23
|
+
*
|
|
24
|
+
* Complements the exact content-hash check in the orchestrator's write path
|
|
25
|
+
* by detecting near-duplicate candidate facts via embedding cosine similarity.
|
|
26
|
+
*
|
|
27
|
+
* The module intentionally has no dependency on the EmbeddingFallback or QMD
|
|
28
|
+
* classes directly — callers pass in a `lookup` function that returns the
|
|
29
|
+
* top-K nearest neighbors with their cosine scores. This keeps the decision
|
|
30
|
+
* logic pure and trivially testable with synthetic fixtures, and lets the
|
|
31
|
+
* orchestrator reuse whichever backend it already has wired up.
|
|
32
|
+
*
|
|
33
|
+
* Related issue: joshuaswarren/remnic#373
|
|
34
|
+
*/
|
|
35
|
+
/** A single nearest-neighbor hit from the embedding backend. */
|
|
36
|
+
interface SemanticDedupHit {
|
|
37
|
+
/** Memory id of the existing neighbor. */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Cosine similarity score in [0, 1]. */
|
|
40
|
+
score: number;
|
|
41
|
+
/** Optional source path, purely informational. */
|
|
42
|
+
path?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Lookup function passed by the caller. Must return an array of hits sorted
|
|
46
|
+
* descending by score. Implementations should return an empty array (never
|
|
47
|
+
* throw) when the embedding backend is unavailable — the decision function
|
|
48
|
+
* treats that as "no near duplicate" (fail-open).
|
|
49
|
+
*/
|
|
50
|
+
type SemanticDedupLookup = (content: string, limit: number) => Promise<SemanticDedupHit[]>;
|
|
51
|
+
interface SemanticDedupOptions {
|
|
52
|
+
/** Master switch. When false, `decideSemanticDedup` always returns `keep`. */
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
/** Cosine similarity threshold (0-1). ≥ threshold ⇒ treat as duplicate. */
|
|
55
|
+
threshold: number;
|
|
56
|
+
/** How many nearest neighbors to compare against. */
|
|
57
|
+
candidates: number;
|
|
58
|
+
}
|
|
59
|
+
type SemanticDedupDecision = {
|
|
60
|
+
action: "keep";
|
|
61
|
+
reason: "disabled" | "backend_unavailable" | "no_candidates" | "no_near_duplicate";
|
|
62
|
+
topScore?: number;
|
|
63
|
+
topId?: string;
|
|
64
|
+
} | {
|
|
65
|
+
action: "skip";
|
|
66
|
+
reason: "near_duplicate";
|
|
67
|
+
topScore: number;
|
|
68
|
+
topId: string;
|
|
69
|
+
topPath?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Pure decision function: given a lookup callback and options, decide whether
|
|
73
|
+
* the candidate content should be written or skipped as a near-duplicate.
|
|
74
|
+
*
|
|
75
|
+
* Contract:
|
|
76
|
+
* - When `options.enabled` is false → always keep, reason="disabled".
|
|
77
|
+
* - When the lookup throws (provider down / network error) → keep,
|
|
78
|
+
* reason="backend_unavailable". Fail-open: a lookup failure must not block
|
|
79
|
+
* writes.
|
|
80
|
+
* - When the lookup succeeds but returns 0 hits (empty index or no
|
|
81
|
+
* neighbors above the score floor) → keep, reason="no_candidates".
|
|
82
|
+
* This is distinct from backend_unavailable so telemetry dashboards can
|
|
83
|
+
* correctly distinguish "provider is down" from "index is empty".
|
|
84
|
+
* - When the top hit's score ≥ threshold → skip with reason="near_duplicate".
|
|
85
|
+
* - Otherwise → keep with reason="no_near_duplicate".
|
|
86
|
+
*/
|
|
87
|
+
declare function decideSemanticDedup(content: string, lookup: SemanticDedupLookup, options: SemanticDedupOptions): Promise<SemanticDedupDecision>;
|
|
88
|
+
|
|
19
89
|
type ReplaySource = "openclaw" | "claude" | "chatgpt";
|
|
20
90
|
type ReplayRole = "user" | "assistant";
|
|
21
91
|
interface ReplayTurn {
|
|
@@ -239,9 +309,9 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
|
|
|
239
309
|
agent: string;
|
|
240
310
|
date: string;
|
|
241
311
|
reason: string;
|
|
242
|
-
confidence?: number | undefined;
|
|
243
312
|
workflow?: string | undefined;
|
|
244
313
|
tags?: string[] | undefined;
|
|
314
|
+
confidence?: number | undefined;
|
|
245
315
|
severity?: "low" | "medium" | "high" | undefined;
|
|
246
316
|
outcome?: string | undefined;
|
|
247
317
|
refs?: string[] | undefined;
|
|
@@ -253,9 +323,9 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
|
|
|
253
323
|
agent: string;
|
|
254
324
|
date: string;
|
|
255
325
|
reason: string;
|
|
256
|
-
confidence?: number | undefined;
|
|
257
326
|
workflow?: string | undefined;
|
|
258
327
|
tags?: string[] | undefined;
|
|
328
|
+
confidence?: number | undefined;
|
|
259
329
|
severity?: "low" | "medium" | "high" | undefined;
|
|
260
330
|
outcome?: string | undefined;
|
|
261
331
|
refs?: string[] | undefined;
|
|
@@ -635,6 +705,35 @@ interface RecallInvocationOptions {
|
|
|
635
705
|
topK?: number;
|
|
636
706
|
mode?: RecallPlanMode;
|
|
637
707
|
abortSignal?: AbortSignal;
|
|
708
|
+
/**
|
|
709
|
+
* Capture a `RecallXraySnapshot` for this recall (issue #570). When
|
|
710
|
+
* `true`, the orchestrator builds a snapshot from the data it has
|
|
711
|
+
* already gathered and stashes it in memory, accessible via
|
|
712
|
+
* `getLastXraySnapshot()`. When `false` or absent, nothing is
|
|
713
|
+
* captured and recall behavior is unchanged (schema-only slice).
|
|
714
|
+
*/
|
|
715
|
+
xrayCapture?: boolean;
|
|
716
|
+
/**
|
|
717
|
+
* Per-invocation override for `recallBudgetChars` (issue #570 PR 3/4).
|
|
718
|
+
* Flows through `getRecallBudgetChars()` for this recall only — no
|
|
719
|
+
* shared config mutation, so concurrent recalls on the same
|
|
720
|
+
* orchestrator are not affected (CLAUDE.md rule 47: no shared
|
|
721
|
+
* mutable state across async boundaries). Must be a non-negative
|
|
722
|
+
* finite integer; non-conforming values are ignored and the
|
|
723
|
+
* configured budget is used.
|
|
724
|
+
*/
|
|
725
|
+
budgetCharsOverride?: number;
|
|
726
|
+
/**
|
|
727
|
+
* Per-invocation principal override (issue #570 PR 4). When set,
|
|
728
|
+
* the orchestrator uses this principal for ACL / namespace checks
|
|
729
|
+
* instead of `resolvePrincipal(sessionKey, config)`. This is the
|
|
730
|
+
* escape hatch for access surfaces (HTTP / MCP) that have already
|
|
731
|
+
* authenticated the caller upstream — threading an unmapped
|
|
732
|
+
* principal through the session-key-based resolver would otherwise
|
|
733
|
+
* collapse it to `"default"` and produce false denials in
|
|
734
|
+
* namespace-enabled deployments (CLAUDE.md rule 42).
|
|
735
|
+
*/
|
|
736
|
+
principalOverride?: string;
|
|
638
737
|
}
|
|
639
738
|
/** Default workspace directory when no per-agent or config workspace is available. */
|
|
640
739
|
declare function defaultWorkspaceDir(): string;
|
|
@@ -751,12 +850,37 @@ declare class Orchestrator {
|
|
|
751
850
|
readonly localLlm: LocalLlmClient;
|
|
752
851
|
readonly fastLlm: LocalLlmClient;
|
|
753
852
|
private readonly judgeVerdictCache;
|
|
754
|
-
|
|
853
|
+
/**
|
|
854
|
+
* Per-orchestrator defer-counter map (issue #562, PR 2). Tracks how many
|
|
855
|
+
* times the judge has returned `"defer"` for a given candidate content
|
|
856
|
+
* hash so the defer cap can be enforced.
|
|
857
|
+
*/
|
|
858
|
+
private readonly judgeDeferCounts;
|
|
859
|
+
/**
|
|
860
|
+
* Side-channel: number of facts deferred in the most recent
|
|
861
|
+
* `persistExtraction` call (issue #562, PR 2). The caller reads this after
|
|
862
|
+
* `persistExtraction` returns to decide whether to retain buffer turns for
|
|
863
|
+
* the next extraction pass. Not part of the return signature because many
|
|
864
|
+
* callers already destructure `persistedIds` by position.
|
|
865
|
+
*/
|
|
866
|
+
private lastPersistExtractionDeferredCount;
|
|
867
|
+
private readonly _fastGatewayLlm;
|
|
868
|
+
get fastGatewayLlm(): FallbackLlmClient | null;
|
|
755
869
|
readonly modelRegistry: ModelRegistry;
|
|
756
870
|
readonly relevance: RelevanceStore;
|
|
757
871
|
readonly negatives: NegativeExampleStore;
|
|
758
872
|
readonly lastRecall: LastRecallStore;
|
|
759
873
|
readonly tierMigrationStatus: TierMigrationStatusStore;
|
|
874
|
+
/**
|
|
875
|
+
* In-memory X-ray snapshot from the most recent `recall()` call that
|
|
876
|
+
* was invoked with `xrayCapture: true` (issue #570 PR 1). Scope is
|
|
877
|
+
* per-process; later slices add CLI/HTTP/MCP surfaces that consume
|
|
878
|
+
* this via the shared renderer. `null` until the first capture, and
|
|
879
|
+
* NEVER overwritten by a recall that did not request capture —
|
|
880
|
+
* requests without the flag leave prior captures intact so the
|
|
881
|
+
* capturing caller can still read their snapshot back.
|
|
882
|
+
*/
|
|
883
|
+
private lastXraySnapshot;
|
|
760
884
|
readonly embeddingFallback: EmbeddingFallback;
|
|
761
885
|
private readonly conversationIndexDir;
|
|
762
886
|
private readonly extraction;
|
|
@@ -772,6 +896,16 @@ declare class Orchestrator {
|
|
|
772
896
|
/** Lossless Context Management engine — proactive session archive + DAG summarization. */
|
|
773
897
|
readonly lcmEngine: LcmEngine | null;
|
|
774
898
|
private readonly rerankCache;
|
|
899
|
+
/**
|
|
900
|
+
* Short-TTL cache for Memory Worth counter lookups so interactive recall
|
|
901
|
+
* doesn't trigger a full `readAllMemories` scan per query. Keyed by
|
|
902
|
+
* namespace; the filter unions across namespaces at query time. The TTL
|
|
903
|
+
* is intentionally short (seconds, not minutes) because counters are
|
|
904
|
+
* mutated by `recordMemoryOutcome` asynchronously and we'd rather serve
|
|
905
|
+
* a 30-second-stale worth score than a stable-but-wrong one.
|
|
906
|
+
*/
|
|
907
|
+
private readonly memoryWorthCounterCache;
|
|
908
|
+
private static readonly MEMORY_WORTH_CACHE_TTL_MS;
|
|
775
909
|
/**
|
|
776
910
|
* Per-session workspace overrides keyed by sessionKey.
|
|
777
911
|
* Set by the before_agent_start hook so recall() uses the correct
|
|
@@ -779,6 +913,14 @@ declare class Orchestrator {
|
|
|
779
913
|
* Using a Map prevents concurrent sessions from overwriting each other.
|
|
780
914
|
*/
|
|
781
915
|
private _recallWorkspaceOverrides;
|
|
916
|
+
/**
|
|
917
|
+
* Per-session coding-agent context (issue #569). Populated by connectors at
|
|
918
|
+
* session-start (PRs 5/6/7) via `setCodingContextForSession`. Used by both
|
|
919
|
+
* the recall path and the write path so that memory routing respects the
|
|
920
|
+
* project/branch scope a session is operating in (rule 42 — read + write
|
|
921
|
+
* through the same namespace layer).
|
|
922
|
+
*/
|
|
923
|
+
private readonly _codingContextBySession;
|
|
782
924
|
private routingRulesStore;
|
|
783
925
|
private contentHashIndex;
|
|
784
926
|
private readonly artifactSourceStatusCache;
|
|
@@ -808,6 +950,7 @@ declare class Orchestrator {
|
|
|
808
950
|
private runtimePolicyValues;
|
|
809
951
|
private utilityRuntimeValues;
|
|
810
952
|
private evalShadowWriteChain;
|
|
953
|
+
private directAnswerObservationChain;
|
|
811
954
|
private initPromise;
|
|
812
955
|
private resolveInit;
|
|
813
956
|
/**
|
|
@@ -840,12 +983,76 @@ declare class Orchestrator {
|
|
|
840
983
|
* promptly on shutdown. Safe to call multiple times or before init.
|
|
841
984
|
*/
|
|
842
985
|
abortDeferredInit(): void;
|
|
986
|
+
private disposeSearchBackendIfNeeded;
|
|
843
987
|
/** Set per-session workspace for the next recall() call (compaction reset). @internal */
|
|
844
988
|
setRecallWorkspaceOverride(sessionKey: string, dir: string): void;
|
|
845
989
|
/** Remove a per-session workspace override (cleanup on error or early return). @internal */
|
|
846
990
|
clearRecallWorkspaceOverride(sessionKey: string): void;
|
|
847
991
|
resolvePrincipal(sessionKey?: string): string;
|
|
848
992
|
resolveSelfNamespace(sessionKey?: string): string;
|
|
993
|
+
/**
|
|
994
|
+
* Attach a coding-agent context to a session (issue #569). Called by the
|
|
995
|
+
* Claude Code / Codex / Cursor connectors at session start after
|
|
996
|
+
* `resolveGitContext(cwd)`. The context is consulted by the recall path
|
|
997
|
+
* and the write path so that memories route to a project- (and optionally
|
|
998
|
+
* branch-) scoped namespace.
|
|
999
|
+
*
|
|
1000
|
+
* Pass `null` to clear.
|
|
1001
|
+
*/
|
|
1002
|
+
setCodingContextForSession(sessionKey: string, codingContext: CodingContext | null): void;
|
|
1003
|
+
/**
|
|
1004
|
+
* Read-only accessor for the coding context attached to a session. Returns
|
|
1005
|
+
* `null` when none is set. Used by `remnic doctor` and by tests.
|
|
1006
|
+
*
|
|
1007
|
+
* Defensive `_codingContextBySession` lookup — legacy orchestrator-flush
|
|
1008
|
+
* tests use `Object.create(Orchestrator.prototype)` which does not run
|
|
1009
|
+
* class-field initializers, so the Map may be undefined on stubs.
|
|
1010
|
+
*/
|
|
1011
|
+
getCodingContextForSession(sessionKey: string | undefined): CodingContext | null;
|
|
1012
|
+
/**
|
|
1013
|
+
* Shared helper used by both the recall path and the write path (rule 42).
|
|
1014
|
+
*
|
|
1015
|
+
* Given a base namespace computed from the principal, returns the overlaid
|
|
1016
|
+
* coding namespace when the session has a coding context AND
|
|
1017
|
+
* `codingMode.projectScope` is true AND `namespacesEnabled` is true.
|
|
1018
|
+
* Otherwise returns `baseNamespace` unchanged — CLAUDE.md #30 escape hatch.
|
|
1019
|
+
*
|
|
1020
|
+
* Principal isolation (CLAUDE.md rule 42): the overlay is COMBINED with
|
|
1021
|
+
* the principal-derived `baseNamespace` rather than replacing it, so two
|
|
1022
|
+
* principals working in the same repository do not share memories through
|
|
1023
|
+
* a common `project-*` namespace.
|
|
1024
|
+
*
|
|
1025
|
+
* Namespaces-disabled gate: when `namespacesEnabled` is false, the
|
|
1026
|
+
* storage router maps every namespace to the same `memoryDir`. Returning
|
|
1027
|
+
* `project-*` in that mode would create apparent route separation with
|
|
1028
|
+
* no actual storage isolation — a false-isolation trap. In that mode we
|
|
1029
|
+
* return `baseNamespace` unchanged so coding mode degrades to the existing
|
|
1030
|
+
* unscoped behavior.
|
|
1031
|
+
*
|
|
1032
|
+
* @internal
|
|
1033
|
+
*/
|
|
1034
|
+
applyCodingNamespaceOverlay(sessionKey: string | undefined, baseNamespace: string): string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Read-side overlay: returns the list of namespaces a session should read
|
|
1037
|
+
* from, including any read fallbacks (branch → project asymmetry lands in
|
|
1038
|
+
* PR 3; PR 2 returns an empty fallbacks list).
|
|
1039
|
+
*
|
|
1040
|
+
* Returns `null` when:
|
|
1041
|
+
* - `namespacesEnabled` is false (overlay would create false isolation)
|
|
1042
|
+
* - no context attached to the session
|
|
1043
|
+
* - `codingMode.projectScope` is false (CLAUDE.md #30 escape hatch)
|
|
1044
|
+
*
|
|
1045
|
+
* The returned `namespace` / `readFallbacks` are RAW overlay fragments
|
|
1046
|
+
* (e.g. `project-origin-ab12`). Callers MUST combine them with the
|
|
1047
|
+
* principal-derived base through `combineNamespaces()` before passing to
|
|
1048
|
+
* storage, so principal isolation is preserved (rule 42).
|
|
1049
|
+
*
|
|
1050
|
+
* @internal
|
|
1051
|
+
*/
|
|
1052
|
+
applyCodingRecallOverlay(sessionKey: string | undefined): {
|
|
1053
|
+
namespace: string;
|
|
1054
|
+
readFallbacks: string[];
|
|
1055
|
+
} | null;
|
|
849
1056
|
getStorageForNamespace(namespace?: string): Promise<StorageManager>;
|
|
850
1057
|
private configuredNamespaces;
|
|
851
1058
|
private buildConfiguredQmdSearchOptions;
|
|
@@ -1042,6 +1249,23 @@ declare class Orchestrator {
|
|
|
1042
1249
|
*/
|
|
1043
1250
|
private validateLocalLlmModel;
|
|
1044
1251
|
recall(prompt: string, sessionKey?: string, options?: RecallInvocationOptions): Promise<string>;
|
|
1252
|
+
/**
|
|
1253
|
+
* Return the most recent X-ray snapshot captured during a
|
|
1254
|
+
* `recall()` call that passed `xrayCapture: true` (issue #570 PR 1).
|
|
1255
|
+
* Returns `null` when no such capture has occurred on this
|
|
1256
|
+
* orchestrator instance. Returned snapshot is a deep copy so
|
|
1257
|
+
* caller mutation cannot tear the stored value.
|
|
1258
|
+
*/
|
|
1259
|
+
getLastXraySnapshot(): RecallXraySnapshot | null;
|
|
1260
|
+
/** Clear the captured X-ray snapshot. Exposed for tests / explicit reset. */
|
|
1261
|
+
clearLastXraySnapshot(): void;
|
|
1262
|
+
/**
|
|
1263
|
+
* Await the in-flight observation-mode direct-answer annotation chain.
|
|
1264
|
+
* Resolves to true when settled, false on timeout.
|
|
1265
|
+
*/
|
|
1266
|
+
waitForDirectAnswerObservationIdle(timeoutMs?: number): Promise<boolean>;
|
|
1267
|
+
private enqueueDirectAnswerObservation;
|
|
1268
|
+
private annotateDirectAnswerTier;
|
|
1045
1269
|
private logRecallFailure;
|
|
1046
1270
|
private artifactTypeForCategory;
|
|
1047
1271
|
private truncateArtifactForRecall;
|
|
@@ -1278,6 +1502,7 @@ declare class Orchestrator {
|
|
|
1278
1502
|
*
|
|
1279
1503
|
* Callers must pass the full candidate pool (post-rerank, pre-slice).
|
|
1280
1504
|
*/
|
|
1505
|
+
private applyMemoryWorthRerank;
|
|
1281
1506
|
private diversifyAndLimitRecallResults;
|
|
1282
1507
|
/**
|
|
1283
1508
|
* Apply Maximal Marginal Relevance to a section's ordered candidate list.
|
|
@@ -1305,7 +1530,7 @@ declare class Orchestrator {
|
|
|
1305
1530
|
* path prefix (and, for the legacy default-namespace layout at
|
|
1306
1531
|
* `memoryDir` root, an exclusion list for `namespaces/*`).
|
|
1307
1532
|
*/
|
|
1308
|
-
|
|
1533
|
+
semanticDedupLookup(content: string, limit: number, targetStorage: StorageManager): Promise<SemanticDedupHit[]>;
|
|
1309
1534
|
/**
|
|
1310
1535
|
* Resolve the namespace-scoped filter to pass into
|
|
1311
1536
|
* `EmbeddingFallback.search()` for semantic dedup. Returns an empty
|
|
@@ -1365,4 +1590,4 @@ declare class Orchestrator {
|
|
|
1365
1590
|
private readArchivedMemoriesForNamespaces;
|
|
1366
1591
|
}
|
|
1367
1592
|
|
|
1368
|
-
export {
|
|
1593
|
+
export { summarizeGraphShadowComparison as $, computeArtifactCandidateFetchLimit as A, type BulkImportSource as B, type CompoundingPromotionReport as C, computeArtifactRecallLimit as D, computeQmdHybridFetchLimit as E, dedupeEntitySynthesisEvidenceEntries as F, type GraphRecallSnapshot as G, deriveTopicsFromExtraction as H, type IntentDebugSnapshot as I, filterRecallCandidates as J, formatCompressionGuidelinesForRecall as K, graphPathRelativeToStorage as L, hasIdentityRecoveryIntent as M, isArtifactMemoryPath as N, Orchestrator as O, lifecycleRecallScoreAdjustment as P, type QmdRecallSnapshot as Q, type ReplaySource as R, type SemanticDedupLookup as S, mergeArtifactRecallCandidates as T, mergeGraphExpandedResults as U, resolveEffectiveIdentityInjectionMode as V, resolveEffectiveRecallMode as W, resolvePersistedMemoryRelativePath as X, resolveRecallModeDecision as Y, resolveRecentThreadMemoryPaths as Z, shouldFilterLifecycleRecallCandidate as _, type ReplayWarning as a, type ImportTurn as b, type BulkImportOptions as c, type BulkImportResult as d, type ReplayTurn as e, type BulkImportSourceAdapter as f, type BulkImportError as g, type ImportSourceRole as h, type ImportTurnValidationIssue as i, type SemanticDedupDecision as j, type SemanticDedupHit as k, type SemanticDedupOptions as l, decideSemanticDedup as m, defaultWorkspaceDir as n, isImportRole as o, parseIsoTimestamp as p, type GraphRecallRankedResult as q, type GraphRecallShadowComparison as r, sanitizeSessionKeyForFilename as s, type RecallInvocationOptions as t, type RecallModeDecision as u, validateImportTurn as v, appendMemoryToGraphContext as w, blendGraphExpandedRecallScore as x, buildCompressionGuidelinesMarkdown as y, buildMemoryPathById as z };
|
package/dist/orchestrator.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import './buffer.js';
|
|
2
|
-
import './port-
|
|
2
|
+
import './port-BADbLZU5.js';
|
|
3
3
|
import './storage.js';
|
|
4
4
|
import './transcript.js';
|
|
5
5
|
import './summarizer.js';
|
|
6
6
|
import './local-llm.js';
|
|
7
|
+
import './fallback-llm.js';
|
|
7
8
|
import './model-registry.js';
|
|
8
9
|
import './relevance.js';
|
|
9
10
|
import './negative.js';
|
|
10
11
|
import './recall-state.js';
|
|
12
|
+
import './recall-xray.js';
|
|
11
13
|
import './session-observer-state.js';
|
|
12
14
|
import './embedding-fallback.js';
|
|
13
|
-
export {
|
|
15
|
+
export { q as GraphRecallRankedResult, r as GraphRecallShadowComparison, G as GraphRecallSnapshot, I as IntentDebugSnapshot, O as Orchestrator, Q as QmdRecallSnapshot, t as RecallInvocationOptions, u as RecallModeDecision, w as appendMemoryToGraphContext, x as blendGraphExpandedRecallScore, y as buildCompressionGuidelinesMarkdown, z as buildMemoryPathById, A as computeArtifactCandidateFetchLimit, D as computeArtifactRecallLimit, E as computeQmdHybridFetchLimit, F as dedupeEntitySynthesisEvidenceEntries, n as defaultWorkspaceDir, H as deriveTopicsFromExtraction, J as filterRecallCandidates, K as formatCompressionGuidelinesForRecall, L as graphPathRelativeToStorage, M as hasIdentityRecoveryIntent, N as isArtifactMemoryPath, P as lifecycleRecallScoreAdjustment, T as mergeArtifactRecallCandidates, U as mergeGraphExpandedResults, V as resolveEffectiveIdentityInjectionMode, W as resolveEffectiveRecallMode, X as resolvePersistedMemoryRelativePath, Y as resolveRecallModeDecision, Z as resolveRecentThreadMemoryPaths, s as sanitizeSessionKeyForFilename, _ as shouldFilterLifecycleRecallCandidate, $ as summarizeGraphShadowComparison } from './orchestrator-CmJ-NTdJ.js';
|
|
14
16
|
import './types.js';
|
|
15
|
-
import './semantic-consolidation-
|
|
17
|
+
import './semantic-consolidation-CxJU6MJk.js';
|
|
16
18
|
import './policy-runtime.js';
|
|
17
19
|
import './profiling.js';
|
|
18
20
|
import './page-versioning.js';
|
|
21
|
+
import './consolidation-operator.js';
|
|
19
22
|
import './memory-projection-store-DeSXPh1j.js';
|
|
20
23
|
import 'better-sqlite3';
|
|
21
24
|
import './session-integrity.js';
|