instar 1.3.408 → 1.3.410

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/ServerSupervisor.d.ts.map +1 -1
  9. package/dist/lifeline/ServerSupervisor.js +12 -1
  10. package/dist/lifeline/ServerSupervisor.js.map +1 -1
  11. package/dist/lifeline/TelegramLifeline.js +2 -2
  12. package/dist/lifeline/TelegramLifeline.js.map +1 -1
  13. package/dist/messaging/MessageProcessingLedger.d.ts +22 -0
  14. package/dist/messaging/MessageProcessingLedger.d.ts.map +1 -1
  15. package/dist/messaging/MessageProcessingLedger.js +58 -6
  16. package/dist/messaging/MessageProcessingLedger.js.map +1 -1
  17. package/dist/messaging/ingressDedup.d.ts +3 -1
  18. package/dist/messaging/ingressDedup.d.ts.map +1 -1
  19. package/dist/messaging/ingressDedup.js +1 -1
  20. package/dist/messaging/ingressDedup.js.map +1 -1
  21. package/dist/messaging/stuckMessageRecovery.d.ts +13 -2
  22. package/dist/messaging/stuckMessageRecovery.d.ts.map +1 -1
  23. package/dist/messaging/stuckMessageRecovery.js +20 -4
  24. package/dist/messaging/stuckMessageRecovery.js.map +1 -1
  25. package/dist/server/routes.d.ts.map +1 -1
  26. package/dist/server/routes.js +5 -0
  27. package/dist/server/routes.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/data/builtin-manifest.json +47 -47
  30. package/upgrades/1.3.409.md +45 -0
  31. package/upgrades/1.3.410.md +59 -0
  32. package/upgrades/side-effects/stuck-recovery-replay-dedupe.md +88 -0
  33. package/upgrades/side-effects/supervisor-startup-grace.md +69 -0
@@ -0,0 +1,69 @@
1
+ # Side-Effects Review — ServerSupervisor startup grace 3min → 10min
2
+
3
+ **Version / slug:** `supervisor-startup-grace`
4
+ **Date:** `2026-06-07`
5
+ **Author:** `Echo`
6
+ **Tier:** 1 (one constant; no API/route/config-default/migration surface)
7
+ **Second-pass reviewer:** `Echo (self) — Tier-1; the boot-time-vs-grace analysis below is load-bearing, and this was PROVEN live on Echo`
8
+
9
+ ## Summary of the change
10
+
11
+ `ServerSupervisor.startupGraceMs` raised from `180_000` (3 min) to `600_000` (10 min).
12
+ The supervisor probes the server's `/health` and, after the startup grace elapses,
13
+ treats failures as "unresponsive" and restarts. But a heavy boot on a loaded box
14
+ synchronously loads large TopicMemory (tens of thousands of messages) + SemanticMemory
15
+ and reconciles dozens of sessions BEFORE the server binds `/health`, so a full boot can
16
+ take 5-6 min. With a 3-min grace the supervisor began restarting the server mid-boot,
17
+ before it ever finished → an endless restart-before-boot loop (the 2026-06-07
18
+ "server temporarily down on every message" incident, topic 21816). 10 min comfortably
19
+ exceeds a realistic slow boot. File: `src/lifeline/ServerSupervisor.ts`. Already tunable
20
+ via the existing `startupGraceSeconds` option (unchanged).
21
+
22
+ ## Decision-point inventory
23
+
24
+ - The single decision: how long to wait for a booting server before treating health
25
+ failures as a hang worth restarting. Lengthened from 3 → 10 min.
26
+ - No message block/allow surface. No new route/config-default/migration. The existing
27
+ `startupGraceSeconds` override is unchanged.
28
+
29
+ ## 1. Over-wait (a genuinely hung boot waits longer before restart)
30
+
31
+ A boot that is truly hung (not just slow) now waits 10 min instead of 3 before the
32
+ supervisor restarts it. That is the deliberate tradeoff: the 3-min value was demonstrably
33
+ too short (it restarted *legitimate* slow boots → the loop, a far worse outcome — a
34
+ permanent outage). A genuine hang is rare; waiting 10 min for it is acceptable, and other
35
+ backstops (the out-of-process fleet watchdog) still exist. Net strictly safer than a
36
+ 3-min grace that loops on every slow boot.
37
+
38
+ ## 2. Under-wait (still restarts before boot completes)
39
+
40
+ 10 min was chosen to exceed the observed worst-case boot (~5-6 min under heavy load on
41
+ Echo) with margin. If a deployment's boot ever exceeds 10 min, `startupGraceSeconds` can
42
+ raise it further without a code change.
43
+
44
+ ## 3. Level-of-abstraction fit
45
+
46
+ Correct: a single duration constant on the component that owns the restart decision. No
47
+ LLM, no new dependency. The deeper durable fix (bind `/health` BEFORE the heavy boot
48
+ loads, so the grace barely matters) is tracked separately as the top post-mortem item;
49
+ this grace bump makes restarts safe in the meantime and is independently correct.
50
+
51
+ ## 4. Blast radius
52
+
53
+ Fleet-wide benefit (every agent's supervisor): a longer grace only ever *prevents* a
54
+ mid-boot restart; it never causes one. Agents on fast/unloaded machines are unaffected
55
+ (their boot finishes well within both 3 and 10 min). This makes the fleet rollout of the
56
+ other stability fixes SAFE — agents that auto-update + restart get the longer grace and
57
+ cannot loop on the restart.
58
+
59
+ ## 5. Rollback
60
+
61
+ Pure code revert (one constant). No state/config/format change.
62
+
63
+ ## 6. Tests
64
+
65
+ `supervisor-startup-grace.test.ts`: default grace >= 6 min (and strictly > the old
66
+ 3-min); `startupGraceSeconds` override works; within the grace window a health failure is
67
+ not acted on. tsc clean. PROVEN LIVE: applied to Echo during the incident, the restart
68
+ loop broke immediately (server went from restarting every ~5-6 min to stable; health
69
+ recovered to 6/6).