instar 1.3.605 → 1.3.607

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 (86) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +140 -1
  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 +29 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/coordination/CrossMachineMandate.d.ts +53 -0
  8. package/dist/coordination/CrossMachineMandate.d.ts.map +1 -0
  9. package/dist/coordination/CrossMachineMandate.js +76 -0
  10. package/dist/coordination/CrossMachineMandate.js.map +1 -0
  11. package/dist/core/AccountCredentialShare.d.ts +115 -0
  12. package/dist/core/AccountCredentialShare.d.ts.map +1 -0
  13. package/dist/core/AccountCredentialShare.js +113 -0
  14. package/dist/core/AccountCredentialShare.js.map +1 -0
  15. package/dist/core/AccountFollowMeGrants.d.ts +92 -0
  16. package/dist/core/AccountFollowMeGrants.d.ts.map +1 -0
  17. package/dist/core/AccountFollowMeGrants.js +106 -0
  18. package/dist/core/AccountFollowMeGrants.js.map +1 -0
  19. package/dist/core/AutonomousSessions.d.ts +24 -0
  20. package/dist/core/AutonomousSessions.d.ts.map +1 -1
  21. package/dist/core/AutonomousSessions.js +22 -0
  22. package/dist/core/AutonomousSessions.js.map +1 -1
  23. package/dist/core/CoherenceJournal.d.ts +1 -1
  24. package/dist/core/CoherenceJournal.d.ts.map +1 -1
  25. package/dist/core/CoherenceJournal.js +12 -2
  26. package/dist/core/CoherenceJournal.js.map +1 -1
  27. package/dist/core/PairingEpochManager.d.ts +68 -0
  28. package/dist/core/PairingEpochManager.d.ts.map +1 -0
  29. package/dist/core/PairingEpochManager.js +88 -0
  30. package/dist/core/PairingEpochManager.js.map +1 -0
  31. package/dist/core/PostUpdateMigrator.d.ts +13 -0
  32. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  33. package/dist/core/PostUpdateMigrator.js +105 -0
  34. package/dist/core/PostUpdateMigrator.js.map +1 -1
  35. package/dist/core/SecretStore.d.ts +44 -0
  36. package/dist/core/SecretStore.d.ts.map +1 -1
  37. package/dist/core/SecretStore.js +126 -0
  38. package/dist/core/SecretStore.js.map +1 -1
  39. package/dist/core/SecretSync.d.ts.map +1 -1
  40. package/dist/core/SecretSync.js +6 -0
  41. package/dist/core/SecretSync.js.map +1 -1
  42. package/dist/core/SubscriptionAccountMetaReplicatedStore.d.ts +106 -0
  43. package/dist/core/SubscriptionAccountMetaReplicatedStore.d.ts.map +1 -0
  44. package/dist/core/SubscriptionAccountMetaReplicatedStore.js +263 -0
  45. package/dist/core/SubscriptionAccountMetaReplicatedStore.js.map +1 -0
  46. package/dist/core/SubscriptionPool.d.ts +23 -5
  47. package/dist/core/SubscriptionPool.d.ts.map +1 -1
  48. package/dist/core/SubscriptionPool.js +30 -6
  49. package/dist/core/SubscriptionPool.js.map +1 -1
  50. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  51. package/dist/core/devGatedFeatures.js +12 -0
  52. package/dist/core/devGatedFeatures.js.map +1 -1
  53. package/dist/core/types.d.ts +29 -0
  54. package/dist/core/types.d.ts.map +1 -1
  55. package/dist/core/types.js.map +1 -1
  56. package/dist/monitoring/AutonomousProgressHeartbeat.d.ts +169 -0
  57. package/dist/monitoring/AutonomousProgressHeartbeat.d.ts.map +1 -0
  58. package/dist/monitoring/AutonomousProgressHeartbeat.js +296 -0
  59. package/dist/monitoring/AutonomousProgressHeartbeat.js.map +1 -0
  60. package/dist/monitoring/ProxyCoordinator.d.ts +1 -1
  61. package/dist/monitoring/ProxyCoordinator.d.ts.map +1 -1
  62. package/dist/monitoring/autonomousHeartbeatScrub.d.ts +44 -0
  63. package/dist/monitoring/autonomousHeartbeatScrub.d.ts.map +1 -0
  64. package/dist/monitoring/autonomousHeartbeatScrub.js +81 -0
  65. package/dist/monitoring/autonomousHeartbeatScrub.js.map +1 -0
  66. package/dist/monitoring/sentinelWiring.d.ts +14 -0
  67. package/dist/monitoring/sentinelWiring.d.ts.map +1 -1
  68. package/dist/monitoring/sentinelWiring.js +19 -0
  69. package/dist/monitoring/sentinelWiring.js.map +1 -1
  70. package/dist/scaffold/templates.d.ts.map +1 -1
  71. package/dist/scaffold/templates.js +10 -0
  72. package/dist/scaffold/templates.js.map +1 -1
  73. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  74. package/dist/server/CapabilityIndex.js +9 -0
  75. package/dist/server/CapabilityIndex.js.map +1 -1
  76. package/dist/server/routes.d.ts.map +1 -1
  77. package/dist/server/routes.js +15 -0
  78. package/dist/server/routes.js.map +1 -1
  79. package/package.json +1 -1
  80. package/src/data/builtin-manifest.json +63 -63
  81. package/src/scaffold/templates.ts +10 -0
  82. package/upgrades/1.3.606.md +28 -0
  83. package/upgrades/1.3.607.md +25 -0
  84. package/upgrades/side-effects/autonomous-progress-heartbeat-ratchet-fix.md +36 -0
  85. package/upgrades/side-effects/autonomous-progress-heartbeat.md +40 -0
  86. package/upgrades/side-effects/ws52-account-follow-me-pr1.md +74 -0
@@ -0,0 +1,296 @@
1
+ /**
2
+ * AutonomousProgressHeartbeat — a hedged, change-gated, sparse liveness BACKSTOP
3
+ * for an autonomous run that has gone silent on the user for a long stretch
4
+ * while its terminal output is STILL changing.
5
+ *
6
+ * Spec: docs/specs/autonomous-progress-heartbeat.md (ELI16: .eli16.md).
7
+ *
8
+ * The incident this closes (2026-06-16, topic 12476): during a 24h autonomous
9
+ * run the agent finished a milestone, said "PR is armed", then went heads-down
10
+ * for ~an hour fixing CI — real work the whole time, but emitted ZERO
11
+ * user-facing message. An hour of silence is indistinguishable from a stall.
12
+ *
13
+ * This is NOT the suppressed PromiseBeacon §B1 "still on it, no new output"
14
+ * filler (HONEST-PROGRESS-MESSAGING removed that). It is a structurally higher
15
+ * bar: it fires ONLY on a LONG user-silence gate (≥25m) AND a corroborated
16
+ * recent output change (read from ActiveWorkSilenceSentinel's already-computed
17
+ * `lastOutputAt` snapshot — predicate #8 captures NOTHING of its own), with
18
+ * purely-observational wording, a per-topic cooldown, a widening per-run backoff
19
+ * + hard cap, and the shared one-voice ProxyCoordinator lease.
20
+ *
21
+ * Signal-only: it emits a liveness message and never gates, blocks, delays, or
22
+ * rewrites anything. Every predicate fails CLOSED (no emit) on any uncertainty.
23
+ */
24
+ import { EventEmitter } from 'node:events';
25
+ import { scrubFocus } from './autonomousHeartbeatScrub.js';
26
+ const DEFAULTS = {
27
+ silenceThresholdMinutes: 25,
28
+ silenceThresholdFloorMinutes: 5,
29
+ tickIntervalMs: 60_000,
30
+ tickIntervalFloorMs: 30_000,
31
+ maxHeartbeatsPerRun: 6,
32
+ recentOutputChangeWindowMs: 5 * 60_000,
33
+ };
34
+ /** Widening per-run backoff (minutes). Floor = silenceThresholdMinutes; the
35
+ * ladder widens 25→40→60→90 (then holds at the last value, capped by the
36
+ * per-run budget). */
37
+ const BACKOFF_LADDER_MINUTES = [25, 40, 60, 90];
38
+ export class AutonomousProgressHeartbeat extends EventEmitter {
39
+ deps;
40
+ cfg;
41
+ runState = new Map();
42
+ lastEmits = [];
43
+ static LAST_EMITS_CAP = 50;
44
+ tickHandle = null;
45
+ ticking = false;
46
+ lastTickAt = 0;
47
+ topicsConsidered = 0;
48
+ constructor(deps, raw = {}) {
49
+ super();
50
+ this.deps = deps;
51
+ const silenceMin = Math.max(DEFAULTS.silenceThresholdFloorMinutes, raw.silenceThresholdMinutes ?? DEFAULTS.silenceThresholdMinutes);
52
+ const tickMs = Math.max(DEFAULTS.tickIntervalFloorMs, raw.tickIntervalMs ?? DEFAULTS.tickIntervalMs);
53
+ this.cfg = {
54
+ enabled: raw.enabled === true,
55
+ // default true: dryRun unless explicitly false (the graduated-rollout ladder).
56
+ dryRun: raw.dryRun !== false,
57
+ silenceThresholdMs: silenceMin * 60_000,
58
+ tickIntervalMs: tickMs,
59
+ maxHeartbeatsPerRun: raw.maxHeartbeatsPerRun ?? DEFAULTS.maxHeartbeatsPerRun,
60
+ recentOutputChangeWindowMs: raw.recentOutputChangeWindowMs ?? DEFAULTS.recentOutputChangeWindowMs,
61
+ };
62
+ }
63
+ start() {
64
+ if (!this.cfg.enabled || this.tickHandle)
65
+ return;
66
+ this.tickHandle = setInterval(() => {
67
+ this.tick().catch((err) => {
68
+ // Observability never endangers the observed; never throw out of the tick.
69
+ this.emit('tick-error', err);
70
+ });
71
+ }, this.cfg.tickIntervalMs);
72
+ if (typeof this.tickHandle.unref === 'function')
73
+ this.tickHandle.unref();
74
+ }
75
+ stop() {
76
+ if (this.tickHandle) {
77
+ clearInterval(this.tickHandle);
78
+ this.tickHandle = null;
79
+ }
80
+ this.runState.clear();
81
+ }
82
+ /** Read-only status for GET /autonomous-heartbeat. */
83
+ status() {
84
+ return {
85
+ enabled: this.cfg.enabled,
86
+ dryRun: this.cfg.dryRun,
87
+ silenceThresholdMinutes: Math.round(this.cfg.silenceThresholdMs / 60_000),
88
+ lastTickAt: this.lastTickAt,
89
+ topicsConsidered: this.topicsConsidered,
90
+ lastEmits: [...this.lastEmits],
91
+ };
92
+ }
93
+ /** Guard-posture surface (GET /guards). Cheap property read — no I/O. */
94
+ guardStatus() {
95
+ return { enabled: this.cfg.enabled, lastTickAt: this.lastTickAt };
96
+ }
97
+ /**
98
+ * One tick. Re-entrancy-guarded (the emit step is awaited and a send can
99
+ * block). Evaluates the per-topic predicate cheap-first; the ProxyCoordinator
100
+ * lease is acquired/released in a try/finally within THIS tick.
101
+ *
102
+ * Public for tests.
103
+ */
104
+ async tick() {
105
+ if (this.ticking)
106
+ return;
107
+ this.ticking = true;
108
+ this.lastTickAt = (this.deps.now ?? Date.now)();
109
+ try {
110
+ const now = (this.deps.now ?? Date.now)();
111
+ const runs = this.deps.listActiveAutonomousRuns();
112
+ this.topicsConsidered = runs.length;
113
+ // Prune run-state for topics no longer active so the map can't leak.
114
+ const activeTopicIds = new Set(runs.map((r) => r.topicId));
115
+ for (const t of [...this.runState.keys()]) {
116
+ if (!activeTopicIds.has(t))
117
+ this.runState.delete(t);
118
+ }
119
+ for (const run of runs) {
120
+ await this.evaluateTopic(run, now);
121
+ }
122
+ }
123
+ finally {
124
+ this.ticking = false;
125
+ }
126
+ }
127
+ /**
128
+ * The per-topic predicate, evaluated strictly cheapest-first, short-circuiting
129
+ * on the first failure. Predicate #1 (run active) is implied by `run` being in
130
+ * the active set. Every predicate is an in-memory read.
131
+ */
132
+ async evaluateTopic(run, now) {
133
+ const topicId = run.topicId;
134
+ // #2 Not mid-handoff + #3 destination warmup elapsed (markers fail closed).
135
+ const markers = this.deps.getRunMarkers(topicId);
136
+ if (!markers) {
137
+ this.recordSuppressed(topicId, now, 'run-markers-unreadable');
138
+ return;
139
+ }
140
+ if (markers.movedTo || markers.moveSuspended) {
141
+ this.recordSuppressed(topicId, now, 'mid-move-marker');
142
+ return;
143
+ }
144
+ // #3 warmup: the run must have been active on THIS machine ≥ one full window.
145
+ if (markers.startedAtMs == null || now - markers.startedAtMs < this.cfg.silenceThresholdMs) {
146
+ this.recordSuppressed(topicId, now, 'warmup-not-elapsed');
147
+ return;
148
+ }
149
+ // #4 Session alive.
150
+ if (!run.sessionName || !this.deps.isSessionAlive(run.sessionName)) {
151
+ this.recordSuppressed(topicId, now, 'session-not-alive');
152
+ return;
153
+ }
154
+ // #5 Silent-to-user ≥ threshold (minutes since most-recent fromUser===false).
155
+ const lastOutboundAt = this.mostRecentOutboundAt(topicId);
156
+ if (lastOutboundAt != null && now - lastOutboundAt < this.cfg.silenceThresholdMs) {
157
+ this.recordSuppressed(topicId, now, 'spoke-recently');
158
+ return;
159
+ }
160
+ const silenceAnchor = lastOutboundAt ?? markers.startedAtMs;
161
+ const minutesSilent = Math.max(1, Math.round((now - silenceAnchor) / 60_000));
162
+ // #6 Per-topic emit-cooldown elapsed (LOCAL map). A new run resets state.
163
+ const state = this.ensureRunState(topicId, markers.startedAtMs);
164
+ const cooldownMs = this.currentBackoffMs(state.count);
165
+ if (state.lastHeartbeatAt > 0 && now - state.lastHeartbeatAt < cooldownMs) {
166
+ this.recordSuppressed(topicId, now, 'cooldown-not-elapsed');
167
+ return;
168
+ }
169
+ // #7 Per-run heartbeat budget not exhausted.
170
+ if (state.count >= this.cfg.maxHeartbeatsPerRun) {
171
+ this.recordSuppressed(topicId, now, 'budget-exhausted');
172
+ return;
173
+ }
174
+ // #8 Recent output change — from the SHARED snapshot (no own capture).
175
+ const lastOutputAt = this.deps.getSharedLastOutputAt(run.sessionName);
176
+ if (lastOutputAt == null || lastOutputAt <= 0) {
177
+ // Snapshot unavailable / lastOutputAt absent → fail CLOSED, never capture.
178
+ this.recordSuppressed(topicId, now, 'shared-snapshot-unavailable');
179
+ return;
180
+ }
181
+ if (now - lastOutputAt > this.cfg.recentOutputChangeWindowMs) {
182
+ // Output has NOT advanced recently (e.g. frozen spinner) → suppress.
183
+ this.recordSuppressed(topicId, now, 'no-recent-output-change');
184
+ return;
185
+ }
186
+ // #9 One-voice free: acquire the shared lease; release UNCONDITIONALLY here.
187
+ if (!this.deps.proxyCoordinator.tryAcquire(topicId, 'autonomous-heartbeat')) {
188
+ this.recordSuppressed(topicId, now, 'lease-held');
189
+ return;
190
+ }
191
+ try {
192
+ const rawFocus = this.deps.getFocusForTopic(topicId);
193
+ const scrub = scrubFocus(rawFocus);
194
+ const text = this.buildMessage(scrub.focus);
195
+ if (this.cfg.dryRun) {
196
+ // dryRun gates on the SAME cooldown/budget as live (it only swaps the
197
+ // final send for a log). Advance state so the next tick doesn't re-log.
198
+ state.lastHeartbeatAt = now;
199
+ state.count += 1;
200
+ this.recordEmit({ topicId, at: now, minutesSilent, focus: scrub.focus, dryRun: true });
201
+ this.emit('would-emit', { topicId, minutesSilent, focus: scrub.focus });
202
+ return;
203
+ }
204
+ try {
205
+ await this.deps.sendMessage(topicId, text, {
206
+ source: 'autonomous-heartbeat',
207
+ isProxy: true,
208
+ tier: 1,
209
+ });
210
+ state.lastHeartbeatAt = now;
211
+ state.count += 1;
212
+ this.recordEmit({ topicId, at: now, minutesSilent, focus: scrub.focus, dryRun: false });
213
+ this.emit('emitted', { topicId, minutesSilent, focus: scrub.focus });
214
+ }
215
+ catch (err) {
216
+ // @silent-fallback-ok: NOT silent — a failed heartbeat send is surfaced via
217
+ // recordSuppressed('send-failed') + the 'send-error' event. We deliberately do
218
+ // NOT advance cooldown/count (a missed heartbeat is the safe status quo; the
219
+ // next tick retries). The lease still releases in finally.
220
+ this.recordSuppressed(topicId, now, 'send-failed');
221
+ this.emit('send-error', { topicId, err });
222
+ }
223
+ }
224
+ finally {
225
+ this.deps.proxyCoordinator.release(topicId, 'autonomous-heartbeat');
226
+ }
227
+ }
228
+ /**
229
+ * The purely-observational, untrusted-framed line. NEVER an assertive "still
230
+ * working"/"still going" claim. `focus` is already scrubbed + HTML-escaped;
231
+ * null → the generic fallback.
232
+ */
233
+ buildMessage(focus) {
234
+ if (focus) {
235
+ return `I haven't posted here in a while — last observed activity was «${focus}». Message me if you need me.`;
236
+ }
237
+ return `I haven't posted here in a while on this autonomous run. Message me if you need me.`;
238
+ }
239
+ // ─── Internals ──────────────────────────────────────────────────────────────
240
+ /** Most-recent outbound (fromUser===false) entry time, or null when none. */
241
+ mostRecentOutboundAt(topicId) {
242
+ let history;
243
+ try {
244
+ history = this.deps.getTopicHistory(topicId) ?? [];
245
+ }
246
+ catch {
247
+ // @silent-fallback-ok: this is fail-CLOSED, not a degraded fallback — when history
248
+ // can't be read we treat the topic as "spoke just now" (MAX_SAFE_INTEGER sentinel)
249
+ // so the silence gate CANNOT fire on missing evidence. Suppressing a heartbeat on
250
+ // an unreadable read is the safe direction; reporting degradation here would be
251
+ // noise on the common transient-read case.
252
+ return Number.MAX_SAFE_INTEGER;
253
+ }
254
+ let latest = null;
255
+ for (const e of history) {
256
+ if (e.fromUser === false && typeof e.at === 'number') {
257
+ if (latest === null || e.at > latest)
258
+ latest = e.at;
259
+ }
260
+ }
261
+ return latest;
262
+ }
263
+ ensureRunState(topicId, runStartedAtMs) {
264
+ const existing = this.runState.get(topicId);
265
+ if (existing && existing.runStartedAtMs === runStartedAtMs)
266
+ return existing;
267
+ // New run (or first sighting) → fresh throttle state.
268
+ const fresh = { runStartedAtMs, lastHeartbeatAt: 0, count: 0 };
269
+ this.runState.set(topicId, fresh);
270
+ return fresh;
271
+ }
272
+ /**
273
+ * The cooldown (ms) that must elapse before the NEXT heartbeat, given how many
274
+ * have already fired on this run (`count`). The gap WIDENS with each heartbeat:
275
+ * the 1st→2nd gap is ladder[0] (25m), the 2nd→3rd gap is ladder[1] (40m), …
276
+ * (then holds at the last ladder value). So the index is `count-1` (the number
277
+ * of gaps already opened). Floored at silenceThresholdMinutes — the ladder
278
+ * never goes below the user-silence gate.
279
+ */
280
+ currentBackoffMs(count) {
281
+ const gapIdx = Math.min(Math.max(count - 1, 0), BACKOFF_LADDER_MINUTES.length - 1);
282
+ const ladderMin = BACKOFF_LADDER_MINUTES[gapIdx];
283
+ const floorMin = this.cfg.silenceThresholdMs / 60_000;
284
+ return Math.max(ladderMin, floorMin) * 60_000;
285
+ }
286
+ recordEmit(e) {
287
+ this.lastEmits.push(e);
288
+ if (this.lastEmits.length > AutonomousProgressHeartbeat.LAST_EMITS_CAP) {
289
+ this.lastEmits.splice(0, this.lastEmits.length - AutonomousProgressHeartbeat.LAST_EMITS_CAP);
290
+ }
291
+ }
292
+ recordSuppressed(topicId, at, reason) {
293
+ this.emit('suppressed', { topicId, reason });
294
+ }
295
+ }
296
+ //# sourceMappingURL=AutonomousProgressHeartbeat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutonomousProgressHeartbeat.js","sourceRoot":"","sources":["../../src/monitoring/AutonomousProgressHeartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AA2F3D,MAAM,QAAQ,GAAG;IACf,uB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AC,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,2BAA2B,CAAC,cAAc,EAAE,CAAC;YACvE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,2BAA2B,CAAC,cAAc,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;IAEO,gBAAgB,CAAC,OAAe,EAAE,EAAU,EAAE,MAAc;QAClE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC"}
@@ -11,7 +11,7 @@
11
11
  * In-memory only (spec §"ProxyCoordinator liveness" — P16). Dies with the
12
12
  * process. No persistence, no distributed lock.
13
13
  */
14
- export type ProxyHolder = 'presence-proxy' | 'promise-beacon';
14
+ export type ProxyHolder = 'presence-proxy' | 'promise-beacon' | 'autonomous-heartbeat';
15
15
  export declare class ProxyCoordinator {
16
16
  private held;
17
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ProxyCoordinator.d.ts","sourceRoot":"","sources":["../../src/monitoring/ProxyCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE9D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAuE;IACnF;;;;;;;;;;OAUG;IACH,OAAO,CAAC,oBAAoB,CAAkC;IAE9D,+CAA+C;IAC/C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO;IASzD,iDAAiD;IACjD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAOnD,mCAAmC;IACnC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAIlD,mBAAmB;IACnB,OAAO,IAAI,KAAK,CAAC;Q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mB,GAAG,OAAO;IAMhF;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG3C"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * autonomousHeartbeatScrub — the deterministic boundary scrub for the
3
+ * AutonomousProgressHeartbeat's interpolated `focus`.
4
+ *
5
+ * Per docs/specs/autonomous-progress-heartbeat.md §Content, `focus` is
6
+ * LLM-derived from conversation/feedback content and therefore
7
+ * attacker-influenceable. Before it is used in the message AND before it is
8
+ * stored into the status route's `lastEmits`, it MUST pass this deterministic
9
+ * boundary scrub:
10
+ * - run it through the credential/secret/path regex set (reuse of the
11
+ * credential-leak-detector / PolicyEnforcementLayer patterns);
12
+ * - on ANY match, DROP focus entirely (the caller falls back to the generic
13
+ * line) — never emit partially-redacted attacker content;
14
+ * - length-clamp to ≤200 chars;
15
+ * - HTML-escape for the Telegram formatter (the message is sent on the
16
+ * `isProxy` path; focus is interpolated).
17
+ *
18
+ * This is a BOUNDARY SCRUB — a deterministic structural validator, not a new
19
+ * LLM gate — and is therefore signal-vs-authority compliant.
20
+ */
21
+ /** Max length of the (post-clamp, pre-escape) focus string. */
22
+ export declare const FOCUS_MAX_LENGTH = 200;
23
+ /** True if `text` matches any credential/secret/path pattern → focus must drop. */
24
+ export declare function focusHasScrubMatch(text: string): boolean;
25
+ export interface ScrubResult {
26
+ /** The HTML-escaped, length-clamped focus to interpolate — or null to drop. */
27
+ focus: string | null;
28
+ /** Why focus was dropped (for the status route / observability). */
29
+ dropped: boolean;
30
+ /** The reason a drop happened: 'scrub-match' | 'empty'. Absent when kept. */
31
+ reason?: 'scrub-match' | 'empty';
32
+ }
33
+ /**
34
+ * Apply the boundary scrub to a raw focus string.
35
+ * - empty/whitespace → dropped (reason 'empty').
36
+ * - any scrub match → dropped (reason 'scrub-match') — never partially redacted.
37
+ * - otherwise → length-clamped to FOCUS_MAX_LENGTH then HTML-escaped.
38
+ *
39
+ * Length-clamp happens BEFORE escape so the 200-char budget is over the visible
40
+ * text, not the escaped expansion. The scrub runs over the RAW text (before
41
+ * clamp) so a secret split across the clamp boundary still trips a pattern.
42
+ */
43
+ export declare function scrubFocus(raw: string | null | undefined): ScrubResult;
44
+ //# sourceMappingURL=autonomousHeartbeatScrub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autonomousHeartbeatScrub.d.ts","sourceRoot":"","sources":["../../src/monitoring/autonomousHeartbeatScrub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAgCpC,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAQtE"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * autonomousHeartbeatScrub — the deterministic boundary scrub for the
3
+ * AutonomousProgressHeartbeat's interpolated `focus`.
4
+ *
5
+ * Per docs/specs/autonomous-progress-heartbeat.md §Content, `focus` is
6
+ * LLM-derived from conversation/feedback content and therefore
7
+ * attacker-influenceable. Before it is used in the message AND before it is
8
+ * stored into the status route's `lastEmits`, it MUST pass this deterministic
9
+ * boundary scrub:
10
+ * - run it through the credential/secret/path regex set (reuse of the
11
+ * credential-leak-detector / PolicyEnforcementLayer patterns);
12
+ * - on ANY match, DROP focus entirely (the caller falls back to the generic
13
+ * line) — never emit partially-redacted attacker content;
14
+ * - length-clamp to ≤200 chars;
15
+ * - HTML-escape for the Telegram formatter (the message is sent on the
16
+ * `isProxy` path; focus is interpolated).
17
+ *
18
+ * This is a BOUNDARY SCRUB — a deterministic structural validator, not a new
19
+ * LLM gate — and is therefore signal-vs-authority compliant.
20
+ */
21
+ import { escapeHtmlText } from '../messaging/TelegramMarkdownFormatter.js';
22
+ /** Max length of the (post-clamp, pre-escape) focus string. */
23
+ export const FOCUS_MAX_LENGTH = 200;
24
+ /**
25
+ * Credential / secret / path / internal-URL patterns. A reuse of the
26
+ * PolicyEnforcementLayer credential-leak set (kept inline + self-contained so
27
+ * the scrub is a pure, deterministic, unit-testable function with no I/O).
28
+ * On ANY match, focus is dropped.
29
+ */
30
+ const SCRUB_PATTERNS = [
31
+ // ── Credentials / secrets ──
32
+ /\bsk-ant-[A-Za-z0-9_-]{20,}\b/, // Anthropic API key
33
+ /\bsk-[A-Za-z0-9_-]{20,}\b/, // OpenAI API key
34
+ /\bghp_[A-Za-z0-9]{20,}\b/, // GitHub PAT
35
+ /\bgho_[A-Za-z0-9]{20,}\b/, // GitHub OAuth token
36
+ /\bghu_[A-Za-z0-9]{20,}\b/, // GitHub user-to-server token
37
+ /\bghs_[A-Za-z0-9]{20,}\b/, // GitHub server-to-server token
38
+ /\bghr_[A-Za-z0-9]{20,}\b/, // GitHub refresh token
39
+ /\bxox[baprs]-[A-Za-z0-9-]{8,}\b/, // Slack tokens
40
+ /\bAKIA[0-9A-Z]{12,}\b/, // AWS access key
41
+ /\bsk_(?:live|test)_[A-Za-z0-9]{12,}\b/, // Stripe keys
42
+ /Bearer\s+[A-Za-z0-9_\-.]{20,}/i, // bearer token
43
+ /(?:password|passwd|pwd|secret|api[_-]?key|token)\s*[:=]\s*\S{6,}/i, // generic secret assignment
44
+ /-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----/, // PEM private key block
45
+ // ── Sensitive / absolute paths ──
46
+ /\/?\.instar\/[^\s)"']*/, // .instar/ paths
47
+ /\/?\.claude\/[^\s)"']*/, // .claude/ paths
48
+ /\/Users\/[^\s)"']+/, // macOS home paths
49
+ /\/home\/[^\s)"']+/, // linux home paths
50
+ // ── Internal URLs ──
51
+ /\bhttps?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0)(?::\d+)?[^\s)]*/i,
52
+ ];
53
+ /** True if `text` matches any credential/secret/path pattern → focus must drop. */
54
+ export function focusHasScrubMatch(text) {
55
+ if (!text)
56
+ return false;
57
+ return SCRUB_PATTERNS.some((p) => p.test(text));
58
+ }
59
+ /**
60
+ * Apply the boundary scrub to a raw focus string.
61
+ * - empty/whitespace → dropped (reason 'empty').
62
+ * - any scrub match → dropped (reason 'scrub-match') — never partially redacted.
63
+ * - otherwise → length-clamped to FOCUS_MAX_LENGTH then HTML-escaped.
64
+ *
65
+ * Length-clamp happens BEFORE escape so the 200-char budget is over the visible
66
+ * text, not the escaped expansion. The scrub runs over the RAW text (before
67
+ * clamp) so a secret split across the clamp boundary still trips a pattern.
68
+ */
69
+ export function scrubFocus(raw) {
70
+ const text = (raw ?? '').replace(/\s+/g, ' ').trim();
71
+ if (!text)
72
+ return { focus: null, dropped: true, reason: 'empty' };
73
+ if (focusHasScrubMatch(text))
74
+ return { focus: null, dropped: true, reason: 'scrub-match' };
75
+ const clamped = text.length > FOCUS_MAX_LENGTH ? text.slice(0, FOCUS_MAX_LENGTH) : text;
76
+ const escaped = escapeHtmlText(clamped);
77
+ if (!escaped)
78
+ return { focus: null, dropped: true, reason: 'empty' };
79
+ return { focus: escaped, dropped: false };
80
+ }
81
+ //# sourceMappingURL=autonomousHeartbeatScrub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autonomousHeartbeatScrub.js","sourceRoot":"","sources":["../../src/monitoring/autonomousHeartbeatScrub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;;GAK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E,MAAM,EAAE,aAAa,EAAE,CAAC;IAC3F,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxF,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACrE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5C,CAAC"}
@@ -132,6 +132,20 @@ export declare class OutputActivityTracker {
132
132
  private readonly last;
133
133
  constructor(sessions: SentinelSessionSurface, now?: () => number);
134
134
  snapshot(): SessionRegistryEntry[];
135
+ /**
136
+ * Cached read of the LAST-computed output-change time for a session, WITHOUT
137
+ * capturing (no tmux frame is read). Returns the `lastChangeAt` recorded by
138
+ * the most recent `snapshot()` call, or null when the session has not been
139
+ * observed yet OR its first sighting only recorded the baseline (lastChangeAt
140
+ * is still 0 — i.e. no real output change has been observed).
141
+ *
142
+ * This is the AutonomousProgressHeartbeat's predicate #8 read (spec
143
+ * §Shared-snapshot dependency): the heartbeat shares THIS tracker (the one
144
+ * ActiveWorkSilenceSentinel ticks on its own 60s loop) and reads the value it
145
+ * already computed — it NEVER captures its own frame. Returns null fails-closed
146
+ * for the heartbeat (no emit).
147
+ */
148
+ lastOutputAtFor(sessionName: string): number | null;
135
149
  }
136
150
  export declare function buildActiveWorkSilenceDeps(opts: {
137
151
  tracker: OutputActivityTracker;
@@ -1 +1 @@
1
- {"version":3,"file":"sentinelWiring.d.ts","sourceRoot":"","sources":["../../src/monitoring/sentinelWiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,4BAA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AAE,MAAM,EAAE,GACtB,IAAI,CAAC;CACT;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,wBAAwB,GAAG;IACvE,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE,CA0DA;AAED,sFAAsF;AACtF;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACjD,MAAM,CAsBR"}
@@ -207,6 +207,25 @@ export class OutputActivityTracker {
207
207
  }
208
208
  return out;
209
209
  }
210
+ /**
211
+ * Cached read of the LAST-computed output-change time for a session, WITHOUT
212
+ * capturing (no tmux frame is read). Returns the `lastChangeAt` recorded by
213
+ * the most recent `snapshot()` call, or null when the session has not been
214
+ * observed yet OR its first sighting only recorded the baseline (lastChangeAt
215
+ * is still 0 — i.e. no real output change has been observed).
216
+ *
217
+ * This is the AutonomousProgressHeartbeat's predicate #8 read (spec
218
+ * §Shared-snapshot dependency): the heartbeat shares THIS tracker (the one
219
+ * ActiveWorkSilenceSentinel ticks on its own 60s loop) and reads the value it
220
+ * already computed — it NEVER captures its own frame. Returns null fails-closed
221
+ * for the heartbeat (no emit).
222
+ */
223
+ lastOutputAtFor(sessionName) {
224
+ const rec = this.last.get(sessionName);
225
+ if (!rec || rec.lastChangeAt <= 0)
226
+ return null;
227
+ return rec.lastChangeAt;
228
+ }
210
229
  }
211
230
  export function buildActiveWorkSilenceDeps(opts) {
212
231
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"sentinelWiring.js","sourceRoot":"","sources":["../../src/monitoring/sentinelWiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GA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+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA2E/F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA2B1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,EAC5B,WAAW,GAAE,OAAe,GAC3B,MAAM,CAuhDR;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,GAAE,OAAe,GAC3B,MAAM,CA2TR"}
@@ -529,6 +529,9 @@ Every guard (monitoring sentinels, reapers, the scheduler, …) is graded by wha
529
529
  - **Topic-operator binding is the THIRD PII store** (WS2.6): when enabled, the VERIFIED operator a topic was bound to on one machine is VISIBLE as advisory context on the others. THE LOAD-BEARING SAFETY RULE (Know Your Principal): a replicated topic-operator record is UNTRUSTED peer data — it is NEVER my authoritative answer to "who is my verified operator of this topic?". Only the LOCAL binding from an AUTHENTICATED sender (TopicOperatorStore.setOperator) is authoritative; a replicated record can NEVER establish or override an operator — it is rendered as quoted untrusted data that explicitly says so. Cross-machine identity is keyed on \`sha256(topicId + ":" + verified-uid)\`, NEVER a content-name. An unbind propagates a tombstone. Enable with \`multiMachine.stateSync.topicOperator\` (ships dark: \`enabled:false\`, \`dryRun:true\`). With user-registry + topic-operator, the WS2 memory family is COMPLETE (7 kinds; playbook deferred).
530
530
  - **When to use** (PROACTIVE — these are the triggers): the user asks "why do I have two versions of preference X?" → read open conflicts and present them for resolution. The user says "roll back machine Y's data / forget what the other machine learned" → un-merge that origin. The user asks "is my relationship/contact data shared across machines / is it encrypted on the other machine?" → explain the at-rest honesty above (transit encrypted; at-rest plaintext on each machine). The user asks "do my learnings/lessons follow me across machines?" → yes when \`stateSync.learnings\` is on (the same lesson collapses by content fingerprint, never duplicates). The user asks "do my ingested sources / knowledge base follow me across machines?" → yes when \`stateSync.knowledge\` is on (the same source collapses by content fingerprint; only the catalog metadata syncs, not the file body). The user asks "do my action items / commitments follow me across machines?" → yes when \`stateSync.evolutionActions\` is on (the same action collapses by content fingerprint; a peer sees its real status so it does not redo completed work). The user asks "do my registered users follow me across machines?" → yes when \`stateSync.userRegistry\` is on (keyed on the channel set; but identity resolution of an inbound sender stays local-authoritative). The user asks "do you know who my verified operator is on the other machine?" → a replicated topic-operator record is advisory context ONLY; my authoritative operator is always the locally auth-bound one. Spec: \`docs/specs/multi-machine-replicated-store-foundation.md\` §7, \`docs/specs/ws23-relationships-userregistry-security.md\`.
531
531
 
532
+ **Cross-Machine Account Follow-Me (WS5.2 — seamless account/quota sharing)** — When I run on more than one machine, "log in once, the account works everywhere" is delivered the ToS-SAFE way: each machine RE-MINTS its OWN login (operator approves once per machine; Mechanism B — default), and NO Claude OAuth token is ever copied between machines (Anthropic's ToS forbids relocating a Claude login). Only a redacted, credential-free METADATA projection of each account (id, nickname, email, provider, framework, status, quota) replicates so a peer KNOWS an account's depth/quota — the login LOCATION (configHome) and every credential field are STRIPPED and never cross the wire. A cross-machine credential SHARE (Mechanism A, sealed-transport) is fully designed but REFUSED for Anthropic by default (per-provider allowlist, default empty). Authorization is operator-mandate-gated (deny-by-default; a peer can NEVER enroll an account onto itself via the mesh), the cross-machine mandate carries an asymmetric Ed25519 issuance signature (the local HMAC proof is machine-local), de-pairing ROTATES the recipient key so old sealed credentials die, and per-account spend is lease-sliced (sum-of-leases bound). Ships DARK on the fleet, LIVE on a development agent (dogfooding); gate: \`multiMachine.accountFollowMe\`. Spec: \`docs/specs/ws52-account-follow-me-security.md\`.
533
+ - **When to use** (PROACTIVE): the user asks "do I have to log my account in on every machine?" / "share my account across machines" → explain the re-mint-per-machine model (one approval per machine, then that machine serves from the shared pool's quota; no token copied). "is my login copied to my other machines?" → NO — only non-credential account metadata replicates; each machine holds its own grant.
534
+
532
535
  **Relationships** — Track people I interact with.
533
536
  - List: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/relationships\`
534
537
 
@@ -1545,6 +1548,13 @@ Two background notifiers used to post frequent, falsely-confident noise because
1545
1548
  - **Silent-freeze watchdog** (ActiveWorkSilenceSentinel): before claiming a session is stuck, it re-captures the LIVE frame and corroborates — if the frame still shows an active-work indicator (spinner / "esc to interrupt"), a sub-agent is live, or it's a clean idle prompt, it stays SILENT. It speaks only when genuinely wedged, and even then hedges ("…hasn't changed in N min and a nudge didn't wake it — it may be stuck, or on a long task I can't see into. Want me to check?"). Threshold raised 15m→30m; a 90m frozen-indicator backstop still surfaces a real mid-tool hang. Tune/disable: \`monitoring.activeWorkSilenceSentinel.enabled\` (off), \`.silenceThresholdMs\` (default 30m), \`.activeWorkMaxFrozenIndicatorMs\` (default 90m).
1546
1549
  - **Promise beacon** (the ⏳ heartbeats): the zero-information "still on it, no new output" filler is suppressed by default — it speaks only on genuine new progress, deadline pressure, a sparse once-per-60m liveness line, or a one-shot turn-finished close-out. Base cadence relaxed 10m→20m. Tune/disable: \`promiseBeacon.suppressUnchangedHeartbeats: false\` (restore the legacy every-tick heartbeat — the rollback lever), \`promiseBeacon.beaconLivenessIntervalMs\` (default 60m), \`promiseBeacon.turnFinishedCloseoutChecks\` (default 3).
1547
1550
  - **Doc correction:** the trio's escalations are NOT gated by \`monitoring.sentinelTelegramEscalation\` (that gate governs a different path); they route through the tone-gated \`/attention\` surface and are controlled by each sentinel's own \`enabled\` flag (both default true). Effectiveness is measurable in \`logs/sentinel-events.jsonl\` and the per-feature LLM-metrics surface (feature keys \`active-work-silence\`, \`promise-beacon\`). Spec: \`docs/specs/HONEST-PROGRESS-MESSAGING-SPEC.md\`.
1551
+
1552
+ ## Autonomous-run silence backstop (AutonomousProgressHeartbeat)
1553
+
1554
+ A proactive backstop that posts ONE purely-observational liveness line when an autonomous run has gone silent on you for a long stretch while its terminal output is still changing. **This is NOT the commitment-cadence "still on it" heartbeat that the honest-progress work removed** — it fires only on a LONG user-silence gate (≥25m) WITH corroborated recent output change (a liveness signal, NOT a progress claim), and the wording is observational ("I haven't posted here in a while — last observed activity was «…». Message me if you need me."), never an assertive "still working" / "still going" claim. It closes the *busy-but-silent-to-user* gap the other watchers miss: the silent-freeze watchdog stays quiet while output is moving (it's a stuck-detector), PresenceProxy needs an inbound message, and PromiseBeacon needs an open commitment — a long heads-down autonomous run with no commitment and no inbound message falls through all three. The real fix is still you sending your own milestones; this only catches a lapse.
1555
+ - **It can't spam you (three LOCAL brakes, NOT dedup):** a long user-silence gate that ANY outbound (including your own normal reply) resets; a per-topic emit-cooldown; and a widening per-run backoff (25→40→60→90m) with a hard cap (~6 lines per run). A 24h silent-but-working run yields a handful of hedged lines, never dozens. Output advancing proves only LIVENESS, never that work is progressing (a log/retry loop also advances output) — which is exactly why the wording is liveness-only.
1556
+ - **Signal-only:** it only ever ADDS a line — never blocks, delays, or rewrites your real messages. Every predicate fails CLOSED (no emit) on any uncertainty (can't read history, the shared snapshot is unavailable, the run is mid-move to another machine). The interpolated \`focus\` is scrubbed for credentials/secrets/paths (drop-to-generic on any match), length-clamped, and HTML-escaped before it's ever shown.
1557
+ - **Status:** \`curl -H "Authorization: Bearer $AUTH" http://localhost:4042/autonomous-heartbeat\` → \`{ enabled, dryRun, silenceThresholdMinutes, lastTickAt, topicsConsidered, lastEmits }\` (503 when dark). Ships dark on the fleet + \`dryRun: true\` on a dev agent (logs "would emit" on the SAME cooldown/budget as live). Tune/disable: \`monitoring.autonomousHeartbeat\` (\`dryRun\`, \`silenceThresholdMinutes\`, \`tickIntervalMs\`, \`maxHeartbeatsPerRun\`). Spec: \`docs/specs/autonomous-progress-heartbeat.md\`.
1548
1558
  `;
1549
1559
  if (hasTelegram) {
1550
1560
  content += `