instar 1.3.790 → 1.3.792

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 (37) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +3 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +4 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/types.d.ts +11 -0
  8. package/dist/core/types.d.ts.map +1 -1
  9. package/dist/core/types.js.map +1 -1
  10. package/dist/monitoring/AgentWorktreeReaper.d.ts +19 -0
  11. package/dist/monitoring/AgentWorktreeReaper.d.ts.map +1 -1
  12. package/dist/monitoring/AgentWorktreeReaper.js +46 -0
  13. package/dist/monitoring/AgentWorktreeReaper.js.map +1 -1
  14. package/dist/monitoring/GreenPrAutoMerger.d.ts +54 -0
  15. package/dist/monitoring/GreenPrAutoMerger.d.ts.map +1 -1
  16. package/dist/monitoring/GreenPrAutoMerger.js +97 -1
  17. package/dist/monitoring/GreenPrAutoMerger.js.map +1 -1
  18. package/dist/monitoring/agentWorktreeGit.d.ts.map +1 -1
  19. package/dist/monitoring/agentWorktreeGit.js +29 -0
  20. package/dist/monitoring/agentWorktreeGit.js.map +1 -1
  21. package/dist/monitoring/greenPrAutomergeWiring.d.ts +8 -1
  22. package/dist/monitoring/greenPrAutomergeWiring.d.ts.map +1 -1
  23. package/dist/monitoring/greenPrAutomergeWiring.js +17 -7
  24. package/dist/monitoring/greenPrAutomergeWiring.js.map +1 -1
  25. package/dist/monitoring/greenPrLogic.d.ts +53 -0
  26. package/dist/monitoring/greenPrLogic.d.ts.map +1 -1
  27. package/dist/monitoring/greenPrLogic.js +70 -0
  28. package/dist/monitoring/greenPrLogic.js.map +1 -1
  29. package/dist/server/routes.d.ts.map +1 -1
  30. package/dist/server/routes.js +5 -0
  31. package/dist/server/routes.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/data/builtin-manifest.json +46 -46
  34. package/upgrades/1.3.791.md +21 -0
  35. package/upgrades/1.3.792.md +77 -0
  36. package/upgrades/side-effects/reaper-toctou-fix.md +19 -0
  37. package/upgrades/side-effects/red-pr-watchdog.md +131 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.790",
3
+ "version": "1.3.792",
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-07-09T08:14:40.654Z",
5
- "instarVersion": "1.3.790",
4
+ "generatedAt": "2026-07-09T10:17:12.654Z",
5
+ "instarVersion": "1.3.792",
6
6
  "entryCount": 202,
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
421
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
429
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
437
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
445
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
453
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
461
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
469
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
477
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
485
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
493
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
501
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
509
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
517
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
525
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
533
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
541
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
549
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
557
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
565
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
573
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
581
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
589
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
597
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
605
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
613
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
621
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
629
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
637
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
645
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
653
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
661
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
669
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
677
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
685
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
693
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
701
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
709
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
717
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
725
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
733
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
741
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
749
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
757
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
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": "6dd6ca2f8912d7e60e3210bb2db055b72b3c1cbb816598cff9d6a00c43413606",
773
+ "contentHash": "59884e1700f28276bccbc65f34b578851dd90c50ecbeb784bf32e46dd2817fb8",
774
774
  "since": "2025-01-01"
775
775
  },
776
776
  "cli:init": {
@@ -0,0 +1,21 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ - **The stale-worktree reaper no longer reaps a worktree that a builder started using between the reaper's check and its delete (AgentWorktreeReaper TOCTOU fix).** The reaper enumerates all worktrees, captures each one's branch, then reaps up to N of them in a later loop. A build worktree whose branch was merged at enumeration but which a builder then `git checkout -b`'d onto a NEW unmerged branch would still be judged "merged" against the STALE branch and deleted mid-build (this happened once tonight). The reaper now RE-READS each worktree's live state — current branch, clean, in-use, merged — immediately before the irreversible delete, and ABORTS (keeps) on any change since evaluation. It is a pure safety tightening: strictly FEWER reaps, never more; fail-closed on any unreadable signal.
9
+ - **New belt-and-suspenders claim:** a `.instar-build-active` marker file at a worktree root is now honored as "in use" — an in-flight builder can drop it to be certain the reaper leaves the worktree alone.
10
+
11
+ ## What to Tell Your User
12
+
13
+ If your agent's background cleanup ever removed a worktree while a build was actively using it, that race is closed — the cleanup now double-checks the live state right before deleting and backs off if anything changed. Nothing to enable; it lands with the release. It only ever makes the cleanup MORE cautious, never less.
14
+
15
+ ## Summary of New Capabilities
16
+
17
+ - None user-facing — a safety hardening of the AgentWorktreeReaper. Two new injected signals (`currentBranch`, `hasActiveBuildMarker`) power an execution-time re-validation that closes the enumerate→reclaim time-of-check-to-time-of-use window. No config, no gate (a pure tightening, always on).
18
+
19
+ ## Evidence
20
+
21
+ `tests/unit/agent-worktree-reaper.test.ts` — 6 new cases pin the guard: branch-changed-since-eval → keep; went-dirty → keep; became-in-use → keep; build-marker-present → keep; still-unchanged → reaps (happy path unchanged); currentBranch-read-error (null) → keep (fail-closed). All 53 reaper tests pass, including the real-git end-to-end reclaim test. The change is delete-safe by construction — every new branch of the guard resolves toward KEEP.
@@ -0,0 +1,77 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ A signal-only **red-PR watchdog** on the existing green-PR auto-merge watcher. Green-PR
9
+ auto-merge only ever acts on GREEN PRs, so a PR of mine that goes RED and *stays* red is
10
+ invisible to it — which is exactly how PR #1399 sat red overnight on 2026-07-08 until the
11
+ operator found it on his morning check-in (an operator-found escape). The watchdog closes
12
+ that gap: after the merge logic runs each tick, it checks my own open PRs and raises ONE
13
+ deduped, age-escalating attention line — `PR #N red for Xh — <failing check names>` — for
14
+ any PR with a required check stuck RED past a threshold (default 2h). It is SIGNAL-ONLY:
15
+ it never merges, closes, or blocks anything.
16
+
17
+ - `src/monitoring/greenPrLogic.ts` — new pure helpers `latestRunPerCheck` (dedup a rollup
18
+ to the newest run per check name), `failingChecksFromRollup`, and `stuckRedChecks`; plus
19
+ a `failingChecks` field on `PrSummary`. **Correctness fix:** `deriveRollup` now dedups to
20
+ the latest run per check BEFORE collapsing — a stale FAILED run superseded by a passing
21
+ re-run previously still read `FAILURE` (the exact bug the overnight incident surfaced),
22
+ which also made the green-PR merger refuse an actually-green PR.
23
+ - `src/monitoring/greenPrAutomergeWiring.ts` — `mapPr` populates `failingChecks` from the
24
+ same `statusCheckRollup` the list projection already fetches (no new gh call).
25
+ - `src/monitoring/GreenPrAutoMerger.ts` — `tick()` runs `redPrWatchdogPass` after the merge
26
+ logic; a per-PR `redPrRaised` memory (in state) dedups to ONE item, re-raised only on age
27
+ escalation or a changed failing-check set, and cleared when the PR goes green / merges /
28
+ closes. New `redPrWatchdog` config (`{ enabled, redThresholdMs }`, default
29
+ `{ enabled: true, redThresholdMs: 7_200_000 }`).
30
+ - `src/server/routes.ts` — `GET /green-pr-automerge` now returns `stuckRed[]` +
31
+ `redPrWatchdog` config so "why did I get a red-PR alert?" is answerable from state.
32
+ - `src/config/ConfigDefaults.ts`, `src/core/types.ts`, `src/commands/server.ts` — the
33
+ config default, type, and constructor wiring.
34
+
35
+ The watchdog runs only where the parent green-PR watcher already runs (a maintainer/dev
36
+ agent with an analyzable instar repo + safe-merge); on every other install it is inert,
37
+ exactly like the parent feature.
38
+
39
+ ## What to Tell Your User
40
+
41
+ - **A pull request of mine that gets stuck RED now surfaces itself.** "If one of my own PRs
42
+ has a required check that keeps failing for more than a couple of hours, I'll raise a
43
+ single quiet heads-up in your attention queue — naming the PR, how long it has been red,
44
+ and which checks are failing — instead of it silently sitting there unmerged. You get one
45
+ item per stuck PR, not a stream; it updates as the PR ages, and it clears itself the moment
46
+ the PR goes green, merges, or closes." This only applies on the maintainer agent that runs
47
+ green-PR auto-merge; it never merges or closes anything on its own — it just tells you.
48
+ - **A subtle merge bug got fixed too.** A PR whose failed check was later re-run green used
49
+ to still read as failed — which could stop it from auto-merging. Now the newest run of
50
+ each check wins, so a re-run-green PR is correctly seen as green.
51
+
52
+ ## Summary of New Capabilities
53
+
54
+ | Capability | How to Use |
55
+ |-----------|-----------|
56
+ | A self-authored PR stuck RED past 2h raises ONE deduped attention line | Automatic wherever `monitoring.greenPrAutoMerge` is enabled |
57
+ | See which of my PRs are flagged red and for how long | `GET /green-pr-automerge` → `stuckRed[]` + `redPrWatchdog` |
58
+ | Tune the "stuck" threshold or turn the watchdog off | `monitoring.greenPrAutoMerge.redPrWatchdog` = `{ enabled, redThresholdMs }` |
59
+ | Re-run-green PRs are no longer misread as failed | Automatic (`deriveRollup` latest-run dedup) |
60
+
61
+ ## Evidence
62
+
63
+ - Unit (`tests/unit/green-pr-red-watchdog.test.ts`, 24): the pure helpers on both sides —
64
+ `latestRunPerCheck` keeps the newest run per check; `failingChecksFromRollup` /
65
+ `stuckRedChecks` flag past-threshold failures and skip fresh / unknown-time ones; the
66
+ `deriveRollup` latest-run-dedup regression (stale FAILED + later passing re-run → SUCCESS,
67
+ not FAILURE); and the orchestrator pass cases (a) raises one line past threshold, (b) none
68
+ below threshold, (c) re-run-green not stuck, (d) same PR two ticks → ONE item, (e) green →
69
+ none, (f) not-authored-by-me skipped, plus recovery/close clears, age-escalation re-raise,
70
+ disabled no-op, and the `redPrWatchdogView` read surface.
71
+ - Unit (existing `green-pr-logic` / `green-pr-automerger` / `green-pr-automerge-wiring` /
72
+ `green-pr-layer2`, 92): unchanged behavior for single-run rollups — no regression.
73
+ - Integration (`tests/integration/green-pr-automerge-routes.test.ts`, +2): `GET
74
+ /green-pr-automerge` surfaces `redPrWatchdog` config + an empty `stuckRed[]` when nothing
75
+ is red (feature-alive), and populates `stuckRed[]` after a tick over a stuck-red PR.
76
+ - `npx tsc --noEmit` clean; the dark-gate ConfigDefaults line-map snapshot updated for the
77
+ +4 line shift (no new/removed dark features).
@@ -0,0 +1,19 @@
1
+ # Side-Effects Review — AgentWorktreeReaper TOCTOU fix
2
+
3
+ **Slug:** reaper-toctou-fix · **Tier:** 1 (small, pure safety tightening) · **Author:** echo · 2026-07-09
4
+
5
+ ## Phase 1 — Principle check (signal vs authority)
6
+ The AgentWorktreeReaper IS a decision authority (it deletes worktrees). This change does NOT add new brittle blocking authority — it adds MORE signal re-checks (live branch/clean/in-use/merged + a build marker) BEFORE the existing authority acts, and only ever moves the verdict toward KEEP. It feeds the existing delete-authority with fresher signals; it never blocks anything new. Compliant — strictly safer.
7
+
8
+ ## Phase 4 — Side-effects review (all 8)
9
+ 1. **Over-block** — Could KEEP a genuinely-reapable worktree if a signal transiently flips (a momentary lock, a slow git read). Harmless + self-correcting: KEEP means "not deleted this pass"; it's re-evaluated next pass. No data loss, ever. This is the intended safe direction.
10
+ 2. **Under-block** — Residual: a builder that checks out the SAME branch name with NEW commits between eval and reclaim → currentBranch matches, but the isMerged RE-CHECK against the current branch catches the new (unmerged) commits → keep. A micro-window between the currentBranch read and `git worktree remove` remains, but `removeWorktree` is NON-forced (refuses a dirty/locked worktree) — a second, independent guard on the actual delete. Acceptable.
11
+ 3. **Level-of-abstraction fit** — Correct layer. The reaper owns the reap decision; the re-validation belongs exactly at its reclaim point (not a higher/lower layer). No smarter existing gate to feed.
12
+ 4. **Signal vs authority** — See Phase 1. The change adds signals to make an existing authority more conservative. No new brittle authority. Ref docs/signal-vs-authority.md.
13
+ 5. **Interactions** — Runs AFTER the per-path reclaim-failure breaker and the maxReapsPerPass cap, immediately BEFORE removeWorktree. Does not shadow or double-fire with them. Adds one `reclaim-raced` event (observability). The mutated evaluation (reap-eligible→keep on race) is the same object already pushed to `evaluations`, so the reap-log/pass event reports the honest raced verdict.
14
+ 6. **External surfaces** — No API/other-agent/other-user surface change. The verdict/reap-log gains new `raced-*` reasons (pure observability). New OPTIONAL file convention: a `.instar-build-active` marker a builder may drop at a worktree root to claim it; absence = today's behavior.
15
+ 7. **Multi-machine posture** — MACHINE-LOCAL BY DESIGN. Each machine's reaper operates only on ITS OWN `.worktrees/` (worktrees are physical checkouts on one disk); currentBranch (local git) and the marker (local fs) are inherently local. No replication needed or wanted — a worktree cannot exist on two machines.
16
+ 8. **Rollback cost** — Trivial. Additive change (2 injected deps + 1 guard method + the re-validation call). No config, no migration, no persisted state. Back-out = revert the commit.
17
+
18
+ ## Phase 5 — Second-pass (inline; this fork cannot spawn a subagent)
19
+ Independent adversarial re-read: (a) Could the guard ever make the reaper MORE aggressive? No — every branch of `reclaimRaceGuard` returns a KEEP reason or null; it can only subtract reaps. (b) Could a throw in the guard cause a reap? No — the guard's try/catch returns `reclaim-recheck-error` (KEEP) on any throw. (c) Does the null-branch fail-closed hold? Yes — a null live branch ≠ a non-null info.branch (info.branch is always non-null at reclaim, since evaluate keeps on !info.branch) → raced → keep; test pins this. (d) Marker fail-closed: an fs error reading the marker returns true (KEEP). **Concur with the review** — the change is delete-safe by construction; no concern raised.