@remnic/core 9.3.697 → 9.3.698

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 (102) hide show
  1. package/dist/access-boundary.d.ts +1 -1
  2. package/dist/access-boundary.js +6 -6
  3. package/dist/access-cli.js +18 -18
  4. package/dist/access-http.d.ts +1 -1
  5. package/dist/access-http.js +9 -9
  6. package/dist/access-mcp.d.ts +1 -1
  7. package/dist/access-mcp.js +8 -8
  8. package/dist/access-operations.d.ts +1 -1
  9. package/dist/access-operations.js +7 -7
  10. package/dist/{access-service-BqBQeUJd.d.ts → access-service-DftqtNUy.d.ts} +10 -0
  11. package/dist/access-service.d.ts +1 -1
  12. package/dist/access-service.js +5 -5
  13. package/dist/access-surface-catalog.d.ts +1 -1
  14. package/dist/briefing.js +3 -3
  15. package/dist/causal-consolidation.js +4 -4
  16. package/dist/{chunk-75KYTVFK.js → chunk-2K64VH66.js} +2 -2
  17. package/dist/{chunk-62Q2QA4Z.js → chunk-2KJG6ZZK.js} +2 -2
  18. package/dist/{chunk-AYMVRRDP.js → chunk-2ULWWAQH.js} +2 -2
  19. package/dist/{chunk-HKE7UREW.js → chunk-A62RAIBN.js} +2 -2
  20. package/dist/{chunk-6YXRSHKG.js → chunk-ANZLT74L.js} +2 -2
  21. package/dist/{chunk-N5UHWRGK.js → chunk-COEZR6F5.js} +2 -2
  22. package/dist/{chunk-3LLLRQPV.js → chunk-CQ4PGFMC.js} +3 -3
  23. package/dist/{chunk-AUGA5JZD.js → chunk-E6GOVHHJ.js} +3 -3
  24. package/dist/{chunk-WHJ4WTHH.js → chunk-EZWQZYLK.js} +2 -2
  25. package/dist/{chunk-4X3LO5OF.js → chunk-FEB7W5JG.js} +103 -15
  26. package/dist/chunk-FEB7W5JG.js.map +1 -0
  27. package/dist/{chunk-GPHHYOQC.js → chunk-FSEQXHEZ.js} +2 -2
  28. package/dist/{chunk-F5J5OVWF.js → chunk-HZ5DRA4Q.js} +13 -13
  29. package/dist/{chunk-2IYYMOQZ.js → chunk-IZ5E6ZTK.js} +4 -4
  30. package/dist/{chunk-FLV6YAS3.js → chunk-JYVD2XZ4.js} +13 -13
  31. package/dist/{chunk-TAEO72ZC.js → chunk-LIWU4QI6.js} +4 -4
  32. package/dist/{chunk-4LM6W5SX.js → chunk-M4DQWUKX.js} +2 -2
  33. package/dist/{chunk-WDLJCSZ4.js → chunk-MRX6S22R.js} +2 -2
  34. package/dist/{chunk-TFZKNDVY.js → chunk-N55RJT4N.js} +2 -2
  35. package/dist/{chunk-AEPUGOPY.js → chunk-PJIHCOGV.js} +2 -2
  36. package/dist/{chunk-UZW4UWIK.js → chunk-RIC5U67B.js} +2 -2
  37. package/dist/{chunk-BQEZPX6Z.js → chunk-SIDSEXUG.js} +2 -2
  38. package/dist/{chunk-4FXCAY7J.js → chunk-SJQ4HY3E.js} +2 -2
  39. package/dist/{chunk-5JTY7OXQ.js → chunk-UDDSC6PO.js} +5 -5
  40. package/dist/{chunk-5MNL24XY.js → chunk-XFG3PVZE.js} +27 -7
  41. package/dist/chunk-XFG3PVZE.js.map +1 -0
  42. package/dist/{chunk-TLIVN7IU.js → chunk-XL5RSHZP.js} +2 -2
  43. package/dist/{chunk-VXNJGBUK.js → chunk-YY2HGKWR.js} +2 -2
  44. package/dist/{cli-DBDgdvh9.d.ts → cli-DUMkkdLl.d.ts} +1 -1
  45. package/dist/cli.d.ts +2 -2
  46. package/dist/cli.js +20 -20
  47. package/dist/compounding/engine.js +3 -3
  48. package/dist/connectors/codex-materialize-runner.js +3 -3
  49. package/dist/connectors/index.js +3 -3
  50. package/dist/entity-retrieval.js +3 -3
  51. package/dist/extraction-faithfulness.d.ts +23 -3
  52. package/dist/extraction-faithfulness.js +1 -1
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.js +26 -26
  55. package/dist/maintenance/memory-governance.js +3 -3
  56. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  57. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  58. package/dist/mcp-memory-inspector-app.d.ts +1 -1
  59. package/dist/namespaces/migrate.js +4 -4
  60. package/dist/namespaces/storage.js +3 -3
  61. package/dist/operator-toolkit.js +8 -8
  62. package/dist/orchestration/maintenance.js +5 -5
  63. package/dist/orchestrator.js +14 -14
  64. package/dist/semantic-consolidation.js +4 -4
  65. package/dist/semantic-rule-promotion.js +3 -3
  66. package/dist/semantic-rule-verifier.js +3 -3
  67. package/dist/storage.js +2 -2
  68. package/dist/verified-recall.js +3 -3
  69. package/package.json +2 -2
  70. package/src/access-service.ts +17 -0
  71. package/src/coding/session-delta-surfaces.test.ts +185 -1
  72. package/src/coding/session-delta-surfaces.ts +30 -1
  73. package/src/coding/session-delta.test.ts +46 -0
  74. package/src/coding/session-delta.ts +18 -1
  75. package/src/extraction-faithfulness.test.ts +149 -5
  76. package/src/extraction-faithfulness.ts +195 -21
  77. package/dist/chunk-4X3LO5OF.js.map +0 -1
  78. package/dist/chunk-5MNL24XY.js.map +0 -1
  79. /package/dist/{chunk-75KYTVFK.js.map → chunk-2K64VH66.js.map} +0 -0
  80. /package/dist/{chunk-62Q2QA4Z.js.map → chunk-2KJG6ZZK.js.map} +0 -0
  81. /package/dist/{chunk-AYMVRRDP.js.map → chunk-2ULWWAQH.js.map} +0 -0
  82. /package/dist/{chunk-HKE7UREW.js.map → chunk-A62RAIBN.js.map} +0 -0
  83. /package/dist/{chunk-6YXRSHKG.js.map → chunk-ANZLT74L.js.map} +0 -0
  84. /package/dist/{chunk-N5UHWRGK.js.map → chunk-COEZR6F5.js.map} +0 -0
  85. /package/dist/{chunk-3LLLRQPV.js.map → chunk-CQ4PGFMC.js.map} +0 -0
  86. /package/dist/{chunk-AUGA5JZD.js.map → chunk-E6GOVHHJ.js.map} +0 -0
  87. /package/dist/{chunk-WHJ4WTHH.js.map → chunk-EZWQZYLK.js.map} +0 -0
  88. /package/dist/{chunk-GPHHYOQC.js.map → chunk-FSEQXHEZ.js.map} +0 -0
  89. /package/dist/{chunk-F5J5OVWF.js.map → chunk-HZ5DRA4Q.js.map} +0 -0
  90. /package/dist/{chunk-2IYYMOQZ.js.map → chunk-IZ5E6ZTK.js.map} +0 -0
  91. /package/dist/{chunk-FLV6YAS3.js.map → chunk-JYVD2XZ4.js.map} +0 -0
  92. /package/dist/{chunk-TAEO72ZC.js.map → chunk-LIWU4QI6.js.map} +0 -0
  93. /package/dist/{chunk-4LM6W5SX.js.map → chunk-M4DQWUKX.js.map} +0 -0
  94. /package/dist/{chunk-WDLJCSZ4.js.map → chunk-MRX6S22R.js.map} +0 -0
  95. /package/dist/{chunk-TFZKNDVY.js.map → chunk-N55RJT4N.js.map} +0 -0
  96. /package/dist/{chunk-AEPUGOPY.js.map → chunk-PJIHCOGV.js.map} +0 -0
  97. /package/dist/{chunk-UZW4UWIK.js.map → chunk-RIC5U67B.js.map} +0 -0
  98. /package/dist/{chunk-BQEZPX6Z.js.map → chunk-SIDSEXUG.js.map} +0 -0
  99. /package/dist/{chunk-4FXCAY7J.js.map → chunk-SJQ4HY3E.js.map} +0 -0
  100. /package/dist/{chunk-5JTY7OXQ.js.map → chunk-UDDSC6PO.js.map} +0 -0
  101. /package/dist/{chunk-TLIVN7IU.js.map → chunk-XL5RSHZP.js.map} +0 -0
  102. /package/dist/{chunk-VXNJGBUK.js.map → chunk-YY2HGKWR.js.map} +0 -0
@@ -2,9 +2,9 @@ import {
2
2
  NamespaceStorageRouter,
3
3
  resolveDefaultNamespaceRoot,
4
4
  resolveNamespaceStorageRoot
5
- } from "../chunk-75KYTVFK.js";
5
+ } from "../chunk-2K64VH66.js";
6
6
  import "../chunk-ZFXCQPNO.js";
7
- import "../chunk-UZW4UWIK.js";
7
+ import "../chunk-RIC5U67B.js";
8
8
  import "../chunk-M7XQSUBB.js";
9
9
  import "../chunk-5UZXUTVO.js";
10
10
  import "../chunk-5GPPACXK.js";
@@ -20,7 +20,7 @@ import "../chunk-RULE4VG5.js";
20
20
  import "../chunk-LDXUBPMO.js";
21
21
  import "../chunk-DM2T26WE.js";
22
22
  import "../chunk-FVQJYWH7.js";
23
- import "../chunk-4X3LO5OF.js";
23
+ import "../chunk-FEB7W5JG.js";
24
24
  import "../chunk-G7D6GZ5J.js";
25
25
  import "../chunk-VF4XKTX3.js";
26
26
  import "../chunk-5J4OL7TJ.js";
@@ -11,13 +11,13 @@ import {
11
11
  summarizeMemoryWorthLegacyCounters,
12
12
  summarizeObservationThroughput,
13
13
  summarizeTierDistribution
14
- } from "./chunk-5JTY7OXQ.js";
15
- import "./chunk-VXNJGBUK.js";
14
+ } from "./chunk-UDDSC6PO.js";
15
+ import "./chunk-YY2HGKWR.js";
16
16
  import "./chunk-7XH7VJN4.js";
17
17
  import "./chunk-YBPYIAA5.js";
18
- import "./chunk-BQEZPX6Z.js";
19
- import "./chunk-4LM6W5SX.js";
20
- import "./chunk-75KYTVFK.js";
18
+ import "./chunk-SIDSEXUG.js";
19
+ import "./chunk-M4DQWUKX.js";
20
+ import "./chunk-2K64VH66.js";
21
21
  import "./chunk-KFY3SGN7.js";
22
22
  import "./chunk-CMTINOFS.js";
23
23
  import "./chunk-BVKCV2ZY.js";
@@ -28,7 +28,7 @@ import "./chunk-NDAH7BJ5.js";
28
28
  import "./chunk-Z5LAYHGJ.js";
29
29
  import "./chunk-OO42R444.js";
30
30
  import "./chunk-K6MV3TRQ.js";
31
- import "./chunk-6YXRSHKG.js";
31
+ import "./chunk-ANZLT74L.js";
32
32
  import "./chunk-VPAFWWCL.js";
33
33
  import "./chunk-QQW2LIEA.js";
34
34
  import "./chunk-SANZHXY2.js";
@@ -51,7 +51,7 @@ import "./chunk-3ONXXHQO.js";
51
51
  import "./chunk-KF74X62T.js";
52
52
  import "./chunk-2LSZVONP.js";
53
53
  import "./chunk-DEUNUKTD.js";
54
- import "./chunk-UZW4UWIK.js";
54
+ import "./chunk-RIC5U67B.js";
55
55
  import "./chunk-M7XQSUBB.js";
56
56
  import "./chunk-5UZXUTVO.js";
57
57
  import "./chunk-5GPPACXK.js";
@@ -67,7 +67,7 @@ import "./chunk-RULE4VG5.js";
67
67
  import "./chunk-LDXUBPMO.js";
68
68
  import "./chunk-DM2T26WE.js";
69
69
  import "./chunk-FVQJYWH7.js";
70
- import "./chunk-4X3LO5OF.js";
70
+ import "./chunk-FEB7W5JG.js";
71
71
  import "./chunk-G7D6GZ5J.js";
72
72
  import "./chunk-VF4XKTX3.js";
73
73
  import "./chunk-5J4OL7TJ.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MaintenanceScheduler
3
- } from "../chunk-WDLJCSZ4.js";
3
+ } from "../chunk-MRX6S22R.js";
4
4
  import "../chunk-666A3MOW.js";
5
- import "../chunk-4LM6W5SX.js";
6
- import "../chunk-75KYTVFK.js";
5
+ import "../chunk-M4DQWUKX.js";
6
+ import "../chunk-2K64VH66.js";
7
7
  import "../chunk-ZFXCQPNO.js";
8
- import "../chunk-UZW4UWIK.js";
8
+ import "../chunk-RIC5U67B.js";
9
9
  import "../chunk-M7XQSUBB.js";
10
10
  import "../chunk-5UZXUTVO.js";
11
11
  import "../chunk-5GPPACXK.js";
@@ -21,7 +21,7 @@ import "../chunk-RULE4VG5.js";
21
21
  import "../chunk-LDXUBPMO.js";
22
22
  import "../chunk-DM2T26WE.js";
23
23
  import "../chunk-FVQJYWH7.js";
24
- import "../chunk-4X3LO5OF.js";
24
+ import "../chunk-FEB7W5JG.js";
25
25
  import "../chunk-G7D6GZ5J.js";
26
26
  import "../chunk-VF4XKTX3.js";
27
27
  import "../chunk-5J4OL7TJ.js";
@@ -28,10 +28,10 @@ import {
28
28
  sanitizeSessionKeyForFilename,
29
29
  shouldFilterLifecycleRecallCandidate,
30
30
  summarizeGraphShadowComparison
31
- } from "./chunk-FLV6YAS3.js";
31
+ } from "./chunk-JYVD2XZ4.js";
32
32
  import "./chunk-VKJHM6PL.js";
33
33
  import "./chunk-7HYPN2GC.js";
34
- import "./chunk-WDLJCSZ4.js";
34
+ import "./chunk-MRX6S22R.js";
35
35
  import "./chunk-666A3MOW.js";
36
36
  import "./chunk-HHLLAQGZ.js";
37
37
  import "./chunk-X5J3JZR3.js";
@@ -43,7 +43,7 @@ import "./chunk-UWK5OXUJ.js";
43
43
  import "./chunk-O7GOFAM3.js";
44
44
  import "./chunk-MDJURR27.js";
45
45
  import "./chunk-7N4KAIGN.js";
46
- import "./chunk-AEPUGOPY.js";
46
+ import "./chunk-PJIHCOGV.js";
47
47
  import "./chunk-UFS7OXGL.js";
48
48
  import "./chunk-TECVW3JP.js";
49
49
  import "./chunk-UHGBNIOS.js";
@@ -90,26 +90,26 @@ import "./chunk-TH7WMHVK.js";
90
90
  import "./chunk-OQH5XUH3.js";
91
91
  import "./chunk-6HEM6HTQ.js";
92
92
  import "./chunk-ZA2S2VLL.js";
93
- import "./chunk-N5UHWRGK.js";
93
+ import "./chunk-COEZR6F5.js";
94
94
  import "./chunk-UU6MVCJ6.js";
95
95
  import "./chunk-PYPOFEMK.js";
96
96
  import "./chunk-EO5QWINU.js";
97
97
  import "./chunk-VEWZZM3H.js";
98
98
  import "./chunk-2PRQG7PV.js";
99
99
  import "./chunk-WIWPSQYU.js";
100
- import "./chunk-GPHHYOQC.js";
100
+ import "./chunk-FSEQXHEZ.js";
101
101
  import "./chunk-2F6NP3NT.js";
102
102
  import "./chunk-TERNBNJB.js";
103
103
  import "./chunk-QRDOSYOR.js";
104
- import "./chunk-TFZKNDVY.js";
104
+ import "./chunk-N55RJT4N.js";
105
105
  import "./chunk-ZRWB5D4H.js";
106
106
  import "./chunk-PONNZ54D.js";
107
107
  import "./chunk-S4DDLTPX.js";
108
108
  import "./chunk-SFQ6QNL7.js";
109
109
  import "./chunk-33JBK2XP.js";
110
- import "./chunk-BQEZPX6Z.js";
111
- import "./chunk-4LM6W5SX.js";
112
- import "./chunk-75KYTVFK.js";
110
+ import "./chunk-SIDSEXUG.js";
111
+ import "./chunk-M4DQWUKX.js";
112
+ import "./chunk-2K64VH66.js";
113
113
  import "./chunk-KFY3SGN7.js";
114
114
  import "./chunk-TQNRI55H.js";
115
115
  import "./chunk-6GUG4YNM.js";
@@ -123,8 +123,8 @@ import "./chunk-LMDRGRJ2.js";
123
123
  import "./chunk-OD4FM2U7.js";
124
124
  import "./chunk-OKTXM5H4.js";
125
125
  import "./chunk-PBH4JUAB.js";
126
- import "./chunk-4FXCAY7J.js";
127
- import "./chunk-AYMVRRDP.js";
126
+ import "./chunk-SJQ4HY3E.js";
127
+ import "./chunk-2ULWWAQH.js";
128
128
  import "./chunk-UUH4YQOF.js";
129
129
  import "./chunk-JLNBQWZ2.js";
130
130
  import "./chunk-3UXOZBHV.js";
@@ -174,8 +174,8 @@ import "./chunk-KF74X62T.js";
174
174
  import "./chunk-2LSZVONP.js";
175
175
  import "./chunk-DEUNUKTD.js";
176
176
  import "./chunk-YN4ZT4CW.js";
177
- import "./chunk-WHJ4WTHH.js";
178
- import "./chunk-UZW4UWIK.js";
177
+ import "./chunk-EZWQZYLK.js";
178
+ import "./chunk-RIC5U67B.js";
179
179
  import "./chunk-M7XQSUBB.js";
180
180
  import "./chunk-5UZXUTVO.js";
181
181
  import "./chunk-5GPPACXK.js";
@@ -191,7 +191,7 @@ import "./chunk-RULE4VG5.js";
191
191
  import "./chunk-LDXUBPMO.js";
192
192
  import "./chunk-DM2T26WE.js";
193
193
  import "./chunk-FVQJYWH7.js";
194
- import "./chunk-4X3LO5OF.js";
194
+ import "./chunk-FEB7W5JG.js";
195
195
  import "./chunk-G7D6GZ5J.js";
196
196
  import "./chunk-VF4XKTX3.js";
197
197
  import "./chunk-5J4OL7TJ.js";
@@ -7,14 +7,14 @@ import {
7
7
  materializeAfterSemanticConsolidation,
8
8
  parseConsolidationResponse,
9
9
  parseOperatorAwareConsolidationResponse
10
- } from "./chunk-4FXCAY7J.js";
11
- import "./chunk-AYMVRRDP.js";
10
+ } from "./chunk-SJQ4HY3E.js";
11
+ import "./chunk-2ULWWAQH.js";
12
12
  import "./chunk-UUH4YQOF.js";
13
13
  import {
14
14
  resolveExtensionsRoot
15
15
  } from "./chunk-JLNBQWZ2.js";
16
16
  import "./chunk-3UXOZBHV.js";
17
- import "./chunk-UZW4UWIK.js";
17
+ import "./chunk-RIC5U67B.js";
18
18
  import "./chunk-M7XQSUBB.js";
19
19
  import "./chunk-5UZXUTVO.js";
20
20
  import "./chunk-5GPPACXK.js";
@@ -30,7 +30,7 @@ import "./chunk-RULE4VG5.js";
30
30
  import "./chunk-LDXUBPMO.js";
31
31
  import "./chunk-DM2T26WE.js";
32
32
  import "./chunk-FVQJYWH7.js";
33
- import "./chunk-4X3LO5OF.js";
33
+ import "./chunk-FEB7W5JG.js";
34
34
  import {
35
35
  CONSOLIDATION_OPERATORS,
36
36
  isConsolidationOperator,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  promoteSemanticRuleFromMemory,
3
3
  setSemanticRulePromotionTestHooks
4
- } from "./chunk-62Q2QA4Z.js";
5
- import "./chunk-UZW4UWIK.js";
4
+ } from "./chunk-2KJG6ZZK.js";
5
+ import "./chunk-RIC5U67B.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-5GPPACXK.js";
@@ -18,7 +18,7 @@ import "./chunk-RULE4VG5.js";
18
18
  import "./chunk-LDXUBPMO.js";
19
19
  import "./chunk-DM2T26WE.js";
20
20
  import "./chunk-FVQJYWH7.js";
21
- import "./chunk-4X3LO5OF.js";
21
+ import "./chunk-FEB7W5JG.js";
22
22
  import "./chunk-G7D6GZ5J.js";
23
23
  import "./chunk-VF4XKTX3.js";
24
24
  import "./chunk-5J4OL7TJ.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  compareVerifiedSemanticRuleResults,
3
3
  searchVerifiedSemanticRules
4
- } from "./chunk-TFZKNDVY.js";
5
- import "./chunk-UZW4UWIK.js";
4
+ } from "./chunk-N55RJT4N.js";
5
+ import "./chunk-RIC5U67B.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-5GPPACXK.js";
@@ -18,7 +18,7 @@ import "./chunk-RULE4VG5.js";
18
18
  import "./chunk-LDXUBPMO.js";
19
19
  import "./chunk-DM2T26WE.js";
20
20
  import "./chunk-FVQJYWH7.js";
21
- import "./chunk-4X3LO5OF.js";
21
+ import "./chunk-FEB7W5JG.js";
22
22
  import "./chunk-G7D6GZ5J.js";
23
23
  import "./chunk-VF4XKTX3.js";
24
24
  import "./chunk-5J4OL7TJ.js";
package/dist/storage.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  normalizeEntityName,
9
9
  parseEntityFile,
10
10
  serializeEntityFile
11
- } from "./chunk-UZW4UWIK.js";
11
+ } from "./chunk-RIC5U67B.js";
12
12
  import "./chunk-M7XQSUBB.js";
13
13
  import "./chunk-5UZXUTVO.js";
14
14
  import "./chunk-5GPPACXK.js";
@@ -26,7 +26,7 @@ import "./chunk-RULE4VG5.js";
26
26
  import "./chunk-LDXUBPMO.js";
27
27
  import "./chunk-DM2T26WE.js";
28
28
  import "./chunk-FVQJYWH7.js";
29
- import "./chunk-4X3LO5OF.js";
29
+ import "./chunk-FEB7W5JG.js";
30
30
  import "./chunk-G7D6GZ5J.js";
31
31
  import "./chunk-VF4XKTX3.js";
32
32
  import "./chunk-5J4OL7TJ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  compareVerifiedEpisodeResults,
3
3
  searchVerifiedEpisodes
4
- } from "./chunk-GPHHYOQC.js";
4
+ } from "./chunk-FSEQXHEZ.js";
5
5
  import "./chunk-7FL4CNPV.js";
6
- import "./chunk-UZW4UWIK.js";
6
+ import "./chunk-RIC5U67B.js";
7
7
  import "./chunk-M7XQSUBB.js";
8
8
  import "./chunk-5UZXUTVO.js";
9
9
  import "./chunk-5GPPACXK.js";
@@ -19,7 +19,7 @@ import "./chunk-RULE4VG5.js";
19
19
  import "./chunk-LDXUBPMO.js";
20
20
  import "./chunk-DM2T26WE.js";
21
21
  import "./chunk-FVQJYWH7.js";
22
- import "./chunk-4X3LO5OF.js";
22
+ import "./chunk-FEB7W5JG.js";
23
23
  import "./chunk-G7D6GZ5J.js";
24
24
  import "./chunk-VF4XKTX3.js";
25
25
  import "./chunk-5J4OL7TJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "9.3.697",
3
+ "version": "9.3.698",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2941,7 +2941,7 @@
2941
2941
  "core"
2942
2942
  ],
2943
2943
  "peerDependencies": {
2944
- "@remnic/coding-graph": "^9.3.697"
2944
+ "@remnic/coding-graph": "^9.3.698"
2945
2945
  },
2946
2946
  "peerDependenciesMeta": {
2947
2947
  "@remnic/coding-graph": {
@@ -4665,9 +4665,26 @@ export class EngramAccessService {
4665
4665
  // non-default namespaces route to memoryDir/namespaces/<token>, so
4666
4666
  // session-delta markers must read/write from the routed tree, mirroring
4667
4667
  // the decision/architecture siblings (cursor review).
4668
+ // Issue #1630 fix 2: gate the marker write on the WRITE-path resolver
4669
+ // — it mirrors memory_store's exact authorization (base ACL for coding
4670
+ // overlays, selectedLayer.writable for scope-profiles), not the raw
4671
+ // canWriteNamespace which misses overlay/profile grants (cursor+codex
4672
+ // review). A throw = read-only caller; delta computed but no advance.
4673
+ let canAdvanceState = false;
4674
+ try {
4675
+ await this.resolveCodingScopedWriteNamespace({
4676
+ namespace: req.namespace,
4677
+ sessionKey: req.sessionKey,
4678
+ authenticatedPrincipal,
4679
+ });
4680
+ canAdvanceState = true;
4681
+ } catch {
4682
+ canAdvanceState = false;
4683
+ }
4668
4684
  return {
4669
4685
  memoryDir: storage.dir,
4670
4686
  namespace: ns,
4687
+ canAdvanceState,
4671
4688
  } satisfies DeltaSurfaceStorage;
4672
4689
  },
4673
4690
  gitInvoker: (cwd, args) => {
@@ -81,9 +81,10 @@ function makeContext(overrides: Partial<DeltaSurfaceContext> = {}): DeltaSurface
81
81
  // shimming its filesystem. The handler imports readLastSeenState / writeLastSeenState
82
82
  // from ./session-delta.js, which hit the real fs. We point memoryDir at a
83
83
  // temp dir per-test.
84
- import { mkdtemp, rm } from "node:fs/promises";
84
+ import { mkdtemp, rm, readFile } from "node:fs/promises";
85
85
  import { tmpdir } from "node:os";
86
86
  import path from "node:path";
87
+ import { sessionDeltaStatePath } from "./session-delta.js";
87
88
 
88
89
  async function makeTempStorage(): Promise<{ storage: DeltaSurfaceStorage; cleanup: () => Promise<void> }> {
89
90
  const dir = await mkdtemp(path.join(tmpdir(), "delta-surface-"));
@@ -383,3 +384,186 @@ test("handler/get: state file is created after a successful first_run", async ()
383
384
  await cleanup();
384
385
  }
385
386
  });
387
+
388
+ // ──────────────────────────────────────────────────────────────────────────
389
+ // Issue #1630 fix 1 — uncapped totals surface in the changed response
390
+ // ──────────────────────────────────────────────────────────────────────────
391
+
392
+ test("handler/get: changed response surfaces uncapped totals alongside capped slices (issue #1630 fix 1)", async () => {
393
+ const { storage, cleanup } = await makeTempStorage();
394
+ try {
395
+ // Seed: first run on headA.
396
+ const invoker1 = makeInvoker([
397
+ { args: ["rev-parse", "HEAD"], stdout: "headA\n" },
398
+ ]);
399
+ await handleCodingDelta(
400
+ { subcommand: "get", sessionKey: "s1" },
401
+ makeContext({ resolveStorage: async () => storage, gitInvoker: invoker1 }),
402
+ );
403
+
404
+ // Now head moved to headB with 25 commits / 60 files — both exceed the
405
+ // caps (MAX_DELTA_COMMITS=20, MAX_DELTA_FILES=50).
406
+ const sep = "\x1f";
407
+ const commitBlocks = Array.from({ length: 25 }, (_, i) => [
408
+ `sha${i}${sep}fix ${i}`,
409
+ "",
410
+ `src/file${i}.ts`,
411
+ "",
412
+ ].join("\n"));
413
+ // Add 35 more distinct files so the total crosses the file cap.
414
+ const extraFiles = Array.from({ length: 35 }, (_, i) => `extra${i}.ts`);
415
+ const lastBlock = [
416
+ `shaExtra${sep}extra`,
417
+ "",
418
+ ...extraFiles,
419
+ "",
420
+ ].join("\n");
421
+ const log = [...commitBlocks, lastBlock].join("\n");
422
+ const invoker2 = makeInvoker([
423
+ { args: ["rev-parse", "HEAD"], stdout: "headB\n" },
424
+ { args: ["log", "--reverse", "--pretty=format:%H\x1f%s", "--name-only", "headA..headB"], stdout: log },
425
+ ]);
426
+ const result = await handleCodingDelta(
427
+ { subcommand: "get", sessionKey: "s1" },
428
+ makeContext({ resolveStorage: async () => storage, gitInvoker: invoker2 }),
429
+ );
430
+ if (!("ok" in result) || !result.ok || result.kind !== "changed") {
431
+ assert.fail(`expected changed, got ${JSON.stringify(result)}`);
432
+ return;
433
+ }
434
+ // Capped display slices.
435
+ assert.equal(result.delta.commits.length, 20, "commits slice must be capped to MAX_DELTA_COMMITS");
436
+ assert.equal(result.delta.touchedFiles.length, 50, "touchedFiles slice must be capped to MAX_DELTA_FILES");
437
+ // Uncapped totals — the TRUE delta size, NOT the capped length.
438
+ assert.equal(result.delta.totalCommits, 26, "totalCommits must report the uncapped commit count");
439
+ assert.ok(
440
+ result.delta.totalTouchedFiles > 50,
441
+ `totalTouchedFiles must report the uncapped file count (got ${result.delta.totalTouchedFiles})`,
442
+ );
443
+ } finally {
444
+ await cleanup();
445
+ }
446
+ });
447
+
448
+ // ──────────────────────────────────────────────────────────────────────────
449
+ // Issue #1630 fix 2 — read-only callers do NOT advance the state marker
450
+ // ──────────────────────────────────────────────────────────────────────────
451
+
452
+ test("handler/get: read-only caller (canAdvanceState=false) does NOT advance the state marker (issue #1630 fix 2)", async () => {
453
+ const { storage, cleanup } = await makeTempStorage();
454
+ try {
455
+ // Seed headA with a WRITE-capable caller (default canAdvanceState=true).
456
+ const invoker1 = makeInvoker([
457
+ { args: ["rev-parse", "HEAD"], stdout: "headA\n" },
458
+ ]);
459
+ await handleCodingDelta(
460
+ { subcommand: "get", sessionKey: "s1" },
461
+ makeContext({
462
+ resolveStorage: async () => ({ ...storage, canAdvanceState: true }),
463
+ gitInvoker: invoker1,
464
+ }),
465
+ );
466
+ // Confirm the marker landed at headA.
467
+ const statePath = sessionDeltaStatePath(storage.memoryDir, storage.namespace);
468
+ const seeded = JSON.parse(await readFile(statePath, "utf8"));
469
+ assert.equal(seeded.head, "headA");
470
+
471
+ // A READ-ONLY caller (canAdvanceState=false) on headB. The delta is
472
+ // computed and returned, but the marker MUST NOT advance.
473
+ const sep = "\x1f";
474
+ const log = [
475
+ `shaRO${sep}read only commit`,
476
+ "",
477
+ "src/ro.ts",
478
+ "",
479
+ ].join("\n");
480
+ const invoker2 = makeInvoker([
481
+ { args: ["rev-parse", "HEAD"], stdout: "headB\n" },
482
+ { args: ["log", "--reverse", "--pretty=format:%H\x1f%s", "--name-only", "headA..headB"], stdout: log },
483
+ ]);
484
+ const result = await handleCodingDelta(
485
+ { subcommand: "get", sessionKey: "s1" },
486
+ makeContext({
487
+ resolveStorage: async () => ({ ...storage, canAdvanceState: false }),
488
+ gitInvoker: invoker2,
489
+ }),
490
+ );
491
+ // The delta is still computed and returned — read-only callers see the data.
492
+ if (!("ok" in result) || !result.ok || result.kind !== "changed") {
493
+ assert.fail(`expected changed, got ${JSON.stringify(result)}`);
494
+ return;
495
+ }
496
+ assert.equal(result.delta.commits.length, 1);
497
+ // But the persisted marker stayed at headA — read-only did not advance it.
498
+ const persisted = JSON.parse(await readFile(statePath, "utf8"));
499
+ assert.equal(persisted.head, "headA", "read-only caller must NOT advance the state marker");
500
+ } finally {
501
+ await cleanup();
502
+ }
503
+ });
504
+
505
+ test("handler/get: write-capable caller (canAdvanceState=true) DOES advance the state marker (issue #1630 fix 2)", async () => {
506
+ const { storage, cleanup } = await makeTempStorage();
507
+ try {
508
+ // Seed headA.
509
+ const invoker1 = makeInvoker([
510
+ { args: ["rev-parse", "HEAD"], stdout: "headA\n" },
511
+ ]);
512
+ await handleCodingDelta(
513
+ { subcommand: "get", sessionKey: "s1" },
514
+ makeContext({
515
+ resolveStorage: async () => ({ ...storage, canAdvanceState: true }),
516
+ gitInvoker: invoker1,
517
+ }),
518
+ );
519
+
520
+ // A WRITE-capable caller on headB — the marker MUST advance.
521
+ const sep = "\x1f";
522
+ const log = [
523
+ `shaW${sep}write commit`,
524
+ "",
525
+ "src/w.ts",
526
+ "",
527
+ ].join("\n");
528
+ const invoker2 = makeInvoker([
529
+ { args: ["rev-parse", "HEAD"], stdout: "headB\n" },
530
+ { args: ["log", "--reverse", "--pretty=format:%H\x1f%s", "--name-only", "headA..headB"], stdout: log },
531
+ ]);
532
+ await handleCodingDelta(
533
+ { subcommand: "get", sessionKey: "s1" },
534
+ makeContext({
535
+ resolveStorage: async () => ({ ...storage, canAdvanceState: true }),
536
+ gitInvoker: invoker2,
537
+ }),
538
+ );
539
+ const statePath = sessionDeltaStatePath(storage.memoryDir, storage.namespace);
540
+ const persisted = JSON.parse(await readFile(statePath, "utf8"));
541
+ assert.equal(persisted.head, "headB", "write-capable caller must advance the state marker");
542
+ } finally {
543
+ await cleanup();
544
+ }
545
+ });
546
+
547
+ test("handler/get: canAdvanceState defaults to true when omitted (back-compat) (issue #1630 fix 2)", async () => {
548
+ // Legacy callers that don't set canAdvanceState keep pre-fix behavior:
549
+ // the marker advances. This protects the existing surface contract.
550
+ const { storage, cleanup } = await makeTempStorage();
551
+ try {
552
+ const invoker = makeInvoker([
553
+ { args: ["rev-parse", "HEAD"], stdout: "headDefault\n" },
554
+ ]);
555
+ await handleCodingDelta(
556
+ { subcommand: "get", sessionKey: "s1" },
557
+ makeContext({
558
+ // canAdvanceState intentionally omitted.
559
+ resolveStorage: async () => storage,
560
+ gitInvoker: invoker,
561
+ }),
562
+ );
563
+ const statePath = sessionDeltaStatePath(storage.memoryDir, storage.namespace);
564
+ const persisted = JSON.parse(await readFile(statePath, "utf8"));
565
+ assert.equal(persisted.head, "headDefault", "omitted canAdvanceState defaults to true (back-compat)");
566
+ } finally {
567
+ await cleanup();
568
+ }
569
+ });
@@ -117,6 +117,16 @@ export type DeltaSurfaceResponse =
117
117
  delta: {
118
118
  commits: ReadonlyArray<{ sha: string; subject: string }>;
119
119
  touchedFiles: readonly string[];
120
+ /**
121
+ * Uncapped total commit count (the {@link commits} slice is capped
122
+ * for transport). Issue #1630 fix 1.
123
+ */
124
+ totalCommits: number;
125
+ /**
126
+ * Uncapped total touched-file count (the {@link touchedFiles} slice
127
+ * is capped for transport). Issue #1630 fix 1.
128
+ */
129
+ totalTouchedFiles: number;
120
130
  summaryLine: string;
121
131
  };
122
132
  nextState: LastSeenState;
@@ -161,6 +171,15 @@ export interface DeltaSurfaceStorage {
161
171
  readonly memoryDir: string;
162
172
  /** The resolved coding-scoped namespace — basis for the state filename. */
163
173
  readonly namespace: string;
174
+ /**
175
+ * Whether the calling principal may WRITE the namespace — i.e. advance the
176
+ * last-seen-head marker. Read-only callers (e.g. a principal with read-but-
177
+ * not-write on the shared namespace) receive the computed delta but the
178
+ * state file is NOT advanced, so they cannot move another principal's
179
+ * baseline (issue #1630 fix 2). Defaults to `true` when omitted so existing
180
+ * callers (and the surface contract tests) keep their pre-fix behavior.
181
+ */
182
+ readonly canAdvanceState?: boolean;
164
183
  }
165
184
 
166
185
  /**
@@ -265,13 +284,21 @@ async function deltaGet(
265
284
  // 5. Persist the new state (rule 25 + rule 54). Failures here are logged
266
285
  // but do NOT fail the operation — the delta was computed; the next
267
286
  // session may re-derive it. A write failure surfaces in doctor/xray.
287
+ //
288
+ // Issue #1630 fix 2: the marker write is gated on a write-capable
289
+ // principal. A read-only caller (e.g. read-but-not-write on the shared
290
+ // namespace) receives the computed delta but does NOT advance the state
291
+ // marker, so it cannot move another principal's baseline. The default
292
+ // is `true` so legacy callers and the surface contract tests keep their
293
+ // pre-fix behavior.
294
+ const canAdvanceState = storage.canAdvanceState !== false;
268
295
  let nextState: LastSeenState | null = null;
269
296
  if (result.ok) {
270
297
  nextState = result.nextState;
271
298
  } else if (result.code === "unreachable_head") {
272
299
  nextState = result.nextState;
273
300
  }
274
- if (nextState) {
301
+ if (nextState && canAdvanceState) {
275
302
  try {
276
303
  await writeLastSeenState(statePath, nextState);
277
304
  } catch (err) {
@@ -312,6 +339,8 @@ async function deltaGet(
312
339
  delta: {
313
340
  commits: result.delta.commits,
314
341
  touchedFiles: result.delta.touchedFiles,
342
+ totalCommits: result.delta.totalCommits,
343
+ totalTouchedFiles: result.delta.totalTouchedFiles,
315
344
  summaryLine: result.delta.summaryLine,
316
345
  },
317
346
  nextState: result.nextState,
@@ -171,6 +171,52 @@ test("computeSessionDelta caps a large delta to MAX constants", () => {
171
171
  assert.equal(result.delta.touchedFiles.length, MAX_DELTA_FILES);
172
172
  });
173
173
 
174
+ test("computeSessionDelta reports uncapped totals alongside capped slices (issue #1630 fix 1)", () => {
175
+ // A repo exceeding both caps: 100 commits / 200 files. The slices are
176
+ // capped for transport, but totalCommits/totalTouchedFiles must report
177
+ // the TRUE delta size so summaries never under-report.
178
+ const commitCount = 100;
179
+ const fileCount = 200;
180
+ const commits: GitCommit[] = Array.from({ length: commitCount }, (_, i) => ({
181
+ sha: `c${i}`,
182
+ subject: `s ${i}`,
183
+ }));
184
+ const files = Array.from({ length: fileCount }, (_, i) => `f${i}.ts`);
185
+ const result = computeSessionDelta(PRIOR, slice("head", commits, files));
186
+ if (!result.ok || result.kind !== "changed") {
187
+ assert.fail(`expected changed, got ${JSON.stringify(result)}`);
188
+ return;
189
+ }
190
+ // Capped display lists — transport-sized.
191
+ assert.equal(result.delta.commits.length, MAX_DELTA_COMMITS);
192
+ assert.equal(result.delta.touchedFiles.length, MAX_DELTA_FILES);
193
+ // Uncapped totals — the true delta size, NOT the capped slice length.
194
+ assert.equal(result.delta.totalCommits, commitCount);
195
+ assert.equal(result.delta.totalTouchedFiles, fileCount);
196
+ // The summary line must report the UNCAPPED totals, not the capped slice
197
+ // length — otherwise the briefing under-reports the delta size (codex review).
198
+ assert.match(result.delta.summaryLine, /100 commits, 200 files touched/);
199
+ assert.ok(!result.delta.summaryLine.match(/^.*20 commits, 50 files/), "summary must NOT use capped counts");
200
+ });
201
+
202
+ test("computeSessionDelta totals equal slice lengths when under the cap (issue #1630 fix 1)", () => {
203
+ // Below the caps, totals === slice lengths (no information lost).
204
+ const commits: GitCommit[] = [
205
+ { sha: "u1", subject: "under cap 1" },
206
+ { sha: "u2", subject: "under cap 2" },
207
+ ];
208
+ const files = ["a.ts", "b.ts", "c.ts"];
209
+ const result = computeSessionDelta(PRIOR, slice("head", commits, files));
210
+ if (!result.ok || result.kind !== "changed") {
211
+ assert.fail(`expected changed, got ${JSON.stringify(result)}`);
212
+ return;
213
+ }
214
+ assert.equal(result.delta.totalCommits, 2);
215
+ assert.equal(result.delta.totalTouchedFiles, 3);
216
+ assert.equal(result.delta.totalCommits, result.delta.commits.length);
217
+ assert.equal(result.delta.totalTouchedFiles, result.delta.touchedFiles.length);
218
+ });
219
+
174
220
  // ──────────────────────────────────────────────────────────────────────────
175
221
  // State persistence — rule 25 (write after compute) + rule 54 (temp+rename)
176
222
  // ──────────────────────────────────────────────────────────────────────────