instar 1.3.409 → 1.3.411

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +13 -3
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/lifeline/MessageQueue.d.ts +22 -2
  5. package/dist/lifeline/MessageQueue.d.ts.map +1 -1
  6. package/dist/lifeline/MessageQueue.js +41 -1
  7. package/dist/lifeline/MessageQueue.js.map +1 -1
  8. package/dist/lifeline/TelegramLifeline.js +2 -2
  9. package/dist/lifeline/TelegramLifeline.js.map +1 -1
  10. package/dist/messaging/MessageProcessingLedger.d.ts +22 -0
  11. package/dist/messaging/MessageProcessingLedger.d.ts.map +1 -1
  12. package/dist/messaging/MessageProcessingLedger.js +58 -6
  13. package/dist/messaging/MessageProcessingLedger.js.map +1 -1
  14. package/dist/messaging/ingressDedup.d.ts +3 -1
  15. package/dist/messaging/ingressDedup.d.ts.map +1 -1
  16. package/dist/messaging/ingressDedup.js +1 -1
  17. package/dist/messaging/ingressDedup.js.map +1 -1
  18. package/dist/messaging/stuckMessageRecovery.d.ts +13 -2
  19. package/dist/messaging/stuckMessageRecovery.d.ts.map +1 -1
  20. package/dist/messaging/stuckMessageRecovery.js +20 -4
  21. package/dist/messaging/stuckMessageRecovery.js.map +1 -1
  22. package/dist/monitoring/SessionWatchdog.d.ts +1 -1
  23. package/dist/monitoring/SessionWatchdog.d.ts.map +1 -1
  24. package/dist/monitoring/SessionWatchdog.js +55 -25
  25. package/dist/monitoring/SessionWatchdog.js.map +1 -1
  26. package/dist/server/routes.d.ts.map +1 -1
  27. package/dist/server/routes.js +5 -0
  28. package/dist/server/routes.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/data/builtin-manifest.json +47 -47
  31. package/upgrades/1.3.411.md +93 -0
  32. package/upgrades/side-effects/stuck-recovery-replay-dedupe.md +88 -0
  33. package/upgrades/side-effects/watchdog-nonblocking-scans.md +81 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.409",
3
+ "version": "1.3.411",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-07T21:38:17.118Z",
5
- "instarVersion": "1.3.409",
4
+ "generatedAt": "2026-06-07T22:07:36.622Z",
5
+ "instarVersion": "1.3.411",
6
6
  "entryCount": 199,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -418,7 +418,7 @@
418
418
  "type": "route-group",
419
419
  "domain": "monitoring",
420
420
  "sourcePath": "src/server/routes.ts",
421
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
421
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
422
422
  "since": "2025-01-01"
423
423
  },
424
424
  "route-group:agents": {
@@ -426,7 +426,7 @@
426
426
  "type": "route-group",
427
427
  "domain": "sessions",
428
428
  "sourcePath": "src/server/routes.ts",
429
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
429
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
430
430
  "since": "2025-01-01"
431
431
  },
432
432
  "route-group:backups": {
@@ -434,7 +434,7 @@
434
434
  "type": "route-group",
435
435
  "domain": "operations",
436
436
  "sourcePath": "src/server/routes.ts",
437
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
437
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
438
438
  "since": "2025-01-01"
439
439
  },
440
440
  "route-group:git": {
@@ -442,7 +442,7 @@
442
442
  "type": "route-group",
443
443
  "domain": "coordination",
444
444
  "sourcePath": "src/server/routes.ts",
445
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
445
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
446
446
  "since": "2025-01-01"
447
447
  },
448
448
  "route-group:memory": {
@@ -450,7 +450,7 @@
450
450
  "type": "route-group",
451
451
  "domain": "memory",
452
452
  "sourcePath": "src/server/routes.ts",
453
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
453
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
454
454
  "since": "2025-01-01"
455
455
  },
456
456
  "route-group:semantic": {
@@ -458,7 +458,7 @@
458
458
  "type": "route-group",
459
459
  "domain": "memory",
460
460
  "sourcePath": "src/server/routes.ts",
461
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
461
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
462
462
  "since": "2025-01-01"
463
463
  },
464
464
  "route-group:status": {
@@ -466,7 +466,7 @@
466
466
  "type": "route-group",
467
467
  "domain": "monitoring",
468
468
  "sourcePath": "src/server/routes.ts",
469
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
469
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
470
470
  "since": "2025-01-01"
471
471
  },
472
472
  "route-group:capabilities": {
@@ -474,7 +474,7 @@
474
474
  "type": "route-group",
475
475
  "domain": "mapping",
476
476
  "sourcePath": "src/server/routes.ts",
477
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
477
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
478
478
  "since": "2025-01-01"
479
479
  },
480
480
  "route-group:project-map": {
@@ -482,7 +482,7 @@
482
482
  "type": "route-group",
483
483
  "domain": "mapping",
484
484
  "sourcePath": "src/server/routes.ts",
485
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
485
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
486
486
  "since": "2025-01-01"
487
487
  },
488
488
  "route-group:coherence": {
@@ -490,7 +490,7 @@
490
490
  "type": "route-group",
491
491
  "domain": "coherence",
492
492
  "sourcePath": "src/server/routes.ts",
493
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
493
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
494
494
  "since": "2025-01-01"
495
495
  },
496
496
  "route-group:topic-bindings": {
@@ -498,7 +498,7 @@
498
498
  "type": "route-group",
499
499
  "domain": "sessions",
500
500
  "sourcePath": "src/server/routes.ts",
501
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
501
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
502
502
  "since": "2025-01-01"
503
503
  },
504
504
  "route-group:context": {
@@ -506,7 +506,7 @@
506
506
  "type": "route-group",
507
507
  "domain": "context",
508
508
  "sourcePath": "src/server/routes.ts",
509
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
509
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
510
510
  "since": "2025-01-01"
511
511
  },
512
512
  "route-group:scope-coherence": {
@@ -514,7 +514,7 @@
514
514
  "type": "route-group",
515
515
  "domain": "coherence",
516
516
  "sourcePath": "src/server/routes.ts",
517
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
517
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
518
518
  "since": "2025-01-01"
519
519
  },
520
520
  "route-group:canonical-state": {
@@ -522,7 +522,7 @@
522
522
  "type": "route-group",
523
523
  "domain": "state",
524
524
  "sourcePath": "src/server/routes.ts",
525
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
525
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
526
526
  "since": "2025-01-01"
527
527
  },
528
528
  "route-group:ci": {
@@ -530,7 +530,7 @@
530
530
  "type": "route-group",
531
531
  "domain": "monitoring",
532
532
  "sourcePath": "src/server/routes.ts",
533
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
533
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
534
534
  "since": "2025-01-01"
535
535
  },
536
536
  "route-group:sessions": {
@@ -538,7 +538,7 @@
538
538
  "type": "route-group",
539
539
  "domain": "sessions",
540
540
  "sourcePath": "src/server/routes.ts",
541
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
541
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
542
542
  "since": "2025-01-01"
543
543
  },
544
544
  "route-group:jobs": {
@@ -546,7 +546,7 @@
546
546
  "type": "route-group",
547
547
  "domain": "scheduling",
548
548
  "sourcePath": "src/server/routes.ts",
549
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
549
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
550
550
  "since": "2025-01-01"
551
551
  },
552
552
  "route-group:skip-ledger": {
@@ -554,7 +554,7 @@
554
554
  "type": "route-group",
555
555
  "domain": "scheduling",
556
556
  "sourcePath": "src/server/routes.ts",
557
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
557
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
558
558
  "since": "2025-01-01"
559
559
  },
560
560
  "route-group:telegram": {
@@ -562,7 +562,7 @@
562
562
  "type": "route-group",
563
563
  "domain": "communication",
564
564
  "sourcePath": "src/server/routes.ts",
565
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
565
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
566
566
  "since": "2025-01-01"
567
567
  },
568
568
  "route-group:attention": {
@@ -570,7 +570,7 @@
570
570
  "type": "route-group",
571
571
  "domain": "communication",
572
572
  "sourcePath": "src/server/routes.ts",
573
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
573
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
574
574
  "since": "2025-01-01"
575
575
  },
576
576
  "route-group:relationships": {
@@ -578,7 +578,7 @@
578
578
  "type": "route-group",
579
579
  "domain": "relationships",
580
580
  "sourcePath": "src/server/routes.ts",
581
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
581
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
582
582
  "since": "2025-01-01"
583
583
  },
584
584
  "route-group:feedback": {
@@ -586,7 +586,7 @@
586
586
  "type": "route-group",
587
587
  "domain": "feedback",
588
588
  "sourcePath": "src/server/routes.ts",
589
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
589
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
590
590
  "since": "2025-01-01"
591
591
  },
592
592
  "route-group:updates": {
@@ -594,7 +594,7 @@
594
594
  "type": "route-group",
595
595
  "domain": "updates",
596
596
  "sourcePath": "src/server/routes.ts",
597
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
597
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
598
598
  "since": "2025-01-01"
599
599
  },
600
600
  "route-group:dispatches": {
@@ -602,7 +602,7 @@
602
602
  "type": "route-group",
603
603
  "domain": "dispatches",
604
604
  "sourcePath": "src/server/routes.ts",
605
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
605
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
606
606
  "since": "2025-01-01"
607
607
  },
608
608
  "route-group:quota": {
@@ -610,7 +610,7 @@
610
610
  "type": "route-group",
611
611
  "domain": "monitoring",
612
612
  "sourcePath": "src/server/routes.ts",
613
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
613
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
614
614
  "since": "2025-01-01"
615
615
  },
616
616
  "route-group:publishing": {
@@ -618,7 +618,7 @@
618
618
  "type": "route-group",
619
619
  "domain": "publishing",
620
620
  "sourcePath": "src/server/routes.ts",
621
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
621
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
622
622
  "since": "2025-01-01"
623
623
  },
624
624
  "route-group:private-views": {
@@ -626,7 +626,7 @@
626
626
  "type": "route-group",
627
627
  "domain": "publishing",
628
628
  "sourcePath": "src/server/routes.ts",
629
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
629
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
630
630
  "since": "2025-01-01"
631
631
  },
632
632
  "route-group:tunnel": {
@@ -634,7 +634,7 @@
634
634
  "type": "route-group",
635
635
  "domain": "networking",
636
636
  "sourcePath": "src/server/routes.ts",
637
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
637
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
638
638
  "since": "2025-01-01"
639
639
  },
640
640
  "route-group:events": {
@@ -642,7 +642,7 @@
642
642
  "type": "route-group",
643
643
  "domain": "networking",
644
644
  "sourcePath": "src/server/routes.ts",
645
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
645
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
646
646
  "since": "2025-01-01"
647
647
  },
648
648
  "route-group:evolution": {
@@ -650,7 +650,7 @@
650
650
  "type": "route-group",
651
651
  "domain": "evolution",
652
652
  "sourcePath": "src/server/routes.ts",
653
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
653
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
654
654
  "since": "2025-01-01"
655
655
  },
656
656
  "route-group:watchdog": {
@@ -658,7 +658,7 @@
658
658
  "type": "route-group",
659
659
  "domain": "monitoring",
660
660
  "sourcePath": "src/server/routes.ts",
661
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
661
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
662
662
  "since": "2025-01-01"
663
663
  },
664
664
  "route-group:topic-memory": {
@@ -666,7 +666,7 @@
666
666
  "type": "route-group",
667
667
  "domain": "memory",
668
668
  "sourcePath": "src/server/routes.ts",
669
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
669
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
670
670
  "since": "2025-01-01"
671
671
  },
672
672
  "route-group:state-sync": {
@@ -674,7 +674,7 @@
674
674
  "type": "route-group",
675
675
  "domain": "coordination",
676
676
  "sourcePath": "src/server/routes.ts",
677
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
677
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
678
678
  "since": "2025-01-01"
679
679
  },
680
680
  "route-group:intent": {
@@ -682,7 +682,7 @@
682
682
  "type": "route-group",
683
683
  "domain": "intent",
684
684
  "sourcePath": "src/server/routes.ts",
685
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
685
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
686
686
  "since": "2025-01-01"
687
687
  },
688
688
  "route-group:triage": {
@@ -690,7 +690,7 @@
690
690
  "type": "route-group",
691
691
  "domain": "safety",
692
692
  "sourcePath": "src/server/routes.ts",
693
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
693
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
694
694
  "since": "2025-01-01"
695
695
  },
696
696
  "route-group:operations": {
@@ -698,7 +698,7 @@
698
698
  "type": "route-group",
699
699
  "domain": "safety",
700
700
  "sourcePath": "src/server/routes.ts",
701
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
701
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
702
702
  "since": "2025-01-01"
703
703
  },
704
704
  "route-group:sentinel": {
@@ -706,7 +706,7 @@
706
706
  "type": "route-group",
707
707
  "domain": "safety",
708
708
  "sourcePath": "src/server/routes.ts",
709
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
709
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
710
710
  "since": "2025-01-01"
711
711
  },
712
712
  "route-group:trust": {
@@ -714,7 +714,7 @@
714
714
  "type": "route-group",
715
715
  "domain": "safety",
716
716
  "sourcePath": "src/server/routes.ts",
717
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
717
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
718
718
  "since": "2025-01-01"
719
719
  },
720
720
  "route-group:monitoring": {
@@ -722,7 +722,7 @@
722
722
  "type": "route-group",
723
723
  "domain": "monitoring",
724
724
  "sourcePath": "src/server/routes.ts",
725
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
725
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
726
726
  "since": "2025-01-01"
727
727
  },
728
728
  "route-group:commitments": {
@@ -730,7 +730,7 @@
730
730
  "type": "route-group",
731
731
  "domain": "commitments",
732
732
  "sourcePath": "src/server/routes.ts",
733
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
733
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
734
734
  "since": "2025-01-01"
735
735
  },
736
736
  "route-group:episodes": {
@@ -738,7 +738,7 @@
738
738
  "type": "route-group",
739
739
  "domain": "memory",
740
740
  "sourcePath": "src/server/routes.ts",
741
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
741
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
742
742
  "since": "2025-01-01"
743
743
  },
744
744
  "route-group:messages": {
@@ -746,7 +746,7 @@
746
746
  "type": "route-group",
747
747
  "domain": "coordination",
748
748
  "sourcePath": "src/server/routes.ts",
749
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
749
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
750
750
  "since": "2025-01-01"
751
751
  },
752
752
  "route-group:system-reviews": {
@@ -754,7 +754,7 @@
754
754
  "type": "route-group",
755
755
  "domain": "monitoring",
756
756
  "sourcePath": "src/server/routes.ts",
757
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
757
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
758
758
  "since": "2025-01-01"
759
759
  },
760
760
  "route-group:machine-mesh": {
@@ -770,7 +770,7 @@
770
770
  "type": "route-group",
771
771
  "domain": "security",
772
772
  "sourcePath": "src/server/routes.ts",
773
- "contentHash": "71db98cdd2a2ec55361f6a66447e40f0f97436817e2ae4b8f0496dc803248cbf",
773
+ "contentHash": "0f4f281893adb0a91ef6033338c8ed90d06df98703aa151902311747aca56624",
774
774
  "since": "2025-01-01"
775
775
  },
776
776
  "cli:init": {
@@ -1570,7 +1570,7 @@
1570
1570
  "type": "subsystem",
1571
1571
  "domain": "communication",
1572
1572
  "sourcePath": "src/lifeline/TelegramLifeline.ts",
1573
- "contentHash": "66d80ca0ef55324cf73f3ec2a1a32791d5d104fe995cb2bb0f7135859770b6fa",
1573
+ "contentHash": "692e4271e6605457b508a73a1178a72ca0992b8a806cd305ccd0c9d06af2b4ec",
1574
1574
  "since": "2025-01-01"
1575
1575
  },
1576
1576
  "subsystem:orphan-process-reaper": {
@@ -0,0 +1,93 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The exactly-once message recovery re-ran an already-answered Telegram message every
9
+ ~10 minutes — tagged "from Unknown" — re-spawning a session each cycle and piling load
10
+ onto an already-overloaded machine (the 2026-06-07 "server temporarily down on every
11
+ message" incident, topic 21816). Three fixes, all "don't replay a handled message":
12
+
13
+ 1. **Reply-evidence guard** — before re-running a message stuck in `processing`,
14
+ stuck-recovery now checks the durable ledger for a reply committed on that topic
15
+ at/after the message arrived. If found, the entry is committed (it was effectively
16
+ handled — its own reply just failed to record during the server flap, or it was a
17
+ duplicate) instead of being re-injected. The no-loss path (re-running a genuinely
18
+ unanswered turn) is unchanged.
19
+ 2. **Sender preserved through replay** — the inbound sender is captured at ingress and
20
+ replayed, so a legitimate re-run no longer shows "from Unknown" (Know Your Principal).
21
+ 3. **Lifeline queue dedup** — `MessageQueue.enqueue` is idempotent on message id and
22
+ refuses to re-queue an id already delivered/dropped this run, killing the "stale
23
+ already-delivered copies kept getting retried" half.
24
+
25
+ `SessionWatchdog` polled every 30s over every running session, running several
26
+ `ps`/`pgrep` probes per session via synchronous `spawnSync` — each blocking the single
27
+ Node event loop for its full duration. Under load (dozens of sessions on a busy box) the
28
+ cumulative stall made the server miss its own `/health` window, so the supervisor
29
+ declared it down and restarted it in a loop (2026-06-07 "server temporarily down on
30
+ every message" incident, topic 21816). The watchdog's process scans are now async
31
+ (`execFile`) and the poll yields the event loop between sessions, so health checks stay
32
+ responsive while scans run. The watchdog's escalation/kill DECISIONS are unchanged —
33
+ only the I/O mechanism of its read-only probes changed.
34
+
35
+ ## What to Tell Your User
36
+
37
+ If they saw the same message echoed back repeatedly, or "server temporarily down" on
38
+ nearly every message during an overload: that replay loop is fixed — an already-answered
39
+ message is no longer re-run, and the queue won't re-deliver something it already sent.
40
+ Nothing for them to do; their messages were never lost (they queued and delivered).
41
+
42
+ If they saw "server temporarily down" on nearly every message during a busy period,
43
+ with the server restarting repeatedly: a big contributor was the watchdog freezing the
44
+ event loop while scanning processes. It no longer does. Nothing for them to do.
45
+
46
+ ## Summary of New Capabilities
47
+
48
+ - `MessageProcessingLedger.hasReplyCommittedForTopicSince(topic, sinceISO)` — durable
49
+ reply-evidence query used to recognize an already-answered topic.
50
+ - `MessageProcessingLedger` stores the inbound sender envelope (additive, nullable
51
+ column; idempotent in-place schema upgrade — no migrator step).
52
+ - `recoverStuckMessages` reply-evidence guard + `alreadyHandled` result counter;
53
+ re-injection preserves the real sender.
54
+ - `MessageQueue.enqueue` is id-idempotent (returns boolean); `MessageQueue.markDelivered`
55
+ records delivered/dropped ids so a redelivery can't re-queue them.
56
+
57
+ - `SessionWatchdog` process scans (`getFrameworkPid`/`getClaudePid`/`getChildProcesses`/
58
+ `hasActivePipelineSibling`/`checkCompactionIdle`) are async (`execFile`) instead of
59
+ blocking `spawnSync`.
60
+ - `poll()` yields the event loop (`setImmediate`) between sessions so a scan over many
61
+ sessions can't monopolize the loop and starve `/health`.
62
+
63
+ ## Evidence
64
+
65
+ `tests/unit/stuck-message-recovery.test.ts`, `MessageProcessingLedger.test.ts`,
66
+ `lifeline/MessageQueue-durability.test.ts`, `lifeline/version-skew-recovery.test.ts`:
67
+ reply-evidence guard commits-not-reruns an answered topic; a genuinely-unanswered entry
68
+ still re-runs; sender round-trips through a recovered replay; the queue refuses to
69
+ re-enqueue an already-delivered id; wiring guards assert routes.ts captures the sender
70
+ and reinjectStuck forwards it. causalAutopsy: latent (the stuck==unanswered assumption
71
+ surfaced under sustained CPU starvation that made replies fail to commit).
72
+
73
+ `tests/unit/SessionWatchdog-nonblocking.test.ts`: scanning helpers return Promises; a
74
+ 0ms timer fires during an in-flight probe (loop stays live); source guards assert no
75
+ `spawnSync(` call, `execFileAsync` present, the three helpers async, and `poll()` yields
76
+ via `setImmediate`. Existing compaction/pipeline/mcp/rate-limit watchdog suites updated
77
+ to `await` and pass. 72 watchdog unit tests green; `tsc --noEmit` clean. causalAutopsy:
78
+ latent — synchronous process scans were always event-loop-blocking, but only surfaced as
79
+ a health-miss restart loop once session count × machine load grew large enough.
80
+
81
+ ## Scope (honest)
82
+
83
+ Contained Tier-1 fix to the existing exactly-once ingress + lifeline replay subsystems.
84
+ No new HTTP route, config default, or migration step. The reply-evidence false-negative
85
+ case (two distinct rapid questions, the second crashes before the first's reply commits)
86
+ is bounded — that message was already routed once, so it isn't lost, only a redundant
87
+ re-run is skipped. 603 messaging/lifeline unit tests green; `tsc --noEmit` clean.
88
+
89
+ Contained Tier-1 refactor of one monitor (`src/monitoring/SessionWatchdog.ts`) + its
90
+ tests. Behavior-equivalent (same commands, parsing, thresholds, LLM gate); only the
91
+ sync→async I/O mechanism changed. The watchdog stays opt-in. The same blocking-scan
92
+ pattern exists in OrphanProcessReaper / mcpProcessReaper (lower cadence — memory-pressure
93
+ and 30-min triggers); those are a candidate follow-up, not in this PR.
@@ -0,0 +1,88 @@
1
+ # Side-Effects Review — Stuck-recovery / replay dedupe + sender preservation
2
+
3
+ **Version / slug:** `stuck-recovery-replay-dedupe`
4
+ **Date:** `2026-06-07`
5
+ **Author:** `Echo`
6
+ **Tier:** 1 (contained fix to an existing dark feature; no API/route/config/migration surface)
7
+ **Second-pass reviewer:** `Echo (self) — Tier-1; the over/under-block analysis below is the load-bearing part`
8
+
9
+ ## Summary of the change
10
+
11
+ The exactly-once ingress subsystem (spec §8 G3a) re-ran an already-answered Telegram
12
+ message every ~10 min, tagged "from Unknown", re-spawning a session each cycle —
13
+ during the very load incident it stemmed from (topic 21816). Three changes, all
14
+ "don't replay an already-handled message":
15
+
16
+ 1. **`stuckMessageRecovery.recoverStuckMessages`** — before re-injecting a stuck
17
+ `processing` entry, a reply-evidence guard checks whether the topic was already
18
+ answered (a reply committed at/after the entry arrived). If so the entry is
19
+ committed (`commitReply`+`advanceCursor`), NOT re-injected. Default backing is the
20
+ ledger query `hasReplyCommittedForTopicSince`; injectable for tests.
21
+ 2. **`MessageProcessingLedger`** — stores the inbound sender envelope (idempotent
22
+ `ALTER TABLE … ADD COLUMN sender_envelope`, no PostUpdateMigrator step per the
23
+ SQLite-self-init contract) and exposes `hasReplyCommittedForTopicSince`.
24
+ `ingressDedup.decideIngress` + `routes.ts` thread the sender from the inbound;
25
+ `server.ts reinjectStuck` replays with the real sender so the prefix is correct.
26
+ 3. **`lifeline/MessageQueue`** — `enqueue` is idempotent on `id` and skips ids already
27
+ delivered/dropped this process; the replay loop feeds the guard via
28
+ `markDelivered()` (remove + remember). Kills the "stale already-delivered copies
29
+ kept getting retried" half.
30
+
31
+ ## Decision-point inventory
32
+
33
+ - `recoverStuckMessages` (per stuck entry) — modify — re-run vs commit-as-handled.
34
+ The new branch only ADDS a "commit, don't re-run" path; it never causes a re-run
35
+ that wasn't already going to happen.
36
+ - `MessageQueue.enqueue` — modify — add vs skip a queue entry. Now returns boolean.
37
+ - No message block/allow surface. No kill/terminate surface. No new HTTP route, no
38
+ config default, no CLAUDE.md/template change.
39
+
40
+ ## 1. Over-block (suppressing a re-run that SHOULD happen)
41
+
42
+ The reply-evidence guard could, in principle, skip re-running a genuinely-unanswered
43
+ message. Bound: the guard fires only when a reply was committed on the SAME topic at
44
+ or after the entry's `receivedAt`. The false-negative case is "two distinct questions
45
+ arrive close together, the first is answered, the second crashed mid-turn and arrived
46
+ before that answer committed." Cost is bounded and small: the second message was
47
+ already ROUTED to the session once (recovery only re-runs crash-mid-turn turns, not
48
+ lost deliveries), so it is not lost from the conversation — only a redundant re-run is
49
+ skipped. The far larger, observed harm (re-running an already-answered message every
50
+ 10 min, forever-bounded only by the 3-attempt cap, each re-run spawning a session
51
+ under load) is eliminated. Net strictly safer. The attempts-cap backstop remains.
52
+
53
+ ## 2. Under-block (still re-running when we shouldn't)
54
+
55
+ A genuinely lost turn (claimed, never answered, no reply on the topic since) still
56
+ re-runs exactly as before — verified by the "still re-runs a genuinely unanswered
57
+ stuck entry" test. The change does not weaken the no-LOSS guarantee.
58
+
59
+ ## 3. Level-of-abstraction fit
60
+
61
+ Correct layer. The reply-evidence signal is an objective, durable ledger read
62
+ (indexed on `topic, reply_committed_at`), not an LLM call. The sender envelope is
63
+ captured at the same ingress point that already logs sender for the message log. The
64
+ queue dedup is a pure in-memory id check. No new external dependency.
65
+
66
+ ## 4. Blast radius
67
+
68
+ The exactly-once ledger + stuck-recovery is gated behind `multiMachine` wiring
69
+ (`ctx.messageLedger`); agents without it are unaffected (the code paths no-op when the
70
+ ledger is null). The sender-envelope column is additive and nullable — old rows read
71
+ back `senderEnvelope: null` (→ replay falls back to "unknown", i.e. today's behavior,
72
+ never worse). `MessageQueue.enqueue`'s new boolean return is ignored by existing
73
+ call sites (statement context). `markDelivered` is a strict superset of the prior
74
+ `remove` on the replay path.
75
+
76
+ ## 5. Rollback
77
+
78
+ Pure code revert — no data migration to undo. The `sender_envelope` column is left in
79
+ place harmlessly on rollback (unused). No state-file format change beyond the additive
80
+ nullable column. No config flag introduced or flipped.
81
+
82
+ ## 6. Tests
83
+
84
+ Unit: reply-evidence guard (both branches + ledger-default), sender round-trip,
85
+ ledger `hasReplyCommittedForTopicSince` (topic+time scoping), `MessageQueue` id-dedup
86
+ + delivered-guard, and source-level wiring guards (routes.ts captures the sender;
87
+ `reinjectStuck` forwards it; replay loop uses `markDelivered`). 603 messaging/lifeline
88
+ unit tests green; `tsc --noEmit` clean.