instar 1.3.1239 → 1.3.1240

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 (41) hide show
  1. package/dist/core/PostUpdateMigrator.js +4 -4
  2. package/dist/core/PostUpdateMigrator.js.map +1 -1
  3. package/dist/data/standards-guard-index.json +1 -1
  4. package/dist/data/standards-guard-index.meta.json +2 -2
  5. package/dist/data/standards-registry.meta.json +1 -1
  6. package/dist/messaging/telegram-origin/OriginAwareness.d.ts +2 -0
  7. package/dist/messaging/telegram-origin/OriginAwareness.d.ts.map +1 -1
  8. package/dist/messaging/telegram-origin/OriginAwareness.js +6 -1
  9. package/dist/messaging/telegram-origin/OriginAwareness.js.map +1 -1
  10. package/dist/messaging/telegram-origin/OriginConfigReader.d.ts.map +1 -1
  11. package/dist/messaging/telegram-origin/OriginConfigReader.js +9 -28
  12. package/dist/messaging/telegram-origin/OriginConfigReader.js.map +1 -1
  13. package/dist/messaging/telegram-origin/OriginDetectorCanary.d.ts +1 -0
  14. package/dist/messaging/telegram-origin/OriginDetectorCanary.d.ts.map +1 -1
  15. package/dist/messaging/telegram-origin/OriginDetectorCanary.js +155 -16
  16. package/dist/messaging/telegram-origin/OriginDetectorCanary.js.map +1 -1
  17. package/dist/messaging/telegram-origin/OriginDetectorCanary.worker.d.ts.map +1 -1
  18. package/dist/messaging/telegram-origin/OriginDetectorCanary.worker.js +69 -41
  19. package/dist/messaging/telegram-origin/OriginDetectorCanary.worker.js.map +1 -1
  20. package/dist/messaging/telegram-origin/OriginNoticePolicyObserver.d.ts +1 -1
  21. package/dist/messaging/telegram-origin/OriginNoticePolicyObserver.d.ts.map +1 -1
  22. package/dist/messaging/telegram-origin/OriginNoticePolicyObserver.js +9 -29
  23. package/dist/messaging/telegram-origin/OriginNoticePolicyObserver.js.map +1 -1
  24. package/dist/messaging/telegram-origin/OriginSourcePoller.d.ts +20 -0
  25. package/dist/messaging/telegram-origin/OriginSourcePoller.d.ts.map +1 -0
  26. package/dist/messaging/telegram-origin/OriginSourcePoller.js +74 -0
  27. package/dist/messaging/telegram-origin/OriginSourcePoller.js.map +1 -0
  28. package/dist/messaging/telegram-origin/OriginStore.d.ts.map +1 -1
  29. package/dist/messaging/telegram-origin/OriginStore.js +7 -1
  30. package/dist/messaging/telegram-origin/OriginStore.js.map +1 -1
  31. package/dist/testing/selfActionRegistry.d.ts.map +1 -1
  32. package/dist/testing/selfActionRegistry.js +23 -1
  33. package/dist/testing/selfActionRegistry.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/data/builtin-manifest.json +19 -19
  36. package/src/data/standards-guard-index.json +1 -1
  37. package/src/data/standards-guard-index.meta.json +2 -2
  38. package/src/data/standards-registry.meta.json +1 -1
  39. package/upgrades/1.3.1240.md +26 -0
  40. package/upgrades/side-effects/telegram-canary-cleanup-phase.md +444 -0
  41. package/upgrades/telegram-canary-cleanup-phase.eli16.md +19 -0
@@ -0,0 +1,444 @@
1
+ # Owned Telegram canary cleanup phases — side-effects review
2
+
3
+ Governing approved/converged spec: docs/specs/telegram-message-origin.md. Fresh
4
+ helper-created worktree fix/telegram-canary-cleanup-phase from canonical
5
+ https://github.com/JKHeadley/instar.git at 15cd5876d6d285a39fc105aeb57e5fde705ad540,
6
+ v1.3.1238. Existing approved private overview is linked in that spec.
7
+
8
+ ## Evidence and intended outcome
9
+
10
+ Independent tracing found all six checks completed in about 318 ms, followed by
11
+ synchronous native watcher shutdown. One success spent 1298 ms closing observer
12
+ watchers and 3150 ms closing reader watchers; a failed cycle stalled at observer
13
+ close until both six-second attempts timed out. A separate production Boot trace
14
+ measured 5763 ms and 1470 ms in those closes, then 3 ms in runtime close. Logs:
15
+ /tmp/echo-review-canary-direct.log and /tmp/echo-review-network-lifecycle-close.log.
16
+
17
+ The current six-second timer includes cleanup and is not a hard total duration
18
+ bound because actual termination remains awaited after timeout. The approved
19
+ spec does not prescribe six seconds. The existing controller declaration requires
20
+ sequential bounded attempts, verified cleanup ownership, a cleanup-failure latch,
21
+ and startup/recurrence floors. Preserve six seconds for contract checks and use
22
+ a separate explicitly chosen 30-second cleanup deadline justified by these timings.
23
+
24
+ ## Principle check and side effects
25
+
26
+ This changes diagnostic health, not credentials, delivery permission, retry custody,
27
+ or source authority. Health stays non-passing until all cleanup is verified.
28
+ Over-block: malformed protocol rejects the attempt and permits at most one retry.
29
+ Failed or unverified cleanup latches unavailable health even if checks succeeded;
30
+ actual source readers retain their own authority. Under-block: early success messages, duplicates, late results and missing
31
+ cleanup must never establish passing health. Ownership remains held while cleanup
32
+ is unresolved. At most two workers run sequentially and recurrence remains
33
+ completion-relative; restart waits 60 seconds.
34
+
35
+ The additional cleanup time can delay diagnostic completion and close(), but never
36
+ permits overlapping workers or healthy status before teardown. Deadlines are
37
+ bounded observations, not promises that an unabortable OS close returns by then.
38
+ Signals expose only fixed phases/reasons, never fixture content or paths.
39
+
40
+ Machine-local by design: each canary owns a private fixture and process resources;
41
+ no network transport or remote authority is created. Rollback restores the older
42
+ probe accounting and needs no stored-data migration. Existing-install awareness
43
+ will receive a guarded update alongside generated instructions.
44
+
45
+ Class unbounded-self-action: preserve existing registered owned-canary controller,
46
+ single-flight ownership, cleanup-failure latch, two-attempt limit, and schedule floors.
47
+ Update its declaration to state the separate contract and cleanup bounds.
48
+
49
+ ## Validation
50
+
51
+ The protocol-compatibility regression failed against the previous parent using
52
+ the new checks-first fixture: that parent could accept the new early check result
53
+ without understanding its separate cleanup message. The old production worker
54
+ reported after its own finally block; its actual defect was classifying timely
55
+ checks as failed while native watcher teardown consumed the shared deadline.
56
+ The corrected protocol passes 25 boundary cases, including delayed timer callbacks,
57
+ late termination and removal, duplicate messages, cancellation after a real worker
58
+ starts, and no automatic scheduling after a cleanup failure. Twelve existing real
59
+ worker/native-lane cases, six scheduling cases, and six installed-migration cases
60
+ also pass (49 focused cases). Build and lint pass. An initial test-source quote
61
+ error was corrected before the real-worker suite ran successfully. The actual
62
+ operator HTTP health test passes (69.7 seconds), including startup wait, fresh
63
+ owned proof, authority-reader invalidation and no origin-row side effects.
64
+ All three production Boot cases pass (133.5 seconds): default native resolver
65
+ wiring, real owned checks with source failure/restoration, and resource shutdown
66
+ after failed profile enrollment. Full-suite and CI release validation remain
67
+ outstanding. This repair now precedes the local-refusal release because its
68
+ known canary defect blocks that candidate's full validation.
69
+
70
+ Independent reviewer review_local_refusal: concur with the runtime protocol and
71
+ 23 initial cases. Separate monotonic deadlines, normal exit before proof, joined
72
+ termination/removal, single-flight ownership and cleanup-failure latch hold. The
73
+ two recommended additional boundary cases are now included and pass. Final
74
+ review also concurs with the guarded awareness migration, controller declaration,
75
+ and 145-second successful-path wait (60 + 2 * (6 + 30) = 132 seconds plus margin).
76
+ The reviewer requested the protocol/latch wording corrections now applied above.
77
+
78
+ Tracked adjacent watchdog false interrupt: topic-69507. The conversation watchdog
79
+ sent SIGINT to a legitimate long-running Vitest process in the separate primary
80
+ release validation. This canary repair does not alter that watchdog; the current
81
+ release validation uses a bounded supervised test job with durable logs and exits.
82
+
83
+
84
+ ## Release dependency and shared fixture corrections
85
+
86
+ The separate local-refusal candidate's frozen full run ended normally with
87
+ 51,936 passing tests and one failure: the real detector HTTP health fixture
88
+ observed ownedContracts.state=fail while config and noticePolicy were healthy.
89
+ All 14,014 input hashes were unchanged. This matches the independently measured
90
+ old canary cleanup failure class; that run did not expose per-attempt phase
91
+ timing, so it is not new proof of the exact timing of each failed attempt.
92
+
93
+ The canary commit was rebased unchanged onto v1.3.1239. An independent range-diff
94
+ review confirmed equivalence and no dependency on local-refusal accounting.
95
+ Fourteen files receive previously reviewed fixture corrections: awaited real
96
+ Boot cleanup has a 30-second budget with existing restorations in finally, and
97
+ the phone fixture explicitly asserts initial/post-save display convergence
98
+ within 20 seconds with safe health metadata on failure. Its body budget is
99
+ 60 seconds. The two detector fixtures already had bounded cleanup; their
100
+ canary-specific 145-second observation is preserved. The HTTP body remains
101
+ 180 seconds; the Boot body is 240 seconds to cover sequential recovery waits
102
+ and its explicit awaited in-body close.
103
+ Only the cleanup hunk is transferred to the late-capacity lifecycle fixture;
104
+ no local-refusal accounting test or runtime change is imported.
105
+
106
+ Reverse closure order, propagation of cleanup errors, delivery assertions,
107
+ operator scope checks, and production authorization/read deadlines remain
108
+ unchanged. Longer fixture waits still fail at their bounds. Independent reviewer
109
+ review_local_refusal concurred with the actual transfer and rebase. Build passes
110
+ on v1.3.1239. Initial combined focused validation passed all 55 tests in eight
111
+ files (normal exit 0, 2026-09-15T08:55:49Z).
112
+
113
+ A class-wide test audit found healthy-readiness waits shorter than two real
114
+ refresh opportunities: two completion-relative five-second intervals plus two
115
+ two-second reads can consume 14 seconds before scheduling margin. Seven files
116
+ now allow 20 seconds for healthy config/display/authorization/policy readiness.
117
+ The shared helper retains monotonic time and real timers for fake-interval lease
118
+ tests. Unavailable/revocation checks, delivery deadlines, and independent
119
+ enrollment-only probes are unchanged. The opt-out branch allows 20 seconds for
120
+ a new parsed snapshot while its unreadable branch keeps seven seconds. Only the
121
+ canary Boot body needs expansion: 145 + 20 + 8 + 20 seconds of sequential waits,
122
+ with allowance for setup and explicit in-body close, fits 240 seconds.
123
+
124
+ Independent reviewer review_local_refusal concurred with the actual seven-file
125
+ diff and owning-body budget audit. Final readiness-focused validation passed
126
+ all 36 tests in seven files (normal exit 0, 2026-09-15T09:06:33Z), including the
127
+ real canary lifecycle, policy, enrollment, dashboard rejection, production Boot,
128
+ and fake-interval lease consumer. Full lint passes. Full local suite and CI
129
+ remain required before merge; no deployment is claimed.
130
+
131
+ ## Full-run watchdog fixture correction
132
+
133
+ Frozen candidate d10015e35060ff41ec56c2d24cad48e8a258fd85 completed the aggregate
134
+ suite normally on 2026-09-15T10:09:41Z: 51,969 tests passed and one failed.
135
+ All 14,018 tracked input hashes were unchanged. The canary production Boot
136
+ lifecycle and real HTTP detector health both passed (154.9 and 91.4 seconds).
137
+ Dedicated integration and E2E phases were not reached because the aggregate
138
+ failed. GitHub CI passed, including integration, build and 3,234 E2E tests;
139
+ build and E2E checkout logs verify merge f4f24dbd9721fe4d9487bc4693cdab7189e21d9a,
140
+ whose parents are current v1.3.1239 main and d10015e35. Those results do not
141
+ establish a passing full local run.
142
+
143
+ The single local failure was the watchdog real-esbuild fixture observing no
144
+ protected service after a fixed 100ms post-spawn sleep. This installation's
145
+ esbuild entrypoint is a Node shim that subsequently starts the native service;
146
+ its spawn event does not establish native-process readiness. Installed version
147
+ 0.21.5 matches the fixture and discovery has no elapsed-time filter. This proves
148
+ the fixture lacks readiness synchronization, not the exact timing of its failed
149
+ attempt. The installer may instead replace the entrypoint with a native binary
150
+ on another platform. The audit found no other real esbuild spawn-plus-100ms
151
+ fixture in the test population.
152
+
153
+ The correction polls actual production process discovery for up to five seconds,
154
+ accepting only the spawned PID or its verified descendants. It detects early
155
+ exit, preserves the watchdog judge/signal assertions, and verifies both exit
156
+ and signal liveness. The test body allows 15 seconds for readiness plus a final
157
+ in-flight bounded process snapshot. Cleanup ends the owned stdin, awaits closure,
158
+ and uses strict process-table reads to verify captured owned resources are gone.
159
+ A bounded fallback rechecks each owned identity before stopping descendants
160
+ before their wrapper; uncertainty or incomplete cleanup fails the test. No
161
+ production watchdog, classifier, deadline, permission, or signaling policy is
162
+ changed. This also removes the former unawaited wrapper-only SIGKILL cleanup.
163
+
164
+ Reviewer review_local_refusal drafted the correction outside the frozen tree;
165
+ the primary independently reviewed ownership and cleanup, strengthened the root
166
+ liveness fence and final assertions, and the reviewer concurred with those
167
+ adjustments. After the frozen run ended and hashes were verified, focused
168
+ validation passed all 11 tests across the real-process integration fixture and
169
+ classification boundaries (normal exit 0, 2026-09-15T10:10:22Z). The corrected
170
+ candidate still requires full local validation and fresh CI before release.
171
+
172
+
173
+ ## Remaining cleanup failure and bounded diagnostics
174
+
175
+ Frozen candidate 5d8a3bea87905b163a4348b64734bc56a37f4b63 completed the aggregate
176
+ with 51,970 passing tests, then dedicated integration with 4,207 passing tests
177
+ and one real detector HTTP failure (2026-09-15T11:27:28Z). All 14,018 tracked
178
+ input hashes were unchanged; dedicated E2E was not reached. CI passed against
179
+ the corresponding merge tree, which does not override the local failure. The
180
+ canary latched cleanup unavailable after one attempt while both actual authority
181
+ readers were healthy. The previous fixed `cleanup` label cannot identify the
182
+ first failing step. This remaining failure blocks release.
183
+
184
+ Three bounded direct probes and one actual production-Boot HTTP lifecycle passed
185
+ without reproducing it. Direct watcher closures took roughly 4.0, 12.5 and 6.6
186
+ seconds; the Boot probe took 1.49 seconds, with immediate parent termination and
187
+ 9ms fixture removal. These observations locate latency in those successful
188
+ probes only; they do not prove the cause of the full-run failure.
189
+
190
+ The existing degradation reason now distinguishes fixed cleanup faults and stages:
191
+ acknowledgement, natural worker exit, parent termination and fixture removal. The
192
+ first fault is retained when later deadline or cleanup failures follow. No paths,
193
+ exception text, worker payloads, credentials or timestamps enter those labels.
194
+ Health schema/reasons, authority, protocol, resource ownership, retries, and
195
+ 6s/30s deadlines remain unchanged. Thirty focused boundary tests pass, including
196
+ negative and late acknowledgements, abnormal exit versus error, failed termination,
197
+ late final cleanup, first-fault preservation, and reporter redaction. A completed
198
+ cycle report remains suppressed after close. Independent reviewer
199
+ review_local_refusal concurs with the runtime and test diff. The next dedicated
200
+ integration run is diagnostic; this addition does not claim to repair the still
201
+ unreproduced failure.
202
+
203
+
204
+ ## Pool fixture listener ownership correction
205
+
206
+ The diagnostic candidate 0c327ce4f passed dedicated integration: 4,208 tests in
207
+ 520 files, including real detector HTTP health (83.6 seconds). All 14,019 tracked
208
+ input hashes were unchanged. This did not reproduce the earlier cleanup fault.
209
+ The required full local run was then started on the same frozen candidate.
210
+
211
+ Fresh CI 34965209260 failed Node 22 shard 1 during pool-view-link-alive beforeAll:
212
+ the real holder AgentServer could not bind fixed port 47262 (EADDRINUSE). Its
213
+ 9,450 tests passed, but one suite failed. Job 104367926455 checkout logs verify
214
+ merge 886d8ea6ec0be058a632f8da520771fdd6c49f6e, with parents main v1.3.1239 and
215
+ 0c327ce4f. The source fixes holder/front ports at 47262/47261 without owning them
216
+ before listen. The competing process cannot be identified from that CI error.
217
+ The in-progress local full run was cancelled through its owned supervisor on
218
+ 2026-09-15T12:06:12Z, after 499 seconds, because this known fixture correction
219
+ requires a new candidate. All 14,019 hashes were verified unchanged and its
220
+ owned process group had no remaining members. That cancelled run is not a pass.
221
+
222
+ The four related real-AgentServer pool fixtures (view link, reconciler, poll
223
+ cache, and placement transfer) now bind port zero. A shared test helper reads
224
+ the actual bound TCP listener after awaited start and rejects an absent or
225
+ non-TCP address. That listener remains reserved through the fixture lifetime;
226
+ there is no probe-and-release race, random port guess, or retry masking a bind
227
+ failure. The holder URL is established before signed mesh proxy wiring, and
228
+ all front/wired/dark URLs are established before their requests. SessionManagers
229
+ do not launch sessions in these fixtures. Existing authentication, signed proxy,
230
+ privacy/no-store, offline 503, ownership/transfer, and wired-versus-dark assertions
231
+ and awaited cleanup remain unchanged. No production server behavior changes.
232
+
233
+ This fixes the test resource-ownership layer and creates no diagnostic or
234
+ authorization signal. It neither over-blocks legitimate production work nor
235
+ weakens production checks. Rollback changes only test fixtures. The shared port
236
+ 47261 also appeared in the reconciler fixture; the narrow pool fixture population
237
+ now contains no fixed 47xxx listener assignments. Existing pool streaming
238
+ fixtures already use OS-assigned listeners and remain unchanged.
239
+
240
+ Reviewer review_local_refusal prepared the five proposals outside the frozen
241
+ tree; the primary independently reviewed them, removed extra blank lines, then
242
+ applied them only after cancellation and input/ownership verification. Focused
243
+ dedicated E2E validation passed all 14 tests across the four actual server
244
+ fixtures (6.68 seconds, normal exit zero). Full local validation and fresh CI
245
+ on the corrected candidate remain required.
246
+
247
+
248
+ ## Completing the enumerated real-listener population
249
+
250
+ The first four-fixture correction committed as 54f3e5f0f with full lint passing.
251
+ Its push completed normally (2026-09-15T12:14:07Z); the smoke listing timed out
252
+ and was skipped, not passed. A broader source audit then examined 13 remaining
253
+ files containing a real AgentServer construction, awaited start, and a numeric
254
+ port assignment. Eight were genuine unreserved listeners: three fixed (U4.1 pin
255
+ persistence, stale-owner handback, secret sync) and five randomized (reply marker,
256
+ ingress, planned handoff, multi-machine HTTP, tunnel/private view). Five were
257
+ configuration or migration literals whose actual listeners already use port zero.
258
+ Those five remain unchanged. This is the enumerated source-search population,
259
+ not a claim that every possible test listener pattern has been formally analyzed.
260
+
261
+ The 54f3e5f0f full run was cancelled through its owned supervisor after 347
262
+ seconds (2026-09-15T12:17:29Z) to complete that population before final validation.
263
+ All 14,020 hashes were unchanged and its owned process group was empty before
264
+ any tracked edit. This cancelled run is not a pass.
265
+
266
+ The eight additional fixtures now use port zero and the same actual-bound-address
267
+ helper. Identity-only peer fixtures retain their roles with a zero placeholder;
268
+ all real signed requests use the listening server's actual URL. Planned handoff
269
+ retains peer resolver closures, which read the assigned URLs only after both
270
+ servers have started. The tunnel fixture retains the same real TunnelManager
271
+ injected into AgentServer. Its test-owned TunnelConfig receives the bound port
272
+ after server start and before explicit tunnel start; TunnelManager retains that
273
+ config object and supplies its current port to provider.start, whose nonzero
274
+ argument overrides the constructor placeholder. No private provider mutation,
275
+ free-port probing, transport mocking, or retry behavior is introduced.
276
+
277
+ All existing request bodies, signing, custody and lease assertions, startup order,
278
+ authentication, and cleanup remain unchanged. The side effects remain test-only
279
+ resource allocation: no production signaling or authority behavior changes.
280
+ The primary reviewed the six reviewer-prepared proposals; the independent
281
+ reviewer reviewed the primary's handoff/tunnel proposals against the actual
282
+ transport, manager, provider, and AgentServer implementations and concurred.
283
+ Focused dedicated E2E validation passed all 53 tests in 12 files (normal exit
284
+ zero after 28.26 seconds). The real tunnel failed its external reachability check,
285
+ so its existing conditional remote branches were not exercised; local tunnel
286
+ and viewer assertions passed. No remote-reachability success is claimed. The
287
+ post-change source audit leaves only the five confirmed configuration-only
288
+ numeric matches. Full local validation and fresh CI still remain required.
289
+
290
+ ## Actual watcher-boundary repair after the interrupted full run
291
+
292
+ Candidate 11d38c7b6 completed its frozen local `test:all` run with 51,972
293
+ passing tests and two failures: the real canary unit and HTTP integration paths
294
+ both latched `cleanup:deadline-timer:awaiting-ack`. CI was green, but that does
295
+ not override the local failure. Direct instrumentation reproduced the cause
296
+ outside Vitest: all six checks finished in roughly 320 ms, then synchronous
297
+ `FSWatcher.close()` calls inside the disposable worker took 15–43 seconds on
298
+ this macOS host. The timeout was therefore reporting a real cleanup-path stall,
299
+ not a failed contract check and not merely an undersized test wait.
300
+
301
+ The repair makes the worker thread itself the watcher cleanup boundary. The
302
+ worker removes its exact private fixture through `SafeFsExecutor`, reports the
303
+ worker-side monotonic check and cleanup completion instants, and acknowledges
304
+ only when fixture removal succeeded. The parent validates the ordered proof,
305
+ rejects missing, malformed, negative, or over-budget proof, then force-terminates
306
+ that one disposable worker. Passing health still waits for the actual worker
307
+ exit event and a second idempotent parent-side fixture removal. Legacy injected
308
+ test workers without the new proof fields retain the previous normal-exit and
309
+ deadline behavior.
310
+
311
+ ### Decision-point and principle review
312
+
313
+ - **Modified decision point:** deterministic admission of `ownedContracts=pass`.
314
+ This is a hard protocol/resource invariant, not a judgment about message
315
+ meaning. No delivery, credential, retry, or content authority changes.
316
+ - **Over-block:** a legitimate proof with inconsistent timestamps, a missing
317
+ `fixtureRemoved: true`, or cleanup duration at/above the configured bound is
318
+ rejected. The bundled worker emits the complete schema; legacy test workers
319
+ remain compatible through the old receive-time path.
320
+ - **Under-block:** a substituted worker could claim false proof, but production
321
+ supplies the bundled owned worker URL. Even then, the parent independently
322
+ requires its actual exit and repeats exact-directory removal before pass.
323
+ - **Level of abstraction:** watcher ownership belongs at the disposable worker
324
+ boundary. Serially closing individual native watcher handles inside that
325
+ worker duplicated the OS/thread teardown authority and caused the stall.
326
+ - **Signal vs authority:** compliant with `docs/signal-vs-authority.md`. This is
327
+ structural validation of a diagnostic result, within the hard-invariant
328
+ exception; it adds no brittle message-flow blocker or conversational judgment.
329
+ - **Judgment Within Floors:** no competing-signals heuristic is added. Ordered
330
+ proof, bounded elapsed time, exact fixture removal, and worker exit are fully
331
+ enumerable invariants.
332
+ - **Interactions and races:** the parent clears the acknowledgement deadline
333
+ only after a valid worker-side proof, owns forced termination, retains the
334
+ single-flight slot until exit/removal settle, and preserves the first fixed
335
+ cleanup fault. A queued timely proof receives one poll turn before an
336
+ `awaiting-ack` timer classification, preventing parent event-loop stalls from
337
+ manufacturing a late acknowledgement. Failed cleanup still latches the
338
+ instance and prevents recurrence.
339
+ - **External surface:** only detector-health timing/reason can change. No
340
+ Telegram request, message body, persistent delivery record, operator action,
341
+ URL, or user-facing notice is added. No operator surface is touched.
342
+ - **Multi-machine posture:** machine-local by design because each machine probes
343
+ its own file/watcher runtime. It emits no notice, holds no durable state, and
344
+ generates no URL, so one-voice, replication, transfer, and remote-link
345
+ concerns do not apply.
346
+ - **Rollback:** pure code/test rollback in the next patch; no data migration or
347
+ agent-state repair.
348
+
349
+ This controller retains its registered two-attempt ceiling, startup and
350
+ completion-relative schedule floors, cleanup-failure latch, and single-flight
351
+ ownership. Class-closure remains `unbounded-self-action` with guard coverage at
352
+ `tests/unit/self-action-convergence.test.ts`: the control-loop edge cannot start
353
+ another attempt while `pending`, cleanup failure prevents rescheduling, and
354
+ `close()` joins the owned worker. No agent-authored prompt/hook/config/skill
355
+ defect is involved.
356
+
357
+ Validation on the repaired candidate: 32 adversarial cleanup protocol cases,
358
+ 12 real-worker/native-lane unit cases, the real authenticated HTTP integration,
359
+ and all three production-Boot E2E lifecycles pass. The exact HTTP case passed in
360
+ 124.4 seconds and the E2E file passed all three cases in 193.0 seconds under the
361
+ same machine load that reproduced the prior fault. Full lint and build pass.
362
+ Fresh full local `test:all` and CI are still required before merge/deployment.
363
+
364
+ ## Exact-head aggregate-load follow-up
365
+
366
+ The first exact-head aggregate run and fresh CI exposed three additional load
367
+ boundaries before merge. The local run timed out while a production-bootstrap
368
+ test waited for an HTTP keep-alive socket during teardown. Node 22 CI also
369
+ started an origin storage worker after its ordinary request deadline and raced a
370
+ real tmux receiver before its child shell had entered raw TTY mode; the latter
371
+ produced the characteristic Linux canonical-line length of 4,095 bytes.
372
+
373
+ The follow-up keeps these concerns separate. Origin storage worker startup now
374
+ has its own bounded 30-second budget instead of borrowing the much shorter
375
+ already-running request budget. The production HTTP test explicitly closes its
376
+ pooled connections. The real-tmux control now waits for a receiver-ready file
377
+ written only after `stty raw`, so its byte-exact assertion measures tmux
378
+ chunking rather than shell-startup scheduling. The outage-policy lifecycle's
379
+ outer test bound now covers its already-declared 20-second readiness and
380
+ 7-second unreadable-state waits plus teardown.
381
+
382
+ These changes do not loosen Telegram send authority, retry authority, durable
383
+ custody, or the detector's cleanup proof. They remove unrelated scheduler and
384
+ transport races from the evidence path while preserving finite failure bounds.
385
+ Focused reruns pass the 32 cleanup protocol cases, all three real production
386
+ bootstrap cases, and all three real-tmux ceiling cases under the same heavily
387
+ loaded host.
388
+
389
+ ## Production source-watcher closure under aggregate load
390
+
391
+ The next exact-head aggregate run exposed the same native watcher class outside
392
+ the disposable detector worker. A dashboard-origin lifecycle completed its
393
+ delivery assertions, then spent more than 30 seconds in fixture teardown while
394
+ `OriginConfigReader` and `OriginNoticePolicyObserver` synchronously closed
395
+ parent-process `FSWatcher` handles. The focused file passed alone but took 33
396
+ seconds; under aggregate load the affected recorded-missing-message case took
397
+ 37 seconds and its teardown hook timed out. This was a real production cleanup
398
+ boundary, not an assertion wait.
399
+
400
+ The two authority readers now observe their exact owned source files with one
401
+ unrefed, overlap-suppressed stat poller. It fingerprints device, inode, size,
402
+ mtime and ctime every 250 ms. Creation, replacement, mutation, deletion or an
403
+ unreadable transition invalidates the existing projection; the established
404
+ five-second source refresh and 30-second expiry remain unchanged. `close()` now
405
+ cancels a timer synchronously instead of closing native filesystem watchers.
406
+ An in-flight stat may finish, but the closed fence prevents it from invalidating
407
+ or refreshing anything afterward.
408
+
409
+ This changes no credential, destination, delivery, retry or lease authority.
410
+ It narrows the observation mechanism while preserving the spec's at-most-five-
411
+ second refresh requirement and fail-closed invalidation. Focused validation
412
+ passed source creation/change/close, encrypted configuration, same-account
413
+ credential rotation, corrupt source, opt-out and hub-rebind boundaries. The
414
+ dashboard production lifecycle then passed all seven cases in 10 seconds under
415
+ the same concurrent aggregate load, down from 33 seconds in the prior focused
416
+ run and the 74-second failing aggregate file.
417
+
418
+ The fixed-rate observer is registered as the
419
+ `telegram-origin-source-poller` eternal-sentinel controller. The convergence
420
+ ratchet proves its 250 ms rate floor and constant exact-file target under
421
+ sustained pressure; overlap suppression, synchronous interval cancellation and
422
+ the closed fence bound each live instance and prevent a late callback after
423
+ shutdown.
424
+
425
+ ## Independent Phase 5 review — production source poller
426
+
427
+ The second pass inspected the poller, both authority-source callers, their unit
428
+ coverage, the production Boot lifecycle, the dashboard teardown regression, and
429
+ the governing signal-versus-authority rule. The poller only emits machine-local
430
+ change signals; it grants no delivery, credential, retry, or destination
431
+ authority. Both callers serialize source work, reject revisions changed during
432
+ a read, retain their five-second refresh and 30-second expiry fences, and prevent
433
+ an in-flight stat from acting after synchronous timer cancellation. Exact-file
434
+ metadata detects ordinary creation, replacement, mutation, deletion, and access
435
+ transitions without creating cross-machine state or a second decision authority.
436
+
437
+ The focused tests exercise mutation, deletion, late creation, post-close silence,
438
+ encrypted credential rotation, corrupt sources, policy opt-out, hub rebinding,
439
+ and the real production teardown that motivated the change. Direct poller tests
440
+ do not isolate close during an intentionally stalled stat; the closed checks and
441
+ post-close behavior make that a non-blocking coverage gap rather than a
442
+ correctness defect.
443
+
444
+ Concur with the review
@@ -0,0 +1,19 @@
1
+ # Let the diagnostic finish cleaning up before judging it
2
+
3
+ Instar periodically checks its own Telegram configuration readers using a private, disposable fixture. It checks six things, including encrypted configuration, the exact alert destination, an opt-out, a changed destination, changed credentials, and malformed configuration. These checks diagnose the readers. They do not contact Telegram or give any message permission to send.
4
+
5
+ The old deadline included both the checks and the time needed to close native filesystem watchers. Tracing showed the checks finishing in about a third of a second, while macOS could spend 15 to 43 seconds closing those watchers one by one. That cleanup could make healthy reader checks appear broken. Retrying repeated the same expensive cleanup.
6
+
7
+ This repair keeps six seconds for the checks and gives their cleanup its own bounded 30-second window. The disposable worker removes its private directory and reports when its work actually finished. Instar then terminates that whole worker thread, which lets the operating system close all of its watchers as one owned boundary instead of serially waiting on each watcher. Instar still waits for the real worker exit and repeats private-directory removal before reporting a pass. While that work is happening, health says cleanup is running. An early success flag cannot establish a passing result.
8
+
9
+ If cleanup proof is missing, malformed, unsuccessful, or over its deadline, the result stays unavailable and that instance stops trying. Instar retains ownership until the worker really exits and final removal settles. This prevents a second worker from overlapping resources that are still closing. A delayed parent event loop does not turn an already completed worker cleanup into a false timeout.
10
+
11
+ The existing startup wait, two-attempt ceiling, and completion-relative schedule remain. Every machine checks its own disposable state. Existing agents receive the same explanation as newly installed agents, without replacing their added notes. No stored delivery data needs migration. Rolling back restores the previous diagnostic timing; it does not replay any message.
12
+
13
+ The acceptance evidence includes malformed and duplicated worker messages, both sides of each deadline, real worker teardown, HTTP health, production boot, and installed-instruction migration. Release readiness still requires the full local suite and normal CI gates.
14
+
15
+ The release gates also found two nearby timing races under heavy load. Starting a storage worker now has a separate bounded allowance from asking an already-running worker to do one operation. Test receivers also announce when raw terminal mode is truly active before accepting a large tmux payload. These do not change who may send a message; they keep slow startup from being mistaken for broken storage or truncated input.
16
+
17
+ One final aggregate test showed that the normal configuration and alert-policy readers still had native filesystem watchers in the main process. Those readers could finish their work and then spend over 30 seconds closing watchers on macOS. They now check the exact source files on a short background cadence and stop by cancelling that timer. Configuration, encrypted-secret, credential, and alert-destination changes still revoke stale authority promptly, while normal shutdown no longer waits on the operating system's watcher close path.
18
+
19
+ That background check is also registered in Instar's self-action convergence guard. The guard proves its cadence stays fixed at one pass per 250 milliseconds under sustained pressure and cannot accelerate into a tight loop.