@remnic/core 9.3.658 → 9.3.660

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.
Files changed (91) hide show
  1. package/dist/access-cli.js +17 -17
  2. package/dist/access-http.js +11 -10
  3. package/dist/access-mcp.js +10 -9
  4. package/dist/access-service.js +9 -8
  5. package/dist/briefing.js +4 -3
  6. package/dist/causal-consolidation.js +5 -4
  7. package/dist/causal-consolidation.js.map +1 -1
  8. package/dist/{chunk-QFKRE7AU.js → chunk-256W7AXC.js} +4 -4
  9. package/dist/{chunk-5PFIMBJJ.js → chunk-2EVZ5EN6.js} +12 -12
  10. package/dist/{chunk-SCPFRKIT.js → chunk-42JKGUFJ.js} +6 -2
  11. package/dist/{chunk-SCPFRKIT.js.map → chunk-42JKGUFJ.js.map} +1 -1
  12. package/dist/{chunk-2VCTTEJM.js → chunk-7H7J3ZWN.js} +3 -3
  13. package/dist/{chunk-QRSKPI62.js → chunk-7PCZGNG2.js} +2 -2
  14. package/dist/{chunk-ZCMO46YY.js → chunk-A7EF2XRO.js} +2 -2
  15. package/dist/{chunk-BNUAOLDK.js → chunk-ANJOULTP.js} +2 -2
  16. package/dist/{chunk-CPPS65WS.js → chunk-AWJ2FHCF.js} +84 -17
  17. package/dist/chunk-AWJ2FHCF.js.map +1 -0
  18. package/dist/{chunk-4PLOQDBB.js → chunk-AX5O25EF.js} +7 -5
  19. package/dist/chunk-AX5O25EF.js.map +1 -0
  20. package/dist/{chunk-7VWDC7AD.js → chunk-B57QYSWN.js} +17 -17
  21. package/dist/{chunk-BKRIAXTU.js → chunk-D2EFNQMY.js} +2 -2
  22. package/dist/{chunk-MBZAESQ3.js → chunk-F6O7IOS3.js} +2 -2
  23. package/dist/{chunk-KI6QM5AV.js → chunk-GY3V3SUI.js} +2 -2
  24. package/dist/{chunk-GGL7R2L2.js → chunk-MO77TWPS.js} +4 -4
  25. package/dist/{chunk-VJYFXDCZ.js → chunk-NMPEJV5M.js} +3 -3
  26. package/dist/{chunk-3R6OP33G.js → chunk-OYXVENIS.js} +3 -3
  27. package/dist/{chunk-7KSPKZIQ.js → chunk-PXVFMQLD.js} +3 -3
  28. package/dist/{chunk-FIS5RT6K.js → chunk-QXHBWFR3.js} +2 -2
  29. package/dist/{chunk-SSSXWIBP.js → chunk-R2EBP6CM.js} +2 -2
  30. package/dist/{chunk-6M4LYWA2.js → chunk-RP2U54GG.js} +5 -5
  31. package/dist/{chunk-G2VVBWFU.js → chunk-RQGR3ETH.js} +2 -2
  32. package/dist/{chunk-JI3LQFJH.js → chunk-TBLGI2LT.js} +2 -2
  33. package/dist/{chunk-RVT6U6PV.js → chunk-TWAJICBN.js} +2 -2
  34. package/dist/{chunk-46RXRASB.js → chunk-TYIXG4VR.js} +3 -3
  35. package/dist/{chunk-EKQMQQ3U.js → chunk-UNLHHTKN.js} +2 -2
  36. package/dist/cli.js +20 -19
  37. package/dist/compounding/engine.js +4 -3
  38. package/dist/connectors/codex-materialize-runner.js +4 -3
  39. package/dist/connectors/index.js +4 -3
  40. package/dist/entity-retrieval.js +4 -3
  41. package/dist/index.js +25 -25
  42. package/dist/maintenance/memory-governance.js +4 -3
  43. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -3
  44. package/dist/maintenance/rebuild-memory-projection.js +5 -4
  45. package/dist/memory-cache.d.ts +43 -1
  46. package/dist/memory-cache.js +6 -1
  47. package/dist/namespaces/migrate.js +8 -7
  48. package/dist/namespaces/search.js +5 -4
  49. package/dist/namespaces/storage.js +4 -3
  50. package/dist/operator-toolkit.js +10 -9
  51. package/dist/orchestrator.js +15 -15
  52. package/dist/qmd-recall-cache.d.ts +4 -1
  53. package/dist/qmd-recall-cache.js +3 -1
  54. package/dist/qmd.js +3 -2
  55. package/dist/schemas.d.ts +24 -24
  56. package/dist/search/factory.js +4 -3
  57. package/dist/search/index.js +4 -3
  58. package/dist/semantic-consolidation.js +5 -4
  59. package/dist/semantic-rule-promotion.js +4 -3
  60. package/dist/semantic-rule-verifier.js +4 -3
  61. package/dist/storage.js +3 -2
  62. package/dist/verified-recall.js +4 -3
  63. package/package.json +1 -1
  64. package/src/memory-cache.test.ts +30 -0
  65. package/src/memory-cache.ts +129 -16
  66. package/src/qmd-recall-cache.ts +6 -0
  67. package/src/storage.ts +27 -3
  68. package/dist/chunk-4PLOQDBB.js.map +0 -1
  69. package/dist/chunk-CPPS65WS.js.map +0 -1
  70. /package/dist/{chunk-QFKRE7AU.js.map → chunk-256W7AXC.js.map} +0 -0
  71. /package/dist/{chunk-5PFIMBJJ.js.map → chunk-2EVZ5EN6.js.map} +0 -0
  72. /package/dist/{chunk-2VCTTEJM.js.map → chunk-7H7J3ZWN.js.map} +0 -0
  73. /package/dist/{chunk-QRSKPI62.js.map → chunk-7PCZGNG2.js.map} +0 -0
  74. /package/dist/{chunk-ZCMO46YY.js.map → chunk-A7EF2XRO.js.map} +0 -0
  75. /package/dist/{chunk-BNUAOLDK.js.map → chunk-ANJOULTP.js.map} +0 -0
  76. /package/dist/{chunk-7VWDC7AD.js.map → chunk-B57QYSWN.js.map} +0 -0
  77. /package/dist/{chunk-BKRIAXTU.js.map → chunk-D2EFNQMY.js.map} +0 -0
  78. /package/dist/{chunk-MBZAESQ3.js.map → chunk-F6O7IOS3.js.map} +0 -0
  79. /package/dist/{chunk-KI6QM5AV.js.map → chunk-GY3V3SUI.js.map} +0 -0
  80. /package/dist/{chunk-GGL7R2L2.js.map → chunk-MO77TWPS.js.map} +0 -0
  81. /package/dist/{chunk-VJYFXDCZ.js.map → chunk-NMPEJV5M.js.map} +0 -0
  82. /package/dist/{chunk-3R6OP33G.js.map → chunk-OYXVENIS.js.map} +0 -0
  83. /package/dist/{chunk-7KSPKZIQ.js.map → chunk-PXVFMQLD.js.map} +0 -0
  84. /package/dist/{chunk-FIS5RT6K.js.map → chunk-QXHBWFR3.js.map} +0 -0
  85. /package/dist/{chunk-SSSXWIBP.js.map → chunk-R2EBP6CM.js.map} +0 -0
  86. /package/dist/{chunk-6M4LYWA2.js.map → chunk-RP2U54GG.js.map} +0 -0
  87. /package/dist/{chunk-G2VVBWFU.js.map → chunk-RQGR3ETH.js.map} +0 -0
  88. /package/dist/{chunk-JI3LQFJH.js.map → chunk-TBLGI2LT.js.map} +0 -0
  89. /package/dist/{chunk-RVT6U6PV.js.map → chunk-TWAJICBN.js.map} +0 -0
  90. /package/dist/{chunk-46RXRASB.js.map → chunk-TYIXG4VR.js.map} +0 -0
  91. /package/dist/{chunk-EKQMQQ3U.js.map → chunk-UNLHHTKN.js.map} +0 -0
package/dist/schemas.d.ts CHANGED
@@ -35,8 +35,8 @@ declare const ProcedureStepExtractSchema: z.ZodObject<{
35
35
  expectedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
36
  optional: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
37
37
  }, "strip", z.ZodTypeAny, {
38
- order: number;
39
38
  intent: string;
39
+ order: number;
40
40
  toolCall?: {
41
41
  kind: string;
42
42
  signature: string;
@@ -44,8 +44,8 @@ declare const ProcedureStepExtractSchema: z.ZodObject<{
44
44
  expectedOutcome?: string | null | undefined;
45
45
  optional?: boolean | null | undefined;
46
46
  }, {
47
- order: number;
48
47
  intent: string;
48
+ order: number;
49
49
  toolCall?: {
50
50
  kind: string;
51
51
  signature: string;
@@ -78,8 +78,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
78
78
  expectedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
79
79
  optional: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
80
80
  }, "strip", z.ZodTypeAny, {
81
- order: number;
82
81
  intent: string;
82
+ order: number;
83
83
  toolCall?: {
84
84
  kind: string;
85
85
  signature: string;
@@ -87,8 +87,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
87
87
  expectedOutcome?: string | null | undefined;
88
88
  optional?: boolean | null | undefined;
89
89
  }, {
90
- order: number;
91
90
  intent: string;
91
+ order: number;
92
92
  toolCall?: {
93
93
  kind: string;
94
94
  signature: string;
@@ -158,8 +158,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
158
158
  promptedByQuestion?: string | null | undefined;
159
159
  scope?: "project" | "global" | null | undefined;
160
160
  procedureSteps?: {
161
- order: number;
162
161
  intent: string;
162
+ order: number;
163
163
  toolCall?: {
164
164
  kind: string;
165
165
  signature: string;
@@ -187,8 +187,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
187
187
  promptedByQuestion?: string | null | undefined;
188
188
  scope?: "project" | "global" | null | undefined;
189
189
  procedureSteps?: {
190
- order: number;
191
190
  intent: string;
191
+ order: number;
192
192
  toolCall?: {
193
193
  kind: string;
194
194
  signature: string;
@@ -216,8 +216,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
216
216
  promptedByQuestion?: string | null | undefined;
217
217
  scope?: "project" | "global" | null | undefined;
218
218
  procedureSteps?: {
219
- order: number;
220
219
  intent: string;
220
+ order: number;
221
221
  toolCall?: {
222
222
  kind: string;
223
223
  signature: string;
@@ -245,8 +245,8 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
245
245
  promptedByQuestion?: string | null | undefined;
246
246
  scope?: "project" | "global" | null | undefined;
247
247
  procedureSteps?: {
248
- order: number;
249
248
  intent: string;
249
+ order: number;
250
250
  toolCall?: {
251
251
  kind: string;
252
252
  signature: string;
@@ -386,8 +386,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
386
386
  expectedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
387
387
  optional: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
388
388
  }, "strip", z.ZodTypeAny, {
389
- order: number;
390
389
  intent: string;
390
+ order: number;
391
391
  toolCall?: {
392
392
  kind: string;
393
393
  signature: string;
@@ -395,8 +395,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
395
395
  expectedOutcome?: string | null | undefined;
396
396
  optional?: boolean | null | undefined;
397
397
  }, {
398
- order: number;
399
398
  intent: string;
399
+ order: number;
400
400
  toolCall?: {
401
401
  kind: string;
402
402
  signature: string;
@@ -466,8 +466,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
466
466
  promptedByQuestion?: string | null | undefined;
467
467
  scope?: "project" | "global" | null | undefined;
468
468
  procedureSteps?: {
469
- order: number;
470
469
  intent: string;
470
+ order: number;
471
471
  toolCall?: {
472
472
  kind: string;
473
473
  signature: string;
@@ -495,8 +495,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
495
495
  promptedByQuestion?: string | null | undefined;
496
496
  scope?: "project" | "global" | null | undefined;
497
497
  procedureSteps?: {
498
- order: number;
499
498
  intent: string;
499
+ order: number;
500
500
  toolCall?: {
501
501
  kind: string;
502
502
  signature: string;
@@ -524,8 +524,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
524
524
  promptedByQuestion?: string | null | undefined;
525
525
  scope?: "project" | "global" | null | undefined;
526
526
  procedureSteps?: {
527
- order: number;
528
527
  intent: string;
528
+ order: number;
529
529
  toolCall?: {
530
530
  kind: string;
531
531
  signature: string;
@@ -553,8 +553,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
553
553
  promptedByQuestion?: string | null | undefined;
554
554
  scope?: "project" | "global" | null | undefined;
555
555
  procedureSteps?: {
556
- order: number;
557
556
  intent: string;
557
+ order: number;
558
558
  toolCall?: {
559
559
  kind: string;
560
560
  signature: string;
@@ -640,8 +640,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
640
640
  promptedByQuestion?: string | null | undefined;
641
641
  scope?: "project" | "global" | null | undefined;
642
642
  procedureSteps?: {
643
- order: number;
644
643
  intent: string;
644
+ order: number;
645
645
  toolCall?: {
646
646
  kind: string;
647
647
  signature: string;
@@ -689,8 +689,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
689
689
  promptedByQuestion?: string | null | undefined;
690
690
  scope?: "project" | "global" | null | undefined;
691
691
  procedureSteps?: {
692
- order: number;
693
692
  intent: string;
693
+ order: number;
694
694
  toolCall?: {
695
695
  kind: string;
696
696
  signature: string;
@@ -754,8 +754,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
754
754
  expectedOutcome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
755
755
  optional: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
756
756
  }, "strip", z.ZodTypeAny, {
757
- order: number;
758
757
  intent: string;
758
+ order: number;
759
759
  toolCall?: {
760
760
  kind: string;
761
761
  signature: string;
@@ -763,8 +763,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
763
763
  expectedOutcome?: string | null | undefined;
764
764
  optional?: boolean | null | undefined;
765
765
  }, {
766
- order: number;
767
766
  intent: string;
767
+ order: number;
768
768
  toolCall?: {
769
769
  kind: string;
770
770
  signature: string;
@@ -834,8 +834,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
834
834
  promptedByQuestion?: string | null | undefined;
835
835
  scope?: "project" | "global" | null | undefined;
836
836
  procedureSteps?: {
837
- order: number;
838
837
  intent: string;
838
+ order: number;
839
839
  toolCall?: {
840
840
  kind: string;
841
841
  signature: string;
@@ -863,8 +863,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
863
863
  promptedByQuestion?: string | null | undefined;
864
864
  scope?: "project" | "global" | null | undefined;
865
865
  procedureSteps?: {
866
- order: number;
867
866
  intent: string;
867
+ order: number;
868
868
  toolCall?: {
869
869
  kind: string;
870
870
  signature: string;
@@ -892,8 +892,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
892
892
  promptedByQuestion?: string | null | undefined;
893
893
  scope?: "project" | "global" | null | undefined;
894
894
  procedureSteps?: {
895
- order: number;
896
895
  intent: string;
896
+ order: number;
897
897
  toolCall?: {
898
898
  kind: string;
899
899
  signature: string;
@@ -921,8 +921,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
921
921
  promptedByQuestion?: string | null | undefined;
922
922
  scope?: "project" | "global" | null | undefined;
923
923
  procedureSteps?: {
924
- order: number;
925
924
  intent: string;
925
+ order: number;
926
926
  toolCall?: {
927
927
  kind: string;
928
928
  signature: string;
@@ -1022,8 +1022,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1022
1022
  promptedByQuestion?: string | null | undefined;
1023
1023
  scope?: "project" | "global" | null | undefined;
1024
1024
  procedureSteps?: {
1025
- order: number;
1026
1025
  intent: string;
1026
+ order: number;
1027
1027
  toolCall?: {
1028
1028
  kind: string;
1029
1029
  signature: string;
@@ -1077,8 +1077,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1077
1077
  promptedByQuestion?: string | null | undefined;
1078
1078
  scope?: "project" | "global" | null | undefined;
1079
1079
  procedureSteps?: {
1080
- order: number;
1081
1080
  intent: string;
1081
+ order: number;
1082
1082
  toolCall?: {
1083
1083
  kind: string;
1084
1084
  signature: string;
@@ -2,7 +2,7 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-SSSXWIBP.js";
5
+ } from "../chunk-R2EBP6CM.js";
6
6
  import "../chunk-6G5JEN55.js";
7
7
  import "../chunk-CYEPCZN5.js";
8
8
  import "../chunk-GRYAECRV.js";
@@ -15,11 +15,12 @@ import "../chunk-7OGJQP7T.js";
15
15
  import "../chunk-E6ZDCOHM.js";
16
16
  import "../chunk-OIF36KGD.js";
17
17
  import "../chunk-7DTASS5T.js";
18
- import "../chunk-QRSKPI62.js";
18
+ import "../chunk-7PCZGNG2.js";
19
19
  import "../chunk-M3VYPE2H.js";
20
20
  import "../chunk-O75CRYGF.js";
21
21
  import "../chunk-3ONXXHQO.js";
22
- import "../chunk-CPPS65WS.js";
22
+ import "../chunk-AWJ2FHCF.js";
23
+ import "../chunk-42JKGUFJ.js";
23
24
  import "../chunk-JUC24CTX.js";
24
25
  import "../chunk-2ODBA7MQ.js";
25
26
  import "../chunk-PVGDJXVK.js";
@@ -2,7 +2,7 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-SSSXWIBP.js";
5
+ } from "../chunk-R2EBP6CM.js";
6
6
  import {
7
7
  MeilisearchBackend
8
8
  } from "../chunk-6G5JEN55.js";
@@ -29,11 +29,12 @@ import "../chunk-7OGJQP7T.js";
29
29
  import "../chunk-E6ZDCOHM.js";
30
30
  import "../chunk-OIF36KGD.js";
31
31
  import "../chunk-7DTASS5T.js";
32
- import "../chunk-QRSKPI62.js";
32
+ import "../chunk-7PCZGNG2.js";
33
33
  import "../chunk-M3VYPE2H.js";
34
34
  import "../chunk-O75CRYGF.js";
35
35
  import "../chunk-3ONXXHQO.js";
36
- import "../chunk-CPPS65WS.js";
36
+ import "../chunk-AWJ2FHCF.js";
37
+ import "../chunk-42JKGUFJ.js";
37
38
  import "../chunk-JUC24CTX.js";
38
39
  import "../chunk-2ODBA7MQ.js";
39
40
  import "../chunk-PVGDJXVK.js";
@@ -7,19 +7,20 @@ import {
7
7
  materializeAfterSemanticConsolidation,
8
8
  parseConsolidationResponse,
9
9
  parseOperatorAwareConsolidationResponse
10
- } from "./chunk-BKRIAXTU.js";
11
- import "./chunk-BNUAOLDK.js";
10
+ } from "./chunk-D2EFNQMY.js";
11
+ import "./chunk-ANJOULTP.js";
12
12
  import "./chunk-LN4YGHTM.js";
13
13
  import {
14
14
  resolveExtensionsRoot
15
15
  } from "./chunk-JLNBQWZ2.js";
16
16
  import "./chunk-3UXOZBHV.js";
17
- import "./chunk-4PLOQDBB.js";
17
+ import "./chunk-AX5O25EF.js";
18
18
  import "./chunk-M7XQSUBB.js";
19
19
  import "./chunk-5UZXUTVO.js";
20
20
  import "./chunk-J6A3CX5N.js";
21
21
  import "./chunk-AZBV4RRY.js";
22
- import "./chunk-CPPS65WS.js";
22
+ import "./chunk-AWJ2FHCF.js";
23
+ import "./chunk-42JKGUFJ.js";
23
24
  import "./chunk-RULE4VG5.js";
24
25
  import "./chunk-SCU65EZI.js";
25
26
  import "./chunk-MB5RSUW6.js";
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  promoteSemanticRuleFromMemory,
3
3
  setSemanticRulePromotionTestHooks
4
- } from "./chunk-FIS5RT6K.js";
5
- import "./chunk-4PLOQDBB.js";
4
+ } from "./chunk-QXHBWFR3.js";
5
+ import "./chunk-AX5O25EF.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-J6A3CX5N.js";
9
9
  import "./chunk-AZBV4RRY.js";
10
- import "./chunk-CPPS65WS.js";
10
+ import "./chunk-AWJ2FHCF.js";
11
+ import "./chunk-42JKGUFJ.js";
11
12
  import "./chunk-RULE4VG5.js";
12
13
  import "./chunk-SCU65EZI.js";
13
14
  import "./chunk-MB5RSUW6.js";
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  compareVerifiedSemanticRuleResults,
3
3
  searchVerifiedSemanticRules
4
- } from "./chunk-VJYFXDCZ.js";
5
- import "./chunk-4PLOQDBB.js";
4
+ } from "./chunk-NMPEJV5M.js";
5
+ import "./chunk-AX5O25EF.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-J6A3CX5N.js";
9
9
  import "./chunk-AZBV4RRY.js";
10
- import "./chunk-CPPS65WS.js";
10
+ import "./chunk-AWJ2FHCF.js";
11
+ import "./chunk-42JKGUFJ.js";
11
12
  import "./chunk-RULE4VG5.js";
12
13
  import "./chunk-SCU65EZI.js";
13
14
  import "./chunk-MB5RSUW6.js";
package/dist/storage.js CHANGED
@@ -9,12 +9,13 @@ import {
9
9
  parseEntityFile,
10
10
  serializeEntityFile,
11
11
  stripAttributesSuffix
12
- } from "./chunk-4PLOQDBB.js";
12
+ } from "./chunk-AX5O25EF.js";
13
13
  import "./chunk-M7XQSUBB.js";
14
14
  import "./chunk-5UZXUTVO.js";
15
15
  import "./chunk-J6A3CX5N.js";
16
16
  import "./chunk-AZBV4RRY.js";
17
- import "./chunk-CPPS65WS.js";
17
+ import "./chunk-AWJ2FHCF.js";
18
+ import "./chunk-42JKGUFJ.js";
18
19
  import "./chunk-RULE4VG5.js";
19
20
  import "./chunk-SCU65EZI.js";
20
21
  import "./chunk-MB5RSUW6.js";
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  compareVerifiedEpisodeResults,
3
3
  searchVerifiedEpisodes
4
- } from "./chunk-46RXRASB.js";
4
+ } from "./chunk-TYIXG4VR.js";
5
5
  import "./chunk-HQ6NIBL6.js";
6
- import "./chunk-4PLOQDBB.js";
6
+ import "./chunk-AX5O25EF.js";
7
7
  import "./chunk-M7XQSUBB.js";
8
8
  import "./chunk-5UZXUTVO.js";
9
9
  import "./chunk-J6A3CX5N.js";
10
10
  import "./chunk-AZBV4RRY.js";
11
- import "./chunk-CPPS65WS.js";
11
+ import "./chunk-AWJ2FHCF.js";
12
+ import "./chunk-42JKGUFJ.js";
12
13
  import "./chunk-RULE4VG5.js";
13
14
  import "./chunk-SCU65EZI.js";
14
15
  import "./chunk-MB5RSUW6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "9.3.658",
3
+ "version": "9.3.660",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2,10 +2,16 @@ import assert from "node:assert/strict";
2
2
  import test from "node:test";
3
3
 
4
4
  import {
5
+ ALL_CACHE_LAYERS,
5
6
  clearMemoryCache,
6
7
  getCachedQmdSearch,
8
+ invalidateAllForDir,
7
9
  setCachedQmdSearch,
8
10
  } from "./memory-cache.js";
11
+ import {
12
+ getCachedQmdRecall,
13
+ setCachedQmdRecall,
14
+ } from "./qmd-recall-cache.js";
9
15
 
10
16
  test("scoped memory cache invalidation clears QMD search results", () => {
11
17
  clearMemoryCache();
@@ -17,3 +23,27 @@ test("scoped memory cache invalidation clears QMD search results", () => {
17
23
 
18
24
  assert.equal(getCachedQmdSearch("qmd-cache-key"), null);
19
25
  });
26
+
27
+ test("invalidateAllForDir clears both QMD cache layers (issue #1535)", () => {
28
+ clearMemoryCache();
29
+ setCachedQmdSearch("qmd-search-key", [{ path: "stale.md" }]);
30
+ setCachedQmdRecall("qmd-recall-key", { bundle: "stale" }, { maxEntries: 16 });
31
+ assert.ok(getCachedQmdSearch("qmd-search-key"));
32
+ assert.ok(
33
+ getCachedQmdRecall("qmd-recall-key", { freshTtlMs: 60_000, staleTtlMs: 600_000 }),
34
+ );
35
+
36
+ invalidateAllForDir("/tmp/remnic-memory");
37
+
38
+ assert.equal(getCachedQmdSearch("qmd-search-key"), null);
39
+ assert.equal(
40
+ getCachedQmdRecall("qmd-recall-key", { freshTtlMs: 60_000, staleTtlMs: 600_000 }),
41
+ null,
42
+ );
43
+ });
44
+
45
+ test("ALL_CACHE_LAYERS registers the QMD recall layer alongside the QMD search layer", () => {
46
+ const names = ALL_CACHE_LAYERS.map((layer) => layer.name);
47
+ assert.ok(names.includes("qmd-search"));
48
+ assert.ok(names.includes("qmd-recall"));
49
+ });
@@ -1,4 +1,5 @@
1
1
  import type { EntityFile, MemoryFile } from "./types.js";
2
+ import { clearQmdRecallCache, qmdRecallCacheSize } from "./qmd-recall-cache.js";
2
3
 
3
4
  interface CacheEntry {
4
5
  memories: Map<string, MemoryFile>; // keyed by file path
@@ -52,8 +53,23 @@ export function setCachedArchivedMemories(baseDir: string, memories: MemoryFile[
52
53
  // Entity cache — same pattern as memory cache, but keyed by schema-aware parse inputs.
53
54
  const entityCacheByDir = new Map<string, { entities: EntityFile[]; version: number; loadedAt: number }>();
54
55
 
55
- function buildEntityCacheKey(baseDir: string, schemaKey: string = ""): string {
56
- return `${baseDir}\u0000${schemaKey}`;
56
+ /**
57
+ * Single normalization point for the entity-cache schema key (issue #1535).
58
+ * BOTH the set/get key builder and the prefix invalidation derive from here so
59
+ * `undefined` vs `""` (or any future normalization rule) can never diverge
60
+ * between the write path and the invalidate path (rule 38 cousin).
61
+ */
62
+ function normalizeEntitySchemaKey(schemaKey: string | undefined): string {
63
+ return schemaKey ?? "";
64
+ }
65
+
66
+ /** Prefix shared by every entity-cache key for a dir, regardless of schemaKey. */
67
+ function entityCacheKeyPrefix(baseDir: string): string {
68
+ return `${baseDir}\u0000`;
69
+ }
70
+
71
+ function buildEntityCacheKey(baseDir: string, schemaKey?: string): string {
72
+ return `${entityCacheKeyPrefix(baseDir)}${normalizeEntitySchemaKey(schemaKey)}`;
57
73
  }
58
74
 
59
75
  export function getCachedEntities(
@@ -81,7 +97,7 @@ export function setCachedEntities(
81
97
  }
82
98
 
83
99
  export function invalidateCachedEntities(baseDir: string): void {
84
- const prefix = `${baseDir}\u0000`;
100
+ const prefix = entityCacheKeyPrefix(baseDir);
85
101
  for (const key of entityCacheByDir.keys()) {
86
102
  if (key.startsWith(prefix)) entityCacheByDir.delete(key);
87
103
  }
@@ -174,21 +190,118 @@ export function setCachedQmdSearch(cacheKey: string, results: unknown[]): void {
174
190
  }
175
191
  }
176
192
 
193
+ /**
194
+ * Cache-layer registry (issue #1535).
195
+ *
196
+ * EVERY process-level cache that can serve memory-derived content is
197
+ * enumerated here, and the single invalidation chokepoint
198
+ * (`invalidateAllForDir`) iterates this list. Adding a new cache layer to
199
+ * this module (or qmd-recall-cache.ts) REQUIRES registering it here —
200
+ * otherwise mutations will never invalidate it (the exact bug this registry
201
+ * exists to prevent) and the enumerate-all-layers fitness test in
202
+ * tests/cache-invalidation-coherence.test.ts fails.
203
+ */
204
+ export interface MemoryCacheLayer {
205
+ /** Stable identifier used by tests and diagnostics. */
206
+ readonly name: string;
207
+ /** "dir" layers evict only entries for the given baseDir. "global" layers
208
+ * are fully cleared on any mutation: their keys embed queries, namespaces,
209
+ * and strategies rather than a storage dir, so a per-dir selective clear
210
+ * is not possible without recording the dir in each entry. Full clear is
211
+ * the simple-and-correct choice — these caches are re-warmable
212
+ * (issue #1535, implementation guide option (b)). */
213
+ readonly scope: "dir" | "global";
214
+ /** Evict entries for baseDir ("dir" scope) or everything ("global" scope). */
215
+ readonly invalidateForDir: (baseDir: string) => void;
216
+ /** Evict every entry across all dirs. */
217
+ readonly clearAll: () => void;
218
+ /** True when the layer still holds entries for baseDir ("dir" scope) or
219
+ * any entries at all ("global" scope). */
220
+ readonly hasEntriesFor: (baseDir: string) => boolean;
221
+ }
222
+
223
+ export const ALL_CACHE_LAYERS: readonly MemoryCacheLayer[] = [
224
+ {
225
+ name: "hot-memories",
226
+ scope: "dir",
227
+ invalidateForDir: (baseDir) => void hotCacheByDir.delete(baseDir),
228
+ clearAll: () => hotCacheByDir.clear(),
229
+ hasEntriesFor: (baseDir) => hotCacheByDir.has(baseDir),
230
+ },
231
+ {
232
+ name: "archive-memories",
233
+ scope: "dir",
234
+ invalidateForDir: (baseDir) => void archiveCacheByDir.delete(baseDir),
235
+ clearAll: () => archiveCacheByDir.clear(),
236
+ hasEntriesFor: (baseDir) => archiveCacheByDir.has(baseDir),
237
+ },
238
+ {
239
+ name: "entities",
240
+ scope: "dir",
241
+ invalidateForDir: (baseDir) => invalidateCachedEntities(baseDir),
242
+ clearAll: () => entityCacheByDir.clear(),
243
+ hasEntriesFor: (baseDir) => {
244
+ const prefix = entityCacheKeyPrefix(baseDir);
245
+ for (const key of entityCacheByDir.keys()) {
246
+ if (key.startsWith(prefix)) return true;
247
+ }
248
+ return false;
249
+ },
250
+ },
251
+ {
252
+ name: "derived-episode-map",
253
+ scope: "dir",
254
+ invalidateForDir: (baseDir) => void episodeMapByDir.delete(baseDir),
255
+ clearAll: () => episodeMapByDir.clear(),
256
+ hasEntriesFor: (baseDir) => episodeMapByDir.has(baseDir),
257
+ },
258
+ {
259
+ name: "derived-rule-memories",
260
+ scope: "dir",
261
+ invalidateForDir: (baseDir) => void ruleMemoriesByDir.delete(baseDir),
262
+ clearAll: () => ruleMemoriesByDir.clear(),
263
+ hasEntriesFor: (baseDir) => ruleMemoriesByDir.has(baseDir),
264
+ },
265
+ {
266
+ name: "qmd-search",
267
+ scope: "global",
268
+ invalidateForDir: () => qmdSearchCache.clear(),
269
+ clearAll: () => qmdSearchCache.clear(),
270
+ hasEntriesFor: () => qmdSearchCache.size > 0,
271
+ },
272
+ {
273
+ name: "qmd-recall",
274
+ scope: "global",
275
+ invalidateForDir: () => clearQmdRecallCache(),
276
+ clearAll: () => clearQmdRecallCache(),
277
+ hasEntriesFor: () => qmdRecallCacheSize() > 0,
278
+ },
279
+ ];
280
+
281
+ /**
282
+ * The single invalidation chokepoint (issue #1535, rule 37).
283
+ *
284
+ * Every memory/entity mutation path must route through this function —
285
+ * storage.ts calls it from its internal invalidation funnels
286
+ * (invalidateAllMemoriesCache / invalidateColdMemoriesCache /
287
+ * bumpMemoryStatusVersion / setSecureStoreKey). Nothing may clear an
288
+ * individual layer ad hoc: partial clears are how the stale-recall bug
289
+ * happened (qmdRecallCache was never invalidated on mutations, so recall
290
+ * served pre-edit bundles for the remainder of its fresh/stale TTL window).
291
+ */
292
+ export function invalidateAllForDir(baseDir: string): void {
293
+ for (const layer of ALL_CACHE_LAYERS) {
294
+ layer.invalidateForDir(baseDir);
295
+ }
296
+ }
297
+
177
298
  export function clearMemoryCache(baseDir?: string): void {
178
299
  if (baseDir) {
179
- hotCacheByDir.delete(baseDir);
180
- archiveCacheByDir.delete(baseDir);
181
- invalidateCachedEntities(baseDir);
182
- episodeMapByDir.delete(baseDir);
183
- ruleMemoriesByDir.delete(baseDir);
184
- qmdSearchCache.clear();
185
- } else {
186
- hotCacheByDir.clear();
187
- archiveCacheByDir.clear();
188
- entityCacheByDir.clear();
189
- episodeMapByDir.clear();
190
- ruleMemoriesByDir.clear();
191
- qmdSearchCache.clear();
300
+ invalidateAllForDir(baseDir);
301
+ return;
302
+ }
303
+ for (const layer of ALL_CACHE_LAYERS) {
304
+ layer.clearAll();
192
305
  }
193
306
  }
194
307
 
@@ -116,3 +116,9 @@ export function setCachedQmdRecall<T>(
116
116
  export function clearQmdRecallCache(): void {
117
117
  qmdRecallCache.clear();
118
118
  }
119
+
120
+ /** Number of cached recall entries. Used by the cache-layer registry in
121
+ * memory-cache.ts (`ALL_CACHE_LAYERS`) and its fitness tests (issue #1535). */
122
+ export function qmdRecallCacheSize(): number {
123
+ return qmdRecallCache.size;
124
+ }