instar 1.3.199 → 1.3.201

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 (35) hide show
  1. package/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh +21 -2
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +30 -0
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/core/AutonomousSessions.d.ts +2 -0
  6. package/dist/core/AutonomousSessions.d.ts.map +1 -1
  7. package/dist/core/AutonomousSessions.js +2 -0
  8. package/dist/core/AutonomousSessions.js.map +1 -1
  9. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  10. package/dist/core/PostUpdateMigrator.js +51 -10
  11. package/dist/core/PostUpdateMigrator.js.map +1 -1
  12. package/dist/core/SessionClock.d.ts +57 -0
  13. package/dist/core/SessionClock.d.ts.map +1 -0
  14. package/dist/core/SessionClock.js +128 -0
  15. package/dist/core/SessionClock.js.map +1 -0
  16. package/dist/core/SessionClockReader.d.ts +18 -0
  17. package/dist/core/SessionClockReader.d.ts.map +1 -0
  18. package/dist/core/SessionClockReader.js +35 -0
  19. package/dist/core/SessionClockReader.js.map +1 -0
  20. package/dist/scaffold/templates.d.ts.map +1 -1
  21. package/dist/scaffold/templates.js +5 -0
  22. package/dist/scaffold/templates.js.map +1 -1
  23. package/dist/server/routes.d.ts.map +1 -1
  24. package/dist/server/routes.js +19 -0
  25. package/dist/server/routes.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/data/builtin-manifest.json +71 -63
  28. package/src/scaffold/templates.ts +5 -0
  29. package/src/templates/scripts/emit-session-clock.sh +78 -0
  30. package/upgrades/1.3.200.md +25 -0
  31. package/upgrades/1.3.201.md +46 -0
  32. package/upgrades/side-effects/session-clock-step1.md +52 -0
  33. package/upgrades/side-effects/session-clock-step2a.md +52 -0
  34. package/upgrades/side-effects/session-clock-step2b.md +49 -0
  35. package/upgrades/side-effects/session-clock-step2c.md +32 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.199",
3
+ "version": "1.3.201",
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,9 +1,9 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-02T05:51:49.340Z",
5
- "instarVersion": "1.3.199",
6
- "entryCount": 193,
4
+ "generatedAt": "2026-06-02T07:52:52.700Z",
5
+ "instarVersion": "1.3.201",
6
+ "entryCount": 194,
7
7
  "entries": {
8
8
  "hook:session-start": {
9
9
  "id": "hook:session-start",
@@ -11,7 +11,7 @@
11
11
  "domain": "identity",
12
12
  "sourcePath": "src/core/PostUpdateMigrator.ts",
13
13
  "installedPath": ".instar/hooks/instar/session-start.sh",
14
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
14
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
15
15
  "since": "2025-01-01"
16
16
  },
17
17
  "hook:dangerous-command-guard": {
@@ -20,7 +20,7 @@
20
20
  "domain": "safety",
21
21
  "sourcePath": "src/core/PostUpdateMigrator.ts",
22
22
  "installedPath": ".instar/hooks/instar/dangerous-command-guard.sh",
23
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
23
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
24
24
  "since": "2025-01-01"
25
25
  },
26
26
  "hook:grounding-before-messaging": {
@@ -29,7 +29,7 @@
29
29
  "domain": "safety",
30
30
  "sourcePath": "src/core/PostUpdateMigrator.ts",
31
31
  "installedPath": ".instar/hooks/instar/grounding-before-messaging.sh",
32
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
32
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
33
33
  "since": "2025-01-01"
34
34
  },
35
35
  "hook:compaction-recovery": {
@@ -38,7 +38,7 @@
38
38
  "domain": "identity",
39
39
  "sourcePath": "src/core/PostUpdateMigrator.ts",
40
40
  "installedPath": ".instar/hooks/instar/compaction-recovery.sh",
41
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
41
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
42
42
  "since": "2025-01-01"
43
43
  },
44
44
  "hook:external-operation-gate": {
@@ -47,7 +47,7 @@
47
47
  "domain": "safety",
48
48
  "sourcePath": "src/core/PostUpdateMigrator.ts",
49
49
  "installedPath": ".instar/hooks/instar/external-operation-gate.js",
50
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
50
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
51
51
  "since": "2025-01-01"
52
52
  },
53
53
  "hook:deferral-detector": {
@@ -56,7 +56,7 @@
56
56
  "domain": "safety",
57
57
  "sourcePath": "src/core/PostUpdateMigrator.ts",
58
58
  "installedPath": ".instar/hooks/instar/deferral-detector.js",
59
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
59
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
60
60
  "since": "2025-01-01"
61
61
  },
62
62
  "hook:post-action-reflection": {
@@ -65,7 +65,7 @@
65
65
  "domain": "evolution",
66
66
  "sourcePath": "src/core/PostUpdateMigrator.ts",
67
67
  "installedPath": ".instar/hooks/instar/post-action-reflection.js",
68
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
68
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
69
69
  "since": "2025-01-01"
70
70
  },
71
71
  "hook:external-communication-guard": {
@@ -74,7 +74,7 @@
74
74
  "domain": "safety",
75
75
  "sourcePath": "src/core/PostUpdateMigrator.ts",
76
76
  "installedPath": ".instar/hooks/instar/external-communication-guard.js",
77
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
77
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
78
78
  "since": "2025-01-01"
79
79
  },
80
80
  "hook:scope-coherence-collector": {
@@ -83,7 +83,7 @@
83
83
  "domain": "coherence",
84
84
  "sourcePath": "src/core/PostUpdateMigrator.ts",
85
85
  "installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
86
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
86
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
87
87
  "since": "2025-01-01"
88
88
  },
89
89
  "hook:scope-coherence-checkpoint": {
@@ -92,7 +92,7 @@
92
92
  "domain": "coherence",
93
93
  "sourcePath": "src/core/PostUpdateMigrator.ts",
94
94
  "installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
95
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
95
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
96
96
  "since": "2025-01-01"
97
97
  },
98
98
  "hook:free-text-guard": {
@@ -101,7 +101,7 @@
101
101
  "domain": "safety",
102
102
  "sourcePath": "src/core/PostUpdateMigrator.ts",
103
103
  "installedPath": ".instar/hooks/instar/free-text-guard.sh",
104
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
104
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
105
105
  "since": "2025-01-01"
106
106
  },
107
107
  "hook:claim-intercept": {
@@ -110,7 +110,7 @@
110
110
  "domain": "coherence",
111
111
  "sourcePath": "src/core/PostUpdateMigrator.ts",
112
112
  "installedPath": ".instar/hooks/instar/claim-intercept.js",
113
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
113
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
114
114
  "since": "2025-01-01"
115
115
  },
116
116
  "hook:claim-intercept-response": {
@@ -119,7 +119,7 @@
119
119
  "domain": "coherence",
120
120
  "sourcePath": "src/core/PostUpdateMigrator.ts",
121
121
  "installedPath": ".instar/hooks/instar/claim-intercept-response.js",
122
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
122
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
123
123
  "since": "2025-01-01"
124
124
  },
125
125
  "hook:stop-gate-router": {
@@ -128,7 +128,7 @@
128
128
  "domain": "safety",
129
129
  "sourcePath": "src/core/PostUpdateMigrator.ts",
130
130
  "installedPath": ".instar/hooks/instar/stop-gate-router.js",
131
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
131
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
132
132
  "since": "2025-01-01"
133
133
  },
134
134
  "hook:auto-approve-permissions": {
@@ -137,7 +137,7 @@
137
137
  "domain": "safety",
138
138
  "sourcePath": "src/core/PostUpdateMigrator.ts",
139
139
  "installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
140
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
140
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
141
141
  "since": "2025-01-01"
142
142
  },
143
143
  "job:health-check": {
@@ -409,7 +409,7 @@
409
409
  "type": "route-group",
410
410
  "domain": "monitoring",
411
411
  "sourcePath": "src/server/routes.ts",
412
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
412
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
413
413
  "since": "2025-01-01"
414
414
  },
415
415
  "route-group:agents": {
@@ -417,7 +417,7 @@
417
417
  "type": "route-group",
418
418
  "domain": "sessions",
419
419
  "sourcePath": "src/server/routes.ts",
420
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
420
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
421
421
  "since": "2025-01-01"
422
422
  },
423
423
  "route-group:backups": {
@@ -425,7 +425,7 @@
425
425
  "type": "route-group",
426
426
  "domain": "operations",
427
427
  "sourcePath": "src/server/routes.ts",
428
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
428
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
429
429
  "since": "2025-01-01"
430
430
  },
431
431
  "route-group:git": {
@@ -433,7 +433,7 @@
433
433
  "type": "route-group",
434
434
  "domain": "coordination",
435
435
  "sourcePath": "src/server/routes.ts",
436
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
436
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
437
437
  "since": "2025-01-01"
438
438
  },
439
439
  "route-group:memory": {
@@ -441,7 +441,7 @@
441
441
  "type": "route-group",
442
442
  "domain": "memory",
443
443
  "sourcePath": "src/server/routes.ts",
444
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
444
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
445
445
  "since": "2025-01-01"
446
446
  },
447
447
  "route-group:semantic": {
@@ -449,7 +449,7 @@
449
449
  "type": "route-group",
450
450
  "domain": "memory",
451
451
  "sourcePath": "src/server/routes.ts",
452
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
452
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
453
453
  "since": "2025-01-01"
454
454
  },
455
455
  "route-group:status": {
@@ -457,7 +457,7 @@
457
457
  "type": "route-group",
458
458
  "domain": "monitoring",
459
459
  "sourcePath": "src/server/routes.ts",
460
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
460
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
461
461
  "since": "2025-01-01"
462
462
  },
463
463
  "route-group:capabilities": {
@@ -465,7 +465,7 @@
465
465
  "type": "route-group",
466
466
  "domain": "mapping",
467
467
  "sourcePath": "src/server/routes.ts",
468
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
468
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
469
469
  "since": "2025-01-01"
470
470
  },
471
471
  "route-group:project-map": {
@@ -473,7 +473,7 @@
473
473
  "type": "route-group",
474
474
  "domain": "mapping",
475
475
  "sourcePath": "src/server/routes.ts",
476
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
476
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
477
477
  "since": "2025-01-01"
478
478
  },
479
479
  "route-group:coherence": {
@@ -481,7 +481,7 @@
481
481
  "type": "route-group",
482
482
  "domain": "coherence",
483
483
  "sourcePath": "src/server/routes.ts",
484
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
484
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
485
485
  "since": "2025-01-01"
486
486
  },
487
487
  "route-group:topic-bindings": {
@@ -489,7 +489,7 @@
489
489
  "type": "route-group",
490
490
  "domain": "sessions",
491
491
  "sourcePath": "src/server/routes.ts",
492
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
492
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
493
493
  "since": "2025-01-01"
494
494
  },
495
495
  "route-group:context": {
@@ -497,7 +497,7 @@
497
497
  "type": "route-group",
498
498
  "domain": "context",
499
499
  "sourcePath": "src/server/routes.ts",
500
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
500
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
501
501
  "since": "2025-01-01"
502
502
  },
503
503
  "route-group:scope-coherence": {
@@ -505,7 +505,7 @@
505
505
  "type": "route-group",
506
506
  "domain": "coherence",
507
507
  "sourcePath": "src/server/routes.ts",
508
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
508
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
509
509
  "since": "2025-01-01"
510
510
  },
511
511
  "route-group:canonical-state": {
@@ -513,7 +513,7 @@
513
513
  "type": "route-group",
514
514
  "domain": "state",
515
515
  "sourcePath": "src/server/routes.ts",
516
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
516
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
517
517
  "since": "2025-01-01"
518
518
  },
519
519
  "route-group:ci": {
@@ -521,7 +521,7 @@
521
521
  "type": "route-group",
522
522
  "domain": "monitoring",
523
523
  "sourcePath": "src/server/routes.ts",
524
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
524
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
525
525
  "since": "2025-01-01"
526
526
  },
527
527
  "route-group:sessions": {
@@ -529,7 +529,7 @@
529
529
  "type": "route-group",
530
530
  "domain": "sessions",
531
531
  "sourcePath": "src/server/routes.ts",
532
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
532
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
533
533
  "since": "2025-01-01"
534
534
  },
535
535
  "route-group:jobs": {
@@ -537,7 +537,7 @@
537
537
  "type": "route-group",
538
538
  "domain": "scheduling",
539
539
  "sourcePath": "src/server/routes.ts",
540
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
540
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
541
541
  "since": "2025-01-01"
542
542
  },
543
543
  "route-group:skip-ledger": {
@@ -545,7 +545,7 @@
545
545
  "type": "route-group",
546
546
  "domain": "scheduling",
547
547
  "sourcePath": "src/server/routes.ts",
548
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
548
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
549
549
  "since": "2025-01-01"
550
550
  },
551
551
  "route-group:telegram": {
@@ -553,7 +553,7 @@
553
553
  "type": "route-group",
554
554
  "domain": "communication",
555
555
  "sourcePath": "src/server/routes.ts",
556
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
556
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
557
557
  "since": "2025-01-01"
558
558
  },
559
559
  "route-group:attention": {
@@ -561,7 +561,7 @@
561
561
  "type": "route-group",
562
562
  "domain": "communication",
563
563
  "sourcePath": "src/server/routes.ts",
564
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
564
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
565
565
  "since": "2025-01-01"
566
566
  },
567
567
  "route-group:relationships": {
@@ -569,7 +569,7 @@
569
569
  "type": "route-group",
570
570
  "domain": "relationships",
571
571
  "sourcePath": "src/server/routes.ts",
572
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
572
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
573
573
  "since": "2025-01-01"
574
574
  },
575
575
  "route-group:feedback": {
@@ -577,7 +577,7 @@
577
577
  "type": "route-group",
578
578
  "domain": "feedback",
579
579
  "sourcePath": "src/server/routes.ts",
580
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
580
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
581
581
  "since": "2025-01-01"
582
582
  },
583
583
  "route-group:updates": {
@@ -585,7 +585,7 @@
585
585
  "type": "route-group",
586
586
  "domain": "updates",
587
587
  "sourcePath": "src/server/routes.ts",
588
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
588
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
589
589
  "since": "2025-01-01"
590
590
  },
591
591
  "route-group:dispatches": {
@@ -593,7 +593,7 @@
593
593
  "type": "route-group",
594
594
  "domain": "dispatches",
595
595
  "sourcePath": "src/server/routes.ts",
596
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
596
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
597
597
  "since": "2025-01-01"
598
598
  },
599
599
  "route-group:quota": {
@@ -601,7 +601,7 @@
601
601
  "type": "route-group",
602
602
  "domain": "monitoring",
603
603
  "sourcePath": "src/server/routes.ts",
604
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
604
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
605
605
  "since": "2025-01-01"
606
606
  },
607
607
  "route-group:publishing": {
@@ -609,7 +609,7 @@
609
609
  "type": "route-group",
610
610
  "domain": "publishing",
611
611
  "sourcePath": "src/server/routes.ts",
612
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
612
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
613
613
  "since": "2025-01-01"
614
614
  },
615
615
  "route-group:private-views": {
@@ -617,7 +617,7 @@
617
617
  "type": "route-group",
618
618
  "domain": "publishing",
619
619
  "sourcePath": "src/server/routes.ts",
620
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
620
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
621
621
  "since": "2025-01-01"
622
622
  },
623
623
  "route-group:tunnel": {
@@ -625,7 +625,7 @@
625
625
  "type": "route-group",
626
626
  "domain": "networking",
627
627
  "sourcePath": "src/server/routes.ts",
628
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
628
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
629
629
  "since": "2025-01-01"
630
630
  },
631
631
  "route-group:events": {
@@ -633,7 +633,7 @@
633
633
  "type": "route-group",
634
634
  "domain": "networking",
635
635
  "sourcePath": "src/server/routes.ts",
636
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
636
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
637
637
  "since": "2025-01-01"
638
638
  },
639
639
  "route-group:evolution": {
@@ -641,7 +641,7 @@
641
641
  "type": "route-group",
642
642
  "domain": "evolution",
643
643
  "sourcePath": "src/server/routes.ts",
644
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
644
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
645
645
  "since": "2025-01-01"
646
646
  },
647
647
  "route-group:watchdog": {
@@ -649,7 +649,7 @@
649
649
  "type": "route-group",
650
650
  "domain": "monitoring",
651
651
  "sourcePath": "src/server/routes.ts",
652
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
652
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
653
653
  "since": "2025-01-01"
654
654
  },
655
655
  "route-group:topic-memory": {
@@ -657,7 +657,7 @@
657
657
  "type": "route-group",
658
658
  "domain": "memory",
659
659
  "sourcePath": "src/server/routes.ts",
660
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
660
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
661
661
  "since": "2025-01-01"
662
662
  },
663
663
  "route-group:state-sync": {
@@ -665,7 +665,7 @@
665
665
  "type": "route-group",
666
666
  "domain": "coordination",
667
667
  "sourcePath": "src/server/routes.ts",
668
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
668
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
669
669
  "since": "2025-01-01"
670
670
  },
671
671
  "route-group:intent": {
@@ -673,7 +673,7 @@
673
673
  "type": "route-group",
674
674
  "domain": "intent",
675
675
  "sourcePath": "src/server/routes.ts",
676
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
676
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
677
677
  "since": "2025-01-01"
678
678
  },
679
679
  "route-group:triage": {
@@ -681,7 +681,7 @@
681
681
  "type": "route-group",
682
682
  "domain": "safety",
683
683
  "sourcePath": "src/server/routes.ts",
684
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
684
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
685
685
  "since": "2025-01-01"
686
686
  },
687
687
  "route-group:operations": {
@@ -689,7 +689,7 @@
689
689
  "type": "route-group",
690
690
  "domain": "safety",
691
691
  "sourcePath": "src/server/routes.ts",
692
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
692
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
693
693
  "since": "2025-01-01"
694
694
  },
695
695
  "route-group:sentinel": {
@@ -697,7 +697,7 @@
697
697
  "type": "route-group",
698
698
  "domain": "safety",
699
699
  "sourcePath": "src/server/routes.ts",
700
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
700
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
701
701
  "since": "2025-01-01"
702
702
  },
703
703
  "route-group:trust": {
@@ -705,7 +705,7 @@
705
705
  "type": "route-group",
706
706
  "domain": "safety",
707
707
  "sourcePath": "src/server/routes.ts",
708
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
708
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
709
709
  "since": "2025-01-01"
710
710
  },
711
711
  "route-group:monitoring": {
@@ -713,7 +713,7 @@
713
713
  "type": "route-group",
714
714
  "domain": "monitoring",
715
715
  "sourcePath": "src/server/routes.ts",
716
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
716
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
717
717
  "since": "2025-01-01"
718
718
  },
719
719
  "route-group:commitments": {
@@ -721,7 +721,7 @@
721
721
  "type": "route-group",
722
722
  "domain": "commitments",
723
723
  "sourcePath": "src/server/routes.ts",
724
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
724
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
725
725
  "since": "2025-01-01"
726
726
  },
727
727
  "route-group:episodes": {
@@ -729,7 +729,7 @@
729
729
  "type": "route-group",
730
730
  "domain": "memory",
731
731
  "sourcePath": "src/server/routes.ts",
732
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
732
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
733
733
  "since": "2025-01-01"
734
734
  },
735
735
  "route-group:messages": {
@@ -737,7 +737,7 @@
737
737
  "type": "route-group",
738
738
  "domain": "coordination",
739
739
  "sourcePath": "src/server/routes.ts",
740
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
740
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
741
741
  "since": "2025-01-01"
742
742
  },
743
743
  "route-group:system-reviews": {
@@ -745,7 +745,7 @@
745
745
  "type": "route-group",
746
746
  "domain": "monitoring",
747
747
  "sourcePath": "src/server/routes.ts",
748
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
748
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
749
749
  "since": "2025-01-01"
750
750
  },
751
751
  "route-group:machine-mesh": {
@@ -761,7 +761,7 @@
761
761
  "type": "route-group",
762
762
  "domain": "security",
763
763
  "sourcePath": "src/server/routes.ts",
764
- "contentHash": "be123a13b53f4906b2f15e1d54110ce554feb54879aeea9291b1bd971901f10c",
764
+ "contentHash": "ed378b5b589fe40b6d922aaf61a8b93d67751158598edd8a06499a8803c106d9",
765
765
  "since": "2025-01-01"
766
766
  },
767
767
  "cli:init": {
@@ -1092,6 +1092,14 @@
1092
1092
  "contentHash": "b0475554bde6729d2d9a1f8005dcada6a8e4c767203d8293c09a212f9bf0a196",
1093
1093
  "since": "2025-01-01"
1094
1094
  },
1095
+ "template:emit-session-clock.sh": {
1096
+ "id": "template:emit-session-clock.sh",
1097
+ "type": "template",
1098
+ "domain": "operations",
1099
+ "sourcePath": "src/templates/scripts/emit-session-clock.sh",
1100
+ "contentHash": "c83cff5728bef544c20ca4a8bce432981175161a4ac2272e112edc612949806d",
1101
+ "since": "2025-01-01"
1102
+ },
1095
1103
  "template:git-sync-gate.sh": {
1096
1104
  "id": "template:git-sync-gate.sh",
1097
1105
  "type": "template",
@@ -1489,7 +1497,7 @@
1489
1497
  "type": "subsystem",
1490
1498
  "domain": "updates",
1491
1499
  "sourcePath": "src/core/PostUpdateMigrator.ts",
1492
- "contentHash": "5604a0742a39ea983d0fd52c754690b576d752ea3f183d02eb02e3ca6e79bdfe",
1500
+ "contentHash": "e8270e118c93a86da1982ba20f6432a566e59f6ae77c3e04c05d81fb3d79b386",
1493
1501
  "since": "2025-01-01"
1494
1502
  },
1495
1503
  "subsystem:scheduler": {
@@ -635,6 +635,11 @@ This routes feedback to the Instar maintainers automatically. Valid types: \`bug
635
635
  - Returns \`{ totals, features: [{ feature, calls, tokensIn, tokensOut, fired, noop, fireRate, p50LatencyMs, p95LatencyMs, ... }] }\` — one row per system (e.g. MessagingToneGate, CoherenceReviewer). Filter with \`?feature=<name>\`.
636
636
  - **When to use**: when asked "which checks cost the most / fire the least?", "is this gate worth it?", or before tuning a sentinel/gate — read the numbers instead of guessing. (Spec: \`docs/specs/llm-feature-metrics-spec.md\`.)
637
637
 
638
+ **Session Clock** — How long have you been running, and how much time is left? For any active time-boxed (autonomous) session, this returns the computed elapsed + remaining so you never have to guess or compute it yourself. Read-only observability.
639
+ - Check: \`curl -H "Authorization: Bearer $AUTH" "http://localhost:${port}/session/clock"\` (optional \`?topic=<N>\` to bind to one session)
640
+ - Returns \`{ now, nowIso, sessions: [{ label, kind, startedAt, endsAt, elapsedSeconds, remainingSeconds, elapsedHuman, remainingHuman, percentElapsed, status }] }\`; \`{ sessions: [] }\` when nothing is time-boxed. Per-machine (the record is local).
641
+ - **When to use** (PROACTIVE): the moment you're about to report progress, decide whether a session is "done", or you catch yourself estimating elapsed/remaining time — call this and quote the real numbers. NEVER assert a timed session is over without checking \`remainingSeconds\`. (Spec: \`docs/specs/ROBUST-SESSION-TIME-AWARENESS-SPEC.md\`.)
642
+
638
643
  **Git Sync** — Automatic version-control and multi-machine synchronization of your state.
639
644
  - **How it works**: The \`git-sync\` job runs hourly, commits local changes, pulls remote changes, and pushes — all automatically. It uses a gate script to skip when nothing has changed (zero-token cost).
640
645
  - **Project-bound agents**: Your state (\`.instar/\`) lives inside the parent project's git repo. The git-sync job uses this repo directly — no separate repo needed. Just make sure the parent repo has a remote configured (\`git remote -v\`).
@@ -0,0 +1,78 @@
1
+ #!/bin/bash
2
+ # emit-session-clock.sh — render the SESSION CLOCK line for an active time-boxed
3
+ # session, so an agent always sees how much of a timed run remains and never
4
+ # winds down early. Signal-only: pure stdout, never blocks.
5
+ #
6
+ # Spec: docs/specs/ROBUST-SESSION-TIME-AWARENESS-SPEC.md (Component 2). The math
7
+ # of record (clock-skew clamping, status) lives in SessionClock.compute() (TS);
8
+ # this script only FORMATS values it is given (render) or queries the route.
9
+ #
10
+ # Modes:
11
+ # render <startedISO> <durationSec> <elapsedSec> <remainingSec> <label>
12
+ # Prints ONE SESSION CLOCK line from the given (already-sanitized, already-
13
+ # computed) values. The caller (autonomous-stop-hook) has already resolved
14
+ # the record + computed elapsed/remaining, so there is NO re-resolution —
15
+ # the injected clock can never disagree with the hook's expiry verdict.
16
+ # query <topic> <port> <auth>
17
+ # Curls GET /session/clock?topic=<topic> and prints the SESSION CLOCK line
18
+ # for the first active session (or nothing if none / server unreachable).
19
+
20
+ humanize() { # seconds -> "Xh Ym" / "Ym" / "Xs"
21
+ local s="${1:-0}"
22
+ case "$s" in (*[!0-9-]*) s=0 ;; esac
23
+ [ "$s" -lt 0 ] 2>/dev/null && s=0
24
+ local h=$((s / 3600)) m=$(((s % 3600) / 60))
25
+ if [ "$h" -gt 0 ]; then echo "${h}h ${m}m"; elif [ "$m" -gt 0 ]; then echo "${m}m"; else echo "${s}s"; fi
26
+ }
27
+
28
+ render_line() { # startedISO durationSec elapsedSec remainingSec label
29
+ local dur="$2" el="${3:-0}" rem="$4" label="$5"
30
+ local pct="" remstr="" lbl=""
31
+ if [ -n "$dur" ] && [ "$dur" -gt 0 ] 2>/dev/null; then pct=" ($((el * 100 / dur))% elapsed)"; fi
32
+ if [ -n "$rem" ]; then remstr=" · $(humanize "$rem") remaining"; fi
33
+ if [ -n "$label" ]; then lbl=" [$label]"; fi
34
+ echo "⏱ SESSION CLOCK${lbl}: $(humanize "$el") elapsed${remstr}${pct}. Do NOT conclude the session is over while remaining is large."
35
+ }
36
+
37
+ MODE="${1:-}"
38
+ shift 2>/dev/null || true
39
+
40
+ case "$MODE" in
41
+ render)
42
+ render_line "${1:-}" "${2:-}" "${3:-0}" "${4:-}" "${5:-}"
43
+ ;;
44
+ query)
45
+ TOPIC="${1:-}"; PORT="${2:-}"; AUTH="${3:-}"
46
+ [ -z "$PORT" ] && exit 0
47
+ URL="http://localhost:${PORT}/session/clock"
48
+ [ -n "$TOPIC" ] && URL="${URL}?topic=${TOPIC}"
49
+ RESP=$(curl -s --max-time 3 -H "Authorization: Bearer ${AUTH}" "$URL" 2>/dev/null)
50
+ [ -z "$RESP" ] && exit 0
51
+ printf '%s' "$RESP" | python3 -c "
52
+ import sys, json
53
+ try:
54
+ d = json.load(sys.stdin)
55
+ except Exception:
56
+ sys.exit(0)
57
+ sessions = d.get('sessions') or []
58
+ if not sessions:
59
+ sys.exit(0)
60
+ c = sessions[0]
61
+ label = c.get('label') or ''
62
+ el = c.get('elapsedHuman') or '?'
63
+ rem = c.get('remainingHuman')
64
+ pct = c.get('percentElapsed')
65
+ line = '⏱ SESSION CLOCK' + ((' [' + label + ']') if label else '') + ': ' + el + ' elapsed'
66
+ if rem is not None:
67
+ line += ' · ' + rem + ' remaining'
68
+ if pct is not None:
69
+ line += ' (' + str(pct) + '% elapsed)'
70
+ line += '. Do NOT conclude the session is over while remaining is large.'
71
+ print(line)
72
+ " 2>/dev/null
73
+ ;;
74
+ *)
75
+ exit 0
76
+ ;;
77
+ esac
78
+ exit 0