Repository navigation
fix: suppress repeated process-event wakes during continuous outages - #7386
arthurcruzd wants to merge 2 commits into
Conversation
A remote secondmate whose host is offline produced a fresh "process-event source failed to start" wake every few cycles. Two things ended or re-keyed the failure episode during one continuous outage: reconcile closed it as soon as it saw the source owned or a launch confirm, though the runner then died on the ssh timeout with nothing read, and the episode was keyed by the registration identity, which every session-start re-arm replaces. An episode now belongs to the source and stays open while its marker exists. Only the runner ends it, once its source command returns a result or a clean empty window it relistens after; a failed read leaves it open. Reconcile's relaunch behavior is unchanged, and a source that genuinely recovers and fails again still announces a new episode.
|
Speaking as Kun's firstmate: thanks @arthurcruzd — 27 wakes for one offline host is exactly the kind of noise worth fixing, and the live lifecycle transcript plus baseline repro are excellent evidence. VISION per-rule
Contract-class: new-default (my own read of tip vs main). Main explicitly specifies the episode as keyed by registration identity and closed when a later cycle finds the source owned or a launch confirms; that path was working as written. This PR replaces it with a per-source episode closed only by a collected result/clean empty window, which changes what the unconfigured supervisor wakes on. That's a captain merge-or-leave call, so it won't auto-merge. CI: all required checks green on 7fb2497. This is now with the captain as a new-default decision; nothing further needed from you unless the captain asks. |
Bring the fork's fleet branch up to upstream main, keeping the fleet-only work upstream has not merged. Upstream's explicit-only T3 Code backend (kunchenguid#7518) is the base for every T3 file; the fleet's earlier copy of that PR is superseded by it, along with its own semantic-supervision push (upstream's pending-request watch), the T3 capture, telemetry, interrupt-verdict, and launch-ownership fixes, and the Claude env-channel ownership (upstream's FM_T3CODE_ENV_KEYS). On top of it the fleet keeps: the T3-hosted primary and its wake relay (bin/fm-t3-host.sh), remote second mates on a host's T3 server, quiet and away mode and the supervision host under the relay, Grok and Muse T3 workers, exit by archive with a relaunch that resumes the same thread, restart reconciliation, the foreign-slot refusal, local-interface telemetry, and the T3 0.1.2 standard-scope sign-in. Also kept: the open contributions for supervisor noise (kunchenguid#7726), one launch-failed wake per outage (kunchenguid#7386), status-file birth times (kunchenguid#7384), the take-over watcher TERM fix (kunchenguid#6916), and the fleet-only second-mate reply-source and CI commits.
Intent
Stop the repeated "process-event source failed to start" wakes that reach the primary while a remote secondmate's machine is offline (asked as: fix it, it looks like a hiccup). A Windows notebook hosting the pbi secondmate (WSL, ssh route wsl) was unreachable for over 24 hours from 2026-10-15; most wakes relayed to the primary were check: process-event source failed to start: procevent:remote-reply-pbi:launch-failed:-, each with a different episode. Measured evidence from the primary wake queue: 27 launch-failed announcements across 13 distinct registration identities for that one outage, up to 8 under a single identity. The outage itself is already reported elsewhere (session-start SECONDMATE_LIVENESS: remote host unavailable), so each repeat told the operator nothing new. Diagnosis (from code and a reproduction): both suspected causes were real. (1) reconcile closed the episode (removed the .launch-failed marker) as soon as a cycle found the source owned or a launch confirmed, but a remote-reply runner for an unreachable host claims, blocks on ssh, then exits 255 with empty stdout (a failed read), so the next unconfirmed launch opened a new episode under the same identity; (2) the episode was keyed by the registration file device:inode, and every re-arm (session-start bootstrap re-arms remote secondmates) publishes a new file, so each re-registration also re-keyed it. Requirement: one continuous outage of a source produces at most one launch-failed wake, while a source that genuinely recovers and later fails again still announces a new one. Decisions: the episode now belongs to the source id and stays open while its marker exists, across relaunches and re-registrations; only the runner ends it, once its source command proves it collected (a captured result, or a clean empty window it relistens after); a failed read leaves it open; seeing the source owned or a confirmed launch deliberately no longer closes it (a generic source blocking indefinitely keeps an earlier episode open until it returns, accepted as the cost of not trusting a bare sighting). Reconcile relaunch behavior is unchanged, marker and queue-key formats are unchanged (key still names the registration identity the episode began under plus a nonce), and retire still clears the marker. Function header comments, the wake payload text, the fm-watch.sh wake docs, docs/configuration.md and the process-event-sources skill were updated to the new contract. A regression test colocated in tests/fm-procevent.test.sh reproduces the flapping shape (failed, re-registered and briefly owned then dead read, failed again, re-registered and failed) and proves a single announcement, then proves a real recovery followed by a failure announces a second; it fails on the old code (3 announcements) and passes on the fix. Out of scope: how secondmate liveness is reported, the mailbox doorbell, the T3 relay, session-reopen messages, and hardening existing load-sensitive tests in that file that use a 2-3 second confirm window (they flake on a heavily loaded 2-vCPU host on unchanged code too). Only targeted tests for touched files should run on this 2-vCPU VPS, never the full suite.
What Changed
Risk Assessment
✅ Low: The bounded lifecycle change matches the outage contract, preserves relaunch behavior, and includes a behavioral regression covering repeated failures and genuine recovery.
Testing
Targeted live CLI checks passed for outage deduplication, both recovery paths, and retirement. The baseline failed as expected. Setup permissions and an invalid fixture argument were corrected before the successful run. Transcripts preserve product output and wake records; all disposable files were removed. No full suite or static analysis ran.
Evidence: Live lifecycle transcript and wake queue
Source: Live lifecycle transcript and wake queue
Evidence: Baseline reproduces premature episode closure
Source: Baseline reproduces premature episode closure
Evidence: Reproducible isolated CLI scenario driver
Source: Reproducible isolated CLI scenario driver
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
python3 ~/.no-mistakes/evidence/01M51H767V0TKZRM24K24DAX9C/drive.pydrove real register, reconcile, list, capture, and retire commands in a disposable worktree-local home.Exercised a real SSH connection failure against a closed localhost port; verified exit 255, no captured result, and preserved outage identity.python3 ~/.no-mistakes/evidence/01M51H767V0TKZRM24K24DAX9C/drive.py .outage-baseline/bin/fm-procevent.shreproduced premature marker removal using the base implementation.Removed disposable homes and baseline files;git status --shortwas clean.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.