@remnic/core 10.0.7 → 10.0.9
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 +40 -39
- package/dist/access-authorization-probe.js +41 -40
- package/dist/access-boundary.js +40 -39
- package/dist/access-cli.js +97 -96
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +40 -39
- package/dist/access-http-briefing.js +41 -40
- package/dist/access-http-query.js +42 -41
- package/dist/access-http.js +61 -60
- package/dist/access-identity-continuity-surface.js +40 -39
- package/dist/access-lcm-surface.js +40 -39
- package/dist/access-mcp.js +50 -49
- package/dist/access-namespace-preflight.js +40 -39
- package/dist/access-observe-write-category.js +8 -8
- package/dist/access-observe-write-surface.js +40 -39
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +41 -40
- package/dist/access-operations.js +48 -47
- package/dist/access-recall-concurrency.js +40 -39
- package/dist/access-recall-response.js +40 -39
- package/dist/access-recall-surface.js +40 -39
- package/dist/access-schema.js +7 -7
- package/dist/access-service.js +40 -39
- package/dist/access-surface-catalog.js +42 -41
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/active-recall.js +13 -13
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/briefing.js +10 -10
- package/dist/buffer.js +6 -6
- package/dist/causal-consolidation.js +11 -11
- package/dist/{chunk-B2UK6O2O.js → chunk-2K7D6EFT.js} +2 -2
- package/dist/{chunk-Z4CETAL7.js → chunk-3ENX2RB4.js} +2 -2
- package/dist/{chunk-TPNCVFVI.js → chunk-3NFN4Y4P.js} +4 -4
- package/dist/{chunk-HHE57I2Z.js → chunk-3R6SLDTH.js} +2 -2
- package/dist/{chunk-WUUE2I2A.js → chunk-3VTNNO2B.js} +4 -4
- package/dist/{chunk-ODGXQUPR.js → chunk-4OKPH6FG.js} +2 -2
- package/dist/{chunk-M4MAVJJX.js → chunk-55ZVZBX4.js} +2 -2
- package/dist/{chunk-VQBGV44L.js → chunk-5EOV7ANU.js} +2 -2
- package/dist/{chunk-JH4XB3RX.js → chunk-5FNVK7MW.js} +2 -2
- package/dist/{chunk-2SKI5ZSH.js → chunk-5NOPZYNI.js} +7 -7
- package/dist/{chunk-E3OSDZ6M.js → chunk-5Q4NQNW7.js} +2 -2
- package/dist/chunk-5VC7J76U.js +134 -0
- package/dist/chunk-5VC7J76U.js.map +1 -0
- package/dist/{chunk-YMVLPVQP.js → chunk-6PHB45IU.js} +2 -2
- package/dist/{chunk-QHL33ZDS.js → chunk-76KHEHT2.js} +2 -2
- package/dist/{chunk-PBYY4WYM.js → chunk-7O252IE6.js} +2 -2
- package/dist/{chunk-5GN5LRQW.js → chunk-7OAIOE5P.js} +2 -2
- package/dist/{chunk-YV54LYEB.js → chunk-7UX44C4N.js} +2 -2
- package/dist/{chunk-VBNIQ6H2.js → chunk-A6G7K273.js} +3 -3
- package/dist/{chunk-NJTW2MUV.js → chunk-AAM66QCP.js} +5 -5
- package/dist/{chunk-Q67D4JYB.js → chunk-AMFCRZYB.js} +2 -2
- package/dist/{chunk-KMAHEIOH.js → chunk-AV46CT77.js} +2 -2
- package/dist/{chunk-7PZHH4KC.js → chunk-AZEZSQ5R.js} +23 -2
- package/dist/chunk-AZEZSQ5R.js.map +1 -0
- package/dist/{chunk-DSVRW5BD.js → chunk-BPY4RRTF.js} +14 -14
- package/dist/{chunk-BSWHZJSP.js → chunk-C3WJNRGR.js} +2 -2
- package/dist/{chunk-ZBDTSFRA.js → chunk-CBP4HWCL.js} +3 -3
- package/dist/{chunk-D6C4JWSN.js → chunk-CSUAHUOH.js} +2 -2
- package/dist/{chunk-JALYQUYO.js → chunk-DGRMWDQY.js} +12 -12
- package/dist/{chunk-4EHA327M.js → chunk-DXHVD4DS.js} +3 -3
- package/dist/{chunk-CRYAYFUE.js → chunk-E5274WUC.js} +2 -2
- package/dist/{chunk-OCIJYYCA.js → chunk-FBVLTTVV.js} +6 -6
- package/dist/{chunk-CG2E6WT5.js → chunk-GDI64ITR.js} +3 -3
- package/dist/{chunk-Z5IQTRDN.js → chunk-GSAZBZMA.js} +2 -2
- package/dist/{chunk-IE2J3V5N.js → chunk-HZVYDWUP.js} +2 -2
- package/dist/{chunk-MHGHEBTR.js → chunk-IJWEXCWF.js} +2 -2
- package/dist/{chunk-VIPGYPEG.js → chunk-IOM5QSNR.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-XKEDESWC.js → chunk-JK3DYMOC.js} +2 -2
- package/dist/{chunk-ETGXRGSR.js → chunk-JSIQSZXI.js} +3 -3
- package/dist/{chunk-F2QIPGTG.js → chunk-JTUKDLAD.js} +2 -2
- package/dist/{chunk-M6PEFWJ4.js → chunk-K3DZ3G5I.js} +2 -2
- package/dist/{chunk-TVRTJZQ5.js → chunk-KDYQYMJZ.js} +2 -2
- package/dist/{chunk-JFGX2DKT.js → chunk-KRIEQCKE.js} +2 -2
- package/dist/{chunk-FRRR4KOW.js → chunk-L3Z4NXDO.js} +3 -3
- package/dist/{chunk-T5XG6GQI.js → chunk-LOFVW6JA.js} +2 -2
- package/dist/{chunk-GTSQJTNS.js → chunk-MAJ2OKE4.js} +8 -8
- package/dist/{chunk-J5QL66XK.js → chunk-MB5EJ2CT.js} +5 -5
- package/dist/{chunk-RVJPY6E4.js → chunk-MVRIW6MI.js} +2 -2
- package/dist/{chunk-QWDH4QNA.js → chunk-MZBWIJJN.js} +8 -8
- package/dist/{chunk-OH75RBYF.js → chunk-N44GZ73R.js} +7 -7
- package/dist/{chunk-YBSWXKCH.js → chunk-N6UMXWBA.js} +2 -2
- package/dist/{chunk-2PBZBNY7.js → chunk-NAHUBSUF.js} +2 -2
- package/dist/{chunk-Z2ZUV6FE.js → chunk-NXLQQ6WI.js} +2 -2
- package/dist/{chunk-QF7XX74D.js → chunk-NYVKLB2I.js} +28 -28
- package/dist/{chunk-V4ACBX3C.js → chunk-OC6JYPZX.js} +21 -44
- package/dist/chunk-OC6JYPZX.js.map +1 -0
- package/dist/{chunk-645A37SC.js → chunk-P2S6P7X6.js} +2 -2
- package/dist/{chunk-PXTZOU5F.js → chunk-PBVNVKYN.js} +2 -2
- package/dist/{chunk-3DSRYRGR.js → chunk-QFIPSKPC.js} +2 -2
- package/dist/{chunk-GH5R5BIH.js → chunk-QN77HA6P.js} +2 -2
- package/dist/{chunk-IJU2ZWPE.js → chunk-QW7G7PWN.js} +2 -2
- package/dist/{chunk-3GLQUOL2.js → chunk-R2AWYR4Q.js} +2 -2
- package/dist/{chunk-YRULQW5J.js → chunk-RBJQYMMT.js} +4 -4
- package/dist/{chunk-EBQCVOGC.js → chunk-RH6QEGCT.js} +2 -2
- package/dist/{chunk-PO6MNTWH.js → chunk-RNPJ4GQA.js} +2 -2
- package/dist/{chunk-YNSHGVXT.js → chunk-S4GUMZRB.js} +31 -31
- package/dist/{chunk-5O4UJ6PM.js → chunk-SQ2O52SU.js} +2 -2
- package/dist/{chunk-Y6IHIORY.js → chunk-V4WSQYO6.js} +63 -63
- package/dist/{chunk-Y6IHIORY.js.map → chunk-V4WSQYO6.js.map} +1 -1
- package/dist/{chunk-65FYHYBE.js → chunk-VSHRMIJH.js} +2 -2
- package/dist/{chunk-Y7427SL7.js → chunk-WCGJK4NQ.js} +4 -4
- package/dist/{chunk-OX5LMCEQ.js → chunk-WJLGUY27.js} +11 -11
- package/dist/{chunk-UL7WKKGZ.js → chunk-WPFSZZ35.js} +2 -2
- package/dist/{chunk-64S6X4IU.js → chunk-XTN54NML.js} +4 -4
- package/dist/{chunk-UTXWLTX5.js → chunk-YAF3NRNC.js} +2 -2
- package/dist/{chunk-BR75HFPC.js → chunk-ZQYAE2C5.js} +2 -2
- package/dist/cli.js +74 -73
- package/dist/coding/export-okf-codegraph.js +9 -9
- package/dist/compounding/engine.js +10 -10
- package/dist/config.js +13 -13
- package/dist/connectors/codex-materialize-runner.js +10 -10
- package/dist/connectors/index.js +10 -10
- package/dist/convergence-refresh.js +12 -12
- package/dist/corpus-watermark.js +12 -12
- package/dist/deep-recall-http-glue.js +8 -8
- package/dist/deep-recall.js +2 -2
- package/dist/entity-retrieval.js +10 -10
- package/dist/external-wiki-access.js +41 -40
- package/dist/extraction.js +14 -14
- package/dist/harmonic-retrieval.d.ts.map +1 -1
- package/dist/harmonic-retrieval.js +12 -11
- package/dist/harmonic-source-lookup.d.ts +14 -0
- package/dist/harmonic-source-lookup.d.ts.map +1 -0
- package/dist/harmonic-source-lookup.js +22 -0
- package/dist/harmonic-source-lookup.js.map +1 -0
- package/dist/index.js +109 -108
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/location/index.js +12 -12
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection-runner.js +12 -12
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/memory-browse-operations.js +41 -40
- package/dist/memory-browse.js +6 -6
- package/dist/memory-projection-batch.d.ts +2 -0
- package/dist/memory-projection-batch.d.ts.map +1 -1
- package/dist/memory-projection-batch.js +4 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.js +10 -10
- package/dist/offline-sync-changeset-generations.js +3 -3
- package/dist/offline-sync-embedding-generation.js +2 -2
- package/dist/offline-sync-snapshot-stream.js +5 -5
- package/dist/offline-sync.js +6 -6
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-toolkit.js +22 -22
- package/dist/orchestration/maintenance.js +19 -19
- package/dist/orchestrator.js +97 -96
- package/dist/qmd.js +6 -6
- package/dist/recall-navigation-operations.js +41 -40
- package/dist/recall-navigation.js +40 -39
- package/dist/recall-state-view-admission.js +6 -6
- package/dist/recall-why-service.js +6 -6
- package/dist/resume-bundles.js +13 -13
- package/dist/search/factory.js +5 -5
- package/dist/search/index.js +7 -7
- package/dist/semantic-consolidation.js +11 -11
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/source-agent-qualifier.js +13 -13
- package/dist/standup/build.js +10 -10
- package/dist/storage.js +9 -9
- package/dist/support-passport/index.js +43 -42
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/export-okf.js +10 -10
- package/dist/verified-recall.js +10 -10
- package/dist/who-knows-cli.js +11 -11
- package/dist/who-knows.js +10 -10
- package/package.json +2 -2
- package/src/harmonic-retrieval.ts +12 -64
- package/src/harmonic-source-lookup.test.ts +178 -0
- package/src/harmonic-source-lookup.ts +142 -0
- package/src/memory-projection-batch.ts +20 -0
- package/src/orchestration/recall-internal.ts +12 -12
- package/src/recall-harmonic-qmd-ordering.test.ts +304 -0
- package/dist/chunk-7PZHH4KC.js.map +0 -1
- package/dist/chunk-V4ACBX3C.js.map +0 -1
- /package/dist/{chunk-B2UK6O2O.js.map → chunk-2K7D6EFT.js.map} +0 -0
- /package/dist/{chunk-Z4CETAL7.js.map → chunk-3ENX2RB4.js.map} +0 -0
- /package/dist/{chunk-TPNCVFVI.js.map → chunk-3NFN4Y4P.js.map} +0 -0
- /package/dist/{chunk-HHE57I2Z.js.map → chunk-3R6SLDTH.js.map} +0 -0
- /package/dist/{chunk-WUUE2I2A.js.map → chunk-3VTNNO2B.js.map} +0 -0
- /package/dist/{chunk-ODGXQUPR.js.map → chunk-4OKPH6FG.js.map} +0 -0
- /package/dist/{chunk-M4MAVJJX.js.map → chunk-55ZVZBX4.js.map} +0 -0
- /package/dist/{chunk-VQBGV44L.js.map → chunk-5EOV7ANU.js.map} +0 -0
- /package/dist/{chunk-JH4XB3RX.js.map → chunk-5FNVK7MW.js.map} +0 -0
- /package/dist/{chunk-2SKI5ZSH.js.map → chunk-5NOPZYNI.js.map} +0 -0
- /package/dist/{chunk-E3OSDZ6M.js.map → chunk-5Q4NQNW7.js.map} +0 -0
- /package/dist/{chunk-YMVLPVQP.js.map → chunk-6PHB45IU.js.map} +0 -0
- /package/dist/{chunk-QHL33ZDS.js.map → chunk-76KHEHT2.js.map} +0 -0
- /package/dist/{chunk-PBYY4WYM.js.map → chunk-7O252IE6.js.map} +0 -0
- /package/dist/{chunk-5GN5LRQW.js.map → chunk-7OAIOE5P.js.map} +0 -0
- /package/dist/{chunk-YV54LYEB.js.map → chunk-7UX44C4N.js.map} +0 -0
- /package/dist/{chunk-VBNIQ6H2.js.map → chunk-A6G7K273.js.map} +0 -0
- /package/dist/{chunk-NJTW2MUV.js.map → chunk-AAM66QCP.js.map} +0 -0
- /package/dist/{chunk-Q67D4JYB.js.map → chunk-AMFCRZYB.js.map} +0 -0
- /package/dist/{chunk-KMAHEIOH.js.map → chunk-AV46CT77.js.map} +0 -0
- /package/dist/{chunk-DSVRW5BD.js.map → chunk-BPY4RRTF.js.map} +0 -0
- /package/dist/{chunk-BSWHZJSP.js.map → chunk-C3WJNRGR.js.map} +0 -0
- /package/dist/{chunk-ZBDTSFRA.js.map → chunk-CBP4HWCL.js.map} +0 -0
- /package/dist/{chunk-D6C4JWSN.js.map → chunk-CSUAHUOH.js.map} +0 -0
- /package/dist/{chunk-JALYQUYO.js.map → chunk-DGRMWDQY.js.map} +0 -0
- /package/dist/{chunk-4EHA327M.js.map → chunk-DXHVD4DS.js.map} +0 -0
- /package/dist/{chunk-CRYAYFUE.js.map → chunk-E5274WUC.js.map} +0 -0
- /package/dist/{chunk-OCIJYYCA.js.map → chunk-FBVLTTVV.js.map} +0 -0
- /package/dist/{chunk-CG2E6WT5.js.map → chunk-GDI64ITR.js.map} +0 -0
- /package/dist/{chunk-Z5IQTRDN.js.map → chunk-GSAZBZMA.js.map} +0 -0
- /package/dist/{chunk-IE2J3V5N.js.map → chunk-HZVYDWUP.js.map} +0 -0
- /package/dist/{chunk-MHGHEBTR.js.map → chunk-IJWEXCWF.js.map} +0 -0
- /package/dist/{chunk-VIPGYPEG.js.map → chunk-IOM5QSNR.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-XKEDESWC.js.map → chunk-JK3DYMOC.js.map} +0 -0
- /package/dist/{chunk-ETGXRGSR.js.map → chunk-JSIQSZXI.js.map} +0 -0
- /package/dist/{chunk-F2QIPGTG.js.map → chunk-JTUKDLAD.js.map} +0 -0
- /package/dist/{chunk-M6PEFWJ4.js.map → chunk-K3DZ3G5I.js.map} +0 -0
- /package/dist/{chunk-TVRTJZQ5.js.map → chunk-KDYQYMJZ.js.map} +0 -0
- /package/dist/{chunk-JFGX2DKT.js.map → chunk-KRIEQCKE.js.map} +0 -0
- /package/dist/{chunk-FRRR4KOW.js.map → chunk-L3Z4NXDO.js.map} +0 -0
- /package/dist/{chunk-T5XG6GQI.js.map → chunk-LOFVW6JA.js.map} +0 -0
- /package/dist/{chunk-GTSQJTNS.js.map → chunk-MAJ2OKE4.js.map} +0 -0
- /package/dist/{chunk-J5QL66XK.js.map → chunk-MB5EJ2CT.js.map} +0 -0
- /package/dist/{chunk-RVJPY6E4.js.map → chunk-MVRIW6MI.js.map} +0 -0
- /package/dist/{chunk-QWDH4QNA.js.map → chunk-MZBWIJJN.js.map} +0 -0
- /package/dist/{chunk-OH75RBYF.js.map → chunk-N44GZ73R.js.map} +0 -0
- /package/dist/{chunk-YBSWXKCH.js.map → chunk-N6UMXWBA.js.map} +0 -0
- /package/dist/{chunk-2PBZBNY7.js.map → chunk-NAHUBSUF.js.map} +0 -0
- /package/dist/{chunk-Z2ZUV6FE.js.map → chunk-NXLQQ6WI.js.map} +0 -0
- /package/dist/{chunk-QF7XX74D.js.map → chunk-NYVKLB2I.js.map} +0 -0
- /package/dist/{chunk-645A37SC.js.map → chunk-P2S6P7X6.js.map} +0 -0
- /package/dist/{chunk-PXTZOU5F.js.map → chunk-PBVNVKYN.js.map} +0 -0
- /package/dist/{chunk-3DSRYRGR.js.map → chunk-QFIPSKPC.js.map} +0 -0
- /package/dist/{chunk-GH5R5BIH.js.map → chunk-QN77HA6P.js.map} +0 -0
- /package/dist/{chunk-IJU2ZWPE.js.map → chunk-QW7G7PWN.js.map} +0 -0
- /package/dist/{chunk-3GLQUOL2.js.map → chunk-R2AWYR4Q.js.map} +0 -0
- /package/dist/{chunk-YRULQW5J.js.map → chunk-RBJQYMMT.js.map} +0 -0
- /package/dist/{chunk-EBQCVOGC.js.map → chunk-RH6QEGCT.js.map} +0 -0
- /package/dist/{chunk-PO6MNTWH.js.map → chunk-RNPJ4GQA.js.map} +0 -0
- /package/dist/{chunk-YNSHGVXT.js.map → chunk-S4GUMZRB.js.map} +0 -0
- /package/dist/{chunk-5O4UJ6PM.js.map → chunk-SQ2O52SU.js.map} +0 -0
- /package/dist/{chunk-65FYHYBE.js.map → chunk-VSHRMIJH.js.map} +0 -0
- /package/dist/{chunk-Y7427SL7.js.map → chunk-WCGJK4NQ.js.map} +0 -0
- /package/dist/{chunk-OX5LMCEQ.js.map → chunk-WJLGUY27.js.map} +0 -0
- /package/dist/{chunk-UL7WKKGZ.js.map → chunk-WPFSZZ35.js.map} +0 -0
- /package/dist/{chunk-64S6X4IU.js.map → chunk-XTN54NML.js.map} +0 -0
- /package/dist/{chunk-UTXWLTX5.js.map → chunk-YAF3NRNC.js.map} +0 -0
- /package/dist/{chunk-BR75HFPC.js.map → chunk-ZQYAE2C5.js.map} +0 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// #3188: park only harmonic's source read and observe real QMD publication.
|
|
2
|
+
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import type { TestContext } from "node:test";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
|
|
8
|
+
import { recordAbstractionNode } from "./abstraction-nodes.js";
|
|
9
|
+
import { parseConfig } from "./config.js";
|
|
10
|
+
import { rebuildMemoryProjection } from "./maintenance/rebuild-memory-projection.js";
|
|
11
|
+
import { Orchestrator } from "./orchestrator.js";
|
|
12
|
+
import {
|
|
13
|
+
RecallSectionCoordinator,
|
|
14
|
+
type RecallSectionAppendOptions,
|
|
15
|
+
type RecallSectionBuckets,
|
|
16
|
+
} from "./orchestration/recall-section-coordinator.js";
|
|
17
|
+
import { getRecallTimings } from "./recall-timings.js";
|
|
18
|
+
import type { RecallInternalCoordinator } from "./orchestration/recall-internal.js";
|
|
19
|
+
import { StorageManager } from "./storage.js";
|
|
20
|
+
import type { SearchBackend } from "./search/port.js";
|
|
21
|
+
import { cleanupDir, eventually, mkTempMemoryDir } from "./testing/orchestrator-lite.js";
|
|
22
|
+
import type { MemoryFile, PluginConfig, QmdSearchResult } from "./types.js";
|
|
23
|
+
|
|
24
|
+
const RECALL_PROMPT = "how does the atlas source lookup behave?";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Complete typed SearchBackend stub (no casts): answers availability and
|
|
28
|
+
* returns one settled QMD candidate from `search`; every other read surface
|
|
29
|
+
* is empty. Mirrors the recall-hardening backend-stub shape.
|
|
30
|
+
*/
|
|
31
|
+
function settledQmdBackend(result: QmdSearchResult): SearchBackend {
|
|
32
|
+
return {
|
|
33
|
+
async probe() {
|
|
34
|
+
return true;
|
|
35
|
+
},
|
|
36
|
+
isAvailable() {
|
|
37
|
+
return true;
|
|
38
|
+
},
|
|
39
|
+
debugStatus() {
|
|
40
|
+
return "backend=settled-qmd-stub";
|
|
41
|
+
},
|
|
42
|
+
async search() {
|
|
43
|
+
return [result];
|
|
44
|
+
},
|
|
45
|
+
async searchGlobal() {
|
|
46
|
+
return [];
|
|
47
|
+
},
|
|
48
|
+
async bm25Search() {
|
|
49
|
+
return [];
|
|
50
|
+
},
|
|
51
|
+
async vectorSearch() {
|
|
52
|
+
return [];
|
|
53
|
+
},
|
|
54
|
+
async hybridSearch() {
|
|
55
|
+
return [];
|
|
56
|
+
},
|
|
57
|
+
async update() {},
|
|
58
|
+
async updateCollection() {},
|
|
59
|
+
async embed() {},
|
|
60
|
+
async embedCollection() {},
|
|
61
|
+
async ensureCollection() {
|
|
62
|
+
return "present";
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface OrderingHarness {
|
|
68
|
+
memoryDir: string;
|
|
69
|
+
orchestrator: Orchestrator;
|
|
70
|
+
config: PluginConfig;
|
|
71
|
+
qmdMemory: MemoryFile;
|
|
72
|
+
harmonicSource: MemoryFile;
|
|
73
|
+
/** Releases the parked harmonic source read (idempotent). */
|
|
74
|
+
releaseHarmonicRead: () => void;
|
|
75
|
+
/** Section ids in append order, via the section coordinator prototype. */
|
|
76
|
+
appendedSectionIds: string[];
|
|
77
|
+
/** How often the harmonic source read was asked for (and parked). */
|
|
78
|
+
harmonicReadCalls: { count: number };
|
|
79
|
+
recall: () => Promise<string>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Seed two active memories — one returned as the settled QMD candidate, one
|
|
84
|
+
* projected into a real abstraction-node store row — then boot the real
|
|
85
|
+
* orchestrator over them. The projection rebuild keeps the harmonic read on
|
|
86
|
+
* the indexed exact-path branch, so intercepting that one
|
|
87
|
+
* `StorageManager.readMemoryByPath` call parks harmonic and nothing else.
|
|
88
|
+
*/
|
|
89
|
+
async function makeOrderingHarness(
|
|
90
|
+
t: TestContext,
|
|
91
|
+
mode: "park" | "fail",
|
|
92
|
+
): Promise<OrderingHarness> {
|
|
93
|
+
const memoryDir = await mkTempMemoryDir("recall-harmonic-order-");
|
|
94
|
+
const storage = new StorageManager(memoryDir);
|
|
95
|
+
await storage.ensureDirectories();
|
|
96
|
+
|
|
97
|
+
const { memory: qmdMemory } = await storage.writeMemory(
|
|
98
|
+
"fact",
|
|
99
|
+
"the atlas qmd sentinel confirms deployment cadence",
|
|
100
|
+
{ source: "test" },
|
|
101
|
+
);
|
|
102
|
+
const { memory: harmonicSource } = await storage.writeMemory(
|
|
103
|
+
"fact",
|
|
104
|
+
"atlas harmonic source lookup body",
|
|
105
|
+
{ source: "test" },
|
|
106
|
+
);
|
|
107
|
+
await recordAbstractionNode({
|
|
108
|
+
memoryDir,
|
|
109
|
+
node: {
|
|
110
|
+
schemaVersion: 1,
|
|
111
|
+
nodeId: "ordering-under-qmd",
|
|
112
|
+
recordedAt: new Date().toISOString(),
|
|
113
|
+
sessionKey: "agent:test",
|
|
114
|
+
kind: "topic",
|
|
115
|
+
abstractionLevel: "meso",
|
|
116
|
+
title: "atlas source lookup",
|
|
117
|
+
summary: "atlas source lookup",
|
|
118
|
+
sourceMemoryIds: [harmonicSource.frontmatter.id],
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
await rebuildMemoryProjection({ memoryDir, storage, dryRun: false });
|
|
122
|
+
|
|
123
|
+
// Defaults only — the ordering fix must not move any budget, and the
|
|
124
|
+
// default candidate/namespace sets stay untouched.
|
|
125
|
+
const config = parseConfig({
|
|
126
|
+
openaiApiKey: "sk-test",
|
|
127
|
+
memoryDir,
|
|
128
|
+
workspaceDir: path.join(memoryDir, "workspace"),
|
|
129
|
+
qmdEnabled: true,
|
|
130
|
+
embeddingFallbackEnabled: false,
|
|
131
|
+
recallPlannerEnabled: false,
|
|
132
|
+
sharedContextEnabled: false,
|
|
133
|
+
harmonicRetrievalEnabled: true,
|
|
134
|
+
queryAwareIndexingEnabled: false,
|
|
135
|
+
parallelRetrievalEnabled: false,
|
|
136
|
+
initGateTimeoutMs: 1000,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const orchestrator = new Orchestrator(config);
|
|
140
|
+
orchestrator.qmd = settledQmdBackend({
|
|
141
|
+
docid: qmdMemory.frontmatter.id,
|
|
142
|
+
path: qmdMemory.path,
|
|
143
|
+
score: 0.9,
|
|
144
|
+
snippet: qmdMemory.content,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const appendedSectionIds: string[] = [];
|
|
148
|
+
const originalAppend = RecallSectionCoordinator.prototype.appendRecallSection;
|
|
149
|
+
t.mock.method(
|
|
150
|
+
RecallSectionCoordinator.prototype,
|
|
151
|
+
"appendRecallSection",
|
|
152
|
+
function recordAppendedSection(
|
|
153
|
+
this: RecallSectionCoordinator,
|
|
154
|
+
sectionBuckets: RecallSectionBuckets,
|
|
155
|
+
sectionId: string,
|
|
156
|
+
content: string,
|
|
157
|
+
options?: RecallSectionAppendOptions,
|
|
158
|
+
): boolean {
|
|
159
|
+
appendedSectionIds.push(sectionId);
|
|
160
|
+
return originalAppend.call(this, sectionBuckets, sectionId, content, options);
|
|
161
|
+
},
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
const harmonicGate = Promise.withResolvers<void>();
|
|
165
|
+
const harmonicReadCalls = { count: 0 };
|
|
166
|
+
const originalRead = StorageManager.prototype.readMemoryByPath;
|
|
167
|
+
const harmonicSourcePath = path.resolve(harmonicSource.path);
|
|
168
|
+
t.mock.method(
|
|
169
|
+
StorageManager.prototype,
|
|
170
|
+
"readMemoryByPath",
|
|
171
|
+
function interceptHarmonicSourceRead(
|
|
172
|
+
this: StorageManager,
|
|
173
|
+
filePath: string,
|
|
174
|
+
): Promise<MemoryFile | null> {
|
|
175
|
+
if (path.resolve(filePath) !== harmonicSourcePath) {
|
|
176
|
+
return originalRead.call(this, filePath);
|
|
177
|
+
}
|
|
178
|
+
if (mode === "fail") {
|
|
179
|
+
return Promise.reject(new Error("synthetic harmonic source read failure"));
|
|
180
|
+
}
|
|
181
|
+
harmonicReadCalls.count += 1;
|
|
182
|
+
return harmonicGate.promise.then(() => originalRead.call(this, filePath));
|
|
183
|
+
},
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// Invoke the existing private delegate without booting background services.
|
|
187
|
+
const recallSeam = orchestrator as unknown as Pick<RecallInternalCoordinator, "recallInternal">
|
|
188
|
+
& Pick<RecallSectionCoordinator, "isRecallSectionEnabled">;
|
|
189
|
+
t.mock.method(recallSeam, "isRecallSectionEnabled", (id: string) =>
|
|
190
|
+
id === "memories" || id === "harmonic-retrieval");
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
memoryDir,
|
|
194
|
+
orchestrator,
|
|
195
|
+
config,
|
|
196
|
+
qmdMemory,
|
|
197
|
+
harmonicSource,
|
|
198
|
+
releaseHarmonicRead: () => harmonicGate.resolve(),
|
|
199
|
+
appendedSectionIds,
|
|
200
|
+
harmonicReadCalls,
|
|
201
|
+
recall: () => recallSeam.recallInternal(RECALL_PROMPT, "agent:test", { mode: "full" }),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
test("settled QMD publishes while the harmonic read is still parked; harmonic renders after release", async (t) => {
|
|
206
|
+
const harness = await makeOrderingHarness(t, "park");
|
|
207
|
+
const { memoryDir, orchestrator, config, appendedSectionIds, harmonicReadCalls } =
|
|
208
|
+
harness;
|
|
209
|
+
let recallPromise: Promise<string> | undefined;
|
|
210
|
+
try {
|
|
211
|
+
// The move must not touch any deadline: pin the configured defaults.
|
|
212
|
+
assert.equal(config.recallOuterTimeoutMs, 75_000);
|
|
213
|
+
assert.equal(config.recallCoreDeadlineMs, 75_000);
|
|
214
|
+
assert.equal(config.recallEnrichmentDeadlineMs, 60_000);
|
|
215
|
+
|
|
216
|
+
recallPromise = harness.recall();
|
|
217
|
+
|
|
218
|
+
// The harmonic read starts during phase 1 and is now parked.
|
|
219
|
+
await eventually(
|
|
220
|
+
async () => (harmonicReadCalls.count > 0 ? true : null),
|
|
221
|
+
"harmonic source read reached the parked seam",
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
// The fix: the settled QMD candidate is formatted and published while
|
|
225
|
+
// harmonic is still parked. Under the pre-fix order the assembly blocked
|
|
226
|
+
// on harmonic first, so this probe could never succeed.
|
|
227
|
+
await eventually(
|
|
228
|
+
async () => (appendedSectionIds.includes("memories") ? true : null),
|
|
229
|
+
"QMD memories section published while harmonic is parked",
|
|
230
|
+
);
|
|
231
|
+
assert.equal(
|
|
232
|
+
appendedSectionIds.includes("harmonic-retrieval"),
|
|
233
|
+
false,
|
|
234
|
+
"harmonic must not append before its read is released",
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
harness.releaseHarmonicRead();
|
|
238
|
+
const context = await recallPromise;
|
|
239
|
+
|
|
240
|
+
// Harmonic still publishes afterward, with its candidate content, and
|
|
241
|
+
// QMD publication strictly precedes the harmonic append.
|
|
242
|
+
assert.ok(
|
|
243
|
+
appendedSectionIds.includes("harmonic-retrieval"),
|
|
244
|
+
"harmonic section must append after the read is released",
|
|
245
|
+
);
|
|
246
|
+
assert.ok(
|
|
247
|
+
appendedSectionIds.lastIndexOf("memories") <
|
|
248
|
+
appendedSectionIds.indexOf("harmonic-retrieval"),
|
|
249
|
+
`QMD publication must precede the harmonic append, got: ${appendedSectionIds.join(",")}`,
|
|
250
|
+
);
|
|
251
|
+
assert.ok(context.includes(harness.qmdMemory.content), "QMD candidate must render");
|
|
252
|
+
assert.ok(
|
|
253
|
+
context.includes("## Harmonic Retrieval"),
|
|
254
|
+
`harmonic section must render, got: ${context.slice(0, 600)}`,
|
|
255
|
+
);
|
|
256
|
+
assert.ok(
|
|
257
|
+
context.includes(harness.harmonicSource.content),
|
|
258
|
+
"harmonic candidate content must render",
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
// Budget parity: harmonic completed inside the untouched shared
|
|
262
|
+
// enrichment budget. A cancelled/timed-out harmonic drops its timing
|
|
263
|
+
// entry (timeout strings do not sanitize to numbers), so a numeric
|
|
264
|
+
// harmonicRetrieval timing proves the move neither shortened nor spent
|
|
265
|
+
// the budget ahead of QMD.
|
|
266
|
+
const record = getRecallTimings(config).find(
|
|
267
|
+
(candidate) => candidate.timingsMs.harmonicRetrieval !== undefined,
|
|
268
|
+
);
|
|
269
|
+
assert.ok(record, "harmonic must complete within the shared enrichment budget");
|
|
270
|
+
assert.ok(record.timingsMs.qmd !== undefined, "QMD timing must be recorded");
|
|
271
|
+
} finally {
|
|
272
|
+
harness.releaseHarmonicRead();
|
|
273
|
+
await recallPromise?.catch(() => undefined);
|
|
274
|
+
await orchestrator.destroy();
|
|
275
|
+
await cleanupDir(memoryDir);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
test("a failed harmonic source read degrades without taking QMD publication down", async (t) => {
|
|
280
|
+
const harness = await makeOrderingHarness(t, "fail");
|
|
281
|
+
const { memoryDir, orchestrator, qmdMemory, appendedSectionIds } = harness;
|
|
282
|
+
try {
|
|
283
|
+
const context = await harness.recall();
|
|
284
|
+
|
|
285
|
+
assert.ok(
|
|
286
|
+
appendedSectionIds.includes("memories"),
|
|
287
|
+
"QMD must still publish when the harmonic read fails",
|
|
288
|
+
);
|
|
289
|
+
assert.equal(
|
|
290
|
+
appendedSectionIds.includes("harmonic-retrieval"),
|
|
291
|
+
false,
|
|
292
|
+
"a failed harmonic read must append no harmonic section",
|
|
293
|
+
);
|
|
294
|
+
assert.ok(context.includes(qmdMemory.content), "QMD candidate must render");
|
|
295
|
+
assert.ok(
|
|
296
|
+
!context.includes("## Harmonic Retrieval"),
|
|
297
|
+
"no harmonic section may render after a failed read",
|
|
298
|
+
);
|
|
299
|
+
} finally {
|
|
300
|
+
harness.releaseHarmonicRead();
|
|
301
|
+
await orchestrator.destroy();
|
|
302
|
+
await cleanupDir(memoryDir);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/memory-projection-batch.ts"],"sourcesContent":["import type { MemoryProjectionCurrentState } from \"./types.js\";\nimport {\n memoryCurrentSelectExpressions,\n openProjectionReadonly,\n parseCurrentRow,\n} from \"./memory-projection-store.js\";\n\nexport interface ProjectedMemoryStateBatch {\n states: Map<string, MemoryProjectionCurrentState>;\n /** Meta `rebuiltAt`; null when the projection never recorded one. */\n rebuiltAt: string | null;\n /**\n * True only when the writer recorded that `memory_current` covers every active\n * memory (an unscoped rebuild). Projections written before this flag existed,\n * and scoped rebuilds, read as false.\n */\n complete: boolean;\n}\n\n/**\n * Read many current-state rows over ONE readonly connection, plus the meta the\n * recall path needs to decide whether the index can be trusted. Ids absent from\n * `memory_current` are simply missing from the map. Null means the projection\n * could not be opened or read.\n */\nexport function readProjectedMemoryStates(\n memoryDir: string,\n memoryIds: Iterable<string>,\n): ProjectedMemoryStateBatch | null {\n const db = openProjectionReadonly(memoryDir);\n if (!db) return null;\n try {\n const currentSelect = memoryCurrentSelectExpressions(db);\n const select = db.prepare(\n `\n SELECT\n memory_id,\n category,\n status,\n lifecycle_state,\n path_rel,\n created_at,\n updated_at,\n archived_at,\n superseded_at,\n entity_ref,\n source,\n confidence,\n confidence_tier,\n memory_kind,\n access_count,\n last_accessed,\n ${currentSelect.tagsJson},\n ${currentSelect.previewText},\n ${currentSelect.privateRecord}\n FROM memory_current\n WHERE memory_id = ?\n `,\n );\n const states = new Map<string, MemoryProjectionCurrentState>();\n for (const memoryId of memoryIds) {\n const state = parseCurrentRow(memoryDir, select.get(memoryId) as Record<string, unknown> | undefined);\n if (state) states.set(memoryId, state);\n }\n const meta = new Map<string, unknown>(\n (db.prepare(\"SELECT key, value FROM meta WHERE key IN ('rebuiltAt', 'complete')\").all() as Array<{\n key: string;\n value: unknown;\n }>).map((row) => [row.key, row.value]),\n );\n const rebuiltAt = meta.get(\"rebuiltAt\");\n return {\n states,\n rebuiltAt: typeof rebuiltAt === \"string\" ? rebuiltAt : null,\n complete: meta.get(\"complete\") === \"true\",\n };\n } catch {\n return null;\n } finally {\n db.close();\n }\n}\n"],"mappings":";;;;;;;AAyBO,SAAS,0BACd,WACA,WACkC;AAClC,QAAM,KAAK,uBAAuB,SAAS;AAC3C,MAAI,CAAC,GAAI,QAAO;AAChB,MAAI;AACF,UAAM,gBAAgB,+BAA+B,EAAE;AACvD,UAAM,SAAS,GAAG;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAkBM,cAAc,QAAQ;AAAA,YACtB,cAAc,WAAW;AAAA,YACzB,cAAc,aAAa;AAAA;AAAA;AAAA;AAAA,IAInC;AACA,UAAM,SAAS,oBAAI,IAA0C;AAC7D,eAAW,YAAY,WAAW;AAChC,YAAM,QAAQ,gBAAgB,WAAW,OAAO,IAAI,QAAQ,CAAwC;AACpG,UAAI,MAAO,QAAO,IAAI,UAAU,KAAK;AAAA,IACvC;AACA,UAAM,OAAO,IAAI;AAAA,MACd,GAAG,QAAQ,oEAAoE,EAAE,IAAI,EAGlF,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC;AAAA,IACvC;AACA,UAAM,YAAY,KAAK,IAAI,WAAW;AACtC,WAAO;AAAA,MACL;AAAA,MACA,WAAW,OAAO,cAAc,WAAW,YAAY;AAAA,MACvD,UAAU,KAAK,IAAI,UAAU,MAAM;AAAA,IACrC;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/harmonic-retrieval.ts"],"sourcesContent":["import path from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { realpath } from \"node:fs/promises\";\nimport { listJsonFilesStrict, readJsonFile } from \"./json-store.js\";\nimport { throwIfAborted } from \"./abort-error.js\";\nimport { inferMemoryStatus, toMemoryPathRel } from \"./memory-lifecycle-ledger-utils.js\";\n import {\n HARMONIC_SOURCE_MEMORY_INSERTED_AT_KEY,\n resolveAbstractionNodeStoreDir,\n validateAbstractionNode,\n type AbstractionNode,\n } from \"./abstraction-nodes.js\";\nimport { resolveCueAnchorStoreDir, validateCueAnchor, type CueAnchor, type CueAnchorType } from \"./cue-anchors.js\";\nimport { compareDeterministicStrings } from \"./deterministic-order.js\";\nimport { countRecallTokenOverlap, normalizeRecallTokens } from \"./recall-tokenization.js\";\nimport { stripAttributesSuffix } from \"./structured-attributes.js\";\nimport { isValidityExpiredNow } from \"./temporal-validity.js\";\nimport { assertSafePathSegment, isRecord } from \"./store-contract.js\";\nimport { isSupportPassportPrivateMemory } from \"./support-passport/card-projection.js\";\nimport type { MemoryFile } from \"./types.js\";\nimport { readProjectedMemoryStates } from \"./memory-projection-batch.js\";\nimport { SecureStoreLockedError } from \"./secure-store/secure-fs.js\";\nimport { StorageManager } from \"./storage.js\";\nimport { RECALL_FALLBACK_DIRS } from \"./utils/category-dir.js\";\nimport { isPathInsideStorageRoot } from \"./storage-paths.js\";\n\n\ntype SourceMemoryMap = Map<string, MemoryFile>;\n\n// `rootReal` set: a direct probe, which skips the corpus walk's symlink\n// hardening, so the resolved file must stay inside the memory root. Null: the\n// path came from the contained corpus walk and is already trusted.\nasync function readMemoryFile(\n storage: StorageManager,\n rootReal: string | null,\n filePath: string,\n abortSignal?: AbortSignal,\n): Promise<MemoryFile | null> {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n if (!existsSync(filePath)) return null;\n try {\n if (rootReal !== null && !isPathInsideStorageRoot(rootReal, await realpath(filePath))) return null;\n return await storage.readMemoryByPath(filePath);\n } catch (err) {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n if (err instanceof SecureStoreLockedError) throw err;\n return null;\n }\n}\n\n// An index older than this is treated as unusable: the date window needed to\n// cover \"created since the last rebuild\" would stop being cheap.\nconst INDEX_MAX_AGE_MS = 7 * 86_400_000;\nconst DAY_MS = 86_400_000;\n\nfunction utcDaysSince(rebuiltMs: number, nowMs: number): string[] {\n const days: string[] = [];\n for (let day = Math.floor((rebuiltMs - DAY_MS) / DAY_MS) * DAY_MS; day <= nowMs; day += DAY_MS) {\n days.push(new Date(day).toISOString().slice(0, 10));\n }\n return days;\n}\n\n// Source ids confirmed absent by a corpus path walk. A node only references a\n// source after the source file exists, so a confirmed absence stays true unless\n// the file is restored later; the short TTL bounds that. Without this, one\n// dangling id (a hard-deleted fact) would force a walk on every recall.\nconst ABSENT_SOURCE_TTL_MS = 10 * 60_000;\nconst ABSENT_SOURCE_MAX_ENTRIES = 4096;\nconst absentSourceIds = new Map<string, number>(); // `${memoryDir}\\0${id}` -> expiry ms\n\n// Memories the projection has no row for were written after its last rebuild, so\n// their dated directory is normally one of `days`. Hot and cold tiers are probed\n// by exact path. Only recall-corpus categories are probed: `questions/` is a queue\n// and `artifacts/` is outside the recall surface, so neither can be a source.\nfunction unprojectedCandidatePaths(memoryDir: string, id: string, days: string[]): string[] {\n const paths: string[] = [];\n for (const root of [memoryDir, path.join(memoryDir, \"cold\")]) {\n for (const dir of RECALL_FALLBACK_DIRS) {\n paths.push(path.join(root, dir, `${id}.md`));\n for (const day of days) paths.push(path.join(root, dir, day, `${id}.md`));\n }\n }\n return paths;\n}\n\n/**\n * Resolve only the source ids the abstraction nodes reference. Returns null when\n * the projection is absent, unreadable, too old, or not known to cover every\n * active memory (a scoped or pre-`complete` rebuild), so the caller keeps the\n * full-corpus scan. Every file is read from disk, so status, tags and validity\n * are current; the index only says where to look. An id the cheap probes cannot\n * place (an import filed under an old date, a tier root outside the memory dir)\n * is looked up by one contained path-only walk, never a frontmatter parse of the\n * corpus.\n */\nasync function readIndexedSourceMemories(options: {\n memoryDir: string;\n abortSignal?: AbortSignal;\n sourceMemoryIds: string[];\n nowMs: number;\n}): Promise<SourceMemoryMap | null> {\n // The ids go to SQL as bound parameters, so any id the projection holds is safe to look up.\n const batch = readProjectedMemoryStates(options.memoryDir, options.sourceMemoryIds);\n const rebuiltMs = Date.parse(batch?.rebuiltAt ?? \"\");\n if (!batch?.complete || !Number.isFinite(rebuiltMs) || options.nowMs - rebuiltMs > INDEX_MAX_AGE_MS) return null;\n const rootReal = await realpath(options.memoryDir).catch(() => null);\n if (rootReal === null) return null;\n\n const storage = new StorageManager(options.memoryDir);\n const days = utcDaysSince(rebuiltMs, options.nowMs);\n const sourceMemories: SourceMemoryMap = new Map();\n const pending: string[] = [];\n for (const id of options.sourceMemoryIds) {\n const state = batch.states.get(id);\n // An id is only ever joined into a path when it is a single safe segment.\n let safeId = true;\n try {\n assertSafePathSegment(id, \"sourceMemoryId\");\n } catch {\n safeId = false;\n }\n // An unprojected id that is not a single path segment cannot be probed or\n // matched by filename, and the scan keys sources by frontmatter id, so only\n // the scan can place it. Rare (legacy/imported ids); worst case is the old cost.\n if (!state && !safeId) return null;\n // state.path was containment-checked by the projection reader.\n const candidates = state\n ? [state.path, path.join(options.memoryDir, \"cold\", state.pathRel)]\n : unprojectedCandidatePaths(options.memoryDir, id, days);\n let found = false;\n for (const candidate of candidates) {\n const memory = await readMemoryFile(storage, rootReal, candidate, options.abortSignal);\n if (memory?.frontmatter.id !== id) continue;\n sourceMemories.set(id, memory);\n found = true;\n break;\n }\n const absentKey = `${options.memoryDir}\\0${id}`;\n if (!found && safeId && (absentSourceIds.get(absentKey) ?? 0) <= options.nowMs) pending.push(id);\n }\n if (pending.length === 0) return sourceMemories;\n\n const wanted = new Set(pending);\n const walked = [\n ...(await storage.collectActiveMemoryPaths({ abortSignal: options.abortSignal })),\n ...(await storage.collectColdMemoryPaths({ abortSignal: options.abortSignal })),\n ];\n for (const filePath of walked) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n if (!wanted.has(path.basename(filePath, \".md\"))) continue;\n const memory = await readMemoryFile(storage, null, filePath, options.abortSignal);\n if (memory && wanted.has(memory.frontmatter.id)) sourceMemories.set(memory.frontmatter.id, memory);\n }\n if (absentSourceIds.size > ABSENT_SOURCE_MAX_ENTRIES) absentSourceIds.clear();\n for (const id of pending) {\n if (!sourceMemories.has(id)) absentSourceIds.set(`${options.memoryDir}\\0${id}`, options.nowMs + ABSENT_SOURCE_TTL_MS);\n }\n return sourceMemories;\n}\n\nasync function readCorpusSourceMemories(options: {\n memoryDir: string;\n abortSignal?: AbortSignal;\n}): Promise<SourceMemoryMap> {\n const sourceMemories: SourceMemoryMap = new Map();\n try {\n const storage = new StorageManager(options.memoryDir);\n const [hotMemories, coldMemories] = await Promise.all([\n storage.readAllMemories({ abortSignal: options.abortSignal }),\n storage.readAllColdMemories(),\n ]);\n for (const memory of [...hotMemories, ...coldMemories]) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n sourceMemories.set(memory.frontmatter.id, memory);\n }\n } catch (err) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n if (err instanceof SecureStoreLockedError) return new Map();\n // Source validation fails closed when the authorized memory directory is\n // unreadable. Source-less nodes remain eligible for retrieval.\n sourceMemories.clear();\n }\n return sourceMemories;\n}\n\nasync function readSourceMemories(options: {\n memoryDir: string;\n abortSignal?: AbortSignal;\n sourceMemoryIds: string[];\n nowMs?: number;\n}): Promise<SourceMemoryMap> {\n try {\n const indexed = await readIndexedSourceMemories({\n memoryDir: options.memoryDir,\n abortSignal: options.abortSignal,\n sourceMemoryIds: options.sourceMemoryIds,\n nowMs: options.nowMs ?? Date.now(),\n });\n if (indexed) return indexed;\n } catch (err) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n if (err instanceof SecureStoreLockedError) return new Map();\n }\n return readCorpusSourceMemories(options);\n}\n\nfunction parseSourceMemoryInsertedAt(node: AbstractionNode): Map<string, string> {\n const insertedAtById = new Map<string, string>();\n const insertedAtRaw = node.metadata?.[HARMONIC_SOURCE_MEMORY_INSERTED_AT_KEY];\n if (!insertedAtRaw) return insertedAtById;\n try {\n const parsed = JSON.parse(insertedAtRaw) as unknown;\n if (!isRecord(parsed)) return insertedAtById;\n for (const [memoryId, value] of Object.entries(parsed)) {\n if (typeof value === \"string\") insertedAtById.set(memoryId, value);\n }\n } catch {\n // Malformed insertion metadata leaves ordering on the recordedAt fallback.\n }\n return insertedAtById;\n}\n\nfunction projectSourceBackedNode(\n node: AbstractionNode,\n sourceMemories: SourceMemoryMap,\n memoryDir: string,\n temporalExpiredInInjection: boolean,\n nowMs: number\n): AbstractionNode | null {\n const sourceMemoryIds = node.sourceMemoryIds ?? [];\n if (sourceMemoryIds.length === 0) return node;\n\n const activeSourceMemoryIds = sourceMemoryIds.filter((memoryId) => {\n const memory = sourceMemories.get(memoryId);\n return (\n memory !== undefined &&\n // #2332: a private support-passport record leaves the eligible set the\n // same way a rejected one does — a node title or anchor attribution\n // rebuilt from it would leak governed metadata into the deep-recall\n // frontier (and every other graph reader) before any content check runs.\n !isSupportPassportPrivateMemory(memory) &&\n inferMemoryStatus(memory.frontmatter, toMemoryPathRel(memoryDir, memory.path)) === \"active\" &&\n (temporalExpiredInInjection || !isValidityExpiredNow(memory.frontmatter, nowMs))\n );\n });\n if (activeSourceMemoryIds.length === 0) return null;\n\n // Newest-first source order keeps the projected title and summary on the most\n // recently inserted facts. Equal or missing timestamps fall back to ascending\n // id order, which matches the stored sourceMemoryIds order.\n const insertedAtById = parseSourceMemoryInsertedAt(node);\n const insertedAtMs = (memoryId: string): number => {\n const parsedMs = Date.parse(insertedAtById.get(memoryId) ?? \"\");\n return Number.isFinite(parsedMs) ? parsedMs : Date.parse(node.recordedAt);\n };\n activeSourceMemoryIds.sort(\n (left, right) =>\n insertedAtMs(right) - insertedAtMs(left) || compareDeterministicStrings(left, right)\n );\n\n const activeMemories = activeSourceMemoryIds.flatMap((memoryId) => {\n const memory = sourceMemories.get(memoryId);\n return memory ? [memory] : [];\n });\n const activeContents = activeMemories.map((memory) =>\n memory.frontmatter.structuredAttributes ? stripAttributesSuffix(memory.content) : memory.content\n );\n let metadata: Record<string, string> | undefined;\n const activeInsertedAt = activeSourceMemoryIds.flatMap((memoryId) => {\n const value = insertedAtById.get(memoryId);\n return typeof value === \"string\" ? [[memoryId, value] as const] : [];\n });\n if (activeInsertedAt.length > 0) {\n metadata = {\n [HARMONIC_SOURCE_MEMORY_INSERTED_AT_KEY]: JSON.stringify(Object.fromEntries(activeInsertedAt)),\n };\n }\n\n return {\n ...node,\n sourceMemoryIds: activeSourceMemoryIds,\n title: activeContents[0]?.slice(0, 80) ?? node.title,\n summary: activeContents.slice(0, 3).join(\"; \").slice(0, 400),\n tags: [...new Set(activeMemories.flatMap((memory) => memory.frontmatter.tags))].sort(compareDeterministicStrings),\n entityRefs: [\n ...new Set(\n activeMemories.flatMap((memory) =>\n typeof memory.frontmatter.entityRef === \"string\" ? [memory.frontmatter.entityRef] : []\n )\n ),\n ].sort(compareDeterministicStrings),\n metadata,\n };\n}\n\nfunction anchorMatchesProjectedNode(\n anchor: CueAnchor,\n nodeRef: string,\n node: AbstractionNode,\n allowLegacyAttribution: boolean\n): boolean {\n const activeSourceMemoryIds = node.sourceMemoryIds ?? [];\n if (activeSourceMemoryIds.length === 0) return true;\n if (!anchor.sourceMemoryIdsByNodeRef) return allowLegacyAttribution;\n const anchorSourceMemoryIds = anchor.sourceMemoryIdsByNodeRef[nodeRef] ?? [];\n return anchorSourceMemoryIds.some((sourceMemoryId) => activeSourceMemoryIds.includes(sourceMemoryId));\n}\n\nexport interface HarmonicMatchedAnchor {\n anchorId: string;\n anchorType: CueAnchorType;\n anchorValue: string;\n}\n\nexport interface HarmonicRetrievalResult {\n node: AbstractionNode;\n score: number;\n nodeScore: number;\n anchorScore: number;\n matchedFields: string[];\n matchedAnchors: HarmonicMatchedAnchor[];\n}\n\ninterface HarmonicCandidate {\n node: AbstractionNode;\n nodeScore: number;\n anchorScore: number;\n matchedFields: Set<string>;\n matchedAnchors: Map<string, HarmonicMatchedAnchor>;\n}\n\nfunction scoreNode(node: AbstractionNode, queryTokens: Set<string>): { score: number; matchedFields: string[] } {\n const matchedFields: string[] = [];\n let score = 0;\n\n const titleMatches = countRecallTokenOverlap(queryTokens, node.title);\n if (titleMatches > 0) {\n score += titleMatches * 3;\n matchedFields.push(\"title\");\n }\n\n const summaryMatches = countRecallTokenOverlap(queryTokens, node.summary);\n if (summaryMatches > 0) {\n score += summaryMatches * 3;\n matchedFields.push(\"summary\");\n }\n\n const tagMatches = countRecallTokenOverlap(queryTokens, node.tags?.join(\" \"));\n if (tagMatches > 0) {\n score += tagMatches * 2;\n matchedFields.push(\"tags\");\n }\n\n const entityMatches = countRecallTokenOverlap(queryTokens, node.entityRefs?.join(\" \"));\n if (entityMatches > 0) {\n score += entityMatches * 2;\n matchedFields.push(\"entityRefs\");\n }\n\n const kindMatches = countRecallTokenOverlap(queryTokens, `${node.kind} ${node.abstractionLevel}`);\n if (kindMatches > 0) {\n score += kindMatches;\n matchedFields.push(\"kind\");\n }\n\n return { score, matchedFields };\n}\n\nfunction scoreAnchor(\n anchor: CueAnchor,\n queryTokens: Set<string>,\n eligibleNodeTags: readonly string[]\n): { score: number; matchedFields: string[] } {\n const matchedFields: string[] = [];\n let score = 0;\n\n const valueMatches = countRecallTokenOverlap(queryTokens, anchor.anchorValue);\n const normalizedMatches = countRecallTokenOverlap(queryTokens, anchor.normalizedCue);\n const cueMatches = Math.max(valueMatches, normalizedMatches);\n if (cueMatches > 0) {\n score += cueMatches * 4;\n if (valueMatches > 0) matchedFields.push(\"anchorValue\");\n if (normalizedMatches > 0) matchedFields.push(\"anchor\");\n }\n\n const typeMatches = countRecallTokenOverlap(queryTokens, anchor.anchorType);\n if (typeMatches > 0) {\n score += typeMatches;\n matchedFields.push(\"anchorType\");\n }\n\n const tagMatches = countRecallTokenOverlap(queryTokens, eligibleNodeTags.join(\" \"));\n if (tagMatches > 0) {\n score += tagMatches * 2;\n matchedFields.push(\"anchorTags\");\n }\n\n return { score, matchedFields };\n}\n\nexport async function readAbstractionNodes(options: {\n memoryDir: string;\n abstractionNodeStoreDir?: string;\n}): Promise<AbstractionNode[]> {\n const rootDir = resolveAbstractionNodeStoreDir(options.memoryDir, options.abstractionNodeStoreDir);\n const files = await listJsonFilesStrict(path.join(rootDir, \"nodes\"), { allowMissingDirectory: true });\n const nodes: AbstractionNode[] = [];\n for (const filePath of files) {\n try {\n nodes.push(validateAbstractionNode(await readJsonFile(filePath)));\n } catch {\n // fail-open: invalid artifacts stay visible via status tooling instead of recall\n }\n }\n return nodes;\n}\n\nexport async function readCueAnchors(options: {\n memoryDir: string;\n abstractionNodeStoreDir?: string;\n}): Promise<CueAnchor[]> {\n const abstractionRoot = resolveAbstractionNodeStoreDir(options.memoryDir, options.abstractionNodeStoreDir);\n const rootDir = resolveCueAnchorStoreDir(abstractionRoot);\n const files = await listJsonFilesStrict(rootDir, { allowMissingDirectory: true });\n const anchors: CueAnchor[] = [];\n for (const filePath of files) {\n try {\n anchors.push(validateCueAnchor(await readJsonFile(filePath)));\n } catch {\n // fail-open: invalid artifacts stay visible via status tooling instead of recall\n }\n }\n return anchors;\n}\n\nexport interface ProjectedHarmonicGraph {\n nodes: AbstractionNode[];\n anchors: CueAnchor[];\n}\n\n/**\n * Read nodes + anchors and project BOTH against the namespace's current active\n * memories. This is the single projection every graph reader shares: a raw\n * `readAbstractionNodes` / `readCueAnchors` pair still carries the stored title,\n * summary, tags, and anchor attribution of a memory that was later rejected,\n * quarantined, or otherwise moved out of the active set, so a second reader\n * that skipped the projection could leak governed metadata even when the\n * memory itself is excluded from the final results.\n *\n * - A node whose every source memory left the active set is dropped.\n * - A surviving node's title/summary/tags/entityRefs are rebuilt from its\n * active sources only.\n * - An anchor keeps a node reference only while its attribution runs through\n * one of that node's surviving active sources, and is dropped once no\n * reference survives.\n */\nexport async function readProjectedHarmonicGraph(options: {\n memoryDir: string;\n abstractionNodeStoreDir?: string;\n anchorsEnabled: boolean;\n abortSignal?: AbortSignal;\n temporalExpiredInInjection?: boolean;\n nowMs?: number;\n}): Promise<ProjectedHarmonicGraph> {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const nodes = await readAbstractionNodes(options);\n const sourceMemoryIds = [...new Set(nodes.flatMap((node) => node.sourceMemoryIds ?? []))];\n const sourceMemories: SourceMemoryMap = sourceMemoryIds.length > 0\n ? await readSourceMemories({\n memoryDir: options.memoryDir,\n abortSignal: options.abortSignal,\n sourceMemoryIds,\n nowMs: options.nowMs,\n })\n : new Map();\n const nowMs = options.nowMs ?? Date.now();\n // A node whose full stored source set survived projection keeps legacy\n // anchor attribution (an anchor written before per-node source ids existed).\n const legacyCompatibleNodeRefs = new Set<string>();\n const projectedNodes = nodes.flatMap((node) => {\n const projected = projectSourceBackedNode(\n node,\n sourceMemories,\n options.memoryDir,\n options.temporalExpiredInInjection === true,\n nowMs\n );\n if (\n projected &&\n (node.sourceMemoryIds?.length ?? 0) > 0 &&\n projected.sourceMemoryIds?.length === node.sourceMemoryIds?.length\n ) {\n legacyCompatibleNodeRefs.add(node.nodeId);\n }\n return projected ? [projected] : [];\n });\n if (!options.anchorsEnabled) return { nodes: projectedNodes, anchors: [] };\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const nodeIndex = new Map(projectedNodes.map((node) => [node.nodeId, node]));\n const anchors = (await readCueAnchors(options)).flatMap((anchor) => {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const nodeRefs = anchor.nodeRefs.filter((nodeRef) => {\n const node = nodeIndex.get(nodeRef);\n return (\n node !== undefined &&\n anchorMatchesProjectedNode(anchor, nodeRef, node, legacyCompatibleNodeRefs.has(nodeRef))\n );\n });\n return nodeRefs.length > 0 ? [{ ...anchor, nodeRefs }] : [];\n });\n return { nodes: projectedNodes, anchors };\n}\n\nexport async function searchHarmonicRetrieval(options: {\n memoryDir: string;\n abstractionNodeStoreDir?: string;\n query: string;\n maxResults: number;\n sessionKey?: string;\n anchorsEnabled: boolean;\n abortSignal?: AbortSignal;\n temporalExpiredInInjection?: boolean;\n}): Promise<HarmonicRetrievalResult[]> {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const queryTokens = new Set(normalizeRecallTokens(options.query, [\"what\", \"which\"]));\n if (queryTokens.size === 0 || options.maxResults <= 0) return [];\n\n // One projection for every graph reader: nodes and anchors both arrive\n // already narrowed to the namespace's current active memories.\n const { nodes: eligibleNodes, anchors } = await readProjectedHarmonicGraph(options);\n const candidates = new Map<string, HarmonicCandidate>();\n\n for (const node of eligibleNodes) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const { score, matchedFields } = scoreNode(node, queryTokens);\n if (score <= 0) continue;\n candidates.set(node.nodeId, {\n node,\n nodeScore: score,\n anchorScore: 0,\n matchedFields: new Set(matchedFields),\n matchedAnchors: new Map(),\n });\n }\n\n if (options.anchorsEnabled) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const nodeIndex = new Map(eligibleNodes.map((node) => [node.nodeId, node]));\n for (const anchor of anchors) {\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n // `nodeRefs` are the projection's surviving references already.\n const eligibleNodeRefs = anchor.nodeRefs;\n const eligibleNodeTags = new Set(eligibleNodeRefs.flatMap((nodeRef) => nodeIndex.get(nodeRef)?.tags ?? []));\n const eligibleAnchorTags = anchor.tags?.filter((tag) => eligibleNodeTags.has(tag)) ?? [];\n const { score, matchedFields } = scoreAnchor(anchor, queryTokens, eligibleAnchorTags);\n if (score <= 0) continue;\n for (const nodeRef of eligibleNodeRefs) {\n const node = nodeIndex.get(nodeRef);\n if (!node) continue;\n const existing = candidates.get(nodeRef) ?? {\n node,\n nodeScore: 0,\n anchorScore: 0,\n matchedFields: new Set<string>(),\n matchedAnchors: new Map<string, HarmonicMatchedAnchor>(),\n };\n existing.anchorScore += score;\n existing.matchedFields.add(\"anchor\");\n for (const field of matchedFields) existing.matchedFields.add(field);\n existing.matchedAnchors.set(anchor.anchorId, {\n anchorId: anchor.anchorId,\n anchorType: anchor.anchorType,\n anchorValue: anchor.anchorValue,\n });\n candidates.set(nodeRef, existing);\n }\n }\n }\n\n return [...candidates.values()]\n .map((candidate) => {\n let score = candidate.nodeScore + candidate.anchorScore;\n if (options.sessionKey && candidate.node.sessionKey === options.sessionKey) score += 0.5;\n return {\n node: candidate.node,\n score,\n nodeScore: candidate.nodeScore,\n anchorScore: candidate.anchorScore,\n matchedFields: [...candidate.matchedFields].sort(),\n matchedAnchors: [...candidate.matchedAnchors.values()].sort(\n (left, right) =>\n left.anchorType.localeCompare(right.anchorType) || left.anchorValue.localeCompare(right.anchorValue)\n ),\n };\n })\n .filter((result) => result.nodeScore > 0 || result.anchorScore > 0)\n .sort(\n (left, right) =>\n right.score - left.score ||\n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;AAAA,MACL,MAAM,UAAU;AAAA,MAChB;AAAA,MACA,WAAW,UAAU;AAAA,MACrB,aAAa,UAAU;AAAA,MACvB,eAAe,CAAC,GAAG,UAAU,aAAa,EAAE,KAAK;AAAA,MACjD,gBAAgB,CAAC,GAAG,UAAU,eAAe,OAAO,CAAC,EAAE;AAAA,QACrD,CAAC,MAAM,UACL,KAAK,WAAW,cAAc,MAAM,UAAU,KAAK,KAAK,YAAY,cAAc,MAAM,WAAW;AAAA,MACvG;AAAA,IACF;AAAA,EACF,CAAC,EACA,OAAO,CAAC,WAAW,OAAO,YAAY,KAAK,OAAO,cAAc,CAAC,EACjE;AAAA,IACC,CAAC,MAAM,UACL,MAAM,QAAQ,KAAK,SACnB,MAAM,cAAc,KAAK,eACzB,MAAM,KAAK,WAAW,cAAc,KAAK,KAAK,UAAU;AAAA,EAC5D,EACC,MAAM,GAAG,QAAQ,UAAU;AAChC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|