Skip to content

fix: suppress repeated process-event wakes during continuous outages - #7386

Open
arthurcruzd wants to merge 2 commits into
kunchenguid:mainfrom
arthurcruzd:fm/fm-offline-remote-wake-flap
Open

arthurcruzd wants to merge 2 commits into
kunchenguid:mainfrom
arthurcruzd:fm/fm-offline-remote-wake-flap

Conversation

@arthurcruzd

Copy link
Copy Markdown
Contributor

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

  • Keep one launch-failure episode per source across relaunches and re-registrations, suppressing repeated wakes during a continuous outage.
  • Close the episode only when a runner captures a result or relistens after a clean empty window; ownership and launch confirmation no longer clear it. Relaunch behavior remains unchanged.
  • Add regression coverage for flapping sources and recovery followed by another failure, and update wake text and documentation to match.

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.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Repeated launches, re-registration, brief ownership, and an SSH failure produce one outage announcement ✅ pass live Live lifecycle transcript and wake queue
A captured result ends the outage and a subsequent failure announces again ✅ pass live Live lifecycle transcript: captured recovery enables a second distinct announcement
A clean empty window followed by relistening ends the outage and permits another announcement ✅ pass live Live lifecycle transcript: clean empty window relistens and clears episode
Retiring a source clears its outage marker so re-arming starts fresh ✅ pass live Live lifecycle transcript: retire then re-arm starts fresh episode
Evidence: Live lifecycle transcript and wake queue

Source: Live lifecycle transcript and wake queue

$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061640
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']
$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061645
$ fm-procevent.sh reconcile
exit=0 reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0 
$ fm-procevent.sh reconcile
exit=0 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=0 

STATE: claimed and blocked; outage must remain open marker= 2049-4061640 167421021
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  lavish       live       0 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']
$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061649
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']

STATE: continuous outage across re-registrations and SSH failure marker= 2049-4061640 167421021
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  lavish       none       0 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021']
PASS: one continuous outage, retries unchanged, one announcement
$ fm-procevent.sh register lavish outage-live -- /usr/bin/printf recovered payload
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061650
$ fm-procevent.sh reconcile
exit=0 reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0 
CAPTURE: recovered payload
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=1 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178']

STATE: new outage after durable capture marker= 2049-4061650 1029719178
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  lavish       none       1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178']
PASS: captured recovery enables a second distinct announcement
$ fm-procevent.sh register remote-reply outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/empty.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/round ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/relistened ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/finish-empty
exit=0 registered: outage-live (remote-reply) 
registration device:inode = 2049:4061886
$ fm-procevent.sh reconcile
exit=0 reconciled: published=1 started=1 stopped=0 uncertain=0 failed=0 

STATE: clean empty window relistens and clears episode marker= absent
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  remote-reply live       1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178']
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=1 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178', 'procevent:outage-live:launch-failed:2049-4061886-18666776']
PASS: clean empty relisten enables a new announcement
$ fm-procevent.sh retire outage-live
exit=0 retired: outage-live 
$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-inmkobru/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061886
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=1 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178', 'procevent:outage-live:launch-failed:2049-4061886-18666776', 'procevent:outage-live:launch-failed:2049-4061886-208754173']

STATE: retire then re-arm starts fresh episode marker= 2049-4061886 208754173
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  lavish       none       1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061640-167421021', 'procevent:outage-live:launch-failed:2049-4061650-1029719178', 'procevent:outage-live:launch-failed:2049-4061886-18666776', 'procevent:outage-live:launch-failed:2049-4061886-208754173']
PASS: retirement clears outage marker
FINAL WAKE QUEUE:
1792126913	1	check	procevent:outage-live:launch-failed:2049-4061640-167421021	check: process-event source outage-live is registered but its launch did not prove it took the source's claim within FM_PROCEVENT_LAUNCH_CONFIRM_SECONDS, so nothing is confirmed to be collecting from it; reconcile reports that as failed= and keeps launching it every supervision cycle. If it stays that way, check the source command and the adapter binary the registration names, and run an attached bin/fm-procevent.sh start outage-live to reproduce a refusal on its stderr - the detached launch discards it, and a hand-run reconcile only counts it as failed=. This is announced once per outage, not once per relaunch or re-registration: the episode ends on its own when a runner of this source returns a result or a clean empty window, so a runner that was merely slow to claim, or a host that comes back, needs nothing from you.
1792126927	2	check	procevent:outage-live:1	check: procevent lavish outage-live 1
1792126929	3	check	procevent:outage-live:1	check: procevent lavish outage-live 1
1792126933	4	check	procevent:outage-live:launch-failed:2049-4061650-1029719178	check: process-event source outage-live is registered but its launch did not prove it took the source's claim within FM_PROCEVENT_LAUNCH_CONFIRM_SECONDS, so nothing is confirmed to be collecting from it; reconcile reports that as failed= and keeps launching it every supervision cycle. If it stays that way, check the source command and the adapter binary the registration names, and run an attached bin/fm-procevent.sh start outage-live to reproduce a refusal on its stderr - the detached launch discards it, and a hand-run reconcile only counts it as failed=. This is announced once per outage, not once per relaunch or re-registration: the episode ends on its own when a runner of this source returns a result or a clean empty window, so a runner that was merely slow to claim, or a host that comes back, needs nothing from you.
1792126935	5	check	procevent:outage-live:1	check: procevent lavish outage-live 1
1792126941	6	check	procevent:outage-live:1	check: procevent lavish outage-live 1
1792126944	7	check	procevent:outage-live:launch-failed:2049-4061886-18666776	check: process-event source outage-live is registered but its launch did not prove it took the source's claim within FM_PROCEVENT_LAUNCH_CONFIRM_SECONDS, so nothing is confirmed to be collecting from it; reconcile reports that as failed= and keeps launching it every supervision cycle. If it stays that way, check the source command and the adapter binary the registration names, and run an attached bin/fm-procevent.sh start outage-live to reproduce a refusal on its stderr - the detached launch discards it, and a hand-run reconcile only counts it as failed=. This is announced once per outage, not once per relaunch or re-registration: the episode ends on its own when a runner of this source returns a result or a clean empty window, so a runner that was merely slow to claim, or a host that comes back, needs nothing from you.
1792126946	8	check	procevent:outage-live:1	check: procevent lavish outage-live 1
1792126949	9	check	procevent:outage-live:launch-failed:2049-4061886-208754173	check: process-event source outage-live is registered but its launch did not prove it took the source's claim within FM_PROCEVENT_LAUNCH_CONFIRM_SECONDS, so nothing is confirmed to be collecting from it; reconcile reports that as failed= and keeps launching it every supervision cycle. If it stays that way, check the source command and the adapter binary the registration names, and run an attached bin/fm-procevent.sh start outage-live to reproduce a refusal on its stderr - the detached launch discards it, and a hand-run reconcile only counts it as failed=. This is announced once per outage, not once per relaunch or re-registration: the episode ends on its own when a runner of this source returns a result or a clean empty window, so a runner that was merely slow to claim, or a host that comes back, needs nothing from you.

$ fm-procevent.sh retire outage-live
exit=0 retired: outage-live 
Disposable home removed.
Evidence: Baseline reproduces premature episode closure

Source: Baseline reproduces premature episode closure

$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061883
Fault injection: remove registered argv in place; launches cannot claim.
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061883-1348732569']
$ fm-procevent.sh reconcile
exit=1 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=1 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061883-1348732569']
$ fm-procevent.sh register lavish outage-live -- ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/transport.sh ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/release ~/.no-mistakes/worktrees/9ebe5b46efa6/01M51H767V0TKZRM24K24DAX9C/.outage-live-tob9bypm/ssh-exit
exit=0 registered: outage-live (lavish) 
registration device:inode = 2049:4061901
$ fm-procevent.sh reconcile
exit=0 reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0 
$ fm-procevent.sh reconcile
exit=0 reconciled: published=0 started=0 stopped=0 uncertain=0 failed=0 

STATE: claimed and blocked; outage must remain open marker= absent
$ fm-procevent.sh list
exit=0 SOURCE                       ADAPTER      OWNER      PENDING
outage-live                  lavish       live       0 
launch-failed wake keys: ['procevent:outage-live:launch-failed:2049-4061883-1348732569']
$ fm-procevent.sh retire outage-live
exit=0 retired: outage-live 
Disposable home removed.
Traceback (most recent call last):
  File "~/.no-mistakes/evidence/01M51H767V0TKZRM24K24DAX9C/drive.py", line 68, in <module>
    assert marker.exists() and marker.read_text()==first
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Evidence: Reproducible isolated CLI scenario driver

Source: Reproducible isolated CLI scenario driver

import os, pathlib, subprocess, tempfile, time, shutil, sys
root=pathlib.Path.cwd()
lab=pathlib.Path(tempfile.mkdtemp(prefix='.outage-live-',dir=root))
cli=root/(sys.argv[1] if len(sys.argv)>1 else 'bin/fm-procevent.sh')
env=os.environ.copy()
for k in list(env):
    if (k.startswith('FM_') and k.endswith('_OVERRIDE')) or k in ('FM_GATE_REFUSE_BYPASS','FM_TEST_SEAM','FM_TASK_ID'): env.pop(k)
env.update(FM_HOME=str(lab),FM_PROCEVENT_CLAIM_ROOT=str(lab/'claims'))
(lab/'state').mkdir(mode=0o700)
id='outage-live'
reg=lab/'state/procevent'/f'{id}.source'
marker=reg.parent/f'.{id}.launch-failed'
claim=lab/'claims'/f'{id}.claim'
trigger=lab/'release'
source=lab/'transport.sh'
source.write_text('''#!/bin/sh
while [ ! -e "$1" ]; do sleep 0.1; done
ssh -F /dev/null -o BatchMode=yes -o ConnectTimeout=1 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/dev/null -p 1 127.0.0.1 true
rc=$?
printf '%s\\n' "$rc" > "$2"
exit "$rc"
''')
source.chmod(0o700)
def run(*args,window=2):
    e=env.copy(); e['FM_PROCEVENT_LAUNCH_CONFIRM_SECONDS']=str(window)
    p=subprocess.run([str(cli),*args],env=e,text=True,capture_output=True,timeout=65)
    print('$ fm-procevent.sh '+' '.join(args),flush=True)
    print(f'exit={p.returncode} {p.stdout.strip()} {p.stderr.strip()}',flush=True)
    return p

def register(adapter='lavish',argv=None):
    p=run('register',adapter,id,'--',*(argv or [str(source),str(trigger),str(lab/'ssh-exit')]))
    assert p.returncode==0
    print('registration device:inode =',f'{reg.stat().st_dev}:{reg.stat().st_ino}',flush=True)

def damage():
    text=reg.read_text(); reg.write_text(text.split('argv:\n')[0]+'argv:\n')
    print('Fault injection: remove registered argv in place; launches cannot claim.',flush=True)

def wait(predicate,label):
    deadline=time.monotonic()+35
    while time.monotonic()<deadline:
        if predicate(): return
        time.sleep(.1)
    raise AssertionError('Timed out: '+label)

def wakes():
    q=lab/'state/.wake-queue'
    rows=[r for r in q.read_text().splitlines() if f'procevent:{id}:launch-failed:' in r] if q.exists() else []
    print('launch-failed wake keys:',[r.split('\t')[3] for r in rows],flush=True)
    return rows

def fail_launch(n):
    p=run('reconcile'); assert p.returncode!=0 and 'failed=1' in p.stdout
    assert len(wakes())==n

def snapshot(label):
    print('\nSTATE:',label,'marker=',marker.read_text().strip() if marker.exists() else 'absent',flush=True)
    run('list'); wakes()

try:
    register(); damage(); fail_launch(1); fail_launch(1)
    first=marker.read_text(); inode=reg.stat().st_ino
    register(); assert reg.stat().st_ino!=inode
    p=run('reconcile',window=30); assert 'failed=0' in p.stdout
    wait(claim.exists,'claimed'); run('reconcile')
    snapshot('claimed and blocked; outage must remain open')
    assert marker.exists() and marker.read_text()==first
    trigger.touch(); wait(lambda:not claim.exists(),'failed read released')
    assert (lab/'ssh-exit').read_text().strip()=='255'
    assert not list((lab/'state/procevent-inbox').glob('*.result'))
    damage(); fail_launch(1); register(); damage(); fail_launch(1)
    snapshot('continuous outage across re-registrations and SSH failure')
    print('PASS: one continuous outage, retries unchanged, one announcement',flush=True)

    register(argv=['/usr/bin/printf','recovered payload'])
    run('reconcile',window=30)
    wait(lambda:bool(list((lab/'state/procevent-inbox').glob('*.result'))) and not claim.exists(),'captured recovery')
    assert not marker.exists() and reg.exists()
    for f in (lab/'state/procevent-inbox').glob('*.result'): print('CAPTURE:',f.read_text(),flush=True)
    damage(); fail_launch(2)
    snapshot('new outage after durable capture')
    print('PASS: captured recovery enables a second distinct announcement',flush=True)

    empty=lab/'empty.sh'; roundfile=lab/'round'
    empty.write_text('''#!/bin/sh
if [ ! -e "$1" ]; then touch "$1"; exit 75; fi
touch "$2"
while [ ! -e "$3" ]; do sleep 0.1; done
exit 255
'''); empty.chmod(0o700)
    register('remote-reply',[str(empty),str(roundfile),str(lab/'relistened'),str(lab/'finish-empty')])
    run('reconcile',window=30)
    wait(lambda:(lab/'relistened').exists(),'second clean-empty poll')
    assert not marker.exists() and claim.exists()
    snapshot('clean empty window relistens and clears episode')
    (lab/'finish-empty').touch(); wait(lambda:not claim.exists(),'empty runner exited')
    damage(); fail_launch(3)
    print('PASS: clean empty relisten enables a new announcement',flush=True)

    run('retire',id); assert not marker.exists() and not reg.exists() and not claim.exists()
    register(); damage(); fail_launch(4)
    snapshot('retire then re-arm starts fresh episode')
    print('PASS: retirement clears outage marker',flush=True)
    print('FINAL WAKE QUEUE:\n'+(lab/'state/.wake-queue').read_text(),flush=True)
finally:
    run('retire',id)
    shutil.rmtree(lab)
    print('Disposable home removed.',flush=True)

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.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Repeated launches, re-registration, brief ownership, and an SSH failure produce one outage announcement ✅ pass live Live lifecycle transcript and wake queue
A captured result ends the outage and a subsequent failure announces again ✅ pass live Live lifecycle transcript: captured recovery enables a second distinct announcement
A clean empty window followed by relistening ends the outage and permits another announcement ✅ pass live Live lifecycle transcript: clean empty window relistens and clears episode
Retiring a source clears its outage marker so re-arming starts fresh ✅ pass live Live lifecycle transcript: retire then re-arm starts fresh episode
  • python3 ~/.no-mistakes/evidence/01M51H767V0TKZRM24K24DAX9C/drive.py drove 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.sh reproduced premature marker removal using the base implementation.
  • Removed disposable homes and baseline files; git status --short was clean.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

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.
@kunchenguid

Copy link
Copy Markdown
Owner

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

  1. One captain, one interface: aligns, with a caution — far less repeat noise during a continuous outage; but "silence never hides a failure" means the new closing rule matters: a generic source that blocks indefinitely (e.g. a board waiting for days) keeps an old episode open, so a later genuine failure after a long healthy-but-quiet stretch would not re-announce.
  2. Authority is explicit: aligns — no new authority; relaunch behaviour unchanged.
  3. Scripts own the mechanics: aligns — episode lifecycle stays scripted and exact.
  4. A restart is a non-event: aligns — episode is the durable marker; retire still clears it.
  5. Delegation with a spine: aligns — regression reproduces the flapping shape (3 → 1 announcement) and proves recovery re-announces; 4/4 live.
  6. The fleet outlives any vendor: aligns — adapter-agnostic.
  7. Scope: aligns — procevent/watch/docs/skill only.

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.

arthurcruzd added a commit to arthurcruzd/firstmate that referenced this pull request Oct 28, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants