dsh-layers-hippocampus 1.7.2 → 1.7.3
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/CHANGELOG.md +2049 -1976
- package/README.md +395 -395
- package/docs/ARCHITECTURE.zh.md +2 -2
- package/index.js +114 -5
- package/package.json +75 -75
- package/src/config.js +48 -0
- package/src/context/smartPrune.js +188 -0
- package/src/context/windowGuard.js +30 -0
- package/src/errors.js +4 -0
- package/src/memory.js +119 -5
- package/src/policy.js +14 -0
- package/src/rawStore.js +161 -23
- package/src/sensitive.js +130 -0
- package/src/tombstones.js +157 -0
- package/src/webRoutes.js +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,1976 +1,2049 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to `dsh-layers-hippocampus` are documented here.
|
|
4
|
-
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
|
-
and the project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
-
|
|
7
|
-
## [1.7.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`
|
|
14
|
-
|
|
15
|
-
`
|
|
16
|
-
`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
`
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
`
|
|
93
|
-
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
(`
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`
|
|
122
|
-
`
|
|
123
|
-
`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- **Added —
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
`
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
`
|
|
166
|
-
`
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- **
|
|
178
|
-
|
|
179
|
-
`
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
`
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
- **Added —
|
|
230
|
-
`
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
- **
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
- **
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- **
|
|
273
|
-
`
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
`
|
|
285
|
-
|
|
286
|
-
`
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
`
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
- **Changed —
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
`
|
|
349
|
-
|
|
350
|
-
`
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
>
|
|
371
|
-
>
|
|
372
|
-
>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
`
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
`
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
- **
|
|
423
|
-
`
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
`
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
`
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
- **
|
|
454
|
-
|
|
455
|
-
`
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
`
|
|
502
|
-
`
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
`
|
|
517
|
-
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
`
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
`
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
`
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
`
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
`
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
`
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
`
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
`
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
- **
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
- **
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
is
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
- **`
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
- **
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
- **
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
the
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
`
|
|
844
|
-
|
|
845
|
-
- **
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
`
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
`
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
`
|
|
923
|
-
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
- **
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
(`
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
`
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
-
|
|
1005
|
-
and
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
the
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
- New `test/v156.
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
`
|
|
1100
|
-
- New `test/v156.
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
- New `test/v156.
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
- New `test/v156.
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
-
|
|
1110
|
-
|
|
1111
|
-
`
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
(
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
- **
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
`
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
`
|
|
1197
|
-
|
|
1198
|
-
`
|
|
1199
|
-
a
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
(
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
-
|
|
1266
|
-
`
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
(
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
-
|
|
1422
|
-
|
|
1423
|
-
`
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
`
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
- **
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
`
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
###
|
|
1499
|
-
|
|
1500
|
-
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
`
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
`
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
`
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
and
|
|
1599
|
-
|
|
1600
|
-
- **
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
-
|
|
1622
|
-
`
|
|
1623
|
-
`
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
`
|
|
1630
|
-
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
`
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
`
|
|
1736
|
-
`
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
`
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
- **
|
|
1764
|
-
|
|
1765
|
-
-
|
|
1766
|
-
|
|
1767
|
-
`
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
-
|
|
1774
|
-
|
|
1775
|
-
-
|
|
1776
|
-
|
|
1777
|
-
## [1.4.
|
|
1778
|
-
|
|
1779
|
-
### Added
|
|
1780
|
-
|
|
1781
|
-
- **
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
- **
|
|
1791
|
-
`
|
|
1792
|
-
the
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
-
|
|
1876
|
-
`
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
`
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
- **
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
`
|
|
1964
|
-
|
|
1965
|
-
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `dsh-layers-hippocampus` are documented here.
|
|
4
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
|
+
and the project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [1.7.3] — 2026-11-27
|
|
8
|
+
|
|
9
|
+
**上下文物理折叠、raw 墓碑移位、敏感标签硬拦截,以及交接标记随压力过期:
|
|
10
|
+
四件都不靠原生压缩,全部落在插件自己的存储与读取层。**
|
|
11
|
+
|
|
12
|
+
- **Added — 模块一:上下文物理裁剪(`src/context/smartPrune.js`)**。`guardRequest` 在
|
|
13
|
+
fail-fast **之前**新增「2.5 physical pruning」一步:当 `context.smartPrune.enabled !== false`
|
|
14
|
+
且 `projectedRatio >= threshold`(默认 0.85)时,把冗长的历史轮次**在原地替换**成折叠指针——
|
|
15
|
+
`session.append('compaction/prune', {...})` 记录被遮蔽的 seq 区间,再以
|
|
16
|
+
`surfaceOp: { op: 'replace', startSeq, endSeq }` 写回同类型事件,内容只剩一行:
|
|
17
|
+
`[System: 此段包含 N 轮关于 [标签] 的细节,已折叠。原文 ID: ev_xxx。若需要,请使用 recall 工具检索。]`。
|
|
18
|
+
`tool/call` 与 `tool/result` 成对保留(折叠只挑 user/assistant 长轮,跳过工具配对与已折叠节点),
|
|
19
|
+
折叠后重新测量压力并把 `ratioAfter` 记进 `runtime.lastSmartPrune`。指针优先写事件 ID,
|
|
20
|
+
没有事件 ID 时退化为 `raw:turn_<seq>_<role>` —— raw 存储的 turn_id 是确定性的,
|
|
21
|
+
所以指针永远能被 `deep_raw` 反查回来。
|
|
22
|
+
- **Added — 模块二:raw 墓碑移出热路径(`src/tombstones.js` + `state/raw-tombstones.json`)**。
|
|
23
|
+
此前 `forget` 往 `raw/*.jsonl` **追加**一行 `{type:'raw_tombstone'}`:raw 是追加日志,
|
|
24
|
+
墓碑会让文件只增不减,而且每次 `deep_raw` 都要扫全部分片才能知道哪些内容已死。
|
|
25
|
+
现在 tombstone 只写覆盖层 `state/raw-tombstones.json`,**双层键**——
|
|
26
|
+
`turnIds`(整回合,O(1) 命中)与 `contentHashes`(片段级,覆盖同一句话在别处的复读)。
|
|
27
|
+
`forget()` 先用 `raw.turnIdsForHashes()` 按 `sha256(content)` 反查 turn_id,双键一起写;
|
|
28
|
+
`scan()` / 归档扫描 / `has()` 全部改走 `_isTombstoned()`。
|
|
29
|
+
`maintain()` 里加了一次性迁移:`stripLegacyTombstoneLines()` 逐分片重写文件,
|
|
30
|
+
把旧版 `raw_tombstone` 行搬进覆盖层(先 `add` 保住键,再 `.tmp-clean` + rename),
|
|
31
|
+
所以老数据升级后 raw 字节数会**下降**而不是增长。
|
|
32
|
+
- **Added — 模块三:敏感标签与读时硬拦截(`src/sensitive.js`)**。`privacy:secret` 是「整条记录
|
|
33
|
+
私密」的一刀切;实际上一条记录里往往只有一句是密钥。Pre-Ingest 现在按内容分类,命中就追加
|
|
34
|
+
`sensitive:api_key` / `sensitive:pii` / `sensitive:credential` 标签(`meta.sensitive`
|
|
35
|
+
同时留证据)。读取层默认**物理剔除**:`recall` 把这些记录从 hits 里拿掉并记
|
|
36
|
+
`sensitive-withheld:<n>`,`deep_raw` 连 snippet 都不给(snippet 本身就是泄漏面),
|
|
37
|
+
只有显式 `allow_sensitive: true` 才放行;工具侧参数同名 `allow_sensitive`。
|
|
38
|
+
审计类场景需要「知道被拦了多少」但不该看到内容时,用 `memory_admin` 的计数。
|
|
39
|
+
标签归一化对 `sensitive:` 家族开了例外(保留 `_`),因为它是**读取契约**,
|
|
40
|
+
不能被 `normaliseTagToken` 改写成 `sensitive:api-key`。
|
|
41
|
+
- **Changed — 契约变更(旧测试同步更新)**:`test/v14.test.js` 的「deep_raw 返回脱敏片段」
|
|
42
|
+
改为「默认拦截、放行后可见」;「forget 追加墓碑行」改为「写覆盖层、分片不增长」;
|
|
43
|
+
`test/v162.nonlinear.test.js` 的 distill-prune 墓碑断言改查覆盖层。
|
|
44
|
+
- **Fixed — `pruneDistilled()` 仍在用旧的定位参数签名**(`tombstone([...hashes], {at})`),
|
|
45
|
+
1.7.3 换成对象签名后它静默写不进键;测试把这条抓了出来,已改为
|
|
46
|
+
`tombstone({ hashes: [...hashes], at: now })`。
|
|
47
|
+
- **Fixed — 交接标记永不过期("总是提前交接上下文")**。`state/handoff.json` 一旦
|
|
48
|
+
`active: true`,`runtime.promptState()` 就**每一轮**把
|
|
49
|
+
`[交接标记] 上下文已接近原生窗口上限…` 追加到提示词尾部。而唯一会清它的两条路径都不在
|
|
50
|
+
prompt 上:① `checkHandoff()` 只在 `guardRequest` 的 `hardExceeded`(真塞不下)分支里被调用;
|
|
51
|
+
② 1.6.3 起同一会话内不再换 session id,`marker.sessionId === usage.sessionId`,
|
|
52
|
+
stale-session 分支也不触发。于是外部压缩(host compaction / billion-context)把
|
|
53
|
+
900k 压回 120k 之后,标记仍然字面为真地宣称"接近上限",模型学到的行为就是**提前交接**。
|
|
54
|
+
- **Added — `src/context/windowGuard.js`:`relievedDecision()` + `HANDOFF_CLEAR_RATIO = 0.5`**。
|
|
55
|
+
两条独立判据,任一成立即视为"压力已解除":`projectedRatio <= context.handoffClearRatio`
|
|
56
|
+
(绝对,默认 0.5);或 `projectedRatio <= markerRatio - 0.3`(相对,即"这段对话被压缩过",
|
|
57
|
+
`RELIEF_COLLAPSE_DELTA = 0.3`)。
|
|
58
|
+
- **Added — `Memory#maintainHandoffMarker({ usage, ratio, threshold })`**(同步):读标记 →
|
|
59
|
+
用**宿主的真实测量**(经 `guardRequest` 传入的 `state.projectedRatio`)判压 →
|
|
60
|
+
`clearHandoff({ reason: 'pressure-relieved:<reason>', consumedBy: '<session>:ratio=<r>' })`。
|
|
61
|
+
这里有一条必须写死的保守规则:**"没有测量"不等于"压力为 0"**。真实宿主从不调用
|
|
62
|
+
`observeSessionTokens()`,本地会话计数器通常是空的;把它读成 0 会把一条仍然真实的标记清掉,
|
|
63
|
+
所以缺测量时返回 `reason: 'no-pressure'` 并保持标记不动。
|
|
64
|
+
- **Changed — 压力读数只有一个来源**:`guardRequest` 每次请求都记
|
|
65
|
+
`runtime.lastPressure = { ratio, tokens, at }` 并在**所有**请求上跑一次 upkeep(原来只在
|
|
66
|
+
fail-fast 上跑);`promptState()` 只复用**新鲜**(`HANDOFF_PRESSURE_FRESH_MS = 5 分钟`)的读数,
|
|
67
|
+
过期或缺失时保持标记——不会因为旧读数误杀。`onAgentCreated` 会重置 `lastPressure`,
|
|
68
|
+
避免新会话继承上一个会话的读数。
|
|
69
|
+
- **Added — 配置项 `context.handoffClearRatio`**(默认 `0.5`,允许 `0.1–0.9`),
|
|
70
|
+
可在设置页/配置补丁里直接改;`src/webRoutes.js` 白名单同步收录。
|
|
71
|
+
- **Tests**:新增 `test/v173.pipeline.test.js` 7 例(指针形状、surface-replace 后长文本变指针且
|
|
72
|
+
tool 配对完整、保护窗口、forget 后分片字节不变/覆盖层有双键/deep_raw 扫不到、
|
|
73
|
+
敏感分类、`recall` 与 `deep_raw` 双向拦截与放行、`filterSensitive` 计数)。
|
|
74
|
+
另加 `test/v173.handoff.test.js` 9 例:两条解除判据的单元边界(含"小幅抖动不算解除")、
|
|
75
|
+
空计数器不清标记、低压力消耗标记并写明 reason、高压力保留、相对塌陷在绝对阈值之上也能清、
|
|
76
|
+
**端到端复现原 bug**(86% 时注入、收到 12% 新鲜读数后不再注入且后续轮次保持干净)、
|
|
77
|
+
读数过期/缺失时保持注入、配置范围校验。
|
|
78
|
+
全量 **571/571**(88 个测试文件)。
|
|
79
|
+
|
|
80
|
+
## [1.7.2] — 2026-11-25
|
|
81
|
+
|
|
82
|
+
**设置页结构重构:17 张卡片按用途收进 5 个分组,左侧竖排目录导航;能力与配置一字未改。**
|
|
83
|
+
|
|
84
|
+
- **Changed — 设置页从「一条长滚动」变成「分组 + 目录」**:`ui/client.js` 里 17 个
|
|
85
|
+
`Section` 按用途分成五组——`identity`(身份与行为)、`context`(上下文与注入)、
|
|
86
|
+
`ingest`(摄入与蒸馏)、`retention`(留存与归档)、`space`(空间与存储)。
|
|
87
|
+
每组由 `SettingsGroup` 渲染(组名 + 一句说明 + 卡片原样),卡片本身**逐字搬进**
|
|
88
|
+
`SettingsIdentityGroup` / `SettingsContextGroup` / `SettingsIngestGroup` /
|
|
89
|
+
`SettingsRetentionGroup` / `SettingsSpaceGroup`,控件、校验、跨字段联动一个字没改。
|
|
90
|
+
- **Changed — 左侧竖排目录**:`SettingsNav` 是**独立滚动的固定栏**——外面的 shell 高度在挂载时量一次
|
|
91
|
+
(`window.innerHeight - shell.top - 24`,`resize` 时重量),目录与卡片各自拥有滚动条,
|
|
92
|
+
点目录滚卡片、滚卡片目录不动。最初用 `position: sticky` 实现,实际**不生效**:宿主 shell
|
|
93
|
+
的 overflow 包裹层不是滚动容器,sticky 子元素会随内容一起滚走。滚动高亮改用
|
|
94
|
+
`IntersectionObserver`(`root` 指向卡片滚动容器,`rootMargin: '-8% 0px -70% 0px'`)。
|
|
95
|
+
- **Changed — 表单宽度**:`maxWidth` 720 → 980,目录 148px 固定、内容 `flex: 1 1 460px`,
|
|
96
|
+
窄屏自动折行(`flexWrap: 'wrap'`)。
|
|
97
|
+
- **保持不变 — 简洁模式**:仍然只显示四组(`identity` / `context` / `retention` / `space`),
|
|
98
|
+
`ingest` 整组不渲染;`hidden: simpleMode` 语义与 `SIMPLE_PATCH_KEYS` 白名单完全照旧。
|
|
99
|
+
- **Tests**:`test/v163.ui.test.js` 新增 `settingsBody()`,把 `MemorySettings` 与五个分组
|
|
100
|
+
组件体拼起来断言卡片存在/被隐藏,避免结构重构后测试假绿或假红。全量 **555/555**(87 个测试文件)。
|
|
101
|
+
|
|
102
|
+
## [1.7.1] — 2026-11-24
|
|
103
|
+
|
|
104
|
+
**把注入面从“多给点信息”改成“只给还没过期的信息”:摘要卫生常开,提示标签单向静默,
|
|
105
|
+
任务模式补一行当前状态。三项都来自一次真实长会话的复盘,不是理论优化。**
|
|
106
|
+
|
|
107
|
+
- **Fixed — 注入摘要里的过期计数(常开,不受模式开关影响)**:交接摘要、L3 人格行、
|
|
108
|
+
`[Active Task]` 都会带上写那一刻的簿记数字(`events 348`、`reviews total 346 due 337`、
|
|
109
|
+
`version 1.6.9`)。它们**写入时是真的,几分钟后就假了**,模型要先读一遍再花 token 纠正。
|
|
110
|
+
新增 `src/promptHygiene.js`:`stripVolatile()` 只删**簿记子句**(版本号、`key: N`、
|
|
111
|
+
`gen-000131`、ISO 时间戳、`N 条/个/分片`),**刻意不删没有键名的裸数字**——否则
|
|
112
|
+
`854,668 + 256,000 > 1,048,576` 这类教训会被一起删掉;带「是/为/需要/必须/禁止/不要」
|
|
113
|
+
的句子不按计数量删除。`hygienicSummary()` 再补一个快照时间戳
|
|
114
|
+
(`(snapshot … · counters stripped as stale)`),让读者知道这段文字有多旧。
|
|
115
|
+
三个注入点(冷启动摘要、人格行、活动任务)全部走同一条路径。
|
|
116
|
+
- **Fixed — 冷启动尾部泄漏摘要事件**:`[Previous Context Tail]` 在缺少 `tailTurns` 时回退到
|
|
117
|
+
「最近业务事件」,而交接摘要事件本身带 `folded_summary` 标签,于是**摘要被当成一轮对话**
|
|
118
|
+
再注入一次(连同它的过期计数)。现在排除摘要事件,其余每行也过一遍卫生。
|
|
119
|
+
- **Added — 提示标签的单向静默(任务模式)**:`[Memory Hints]` 过去会一直展示同一个不相关
|
|
120
|
+
标签,从不换来一次 `recall`(实测 2 次出现、0 次使用)。新增 `src/hintFeedback.js`
|
|
121
|
+
(`state/hint-feedback.json`,schema 1):每个标签记 `shown` / `recalled`;连续
|
|
122
|
+
`context.hintsIdleSilenceAfter`(默认 **8**)次展示且 `recalled === 0` → **永久静默**。
|
|
123
|
+
单向是关键:静默后即使偶然被 recall 也不会自动复活,只有 `revive()` 或删状态文件才能恢复
|
|
124
|
+
—— 自动复活只会把同一个错误再学一遍。计数只在真的渲染出 hints 时才增加;召回路径
|
|
125
|
+
(`injectRecall`)记录 `recalled`,这是唯一能让标签留下的信号。
|
|
126
|
+
- **Added — `[Task State]` 当前状态行(任务模式)**:记忆回答「去过哪里」,构建/调试会话
|
|
127
|
+
还需要「现在在哪」。任务模式在 Prompt **最末**注入一行
|
|
128
|
+
(`repo@branch · HEAD <sha7> · window 291k/1048k (host) · maintained 12m ago`):
|
|
129
|
+
HEAD 直接读 `.git/HEAD` + loose ref(**不 spawn git**,5 秒缓存),窗口压力取宿主上报值,
|
|
130
|
+
硬上限 `context.statePointer.maxChars`(默认 300,超出截断加 `…`)。
|
|
131
|
+
它排在所有易变段之后,前缀缓存不受影响。
|
|
132
|
+
- **Added — 任务 / 专家模式(`context.mode`)**:`task`(默认)启用上面两项;
|
|
133
|
+
`expert` 保留全部提示、不注入状态行、不咨询提示闭环。设置页「上下文窗口」新增
|
|
134
|
+
运行模式下拉、静默阈值数字框与状态行开关;`context.mode` 也进了简洁模式白名单
|
|
135
|
+
(同一个开关在两种视图里都必须可改,否则等于骗人)。枚举校验:拼错直接 fail-fast。
|
|
136
|
+
- **Observability**:`capabilities.mode` 与 `capabilities.hints`(`tracked` / `silenced` /
|
|
137
|
+
`silencedTags`)进入 `/stats`;`/memory status` 显示运行模式、提示反馈统计与被静默的标签
|
|
138
|
+
——「一个标签为什么不再出现」必须能从接口回答,而不是靠猜。
|
|
139
|
+
- **Tests**:`test/v171.mode.test.js`(7 例)锁定模式默认与枚举校验、8 次空手展示后的单向
|
|
140
|
+
静默且 recall 不复活、静默跨重启持久、有 recall 的标签不被静默、专家模式不咨询闭环也不注入
|
|
141
|
+
状态行、状态行硬上限与 HEAD 存在且排在最后、卫生剔除簿记却保留 854,668 那组教训数字、
|
|
142
|
+
快照时间戳格式,以及真实交接下冷启动块既被清洗又保留结论半句。
|
|
143
|
+
全量 **555/555**(87 个测试文件)。
|
|
144
|
+
|
|
145
|
+
## [1.7.0] — 2026-11-24
|
|
146
|
+
|
|
147
|
+
**全链路记忆的第二半:写入侧去重(实体)、检索侧联想(1 跳)、语义侧分层(六维人格)、
|
|
148
|
+
隐私侧闸门(secret)、以及“模型不知道自己有哪些工具”的可观测性。**
|
|
149
|
+
|
|
150
|
+
- **Added — 实体归并(M1 本地半,零 Token)**。新增 `src/entityAlias.js`:
|
|
151
|
+
`entity:` 标签在**写入前**折向已有规范词——先查 `state/entity_alias.json` 字典,
|
|
152
|
+
再判子串包含(已有 `entity:红薯` 时 `entity:烤红薯` 直接折向短词),最后是编辑距离
|
|
153
|
+
(相似度 ≥0.8 且长度差 ≤2,专治拼写错误)。折名结果改写的是**写入形状**,raw 日志照旧
|
|
154
|
+
append-only;同一批写入里连续出现的实体也互通(`_recentEntityWords` 兜住索引未跟上的窗口)。
|
|
155
|
+
折名发生在 `stage()` 内、`_resolveTags()` 之前;早先传原始 tags 会让合并结果被整体覆盖。
|
|
156
|
+
- **Added — 别名字典落盘**。`state/entity_alias.json`(schema 1,`writeJsonAtomic`),
|
|
157
|
+
词表可由 Dream 自动扩充,也可人工编辑。
|
|
158
|
+
- **Added — 离线同义词学习**。`DreamEngine.learnAliases()`:取过去 24h 新增 `entity:` 词
|
|
159
|
+
(<2 个词直接 skip),走与蒸馏**同一套** fetch 超时/鉴权/熔断设施发一次小请求
|
|
160
|
+
(`maxTokens = max(128, 词数×8+64)`),只接受 `{"aliases":{variant:canonical}}`;
|
|
161
|
+
`sanitiseAliasPairs(..., {known})` 要求 canonical **必须已存在**,否则等于凭空造节点。
|
|
162
|
+
学到新词后 `markDirty()` + `invalidateAdjacency()`,索引重建时旧事件自动折到新节点
|
|
163
|
+
(日志不动,删空节点只是派生视图的事)。
|
|
164
|
+
- **Added — 1 跳联想召回(M2)**。新增 `src/tagGraph.js`:`buildAdjacency()` 把共现边编成
|
|
165
|
+
`Map<tag, [{tag,weight}]>`(对称、去重、权重降序、每节点最多 8 个邻居),
|
|
166
|
+
`expandOneHop()` 每条种子只做**一次** `Map.get`——没有队列、没有 visited 集,因此不存在图遍历。
|
|
167
|
+
`recall()` 新增 `adjacency` / `maxAssociativeHops`(默认 1)/ `associativeLimit`(默认 2):
|
|
168
|
+
>1 直接抛 `MEM_E_INVALID_INPUT: maxAssociativeHops must be <= 1: associative recall is a single
|
|
169
|
+
O(1) lookup, not a graph walk`(空索引也照样抛,参数错误不该被数据量掩盖);
|
|
170
|
+
0 则完全关闭联想。命中的邻居以 `ASSOCIATION_PENALTY`(0.5)参与打分,
|
|
171
|
+
最相似的 1–2 条 L3 摘要以半权重返回,并在 `associative` 里说明“经由哪个标签、几跳”。
|
|
172
|
+
种子来自三处:显式查询标签、文本分词命中的标签、以及**在查询文本里被点名的实体**
|
|
173
|
+
(`entitySeedsMentioned()`,硬上限 200 次扫描)——所以“红薯怎么做”也能顺着图谱摸到 `topic:吃饭`。
|
|
174
|
+
- **Added — 时间窗加成**。`recall()` 的 `recentWindow`(`retrieval.recentWindowTurns`,默认 50 轮):
|
|
175
|
+
窗口内事件按“离窗口末尾多近”给 1.2×–1.5× 加成。因为上限从 1.3 抬到 1.5,
|
|
176
|
+
剪枝硬上界同步从 `salience × 3.9` 改为 **`salience × 4.5`**(剪枝仍是精确的,测试逐位比对)。
|
|
177
|
+
- **Added — 自动指针注入(M3)**。`context.autoInjectIndex`(默认 `{enabled:true, everyNTurns:3,
|
|
178
|
+
maxPointers:3, maxChars:300}`,也接受 `true`/`false` 简写):每 N 个 user turn 在
|
|
179
|
+
`[Memory Hints]` 之后追加 `[Memory Index]`,格式 `- [memory <eventId>] <tag> · <title>`,
|
|
180
|
+
**绝不注入正文**;单次硬限 300 字符;注入过的 eventId 进入同一个 `injectedIds` 去重池;
|
|
181
|
+
活跃标签签名没变就保持沉默(不重复刷同一批指针);新会话 / 插件重启后立刻重新布防一次
|
|
182
|
+
——这正是“重启后上下文空白”那个缺口的补丁。`/memory status` 会报 `[Memory Index]` 状态。
|
|
183
|
+
- **Added — L3 六维人格(M2)**。新增 `src/semantic/dimensions.js`:persona / preferences /
|
|
184
|
+
facts-rules / relationships / skills-patterns / boundaries;`upsert()` 接受 `dimension`
|
|
185
|
+
并落 `dim:<dim>` 标签(**标签不变量仍按调用方原始 tags 校验**,`dim:` 不能当免标签后门);
|
|
186
|
+
未指定时按 tag → 标题 → 关键词推断。`personaTraitsText()` 按维度排序并**逐行剥离生理状态**
|
|
187
|
+
(`PHYSIOLOGY_TERMS`:疲劳/心率/体温/激素…)——“不是人体,是人格”。
|
|
188
|
+
- **Added — 隐私闸门(M3)**。新增 `src/privacy.js`:带 `privacy:secret` 标签或
|
|
189
|
+
`meta.privacy='secret'` 的记录,`recall` **默认过滤**并在 `notes` 记 `privacy-withheld:<n>`;
|
|
190
|
+
只有显式 `includeSecret`(工具参数 `include_secret`)才返回;secret 既不进
|
|
191
|
+
`[Memory Index]` 指针,也不做联想种子(不然隐私会从邻边漏出来)。
|
|
192
|
+
判定与打标由调用方(情感插件)负责,本插件只提供接口与过滤。
|
|
193
|
+
- **Added — Dream 事实来源(M4)**。蒸馏输出契约扩展为
|
|
194
|
+
`{"summary","confidence","facts":[{"text","source"}],"dimension"}`;`source` 只认
|
|
195
|
+
`user`/`self`,**无主或非法的条目直接丢弃**(绝不默认成“用户说”),机械兜底
|
|
196
|
+
`localDistillation()` 也按事件 role 标注。facts 与 dimension 落进该 L3 记录的 `meta`。
|
|
197
|
+
- **Added — 交接摘要结构化(M1)**。`getLatestHandoffSummary()` 在保留 `text` 的同时新增
|
|
198
|
+
`activeTask` / `recentFacts` / `personaTraits` / `lastRawTurns`;`lastRawTurns` 条数由
|
|
199
|
+
`context.handoffSummaryTurns`(默认 4,范围 3–5)控制,**每条都带 role**——不接受无主纯文本。
|
|
200
|
+
- **Added — 工具使用证据(M5)**。`runtime.toolUsage` 统计每个工具的真实调用次数,
|
|
201
|
+
`/memory status` 新增「工具使用(本进程)」段;`remember/recall/capture/deep_raw`
|
|
202
|
+
长期 0 次时直接建议 `/memory tools disable`。不新增任何模型请求。
|
|
203
|
+
- **Tests**:新增 `test/v170.dimensions.test.js`(7 例)。全量 **548/548**(86 个测试文件)。
|
|
204
|
+
|
|
205
|
+
## [1.6.9] — 2026-11-22
|
|
206
|
+
|
|
207
|
+
**全链路记忆机制:写入时归并、检索时联想、装配时只给指针。**
|
|
208
|
+
在 1.6.8 的「密文不写入」之后,这一版补上另外三处漏点——
|
|
209
|
+
**标签会分裂**(`entity:红薯` 与 `entity:烤红薯` 各自成节点)、
|
|
210
|
+
**联想靠自觉**(模型不主动 `recall` 就不会碰到相关记忆)、
|
|
211
|
+
**上下文靠运气**(同一件事从不跨轮次自动进入 Prompt)。
|
|
212
|
+
|
|
213
|
+
- **Added — 本地实体归并(零 Token,写侧)**:新增 `src/entityAlias.js`。`entity:` 标签在
|
|
214
|
+
`stage()` 写入前先折名,三条判据按顺序:① 别名字典命中(`state/entity_alias.json`);
|
|
215
|
+
② **子串包含**——已有 `entity:红薯` 时写入 `entity:烤红薯` 直接折向较短的既有词;
|
|
216
|
+
③ **编辑距离**——相似度 ≥0.8 且长度差 ≤2 时归并(收拾拼写错误)。
|
|
217
|
+
折名记录写进事件的 `meta.entity_merged`(`{from,to,reason:'alias'|'substring'|'fuzzy'}`),
|
|
218
|
+
`entity` 字段同步规范化。**修掉一个真根因**:`_resolveTags()` 原先用原始 tags 覆盖合并结果,
|
|
219
|
+
导致合并看似生效、实际仍分裂出新标签。
|
|
220
|
+
- **Added — 别名字典(`state/entity_alias.json`,schema 1,原子写)**:`EntityAliasStore` 提供
|
|
221
|
+
`load/map/list/resolve/learn/status`。索引构建期 `buildIndex()` 通过 `canonicalTag()` 再折一次,
|
|
222
|
+
所以**日志永远不被改写**:所谓「转移旧节点事件、删除空节点」,是索引重建后自然收敛,
|
|
223
|
+
原始记录仍在 `raw/` 与 `log/` 里可查。
|
|
224
|
+
- **Added — Dream 学同义词**:`DreamEngine.learnAliases()` 取过去 24h 新增的 `entity:` 词,
|
|
225
|
+
发一个小的 JSON 请求让模型输出 `{"aliases":{"地瓜":"红薯"}}`,经
|
|
226
|
+
`sanitiseAliasPairs(pairs, { known })` 过滤后写入字典——**只允许折向已存在的规范词**,
|
|
227
|
+
否则等于让模型凭空造节点。学完置 `markDirty()` + `invalidateAdjacency()`,下轮读取即生效;
|
|
228
|
+
它排在月记与 Dream **之后**,失败只记 `executeDream().entityAliasError`,绝不拖垮蒸馏。
|
|
229
|
+
- **Added — 1 跳共现联想(严格 O(1))**:新增 `src/tagGraph.js`。`buildAdjacency()` 把
|
|
230
|
+
`state/graph.json` 的共现边折成 `Map<tag,[{tag,weight}]>`(对称、权重降序、每点最多 8 邻居);
|
|
231
|
+
`recall()` 命中查询标签后只做一次 `Map.get()` 取最强邻居——**不建队列、不记 visited,没有 BFS/DFS**。
|
|
232
|
+
联想语义条目按 `score × 0.5` 返回并标注 `association:{via,penalty,hops:1}`,
|
|
233
|
+
`recall` 结果里的 `associative.{hops,tags,seeds,semantic}` 让「为什么带回了这条」可审计。
|
|
234
|
+
`entitySeedsMentioned()` 会把**查询文本里直接出现的 entity 词**当种子,
|
|
235
|
+
所以 `entity:红薯` 不需要用户显式写标签也能触发联想。
|
|
236
|
+
- **Added — `maxAssociativeHops` 硬上限 1**:`assertAssociativeHops()` 在 `recall()`、
|
|
237
|
+
`_recallLocal()` 与工具入口**最先**执行(空索引也照样校验);`>1` 直接抛
|
|
238
|
+
`MEM_E_INVALID_INPUT`(「associative recall is a single O(1) lookup, not a graph walk」);
|
|
239
|
+
`0` 可关掉联想。**性能是契约,不是建议。**
|
|
240
|
+
- **Added — 时间窗加成**:`policy.retrieval.recentWindowTurns`(默认 50)取最近 N 个事件的时间范围,
|
|
241
|
+
窗口内事件按贴近程度拿 **1.2x–1.5x**(`RECENT_BOOST_MIN/MAX`)。
|
|
242
|
+
因为 `timeBoost` 上限由 1.3 提到 1.5,剪枝上界 `PRUNE_BOUND_FACTOR` 同步 **3.9 → 4.5**
|
|
243
|
+
(否则 `salience × 3.9` 不再是硬上界,早停会剪错)。
|
|
244
|
+
- **Added — 自动指针注入(`context.autoInjectIndex`)**:默认
|
|
245
|
+
`{ enabled: true, everyNTurns: 3, maxPointers: 3, maxChars: 300 }`(也接受布尔简写)。
|
|
246
|
+
插件就绪 / 会话切换即布防,**第一轮就**输出 `[Memory Index]` 段;此后每 N 个 user turn 重新布防。
|
|
247
|
+
行格式 `- [memory <eventId>] <tag> · <title>`——**只有指针,没有正文**,整段硬限 300 字符。
|
|
248
|
+
注入过的 eventId 进 `runtime.injection.ids` 去重池;活跃标签签名没变就不再重复注入。
|
|
249
|
+
这是「模型不会主动 recall 怎么办」的答案:不逼它调用工具,只把索引放到它眼前。
|
|
250
|
+
- **Changed — 可配置 / 可观测**:`context.autoInjectIndex.{enabled,everyNTurns,maxPointers,maxChars}`
|
|
251
|
+
四个键进 `EDITABLE_CONFIG_KEYS`;`recall` 结果带 `associative` 与 `recentWindow`;
|
|
252
|
+
`memory.status()` 暴露 `entityAliasStatus()` 与 `associativeStatus()`。
|
|
253
|
+
- **Tests**:新增 `test/v169.fullchain.test.js`(6 例)——`烤红薯` 因子串包含折进 `红薯`;
|
|
254
|
+
Dream 识别 `地瓜 → 红薯` 且重定向到索引、日志未被改写;查 `红薯` 带回 `吃饭` 的联想摘要且仅 1 跳;
|
|
255
|
+
近期记忆得分高于同权重旧记忆;`maxAssociativeHops > 1` 抛错、`0` 关闭;
|
|
256
|
+
首轮即注入指针、同会话不重复、标签未变仍不重复。
|
|
257
|
+
全量 **541/541**(85 个测试文件)。
|
|
258
|
+
## [1.6.8] — 2026-11-20
|
|
259
|
+
|
|
260
|
+
**写侧护栏:拒绝高熵密文 / 加密载荷。** raw 日志与 L1 事件日志是本插件承诺「永远保留」
|
|
261
|
+
的两样东西,而密文块恰恰是唯一无法被召回(没有可搜索的子串)、无法被蒸馏(没有可说的
|
|
262
|
+
语义)、也无法被打标的载荷——它只会永久占用保留期与存储预算。这是审计项 A4,自
|
|
263
|
+
1.5.7 起挂着「文档已规划但代码未实现」,本版补上。
|
|
264
|
+
|
|
265
|
+
- **Added — `src/entropy.js`**:纯函数检测器,零依赖。
|
|
266
|
+
- `shannonEntropy(text)`:香农熵(保留 3 位小数)。
|
|
267
|
+
- `detectCiphertext(text, { minRunChars })` → `null` 或
|
|
268
|
+
`{ reason: 'pem'|'base64'|'hex', runLength, entropy, at, sample }`。
|
|
269
|
+
- 三条判据各自有下限:base64 连续 ≥512 字符且熵 ≥4.5;hex 连续 ≥512 字符且熵 ≥3.5;
|
|
270
|
+
PEM 甲壳(`-----BEGIN PGP MESSAGE-----` 等 5 种标记)**即使很短**也拒绝。
|
|
271
|
+
- 保守优先:散文、源码、URL、Windows 路径、低熵长串、短 base64 data URI 全部放行。
|
|
272
|
+
- **Added — `MEM_E_ENCRYPTED_RAW_REJECTED`**(`src/errors.js`),details 带
|
|
273
|
+
`{ reason, runLength, entropy, at }`,调用方不必解析消息文本。
|
|
274
|
+
- **Changed — 三条写路径统一护栏**:
|
|
275
|
+
- `src/rawStore.js#capture`:在非空校验之后、门槛判定之前检测,**拒绝且零落盘**
|
|
276
|
+
(不入队、不刷盘、分片里不会出现该载荷)。
|
|
277
|
+
- `src/memory.js#remember`:同规则,且**先于**旧的 base64-media 守卫——对一个密文块,
|
|
278
|
+
叫调用方「改用 media_url」是错误建议,正确诊断是「这是密文」。
|
|
279
|
+
- `src/memory.js#captureSessionEvent`:auto-capture 遇到密文时返回
|
|
280
|
+
`{ stored: false, skipped: 'encrypted-blob', reason }`,**不作为 capture 失败刷警告**
|
|
281
|
+
(会话里粘一段密钥不该让日志被 warn 淹没),其他错误仍照旧上抛。
|
|
282
|
+
- **Tests**:新增 `test/v168.encrypted.test.js`(8 例):熵函数基准、7 类正常内容零误判、
|
|
283
|
+
base64/hex/PEM 三判据各自的拒绝理由、raw store 拒绝且磁盘无残留、auto-capture 的 skip
|
|
284
|
+
语义、`remember()` 同规则且普通写入不受影响。全量 **541/541**(85 个测试文件)。
|
|
285
|
+
- **Fixed — `/memory maintain` 的计数全是空的**:该命令把 `report.rawArchive.archived`
|
|
286
|
+
与 `report.rawPrune.removed` 当数字插值,而它们其实是**数组**,于是输出成了
|
|
287
|
+
`维护完成:;L2 合并 0 组;冷归档 个。`(分段用空数组拼出来就是空串)。现在统一走
|
|
288
|
+
`count()`(数组取 length、数字取原值),并且只推入有内容的分段;本轮真的什么都没做时
|
|
289
|
+
明确回答「本轮无变更」。新增回归用例(`test/v165.micokernel.test.js` 第 9 例)锁住
|
|
290
|
+
「无空分段 + 冷归档必须带数字」。
|
|
291
|
+
- **Docs**:`记忆插件-未完成表.md` 从「2026-11-05 待办审计」重写为「当前状态表」——
|
|
292
|
+
A1–A21 逐项给出关闭依据,13 项关闭、2 项 superseded、2 项并入 M3/M6、4 项明确不做
|
|
293
|
+
(并写明为什么不做),另列仍需外部动作的四项(npm 账号封控等)。
|
|
294
|
+
|
|
295
|
+
## [1.6.7] — 2026-11-17
|
|
296
|
+
|
|
297
|
+
**发布链完整性修正 + 索引式提示注入(M1)。1.6.6 在 npm 上的制品(`gitHead 99a07cb`)
|
|
298
|
+
是从一份**旧 checkout** 发布的,只带来 Live Compact 修复,**不含** M3(测试跨包解耦)
|
|
299
|
+
与 M5(错误码边界)。1.6.7 把这两项送往 npm,并让仓库历史与已发布标签不再分叉;
|
|
300
|
+
M1 则是本版的主线功能——每轮 Prompt 不再为记忆**正文**付费。**
|
|
301
|
+
|
|
302
|
+
- **Added — 外部价格 / 通知接缝(M2)**。`dsh-price-tip` / `dsh-peak-runner` /
|
|
303
|
+
`dsh-notify-plugin` 在本机**并不存在**,因此没有「接线真实 API」可做——凭空猜服务名
|
|
304
|
+
等于发明接口。本版只做**可验证的可选接缝**:
|
|
305
|
+
- `HostBridge.setNotifier(sink)` + `notify({title,text,kind,at})`:没有 sink 时返回
|
|
306
|
+
`{delivered:false, reason:'no-notifier'}` 并只记计数,**绝不发明投递通道、绝不抛错**;
|
|
307
|
+
sink 抛错也只记 `sink-error`,不会污染维护流程。
|
|
308
|
+
- `index.js` 探测一组**约定键**(`priceTip` / `notifier` / `peakRunner`,或 `notify` / `peak`),
|
|
309
|
+
并接受多种方法形状(`isLowValley|lowValley|isLow|price`、`notify|send|post`、
|
|
310
|
+
`isPeak|peak|isHigh`)。外部价格服务优先于内置时间窗;`DSH_DREAM_PRICE` 仍可强制覆盖。
|
|
311
|
+
- `capabilities.externalSeams` 报告**哪条接缝真的接上了**(`{wired, source}`),
|
|
312
|
+
所以「没装」是可见事实而不是静默降级。
|
|
313
|
+
- 一旦通知接缝可用,「Dream 因高峰被推迟」会通过它播报(内含 `dueAt`);没有接缝时
|
|
314
|
+
这件事仍由持久化队列与 `dream-deferred` 事件表达,行为不变。
|
|
315
|
+
- **排队本来就是实装的**:`index.js` 的 `tick()` 在高峰把 LLM 蒸馏写入 `dreamQueue`
|
|
316
|
+
并在谷时唤醒(`reason: 'peak-hour'`),不是丢弃,本次未改动该逻辑。
|
|
317
|
+
- **Changed — 多空间开关的语义澄清(M6)**。`features.multiSpace` 默认 `true`,但只有注入了
|
|
318
|
+
能创建空间适配器的 `orchestrator` 服务时才真正生效——以前这个差异是**静默**的:
|
|
319
|
+
用户以为开了多空间,实际在跑单空间。现在新增 `multiSpaceReason()`,返回
|
|
320
|
+
`'active'` / `'disabled-by-config'` / `'orchestrator-missing'` 三态,
|
|
321
|
+
通过 `capabilities.multiSpaceReason` + `capabilities.multiSpaceRequested` 与
|
|
322
|
+
`panel.spaces.{requested,reason}` 同时暴露,设置页在多空间卡片里直接写明
|
|
323
|
+
「当前被配置关闭:features.multiSpace=false」,不再把「没装适配器」和「你关了它」
|
|
324
|
+
混成一个 `spaces:false`。**开关本身没有改默认值**(改默认会静默改变已部署 profile 的行为),
|
|
325
|
+
改的是可观测性与文档;并有用例锁住「布尔值与理由不可能互相矛盾」。
|
|
326
|
+
- **Changed — 索引式提示注入(M1)**。`context.injectMode` 新增两个取值:
|
|
327
|
+
- `index`(**新默认**):每个记忆块只注入一行指针
|
|
328
|
+
`- [memory <eventId>] 标签 · 标签 · 标题`。正文不进 Prompt,需要细节时用
|
|
329
|
+
`memory_recall` 按 eventId / 标签取。`[Memory Blocks]` 标记名保持不变,因此缓存前缀
|
|
330
|
+
语义不变;规则段多一行「这些是索引指针,正文须调 recall」,**只在 index 模式下出现**。
|
|
331
|
+
- `full`:沿用旧版渲染(正文前 200 字)与旧版计费(整段正文),一行代码即可回退。
|
|
332
|
+
- **窗口计费随渲染形态走**:`ContextEngine.tokensOf()` 在 index 模式下只计指针行,
|
|
333
|
+
在 full 模式下仍计整段正文(旧口径,不动既有调优);调用方**显式传入的 `tokens`
|
|
334
|
+
永远优先**,折叠与驱逐的排序不变。
|
|
335
|
+
- `index` 模式下 `tokens()` 的实测差异是数量级的:8,000 字符的正文约 2,000 tokens,
|
|
336
|
+
指针行通常 < 60 tokens。
|
|
337
|
+
- `briefing` 块(运营方钉死的策略)**永不降级为指针**,始终整段渲染。
|
|
338
|
+
- 可编辑键新增 `context.injectMode`(`index` / `full`,非法值 fail-fast),设置页
|
|
339
|
+
「上下文窗口」卡片新增下拉;简洁模式下同样可见可存。
|
|
340
|
+
- **Changed — 测试与兄弟包解耦(M3)**。`test/orchestrator.js` 先按包名 `dsh-layers-orchestrator/src/*`
|
|
341
|
+
解析、失败再退回同级 checkout(`via: 'package' | 'sibling'`);22 个真正依赖多空间的用例改走
|
|
342
|
+
`orchestratorTest()`,缺包时注册为 **skipped 并带原因**而不是 import 阶段崩掉整套测试。
|
|
343
|
+
`makeMemory()` 的 `multiSpace` 默认值改为 `MULTI_SPACE_AVAILABLE`,杜绝 `new null()`。
|
|
344
|
+
实测:两包在位 **510/510**(skipped 0);单独 checkout 时 **454 pass / 0 fail / 56 skipped**。
|
|
345
|
+
- **Changed — 错误码边界(M5)**。`dsh-orchestrator` 内两套命名空间是**故意**并存的:
|
|
346
|
+
`MEM_E_*`(从核心搬出去的引擎沿用,客户端 HTTP 映射依赖它)与 `ORCH_E_*`(路由器/去重/联邦/授权)。
|
|
347
|
+
海马体侧新增单一边界 `src/errors.js#fromOrchestratorError()` + `ORCHESTRATOR_CODE_MAP`:
|
|
348
|
+
`ORCH_E_CONSENT_*` → `MEM_E_REQUIRE_USER_CONSENT`(三个都映射到同一处,因为修法是去问人而不是重试)、
|
|
349
|
+
`ORCH_E_SPACE_INVALID` → `MEM_E_SPACE_INVALID`、`ORCH_E_INVALID_INPUT` → `MEM_E_INVALID_INPUT`、
|
|
350
|
+
`ORCH_E_NOT_READY` → `MEM_E_NOT_READY`、`ORCH_E_FEDERATION_CONFLICT` → `MEM_E_FEDERATION_FAILED`;
|
|
351
|
+
**未列入的 `ORCH_E_*` 不会被拍平成 `MEM_E_IO`**,原始码保留在 `details.orchestratorCode` 里可审计。
|
|
352
|
+
映射表同步写进 `dsh-orchestrator/README.md` 的「错误码边界」一节。
|
|
353
|
+
- **Tests**:新增 `test/v166.errorContract.test.js`(7 例)与 `test/v167.m1.test.js`(9 例:
|
|
354
|
+
默认 index、指针行构成、index 计费 = 渲染行、full 保留旧渲染与旧计费、显式权重优先、
|
|
355
|
+
briefing 不降级、标题截断与回退、`injectMode` 校验与可编辑、规则段只在 index 出现、
|
|
356
|
+
recall 命中把标签与标题带进窗口且正文尾巴不出现);
|
|
357
|
+
`test/v156.features.test.js` 新增 M6 用例(`multiSpaceReason` 三态 + 显式关闭优先于
|
|
358
|
+
缺适配器 + 「布尔值与理由不可能矛盾」的交叉断言);
|
|
359
|
+
`test/v167.m2.test.js`(6 例)锁住 M2 接缝:无 sink 时为 `no-notifier` 的记账型空操作、
|
|
360
|
+
sink 收到 payload 且被计数、sink 抛错只记 `sink-error` 不外溢、`externalSeams()` 如实报告
|
|
361
|
+
「通知与高峰缺席、价格回退本地时间窗」、注入 `notifier` 服务后被自动发现并可用、
|
|
362
|
+
注入 `priceTip` 后外部价格**优先于**本地时钟窗口。
|
|
363
|
+
全量 **541/541**(85 个测试文件)。
|
|
364
|
+
|
|
365
|
+
## [1.6.6] — 2026-11-16
|
|
366
|
+
|
|
367
|
+
**发布修正版:1.6.5 在 npm 上发布的是「每轮请求都裁剪工具结果」的版本——那个把上下文
|
|
368
|
+
从 10% 悄悄缩到 7% 的缺陷没有随任何已发布制品走出去。1.6.6 补上这条修复。**
|
|
369
|
+
|
|
370
|
+
> **发布实况(事后核对)**:1.6.6 的 npm 制品 `gitHead 99a07cb` 来自旧 checkout,
|
|
371
|
+
> **只含**下面的 Live Compact 修复——M3 与 M5 当时已在主线上、但没有进这个 tarball。
|
|
372
|
+
> 那两项随 **1.6.7** 发出。本地 `v1.6.6` tag 已指向 `99a07cb`,与 npm/GitHub 一致;
|
|
373
|
+
> `99a07cb` 也已并入 `main` 历史,发布可追溯。
|
|
374
|
+
> 1.6.5 同理不可覆盖(`gitHead 28776c7`),其 tag 亦指向该提交。
|
|
375
|
+
|
|
376
|
+
- **Fixed — 上下文在每轮请求里被悄悄缩水("从 10% 直接掉到 7%")**。
|
|
377
|
+
`guardRequest` 曾在**每一次** `agent/request` 上调用宿主的 `toolResultPruner.pruneSession()`。
|
|
378
|
+
宿主的 `pruneContent()` 用的是**预设预算**(ptc 预设 `thresholdChars: 8192` → 4k 头 + 1k 尾),
|
|
379
|
+
而且它**只在 `compaction-basic` 的 `context-overflow` 分支里**才被调用——我们把「溢出时裁剪」
|
|
380
|
+
变成了「每轮都裁剪」,一次 pass 就能掉约 80k tokens。
|
|
381
|
+
现在 Live Compact **只跑本插件自己的保守策略**(`context.liveCompact`,默认 200,000 字符阈值 /
|
|
382
|
+
4,000 头 / 2,000 尾 / 每请求最多 4 个节点),不再委托宿主 pruner;
|
|
383
|
+
回归用例 `the guard never rewrites an ordinary tool result on a healthy request`
|
|
384
|
+
断言宿主 pruner 在健康请求上**一次都不被调用**。
|
|
385
|
+
- **Tests**:`test/v164.windowGuard.test.js` 增加上述回归用例(12 例)。全量 **503/503**(79 个测试文件)。
|
|
386
|
+
|
|
387
|
+
## [1.6.5] — 2026-11-15
|
|
388
|
+
|
|
389
|
+
**回归微内核:引擎只负责存储、检索与蒸馏,绝不驱动对话;蒸馏只有一个总调度器;
|
|
390
|
+
面板的全部能力收进 `/memory` 指令集,且不花一分模型 Token。**
|
|
391
|
+
|
|
392
|
+
- **Added — `/memory` 指令集(0 Token)**。四条子命令通过宿主的 `commands` 服务注册,
|
|
393
|
+
`commands.execute()` 的语义是「parse and execute a known command **without sending it
|
|
394
|
+
to the model**」,因此不产生任何模型请求(测试用 `fetch` 计数断言为 0):
|
|
395
|
+
- `/memory resume`:拉取上一次交接摘要并**强制重新注入**当前上下文。它绕过「每会话
|
|
396
|
+
每交接批次只注入一次」的去重(`armColdStartNow()` 先删掉该 `session|epoch` 的投递
|
|
397
|
+
记录再布防),所以用户可以随时把摘要拉回来;没有交接时明确回「没有可恢复的交接摘要」。
|
|
398
|
+
- `/memory maintain`:立即触发一次后台维护(索引重建 / 月记 / L2 合并 / Dream / 冷归档),
|
|
399
|
+
回报各阶段计数;已在运行时直接拒绝而不是排队。
|
|
400
|
+
- `/memory status`:事件数、L3 摘要数、活跃标签列表、会话 token 与窗口来源
|
|
401
|
+
(`host`/`config`/`default`)、静默状态、冷启动队列长度。
|
|
402
|
+
这些数字全部取自面板同一份契约(`panel.global.*` + 索引快照的活跃集合),
|
|
403
|
+
不再各自拼字段——早期实现读错了契约,导致整行显示成 `?`。
|
|
404
|
+
- `/memory mute` / `/memory unmute`:紧急静默 `[Memory Hints]`。静音时**不消费标签**,
|
|
405
|
+
所以解除后提示会原样回来,而不是被会话级去重池吃掉。
|
|
406
|
+
- **Fixed — 月记与 Dream 重复咀嚼同一批日记**。L2.5 月记原本挂在 `maintain()` 上,与
|
|
407
|
+
Dream 各走各的调度,同一条 L2 日记可能先被压进月记、再被按标签蒸馏一次。
|
|
408
|
+
现在 **`executeDream()` 是唯一的蒸馏总调度器**:先跑月记(只处理已结束的自然月),
|
|
409
|
+
再让 Dream 处理剩下的材料。被月记吸收的事件 id 记入 `state/months.json` 的
|
|
410
|
+
`promoted` 映射(即 `promoted_to_monthly`),`DreamEngine.collectGroups()` 直接跳过,
|
|
411
|
+
并在报告里给出 `skippedPromoted` 计数。
|
|
412
|
+
**为什么不写进事件本身**:raw 日志是 append-only 的唯一真相源,永不改写;标记放在
|
|
413
|
+
派生状态里,语义等价且可重建。
|
|
414
|
+
- **Added — 原子服务接口 `getLatestHandoffSummary()`**。`ctx.get('hippocampus')
|
|
415
|
+
.getLatestHandoffSummary()` 返回 `{ active, state, at, sessionId, summaryEventId,
|
|
416
|
+
agentPreset, tailTurns, text, found }`,纯读:不装配 prompt、不消费 marker、不产生副作用。
|
|
417
|
+
外部路由插件想自己决定「什么时候续上、怎么展示」时用它,而不是去解析提示词。
|
|
418
|
+
- **Changed — 微内核边界**。引擎半侧(`index.js` + `src/**`)不含任何宿主 UI 或追加模式
|
|
419
|
+
监听:`autoNewSession` 整链已在 1.6.3 删除,本次用测试把这条边界**锁死**——源码扫描
|
|
420
|
+
禁止出现 `uiWorkspace` / `startSession(` / `sessionStorage` / `appendMode` /
|
|
421
|
+
`onSlot(` / `slots.register(` / `ctx.slots =`。会话控制交给外部路由插件。
|
|
422
|
+
- **Fixed — 上下文在每轮请求里被悄悄缩水(“从 10% 直接掉到 7%”)**。1.6.4 的
|
|
423
|
+
`guardRequest` 在**每一次** `agent/request` 上都把宿主 `toolResultPruner.pruneSession()`
|
|
424
|
+
委托执行了一遍。两处都错:
|
|
425
|
+
- 宿主用的预算是 **预设自己的**(ptc: `thresholdChars 8192` → 留 4k 头 + 1k 尾),
|
|
426
|
+
于是一次普通的 20 KB 文件读取在下一次请求就被腰斩;
|
|
427
|
+
- 宿主自己只在 compaction-basic 的 `context-overflow` 分支里调它
|
|
428
|
+
(`this.ctx.get('toolResultPruner')?.pruneSession(agent.session)`),
|
|
429
|
+
「溢出时裁剪」被我们变成了「每一轮都裁剪」。实测一次 pass 可掉 **~80k tokens**。
|
|
430
|
+
现在 Live Compact **只跑我们自己的保守裁剪**:单条 `tool/result` 超过
|
|
431
|
+
`context.liveCompact.thresholdChars`(默认 200,000 字符)才指针化,头部 4k / 尾部 2k
|
|
432
|
+
原样保留、中间换成 `deep_raw` 可取回的指针行。健康的对话**永远不会被改写**——
|
|
433
|
+
宿主压缩链路的裁剪仍由宿主在真溢出时负责。
|
|
434
|
+
新增回归用例锁定:请求里即使注入了假 `toolResultPruner`,`pruneSession` 的调用次数也必须为 0,
|
|
435
|
+
且一条 20k 字符的正常结果不产生任何 surface 改写。
|
|
436
|
+
- **Tests**:新增 `test/v165.micokernel.test.js`(8 例):`/memory` 注册与全部子命令返回
|
|
437
|
+
纯文本、**网络调用数为 0**、静默真的不注入提示、`resume` 在无交接时明确报错且服务接口
|
|
438
|
+
与它同源、`executeDream()` 先跑月记并把日记标进 `promoted`、`maintain()` 不再产出月记、
|
|
439
|
+
已晋升日记在下一轮仍被排除、以及上面那条「无 UI/追加模式监听」的源码扫描。
|
|
440
|
+
`test/flow.test.js` 与 `test/v156.federation.test.js` 的月记断言随调度器迁移改为
|
|
441
|
+
`executeDream()`。全量 **502/502**(80 个测试文件)。
|
|
442
|
+
|
|
443
|
+
> **发布说明**:1.6.5 发布到 npm 的制品(`gitHead 28776c7`)**不包含**上面那条 Live Compact
|
|
444
|
+
> 修复——它是在 1.6.5 发布之后才提交的。该修复进入 **1.6.6**;M3 与 M5 实际进入 **1.6.7**
|
|
445
|
+
> (1.6.6 的制品同样来自旧 checkout,只含 Live Compact)。
|
|
446
|
+
|
|
447
|
+
## [1.6.4] — 2026-11-14
|
|
448
|
+
|
|
449
|
+
**修复 1M 上下文溢出(`CONTEXT_WINDOW_EXCEEDED`):交接判定的分母、分子与状态机三处
|
|
450
|
+
同时失效,外加单轮超大工具输出没有任何熔断。这是一次独立的安全发版——1.6.3 从未
|
|
451
|
+
发布过,它的全部内容已并入本版。**
|
|
452
|
+
|
|
453
|
+
- **Fixed — 分母错源:接入宿主真实模型窗口**。新增 `src/context/windowGuard.js` 的
|
|
454
|
+
`resolveWindow()`:**宿主适配器上报的窗口优先**(`llm.resolveModelInfo().context.contextWindow`,
|
|
455
|
+
也接受 `tokenMeter.contextPressure().contextWindow`),`context.nativeTokenLimit` 降级为
|
|
456
|
+
用户覆盖,只在宿主不可用时兜底。`panel.session.windowSource` 暴露本次用的是
|
|
457
|
+
`host` / `config` / `default`,事后可审计。此前本机 profile 写的 `8000` 被当成模型窗口,
|
|
458
|
+
模型真实窗口是 **1,048,576**。
|
|
459
|
+
- **Fixed — 分子不再靠猜:`used + reserved` 公式**。判定改为
|
|
460
|
+
`used_tokens + reserved_completion_tokens >= window × threshold`。
|
|
461
|
+
已用优先取宿主 `tokenMeter` 的测量值(含系统提示、工具 schema、历史重放),
|
|
462
|
+
`Math.ceil(字符数 ÷ 4)` 的自估降为下限;`reserved` 取本次请求真实的 `maxTokens`
|
|
463
|
+
(默认 256,000)。事故数字 854,668 + 256,000 = 1,110,668 > 1,048,576 现在能直接判出来。
|
|
464
|
+
- **Fixed — Fail-Fast 兜底**。新增 `agent/request` 中间件:拿到最终请求配置后重新判定,
|
|
465
|
+
**必定放不进窗口的请求在本地就被拦下**,抛 `MEM_E_CONTEXT_EXCEEDED`,details 里带
|
|
466
|
+
`usedTokens / reservedTokens / projectedTokens / window / windowSource / ratio`,
|
|
467
|
+
并明确写出 “Nothing was sent to the provider”。宿主缺少 `llm` / `tokenMeter` 服务时
|
|
468
|
+
**绝不阻断**(降级为原有行为)。
|
|
469
|
+
- **Fixed — 交接状态机死锁(“80% 了却不交接”)**。`checkHandoff()` 里
|
|
470
|
+
`if (marker.active) return base;` 会让首次交接后的同一会话**永远**不再交接
|
|
471
|
+
(1.6.3 移除自动开新会话后,session id 不再变化,marker 就永久 active)。
|
|
472
|
+
改为 `rehandoffDecision()`:同会话压力再涨 ≥5 个百分点(`pressure-growth`)或投影
|
|
473
|
+
≥95% 硬上限(`near-hard-limit`)时清掉旧 marker 重新蒸馏;不同会话仍走原有消费路径。
|
|
474
|
+
- **Added — Live Compact:单轮超大工具输出熔断**。新增 `src/context/liveCompact.js`:
|
|
475
|
+
单个 `tool/result` 的文本超过 `context.liveCompact.thresholdChars`(默认 200,000 字符)时,
|
|
476
|
+
保留头 4,000 / 尾 2,000 字符,中间压成一行指针
|
|
477
|
+
(`[[hippocampus:live-compact: removed N chars … (seq=…, call=…, tool=…)]`),
|
|
478
|
+
原文仍可用 `deep_raw` 取回。走宿主 surface 协议
|
|
479
|
+
(`append('compaction/prune')` + `append('tool/result', { surfaceOp: { op: 'replace' } })`),
|
|
480
|
+
宿主自带 `toolResultPruner` 时优先委托给它。指针化按 code point 切,不会劈开代理对。
|
|
481
|
+
- **Tests**:新增 `test/v164.windowGuard.test.js`(11 例)锁定本次修复:宿主窗口优先于配置覆盖、
|
|
482
|
+
引擎 `windowSource` 可审计、`used + reserved` 判定(含那组真实数字 854,668 + 256,000)、
|
|
483
|
+
`nativeState` 优先采用宿主测量值、`rehandoffDecision` 的四种判定、
|
|
484
|
+
超大工具结果的指针化(含代理对不被劈开、`surfaceOp replace` 的实际形状)、
|
|
485
|
+
同会话内 marker 仍 active 时 `checkHandoff` 会续交、以及
|
|
486
|
+
`guardRequest` 在「必超限」时抛 `MEM_E_CONTEXT_EXCEEDED` / 在「放得下」时放行 /
|
|
487
|
+
在没有宿主服务时绝不阻断(降级为原有行为)。
|
|
488
|
+
全量 **494/494**(79 个测试文件)。
|
|
489
|
+
|
|
490
|
+
## [1.6.3] — 2026-11-13
|
|
491
|
+
|
|
492
|
+
**配置加载器加固:把 1.6.2 的“旧配置启动阻断”事故固化为引擎能力——先迁移、再严格校验、
|
|
493
|
+
必要时安全降级,绝不让 DSH 客户端卡在“正在启动…”。**
|
|
494
|
+
|
|
495
|
+
- **Added — 冷启动注入可观测性**:`/stats` 新增 `coldStart{ pending[], injected, lastSessionId }`,
|
|
496
|
+
`panel.startup` / `panel.configVersion` / `panel.configWarnings` 与
|
|
497
|
+
`CAPABILITIES.startup` 同源(此前 `toMemoryOptions()` 没把迁移结果传给引擎,panel 报
|
|
498
|
+
`migrated:false` 而 capabilities 报 `true`)。
|
|
499
|
+
- **Fixed — 复习队列只报不消费(积压到 337 条)**:`maintain()` 现在按
|
|
500
|
+
`review.consumeBatchSize`(默认 40,上限 200/轮)分批消费到期行,批间
|
|
501
|
+
`await setImmediate` 让出主线程;每批一次 `reviews.advanceMany()` 落盘(不是每条一次写),
|
|
502
|
+
并对该批做一次 `reinforce` 权重强化。`review.autoConsume` 可整体关闭。
|
|
503
|
+
- **Fixed — 1.6.2 遗留的两个启动/保留缺陷**:旧 profile(`retentionDays: 30` 且没有
|
|
504
|
+
`archiveAfterDays`)由 `migrateConfig` 派生 `29` 而不是启动失败;`prune()` 现在也会按
|
|
505
|
+
月清理过期的 `.jsonl.br/.zst/.gz` 冷归档(此前只删明文,归档变相突破保留期)。
|
|
506
|
+
|
|
507
|
+
- **Added — 配置 schema 版本与迁移机制**:`src/config.js` 新增
|
|
508
|
+
`CONFIG_SCHEMA_VERSION = 3`;配置对象可携带 `configVersion`。加载顺序变为
|
|
509
|
+
**`migrateConfig()` → 严格校验**:迁移阶段只做“补值 + 告警”,从不抛错,也绝不覆盖
|
|
510
|
+
用户显式写下的值。缺少 `configVersion` 的旧配置被视为 legacy(`fromVersion: 0`)并
|
|
511
|
+
升级到当前版本。
|
|
512
|
+
- 首次落地的迁移规则:`raw.archiveAfterDays` 缺失且
|
|
513
|
+
`raw.retentionDays <= 新默认值(90)` 时,派生为 `Math.max(1, retentionDays - 1)`
|
|
514
|
+
(即 30 → 29),从而满足 `archiveAfterDays < retentionDays` 的硬约束。
|
|
515
|
+
- 每条迁移都写入 `console.warn`(前缀 `hippocampus/config-migration:`)并携带在
|
|
516
|
+
`config.warnings` 里,`apply()` 再经 `ctx.logger.warn` 输出一次——**迁移永不被静默**。
|
|
517
|
+
- 空配置 `{}` 视为“使用默认值”,不算 legacy,因此内部调用不会产生噪声告警。
|
|
518
|
+
- **Added — `strictStartup`(默认 `true`)启动安全网**:显式设为 `false` 时,若严格校验
|
|
519
|
+
抛出 `MEM_E_CONFIG_OUT_OF_RANGE`,引擎会丢弃该越界键、回退到安全值并继续启动,同时
|
|
520
|
+
置 `config.startup.degraded = true`、记录 `degradedReason{code,key,message}`、
|
|
521
|
+
输出 `hippocampus/config-degraded:` 警告,并在 `apply()` 里额外 warn
|
|
522
|
+
`STARTED DEGRADED (strictStartup=false)`。
|
|
523
|
+
- 降级**只**覆盖越界值:`MEM_E_CONFIG_INVALID_TYPE` / `MEM_E_CONFIG_UNKNOWN_KEY`
|
|
524
|
+
仍然 fail-fast(拼写错误不该被宽容)。
|
|
525
|
+
- `strictStartup` 自身必须是布尔值。
|
|
526
|
+
- **Added — 启动状态进入可观测面**:`CAPABILITIES.startup` / `CAPABILITIES.configVersion`
|
|
527
|
+
与 `memory_admin action=status` 的 `panel.startup` / `panel.configVersion` /
|
|
528
|
+
`panel.configWarnings`。设置页与运维方可以直接看到“这份配置来自哪个 schema 版本、
|
|
529
|
+
是否迁移过、是否降级启动”。
|
|
530
|
+
- **Added — 设置页「简洁模式」(纯显示层)**:设置页顶部新增“简洁模式 / 专业模式”切换。
|
|
531
|
+
简洁模式只渲染四块——**身份、上下文窗口、系统级存储位置迁移、原始回合留存(raw)**;
|
|
532
|
+
raw 卡内再收敛为三项(`raw.mode`、`raw.maxTotalMb`、`raw.compressionEngine`),
|
|
533
|
+
最小显著度 / 保留期 / 冷压缩阈值 / deep_raw 扫描上限全部隐藏。
|
|
534
|
+
- 隐藏是**纯 UI 行为,不碰配置值**:保存时 patch 被过滤为
|
|
535
|
+
`SIMPLE_PATCH_KEYS`(9 个可见键),文件里未显示的项保持原值;新装即默认值,
|
|
536
|
+
专业模式下调过的不会被简洁模式覆盖。
|
|
537
|
+
- 校验同步收敛:只检查可见数字键,隐藏项的越界值不会阻断保存,Cron 非空检查也跳过。
|
|
538
|
+
- 模式偏好存浏览器 `localStorage`(键 `hippocampus:settings-mode`),不进插件配置、
|
|
539
|
+
不影响引擎行为;读写失败一律退回专业模式。
|
|
540
|
+
- **Removed — 交接时“自动开启新会话”(`context.autoNewSession*`)**:交接就发生在对话
|
|
541
|
+
中间,宿主会在标记后**继续同一个对话**;客户端再调 `uiWorkspace.startSession()` 只会
|
|
542
|
+
额外弹出一个空对话,在“追加到原对话”的用法下毫无意义还打断体验。因此彻底移除:
|
|
543
|
+
- 配置层:`autoNewSession` / `autoNewSessionPoll` / `autoNewSessionIntervalSeconds`
|
|
544
|
+
三个键从 `DEFAULT_CONFIG`、校验、resolved 与 HTTP 可编辑白名单中删除。
|
|
545
|
+
- `migrateConfig` 会**静默剥离**旧 profile 残留的这三个键并 warn(否则老用户会撞上
|
|
546
|
+
未知键阻断启动)。
|
|
547
|
+
- 可观测面:`CAPABILITIES.autoNewSession` 与 `handoffView().autoNewSession` 删除。
|
|
548
|
+
- 客户端:三个设置控件、`startAutoNewSession()` 轮询器与其 `ctx.effect` 注册全部删除;
|
|
549
|
+
设置页不再渲染任何“自动开新会话”开关。
|
|
550
|
+
- **Fixed — 新对话拿不到交接摘要与前几轮原话**(2026-11-13 用户报告):
|
|
551
|
+
- 根因:冷启动注入是一个**进程级一次性布尔** `coldStartPending`,被**第一个组装
|
|
552
|
+
prompt 的 agent** 抢先消费(子代理、标题生成等),用户真正的新对话拿到的是空。
|
|
553
|
+
- 改为**按会话幂等**:`runtime.coldStart = { pending: Map, injected: Set, lastSessionId }`,
|
|
554
|
+
以 `session|handoffEpoch` 为键;`noteColdStart()` 在「新 session id 的首个
|
|
555
|
+
`session/event`」与「`agent/created`」两处布防(同键复用、已被注入过的直接跳过、
|
|
556
|
+
过期 5 分钟未消费自动丢弃、最多 8 条 pending 有界淘汰),
|
|
557
|
+
`promptState(assemblyContext)` 用宿主传给 `systemPrompt.context` 的
|
|
558
|
+
`assemblyContext.agent.id` 与当前 session id 做匹配,注入后写入 `injected` 集合并
|
|
559
|
+
有界淘汰(64)。**兄弟 agent 先装配不会再吞掉用户的注入**——这是单槽位实现仍会
|
|
560
|
+
踩的坑:标题生成器或子代理随后布防会覆盖并且消费掉用户的那一条。
|
|
561
|
+
- `handoff.json` 标记新增 `tailTurns`:交接蒸馏时把最后 5 轮(role + 文本,每条
|
|
562
|
+
≤400 字,内存环形缓冲 12 条、跨会话自动清空)写进标记;
|
|
563
|
+
`[Previous Context Tail]` 优先回放这些**原话**(`- user: …` / `- assistant: …`),
|
|
564
|
+
没有 tailTurns 时才回退到最近业务事件。
|
|
565
|
+
- `context.coldStartInjectRecentTurns` 默认由 `false` 改为 **`true`**:只给摘要会让
|
|
566
|
+
新对话接不上具体语境。
|
|
567
|
+
- 即使两个开关全关,匹配到的 pending 也会被消费掉,不会遗留到下一次无关会话。
|
|
568
|
+
- **可观测**:`/stats` 新增 `coldStart{ pending[], injected, lastSessionId }`(`runtime.coldStartView()`),
|
|
569
|
+
运维方不必读 prompt 就能区分“已布防未装配”与“已注入”。
|
|
570
|
+
- **`panel.startup` / `panel.configVersion` / `panel.configWarnings` 与 `capabilities.startup`
|
|
571
|
+
对齐**:此前 `toMemoryOptions()` 没有把迁移结果传给引擎,panel 报的是“未迁移”默认值,
|
|
572
|
+
而 capabilities 报的是真相——同一个进程两处说法不一致,现由 `toMemoryOptions` 一并透传。
|
|
573
|
+
- **Fixed — 复习队列只报不消费(积压到 337 条)**:`maintain()` 里
|
|
574
|
+
`ReviewSchedule.tick()` 的结果只被写进报告,**从来没有人推进它**,于是新装用户的
|
|
575
|
+
`state/reviews.json` 里每条都是 `lastAt: null`、`dueAt` 停在初始间隔,队列只增不减
|
|
576
|
+
(现场:`total 346 / due 337`)。两个后果:复习面板永远是“全到期”,且 recall 拿不到
|
|
577
|
+
强化锚点——衰减曲线相当于“写下之后从未被碰过”。
|
|
578
|
+
- 现在 `maintain()` 会真正消费到期行:`_consumeDueReviews()` 取出到期 id,
|
|
579
|
+
**分批**(默认 30–50 条,`review.consumeBatchSize = 40`)调用批量 `reinforce()`
|
|
580
|
+
(权重 1,日志即锚点,不改任何字段),再用 `ReviewSchedule.advanceMany()` 一次性
|
|
581
|
+
推进 `lastAt` / `step` / `dueAt`。
|
|
582
|
+
- **性能防线**:每批之间 `await new Promise(setImmediate)` 让出事件循环,HTTP 路由与
|
|
583
|
+
prompt 组装不会被一个巨大积压卡住;单次维护总量上限 `review.consumeMaxPerRun = 200`,
|
|
584
|
+
再多就跨多次维护轮次排空(报告里的 `remaining` 说明还剩多少)。
|
|
585
|
+
- **一次文件写/批**:新增的 `advanceMany()` 把“逐条 advance = 每条一次读+一次原子写”
|
|
586
|
+
变成“整批一次”,337 条积压不再是 337 次 fsync。
|
|
587
|
+
- 开关:`review.autoConsume`(默认 `true`)可关;`review.enabled: false` 时不会消费。
|
|
588
|
+
失败的批次不中断维护(`lastAt` 保持 null,下一轮自然重试),错误写进
|
|
589
|
+
`report.reviewConsumeError`。三条新键均进入 HTTP 可编辑白名单。
|
|
590
|
+
- **Fixed — 1.6.2 遗留的两个启动/保留缺陷(随 1.6.3 一并锁定)**:
|
|
591
|
+
- **旧 profile 启动阻断**:旧配置只写 `raw.retentionDays: 30`、没有 `archiveAfterDays`,
|
|
592
|
+
而 1.6.2 的新默认值是 90,硬校验 `archiveAfterDays < retentionDays` 直接抛错,
|
|
593
|
+
`apply()` 失败 → 插件整体不注册 → `/api/hippocampus/*` 全部 404,设置页永远停在
|
|
594
|
+
“正在启动…”。现在 `migrateConfig()` 在**未显式配置**且冲突时自适应派生
|
|
595
|
+
`Math.max(1, retentionDays - 1)`(30 → 29)并告警;**显式**写下越界值仍然 fail-fast。
|
|
596
|
+
- **`.jsonl.br` 冷归档永不清理**:`prune()` 原先只删明文分片,Brotli/Gzip/Zstd 归档
|
|
597
|
+
变成“保留期之外的永久副本”,等于变相突破 `retentionDays`。现在 `prune()` 按
|
|
598
|
+
`cutoffMonth` 整月删除过期归档,并同步从 `state/raw-archive.json` 抹掉记录
|
|
599
|
+
(返回 `removedArchives`)。
|
|
600
|
+
- **Tests**:`test/v163.migration.test.js`(9 例)锁定本次教训——旧配置(仅
|
|
601
|
+
`retentionDays: 30`)可启动且 `archiveAfterDays` 派生为 29;显式冲突在
|
|
602
|
+
`strictStartup: true` 下阻断、在 `false` 下降级启动;降级不吞类型错误与未知键;
|
|
603
|
+
以及 1.6.2 生产 profile 的原始形状可被完整解析。`test/helpers.js` 的夹具改走同一
|
|
604
|
+
迁移步骤,`test/status.test.js` 的 panel 形状契约同步新增三个字段。
|
|
605
|
+
`test/v163.ui.test.js`(5 例)锁定简洁模式契约:`Section` 的 `hidden` 短路、
|
|
606
|
+
14 个专业模式卡片全部带 `hidden: simpleMode`、raw 只剩三项、保存与校验按白名单收敛。
|
|
607
|
+
`test/v163.reviewQueue.test.js`(5 例)锁定复习消费契约:到期行被消费且 `step`/`lastAt`
|
|
608
|
+
前进、强化记录数 == 消费数、超出单轮预算的积压跨轮次排空、`autoConsume:false` 不动队列、
|
|
609
|
+
整批只写一次 `reviews.json`。
|
|
610
|
+
`test/v156.autoSession.test.js` 重写为「该功能已移除」契约(配置无该键、旧 profile
|
|
611
|
+
迁移剥离、路由/能力面不暴露、客户端无轮询器);
|
|
612
|
+
`test/v160.coldStart.test.js` 重写为按会话注入契约(无标记不布防、摘要+尾部各一次、
|
|
613
|
+
兄弟 agent 先装配不吞注入、两个会话各注入一次、**两条 pending 先布防后装配也各得其份**、
|
|
614
|
+
双关不遗留 pending、tailTurns 优先、stats 暴露 coldStart 状态)。
|
|
615
|
+
全量 **483/483**(78 个测试文件)。
|
|
616
|
+
|
|
617
|
+
## [1.6.2] — 2026-11-11
|
|
618
|
+
|
|
619
|
+
**补丁版:修复冷数据归档与保留期的时间冲突,并把“打破日志线性增长”的三层机制并入正式记录。**
|
|
620
|
+
|
|
621
|
+
- **Fixed — 设置页卡在“正在启动…”并报 `MEM_E_NETWORK: HTTP 404`**(2026-11-13):
|
|
622
|
+
1.6.2 的强校验 `archiveAfterDays < retentionDays` 与**旧 profile**(`raw.retentionDays: 30`、
|
|
623
|
+
从未写过 `archiveAfterDays`)冲突,`apply()` 抛 `MEM_E_CONFIG_OUT_OF_RANGE`,插件根本没加载,
|
|
624
|
+
所有 `/api/hippocampus/*` 路由缺失 → UI 永远 404。现在:
|
|
625
|
+
- `archiveAfterDays` **未被显式配置**时按 `retentionDays - 1` 派生,并置
|
|
626
|
+
`raw.archiveAfterDaysDerived: true`(旧 profile 可直接启动);
|
|
627
|
+
- **显式**给出越界的 `archiveAfterDays` 仍然 fail-fast(配置错误不该被静默原谅)。
|
|
628
|
+
- **Fixed — 归档文件不受 retention 约束**:`prune()` 原来只删 `.jsonl` 明文分片,`.jsonl.br`
|
|
629
|
+
归档会永久堆积,等于变相突破保留期。现在整月归档的末日晚于 cutoff 才保留,否则连
|
|
630
|
+
`state/raw-archive.json` 记录一起删除,返回 `removedArchives`。
|
|
631
|
+
|
|
632
|
+
- **修复冷数据归档时间冲突**:冷归档阈值与 TTL 保留期原本互相挤压(`archiveAfterDays` 与
|
|
633
|
+
`retentionDays` 同为 30/90 量级,冷分片常在归档前就被 TTL 删除)。现在默认值上调为
|
|
634
|
+
`archiveAfterDays: 90`、`retentionDays: 365`,并保留 fail-fast 校验
|
|
635
|
+
(`archiveAfterDays` 必须严格小于 `retentionDays`),同时新增 `raw.coldAccessWindowDays: 90`,
|
|
636
|
+
也就是“近 90 天零访问”才允许归档。
|
|
637
|
+
- **实施多档保留策略(含遗忘性保存与全保存)**:raw 层保留谱系落地为
|
|
638
|
+
`raw.mode: off | salience | all` ——
|
|
639
|
+
`off` 为不保存(遗忘性保存,仅保留 L1 之上的记忆)、`salience` 为默认的高价值保存、
|
|
640
|
+
`all` 为全保存(受 `maxTurnKb` / `maxBytesPerDay` / `maxTotalMb` 预算约束);
|
|
641
|
+
另加 `raw.distillPrune`(默认 false):蒸馏产物覆盖第 i 天、且该分片已出
|
|
642
|
+
`raw.hotWindowDays` 热窗时,允许物理清理 raw 原文,**必经 Tombstone 防复活**。
|
|
643
|
+
L2 继续走同类项合并(`l2Merge`),L3 增加硬熔断 `semantic.maxEntries`(默认 100)+ LRU 淘汰,
|
|
644
|
+
语义层随“事件重要性”而非“对话条数”增长。
|
|
645
|
+
- **优化长窗口压缩与高频引用去重**:
|
|
646
|
+
- 冷归档默认改用 **Brotli quality 11**(`.jsonl.br`,极限压缩),`gzip`(9) / `zstd` 仍可选,
|
|
647
|
+
全部来自 Node 内置 `node:zlib`,零外部依赖;读取按扩展名流式解压、命中即停。
|
|
648
|
+
- 高频重复的超长内容(工具 schema / 系统提示块,≥512 字符且出现 ≥2 次)在建索引时
|
|
649
|
+
只存一份到 `templates.json`,事件侧改为 `contentRef` 引用(`src/index/templates.js`),
|
|
650
|
+
索引加载时还原原文;**日志本体不参与替换**,raw 逐行真相、`deep_raw` 与行级游标不受影响。
|
|
651
|
+
- 稀疏行索引(每 64 行采样)继续用于跳过时间窗不重叠的分片并复用 `lineCount`。
|
|
652
|
+
|
|
653
|
+
### 1.6.2 详细变更
|
|
654
|
+
|
|
655
|
+
- **Breaking the linear log curve — three layers** (`test/v162.nonlinear.test.js`, 9 cases):
|
|
656
|
+
- **Compression layer**: cold classification is now MULTI-dimensional (age >
|
|
657
|
+
`raw.archiveAfterDays` **AND** zero access for `raw.coldAccessWindowDays` **AND** no
|
|
658
|
+
`pinned` / `status:handoff` / hot-tag record). Defaults move to
|
|
659
|
+
`archiveAfterDays=90`, `coldAccessWindowDays=90`, `retentionDays=365`. Cold
|
|
660
|
+
archives default to **Brotli quality 11** (`.jsonl.br`, "极限压缩") instead of
|
|
661
|
+
gzip; `gzip`/`zstd` stay selectable and all three are Node built-ins.
|
|
662
|
+
Recently-read old shards stay PLAINTEXT for O(1) cursor scans.
|
|
663
|
+
- **Encoding layer (referential dedup, NOT columnar)**: repeated long content
|
|
664
|
+
(tool schemas / system prompt blocks, ≥512 chars, ≥2 occurrences) is stored ONCE
|
|
665
|
+
in `templates.json` at the INDEX layer; events carry `contentRef` instead of a
|
|
666
|
+
duplicate copy. Index loads resolve refs, so readers always see exact content —
|
|
667
|
+
the log itself is untouched (`src/index/templates.js`).
|
|
668
|
+
- **Semantic layer**: raw stops being the only home of truth. `raw.distillPrune`
|
|
669
|
+
(opt-in) lets `maintain()` physically clean raw shards that are outside
|
|
670
|
+
`raw.hotWindowDays` **and** already covered by an L3 summary — always through the
|
|
671
|
+
tombstone path, so nothing resurrects. L3 gains a hard capacity breaker
|
|
672
|
+
(`semantic.maxEntries`, default 100) with LRU retirement recorded as append-only
|
|
673
|
+
`semantic_retire` events.
|
|
674
|
+
|
|
675
|
+
## [1.6.1] — 2026-11-07
|
|
676
|
+
|
|
677
|
+
**Version fully un-frozen (user directive 2026-11-07): normal semantic versioning
|
|
678
|
+
resumes; 1.6.1 was the release that followed 1.6.0.**
|
|
679
|
+
|
|
680
|
+
- **Archive month detail UI**: the panel's raw section now shows `indexedShards` /
|
|
681
|
+
`archiveCount` StatCards plus a **collapsible month table** (月份 / 引擎 / 归档大小 /
|
|
682
|
+
归档时间, month-DESC, collapsed by default). `panel.raw` carries `archivedBytes`,
|
|
683
|
+
`totalBytes`, `engines:{gzip,zstd}`, `savedBytes`, `compressionRatio` (null when
|
|
684
|
+
unmeasured) and `archiveMonths[]` with `at`/`bytesBefore`/`bytesAfter`; older hosts
|
|
685
|
+
degrade to “—” instead of breaking the panel.
|
|
686
|
+
- **Segment-token audit** (`docs/AUDIT-2026-11-07-segment-token.md`): no P0
|
|
687
|
+
same-segment re-injection exists; the six injection surfaces are documented with
|
|
688
|
+
their dedup mechanisms. Its two P3 items are now IMPLEMENTED:
|
|
689
|
+
- **P3-1** the `[Active Task]` event id also joins the block dedup pool, so one
|
|
690
|
+
event can never be injected both as Active Task and as a recall block;
|
|
691
|
+
- **P3-2** `[Persona & Traits]` is memoized by the L3 shape (`summaryId` +
|
|
692
|
+
`updatedAt` + count); unchanged L3 costs one signature, not a re-render.
|
|
693
|
+
- **Raw cold-tier archiving (zero external deps)**: on `maintain()`, daily shards
|
|
694
|
+
older than `raw.archiveAfterDays` (default **7**) are merged per calendar month
|
|
695
|
+
into one `raw-archive-YYYY-MM.jsonl.gz` via Node's built-in `zlib`, then the
|
|
696
|
+
plaintext shard is removed. Archiving runs at most once per month and SKIPS any
|
|
697
|
+
shard that is recently read (`state/raw-access.json`), `pinned`,
|
|
698
|
+
`status:handoff`, or carries a hot active-set tag. `deep_raw` and hash restore
|
|
699
|
+
stream the archive with `createGunzip()` line-by-line (no full read), report
|
|
700
|
+
`archiveErrors`/`notes: archive-corrupt:<name>` for a corrupt archive, and keep
|
|
701
|
+
plaintext `.jsonl` reads unchanged. `raw.retentionDays` default moves **30 → 90**
|
|
702
|
+
and must stay strictly above `archiveAfterDays` (fail-fast otherwise).
|
|
703
|
+
- **`/stats` panel: archive + index visualization**: `panel.raw` now reports
|
|
704
|
+
`archiveCount`, `archivedBytes`, `totalBytes`, `archiveMonths`, `engines`
|
|
705
|
+
(`{gzip,zstd}`), `savedBytes` (sum of bytesBefore−bytesAfter), `compressionRatio`
|
|
706
|
+
(null when no measured archive) and `indexedShards`. Each archive records
|
|
707
|
+
`bytesBefore`/`bytesAfter` in `state/raw-archive.json`, so the ratio and saved
|
|
708
|
+
bytes are real measurements, not estimates. The panel gains two StatCards
|
|
709
|
+
(“raw 索引覆盖”, “raw 冷归档”) with graceful “—” for an older host, plus a
|
|
710
|
+
collapsible **archive month table** (月份 / 引擎 / 归档大小 / 归档时间, month-DESC,
|
|
711
|
+
collapsed by default); `archiveMonths` rows carry `at`/`bytesBefore`/`bytesAfter`.
|
|
712
|
+
4 cases in `test/v161.stats.test.js` + 2 UI contract cases.
|
|
713
|
+
- **Sparse line index for raw shards** (performance audit item C): one
|
|
714
|
+
`<day>.jsonl.idx.json` per shard, sampled every 64 lines with
|
|
715
|
+
`{line, offset, timestamp}` plus `bytes/mtimeMs/lineCount/minTs/maxTs/sorted`.
|
|
716
|
+
`deep_raw` uses it to SKIP a shard whose time range cannot overlap the window
|
|
717
|
+
(without opening the file) and to reuse `lineCount` for absolute `hit.line`
|
|
718
|
+
numbers (no second pass). Built offline by `maintain()` (50 shards/round,
|
|
719
|
+
progressive), deleted with its shard by `prune()`, and silently bypassed when
|
|
720
|
+
missing, stale (bytes/mtime mismatch), corrupt, or non-monotonic. `stats()`
|
|
721
|
+
reports `indexedShards`. 6 cases in `test/v161.rawIndex.test.js`.
|
|
722
|
+
- **Compression-engine selection (zero install)**: `raw.compressionEngine`
|
|
723
|
+
(`gzip` default | `zstd`) + a settings-page engine picker with an
|
|
724
|
+
enable/disable button. Zstd uses Node's BUILT-IN `node:zlib` zstd — nothing is
|
|
725
|
+
downloaded and there is no package to uninstall; "停用" switches back to gzip.
|
|
726
|
+
Archives are `raw-archive-YYYY-MM.jsonl.gz` / `.jsonl.zst`, dispatch is by
|
|
727
|
+
extension, and a legacy gzip archive stays readable after switching to zstd.
|
|
728
|
+
When the runtime lacks zstd the config silently falls back to gzip and
|
|
729
|
+
`capabilities.compression` reports `{engine, fallback, zstd, node}` for the UI.
|
|
730
|
+
- **Raw retention tiers documented**: the raw layer exposes exactly three modes —
|
|
731
|
+
`off` (keep nothing), `salience` (default: high-value turns/code/stack/errors only),
|
|
732
|
+
`all` (bounded by `maxTurnKb`/`maxBytesPerDay`/`maxTotalMb`) — plus
|
|
733
|
+
`retentionDays` (default 90) and `pinned` never pruned. README/ARCHITECTURE now
|
|
734
|
+
describe these implemented tiers only.
|
|
735
|
+
- **Fixed — settings page rendered blank**: the compression-engine card referenced a
|
|
736
|
+
bare `payload` that only exists in other components' scopes; it now uses the local
|
|
737
|
+
`statsPayload` and the shared `Select` component (not a fake `type:'select'` on
|
|
738
|
+
`Field`). `test/v161.ui.test.js` pins the scope rule so the whole settings page
|
|
739
|
+
cannot be taken down by one card again.
|
|
740
|
+
|
|
741
|
+
- **Recall bound-based early exit** (performance audit item A): every score is
|
|
742
|
+
`salience × decay × tagAffinity(≤3) × lexicalBoost(≤1) × association(≤1) ×
|
|
743
|
+
timeBoost(≤1.3) × handoff(≤1)`, so `salience × 3.9` is a hard upper bound.
|
|
744
|
+
Candidates are visited salience-DESC and scoring stops as soon as that bound
|
|
745
|
+
cannot beat the current k-th score. `pinned` hits bypass the cut, the best-k
|
|
746
|
+
window keeps the bound exact (ties still visited), and the result reports
|
|
747
|
+
`pruned` + `notes: pruned:<n>`. Complexity unchanged in the worst case
|
|
748
|
+
(`O(K log K)` ordering) but the per-candidate decay/similarity work is skipped
|
|
749
|
+
for the long low-salience tail.
|
|
750
|
+
- Regression: pinned decay stays exactly 1 (bypass path), monthly memos unchanged.
|
|
751
|
+
- **456 tests green** (64 files).
|
|
752
|
+
|
|
753
|
+
## [1.6.0] — 2026-11-06
|
|
754
|
+
|
|
755
|
+
> Version note: 1.6.0 was the FIRST release after the temporary 1.5.7 freeze; the
|
|
756
|
+
> 2026-11-07 directive removed all freeze language and resumed normal versioning.
|
|
757
|
+
Cold-start wake-up + user-controlled cold-start injection:
|
|
758
|
+
|
|
759
|
+
- **Anti-"customer service" wake-up** (static `memory:policy` prefix): the model is
|
|
760
|
+
told it has continuous long-term memory, must not open with "how may I help you",
|
|
761
|
+
and should recall the recent topic before replying.
|
|
762
|
+
- **`context.coldStartInjectSummary`** (default **true**): on the first prompt
|
|
763
|
+
assembly of a brand-new conversation, inject `[Cold-Start Summary]` — the handoff
|
|
764
|
+
summary event when present, else the top-3 L3 semantic summaries (≤800 chars).
|
|
765
|
+
- **`context.coldStartInjectRecentTurns`** (default **false**): inject
|
|
766
|
+
`[Previous Context Tail]` with the last ≤5 business episodes (200 chars each).
|
|
767
|
+
- **`[Cold-Start Detected: Active Space=…, Recent Topic=…]`** header when either
|
|
768
|
+
switch is on; the block is volatile-tail only (prompt-cache prefix untouched) and
|
|
769
|
+
is consumed exactly once per new conversation.
|
|
770
|
+
- Both switches off → no historical blocks; the static wake-up policy still ships.
|
|
771
|
+
- UI: two independent toggles in the settings page's session group; HTTP-editable.
|
|
772
|
+
- **416 tests green** (64 files).
|
|
773
|
+
|
|
774
|
+
## [1.5.7] — 2026-11-04
|
|
775
|
+
|
|
776
|
+
> Historical note: 1.5.7 shipped under a temporary version freeze; the 2026-11-07
|
|
777
|
+
> directive removed ALL freeze language and resumed normal semantic versioning
|
|
778
|
+
> (current version: 1.6.2). The sentence below is the historical 1.5.7 statement.
|
|
779
|
+
|
|
780
|
+
**Version freeze (historical, superseded): 1.5.7 was the shipped release.**
|
|
781
|
+
This release folds in everything added after the 1.5.6 draft — Orchestrator
|
|
782
|
+
federation/dedupe wiring, read-time merge, cross-space recall aggregation (opt-in
|
|
783
|
+
`features.crossSpaceRecall`), durable Orchestrator state, the settings-page GitHub
|
|
784
|
+
installer, the verified automatic new-conversation handoff (with configurable
|
|
785
|
+
once/interval detection), low-valley Dream Phase 2, space deletion, graph
|
|
786
|
+
interaction, and the rest of the 1.5.6 section below. Annotations of the form
|
|
787
|
+
`v1.5.6:` below record the version in which a feature was introduced; they are
|
|
788
|
+
history, not the current version. **411 tests green** (64 files).
|
|
789
|
+
|
|
790
|
+
## [1.5.6] — 2026-11-03
|
|
791
|
+
|
|
792
|
+
**`deep_raw` now scans by line cursor: a huge day shard is never loaded whole.**
|
|
793
|
+
The black box is read newest-first in fixed chunks; peak memory is one chunk plus
|
|
794
|
+
one partial line (test-locked), not the file size. `hit.line` keeps its absolute
|
|
795
|
+
1-based semantics. **411 tests green** (was 303).
|
|
796
|
+
|
|
797
|
+
### Changed — raw scan / restore (zero-dependency, O(chunk) memory)
|
|
798
|
+
|
|
799
|
+
- **`readLinesReverse(file, {chunkSize, onBuffer})`** (`src/rawStore.js`): reads a
|
|
800
|
+
file backwards in 64 KiB chunks, yielding one line at a time; the trailing
|
|
801
|
+
newline does not produce a phantom empty line. `onBuffer` reports the live
|
|
802
|
+
buffer size for tests.
|
|
803
|
+
- **`deep_raw` scan** rewrote the whole-shard `readFileSync + split` path:
|
|
804
|
+
newest-first, one `JSON.parse` per line, line bytes counted as they are read,
|
|
805
|
+
hit results collected per shard. `hit.line` is computed from the shard's line
|
|
806
|
+
count via ONE extra bounded streaming pass, paid only when that shard produced
|
|
807
|
+
a hit (so a miss costs no counting pass).
|
|
808
|
+
- **`restoreByHash`** streams forward via `readline`; **`_loadTombstones`** streams
|
|
809
|
+
synchronously with a `StringDecoder` (multi-byte boundaries preserved);
|
|
810
|
+
**`_hashesFor`** streams asynchronously (so `RawStore.capture()` is now async —
|
|
811
|
+
only internal callers exist; the public `captureRaw()` contract is unchanged).
|
|
812
|
+
- **Engine-side result ceiling**: `MAX_SCAN_RESULTS = 500` caps one scan even if an
|
|
813
|
+
embedder passes `limit: 5000`; `budget.maxHits` is reported, `truncated` is true
|
|
814
|
+
when the cap is reached.
|
|
815
|
+
- **Observability**: `scanned.peakBufferBytes` exposes the largest buffer the
|
|
816
|
+
scanner ever held (proves the memory bound).
|
|
817
|
+
|
|
818
|
+
### Added — stability hardening (same 1.5.6, no extra version bump)
|
|
819
|
+
|
|
820
|
+
- **Recall response cap**: `context.maxInjectTokens` (default 4000, 256–100 000,
|
|
821
|
+
fail-fast) bounds the JSON one recall returns. `Memory.applyPayloadBudget()`
|
|
822
|
+
keeps hits in rank order (the first is always kept), then semantic/temp summaries;
|
|
823
|
+
a cut is loud: `truncated: true`, `payload: {maxTokens, estimatedTokens, dropped}`
|
|
824
|
+
and a `payload-budget` note. Editable over HTTP and rendered in the settings page
|
|
825
|
+
with a tooltip.
|
|
826
|
+
- **`Memory.close()` releases resources**: `RawStore.close()` clears the flush timer
|
|
827
|
+
and synchronously persists queued turns before the log closes; `Memory.close()`
|
|
828
|
+
then detaches the scheduler, clears oversized-tag hints and calls
|
|
829
|
+
`IndexManager.release()` to drop the A/B views. Idempotent.
|
|
830
|
+
- **Event-loop lag monitoring**: `src/eventLoop.js` (`createLagMonitor`) wraps
|
|
831
|
+
`perf_hooks.monitorEventLoopDelay`; `maintain()` yields 50ms between phases and
|
|
832
|
+
`IndexManager.rebuild` yields between read/build/catch-up/swap once the measured
|
|
833
|
+
max delay crosses 100ms. The report carries
|
|
834
|
+
`eventLoop: {maxMs, p99Ms, meanMs, yields, thresholdMs}`. Honest boundary: a
|
|
835
|
+
synchronous builder cannot be preempted, so the granularity is phase-level and the
|
|
836
|
+
numbers expose an oversized phase.
|
|
837
|
+
|
|
838
|
+
### Added — pre-ingest tagging (same 1.5.6, no extra version bump)
|
|
839
|
+
|
|
840
|
+
- **`src/tagging.js` / `extractTags()`**: deterministic anchors derived from content
|
|
841
|
+
shape — named error types (`error:typeerror`), Node errno codes
|
|
842
|
+
(`error:econnrefused`), fenced-code language (`lang:python`), HTTP status
|
|
843
|
+
(`http:500`), file path basename (`file:index.js`) and explicit task statements
|
|
844
|
+
(`task:…`). No LLM, no dependencies, stable ordering.
|
|
845
|
+
- **Write gate** (`Memory.stage`): model-provided tags always win; only an untagged
|
|
846
|
+
write runs the heuristic. Tags are deduplicated and capped by `tagging.maxTags`
|
|
847
|
+
(1–5, default 2). Inferred anchors are recorded on `meta.auto_tagged` /
|
|
848
|
+
`meta.auto_tags` (provenance, not a silent rewrite of what the caller asserted).
|
|
849
|
+
- **raw stays pure**: the black box still receives exactly
|
|
850
|
+
`{turn_id, timestamp, role, content}` — the test locks the four-field shape.
|
|
851
|
+
- **Miss is a warning**: `MEM_E_AUTO_TAG_MISS` goes to the Host log via
|
|
852
|
+
`Memory.setWarnHook` (wired in `index.js`) and increments
|
|
853
|
+
`panel.autoTag.misses`; the write proceeds untagged.
|
|
854
|
+
- **Config**: `tagging.autoTag` (default true) and `tagging.maxTags` (1–5), both
|
|
855
|
+
fail-fast, HTTP-editable and rendered in the settings page.
|
|
856
|
+
|
|
857
|
+
### Added — pinned memory (same 1.5.6, no extra version bump)
|
|
858
|
+
|
|
859
|
+
- **`remember({ pinned: true })`**: a lesson/experience that must survive time.
|
|
860
|
+
It stores `meta.pinned = true` (provenance included in `content_hash`) and is
|
|
861
|
+
refused with **`MEM_E_PINNED_TAG_REQUIRED`** unless the caller supplies at least
|
|
862
|
+
one tag — an untriggerable lesson would be dead memory.
|
|
863
|
+
- **Never decays**: `projectEpisode` exposes `pinned`; `deriveTagTable` gives a
|
|
864
|
+
pinned event `decay = 1`, keeps its tag un-archived, and protected from the
|
|
865
|
+
`maxPostingsPerTag` drop; `deriveActiveSet` admits pinned tags regardless of
|
|
866
|
+
score or the cap.
|
|
867
|
+
- **Ranks first**: recall gives every matching pinned record `decay = 1`, exempts
|
|
868
|
+
it from `minScore`, and orders pinned hits ahead of all others
|
|
869
|
+
(`pinned-first:N` note).
|
|
870
|
+
- **Observability**: `panel.global.pinned` counts pinned records.
|
|
871
|
+
- Tool surface: `memory_remember.pinned` (boolean) is documented and passed
|
|
872
|
+
through; `bulk_ingest` items accept the same field.
|
|
873
|
+
|
|
874
|
+
### Changed — relevance-first prompt hints (same 1.5.6, no extra version bump)
|
|
875
|
+
|
|
876
|
+
- **Global "most active tags" map removed from the prompt.** `runtime.promptState()`
|
|
877
|
+
now renders only tags that lexically overlap the CURRENT user turn (max 5), via
|
|
878
|
+
`src/utils/memoryHints.js` (`selectRelevantTags` / `renderMemoryHints`).
|
|
879
|
+
Internal bookkeeping tags (`status:*`, `month:*`, `context:*`, `active_task`)
|
|
880
|
+
are never hinted; no match means the section is simply absent (no padding).
|
|
881
|
+
- **Cache-safe placement**: `[Memory Hints]` is rendered AFTER `[Memory Blocks]`,
|
|
882
|
+
so a per-turn hint never disturbs the cacheable prefix (rules only).
|
|
883
|
+
- **Input source**: prompt assembly receives no message text, so the plugin tracks
|
|
884
|
+
the last `user/message` from `session/event` (`runtime.lastUserText`); other
|
|
885
|
+
surface events never overwrite it.
|
|
886
|
+
- The legacy `renderMemoryMap` / `composePrompt({map})` API remains for callers
|
|
887
|
+
and is still unit-tested, but the plugin no longer injects the map.
|
|
888
|
+
|
|
889
|
+
### Added — capability flags & microkernel boundary (same 1.5.6, no extra version bump)
|
|
890
|
+
|
|
891
|
+
- **`features.multiSpace` (default true)** and **`features.crossSpaceTransfer`**
|
|
892
|
+
(default mirrors multiSpace). Both are fail-fast, HTTP-editable and rendered in
|
|
893
|
+
the settings page; turning multiSpace off implies crossSpaceTransfer off, and the
|
|
894
|
+
explicit contradictory combination is refused.
|
|
895
|
+
- **Strict single-space mode**: with multiSpace off, every routed read/write whose
|
|
896
|
+
`targetSpaceId` is not `default` answers **`MEM_E_FEATURE_DISABLED`** (before any
|
|
897
|
+
I/O); `createSpace` / `ensureSpace` / `warmup` refuse too, and the `/spaces` route
|
|
898
|
+
reports `['default']` with `capabilities.spaces=false` so the client hides
|
|
899
|
+
create/selector affordances instead of 404-ing.
|
|
900
|
+
- **Tools follow the flags**: `space_transfer` / `transfer_to_global` are neither
|
|
901
|
+
registered nor advertised in the prompt section when the capability is off.
|
|
902
|
+
- **`Memory.open('/abs/dir')`** is now the single-space form (the Orchestrator owns
|
|
903
|
+
the multi-space walk); the options-object form stays supported.
|
|
904
|
+
- **`Memory.warmup({targetSpaceId?, dataDir?})`**: lazy, read-only index warm-up for
|
|
905
|
+
the UI / Orchestrator — no maintenance, no writes; unknown/relative dataDir fails
|
|
906
|
+
fast.
|
|
907
|
+
|
|
908
|
+
### Added — host lifecycle: compensating Dream (same 1.5.6, no extra version bump)
|
|
909
|
+
|
|
910
|
+
- **`src/hostBridge.js`** subscribes to the Host's process-local events
|
|
911
|
+
`agent/created` and `session/created` (the "session start" signals) through a plain
|
|
912
|
+
`{on, off}` bus seam, plus `agent/disposed` for teardown.
|
|
913
|
+
- **Compensation rule**: on a session start, if no Dream ran for
|
|
914
|
+
`dream.compensateAfterHours` (default 24, 1–720, fail-fast) AND the price window
|
|
915
|
+
permits, run exactly ONE compensating Dream through the shared
|
|
916
|
+
`runtime.runMaintenance('compensate')` gate — never a second concurrent run, never
|
|
917
|
+
a queue.
|
|
918
|
+
- **Price is injected, never guessed**: `setPriceProbe(fn)` / `DSH_DREAM_PRICE=low|high`.
|
|
919
|
+
Unknown price + an LLM-backed Dream ⇒ skip (`price-unknown`); unknown + local-only
|
|
920
|
+
Dream ⇒ allowed. A known peak ⇒ skip (`peak`).
|
|
921
|
+
- **Observability**: `runtime.hostStatus()` and `/stats`'s top-level `host` report
|
|
922
|
+
`sessionStarts / compensations / skipped / lastSkipReason / dreamDue / lowValley`.
|
|
923
|
+
- `enableDream:false` disables compensation; `agent/created`/`session/created` do not
|
|
924
|
+
otherwise affect memory writes (raw capture remains on `session/event`).
|
|
925
|
+
|
|
926
|
+
### Added — Dream tunables in the settings page (same 1.5.6, no extra version bump)
|
|
927
|
+
|
|
928
|
+
- The **safe** Dream subset is now exposed to `/stats` + `/config` and rendered in
|
|
929
|
+
the settings page: `useLlm`, `minGroupSize`, `maxGroupsPerRun`, `maxSummaryChars`,
|
|
930
|
+
`maxSourceChars`, `maxEventsPerGroup`, `llmTimeoutMs`, `failureThreshold`,
|
|
931
|
+
`cooldownMinutes`, `compensateAfterHours` (all fail-fast validated).
|
|
932
|
+
- **Credentials stay private**: `dream.llm.{baseUrl,model,apiKey}` is neither exposed
|
|
933
|
+
by the routes nor editable over HTTP nor rendered in the form; it comes only from
|
|
934
|
+
the profile or `DSH_DREAM_LLM_*` env. A test asserts the key never appears in the
|
|
935
|
+
`/stats` payload.
|
|
936
|
+
|
|
937
|
+
### Added — L2 multi-merge (`merged_into`, same 1.5.6, no extra version bump)
|
|
938
|
+
|
|
939
|
+
- **`src/l2Merge.js`** condenses duplicate same-tag L2 episodes into ONE durable
|
|
940
|
+
record, offline at the end of `maintain()` (after monthly memos; a failure never
|
|
941
|
+
fails maintenance).
|
|
942
|
+
- **Pinned and ordinary groups are strictly separated** — pinned merges only with
|
|
943
|
+
pinned; ordinary only with ordinary. A pinned merge keeps `pinned: true` and
|
|
944
|
+
inherits every tag.
|
|
945
|
+
- **Text**: earliest/latest time + deduplicated core text (each source capped), the
|
|
946
|
+
whole line capped by `l2Merge.maxSummaryChars` (ASCII ellipsis so identity
|
|
947
|
+
canonicalisation cannot make it longer).
|
|
948
|
+
- **Federated metadata**: `meta.global_tags` is copied into the merged record's
|
|
949
|
+
`meta` and **never becomes a tag**, so it cannot enter the sub-space inverted index;
|
|
950
|
+
`projectEpisode` exposes it as `event.globalTags` for the merge layer only.
|
|
951
|
+
- **Append-only marking**: sources are recorded as merged in
|
|
952
|
+
`state/l2-merge.json` (`mergedSourceIds`); the log is untouched and originals stay
|
|
953
|
+
recoverable. A second pass merges nothing (idempotent) and `status().panel.l2Merge`
|
|
954
|
+
reports the bookkeeping.
|
|
955
|
+
- **Config `l2Merge`**: `enabled` (default true), `minGroupSize` (2–20, default 2),
|
|
956
|
+
`maxGroupsPerRun` (1–50, default 5), `maxSummaryChars` (100–2000, default 400);
|
|
957
|
+
fail-fast, HTTP-editable and rendered in the settings page.
|
|
958
|
+
|
|
959
|
+
### Added — L3 semantic tag invariant (same 1.5.6, no extra version bump)
|
|
960
|
+
|
|
961
|
+
- **`SemanticStore.upsert` is strict**: an L3 summary with zero usable tags is
|
|
962
|
+
refused with **`MEM_E_SEMANTIC_TAG_REQUIRED`** — such a summary could never be
|
|
963
|
+
reached by tag-driven retrieval (dead knowledge).
|
|
964
|
+
- **Offline paths degrade instead of failing**: delete-consolidation and trend
|
|
965
|
+
promotion derive tags from content heuristics (`extractTags`) and, if even that
|
|
966
|
+
yields nothing, write an explicit provenance anchor (`origin:unlabelled-episode` /
|
|
967
|
+
`origin:unlabelled-trend`). Maintenance and the two-phase delete pipeline therefore
|
|
968
|
+
never break on historical untagged events.
|
|
969
|
+
- **Historical data is read-only degraded**: summaries written before the invariant
|
|
970
|
+
remain readable and are marked `degraded: true` in `list()` /
|
|
971
|
+
`semanticSummaries()`; nothing is silently rewritten.
|
|
972
|
+
|
|
973
|
+
### Added — working mode survives a handoff (same 1.5.6, no extra version bump)
|
|
974
|
+
|
|
975
|
+
- **Handoff marker carries the Host agent preset** (the UI's “工作模式”): the marker
|
|
976
|
+
written at rollover now records `agentPreset`, fed by the live adapter through
|
|
977
|
+
`memory.setHandoffPresetProvider()`.
|
|
978
|
+
- **A new conversation restores it before its first turn**: `agent/created` is a
|
|
979
|
+
serial Host event, so the bridge awaits `agentPresets.select(agent, preset)` for
|
|
980
|
+
`source === 'startup'` from a different session. `resume`, the marker-owner session
|
|
981
|
+
and markers without a preset are never overridden.
|
|
982
|
+
- **Never breaks agent creation**: a failed `select` is reported in
|
|
983
|
+
`runtime.lastPresetInherit` and the log, then creation proceeds.
|
|
984
|
+
- **Tracking**: `agent-preset/selected` updates the mode; tool boundaries and prompt
|
|
985
|
+
assembly opportunistically read `agents.currentInitiator()` + `agentPresets
|
|
986
|
+
.composedPreset()` and **backfill an older marker** that predates this feature.
|
|
987
|
+
- **Observability**: `/stats` exposes `agentPreset` + `presetInherit`, and
|
|
988
|
+
`hostStatus().presetSelections` counts observed selections.
|
|
989
|
+
|
|
990
|
+
### Changed — physical split: multi-space engine moved out (same 1.5.6)
|
|
991
|
+
|
|
992
|
+
- **`src/spaces/spaceRouter.js` and `src/spaces/transfer.js` are GONE from this
|
|
993
|
+
package.** The full multi-space router (per-space FIFO chains, lazy child stores,
|
|
994
|
+
`MEM_E_*` validation) and the cross-space transfer engine now live in
|
|
995
|
+
`dsh-orchestrator` (`src/spaceRouter.js`, `src/transfer.js`).
|
|
996
|
+
- The core compiles only `src/spaces/singleSpace.js`: the `default` space is the
|
|
997
|
+
owner handle; every named-space operation answers **`MEM_E_FEATURE_DISABLED`** with
|
|
998
|
+
an explicit "install dsh-orchestrator" hint. No silent fallback to `default`.
|
|
999
|
+
- **Adapter injection is the wiring seam**: the Host's optional `orchestrator`
|
|
1000
|
+
service supplies `createSpaceAdapter({owner, dataDir, openChild})` and `transfer`;
|
|
1001
|
+
`Memory.open({spaces|spacesFactory, transfer})` accepts the same seam for embedders.
|
|
1002
|
+
Without the service the plugin advertises `capabilities.spaces=false`, registers
|
|
1003
|
+
only the eight single-space tools, and `/spaces` reports `default` only.
|
|
1004
|
+
- A profile with `features.multiSpace:true` but no Orchestrator logs a loud warning
|
|
1005
|
+
and runs the strict single-space core (visible in `/stats.capabilities`), instead
|
|
1006
|
+
of pretending the capability exists.
|
|
1007
|
+
|
|
1008
|
+
### Added — first batch: orchestrator service + 3 experience fixes (same 1.5.6)
|
|
1009
|
+
|
|
1010
|
+
- **Orchestrator service registration**: `apply()` now installs a real Host service
|
|
1011
|
+
(`ctx.provide('orchestrator', …)` inside `ctx.effect`, so unloading removes it).
|
|
1012
|
+
It exposes `createSpaceAdapter`, `transfer`, `dirFor`, `status`, `federation`,
|
|
1013
|
+
`dedupe`, `consent` and `router`. The core decides the capability through
|
|
1014
|
+
`config.multiSpaceActive(config, hasOrchestrator)`.
|
|
1015
|
+
- **Reserved system tags isolated from display**: `status:*`, `folded-summary` and
|
|
1016
|
+
`active_task` are filtered out of the knowledge graph (`buildGraph` + defensive
|
|
1017
|
+
`view`) and the L1.5 tag tree (`rebuildTree` + persisted-tree/ghost filtering).
|
|
1018
|
+
The inverted index still keeps them (handoff/recall internals need them).
|
|
1019
|
+
- **`[Active Task]` injection**: prompt assembly prefers the active handoff summary,
|
|
1020
|
+
otherwise the newest event carrying a `task:` tag, and renders it as an
|
|
1021
|
+
unconditional top block (`[Active Task]`) once per session.
|
|
1022
|
+
- **Fallback hints**: `selectRelevantTags` accepts `fallbackTags`; when the current
|
|
1023
|
+
input has no lexical overlap (e.g. “继续”), the previous turn's matched tags (max 2)
|
|
1024
|
+
are carried into `[Memory Hints]`.
|
|
1025
|
+
- **Session-scoped injection dedup**: `runtime.injection` keeps per-session `ids` and
|
|
1026
|
+
`tags`; hints, `[Active Task]` and recall blocks already injected are filtered on
|
|
1027
|
+
later turns. SessionStart and rollover reset the pool, so the next session receives
|
|
1028
|
+
the handoff content again.
|
|
1029
|
+
- **Space deletion (UI + engine)**: `SpaceRouter.deleteSpace(id, {confirm})` closes
|
|
1030
|
+
the child handle, evicts its queues/caches and removes the directory (refusing
|
|
1031
|
+
`default` and requiring `confirm:true`). `Memory.deleteSpace` / `runtime.deleteSpace`
|
|
1032
|
+
gate the same rules (named space only; `MEM_E_FEATURE_DISABLED` in the strict
|
|
1033
|
+
single-space core). The HTTP route reuses `POST /spaces` with
|
|
1034
|
+
`{action:'delete', space_id, confirm:true}`; an **unknown action is a 400** and
|
|
1035
|
+
never falls through to CREATE. The SpaceSelector renders `🗑 删除空间` only for a
|
|
1036
|
+
named space AND only when the new **`capabilities.spacesDelete`** handshake is
|
|
1037
|
+
true — an old/pre-delete host therefore hides the button instead of answering the
|
|
1038
|
+
misleading “空间已存在”. When `capabilities.spaces` is false the entire space UI
|
|
1039
|
+
(selector, create/delete, current-space chip) disappears silently.
|
|
1040
|
+
|
|
1041
|
+
### Added — local low-valley Dream scheduling (same 1.5.6)
|
|
1042
|
+
|
|
1043
|
+
- **No external price plugin required**: `src/priceWindow.js` computes Beijing-time
|
|
1044
|
+
peak/valley locally (weekday 09–12 / 14–18 peak; lunch, nights and weekends low).
|
|
1045
|
+
Chinese holidays are NOT modelled (the calendar moves yearly); `DSH_DREAM_PRICE=low|high`
|
|
1046
|
+
or a Host price probe still override it.
|
|
1047
|
+
- **The Host bridge gets a default probe** from `isLowValley()`, so a compensating
|
|
1048
|
+
Dream skips peaks (`reason:'peak'`) and runs locally in the valley.
|
|
1049
|
+
- **Idle LLM Dream defers instead of spending at peak**: `runtime.tick()` writes a
|
|
1050
|
+
durable `state/dream-queue.json` (`pending, dueAt, reason:'peak-hour'`), emits
|
|
1051
|
+
`dream-deferred`, and runs the queued Dream as soon as the valley opens — the queue
|
|
1052
|
+
survives a restart, so a missed window is not lost.
|
|
1053
|
+
- **Config `dream.onlyLowValley`** (default true; fail-fast, HTTP-editable, settings
|
|
1054
|
+
toggle). A local-only Dream (no LLM) is never gated by price.
|
|
1055
|
+
- `/stats` exposes `dreamWindow` (low/reason/nextLowAt), `dreamQueue` and `dreamTimer`.
|
|
1056
|
+
- **Phase 2 — wake timer + sleep correction**: `src/dreamTimer.js` arms ONE wake-up
|
|
1057
|
+
at the queued due time / next valley (injectable timers, `unref`ed). On fire it
|
|
1058
|
+
re-reads the CLOCK and the WINDOW: a late wake after an OS sleep is reported
|
|
1059
|
+
(`lateMs`, `catchUp`) and runs; a wake that lands in a peak re-arms for the next
|
|
1060
|
+
valley instead of spending. Boot arms from the persisted queue, so a queue left by
|
|
1061
|
+
a previous run catches up with delay 0. Disposal cancels the timer.
|
|
1062
|
+
`dreamTimer` status (arms/wakes/lateWakes/reschedules/runs) is exposed on `/stats`.
|
|
1063
|
+
|
|
1064
|
+
### Added — Federation / cross-space dedupe wiring (same 1.5.6)
|
|
1065
|
+
|
|
1066
|
+
- **Federation on write**: after a successful write the engine reports the record's
|
|
1067
|
+
BUSINESS tags (never `status:*` / `month:*` / `active_task`) to the Orchestrator's
|
|
1068
|
+
global `FederationMap` with the space id; a tag seen in two spaces becomes ONE
|
|
1069
|
+
global node listing both. A missing/broken service can never fail the write.
|
|
1070
|
+
- **Dedupe on monthly memos**: `generateMonthlyMemos()` claims `sha256(content)` in
|
|
1071
|
+
the Orchestrator's `ContentRegistry` as `monthly:<spaceId>`; a sibling space with
|
|
1072
|
+
the identical monthly workload skips its copy and reports
|
|
1073
|
+
`monthly.skipped`/`skippedEntries` (owner traceable). Same-space reruns are
|
|
1074
|
+
idempotent.
|
|
1075
|
+
- Services arrive through the existing `orchestrator` adapter extras; spaces carry
|
|
1076
|
+
their own `spaceId` (`path.basename(childDir)`), the default space is `default`.
|
|
1077
|
+
- **Read-time merge on recall**: monthly memos now persist `meta.source_event_ids`,
|
|
1078
|
+
and `projectEpisode` exposes `sourceEventIds`. `Memory.mergeRecallHits()` feeds the
|
|
1079
|
+
recalled hits through `ContentRegistry.mergeForRead()`: a memo wins over the events
|
|
1080
|
+
it owns, duplicate `contentHash` collapses monthly-first, and the payload reports
|
|
1081
|
+
`merge: {space,monthly,droppedOwnedByMonthly,droppedDuplicateContent,total}`. Only
|
|
1082
|
+
when the Orchestrator dedupe service is present; the pure core payload shape is
|
|
1083
|
+
unchanged.
|
|
1084
|
+
- **Cross-space recall aggregation**: `Memory.recallAcrossSpaces()` queries every open
|
|
1085
|
+
space under its own lock, tags each hit with `spaceId`, and folds the union through
|
|
1086
|
+
the same `mergeForRead()` (raw hits are requested with `mergeRecall:false` so the
|
|
1087
|
+
aggregation sees owned events before the memo hides them). It is **opt-in**:
|
|
1088
|
+
`features.crossSpaceRecall` defaults to **false**, is fail-fast (true without
|
|
1089
|
+
multiSpace is a contradiction), HTTP-editable and rendered in the settings page.
|
|
1090
|
+
Only when `crossSpaceRecall:true` does `runtime.recall()` use this path; otherwise
|
|
1091
|
+
the single-space payload is unchanged (`mode` is never `cross-space`).
|
|
1092
|
+
`mode:'cross-space'`, `spaces`, `merge` and per-hit `spaceId` are reported.
|
|
1093
|
+
|
|
1094
|
+
### Tests
|
|
1095
|
+
|
|
1096
|
+
- New `test/v156.rawscan.test.js` (5 cases): newest-first + absolute line number
|
|
1097
|
+
(5000-line shard), turn-budget truncation without reading the head, engine result
|
|
1098
|
+
ceiling, `readLinesReverse` peak buffer ≤ chunk + one line over a 20k-line file,
|
|
1099
|
+
and `restoreByHash` over the streaming path.
|
|
1100
|
+
- New `test/v156.hardening.test.js` (5 cases): recall payload truncation and
|
|
1101
|
+
under-budget pass-through, `maxInjectTokens` fail-fast, `close()` resource release
|
|
1102
|
+
and idempotency, lag monitor yield after a 120ms block, maintenance `eventLoop`.
|
|
1103
|
+
- New `test/v156.tagging.test.js` (7 cases): extraction matrix, untagged write gets
|
|
1104
|
+
an anchor and becomes recallable, raw purity (four fields), manual tags win +
|
|
1105
|
+
dedupe, miss warning + panel counter, `autoTag:false`, config fail-fast.
|
|
1106
|
+
- New `test/v156.pinned.test.js` (3 cases): pinned without tags refused and no
|
|
1107
|
+
write, one-year decay still `decay=1` + index/tag flags + pinned-first ranking,
|
|
1108
|
+
pinned tag stays in the active set after a 400-day maintenance.
|
|
1109
|
+
- New `test/v156.hints.test.js` (4 cases): selector matrix (match/unrelated/internal/
|
|
1110
|
+
empty), hint rendering, prompt tail contains only matching tags after the block
|
|
1111
|
+
marker with a stable prefix, `session/event` user turn tracking.
|
|
1112
|
+
- New `test/v156.features.test.js` (5 cases): flag fail-fast + implied transfer-off,
|
|
1113
|
+
strict single-space engine + capabilities/tools absent, transfer-only-off,
|
|
1114
|
+
defaults unchanged, `Memory.open(string)` + lazy `warmup()`.
|
|
1115
|
+
- New `test/v156.host.test.js` (6 cases): price normalisation; session start runs one
|
|
1116
|
+
compensating Dream; unknown price + LLM skipped; peak skipped; not-due / disabled /
|
|
1117
|
+
in-flight refused; MockHostEnvironment integration through `apply()` + `hostStatus`
|
|
1118
|
+
surfaced on `/stats`; `dream.compensateAfterHours` fail-fast.
|
|
1119
|
+
- New `test/v156.dreamui.test.js` (3 cases): safe Dream subset exposed / credentials
|
|
1120
|
+
absent from the payload; tunables editable over HTTP while `dream.llm.*` is not;
|
|
1121
|
+
settings page renders the section and offers no credential field.
|
|
1122
|
+
- New `test/v156.l2merge.test.js` (4 cases): pinned/ordinary strict separation with
|
|
1123
|
+
global-tag metadata preserved as meta (never a tag); a lone ordinary record is not
|
|
1124
|
+
dragged into the pinned group; `maxSummaryChars` cap + `enabled:false`; config
|
|
1125
|
+
fail-fast. Older fixtures disable `l2Merge` so their exact index-count assertions
|
|
1126
|
+
stay deterministic.
|
|
1127
|
+
- New `test/v156.l3tag.test.js` (4 cases): strict upsert refusal; delete-consolidation
|
|
1128
|
+
derives `error:typeerror` / `origin:unlabelled-episode` instead of dead knowledge;
|
|
1129
|
+
trend promotion derives tags before writing L3; historical untagged summaries are
|
|
1130
|
+
readable but `degraded`.
|
|
1131
|
+
- New `test/v156.preset.test.js` (6 cases): marker records the working mode; a new
|
|
1132
|
+
conversation restores it through `agentPresets.select`; older markers are
|
|
1133
|
+
backfilled from the live agent; resume / same-session / marker-without-preset never
|
|
1134
|
+
override; a failed select does not fail creation; `agent-preset/selected` keeps the
|
|
1135
|
+
tracked mode current.
|
|
1136
|
+
- New `test/v156.singleSpace.test.js` (3 cases): the core works for `default` and
|
|
1137
|
+
refuses named read/write/create/ensure/transfer; without the Orchestrator the plugin
|
|
1138
|
+
advertises `spaces:false`, registers eight tools and never advertises a dead tool in
|
|
1139
|
+
the prompt; injecting the adapter restores ten tools and `spaces:true`.
|
|
1140
|
+
- Updated: manifest 1.5.5 → 1.5.6; settings page gains `context.maxInjectTokens`,
|
|
1141
|
+
the pre-ingest tagging section, Dream tunables and the L2-merge section; editable
|
|
1142
|
+
contract gains `tagging`, `features`, `dream` and `l2Merge`; panel contract gains
|
|
1143
|
+
`global.pinned`, `autoTag` and `l2Merge`; `plugin.test` prompt contract now asserts
|
|
1144
|
+
relevance hints instead of the removed global map.
|
|
1145
|
+
- New `test/v156.firstBatch.test.js` (5 cases): reserved status tags never reach the
|
|
1146
|
+
graph/tag tree; `[Active Task]` from the handoff summary and from a `task:` event;
|
|
1147
|
+
fallback hints reuse the previous turn's tags; session dedup blocks the second
|
|
1148
|
+
injection and resets on a new session.
|
|
1149
|
+
- New `test/v156.spaceDelete.test.js` (5 cases): engine deletion with confirm/default/
|
|
1150
|
+
missing rules; strict single-space refusal; **`capabilities.spacesDelete` versioned
|
|
1151
|
+
handshake** (an old host hides the button, so a delete request can never be
|
|
1152
|
+
misread as CREATE); `POST /spaces {action:'delete'}` removes the store and returns
|
|
1153
|
+
the refreshed list; unknown actions answer 400 instead of falling through to
|
|
1154
|
+
CREATE; the UI source carries the capability guard, the button, the human confirm
|
|
1155
|
+
and the default-space guard.
|
|
1156
|
+
- **Graph interaction layer** (`test/v156.graph.test.js`, 4 cases): Ctrl/Cmd+drag
|
|
1157
|
+
pans the canvas (plain drag still moves a node), Ctrl/Cmd+wheel zooms around the
|
|
1158
|
+
cursor via a non-passive native listener (plain wheel keeps page scroll),
|
|
1159
|
+
double-click on blank space resets the view, and the frozen initial layout runs
|
|
1160
|
+
through `separateOverlaps()` so nodes never start piled on top of each other.
|
|
1161
|
+
The header/footer advertise the interaction.
|
|
1162
|
+
- New `test/v156.lowValley.test.js` (4 cases): Beijing peak/valley boundaries and
|
|
1163
|
+
next-low computation; `dream.onlyLowValley` fail-fast + editable; a peak-hour idle
|
|
1164
|
+
Dream is deferred durably and runs at the valley; the Host bridge probe follows the
|
|
1165
|
+
window while `DSH_DREAM_PRICE` remains an override.
|
|
1166
|
+
- New `test/v156.federation.test.js` (2 cases): business tags federate into one
|
|
1167
|
+
global node across spaces while internal tags are skipped; the first space claims a
|
|
1168
|
+
cross-space monthly memo and the sibling reports `skipped` with the owner.
|
|
1169
|
+
- New `test/v156.lowValley2.test.js` (4 cases): peak wake re-arms (never runs); a
|
|
1170
|
+
sleep-delayed wake reports `lateMs`/`catchUp`; a past-due queue in the valley arms
|
|
1171
|
+
delay 0; runtime integration: peak deferral -> timer fire -> queue cleared and
|
|
1172
|
+
`dreamTimer.runs === 1`.
|
|
1173
|
+
- New `test/v156.readMerge.test.js` (2 cases): a recalled monthly memo drops the
|
|
1174
|
+
events it owns and reports merge stats; without the dedupe service the recall
|
|
1175
|
+
payload is unchanged.
|
|
1176
|
+
- New `test/v156.crossSpaceRecall.test.js` (2 cases): a recall returns hits from every
|
|
1177
|
+
open space with provenance; a monthly memo hides its owned event even when recorder
|
|
1178
|
+
in another space, while the other space still contributes.
|
|
1179
|
+
- New `test/v156.crossSpaceRecallFlag.test.js` (3 cases): default false + fail-fast
|
|
1180
|
+
(`true` without multiSpace is a contradiction, non-boolean rejected); flag true
|
|
1181
|
+
aggregates open spaces; flag false keeps the single-space payload.
|
|
1182
|
+
- **Settings-page GitHub installer**: new `POST /api/hippocampus/orchestrator/install`
|
|
1183
|
+
(requires `{confirm:true}`) delegates to the Host's
|
|
1184
|
+
`pluginManager.installBundle('git+https://github.com/382quaii/dsh-Layers-Orchestrator.git', {enabled:true})`,
|
|
1185
|
+
short-circuits when the service is already present, and reports
|
|
1186
|
+
`applied | restart-required | manual | failed`. The settings page ships a
|
|
1187
|
+
“从 GitHub 安装 dsh-orchestrator” button (human confirm dialog) plus the repo link;
|
|
1188
|
+
without `pluginManager` it shows the exact manual steps instead of failing silently.
|
|
1189
|
+
- **Automatic new conversation on handoff (verified feasible)**: the Host exposes
|
|
1190
|
+
`agents.create/resume` and, decisively, the CLIENT service
|
|
1191
|
+
`uiWorkspace.startSession()` — the same action the “+” button uses. A client-half
|
|
1192
|
+
controller polls `/stats`, and when `handoff.active && handoff.autoNewSession` it
|
|
1193
|
+
calls `uiWorkspace.startSession(undefined, {agentPreset})` once per handoff marker
|
|
1194
|
+
(sessionStorage guard, lifecycle-owned interval, capability-guarded no-op on old
|
|
1195
|
+
hosts). New config `context.autoNewSession` (default **true**, fail-fast,
|
|
1196
|
+
HTTP-editable, settings toggle), plus `context.autoNewSessionPoll`
|
|
1197
|
+
(`interval` | `once`, default `interval`) and
|
|
1198
|
+
`context.autoNewSessionIntervalSeconds` (5–3600, default 15): the settings page
|
|
1199
|
+
now exposes a “按间隔轮询 / 只检查一次” select and an interval slider; the client
|
|
1200
|
+
configures its timer from the FIRST stats response (`once` clears the recurring
|
|
1201
|
+
timer). The workspace-file handoff scheme is no longer needed and stays documented
|
|
1202
|
+
only as a fallback.
|
|
1203
|
+
- **Fixed — new-conversation failure `tool "subagent" is already registered`**:
|
|
1204
|
+
handoff preset inheritance no longer calls `agentPresets.select()` when the new
|
|
1205
|
+
session is ALREADY composed with the marker's preset. A redundant recompose
|
|
1206
|
+
re-mounted the preset's `@deepseek-ai/dsh-tool-subagent` row and aborted session
|
|
1207
|
+
creation; the skip is recorded as `presetInherit.reason='already-composed'` and
|
|
1208
|
+
locked by a regression test in `test/v156.preset.test.js`.
|
|
1209
|
+
- **Persona section + generic custom decay (v1.5.7)**:
|
|
1210
|
+
- `[Persona & Traits]` is its own prompt section (`name:'persona'`, **order 100**),
|
|
1211
|
+
rendering the ≤10 highest-confidence L3 semantic summaries (live store read, not
|
|
1212
|
+
the recall cache). The memory block/policy/reflection sections keep 2450/2455/2460.
|
|
1213
|
+
- `service.remember()` accepts **`customDecayRate`** (finite, 0 < rate ≤ 10) OR
|
|
1214
|
+
**`customHalfLifeDays`** (integer 1–36500), never both. The value is normalised to
|
|
1215
|
+
`meta.decay_rate`, projected as `decayRate`, and applied as
|
|
1216
|
+
`effectiveHalfLife = policyHalfLife / decayRate` for THAT record only. No
|
|
1217
|
+
tag-prefix logic exists anywhere in the engine — an emotion plugin decides the
|
|
1218
|
+
semantics by passing the parameter.
|
|
1219
|
+
- **Cross-plugin `ctx.provide('hippocampus', service)`** (user decision 2026-11-05:
|
|
1220
|
+
in-process service only, NO HTTP write surface): `apiVersion=1`, `ready()`,
|
|
1221
|
+
`capabilities()` (declares `l3Traits:10` plus per-method support), `remember()`
|
|
1222
|
+
(L2-only; non-L2 layers are redirected with a warning; returns
|
|
1223
|
+
`{status,eventId,eventTime,duplicate}`), `recall()`, `runMaintenance(source)`
|
|
1224
|
+
(never queues: a running pass answers `MEM_E_MAINTENANCE_RUNNING`; manual passes
|
|
1225
|
+
are rate-limited to 30 s while `cron` bypasses), `stats()/handoffView()/
|
|
1226
|
+
promptState()` read-only snapshots and `onDispose()` hooks. The service disappears
|
|
1227
|
+
with its plugin fiber; later calls answer `MEM_E_SERVICE_DISPOSED`. New codes
|
|
1228
|
+
`MEM_E_MAINTENANCE_RUNNING`, `MEM_E_SERVICE_DISPOSED`, `MEM_E_FEDERATION_FAILED`
|
|
1229
|
+
are registered append-only (8 cases in `test/v157.service.test.js`).
|
|
1230
|
+
- **Durable Orchestrator state**: `<root>/state/orchestrator.json` now persists the
|
|
1231
|
+
global federation map and the monthly-memo claims (atomic tmp+rename on every
|
|
1232
|
+
mutation); it is loaded before the services become observable, and a corrupt file
|
|
1233
|
+
is treated as empty instead of failing activation — a restart no longer forgets
|
|
1234
|
+
cross-space dedupe.
|
|
1235
|
+
- Full suite: **411 tests / 411 pass / 0 fail**, 64 test files. Orchestrator:
|
|
1236
|
+
**31/31** (`service` + `spaces` deletion + `persistence` round-trip/corrupt state).
|
|
1237
|
+
**Installed locally**: desktop profile gets a `link:` dependency + an ordered patch
|
|
1238
|
+
insert BEFORE the hippocampus entries, so the service exists at activation. Two
|
|
1239
|
+
Cordis constraints were fixed on the way: `apply()` must return **undefined**
|
|
1240
|
+
(the return value is treated as an effect → `TypeError: Invalid effect`), and the
|
|
1241
|
+
service is registered directly with `ctx.provide` (itself an effect). The market
|
|
1242
|
+
catalog still does **not** list it: that needs an npm publish / catalog submission.
|
|
1243
|
+
- Added `docs/RELEASE-1.5.6.md`: release notes + the exact push/tag/npm/market
|
|
1244
|
+
commands that require the operator's credentials (none executed here).
|
|
1245
|
+
|
|
1246
|
+
## [1.5.5] — 2026-11-03
|
|
1247
|
+
|
|
1248
|
+
**Offline Dream distillation: an optional LLM pass that can never take Dream down.**
|
|
1249
|
+
Same-tag L2 records are distilled into one durable, provenance-carrying record.
|
|
1250
|
+
The LLM leg uses **Node's built-in `fetch` only** (charter v2.0 #1: still zero
|
|
1251
|
+
dependencies); endpoint / model / key are injected through config or
|
|
1252
|
+
`DSH_DREAM_LLM_*` env and are never hard-coded, logged, or returned by HTTP.
|
|
1253
|
+
Every failure — no config, network down, timeout, non-JSON — silently degrades to
|
|
1254
|
+
the deterministic local merge and records `MEM_E_DREAM_LLM_FALLBACK`. **303 tests
|
|
1255
|
+
green** (was 295).
|
|
1256
|
+
|
|
1257
|
+
### Added — Dream LLM distillation (`src/dream.js`, `Memory.executeDream`)
|
|
1258
|
+
|
|
1259
|
+
- **Structured output**: the model must answer JSON `{"summary","confidence"}`;
|
|
1260
|
+
`summary` is capped at `dream.maxSummaryChars` (default 200). Fenced code,
|
|
1261
|
+
non-JSON, missing fields and over-long summaries are all treated as LLM failure.
|
|
1262
|
+
- **Zero-dependency transport**: Node's global `fetch` against an
|
|
1263
|
+
OpenAI-compatible `/chat/completions`; `Authorization: Bearer` only when a key is
|
|
1264
|
+
configured. No SDK, no `node-fetch`, no new `package.json` dependency (test-locked).
|
|
1265
|
+
- **Absolute timeout**: `AbortController` + `Promise.race` under
|
|
1266
|
+
`dream.llmTimeoutMs` (default 15s); the timer is always cleared in `finally`.
|
|
1267
|
+
- **Local fallback**: earliest/latest time + deduplicated core text, capped to
|
|
1268
|
+
`maxSummaryChars`. Degradation warns `MEM_E_DREAM_LLM_FALLBACK` and is visible in
|
|
1269
|
+
`status().panel.dream.lastFallback`.
|
|
1270
|
+
- **Provenance**: the distilled record always carries
|
|
1271
|
+
`meta.source_event_ids` (deduped, sorted) and `meta.distilled_by` (`llm|local`);
|
|
1272
|
+
a re-run never merges the same source twice (`state/dream.json` bookkeeping).
|
|
1273
|
+
- **Circuit breaker**: `failureThreshold` (default 3) consecutive failures open the
|
|
1274
|
+
breaker for `cooldownMinutes` (default 60); afterwards a half-open state allows
|
|
1275
|
+
exactly one probe — success closes it, failure re-opens. Exposed as
|
|
1276
|
+
`panel.dream.circuit`.
|
|
1277
|
+
- **Single-flight + serial**: a concurrent `executeDream()` is refused
|
|
1278
|
+
(`dream-in-flight`); within one run groups are processed strictly serially, so a
|
|
1279
|
+
slow provider can never exhaust connections or accumulate queued work.
|
|
1280
|
+
- **Offline only**: `executeDream()` is called exclusively from the `dream` branch
|
|
1281
|
+
of the maintenance gate, after `maintain()` converged; the online
|
|
1282
|
+
`recall`/`remember` paths never touch the network.
|
|
1283
|
+
|
|
1284
|
+
### Config
|
|
1285
|
+
|
|
1286
|
+
- New `dream` group (fail-fast validated): `useLlm`, `minGroupSize` (2–50),
|
|
1287
|
+
`maxGroupsPerRun` (1–50), `maxSummaryChars` (40–2000), `maxSourceChars`
|
|
1288
|
+
(80–4000), `maxEventsPerGroup` (2–50), `llmTimeoutMs` (500–120000),
|
|
1289
|
+
`failureThreshold` (1–20), `cooldownMinutes` (1–1440), and
|
|
1290
|
+
`llm.{baseUrl,model,apiKey}`. The `llm` block is deliberately **not** part of the
|
|
1291
|
+
UI/HTTP config projection, so a credential can never leak through the panel.
|
|
1292
|
+
|
|
1293
|
+
### Tests
|
|
1294
|
+
|
|
1295
|
+
- New `test/v155.dream.test.js` (8 cases): no-config local fallback with full
|
|
1296
|
+
provenance; LLM success (URL/header/body/JSON parse); non-JSON degradation;
|
|
1297
|
+
fetch timeout degradation; single-flight refusal; circuit open → no fetch →
|
|
1298
|
+
half-open single probe → close; `dream` config fail-fast matrix; `package.json`
|
|
1299
|
+
dependency red line.
|
|
1300
|
+
- Updated: status-panel contract gains `dream`; manifest 1.5.4 → 1.5.5.
|
|
1301
|
+
- Full suite: **303 tests / 303 pass / 0 fail**, 41 test files.
|
|
1302
|
+
|
|
1303
|
+
## [1.5.4] — 2026-11-02
|
|
1304
|
+
|
|
1305
|
+
**Hotfix: the automatic handoff state machine can no longer wedge a session, and
|
|
1306
|
+
recursive handoff summaries are cut off at the source.** Incident: recursive
|
|
1307
|
+
`交接摘要` generations inflated the ratio past the native window and a handoff that
|
|
1308
|
+
failed could leave the machine stuck, blocking new sessions. **295 tests green**
|
|
1309
|
+
(was 286).
|
|
1310
|
+
|
|
1311
|
+
### Fixed — state machine (no deadlock, Fail-Fast with graceful degradation)
|
|
1312
|
+
|
|
1313
|
+
- **`checkHandoff()` never rejects**: a distillation error, a timeout (default 5s,
|
|
1314
|
+
injectable per call) or a marker-write failure degrade to a `state:"failed"`
|
|
1315
|
+
marker carrying `summaryError` and return immediately. The next session starts
|
|
1316
|
+
regardless.
|
|
1317
|
+
- **New-session transition resets everything**: `observeSessionTokens()` always
|
|
1318
|
+
establishes the new session's own baseline, consumes a marker belonging to a
|
|
1319
|
+
different session, and **releases `_handoffInFlight`**, so a hung handoff guard
|
|
1320
|
+
can never own the next session. A same-key restart (estimate halved after reset)
|
|
1321
|
+
is treated as a new baseline too.
|
|
1322
|
+
- **Stale marker consumption happens before early returns**, so a fresh session
|
|
1323
|
+
cannot inherit "handoff active" forever.
|
|
1324
|
+
- **Outer watchdog in `_maybeAutoHandoff()`** in addition to the inner one: even if
|
|
1325
|
+
`checkHandoff` itself hangs, the in-flight flag is released in `finally`.
|
|
1326
|
+
|
|
1327
|
+
### Fixed — recursion
|
|
1328
|
+
|
|
1329
|
+
- **`_distillHandoffTail()` refuses handoff content** by tag (`status:handoff`) and
|
|
1330
|
+
by the `交接摘要` text prefix, in both the live-context path and the indexed
|
|
1331
|
+
fallback. Output is hard-capped at 1200 characters; the idempotency key includes
|
|
1332
|
+
the timestamp so distinct epochs never collide. (No more summary-of-summary.)
|
|
1333
|
+
- **`status:handoff` is internal**: 2% weight in normal recall and excluded from the
|
|
1334
|
+
recent-memory list, so real facts always outrank handoff bookkeeping.
|
|
1335
|
+
|
|
1336
|
+
### Added — escape hatches and cleanup
|
|
1337
|
+
|
|
1338
|
+
- **`Memory.resetSessionState()` / `memory_admin action=reset_session` /
|
|
1339
|
+
`POST /api/hippocampus/session/reset` / settings-page 「强制重置交接状态(逃生舱)」**:
|
|
1340
|
+
clears the live token baseline, the in-flight guard and the active marker. It
|
|
1341
|
+
rewrites only `state/`; durable memories are untouched.
|
|
1342
|
+
- **`Memory.repairHandoffSummaries()` + `scripts/repair-handoff.mjs`
|
|
1343
|
+
(`npm run repair-handoff`)**: finds recursive/excess handoff generations
|
|
1344
|
+
(recursive = >=2 `交接摘要` markers) and parks them in the two-phase
|
|
1345
|
+
`pending_delete` queue. Dry-run by default; `--reset-marker` consumes a stuck
|
|
1346
|
+
marker.
|
|
1347
|
+
- Panel session status now exposes `handoffState` / `handoffDegraded` /
|
|
1348
|
+
`handoffErrorCode`; a degraded handoff is visible in the status bar instead of
|
|
1349
|
+
silently locking.
|
|
1350
|
+
- New error code **`MEM_E_HANDOFF_FAILED`**.
|
|
1351
|
+
|
|
1352
|
+
### Tests
|
|
1353
|
+
|
|
1354
|
+
- New `test/v156.handoff.test.js` (9 tests): recursion refused by tag/prefix and
|
|
1355
|
+
fallback path; throwing/hanging distillation degrades without rejecting; new
|
|
1356
|
+
session resets ratio and releases the stuck guard; handoff summary ranking and
|
|
1357
|
+
list isolation; `resetSessionState` preserves memories; repair dry-run + pending
|
|
1358
|
+
delete; admin tool + HTTP escape hatch (route table 8).
|
|
1359
|
+
- Route contract 7 → 8, manifest 1.5.4.
|
|
1360
|
+
- Full suite: **295 tests / 295 pass / 0 fail**, 40 test files.
|
|
1361
|
+
|
|
1362
|
+
## [1.5.3] — 2026-11-02
|
|
1363
|
+
|
|
1364
|
+
**Hotfix: space creation no longer exposes a raw `MEM_E_SPACES: HTTP 404`, and
|
|
1365
|
+
invalid/conflicting space names are rejected by the ENGINE with
|
|
1366
|
+
`MEM_E_SPACE_INVALID`.** Incident: a new client bundle called
|
|
1367
|
+
`/api/hippocampus/spaces` against a host process that predated the route (the same
|
|
1368
|
+
process also 404s `/memories`). Fixed on three layers plus a route-drift test.
|
|
1369
|
+
**286 tests green** (was 270).
|
|
1370
|
+
|
|
1371
|
+
### Added — release hygiene
|
|
1372
|
+
|
|
1373
|
+
- **Benchmark Protocol v1 (`scripts/bench-protocol.mjs`, `npm run bench`)**: the only
|
|
1374
|
+
sanctioned way to publish a throughput number. Each measured run gets a fresh
|
|
1375
|
+
`os.tmpdir()` store, one discarded same-process warmup precedes 5 measured runs,
|
|
1376
|
+
and the report carries MEDIAN + min/max/spread. It makes no speed assertions
|
|
1377
|
+
(a shared/AV-scanned machine must report, not fail), so single-run noise cannot
|
|
1378
|
+
become an architecture conclusion again. Replaces the deleted single-run
|
|
1379
|
+
`scripts/confidence-ab.mjs`.
|
|
1380
|
+
- **Multi-space fixed-overhead coverage (`test/v154.release.test.js`)**: N=10
|
|
1381
|
+
physical spaces — bounded per-space boot (<500ms median), lazy root boot
|
|
1382
|
+
(`spaces.open=[]`, children never eagerly opened), uniform per-space storage
|
|
1383
|
+
(max/min ≤1.35), linear total bytes (≤1.3×N), per-space fixed overhead <256KB.
|
|
1384
|
+
- **Dead config removal**: `context.minInjectConfidence` is gone end-to-end
|
|
1385
|
+
(default/validation/projection, HTTP-editable key,
|
|
1386
|
+
`applyConfidence`/`MIN_INJECT_CONFIDENCE` retrieval pass, recall
|
|
1387
|
+
`confidence`/`lowConfidence` annotations and low-confidence notes, obsolete A/B
|
|
1388
|
+
script). Supplying the old key fails fast with `MEM_E_CONFIG_UNKNOWN_KEY`
|
|
1389
|
+
(`details.removedIn = "1.5.3"`), so a profile cannot keep believing it works.
|
|
1390
|
+
- Test watchdog default 30s → 60s (the in-process suite boots real stores/spaces and
|
|
1391
|
+
legitimately takes ~15–25s; the watchdog now only fires on real hangs).
|
|
1392
|
+
|
|
1393
|
+
### Added — tool schema pruning
|
|
1394
|
+
|
|
1395
|
+
- **`tools.disabled` config (default `[]`)**: every registered tool definition costs its
|
|
1396
|
+
JSON schema in prompt tokens on EVERY turn (~1.1–1.2k tokens of baseline tax). A
|
|
1397
|
+
closed suffix vocabulary (`remember/checkpoint/recall/capture/bulk_ingest/reinforce/forget/space_transfer/transfer_to_global/admin`)
|
|
1398
|
+
lets an operator prune low-frequency tools; `remember`/`recall`/`admin` are CORE
|
|
1399
|
+
and cannot be disabled. A typo/prefix/full name, a core tool, or a duplicate aborts
|
|
1400
|
+
config resolution with **`MEM_E_INVALID_TOOL_NAME`** (fail-fast, never silently
|
|
1401
|
+
ignored). The register wrapper skips disabled suffixes AND the `memory` prompt
|
|
1402
|
+
section stops advertising them, so the schema prune cannot lie to the model.
|
|
1403
|
+
Editable over HTTP (`tools.disabled`) and rendered in the settings page as a
|
|
1404
|
+
checkbox catalog with core-不可关闭 / low-frequency tooltips. Takes effect on the
|
|
1405
|
+
next host start/reload (tool registration happens at activation).
|
|
1406
|
+
|
|
1407
|
+
### Fixed
|
|
1408
|
+
|
|
1409
|
+
- **Route-drift lock**: a new test parses the client `API` constant table and
|
|
1410
|
+
proves every path equals the backend `MEMORY_API` value verbatim, and that the
|
|
1411
|
+
registered route table contains them all. Adding a route on one side without the
|
|
1412
|
+
other now fails CI instead of 404-ing in production.
|
|
1413
|
+
- **Capability handshake**: `/stats` (ready AND booting) and `GET /spaces` now carry
|
|
1414
|
+
`capabilities: { version, spaces, memories, transferConsent, multiSpace }`.
|
|
1415
|
+
The client checks `capabilities.spaces` BEFORE calling `POST /spaces`; if the
|
|
1416
|
+
host is older it shows a version hint and disables the action instead of firing a
|
|
1417
|
+
request that 404s. `memories` is gated the same way (old host → "当前宿主版本不
|
|
1418
|
+
支持记忆列表", not `MEM_E_MEMORIES`).
|
|
1419
|
+
- **Human error copy**: every space-create failure now renders a complete sentence.
|
|
1420
|
+
404 / route-missing / network → `创建失败:底层引擎未响应,请检查版本或联系架构师`;
|
|
1421
|
+
invalid name → `创建失败:空间名称无效——需以小写字母/数字开头,只能含 a-z 0-9 . _ -(最长 64)`;
|
|
1422
|
+
duplicate → `创建失败:空间「33」已存在,请换一个名称`; reserved → `创建失败:该名称是
|
|
1423
|
+
系统保留名,请换一个`. The `MEM_E_SPACES: HTTP 404` template is gone from the bundle.
|
|
1424
|
+
- **`MEM_E_SPACE_INVALID` (400)**: `validateNewSpaceId` + `Memory.createSpace` reject,
|
|
1425
|
+
before any directory/JSONL write: empty/whitespace, wrong charset (`Bad`, `bad id!`,
|
|
1426
|
+
path separators, `..`, `.`), >64 chars, trailing dot (Windows alias), Windows
|
|
1427
|
+
device names (`con`, `nul`, `com1`, …), `default` (always exists), an existing
|
|
1428
|
+
space (conflict), and a non-directory path collision. Creation returns `201`,
|
|
1429
|
+
conflicts/invalid ids `400 MEM_E_SPACE_INVALID`.
|
|
1430
|
+
- Fresh spaces are created from `POST /spaces` with a strict non-idempotent
|
|
1431
|
+
`runtime.createSpace`; the lazy `ensureSpace` used by transfer keeps its
|
|
1432
|
+
idempotent semantics.
|
|
1433
|
+
|
|
1434
|
+
### Tests
|
|
1435
|
+
|
|
1436
|
+
- New `test/v153.spaces.test.js` (7 tests): client↔backend route-path equality
|
|
1437
|
+
(the anti-404 lock), a real dispatch through the CLIENT path against the
|
|
1438
|
+
registered host route table (handler answers 201, never a router 404),
|
|
1439
|
+
invalid/reserved matrix, engine conflict-before-write, HTTP 201/400 + capability
|
|
1440
|
+
handshake, human-copy mapper (no raw 404), capability gating for old hosts.
|
|
1441
|
+
- Updated: `POST /spaces` assertions 200 → 201 strict creation; manifest 1.5.3.
|
|
1442
|
+
- Full suite: **286 tests / 286 pass / 0 fail**, 39 test files (includes
|
|
1443
|
+
`v154.release.test.js`).
|
|
1444
|
+
- **Note (deployment)**: the live host process observed during the incident still
|
|
1445
|
+
404s `/spaces` and `/memories` — it must be restarted/reloaded for the new routes
|
|
1446
|
+
to serve; until then the new client degrades with the version hint above instead
|
|
1447
|
+
of a naked 404.
|
|
1448
|
+
|
|
1449
|
+
## [1.5.2] — 2026-11-02
|
|
1450
|
+
|
|
1451
|
+
**Architecture correction: physical storage migration vs. business-data transfer
|
|
1452
|
+
are now physically decoupled, and the UI has a real global SpaceSelector.** The
|
|
1453
|
+
v1.5.0/v1.5.1 UI mixed two unrelated concerns and let the user type
|
|
1454
|
+
`target_space_id`/`event_ids` by hand. Fixed and locked by tests. **270 tests
|
|
1455
|
+
green** (was 263).
|
|
1456
|
+
|
|
1457
|
+
### Changed — UI (module decoupling)
|
|
1458
|
+
|
|
1459
|
+
- **Physical dataDir migration extracted** into `StorageMigratorUI`, a SYSTEM/DATA
|
|
1460
|
+
MANAGEMENT section at the bottom of the settings page. It owns only the A/B
|
|
1461
|
+
double-buffer state machine: `POST { dataDir }` → `202 state=migrating` → copy →
|
|
1462
|
+
verify → swap, old directory kept as a backup. No event ids, no spaces.
|
|
1463
|
+
- **Business cross-space transfer removed from the settings form**: the manual
|
|
1464
|
+
`event_ids` / `target_space_id` text inputs, the copy/cut buttons and the
|
|
1465
|
+
inline confirmation are gone. Business transfer now exists ONLY in the panel's
|
|
1466
|
+
regulated flow (below).
|
|
1467
|
+
- **Global `SpaceSelector`** in the panel header: a dropdown of the physical spaces
|
|
1468
|
+
(friendly labels: 默认空间 / 工作空间 / 私人空间 / 全局空间, unknown ids verbatim)
|
|
1469
|
+
with `+ 新建空间` (creates an EMPTY space — never a copy). The selection is
|
|
1470
|
+
app-global (`spaceStore` + `space-changed` bus event), so the panel and the
|
|
1471
|
+
settings page follow it.
|
|
1472
|
+
- **Every UI read follows the selected space**: `useMemoryStats`, `useGraph` and
|
|
1473
|
+
`useRecentMemories` append `?space=<id>`; the backend routes `stats`, `graph` and
|
|
1474
|
+
`memories` to that physical store. Memory list, graph, L1 log/index counts, L2.5
|
|
1475
|
+
quarantine, L3 semantic count, L1.5 tag tree and the session status bar are all
|
|
1476
|
+
that space's only — switching spaces cannot blend views or contexts.
|
|
1477
|
+
- **Regulated cross-space flow (UI_TASK_3)**: check memories in the current space →
|
|
1478
|
+
`移动到…` → dialog step 1 states `即将向 [目标空间] 发起迁移请求` → step 2 is the
|
|
1479
|
+
SECOND explicit consent (`二次确认 · 安全红线`, with the cut warning when 剪切) →
|
|
1480
|
+
only then is `user_approved: true` sent. Target is a dropdown of known spaces,
|
|
1481
|
+
never a free-text id.
|
|
1482
|
+
- `h(StorageMigratorUI)` is a separate component, so the two state machines can no
|
|
1483
|
+
longer share draft state or validation.
|
|
1484
|
+
|
|
1485
|
+
### Added — backend routing
|
|
1486
|
+
|
|
1487
|
+
- **`GET/POST /api/hippocampus/spaces`**: list the router's spaces / create an empty
|
|
1488
|
+
one (`space_id`). The selector and `+ 新建空间` use it.
|
|
1489
|
+
- **`?space=<id>` on `/api/hippocampus/stats` and `/api/hippocampus/graph`**:
|
|
1490
|
+
`runtime.uiPayload(spaceId)` / `runtime.graphPayload(spaceId)` return that space's
|
|
1491
|
+
panel/graph via `Memory.status({ targetSpaceId })` and
|
|
1492
|
+
`Memory.graphForSpace({ targetSpaceId })`; a new space reports zeros (empty), so a
|
|
1493
|
+
switched view is never a fallback to the default store.
|
|
1494
|
+
- `Memory.ensureSpace()` (root router) and `runtime.spaceList()`.
|
|
1495
|
+
- Panel status `panel.spaces.current` now reports the SELECTED space (was always
|
|
1496
|
+
`default`), and `stats`/`graph` responses carry a top-level `spaceId`.
|
|
1497
|
+
|
|
1498
|
+
### Security (unchanged red line, stricter transport)
|
|
1499
|
+
|
|
1500
|
+
- The HTTP transfer route no longer fabricates consent: it forwards
|
|
1501
|
+
`user_approved` from the request and the ENGINE gate rejects a request that lacks
|
|
1502
|
+
it with `MEM_E_REQUIRE_USER_CONSENT`. The UI only sets the flag after step 2. An
|
|
1503
|
+
agent tool call and a raw POST that "bypasses the UI" therefore hit the same
|
|
1504
|
+
wall.
|
|
1505
|
+
- `dataDir` migration Fail-Fast strengthened: `validateMigrationPaths` now also
|
|
1506
|
+
rejects an existing non-empty target (`MEM_E_MIGRATION_TARGET_BUSY`) and a
|
|
1507
|
+
non-directory target (`MEM_E_MIGRATION_PATH`) synchronously, before a 202/job.
|
|
1508
|
+
The old store remains authoritative on any rejection.
|
|
1509
|
+
|
|
1510
|
+
### Tests
|
|
1511
|
+
|
|
1512
|
+
- New `test/v152.refactor.test.js` (7 tests): dataDir validation matrix
|
|
1513
|
+
(missing/relative/same/inside/root/non-empty/non-dir) + `startMigration`
|
|
1514
|
+
fail-fast with the old dir intact; space isolation for stats/graph/memories/
|
|
1515
|
+
session/recall with `?space=`; `ensureSpace` empty space + spaces route;
|
|
1516
|
+
unauthorized transfer blocked at engine AND HTTP, authorized passes; UI wiring
|
|
1517
|
+
(SpaceSelector header mount, checkbox flow, no manual inputs, isolated
|
|
1518
|
+
StorageMigratorUI).
|
|
1519
|
+
- Updated contract assertions: HTTP routes 6 → 7 (spaces), transfer route requires
|
|
1520
|
+
explicit `user_approved`, settings order now context → space/session → system
|
|
1521
|
+
storage, cut second-confirmation now lives in the panel dialog, manifest 1.5.2.
|
|
1522
|
+
- Full suite: **270 tests, 270 pass, 0 fail**.
|
|
1523
|
+
|
|
1524
|
+
## [1.5.1] — 2026-11-02
|
|
1525
|
+
|
|
1526
|
+
**Security patch: cross-space transfer now requires EXPLICIT user consent.** Moving
|
|
1527
|
+
memories between spaces is a data-egress action, not a memory optimisation. Two
|
|
1528
|
+
independent locks (prompt + engine), plus a human-only UI path. **263 tests green**
|
|
1529
|
+
(was 254).
|
|
1530
|
+
|
|
1531
|
+
### Added
|
|
1532
|
+
|
|
1533
|
+
- **Prompt red line (`memory:policy`)**: a static `【🚨最高安全红线】` block forbids
|
|
1534
|
+
the model from calling `memory_space_transfer` / `memory_transfer_to_global` on
|
|
1535
|
+
its own judgement, sympathy, or "better cross-device sharing". The only allowed
|
|
1536
|
+
trigger is a direct user command in the current conversation; when unsure the
|
|
1537
|
+
model must ask `您需要我把这条信息同步到其他空间吗?`. It also documents the
|
|
1538
|
+
`user_approved: true` retry protocol for `MEM_E_REQUIRE_USER_CONSENT` and states
|
|
1539
|
+
that the intercept is never a one-off obstacle to bypass.
|
|
1540
|
+
- **`memory_transfer_to_global` tool**: copy/move memories from a space into the
|
|
1541
|
+
canonical `global` space, with the same privacy screen, raw_turn stripping, fresh
|
|
1542
|
+
target ids and consent gate as `memory_space_transfer`. Both tool schemas expose
|
|
1543
|
+
`user_approved` and their descriptions carry the security warning.
|
|
1544
|
+
- **`context.requireExplicitConsentForTransfer`** (default **true**, validated
|
|
1545
|
+
boolean, HTTP-editable and exposed in the settings page): the operator's master
|
|
1546
|
+
switch for the engine gate. The settings toggle explains the risk.
|
|
1547
|
+
- **`GET /api/hippocampus/memories`** (`limit`, `space`): bounded recent-memory
|
|
1548
|
+
projection (`eventId`, `day`, `tags`, `snippet`) used by the panel's per-memory
|
|
1549
|
+
detail rows. `Memory.recentMemories()` is read-only and index-snapshot based.
|
|
1550
|
+
- **UI per-memory 分享/转移 button**: the panel now lists the 20 most recent
|
|
1551
|
+
memories with a human-initiated transfer dialog (target space, copy/cut toggle,
|
|
1552
|
+
second confirmation for cut). It calls the transfer route directly — **bypassing
|
|
1553
|
+
the model entirely** — and the browser request is the consenting human.
|
|
1554
|
+
|
|
1555
|
+
### Fixed / Security
|
|
1556
|
+
|
|
1557
|
+
- `Memory.transferEvents()` now throws
|
|
1558
|
+
**`MEM_E_REQUIRE_USER_CONSENT`** with the fixed message
|
|
1559
|
+
`[系统拦截] 跨空间传递需要用户明确授权。请向用户确认后再试。` when
|
|
1560
|
+
`context.requireExplicitConsentForTransfer` is true and the call does not carry
|
|
1561
|
+
`userApproved === true`. The gate runs **before** space ids are validated, before
|
|
1562
|
+
any store is opened, before content is read and before any pending-delete record
|
|
1563
|
+
is written, so a refused call is provably side-effect free.
|
|
1564
|
+
- `POST /api/hippocampus/transfer` is documented and implemented as the **human
|
|
1565
|
+
channel**: it marks `userApproved: true` itself (same-origin authenticated
|
|
1566
|
+
browser request). The agent half cannot reach HTTP routes, so a UI click needs no
|
|
1567
|
+
model involvement and a model call still hits the gate.
|
|
1568
|
+
- The consent gate is strict: `userApproved` must be the boolean `true`; the
|
|
1569
|
+
config value must be a boolean (a string like `"yes"` fails fast).
|
|
1570
|
+
|
|
1571
|
+
### Tests
|
|
1572
|
+
|
|
1573
|
+
- New `test/v151.consent.test.js` (9 tests): default-on config + fail-fast type
|
|
1574
|
+
check; engine gate fires before validation/IO (invalid target still answers
|
|
1575
|
+
CONSENT, nothing parked, source untouched); agent tool blocked then succeeds only
|
|
1576
|
+
with `user_approved: true`; `memory_transfer_to_global` same contract; explicit
|
|
1577
|
+
config opt-out; engine-level facade contract; prompt red-line markers; HTTP route
|
|
1578
|
+
marks consent; UI 分享/转移 + direct-API contract.
|
|
1579
|
+
- Intentional contract growth updates: tools 9 → 10, HTTP routes 5 → 6, v150 UI
|
|
1580
|
+
route/transfer assertions extended with `userApproved`, manifest 1.5.1.
|
|
1581
|
+
- Full suite: **263 tests, 263 pass, 0 fail**.
|
|
1582
|
+
|
|
1583
|
+
## [1.5.0] — 2026-11-02
|
|
1584
|
+
|
|
1585
|
+
Tag-explosion defence, physical multi-space routing, session handoff and the
|
|
1586
|
+
cross-space transfer API. The plugin stays deliberately permission-free: the
|
|
1587
|
+
complex permission choreography belongs to the future Orchestrator plugin, while
|
|
1588
|
+
this engine owns only physical memory. **253 tests green** (was 200).
|
|
1589
|
+
|
|
1590
|
+
### Added — module 1: tag-explosion defence (P0)
|
|
1591
|
+
|
|
1592
|
+
- **`index.maxPostingsPerTag` (default 500, 1–100000)**: derives the inverted index
|
|
1593
|
+
with a hard physical cap per tag. When a tag exceeds it, the retained pointers are
|
|
1594
|
+
chosen by `salience desc -> eventTime desc -> eventId asc` and re-sorted for
|
|
1595
|
+
retrieval (`eventTime desc`, then id). `eventCount`, `mass` and `lastSeen` are
|
|
1596
|
+
still aggregated over **all** events, so the counts the degradation layer reports
|
|
1597
|
+
are honest; only the in-memory posting pointers are dropped (the JSONL log is
|
|
1598
|
+
untouched and rebuildable). Tags expose `postingsLimit` / `postingsTruncated` /
|
|
1599
|
+
`postingsDropped`; index stats expose `postingsTruncated` / `postingsDropped`.
|
|
1600
|
+
- **Recall degradation for oversized tags**: an EXPLICIT query tag holding more than
|
|
1601
|
+
50 memories (`TAG_OVERFLOW_THRESHOLD`) is not expanded into the candidate pool.
|
|
1602
|
+
The response carries `oversizedTagHints: [{ tag, total, code:
|
|
1603
|
+
'MEM_E_TAG_OVERFLOW', hint: '[系统提示] 发现关于 [tag] 的记忆共 N 条,数据量过大。
|
|
1604
|
+
请提供更精确的 startTime/endTime 或使用 deep_raw 查阅。', window }]` and the
|
|
1605
|
+
course-block fallback is suppressed so the flood cannot re-enter through the back
|
|
1606
|
+
door. If the caller insists (a second recall on the same tag), only the **3 most
|
|
1607
|
+
recent** summaries are returned (`oversizedRecent: true`,
|
|
1608
|
+
`oversized-tag-recent:3`). Graph neighbours of an oversized tag are never woken.
|
|
1609
|
+
- **`deep_raw` super-tag gate**: a query touching a tag with more than 500
|
|
1610
|
+
associations (`SUPER_TAG_THRESHOLD`) without `start_time`/`end_time` now throws
|
|
1611
|
+
**`MEM_E_TIME_RANGE_REQUIRED`** (narrow queries keep the old
|
|
1612
|
+
`MEM_E_INVALID_INPUT` contract). One authority decides: the tool no longer
|
|
1613
|
+
pre-validates the window.
|
|
1614
|
+
|
|
1615
|
+
### Added — module 2: multi-space routing & session handoff (physical layer)
|
|
1616
|
+
|
|
1617
|
+
- **Config** `context.autoSpaceFollow` (false), `context.autoRolloverEnabled`
|
|
1618
|
+
(true), `context.autoRolloverThreshold` (0.85, 0.5–0.99),
|
|
1619
|
+
`context.nativeTokenLimit` (8000, 512–1000000) — validated fail-fast, editable
|
|
1620
|
+
over HTTP and in the UI.
|
|
1621
|
+
- **`SpaceRouter`** (`src/spaces/spaceRouter.js`): `targetSpaceId` on
|
|
1622
|
+
`remember`/`recall` routes to an isolated physical store
|
|
1623
|
+
(`<dataDir>/spaces/<id>`, `default` = the existing store, so every old path is
|
|
1624
|
+
byte-identical). One FIFO promise chain **per space**: same-space operations are
|
|
1625
|
+
serialised, different spaces run concurrently (a single global lock would
|
|
1626
|
+
reintroduce the cross-space stalls spaces exist to remove). Ids become directory
|
|
1627
|
+
names, so `^[a-z0-9][a-z0-9._-]{0,63}$` is enforced and a typo fails with
|
|
1628
|
+
`MEM_E_INVALID_INPUT` instead of silently writing into the default space.
|
|
1629
|
+
`runMany` acquires in sorted order (no ABBA deadlock).
|
|
1630
|
+
- **Qwen native fidelity**: `ContextEngine.nativeState()` reports
|
|
1631
|
+
`mode: 'native' | 'layered'`; below `nativeTokenLimit` nothing is folded (folding
|
|
1632
|
+
is a layered-mode operation), above it the L1.5 layered fold runs. The legacy
|
|
1633
|
+
`maxTokens` paging threshold is untouched.
|
|
1634
|
+
- **Automatic handoff (转生)**: when the session reaches
|
|
1635
|
+
`autoRolloverThreshold x nativeTokenLimit`, the tail is distilled into ONE durable
|
|
1636
|
+
L1.5 summary (`status:handoff`), `state/handoff.json` is marked active and the
|
|
1637
|
+
`memory-state` prompt appends `[交接标记] … 本插件不能保证一个会话永生不死,只能
|
|
1638
|
+
保证人格不死。`. A new session consumes the marker. Handoffs are idempotent (one
|
|
1639
|
+
summary per handoff) and self-trigger from the `session/event` stream and from
|
|
1640
|
+
tool boundaries. With `autoRolloverEnabled: false` no marker is written and
|
|
1641
|
+
ContextEngine force-evicts at 95% (`reason: 'native-force'`, down to
|
|
1642
|
+
`target x nativeTokenLimit`).
|
|
1643
|
+
- **Panel/status**: `panel.session` (`mode`, `tokens`, `nativeTokenLimit`,
|
|
1644
|
+
`threshold`, `remainingTokens`, `rolloverEnabled`, `handoffActive`, …) and
|
|
1645
|
+
`panel.spaces` (`current`, `ids`, `open`) are part of the UI contract.
|
|
1646
|
+
|
|
1647
|
+
### Added — module 3: atomic cross-space transfer
|
|
1648
|
+
|
|
1649
|
+
- **`memory_space_transfer` tool** (`event_ids`, `target_space_id`,
|
|
1650
|
+
`transfer_mode: 'copy' | 'move'` default copy, optional `source_space_id`) and
|
|
1651
|
+
`Memory.transferEvents()`.
|
|
1652
|
+
- **Safety rails enforced by the engine, not the caller**: privacy screening aborts
|
|
1653
|
+
the whole batch with **`MEM_E_PRIVACY_BLOCKED`** (ID cards, CN phones, bank cards,
|
|
1654
|
+
emails, credential assignments, PEM private keys; matched bytes never leave the
|
|
1655
|
+
scanner) before any write; `raw_turn` / `rawTurn` / `raw_*` pointers are stripped
|
|
1656
|
+
from meta at every depth; the TARGET space regenerates `event_id`s
|
|
1657
|
+
(`dedupe:false`, never reuses the source identity) and tags copies
|
|
1658
|
+
`transferred:from:<source>` + `transferred:to:<target>`.
|
|
1659
|
+
- **State difference**: `copy` leaves the source untouched (`state: 'retained'`);
|
|
1660
|
+
`move` parks the source ids in the **two-phase pending_delete queue**
|
|
1661
|
+
(`state: 'pending_delete'`, `dueAt`, cancellable with `restore`) only after every
|
|
1662
|
+
target write succeeded — never a direct physical delete, and a partial target
|
|
1663
|
+
failure leaves the source untouched.
|
|
1664
|
+
- **HTTP**: `POST /api/hippocampus/transfer` (same-origin, validated body) for the
|
|
1665
|
+
UI migration button.
|
|
1666
|
+
|
|
1667
|
+
### Added — module 4: UI
|
|
1668
|
+
|
|
1669
|
+
- **Space panel**: soft-follow toggle (`context.autoSpaceFollow`), auto-rollover
|
|
1670
|
+
toggle, trigger-ratio slider, native-window field, single-tag index cap control,
|
|
1671
|
+
and a live status bar: `[当前: 原生模式 | 剩余 X Tokens 触发交接]` (also
|
|
1672
|
+
`分层折叠` / `已交接` variants).
|
|
1673
|
+
- **Migration interaction**: copy/cut (复制/剪切) toggle next to the transfer button;
|
|
1674
|
+
choosing 剪切 requires a **second confirmation warning** before any request is
|
|
1675
|
+
sent.
|
|
1676
|
+
- **Philosophy footer** (bold, bottom of the settings page): **本插件不能保证一个
|
|
1677
|
+
会话永生不死,只能保证人格不死。**
|
|
1678
|
+
- **Subtraction**: the tag search box uses the host-native Enter key only — no
|
|
1679
|
+
debounce, no timer, no effect. `filterGraphByQuery` is pure and testable; the
|
|
1680
|
+
force layout is not re-run by filtering.
|
|
1681
|
+
|
|
1682
|
+
### Changed
|
|
1683
|
+
|
|
1684
|
+
- `uiConfig` exposes `index`; `Memory.applyLiveConfig()` projects a validated config
|
|
1685
|
+
onto the facade **and every open child space**, including the context engine's
|
|
1686
|
+
native/rollover overrides.
|
|
1687
|
+
- `Memory` opens child spaces lazily with the same policy input; `close()` closes
|
|
1688
|
+
children first; a child failure never blocks the rest.
|
|
1689
|
+
- The `memory-state` prompt only gains the handoff block when a marker is active,
|
|
1690
|
+
so the cache-stable prefix is unchanged in the common case.
|
|
1691
|
+
|
|
1692
|
+
### Tests
|
|
1693
|
+
|
|
1694
|
+
- New files: `v150.index.test.js` (truncation/degradation/super-tag gate),
|
|
1695
|
+
`v150.space.test.js` (per-space concurrency, native boundary, forced eviction),
|
|
1696
|
+
`v150.transfer.test.js` (copy/move state difference, privacy, raw_turn strip,
|
|
1697
|
+
fresh ids), `v150.ui.test.js` (bundle contract, helpers, no debounce, footer,
|
|
1698
|
+
transfer route), `v150.lifecycle.test.js` (Qwen mode, threshold handoff, marker
|
|
1699
|
+
consumption, `targetSpaceId` isolation, ninth tool surface),
|
|
1700
|
+
`v150.config.test.js` (new groups, ranges, HTTP editability).
|
|
1701
|
+
- Intentional contract updates in old tests: 8 -> 9 tools, 4 -> 5 routes,
|
|
1702
|
+
`panel.session`/`panel.spaces` added to the panel snapshot, manifest 1.5.0.
|
|
1703
|
+
- Full suite: **253 tests, 253 pass, 0 fail** (old 200 cases included unchanged).
|
|
1704
|
+
|
|
1705
|
+
## [1.4.3] — 2026-11-02
|
|
1706
|
+
|
|
1707
|
+
Two measured blockers from the 2026-11-02 handoff, both fixed and locked by tests.
|
|
1708
|
+
|
|
1709
|
+
### Added
|
|
1710
|
+
|
|
1711
|
+
- **`raw.maxScanTurns` config (500–50000, default 5000)**: `deep_raw`'s scan budget
|
|
1712
|
+
was a hidden constant and is now a validated, UI-editable knob (`raw.maxScanTurns`).
|
|
1713
|
+
- **`stage()` / `commitMany()`**: remember is now a `stage -> commitMany` composition.
|
|
1714
|
+
`stage()` validates and builds a record (identity + idempotency, no log/index I/O);
|
|
1715
|
+
`commitMany()` performs ONE durable append, ONE ledger checkpoint and ONE index
|
|
1716
|
+
delta for a whole batch. `bulkIngest` uses it, so a 50-item chunk is one write
|
|
1717
|
+
instead of 50.
|
|
1718
|
+
- **`memory-state` prompt is now composed** via `composePrompt`: stable rules →
|
|
1719
|
+
`[Memory Map]` (active tags + counts) → `[Memory Blocks]` (the only per-turn
|
|
1720
|
+
volatile tail). The old single-line `briefing()` is no longer the prompt body
|
|
1721
|
+
(it changed on every write and broke the prefix cache). Full-chain tests lock the
|
|
1722
|
+
prefix to be byte-identical before/after a recall injects a block.
|
|
1723
|
+
- **`scripts/confidence-ab.mjs`**: local A/B benchmark for `context.minInjectConfidence`
|
|
1724
|
+
(100 noise + 10/3 relevant; characters, hits, low-confidence hints, mis-degraded
|
|
1725
|
+
relevant memories). Run it with `node scripts/confidence-ab.mjs`.
|
|
1726
|
+
- **Crash-restart test**: kills the process inside the 200ms checkpoint window
|
|
1727
|
+
(cancelled timer, no `close()`), reopens the same directory, and asserts the fresh
|
|
1728
|
+
instance reports `stale` (`unflushed-bytes`), rebuilds the index and can recall the
|
|
1729
|
+
unflushed tail.
|
|
1730
|
+
|
|
1731
|
+
### Fixed
|
|
1732
|
+
|
|
1733
|
+
- **`injectRecall()` crashed on any L3 semantic hit**: it used `summary.id` while
|
|
1734
|
+
`rankSemantic()` returns `summaryId`, so a recall with a distilled summary and
|
|
1735
|
+
`context.injectPrompt` failed with `MEM_E_IO: ContextEngine.inject requires an id`.
|
|
1736
|
+
Now it uses `summaryId ?? id` and skips invalid summaries. Found by the new
|
|
1737
|
+
prompt/tag-tree full-chain test.
|
|
1738
|
+
- `logStore.status()` now exposes `unflushedBytes` (shard size minus manifest bytes)
|
|
1739
|
+
so an unclean shutdown cannot hide the uncheckpointed tail behind equal counters.
|
|
1740
|
+
|
|
1741
|
+
### Changed
|
|
1742
|
+
|
|
1743
|
+
- **`deep_raw` scans NEWEST-FIRST** (per shard, tail to head). The old head-first
|
|
1744
|
+
scan burned its whole budget on the oldest 5000 turns of a day file — in a 10k
|
|
1745
|
+
shard the newest turn could never be found. A hit beyond the window now returns
|
|
1746
|
+
`truncated: true` with a note instead of pretending the turn does not exist.
|
|
1747
|
+
- **Buffered log append**: the hot path keeps one append handle without fsync +
|
|
1748
|
+
manifest rewrite per record. A 200ms checkpoint (and `close()`, and any
|
|
1749
|
+
rewrite/compaction) fsyncs and publishes the manifest; `status().unflushedBytes`
|
|
1750
|
+
plus the boot check make a mid-burst crash visible as stale instead of silently
|
|
1751
|
+
"up to date".
|
|
1752
|
+
- **Identity ledger checkpoint is debounced** (500ms / `close()`): it is a derived
|
|
1753
|
+
startup hint rebuilt from the log, so rewriting it per append was pure O(n²) cost.
|
|
1754
|
+
- **Index appends are lazy**: `applyRecords` records the delta and marks the view
|
|
1755
|
+
dirty; the next `snapshot()` folds it once. N writes cost one index build, and
|
|
1756
|
+
read-your-writes still holds because the fold happens on the read path.
|
|
1757
|
+
- **Briefing is dirty-driven**: a write marks the prompt-state line stale; the next
|
|
1758
|
+
`briefing()` / panel poll rebuilds it once instead of every append.
|
|
1759
|
+
|
|
1760
|
+
### Measured
|
|
1761
|
+
|
|
1762
|
+
- Sequential `memory.remember` x1000: **119/s -> 9104/s** (8.4s -> 110ms).
|
|
1763
|
+
- 10,000-line raw shard, newest query: **0 hits -> 1 hit** (`deep_raw` now starts at
|
|
1764
|
+
the tail; hash restore and redaction regression-guarded).
|
|
1765
|
+
- **`deep_raw` tail-scan bias documented**: beyond `raw.maxScanTurns` (default 5000)
|
|
1766
|
+
per shard, only the newest N turns are covered; older history needs a larger budget
|
|
1767
|
+
or time-window pagination (`end_time` moved backwards). `truncated: true` + notes
|
|
1768
|
+
always say so.
|
|
1769
|
+
- **Confidence A/B (measured)**: `minInjectConfidence=0.6` cuts the tool payload by
|
|
1770
|
+
**49.7%** (10 relevant / 100 noise) and **75.8%** (3 relevant / 100 noise), with
|
|
1771
|
+
**0 relevant hits mis-degraded**; the prompt window only shrinks when the top-8
|
|
1772
|
+
contains noise (0% vs 59.7% in the two scenarios), so the honest claim is
|
|
1773
|
+
"long-tail payload + anti-hallucination", not "always fewer prompt tokens".
|
|
1774
|
+
- 197 tests green (was 189); after the prompt/tag-tree full-chain wiring and the
|
|
1775
|
+
crash-restart test: **200**.
|
|
1776
|
+
|
|
1777
|
+
## [1.4.2] — 2026-11-01
|
|
1778
|
+
|
|
1779
|
+
### Added
|
|
1780
|
+
|
|
1781
|
+
- **L1.5 标签层级树**: hierarchical tags (`tech/frontend/vue3`) now have a
|
|
1782
|
+
three-level lifecycle — immortal roots, leaves that die when their reference
|
|
1783
|
+
count reaches zero, and mids that enter a grace window when they lose their last
|
|
1784
|
+
child. A mid inside that window is a **ghost**: it can be revived by a new leaf,
|
|
1785
|
+
and it is what the UI's history view shows. The tree is a **derived cache**
|
|
1786
|
+
(`state/tag-tree.json`) built by `maintain()` from the converged index; the
|
|
1787
|
+
previous cache is carried forward (`refCount = 0`, orphans dropped) so the
|
|
1788
|
+
lifecycle is observable across maintenance runs. Deleting the file loses only
|
|
1789
|
+
ghost history.
|
|
1790
|
+
- **Bounded prune queue**: dead leaves are queued and consumed one
|
|
1791
|
+
`tagTree.pruneBatchSize` batch per maintenance run; the remaining queue is
|
|
1792
|
+
persisted in the same atomic write, so a 10k-leaf storm drains across runs
|
|
1793
|
+
instead of causing a maintenance storm.
|
|
1794
|
+
- **Anti-hallucination recall degradation**: a `memory_recall` hit reached only
|
|
1795
|
+
through a fading mid is **removed from `hits` entirely** (body, snippet and score
|
|
1796
|
+
never reach the model or the prompt window) and replaced by one metadata hint per
|
|
1797
|
+
mid: path, count, remaining grace days and the exact `deep_raw` time window. A
|
|
1798
|
+
query that names a fading mid with no live episode returns a `count: 0` hint
|
|
1799
|
+
instead of silence.
|
|
1800
|
+
- **`panel.tagTree`**: node/root/mid/leaf/ghost/queue counts for the Web panel, and
|
|
1801
|
+
`GET /api/hippocampus/graph` now returns `tagTree.ghosts` in the same response as
|
|
1802
|
+
the cached graph.
|
|
1803
|
+
- **UI**: `tagTree.*` sliders with numeric boxes and hover tooltips in the settings
|
|
1804
|
+
section; ghost nodes rendered in the force graph as translucent dashed circles
|
|
1805
|
+
hanging under their parent root, with a `仅活跃 / 历史全貌` toggle that cross-fades
|
|
1806
|
+
them via CSS opacity (the force layout does not re-run when toggling).
|
|
1807
|
+
- **Config `tagTree` group** (fail-fast, editable over HTTP and in the UI):
|
|
1808
|
+
`midHalfLifeMultiplier` (1–10), `midGracePeriodDays` (7–180),
|
|
1809
|
+
`pruneBatchSize` (10–500), `leafDecayFloor` (0–1). `midHalfLifeMultiplier` is the
|
|
1810
|
+
only source of the mid half-life — no silent hard-coded lifetime.
|
|
1811
|
+
|
|
1812
|
+
### Changed
|
|
1813
|
+
|
|
1814
|
+
- `maintain()` now rebuilds/prunes/persists the tag tree after the index
|
|
1815
|
+
generation converges; a tag-tree failure is reported as `report.tagTreeError`
|
|
1816
|
+
and can never fail maintenance or block recall.
|
|
1817
|
+
- `applyConfig` now projects the validated config onto the running `Memory` facade,
|
|
1818
|
+
so live UI edits (raw limits, tagTree lifetimes, …) actually reach the running
|
|
1819
|
+
objects instead of waiting for a reload.
|
|
1820
|
+
- `pruneBatch` re-derives decay against the pass's `now` (a frozen build-time score
|
|
1821
|
+
made grace windows meaningless), rejects `O(mids × nodes)` rescans, and keeps
|
|
1822
|
+
parent child counts truthful when a mid dies.
|
|
1823
|
+
|
|
1824
|
+
## [1.4.1] — 2026-11-01
|
|
1825
|
+
|
|
1826
|
+
### Added
|
|
1827
|
+
|
|
1828
|
+
- **Prompt discipline (soft interception)**: a static `memory:policy` section tells
|
|
1829
|
+
the model to prefer `memory_recall` for history/files/system facts, and to treat
|
|
1830
|
+
a `[Slimmed]` response as an invitation to answer from the summary unless the
|
|
1831
|
+
`recovery_hash` must be dereferenced.
|
|
1832
|
+
- **Own-tool output slimming**: `memory_recall`/`memory_admin` responses over the
|
|
1833
|
+
budget (default 2000 tokens) are captured to raw first, then returned as
|
|
1834
|
+
`{slimmed, summary, topics, key_entities, recovery_hash, hint}`; the hint points
|
|
1835
|
+
at `memory_recall(mode="deep_raw", hash=…)`, which restores the exact payload.
|
|
1836
|
+
- **Retrieval confidence**: hits below `context.minInjectConfidence` (default 0.6)
|
|
1837
|
+
carry a short hint instead of their full body, plus a `low-confidence-hints:N` note.
|
|
1838
|
+
- **Write flood guard**: writes above 80% of `storageBudgetMb` throw
|
|
1839
|
+
`MEM_E_WRITE_FLOOD`; `memory.bulkIngest` chunks 50 items per await and ships as
|
|
1840
|
+
`memory_bulk_ingest`.
|
|
1841
|
+
- **raw.captureRatio** (0 | 0.5 | 1): deterministic sampling by content hash;
|
|
1842
|
+
ratio 0 disables capture and `deep_raw` returns an explicit warning.
|
|
1843
|
+
|
|
1844
|
+
### Changed
|
|
1845
|
+
|
|
1846
|
+
- `memory_recall` gains `hash` (exact raw restore) and confidence fields; deep_raw
|
|
1847
|
+
results honour the token budget before returning.
|
|
1848
|
+
- `promptLayout` composes stable rules → memory map → `[Memory Blocks]` tail.
|
|
1849
|
+
|
|
1850
|
+
## [1.4.0] — 2026-10-31
|
|
1851
|
+
|
|
1852
|
+
### Added
|
|
1853
|
+
|
|
1854
|
+
- **Raw-turn forensics (`memory_capture`, `memory_recall mode:"deep_raw"`)**: a
|
|
1855
|
+
separate day-sharded JSONL store (`raw/`) that is never indexed, never loaded at
|
|
1856
|
+
boot, and never touched by normal recall. Gated by `raw.mode` (default
|
|
1857
|
+
`salience`: high-salience, code, stack traces, tool output, or `force`), deduped
|
|
1858
|
+
by content hash, secret-redacted, and capped by `maxTurnKb` (head+tail
|
|
1859
|
+
truncation), `maxBytesPerDay`, `maxTotalMb`, and `retentionDays` (pruned by
|
|
1860
|
+
maintenance; code shards keep 90 days). `deep_raw` scans newest→oldest under a
|
|
1861
|
+
byte/turn budget and reports `truncated: true` instead of pretending it saw
|
|
1862
|
+
everything.
|
|
1863
|
+
- **Spaced repetition**: engine-owned schedule (`1,2,4,7,15,30` days) persisted in
|
|
1864
|
+
`state/reviews.json`; `maintain()` reconciles due items and `reinforce` advances
|
|
1865
|
+
the step. Exposed as `memory_admin action="reviews"`.
|
|
1866
|
+
- **Two-phase delete**: `forget` parks the event for `delete.graceHours`
|
|
1867
|
+
(default 24) in `pending_deletes`; `restore` cancels it, and `maintain()`
|
|
1868
|
+
promotes expired requests into the 4-phase pipeline. Unknown ids now fail
|
|
1869
|
+
immediately, before parking.
|
|
1870
|
+
- **UI data-dir migration**: `dataDir` is editable in the settings page. Saving it
|
|
1871
|
+
takes `.migration.lock`, returns HTTP 202 with `state=migrating`, copies with
|
|
1872
|
+
`fs.promises.cp` in the background, verifies `recordCount` on both sides, and
|
|
1873
|
+
only then switches and reloads the store. A mismatch removes the target and
|
|
1874
|
+
keeps the old store authoritative; the source is never deleted.
|
|
1875
|
+
- New config groups: `raw.*`, `delete.graceHours`, `review.enabled`,
|
|
1876
|
+
`migration.timeoutMs` (all fail-fast validators, UI tooltips included).
|
|
1877
|
+
- **Raw-turn black box (minimal schema)**: each line is exactly
|
|
1878
|
+
`{turn_id, timestamp, role, content}` — no tags, salience, decay, event ids,
|
|
1879
|
+
graph links, session ids or metadata. Addressing is by `(day file, line number)`;
|
|
1880
|
+
append-only keeps lines stable (the one lawful line-pointer exception).
|
|
1881
|
+
Writes are queued and flushed in batches (10 records / 1s), never sync.
|
|
1882
|
+
- **Read-side redaction**: the shard keeps 100% plaintext (forensic integrity);
|
|
1883
|
+
secrets are redacted when `deep_raw` returns snippets, before any text reaches a
|
|
1884
|
+
model prompt. README states local storage is plaintext.
|
|
1885
|
+
- **Tombstones**: a committed purge appends `raw_tombstone {hash, timestamp}`;
|
|
1886
|
+
scans skip tombstoned content hashes (no resurrection).
|
|
1887
|
+
- **deep_raw constraints**: `start_time` and `end_time` are mandatory (missing →
|
|
1888
|
+
`MEM_E_INVALID_INPUT`), results are capped by `raw.maxResultTokens` (default
|
|
1889
|
+
1000) and carry the truncation notice when cut.
|
|
1890
|
+
- **TTL**: maintenance deletes whole day files strictly older than
|
|
1891
|
+
`today - raw.retentionDays`; today's shard is never touched. Raw bytes are
|
|
1892
|
+
surfaced as `panel.storage.rawBytes` and counted in the dashboard ring.
|
|
1893
|
+
- **Automatic raw capture**: the plugin subscribes to `dsh-session`'s
|
|
1894
|
+
`session/event` and stores every user/assistant surface message verbatim
|
|
1895
|
+
(`raw.autoCapture: true`). The Host-injected `Current runtime context.` block is
|
|
1896
|
+
stripped out of `content` and kept (truncated) in `metadata.runtimeContext`, so
|
|
1897
|
+
`deep_raw` stays signal-clean. Tool output is opt-in (`raw.captureTools: false`),
|
|
1898
|
+
**except failed tool results** (`isError`), which are always captured as
|
|
1899
|
+
`kind: "error"`. Budgets, dedupe and retention still apply.
|
|
1900
|
+
|
|
1901
|
+
### Changed
|
|
1902
|
+
|
|
1903
|
+
- Panel adds `raw`, `reviews`, and `pendingDeletes`; the settings page renders a
|
|
1904
|
+
migration progress card while `state=migrating`.
|
|
1905
|
+
- `Memory._scheduler` cron now reads `runtime.config` per tick, so a hot config
|
|
1906
|
+
update changes the schedule without a restart.
|
|
1907
|
+
|
|
1908
|
+
## [1.3.1] — 2026-10-30
|
|
1909
|
+
|
|
1910
|
+
### Fixed
|
|
1911
|
+
|
|
1912
|
+
- **Cold-start 404 (root cause)**: `webServer` is provided by the web-app row, which
|
|
1913
|
+
activates *after* this plugin's `apply()`. The old code called
|
|
1914
|
+
`ctx.get('webServer')` once and silently skipped registration when it was
|
|
1915
|
+
absent — every cold start had no routes, while a warm reload worked. Route
|
|
1916
|
+
registration now lives in `ctx.inject(['webServer'], child => …)`, so the child
|
|
1917
|
+
fiber activates the moment the service appears and the routes are always
|
|
1918
|
+
mounted. Verified live (404 → 200) and covered by a deferred-inject test.
|
|
1919
|
+
- **Front-end death spiral**: a bodiless 404 used to be synthesized into a JSON
|
|
1920
|
+
error, which the old retry counter treated as a protocol failure and gave up
|
|
1921
|
+
after six attempts. `getJson` now keeps "no JSON" distinct, and the pure
|
|
1922
|
+
`decideRetry` policy retries bodiless 404s with exponential backoff (capped at
|
|
1923
|
+
5s) for up to 10 minutes before surfacing `MEM_E_BOOT_TIMEOUT` with a manual
|
|
1924
|
+
reconnect button.
|
|
1925
|
+
- **Diagnostics**: `apply()` prints `[Hippocampus] Route registered at <iso>
|
|
1926
|
+
(<paths>) phase=<phase>` when the routes are mounted, and
|
|
1927
|
+
`[Hippocampus] Route registration FAILED: <reason>` if the service never
|
|
1928
|
+
provides one.
|
|
1929
|
+
|
|
1930
|
+
## [1.3.0] — 2026-10-30
|
|
1931
|
+
|
|
1932
|
+
### Added
|
|
1933
|
+
|
|
1934
|
+
- **Context folding (推币机)**: blocks evicted from the context window are no longer
|
|
1935
|
+
dropped. A light rule folds the most recent batch into one `folded_summary`
|
|
1936
|
+
episode tagged `status:folded` — extracting names, task statements and core
|
|
1937
|
+
conclusions — and writes it back to the L1 log.
|
|
1938
|
+
- **Graph association (在线联想)**: when a query touches a tag, retrieval reads the
|
|
1939
|
+
cached graph and pulls that tag's three strongest neighbours into the candidate
|
|
1940
|
+
pool with an explicit `penalty: 0.5`; such hits are marked `association.via` and
|
|
1941
|
+
can never outrank a direct hit.
|
|
1942
|
+
- **Monthly memos (月记)**: `maintain()` condenses a finished natural month into one
|
|
1943
|
+
`status:monthly` episode. Memos do not decay (`decay = 1`) and are pulled in
|
|
1944
|
+
first for fuzzy historical queries ("上个月", "2023-10", "去年" …).
|
|
1945
|
+
|
|
1946
|
+
### Changed
|
|
1947
|
+
|
|
1948
|
+
- HTTP routes are now registered **before** tools, prompts and scheduling inside
|
|
1949
|
+
`apply()`, so a page that wins the boot race hits a live handler answering
|
|
1950
|
+
`state=pending` instead of a 404. The Host-side assumption is documented in the
|
|
1951
|
+
code: `apply()` awaits nothing, and route service is expected once it returns.
|
|
1952
|
+
|
|
1953
|
+
## [1.2.0] — 2026-10-30
|
|
1954
|
+
|
|
1955
|
+
### Added
|
|
1956
|
+
|
|
1957
|
+
- **`memory_checkpoint`** (`task_id`, `progress`, `updated_at`): exactly one active
|
|
1958
|
+
heavy task. A new checkpoint demotes the previous one, one not refreshed for
|
|
1959
|
+
seven days is demoted by `maintain()`, and `memory_admin action="active_task"`
|
|
1960
|
+
reads it straight from the index — the active-set cap of 200 does not apply.
|
|
1961
|
+
- **Multimodal pointers**: `memory_remember` accepts `media_url` (absolute path or
|
|
1962
|
+
http(s) URL) plus `media_type` (`image|video|document|audio`). Inline base64 in
|
|
1963
|
+
`content` is rejected with `MEM_E_INVALID_MEDIA` from 256 consecutive base64
|
|
1964
|
+
characters; 200 characters is still ordinary text.
|
|
1965
|
+
- **`decay.halfLifeDays`** (default 30, 7–365) and **`activeSet.cap`** (default 200,
|
|
1966
|
+
100–1000): both declared in `DEFAULT_CONFIG`, validated fail-fast by
|
|
1967
|
+
`resolveConfig`, projected into `policy`, and editable from the settings page.
|
|
1968
|
+
- **State handshake**: every route response now carries `state`
|
|
1969
|
+
(`pending|in_progress|ready|failed`), and the UI retries on `state` rather than
|
|
1970
|
+
on the HTTP status. A bodiless 404 during boot is treated as `pending` for a
|
|
1971
|
+
120s grace window (the routes are only mounted once the Host runs `apply()`).
|
|
1972
|
+
|
|
1973
|
+
### Changed
|
|
1974
|
+
|
|
1975
|
+
- Writes before READY are refused loudly: `POST /api/hippocampus/config` answers
|
|
1976
|
+
`409` with `MEM_E_NOT_READY` and the current state; tools already answered
|
|
1977
|
+
`MEM_E_NOT_READY`, and their error details now include `state` and `retryable`.
|
|
1978
|
+
- The settings page covers the full editable surface (18 keys), with the documented
|
|
1979
|
+
hints for `storageBudgetMb`, `context.maxTokens`, `decay.halfLifeDays` and
|
|
1980
|
+
`activeSet.cap`; saving before READY is disabled in the UI and rejected by the API.
|
|
1981
|
+
|
|
1982
|
+
## [1.1.0] — 2026-10-29
|
|
1983
|
+
|
|
1984
|
+
### Added
|
|
1985
|
+
|
|
1986
|
+
- **Graph dragging**: nodes are movable with pointer events. The dragged node is
|
|
1987
|
+
pinned for the duration, coordinates are mutated in a ref and painted straight
|
|
1988
|
+
to the DOM (no `setState` per frame), and release unpins it and runs a short
|
|
1989
|
+
alpha relaxation over its 1-hop neighbourhood. A pointer travel under 4px is
|
|
1990
|
+
still a click, so selecting a label can never move the node by accident.
|
|
1991
|
+
- **`storageBudgetMb`** (integer, default 50, range 10–1000): the storage ring's
|
|
1992
|
+
budget is now configurable instead of hard-coded, and the ring recomputes the
|
|
1993
|
+
moment the value is saved.
|
|
1994
|
+
- **Full settings UI**: every editable config key is in the settings section —
|
|
1995
|
+
switches for booleans, bounded number inputs, a select for
|
|
1996
|
+
`identity.eventTimePolicy`, and a text field for the maintenance cron. Saving
|
|
1997
|
+
posts one dotted-path patch through the same fail-fast validator as startup;
|
|
1998
|
+
a rejected value shows a red banner with the `MEM_E_CONFIG_*` code and nothing
|
|
1999
|
+
is applied. A successful save broadcasts `config-changed` so the panel
|
|
2000
|
+
refetches stats and graph immediately.
|
|
2001
|
+
|
|
2002
|
+
### Fixed
|
|
2003
|
+
|
|
2004
|
+
- Dotted config paths deeper than one level (`identity.eventTimePolicy`,
|
|
2005
|
+
`retrieval.topK`) now nest correctly instead of producing a literal key.
|
|
2006
|
+
|
|
2007
|
+
## [1.0.0] — 2026-10-29
|
|
2008
|
+
|
|
2009
|
+
First public release. The package was previously developed under the working
|
|
2010
|
+
names `@local/dsh-memory` / `Layers-Hippocampus`; the data directory is
|
|
2011
|
+
unchanged and legacy folders are migrated automatically.
|
|
2012
|
+
|
|
2013
|
+
### Added
|
|
2014
|
+
|
|
2015
|
+
- **Layers**: append-only event log, rebuildable tag index (A/B generations),
|
|
2016
|
+
day diaries, independent semantic layer, L2.5 trend quarantine with promotion
|
|
2017
|
+
and burst detection.
|
|
2018
|
+
- **Identity discipline**: canonical `content_hash`, `event_id =
|
|
2019
|
+
hash(content_hash + event_time + occurrence_index)`, separate idempotency
|
|
2020
|
+
index, tombstones that survive log compaction.
|
|
2021
|
+
- **Context paging**: token budget, eviction thresholds, cumulative saved-token
|
|
2022
|
+
accounting persisted in `state/context.json`.
|
|
2023
|
+
- **Maintenance**: one gate for cron and Dream (`runtime.runMaintenance`), no
|
|
2024
|
+
queueing and no backfill; a missed window is skipped, not replayed.
|
|
2025
|
+
- **Config fail-fast**: `enableDream`, `dreamIdleMinutes`, `enableReflection`,
|
|
2026
|
+
`graphMaxEdges` (100–2000, default 500), cron, context and temp ranges are
|
|
2027
|
+
validated by `resolveConfig`; HTTP hot updates go through the same validator.
|
|
2028
|
+
- **Async startup state machine** `pending → in_progress → ready | failed`, with
|
|
2029
|
+
`POST /api/hippocampus/retry` and a UI retry banner.
|
|
2030
|
+
- **Offline knowledge graph**: built at the end of `maintain()` from the index
|
|
2031
|
+
(log minus tombstones), per-node Top-N neighbours, global weight order, cached
|
|
2032
|
+
at `state/graph.json`, hard cap 2000 edges.
|
|
2033
|
+
- **Web UI**: sidebar icon, main panel (SVG storage ring, stats, force-directed
|
|
2034
|
+
graph with progressive reveal), and a settings section.
|
|
2035
|
+
- **HTTP API** (same-origin, behind the Host's browser auth):
|
|
2036
|
+
`GET /api/hippocampus/stats`, `GET|POST /api/hippocampus/config`,
|
|
2037
|
+
`GET /api/hippocampus/graph`, `POST /api/hippocampus/retry`.
|
|
2038
|
+
- **Tests**: 106 in-process cases (Node `node:test`) covering identity,
|
|
2039
|
+
retrieval, L2.5, maintenance, migration, routes, graph and the client bundle
|
|
2040
|
+
contract.
|
|
2041
|
+
|
|
2042
|
+
### Security
|
|
2043
|
+
|
|
2044
|
+
- The UI never receives credentials and never calls agent tools; every number is
|
|
2045
|
+
read through the Host's authenticated JSON routes.
|
|
2046
|
+
- The graph route returns at most `graphMaxEdges` edges from a cached file — no
|
|
2047
|
+
query language, no path input.
|
|
2048
|
+
|
|
2049
|
+
[1.0.0]: https://github.com/382quaii/dsh-Layers-Hippocampus/releases/tag/v1.0.0
|