instar 0.28.77 → 0.28.78

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 (46) hide show
  1. package/dashboard/index.html +184 -4
  2. package/dist/commands/server.d.ts.map +1 -1
  3. package/dist/commands/server.js +46 -2
  4. package/dist/commands/server.js.map +1 -1
  5. package/dist/monitoring/TokenLedger.d.ts +39 -0
  6. package/dist/monitoring/TokenLedger.d.ts.map +1 -1
  7. package/dist/monitoring/TokenLedger.js +110 -13
  8. package/dist/monitoring/TokenLedger.js.map +1 -1
  9. package/dist/monitoring/TokenLedgerPoller.d.ts.map +1 -1
  10. package/dist/monitoring/TokenLedgerPoller.js +8 -8
  11. package/dist/monitoring/TokenLedgerPoller.js.map +1 -1
  12. package/dist/server/AgentServer.d.ts +4 -0
  13. package/dist/server/AgentServer.d.ts.map +1 -1
  14. package/dist/server/AgentServer.js +14 -1
  15. package/dist/server/AgentServer.js.map +1 -1
  16. package/dist/server/routes.d.ts +8 -1
  17. package/dist/server/routes.d.ts.map +1 -1
  18. package/dist/server/routes.js +98 -0
  19. package/dist/server/routes.js.map +1 -1
  20. package/dist/threadline/BackfillCore.d.ts +70 -0
  21. package/dist/threadline/BackfillCore.d.ts.map +1 -0
  22. package/dist/threadline/BackfillCore.js +117 -0
  23. package/dist/threadline/BackfillCore.js.map +1 -0
  24. package/dist/threadline/ListenerSessionManager.d.ts +35 -0
  25. package/dist/threadline/ListenerSessionManager.d.ts.map +1 -1
  26. package/dist/threadline/ListenerSessionManager.js +41 -0
  27. package/dist/threadline/ListenerSessionManager.js.map +1 -1
  28. package/dist/threadline/TelegramBridge.d.ts +140 -0
  29. package/dist/threadline/TelegramBridge.d.ts.map +1 -0
  30. package/dist/threadline/TelegramBridge.js +224 -0
  31. package/dist/threadline/TelegramBridge.js.map +1 -0
  32. package/dist/threadline/ThreadlineMCPServer.d.ts.map +1 -1
  33. package/dist/threadline/ThreadlineMCPServer.js +5 -0
  34. package/dist/threadline/ThreadlineMCPServer.js.map +1 -1
  35. package/dist/threadline/ThreadlineObservability.d.ts +95 -0
  36. package/dist/threadline/ThreadlineObservability.d.ts.map +1 -0
  37. package/dist/threadline/ThreadlineObservability.js +310 -0
  38. package/dist/threadline/ThreadlineObservability.js.map +1 -0
  39. package/package.json +1 -1
  40. package/scripts/threadline-bridge-backfill.mjs +379 -0
  41. package/src/data/builtin-manifest.json +47 -47
  42. package/upgrades/0.28.78.md +90 -0
  43. package/upgrades/side-effects/threadline-bridge-backfill.md +203 -0
  44. package/upgrades/side-effects/threadline-observability-tab.md +206 -0
  45. package/upgrades/side-effects/threadline-tg-bridge-module.md +196 -0
  46. package/upgrades/side-effects/token-ledger-bounded-scan.md +230 -0
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-05-02T01:08:33.142Z",
5
- "instarVersion": "0.28.77",
4
+ "generatedAt": "2026-05-02T05:23:38.389Z",
5
+ "instarVersion": "0.28.78",
6
6
  "entryCount": 187,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -384,7 +384,7 @@
384
384
  "type": "route-group",
385
385
  "domain": "monitoring",
386
386
  "sourcePath": "src/server/routes.ts",
387
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
387
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
388
388
  "since": "2025-01-01"
389
389
  },
390
390
  "route-group:agents": {
@@ -392,7 +392,7 @@
392
392
  "type": "route-group",
393
393
  "domain": "sessions",
394
394
  "sourcePath": "src/server/routes.ts",
395
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
395
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
396
396
  "since": "2025-01-01"
397
397
  },
398
398
  "route-group:backups": {
@@ -400,7 +400,7 @@
400
400
  "type": "route-group",
401
401
  "domain": "operations",
402
402
  "sourcePath": "src/server/routes.ts",
403
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
403
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
404
404
  "since": "2025-01-01"
405
405
  },
406
406
  "route-group:git": {
@@ -408,7 +408,7 @@
408
408
  "type": "route-group",
409
409
  "domain": "coordination",
410
410
  "sourcePath": "src/server/routes.ts",
411
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
411
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
412
412
  "since": "2025-01-01"
413
413
  },
414
414
  "route-group:memory": {
@@ -416,7 +416,7 @@
416
416
  "type": "route-group",
417
417
  "domain": "memory",
418
418
  "sourcePath": "src/server/routes.ts",
419
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
419
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
420
420
  "since": "2025-01-01"
421
421
  },
422
422
  "route-group:semantic": {
@@ -424,7 +424,7 @@
424
424
  "type": "route-group",
425
425
  "domain": "memory",
426
426
  "sourcePath": "src/server/routes.ts",
427
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
427
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
428
428
  "since": "2025-01-01"
429
429
  },
430
430
  "route-group:status": {
@@ -432,7 +432,7 @@
432
432
  "type": "route-group",
433
433
  "domain": "monitoring",
434
434
  "sourcePath": "src/server/routes.ts",
435
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
435
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
436
436
  "since": "2025-01-01"
437
437
  },
438
438
  "route-group:capabilities": {
@@ -440,7 +440,7 @@
440
440
  "type": "route-group",
441
441
  "domain": "mapping",
442
442
  "sourcePath": "src/server/routes.ts",
443
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
443
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
444
444
  "since": "2025-01-01"
445
445
  },
446
446
  "route-group:project-map": {
@@ -448,7 +448,7 @@
448
448
  "type": "route-group",
449
449
  "domain": "mapping",
450
450
  "sourcePath": "src/server/routes.ts",
451
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
451
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
452
452
  "since": "2025-01-01"
453
453
  },
454
454
  "route-group:coherence": {
@@ -456,7 +456,7 @@
456
456
  "type": "route-group",
457
457
  "domain": "coherence",
458
458
  "sourcePath": "src/server/routes.ts",
459
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
459
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
460
460
  "since": "2025-01-01"
461
461
  },
462
462
  "route-group:topic-bindings": {
@@ -464,7 +464,7 @@
464
464
  "type": "route-group",
465
465
  "domain": "sessions",
466
466
  "sourcePath": "src/server/routes.ts",
467
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
467
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
468
468
  "since": "2025-01-01"
469
469
  },
470
470
  "route-group:context": {
@@ -472,7 +472,7 @@
472
472
  "type": "route-group",
473
473
  "domain": "context",
474
474
  "sourcePath": "src/server/routes.ts",
475
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
475
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
476
476
  "since": "2025-01-01"
477
477
  },
478
478
  "route-group:scope-coherence": {
@@ -480,7 +480,7 @@
480
480
  "type": "route-group",
481
481
  "domain": "coherence",
482
482
  "sourcePath": "src/server/routes.ts",
483
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
483
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
484
484
  "since": "2025-01-01"
485
485
  },
486
486
  "route-group:canonical-state": {
@@ -488,7 +488,7 @@
488
488
  "type": "route-group",
489
489
  "domain": "state",
490
490
  "sourcePath": "src/server/routes.ts",
491
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
491
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
492
492
  "since": "2025-01-01"
493
493
  },
494
494
  "route-group:ci": {
@@ -496,7 +496,7 @@
496
496
  "type": "route-group",
497
497
  "domain": "monitoring",
498
498
  "sourcePath": "src/server/routes.ts",
499
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
499
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
500
500
  "since": "2025-01-01"
501
501
  },
502
502
  "route-group:sessions": {
@@ -504,7 +504,7 @@
504
504
  "type": "route-group",
505
505
  "domain": "sessions",
506
506
  "sourcePath": "src/server/routes.ts",
507
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
507
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
508
508
  "since": "2025-01-01"
509
509
  },
510
510
  "route-group:jobs": {
@@ -512,7 +512,7 @@
512
512
  "type": "route-group",
513
513
  "domain": "scheduling",
514
514
  "sourcePath": "src/server/routes.ts",
515
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
515
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
516
516
  "since": "2025-01-01"
517
517
  },
518
518
  "route-group:skip-ledger": {
@@ -520,7 +520,7 @@
520
520
  "type": "route-group",
521
521
  "domain": "scheduling",
522
522
  "sourcePath": "src/server/routes.ts",
523
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
523
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
524
524
  "since": "2025-01-01"
525
525
  },
526
526
  "route-group:telegram": {
@@ -528,7 +528,7 @@
528
528
  "type": "route-group",
529
529
  "domain": "communication",
530
530
  "sourcePath": "src/server/routes.ts",
531
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
531
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
532
532
  "since": "2025-01-01"
533
533
  },
534
534
  "route-group:attention": {
@@ -536,7 +536,7 @@
536
536
  "type": "route-group",
537
537
  "domain": "communication",
538
538
  "sourcePath": "src/server/routes.ts",
539
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
539
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
540
540
  "since": "2025-01-01"
541
541
  },
542
542
  "route-group:relationships": {
@@ -544,7 +544,7 @@
544
544
  "type": "route-group",
545
545
  "domain": "relationships",
546
546
  "sourcePath": "src/server/routes.ts",
547
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
547
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
548
548
  "since": "2025-01-01"
549
549
  },
550
550
  "route-group:feedback": {
@@ -552,7 +552,7 @@
552
552
  "type": "route-group",
553
553
  "domain": "feedback",
554
554
  "sourcePath": "src/server/routes.ts",
555
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
555
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
556
556
  "since": "2025-01-01"
557
557
  },
558
558
  "route-group:updates": {
@@ -560,7 +560,7 @@
560
560
  "type": "route-group",
561
561
  "domain": "updates",
562
562
  "sourcePath": "src/server/routes.ts",
563
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
563
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
564
564
  "since": "2025-01-01"
565
565
  },
566
566
  "route-group:dispatches": {
@@ -568,7 +568,7 @@
568
568
  "type": "route-group",
569
569
  "domain": "dispatches",
570
570
  "sourcePath": "src/server/routes.ts",
571
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
571
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
572
572
  "since": "2025-01-01"
573
573
  },
574
574
  "route-group:quota": {
@@ -576,7 +576,7 @@
576
576
  "type": "route-group",
577
577
  "domain": "monitoring",
578
578
  "sourcePath": "src/server/routes.ts",
579
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
579
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
580
580
  "since": "2025-01-01"
581
581
  },
582
582
  "route-group:publishing": {
@@ -584,7 +584,7 @@
584
584
  "type": "route-group",
585
585
  "domain": "publishing",
586
586
  "sourcePath": "src/server/routes.ts",
587
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
587
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
588
588
  "since": "2025-01-01"
589
589
  },
590
590
  "route-group:private-views": {
@@ -592,7 +592,7 @@
592
592
  "type": "route-group",
593
593
  "domain": "publishing",
594
594
  "sourcePath": "src/server/routes.ts",
595
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
595
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
596
596
  "since": "2025-01-01"
597
597
  },
598
598
  "route-group:tunnel": {
@@ -600,7 +600,7 @@
600
600
  "type": "route-group",
601
601
  "domain": "networking",
602
602
  "sourcePath": "src/server/routes.ts",
603
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
603
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
604
604
  "since": "2025-01-01"
605
605
  },
606
606
  "route-group:events": {
@@ -608,7 +608,7 @@
608
608
  "type": "route-group",
609
609
  "domain": "networking",
610
610
  "sourcePath": "src/server/routes.ts",
611
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
611
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
612
612
  "since": "2025-01-01"
613
613
  },
614
614
  "route-group:evolution": {
@@ -616,7 +616,7 @@
616
616
  "type": "route-group",
617
617
  "domain": "evolution",
618
618
  "sourcePath": "src/server/routes.ts",
619
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
619
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
620
620
  "since": "2025-01-01"
621
621
  },
622
622
  "route-group:watchdog": {
@@ -624,7 +624,7 @@
624
624
  "type": "route-group",
625
625
  "domain": "monitoring",
626
626
  "sourcePath": "src/server/routes.ts",
627
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
627
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
628
628
  "since": "2025-01-01"
629
629
  },
630
630
  "route-group:topic-memory": {
@@ -632,7 +632,7 @@
632
632
  "type": "route-group",
633
633
  "domain": "memory",
634
634
  "sourcePath": "src/server/routes.ts",
635
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
635
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
636
636
  "since": "2025-01-01"
637
637
  },
638
638
  "route-group:state-sync": {
@@ -640,7 +640,7 @@
640
640
  "type": "route-group",
641
641
  "domain": "coordination",
642
642
  "sourcePath": "src/server/routes.ts",
643
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
643
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
644
644
  "since": "2025-01-01"
645
645
  },
646
646
  "route-group:intent": {
@@ -648,7 +648,7 @@
648
648
  "type": "route-group",
649
649
  "domain": "intent",
650
650
  "sourcePath": "src/server/routes.ts",
651
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
651
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
652
652
  "since": "2025-01-01"
653
653
  },
654
654
  "route-group:triage": {
@@ -656,7 +656,7 @@
656
656
  "type": "route-group",
657
657
  "domain": "safety",
658
658
  "sourcePath": "src/server/routes.ts",
659
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
659
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
660
660
  "since": "2025-01-01"
661
661
  },
662
662
  "route-group:operations": {
@@ -664,7 +664,7 @@
664
664
  "type": "route-group",
665
665
  "domain": "safety",
666
666
  "sourcePath": "src/server/routes.ts",
667
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
667
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
668
668
  "since": "2025-01-01"
669
669
  },
670
670
  "route-group:sentinel": {
@@ -672,7 +672,7 @@
672
672
  "type": "route-group",
673
673
  "domain": "safety",
674
674
  "sourcePath": "src/server/routes.ts",
675
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
675
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
676
676
  "since": "2025-01-01"
677
677
  },
678
678
  "route-group:trust": {
@@ -680,7 +680,7 @@
680
680
  "type": "route-group",
681
681
  "domain": "safety",
682
682
  "sourcePath": "src/server/routes.ts",
683
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
683
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
684
684
  "since": "2025-01-01"
685
685
  },
686
686
  "route-group:monitoring": {
@@ -688,7 +688,7 @@
688
688
  "type": "route-group",
689
689
  "domain": "monitoring",
690
690
  "sourcePath": "src/server/routes.ts",
691
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
691
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
692
692
  "since": "2025-01-01"
693
693
  },
694
694
  "route-group:commitments": {
@@ -696,7 +696,7 @@
696
696
  "type": "route-group",
697
697
  "domain": "commitments",
698
698
  "sourcePath": "src/server/routes.ts",
699
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
699
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
700
700
  "since": "2025-01-01"
701
701
  },
702
702
  "route-group:episodes": {
@@ -704,7 +704,7 @@
704
704
  "type": "route-group",
705
705
  "domain": "memory",
706
706
  "sourcePath": "src/server/routes.ts",
707
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
707
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
708
708
  "since": "2025-01-01"
709
709
  },
710
710
  "route-group:messages": {
@@ -712,7 +712,7 @@
712
712
  "type": "route-group",
713
713
  "domain": "coordination",
714
714
  "sourcePath": "src/server/routes.ts",
715
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
715
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
716
716
  "since": "2025-01-01"
717
717
  },
718
718
  "route-group:system-reviews": {
@@ -720,7 +720,7 @@
720
720
  "type": "route-group",
721
721
  "domain": "monitoring",
722
722
  "sourcePath": "src/server/routes.ts",
723
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
723
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
724
724
  "since": "2025-01-01"
725
725
  },
726
726
  "route-group:machine-mesh": {
@@ -736,7 +736,7 @@
736
736
  "type": "route-group",
737
737
  "domain": "security",
738
738
  "sourcePath": "src/server/routes.ts",
739
- "contentHash": "674740fc474b7f7a63823a80418a84e14e298772bca3e9209e54d5d53467160e",
739
+ "contentHash": "2f75380a8bf19777fb1e44a1d80a728c7b0747ba06c266fcc4f5f3887afdd251",
740
740
  "since": "2025-01-01"
741
741
  },
742
742
  "cli:init": {
@@ -1408,7 +1408,7 @@
1408
1408
  "type": "subsystem",
1409
1409
  "domain": "server",
1410
1410
  "sourcePath": "src/server/AgentServer.ts",
1411
- "contentHash": "04480cb37014c2b3791a8135eb14102b9755e7ac4ce5466fc8fb9725477726c7",
1411
+ "contentHash": "699f34ca3364384b00a722407aa728d529dc869c2c4947200fed5753a3b52a3e",
1412
1412
  "since": "2025-01-01"
1413
1413
  },
1414
1414
  "subsystem:session-manager": {
@@ -0,0 +1,90 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ The Token Ledger (shipped in v0.28.77 as Phase 1 read-only token-usage
8
+ observability) had an unbounded synchronous first scan. On agents with
9
+ deep Claude Code history this blocked the Node event loop for minutes —
10
+ one local agent had 119,130 JSONL transcripts totaling 12 GB, and on
11
+ boot the server stopped responding to its own `/health` endpoint, which
12
+ caused the lifeline supervisor to declare the agent dead and restart it
13
+ in a loop.
14
+
15
+ This release bounds the scan in three independent ways:
16
+
17
+ 1. **Per-tick file cap** (default 500) with a persistent in-memory
18
+ cursor across ticks. The first poll backfills 500 files; the next
19
+ poll picks up where the previous one stopped; once the tree is fully
20
+ walked the cursor wraps back to the start so newly-written sessions
21
+ are still picked up.
22
+ 2. **Intra-tick yielding** (default every 25 files) via `setImmediate`.
23
+ Even within a single tick the event loop gets to drain HTTP and
24
+ health-check traffic — the server stays responsive while the ledger
25
+ is doing its work.
26
+ 3. **Optional max file age** (default 30 days at the wiring layer). The
27
+ ledger ignores transcripts whose mtime is older than the backfill
28
+ window. Active sessions are never blackholed: appending a new turn
29
+ updates the file's mtime, which brings it back into the window. The
30
+ source JSONLs in `~/.claude/projects/` remain the ground truth, so an
31
+ operator can widen the window later by passing a larger
32
+ `maxFileAgeMs` and the ledger will pick up the older data on the
33
+ next scan.
34
+
35
+ A new `scanAllAsync()` method is the path the poller now uses; the
36
+ original `scanAll()` sync entry point is preserved for tests and any
37
+ caller that doesn't need yielding (and now honors the per-tick cap and
38
+ age cutoff too).
39
+
40
+ No schema migration. No new routes. No new external surfaces. Pure
41
+ containment fix for the v0.28.77 regression.
42
+
43
+ ## What to Tell Your User
44
+
45
+ - **Quieter, more reliable startup with the new Tokens tab**: I no
46
+ longer get stuck staring at years of old session transcripts on boot.
47
+ When I start up, I look at the most recent month of activity first,
48
+ in small batches, and I keep answering you in between batches. The
49
+ Tokens tab will fill in over the first few minutes instead of being
50
+ empty until everything has been read at once.
51
+
52
+ ## Summary of New Capabilities
53
+
54
+ | Capability | How to Use |
55
+ |-----------|-----------|
56
+ | Bounded first-boot scan of the token ledger | Automatic on upgrade |
57
+ | Configurable backfill window for the token ledger | Pass `maxFileAgeMs` to TokenLedger constructor (defaults to 30 days at the wiring layer) |
58
+ | Per-tick scan cap and event-loop yielding | Automatic on upgrade |
59
+
60
+ ## Evidence
61
+
62
+ Reproduction (before fix):
63
+
64
+ 1. Start v0.28.77 on a host with deep Claude Code history (the local
65
+ reproduction host had 119,130 JSONL files / 12 GB under
66
+ `~/.claude/projects/`).
67
+ 2. `curl -m 5 http://localhost:4042/health` hangs — connection accepted
68
+ but no response within timeout.
69
+ 3. `sample <pid> 1` shows the main thread spending 100% of its time in
70
+ `uv_fs_stat` callbacks under
71
+ `Builtins_InterpreterEntryTrampoline` — a JS loop hammering the
72
+ filesystem with no event-loop yields.
73
+ 4. The lifeline supervisor's health probe times out, declares the
74
+ server unhealthy, and restarts it. The next boot starts the same
75
+ scan over again.
76
+
77
+ After fix:
78
+
79
+ 1. Same host, same `~/.claude/projects/` tree. Server boots and
80
+ `curl http://localhost:4042/health` returns a normal JSON response
81
+ within a few hundred ms.
82
+ 2. `curl http://localhost:4042/tokens/summary` returns valid JSON
83
+ immediately (initially with a small subset of recent sessions).
84
+ Subsequent ticks fill in the rest of the 30-day window.
85
+ 3. The lifeline supervisor sees a healthy server and stops restarting.
86
+
87
+ Unit tests: `tests/unit/token-ledger.test.ts` — 15/15 passing locally
88
+ on the `fix/token-ledger-bounded-scan` branch. Three new tests cover
89
+ the cursor resume, age cutoff, and async yielding behavior. Typecheck
90
+ clean (`npx tsc --noEmit`).