aboutsummaryrefslogtreecommitdiff
path: root/working/triage-telegram-down-launch/proposed.diff
blob: 72b9cd4137bb0a66a1e70e5032f44d3f34c68820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- claude-templates/.ai/workflows/triage-intake.telegram.org	2026-07-09 13:57:29.819324933 -0500
+++ working/triage-telegram-down-launch/triage-intake.telegram.org.proposed	2026-07-24 17:26:36.349127827 -0500
@@ -30,6 +30,20 @@
 unless Craig has Telegram open in Emacs. The scan therefore runs the full
 lifecycle every time, never skips because the server is down:
 
+⚠ *DOWN / not-loaded is the TRIGGER to launch, never a reason to skip or fail.*
+This is the exact mistake two projects (work + home, 2026-07-24) made: they
+probed telega, saw =(telega-server-live-p)= nil or telega not =featurep=, and
+reported =SCAN FAILED: telegram — not loaded= or a silent SKIP — a *blind*
+sweep — instead of running Step 1 to start it. A down or unloaded telega is the
+normal entry state; =(telega t)= both LOADS the package and STARTS the docker
+server (work confirmed: down → =(telega t)= → Ready, 18 chats). So the plugin
+MUST run Step 1's launch whenever telega is down/unloaded, wait for Ready, then
+scan. =SCAN FAILED= is reserved for a launch that was actually ATTEMPTED and did
+not reach Ready (image missing, server crash on start, daemon unreachable) —
+never for the pre-launch down state itself. The =:ENABLED:= guard above tests
+whether telega is INSTALLED (=fboundp=), not whether the server is up; a down
+server never disables the source.
+
 1. Record prior state: TELEGA_WAS_RUNNING via (telega-server-live-p).
 2. Launch (only if not running):
    emacsclient -e "(progn (setq telega-use-docker t) (telega t) 'started)"
@@ -48,10 +62,13 @@
    Verify: telega-server-live-p → nil, no zevlg/telega-server container in
    docker ps. If Craig had it running, leave it untouched.
 
-If any lifecycle step fails (docker image missing, server crash, daemon
-unreachable), the sweep reports it as SCAN FAILED at the top of the summary
-per the engine's failure rule — never as a silent skip. Craig gets real
-traffic here.
+If any lifecycle step fails *after the launch was attempted* (docker image
+missing, server crash on start, daemon unreachable, Ready never reached), the
+sweep reports it as SCAN FAILED at the top of the summary per the engine's
+failure rule — never as a silent skip. This does NOT cover the ordinary
+pre-launch down state: a down server means "run Step 1," not "SCAN FAILED."
+Craig gets real traffic here, so a blind sweep that skipped the launch is worse
+than a clean failure — it hides real unread messages behind a false all-clear.
 
 ** Scan
 
@@ -88,7 +105,15 @@
 # `(telega t)` starts without popping the root buffer. Docker mode (the stable
 # path — see the SEGFAULT gotcha) reconnects the persisted ~/.telega session in
 # ~2s. Then load the main chat list so telega--chats populates.
+#
+# The `(setq telega-use-docker t)` is mandatory and must come BEFORE `(telega t)`:
+# tdlib segfaults in native mode (SEGFAULT gotcha below), and the daemon's default
+# is nil unless something (e.g. an Emacs-config :custom) has already forced it. It
+# was missing here while the Quick Reference and the gotcha both require it —
+# a session that started telega without it on a native-mode daemon would crash the
+# server, surfacing as a triage SCAN FAILED. Match the Quick Reference exactly.
 emacsclient -e "(progn
+  (setq telega-use-docker t)
   (unless (and (fboundp 'telega-server-live-p) (telega-server-live-p)) (telega t))
   'started)"
 # Poll until Ready with chats synced, or a crash/timeout. Background this with an