@remnic/core 10.0.95 → 10.0.97
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/abstraction-nodes.d.ts.map +1 -1
- package/dist/abstraction-nodes.js +7 -1
- package/dist/access-admin-ops-surface.js +91 -90
- package/dist/access-audit.js +2 -2
- package/dist/access-cli.js +91 -90
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +91 -90
- package/dist/access-http-briefing.js +91 -90
- package/dist/access-http-query.js +91 -90
- package/dist/access-http-types.d.ts +2 -0
- package/dist/access-http-types.d.ts.map +1 -1
- package/dist/access-http.d.ts +1 -0
- package/dist/access-http.d.ts.map +1 -1
- package/dist/access-http.js +91 -90
- package/dist/access-identity-continuity-surface.js +91 -90
- package/dist/access-lcm-surface.js +91 -90
- package/dist/access-mcp.js +91 -90
- package/dist/access-observe-write-surface.js +91 -90
- package/dist/access-operations-batch.js +91 -90
- package/dist/access-operations.js +91 -90
- package/dist/access-recall-concurrency.js +91 -90
- package/dist/access-recall-response.js +91 -90
- package/dist/access-recall-surface.js +91 -90
- package/dist/access-schema.d.ts +5 -5
- package/dist/access-service.js +91 -90
- package/dist/active-recall.js +16 -16
- package/dist/briefing.js +15 -15
- package/dist/buffer.js +7 -7
- package/dist/calibration.js +2 -2
- package/dist/{capsule-merge-6IDAYTKG.js → capsule-merge-ILR35DIB.js} +10 -10
- package/dist/causal-consolidation.js +16 -16
- package/dist/{chunk-UN4RVUG2.js → chunk-2R3ACFYN.js} +3 -3
- package/dist/{chunk-RQFXZYTF.js → chunk-33C4BK7I.js} +4 -4
- package/dist/{chunk-BN2EBCLB.js → chunk-3DQZ2GAY.js} +2 -2
- package/dist/{chunk-DDATG2SF.js → chunk-3ETADXEP.js} +136 -127
- package/dist/{chunk-DDATG2SF.js.map → chunk-3ETADXEP.js.map} +1 -1
- package/dist/{chunk-UBEKET2V.js → chunk-3R63SXC5.js} +4 -4
- package/dist/{chunk-GBJUTX44.js → chunk-3WDFQKB4.js} +2 -2
- package/dist/{chunk-LLPMMMWG.js → chunk-4IJFJQPD.js} +2 -2
- package/dist/{chunk-BPK32FRM.js → chunk-4PXDXCNE.js} +61 -6
- package/dist/chunk-4PXDXCNE.js.map +1 -0
- package/dist/{chunk-CIWMTNHW.js → chunk-5NFF2TSD.js} +2 -2
- package/dist/{chunk-WGGRZYSQ.js → chunk-6RW5TONS.js} +8 -8
- package/dist/{chunk-LNGELD2M.js → chunk-6VAIFSDG.js} +2 -2
- package/dist/{chunk-2WCLTWV2.js → chunk-7NVK6AGC.js} +2 -2
- package/dist/{chunk-X5HGU2EM.js → chunk-A2D5WZRO.js} +2 -2
- package/dist/{chunk-LS7PT3YD.js → chunk-AMRGZOIP.js} +5 -5
- package/dist/{chunk-PC5DRBGD.js → chunk-AP4BFWSW.js} +2 -2
- package/dist/{chunk-OUVYYKYU.js → chunk-B2BMTXIF.js} +2 -2
- package/dist/{chunk-A4F7OIC5.js → chunk-BUOP3DOK.js} +7 -3
- package/dist/{chunk-A4F7OIC5.js.map → chunk-BUOP3DOK.js.map} +1 -1
- package/dist/{chunk-DNY63QWJ.js → chunk-CCQEANCY.js} +2 -2
- package/dist/{chunk-YIXJSW5M.js → chunk-CH2N4XCJ.js} +3 -3
- package/dist/{chunk-LQ5SS4OP.js → chunk-D6IGZYTN.js} +3 -3
- package/dist/{chunk-FWRXW7CZ.js → chunk-D6WJNWZG.js} +29 -29
- package/dist/{chunk-4EZWSDFL.js → chunk-E3YHIAO3.js} +3 -3
- package/dist/{chunk-IL3RHBWM.js → chunk-ECC6AAEE.js} +3 -3
- package/dist/{chunk-XJ2S5UBF.js → chunk-EHJ2RYR7.js} +3 -3
- package/dist/{chunk-F4QFU5IZ.js → chunk-EZ7XJJ5L.js} +2 -2
- package/dist/{chunk-FQAQ63QA.js → chunk-FHQ5SPMD.js} +2 -2
- package/dist/{chunk-LXATZLSC.js → chunk-FL3O34XF.js} +12 -5
- package/dist/chunk-FL3O34XF.js.map +1 -0
- package/dist/{chunk-DPPLNZ3A.js → chunk-FM4P7HSW.js} +4 -4
- package/dist/{chunk-QDESY76F.js → chunk-FQACH7MC.js} +2 -2
- package/dist/{chunk-XPXHQI6N.js → chunk-FVMEZ57K.js} +2 -2
- package/dist/{chunk-ILY5SSOM.js → chunk-FVPWQWIK.js} +6 -6
- package/dist/{chunk-F2XNSIPP.js → chunk-G2CGIFRP.js} +10 -3
- package/dist/chunk-G2CGIFRP.js.map +1 -0
- package/dist/{chunk-S3S72HRM.js → chunk-HCCRWSP7.js} +2 -2
- package/dist/{chunk-NMGHGTVR.js → chunk-HRMOKGQM.js} +6 -6
- package/dist/chunk-ITAUMNQU.js +40 -0
- package/dist/chunk-ITAUMNQU.js.map +1 -0
- package/dist/{chunk-R23JWJD3.js → chunk-J426U7XK.js} +9 -9
- package/dist/{chunk-CL4JU3DF.js → chunk-KI7E3N6Q.js} +3 -3
- package/dist/{chunk-SQ3GEIEL.js → chunk-KUQLUYIR.js} +5 -5
- package/dist/{chunk-J7BIFOYP.js → chunk-MXXTU4R2.js} +2 -2
- package/dist/{chunk-IAYUTGF2.js → chunk-O3GZPLVY.js} +4 -4
- package/dist/{chunk-IGOW4TJE.js → chunk-O3JG4PD3.js} +2 -2
- package/dist/{chunk-UHMHJX5G.js → chunk-OIG4ZFMB.js} +4 -4
- package/dist/{chunk-D5XG2KPS.js → chunk-OTSRGZRU.js} +2 -2
- package/dist/{chunk-ZDV5YWID.js → chunk-PWATRW3H.js} +6 -6
- package/dist/{chunk-ESLOLCD4.js → chunk-RUWKIPWJ.js} +2 -2
- package/dist/{chunk-IQ55QGY5.js → chunk-RXL67CV6.js} +2 -2
- package/dist/{chunk-W54Z2MOP.js → chunk-RXSGBO7Y.js} +2 -2
- package/dist/{chunk-QMFAMOT2.js → chunk-SFZEJJ6V.js} +2 -2
- package/dist/{chunk-QHARXWTC.js → chunk-SW3WUUYA.js} +2 -2
- package/dist/{chunk-FZZMLGWQ.js → chunk-TFI2Y5AR.js} +2 -2
- package/dist/{chunk-BOK6BN5M.js → chunk-THV6PZ7V.js} +2 -2
- package/dist/{chunk-Z3FTSHT5.js → chunk-UG54AEUG.js} +2 -2
- package/dist/{chunk-X2BVB74H.js → chunk-UZQXJDOE.js} +2 -2
- package/dist/{chunk-SUTEBYGI.js → chunk-VRBTZDQ5.js} +2 -2
- package/dist/{chunk-RKABLU5M.js → chunk-XP5CKXFV.js} +9 -9
- package/dist/{chunk-RNG7S3FY.js → chunk-YCQMNW3F.js} +6 -6
- package/dist/{chunk-OJXK5C6Z.js → chunk-ZG4GNPRE.js} +7 -7
- package/dist/{chunk-TYRWSE4B.js → chunk-ZUMHQEW4.js} +2 -2
- package/dist/{chunk-DAOMWGO2.js → chunk-ZX5N5D6M.js} +4 -4
- package/dist/cli.js +91 -90
- package/dist/coding/export-okf-codegraph.js +14 -14
- package/dist/compounding/engine.js +16 -16
- package/dist/config.js +16 -16
- package/dist/connectors/codex-materialize-runner.js +15 -15
- package/dist/connectors/index.js +15 -15
- package/dist/consolidation-provenance-check.js +8 -8
- package/dist/consolidation-undo.js +6 -6
- package/dist/contradiction/index.js +6 -6
- package/dist/convergence-refresh.js +17 -17
- package/dist/corpus-watermark.js +17 -17
- package/dist/cue-anchors.d.ts.map +1 -1
- package/dist/cue-anchors.js +8 -2
- package/dist/{entity-canonical-id-migration-JJSTZF73.js → entity-canonical-id-migration-IG77BOGD.js} +5 -5
- package/dist/entity-mention-index-cache.js +2 -2
- package/dist/entity-retrieval.js +16 -16
- package/dist/explicit-capture.js +91 -90
- package/dist/extraction.js +21 -21
- package/dist/harmonic-construction.js +9 -3
- package/dist/harmonic-graph-version.d.ts +14 -0
- package/dist/harmonic-graph-version.d.ts.map +1 -0
- package/dist/harmonic-graph-version.js +17 -0
- package/dist/harmonic-retrieval.d.ts +19 -14
- package/dist/harmonic-retrieval.d.ts.map +1 -1
- package/dist/harmonic-retrieval.js +22 -17
- package/dist/index.js +105 -104
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.js +8 -8
- package/dist/local-llm.js +2 -2
- package/dist/location/index.js +16 -16
- package/dist/maintenance/memory-governance.js +15 -15
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +15 -15
- package/dist/maintenance/rebuild-memory-projection-runner.js +17 -17
- package/dist/maintenance/rebuild-memory-projection.js +16 -16
- package/dist/memory-browse.js +7 -7
- package/dist/namespaces/migrate.js +16 -16
- package/dist/namespaces/search.d.ts.map +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.js +15 -15
- package/dist/operator-doctor-corpus.js +18 -18
- package/dist/operator-toolkit.js +24 -24
- package/dist/orchestration/backlog-scheduler.js +92 -91
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +92 -91
- package/dist/orchestration/maintenance.js +25 -25
- package/dist/orchestrator.js +93 -92
- package/dist/page-versioning.js +6 -6
- package/dist/qmd.js +4 -4
- package/dist/recall-navigation.js +91 -90
- package/dist/recall-state-view-admission.js +7 -7
- package/dist/recall-why-service.js +7 -7
- package/dist/{resolution-OVVIF7ZY.js → resolution-G4SLHSEU.js} +7 -7
- package/dist/resolution-G4SLHSEU.js.map +1 -0
- package/dist/resume-bundles.js +17 -17
- package/dist/schemas.d.ts +9 -9
- package/dist/search/factory.js +5 -5
- package/dist/search/index.js +5 -5
- package/dist/semantic-consolidation.js +16 -16
- package/dist/semantic-rule-promotion.js +15 -15
- package/dist/semantic-rule-verifier.js +15 -15
- package/dist/source-agent-qualifier.js +18 -18
- package/dist/standup/build.js +15 -15
- package/dist/storage.js +14 -14
- package/dist/summarizer.js +3 -3
- package/dist/support-passport/index.js +3 -3
- package/dist/transfer/capsule-import.js +8 -8
- package/dist/transfer/export-okf.js +15 -15
- package/dist/verified-recall.js +15 -15
- package/dist/who-knows-cli.js +16 -16
- package/dist/who-knows.js +15 -15
- package/package.json +2 -2
- package/src/abstraction-nodes.ts +7 -2
- package/src/access-http-cancellation.test.ts +45 -0
- package/src/access-http-types.ts +2 -0
- package/src/access-http.ts +13 -1
- package/src/cue-anchors.ts +8 -3
- package/src/harmonic-graph-cache.test.ts +244 -0
- package/src/harmonic-graph-version.ts +46 -0
- package/src/harmonic-retrieval.ts +92 -2
- package/src/namespaces/search.test.ts +35 -0
- package/src/namespaces/search.ts +7 -1
- package/src/orchestration/recall-internal.ts +1 -1
- package/dist/chunk-BPK32FRM.js.map +0 -1
- package/dist/chunk-F2XNSIPP.js.map +0 -1
- package/dist/chunk-LXATZLSC.js.map +0 -1
- /package/dist/{capsule-merge-6IDAYTKG.js.map → capsule-merge-ILR35DIB.js.map} +0 -0
- /package/dist/{chunk-UN4RVUG2.js.map → chunk-2R3ACFYN.js.map} +0 -0
- /package/dist/{chunk-RQFXZYTF.js.map → chunk-33C4BK7I.js.map} +0 -0
- /package/dist/{chunk-BN2EBCLB.js.map → chunk-3DQZ2GAY.js.map} +0 -0
- /package/dist/{chunk-UBEKET2V.js.map → chunk-3R63SXC5.js.map} +0 -0
- /package/dist/{chunk-GBJUTX44.js.map → chunk-3WDFQKB4.js.map} +0 -0
- /package/dist/{chunk-LLPMMMWG.js.map → chunk-4IJFJQPD.js.map} +0 -0
- /package/dist/{chunk-CIWMTNHW.js.map → chunk-5NFF2TSD.js.map} +0 -0
- /package/dist/{chunk-WGGRZYSQ.js.map → chunk-6RW5TONS.js.map} +0 -0
- /package/dist/{chunk-LNGELD2M.js.map → chunk-6VAIFSDG.js.map} +0 -0
- /package/dist/{chunk-2WCLTWV2.js.map → chunk-7NVK6AGC.js.map} +0 -0
- /package/dist/{chunk-X5HGU2EM.js.map → chunk-A2D5WZRO.js.map} +0 -0
- /package/dist/{chunk-LS7PT3YD.js.map → chunk-AMRGZOIP.js.map} +0 -0
- /package/dist/{chunk-PC5DRBGD.js.map → chunk-AP4BFWSW.js.map} +0 -0
- /package/dist/{chunk-OUVYYKYU.js.map → chunk-B2BMTXIF.js.map} +0 -0
- /package/dist/{chunk-DNY63QWJ.js.map → chunk-CCQEANCY.js.map} +0 -0
- /package/dist/{chunk-YIXJSW5M.js.map → chunk-CH2N4XCJ.js.map} +0 -0
- /package/dist/{chunk-LQ5SS4OP.js.map → chunk-D6IGZYTN.js.map} +0 -0
- /package/dist/{chunk-FWRXW7CZ.js.map → chunk-D6WJNWZG.js.map} +0 -0
- /package/dist/{chunk-4EZWSDFL.js.map → chunk-E3YHIAO3.js.map} +0 -0
- /package/dist/{chunk-IL3RHBWM.js.map → chunk-ECC6AAEE.js.map} +0 -0
- /package/dist/{chunk-XJ2S5UBF.js.map → chunk-EHJ2RYR7.js.map} +0 -0
- /package/dist/{chunk-F4QFU5IZ.js.map → chunk-EZ7XJJ5L.js.map} +0 -0
- /package/dist/{chunk-FQAQ63QA.js.map → chunk-FHQ5SPMD.js.map} +0 -0
- /package/dist/{chunk-DPPLNZ3A.js.map → chunk-FM4P7HSW.js.map} +0 -0
- /package/dist/{chunk-QDESY76F.js.map → chunk-FQACH7MC.js.map} +0 -0
- /package/dist/{chunk-XPXHQI6N.js.map → chunk-FVMEZ57K.js.map} +0 -0
- /package/dist/{chunk-ILY5SSOM.js.map → chunk-FVPWQWIK.js.map} +0 -0
- /package/dist/{chunk-S3S72HRM.js.map → chunk-HCCRWSP7.js.map} +0 -0
- /package/dist/{chunk-NMGHGTVR.js.map → chunk-HRMOKGQM.js.map} +0 -0
- /package/dist/{chunk-R23JWJD3.js.map → chunk-J426U7XK.js.map} +0 -0
- /package/dist/{chunk-CL4JU3DF.js.map → chunk-KI7E3N6Q.js.map} +0 -0
- /package/dist/{chunk-SQ3GEIEL.js.map → chunk-KUQLUYIR.js.map} +0 -0
- /package/dist/{chunk-J7BIFOYP.js.map → chunk-MXXTU4R2.js.map} +0 -0
- /package/dist/{chunk-IAYUTGF2.js.map → chunk-O3GZPLVY.js.map} +0 -0
- /package/dist/{chunk-IGOW4TJE.js.map → chunk-O3JG4PD3.js.map} +0 -0
- /package/dist/{chunk-UHMHJX5G.js.map → chunk-OIG4ZFMB.js.map} +0 -0
- /package/dist/{chunk-D5XG2KPS.js.map → chunk-OTSRGZRU.js.map} +0 -0
- /package/dist/{chunk-ZDV5YWID.js.map → chunk-PWATRW3H.js.map} +0 -0
- /package/dist/{chunk-ESLOLCD4.js.map → chunk-RUWKIPWJ.js.map} +0 -0
- /package/dist/{chunk-IQ55QGY5.js.map → chunk-RXL67CV6.js.map} +0 -0
- /package/dist/{chunk-W54Z2MOP.js.map → chunk-RXSGBO7Y.js.map} +0 -0
- /package/dist/{chunk-QMFAMOT2.js.map → chunk-SFZEJJ6V.js.map} +0 -0
- /package/dist/{chunk-QHARXWTC.js.map → chunk-SW3WUUYA.js.map} +0 -0
- /package/dist/{chunk-FZZMLGWQ.js.map → chunk-TFI2Y5AR.js.map} +0 -0
- /package/dist/{chunk-BOK6BN5M.js.map → chunk-THV6PZ7V.js.map} +0 -0
- /package/dist/{chunk-Z3FTSHT5.js.map → chunk-UG54AEUG.js.map} +0 -0
- /package/dist/{chunk-X2BVB74H.js.map → chunk-UZQXJDOE.js.map} +0 -0
- /package/dist/{chunk-SUTEBYGI.js.map → chunk-VRBTZDQ5.js.map} +0 -0
- /package/dist/{chunk-RKABLU5M.js.map → chunk-XP5CKXFV.js.map} +0 -0
- /package/dist/{chunk-RNG7S3FY.js.map → chunk-YCQMNW3F.js.map} +0 -0
- /package/dist/{chunk-OJXK5C6Z.js.map → chunk-ZG4GNPRE.js.map} +0 -0
- /package/dist/{chunk-TYRWSE4B.js.map → chunk-ZUMHQEW4.js.map} +0 -0
- /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
- /package/dist/{entity-canonical-id-migration-JJSTZF73.js.map → entity-canonical-id-migration-IG77BOGD.js.map} +0 -0
- /package/dist/{resolution-OVVIF7ZY.js.map → harmonic-graph-version.js.map} +0 -0
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
normalizeActionIntent,
|
|
20
20
|
sanitizePayloadString
|
|
21
21
|
} from "./chunk-CIEEYVUB.js";
|
|
22
|
-
import {
|
|
23
|
-
parseSubjectRuntimeConfig
|
|
24
|
-
} from "./chunk-3AUDELZL.js";
|
|
25
22
|
import {
|
|
26
23
|
parseRecallStandingBlock,
|
|
27
24
|
parseStandingBlockFreshDays,
|
|
28
25
|
parseStandingBlockMaxChars
|
|
29
26
|
} from "./chunk-LI4APB6M.js";
|
|
27
|
+
import {
|
|
28
|
+
parseSubjectRuntimeConfig
|
|
29
|
+
} from "./chunk-3AUDELZL.js";
|
|
30
30
|
import {
|
|
31
31
|
cloneDefaultSessionObserverBands
|
|
32
32
|
} from "./chunk-Z5LAYHGJ.js";
|
|
@@ -5854,4 +5854,4 @@ export {
|
|
|
5854
5854
|
VALID_MEMORY_CATEGORIES,
|
|
5855
5855
|
parseConfig
|
|
5856
5856
|
};
|
|
5857
|
-
//# sourceMappingURL=chunk-
|
|
5857
|
+
//# sourceMappingURL=chunk-3R63SXC5.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
computeCorpusWatermarks,
|
|
6
6
|
resolveCorpusNamespaceRoots
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OTSRGZRU.js";
|
|
8
8
|
|
|
9
9
|
// src/operator-doctor-corpus.ts
|
|
10
10
|
var DIGEST_PREFIX_LENGTH = 12;
|
|
@@ -78,4 +78,4 @@ export {
|
|
|
78
78
|
corpusWatermarksFromCheck,
|
|
79
79
|
summarizeCorpusAndReplica
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-3WDFQKB4.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-D3ZKHLN2.js";
|
|
9
9
|
import {
|
|
10
10
|
deriveSourceConnector
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HCCRWSP7.js";
|
|
12
12
|
import {
|
|
13
13
|
resolvePipelineProcessingCapabilities
|
|
14
14
|
} from "./chunk-C5LWPYS3.js";
|
|
@@ -130,4 +130,4 @@ export {
|
|
|
130
130
|
renderExtractionConversation,
|
|
131
131
|
applyGroundingWithConnector
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-4IJFJQPD.js.map
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
resolveCueAnchorStoreDir,
|
|
10
10
|
validateCueAnchor
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FL3O34XF.js";
|
|
12
12
|
import {
|
|
13
13
|
StorageManager
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D6WJNWZG.js";
|
|
15
15
|
import {
|
|
16
16
|
isValidityExpiredNow
|
|
17
17
|
} from "./chunk-6CIAGZ6X.js";
|
|
@@ -36,7 +36,10 @@ import {
|
|
|
36
36
|
HARMONIC_SOURCE_MEMORY_INSERTED_AT_KEY,
|
|
37
37
|
resolveAbstractionNodeStoreDir,
|
|
38
38
|
validateAbstractionNode
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-G2CGIFRP.js";
|
|
40
|
+
import {
|
|
41
|
+
readHarmonicGraphStamp
|
|
42
|
+
} from "./chunk-ITAUMNQU.js";
|
|
40
43
|
import {
|
|
41
44
|
compareDeterministicStrings
|
|
42
45
|
} from "./chunk-G73MCJKL.js";
|
|
@@ -304,7 +307,7 @@ async function readCueAnchors(options) {
|
|
|
304
307
|
}
|
|
305
308
|
return anchors;
|
|
306
309
|
}
|
|
307
|
-
async function
|
|
310
|
+
async function buildProjectedHarmonicGraph(options) {
|
|
308
311
|
throwIfAborted(options.abortSignal, "harmonic retrieval aborted");
|
|
309
312
|
const nodes = await readAbstractionNodes(options);
|
|
310
313
|
const sourceMemoryIds = [...new Set(nodes.flatMap((node) => node.sourceMemoryIds ?? []))];
|
|
@@ -342,11 +345,61 @@ async function readProjectedHarmonicGraph(options) {
|
|
|
342
345
|
});
|
|
343
346
|
return { nodes: projectedNodes, anchors };
|
|
344
347
|
}
|
|
348
|
+
var GRAPH_CACHE_TTL_MS = 3e4;
|
|
349
|
+
var GRAPH_CACHE_MAX_ENTRIES = 8;
|
|
350
|
+
var graphCache = /* @__PURE__ */ new Map();
|
|
351
|
+
var harmonicGraphCacheStats = { hits: 0, misses: 0 };
|
|
352
|
+
function deepFreeze(value) {
|
|
353
|
+
if (Object.isFrozen(value)) return value;
|
|
354
|
+
Object.freeze(value);
|
|
355
|
+
for (const child of Object.values(value)) deepFreeze(child);
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
358
|
+
function clearHarmonicGraphCache() {
|
|
359
|
+
graphCache.clear();
|
|
360
|
+
}
|
|
361
|
+
async function readProjectedHarmonicGraph(options) {
|
|
362
|
+
if (options.useCache !== true || options.nowMs !== void 0) return buildProjectedHarmonicGraph(options);
|
|
363
|
+
throwIfAborted(options.abortSignal, "harmonic retrieval aborted");
|
|
364
|
+
const nodeStoreDir = resolveAbstractionNodeStoreDir(options.memoryDir, options.abstractionNodeStoreDir);
|
|
365
|
+
const key = JSON.stringify([
|
|
366
|
+
options.memoryDir,
|
|
367
|
+
nodeStoreDir,
|
|
368
|
+
options.anchorsEnabled === true,
|
|
369
|
+
options.temporalExpiredInInjection === true
|
|
370
|
+
]);
|
|
371
|
+
const stamp = readHarmonicGraphStamp(options.memoryDir, nodeStoreDir);
|
|
372
|
+
const startedAtMs = Date.now();
|
|
373
|
+
const hit = graphCache.get(key);
|
|
374
|
+
if (hit && hit.stamp === stamp && startedAtMs - hit.startedAtMs < GRAPH_CACHE_TTL_MS) {
|
|
375
|
+
harmonicGraphCacheStats.hits++;
|
|
376
|
+
graphCache.delete(key);
|
|
377
|
+
graphCache.set(key, hit);
|
|
378
|
+
return hit.graph;
|
|
379
|
+
}
|
|
380
|
+
harmonicGraphCacheStats.misses++;
|
|
381
|
+
const built = await buildProjectedHarmonicGraph(options);
|
|
382
|
+
const graph = {
|
|
383
|
+
nodes: deepFreeze(built.nodes),
|
|
384
|
+
anchors: deepFreeze(built.anchors)
|
|
385
|
+
};
|
|
386
|
+
graphCache.delete(key);
|
|
387
|
+
graphCache.set(key, { stamp, startedAtMs, graph });
|
|
388
|
+
while (graphCache.size > GRAPH_CACHE_MAX_ENTRIES) {
|
|
389
|
+
const oldest = graphCache.keys().next().value;
|
|
390
|
+
if (oldest === void 0) break;
|
|
391
|
+
graphCache.delete(oldest);
|
|
392
|
+
}
|
|
393
|
+
return graph;
|
|
394
|
+
}
|
|
345
395
|
async function searchHarmonicRetrieval(options) {
|
|
346
396
|
throwIfAborted(options.abortSignal, "harmonic retrieval aborted");
|
|
347
397
|
const queryTokens = new Set(normalizeRecallTokens(options.query, ["what", "which"]));
|
|
348
398
|
if (queryTokens.size === 0 || options.maxResults <= 0) return [];
|
|
349
|
-
const { nodes: eligibleNodes, anchors } = await readProjectedHarmonicGraph(
|
|
399
|
+
const { nodes: eligibleNodes, anchors } = await readProjectedHarmonicGraph({
|
|
400
|
+
...options,
|
|
401
|
+
useCache: options.useGraphCache === true
|
|
402
|
+
});
|
|
350
403
|
const candidates = /* @__PURE__ */ new Map();
|
|
351
404
|
for (const node of eligibleNodes) {
|
|
352
405
|
throwIfAborted(options.abortSignal, "harmonic retrieval aborted");
|
|
@@ -413,7 +466,9 @@ async function searchHarmonicRetrieval(options) {
|
|
|
413
466
|
export {
|
|
414
467
|
readAbstractionNodes,
|
|
415
468
|
readCueAnchors,
|
|
469
|
+
harmonicGraphCacheStats,
|
|
470
|
+
clearHarmonicGraphCache,
|
|
416
471
|
readProjectedHarmonicGraph,
|
|
417
472
|
searchHarmonicRetrieval
|
|
418
473
|
};
|
|
419
|
-
//# sourceMappingURL=chunk-
|
|
474
|
+
//# sourceMappingURL=chunk-4PXDXCNE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/harmonic-retrieval.ts"],"sourcesContent":["import path from \"node:path\";\nimport { realpath } from \"node:fs/promises\";\nimport { listJsonFilesStrict, readJsonFile } from \"./json-store.js\";\nimport { throwIfAborted } from \"./abort-error.js\";\nimport { readHarmonicGraphStamp } from \"./harmonic-graph-version.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 { readHarmonicSourceMemory, readUnresolvedHarmonicSources } from \"./harmonic-source-lookup.js\";\n\n\ntype SourceMemoryMap = Map<string, MemoryFile>;\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\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/** Resolve indexed sources first, then use the durable unresolved-id path cache. */\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 || !batch.rebuiltAt || !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 // state.path was containment-checked by the projection reader.\n const candidates = state\n ? [state.path, path.join(options.memoryDir, \"cold\", state.pathRel)]\n : safeId ? unprojectedCandidatePaths(options.memoryDir, id, days) : [];\n let found = false;\n for (const candidate of candidates) {\n const memory = await readHarmonicSourceMemory(storage, rootReal, candidate, options.abortSignal);\n if (memory?.frontmatter.id !== id) continue;\n sourceMemories.set(id, memory);\n found = true;\n break;\n }\n if (!found) pending.push(id);\n }\n if (pending.length === 0) return sourceMemories;\n\n const unresolved = await readUnresolvedHarmonicSources({\n storage, rootReal, rebuiltAt: batch.rebuiltAt, sourceMemoryIds: pending,\n nowMs: options.nowMs, abortSignal: options.abortSignal,\n });\n for (const [id, memory] of unresolved) sourceMemories.set(id, memory);\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({ abortSignal: options.abortSignal }),\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 */\nasync function buildProjectedHarmonicGraph(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\nconst GRAPH_CACHE_TTL_MS = 30_000;\nconst GRAPH_CACHE_MAX_ENTRIES = 8;\n\ninterface GraphCacheEntry {\n stamp: string;\n startedAtMs: number;\n graph: ProjectedHarmonicGraph;\n}\n\nconst graphCache = new Map<string, GraphCacheEntry>();\n/** Counters for tests and diagnostics. */\nexport const harmonicGraphCacheStats = { hits: 0, misses: 0 };\n\n/** Freeze records and their nested arrays/objects so a caller cannot corrupt the shared cache. */\nfunction deepFreeze<T extends object>(value: T): T {\n // isFrozen is true for primitives and null, and a frozen value is not revisited, so this ends on cycles too.\n if (Object.isFrozen(value)) return value;\n Object.freeze(value);\n for (const child of Object.values(value)) deepFreeze(child);\n return value;\n}\n\nexport function clearHarmonicGraphCache(): void {\n graphCache.clear();\n}\n\n/**\n * `readProjectedHarmonicGraph` with an opt-in in-memory cache. Every recall used\n * to re-read all nodes, anchors and source memories from disk (about 4.7 s on a\n * 2107 node, 9199 anchor, 4105 source graph). With `useCache` a completed graph is\n * reused while the stamp below is unchanged: the memory corpus, memory status and\n * cold-write version sentinels (bumped by every memory write, in any process) and\n * the graph version sentinel (bumped by node and anchor writes). A stamp read is\n * four stats, not a scan of the memories. The TTL bounds the one input a sentinel\n * cannot see, which is wall-clock validity expiry. An explicit `nowMs` bypasses the\n * cache so tests stay deterministic. The cached arrays are frozen: callers must not\n * mutate them.\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 useCache?: boolean;\n}): Promise<ProjectedHarmonicGraph> {\n if (options.useCache !== true || options.nowMs !== undefined) return buildProjectedHarmonicGraph(options);\n // Same cancellation contract as the builder: a cache hit must not mask an aborted signal.\n throwIfAborted(options.abortSignal, \"harmonic retrieval aborted\");\n const nodeStoreDir = resolveAbstractionNodeStoreDir(options.memoryDir, options.abstractionNodeStoreDir);\n const key = JSON.stringify([\n options.memoryDir,\n nodeStoreDir,\n options.anchorsEnabled === true,\n options.temporalExpiredInInjection === true,\n ]);\n // The stamp is read BEFORE the build, so a write that lands mid-build leaves the\n // entry stale and the next call rebuilds.\n const stamp = readHarmonicGraphStamp(options.memoryDir, nodeStoreDir);\n const startedAtMs = Date.now();\n const hit = graphCache.get(key);\n if (hit && hit.stamp === stamp && startedAtMs - hit.startedAtMs < GRAPH_CACHE_TTL_MS) {\n harmonicGraphCacheStats.hits++;\n graphCache.delete(key);\n graphCache.set(key, hit);\n return hit.graph;\n }\n harmonicGraphCacheStats.misses++;\n const built = await buildProjectedHarmonicGraph(options);\n const graph = {\n nodes: deepFreeze(built.nodes),\n anchors: deepFreeze(built.anchors),\n };\n graphCache.delete(key);\n graphCache.set(key, { stamp, startedAtMs, graph });\n while (graphCache.size > GRAPH_CACHE_MAX_ENTRIES) {\n const oldest = graphCache.keys().next().value;\n if (oldest === undefined) break;\n graphCache.delete(oldest);\n }\n return graph;\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 /** Share one projected graph between recalls until a write bumps a version sentinel (see readProjectedHarmonicGraph). */\n useGraphCache?: 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({\n ...options,\n useCache: options.useGraphCache === true,\n });\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 right.anchorScore - left.anchorScore ||\n right.node.recordedAt.localeCompare(left.node.recordedAt)\n )\n .slice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UAC3C,UAAU,OAAO;AAAA,UACjB,YAAY,OAAO;AAAA,UACnB,aAAa,OAAO;AAAA,QACtB,CAAC;AACD,mBAAW,IAAI,SAAS,QAAQ;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,WAAW,OAAO,CAAC,EAC3B,IAAI,CAAC,cAAc;AAClB,QAAI,QAAQ,UAAU,YAAY,UAAU;AAC5C,QAAI,QAAQ,cAAc,UAAU,KAAK,eAAe,QAAQ,WAAY,UAAS;AACrF,WAAO;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":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionDeadlineError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HCCRWSP7.js";
|
|
4
4
|
import {
|
|
5
5
|
BufferAdmissionRefusedError,
|
|
6
6
|
canAdmitNewEntryUnlocked
|
|
@@ -926,4 +926,4 @@ var SmartBuffer = class {
|
|
|
926
926
|
export {
|
|
927
927
|
SmartBuffer
|
|
928
928
|
};
|
|
929
|
-
//# sourceMappingURL=chunk-
|
|
929
|
+
//# sourceMappingURL=chunk-5NFF2TSD.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rebuildMemoryLifecycleLedger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6VAIFSDG.js";
|
|
4
4
|
import {
|
|
5
5
|
PROJECTION_REBUILD_RUNNER_FLAG
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CCQEANCY.js";
|
|
7
7
|
import {
|
|
8
8
|
startLocationAutoSync
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ECC6AAEE.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureContradictionScanCron,
|
|
12
12
|
ensureDaySummaryCron,
|
|
@@ -21,17 +21,17 @@ import {
|
|
|
21
21
|
isIsoWeekId,
|
|
22
22
|
msUntilNextIsoWeek,
|
|
23
23
|
previousIsoWeekId
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-E3YHIAO3.js";
|
|
25
25
|
import {
|
|
26
26
|
planNamespaceMaintenance,
|
|
27
27
|
runNamespaceMaintenanceBatchPlan
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-FHQ5SPMD.js";
|
|
29
29
|
import {
|
|
30
30
|
rebuildMemoryProjection
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KI7E3N6Q.js";
|
|
32
32
|
import {
|
|
33
33
|
LocalLlmClient
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-33C4BK7I.js";
|
|
35
35
|
import {
|
|
36
36
|
DEFAULT_TIMELINE_CATEGORIES,
|
|
37
37
|
TIMELINE_RESERVED_IDLE,
|
|
@@ -2874,4 +2874,4 @@ export {
|
|
|
2874
2874
|
ActivitySyncScheduler,
|
|
2875
2875
|
MaintenanceScheduler
|
|
2876
2876
|
};
|
|
2877
|
-
//# sourceMappingURL=chunk-
|
|
2877
|
+
//# sourceMappingURL=chunk-6RW5TONS.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KJTKLXTH.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D6WJNWZG.js";
|
|
7
7
|
import {
|
|
8
8
|
assertInjectedStorageRooted
|
|
9
9
|
} from "./chunk-BNZAR6PO.js";
|
|
@@ -260,4 +260,4 @@ export {
|
|
|
260
260
|
backupExistingLedger,
|
|
261
261
|
rebuildMemoryLifecycleLedger
|
|
262
262
|
};
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
263
|
+
//# sourceMappingURL=chunk-6VAIFSDG.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-5HFVWYHL.js";
|
|
4
4
|
import {
|
|
5
5
|
isGenericRecallExcludedPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EZ7XJJ5L.js";
|
|
7
7
|
import {
|
|
8
8
|
planRecallMode
|
|
9
9
|
} from "./chunk-CSAKJVXW.js";
|
|
@@ -132,4 +132,4 @@ async function findExpectedMemory(orchestrator, namespaces, expect) {
|
|
|
132
132
|
export {
|
|
133
133
|
runRecallWhy
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-7NVK6AGC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPostConsolidationMaterialize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3DQZ2GAY.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverMemoryExtensions,
|
|
6
6
|
renderExtensionsBlock,
|
|
@@ -220,4 +220,4 @@ export {
|
|
|
220
220
|
buildExtensionsBlockForConsolidation,
|
|
221
221
|
materializeAfterSemanticConsolidation
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-A2D5WZRO.js.map
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
ExtractionDrain,
|
|
3
3
|
TurnIngestionCoordinator,
|
|
4
4
|
shouldSkipImplicitExtraction
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3ETADXEP.js";
|
|
6
6
|
import {
|
|
7
7
|
headerConnector,
|
|
8
8
|
renderExtractionConversation,
|
|
9
9
|
resolveSourceConnector
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4IJFJQPD.js";
|
|
11
11
|
import {
|
|
12
12
|
SmartBuffer
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5NFF2TSD.js";
|
|
14
14
|
import {
|
|
15
15
|
selfDeps
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-D6WJNWZG.js";
|
|
17
17
|
import {
|
|
18
18
|
describeError,
|
|
19
19
|
groupTurnsByExtractionScope
|
|
@@ -447,4 +447,4 @@ export {
|
|
|
447
447
|
ClaimBufferStorage,
|
|
448
448
|
BufferDrainRunner
|
|
449
449
|
};
|
|
450
|
-
//# sourceMappingURL=chunk-
|
|
450
|
+
//# sourceMappingURL=chunk-AMRGZOIP.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-QNUNAXBE.js";
|
|
12
12
|
import {
|
|
13
13
|
LocalLlmClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-33C4BK7I.js";
|
|
15
15
|
import {
|
|
16
16
|
completeBackgroundGeneration,
|
|
17
17
|
parseBackgroundGenerationJson
|
|
@@ -808,4 +808,4 @@ export {
|
|
|
808
808
|
summarizeHourlyStatus,
|
|
809
809
|
HourlySummarizer
|
|
810
810
|
};
|
|
811
|
-
//# sourceMappingURL=chunk-
|
|
811
|
+
//# sourceMappingURL=chunk-AP4BFWSW.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-GZFKCLRC.js";
|
|
11
11
|
import {
|
|
12
12
|
StorageManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-D6WJNWZG.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeEntityName
|
|
16
16
|
} from "./chunk-YXZG5TVN.js";
|
|
@@ -974,4 +974,4 @@ export {
|
|
|
974
974
|
resolveBriefingSaveDir,
|
|
975
975
|
briefingFilename
|
|
976
976
|
};
|
|
977
|
-
//# sourceMappingURL=chunk-
|
|
977
|
+
//# sourceMappingURL=chunk-B2BMTXIF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSearchBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FVMEZ57K.js";
|
|
4
4
|
import {
|
|
5
5
|
reportSearchDegradation
|
|
6
6
|
} from "./chunk-NWA6IXR3.js";
|
|
@@ -413,7 +413,11 @@ var NamespaceSearchAbortError = class extends Error {
|
|
|
413
413
|
};
|
|
414
414
|
function awaitWithAbort(operation, signal) {
|
|
415
415
|
if (!signal) return operation;
|
|
416
|
-
if (signal.aborted)
|
|
416
|
+
if (signal.aborted) {
|
|
417
|
+
operation.catch(() => {
|
|
418
|
+
});
|
|
419
|
+
return Promise.reject(new NamespaceSearchAbortError());
|
|
420
|
+
}
|
|
417
421
|
return new Promise((resolve, reject) => {
|
|
418
422
|
const onAbort = () => {
|
|
419
423
|
signal.removeEventListener("abort", onAbort);
|
|
@@ -568,4 +572,4 @@ export {
|
|
|
568
572
|
normalizeQmdResultPath,
|
|
569
573
|
resolveNamespaceResultPath
|
|
570
574
|
};
|
|
571
|
-
//# sourceMappingURL=chunk-
|
|
575
|
+
//# sourceMappingURL=chunk-BUOP3DOK.js.map
|