Skip to content

fix: stop task browser bridge groups during teardown - #55

Merged
peterOC26 merged 5 commits into
mainfrom
fm/fm-teardown-stop-browser-bridges-b1
Nov 12, 2026
Merged

peterOC26 merged 5 commits into
mainfrom
fm/fm-teardown-stop-browser-bridges-b1

Conversation

@peterOC26

@peterOC26 peterOC26 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Intent

Teardown leaves the finished task's browser bridge running. Found 2026-11-02 17:44Z: 50 chrome-devtools-axi bridges (each with npm exec + chrome-devtools-mcp) from finished tasks were still running; swap was 8191/8191 MB and MemAvailable 3.3 GB, which stalled live test calls and the nightly run. Each bridge carries FM_TASK_ID and CHROME_DEVTOOLS_AXI_SESSION in its environment and is its own process group. Firstmate stopped the 49 whose task had no state meta (kill -TERM -- -pgid): MemAvailable went to 8.9 GB, swap to 3.7 GB. Fix: bin/fm-teardown.sh stops the bridge process group whose FM_TASK_ID is the torn-down task.
Part of the firstmate upkeep batch the captain approved (Q1931 A sweep; Q1994: "use grok and deepseek" - Grok builds).

What Changed

  • Stop detached chrome-devtools-axi bridge process groups during accepted teardown, matching the current user, task ID, and home inbox.
  • Send TERM, then KILL surviving groups after a short wait, with process identity checks and warnings that preserve the teardown result.
  • Add regression coverage for cleanup, ownership exclusions, refused teardown, and identity changes; document that FM_PROC_ROOT_OVERRIDE disables bridge cleanup.

Risk Assessment

⚠️ Medium: The change sends TERM and then KILL to whole process groups, but several checks narrow who gets signaled: same uid, the exact FM_TASK_ID plus this home's FM_TASK_INBOX, a node leader running chrome-devtools-axi-bridge.js, and starttime identity rechecks before each signal. It runs only after cleanup is accepted, and it is best effort, so it cannot change the teardown result. Executable tests cover the main paths. The one remaining item is a deduplication cleanup.

Testing

Reproduced the base-commit leak, passed five live cleanup and boundary scenarios with real bridges, and passed focused executable regressions and fault injections. Product transcripts were captured, temporary files were removed, and remaining live limitations are explicit.

  • Live validation: ✅ go - 5 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Accepted cleanup stops the finished task's real bridge, npm, and MCP group and closes its record ✅ pass live Original leak reproduced on base commit; Live bridge cleanup, KILL escalation, and ownership exclusions
A suspended bridge survives TERM and is removed by KILL escalation ✅ pass live Live bridge cleanup, KILL escalation, and ownership exclusions
Cleanup preserves another task's bridge, another home's bridge, missing ownership markers, and a non-bridge process ✅ pass live Live bridge cleanup, KILL escalation, and ownership exclusions
Cleanup refuses uncommitted work and preserves the task record, file contents, and responsive bridge ✅ pass live Dirty-work refusal preserves responsive bridge
A set-but-empty proc override silently skips bridge cleanup while task cleanup succeeds ✅ pass live Proc override silently preserves bridge
KILL is skipped when no recorded member identity still matches ⏸️ untested no Executable fault injection passed, but real kernel PID/starttime replacement was not driven. Live reproduction requires a disposable environment with controlled PID reuse.
Unavailable uid or process snapshot warns without failing accepted cleanup ⏸️ untested no Both executable fault injections passed. This host provides working uid and process inspection; live reproduction requires a disposable host exhibiting those OS failures.
A host without procfs silently skips bridge cleanup ⏸️ untested no No host without /proc is available. Provide a macOS runner or another disposable environment without procfs.
Another user's bridge remains running ⏸️ untested no No second-user launch credential or authorized launcher was supplied. Provide a disposable second OS account to exercise this boundary live.
Evidence: Live bridge cleanup, KILL escalation, and ownership exclusions

Source: Live bridge cleanup, KILL escalation, and ownership exclusions

$ bash bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d
exit=0
$ tasks-axi add bridge-live-b1 Disposable live bridge validation --kind ship --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md
ok: added bridge-live-b1 (ship) -> Queued
task:
  id: bridge-live-b1
  title: Disposable live bridge validation
  state: queued
  blocked: no
  blocked_by: none
  held: no
  hold_reason: "-"
  hold_kind: "-"
  hold_until: "-"
  kind: ship
  repo: "-"
  priority: "-"
  created: 2026-11-11
  closed: "-"
  deps: none
  links: none
  body: ""
help[2]:
  - Run `tasks-axi start bridge-live-b1 --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md` to move it to in flight
  - Run `tasks-axi block bridge-live-b1 --by <other> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md` to record a dependency
exit=0
$ tasks-axi start bridge-live-b1 --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md
ok: start bridge-live-b1 -> In flight
help[1]:
  - Run `tasks-axi done bridge-live-b1 --pr <url> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md` when it ships
exit=0
Installed product versions:
$ chrome-devtools-axi --version
0.1.46
exit=0
$ chrome-devtools-axi start
status: ready
port: 38899
exit=0
BRIDGE own: {"pid": 2537750, "state": "S", "ppid": 1, "pgid": 2537750, "start": "108479608", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi pages
pages[1]{id,url,selected}:
  1,about:blank,false
help[2]:
  Run `chrome-devtools-axi selectpage <id>` to switch tabs
  Run `chrome-devtools-axi newpage <url>` to open a new tab
exit=0
$ chrome-devtools-axi start
status: ready
port: 50089
exit=0
BRIDGE stopped: {"pid": 2539093, "state": "S", "ppid": 1, "pgid": 2539093, "start": "108479874", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi start
status: ready
port: 60289
exit=0
BRIDGE other-task: {"pid": 2540145, "state": "S", "ppid": 1, "pgid": 2540145, "start": "108480129", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi start
status: ready
port: 60143
exit=0
BRIDGE other-home: {"pid": 2542073, "state": "S", "ppid": 1, "pgid": 2542073, "start": "108480380", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi start
status: ready
port: 57023
exit=0
BRIDGE missing-inbox: {"pid": 2543298, "state": "S", "ppid": 1, "pgid": 2543298, "start": "108480649", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi start
status: ready
port: 54275
exit=0
BRIDGE missing-task: {"pid": 2545454, "state": "S", "ppid": 1, "pgid": 2545454, "start": "108480909", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
Group member before teardown: {"pid": 2537750, "state": "S", "ppid": 1, "pgid": 2537750, "start": "108479608", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
Group member before teardown: {"pid": 2537819, "state": "S", "ppid": 2537750, "pgid": 2537750, "start": "108479636", "command": "npm exec chrome-devtools-mcp@latest --userDataDir=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/chrome-own --headless --chrome-arg=--use-mock-keychain --chrome-arg=--password-store=basic --executablePath=/usr/bin/chromium --chrome-arg=--no-sandbox --chrome-arg=--disable-dev-shm-usage             "}
Group member before teardown: {"pid": 2538495, "state": "S", "ppid": 2537819, "pgid": 2537750, "start": "108479746", "command": "sh -c 'chrome-devtools-mcp' --userDataDir=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/chrome-own --headless --chrome-arg=--use-mock-keychain --chrome-arg=--password-store=basic --executablePath=/usr/bin/chromium --chrome-arg=--no-sandbox --chrome-arg=--disable-dev-shm-usage "}
Group member before teardown: {"pid": 2538498, "state": "S", "ppid": 2538495, "pgid": 2537750, "start": "108479746", "command": "chrome-devtools-mcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "}
Group member before teardown: {"pid": 2539093, "state": "T", "ppid": 1, "pgid": 2539093, "start": "108479874", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
Group member before teardown: {"pid": 2539153, "state": "S", "ppid": 2539093, "pgid": 2539093, "start": "108479903", "command": "npm exec chrome-devtools-mcp@latest --userDataDir=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/chrome-stopped --headless --chrome-arg=--use-mock-keychain --chrome-arg=--password-store=basic --executablePath=/usr/bin/chromium --chrome-arg=--no-sandbox --chrome-arg=--disable-dev-shm-usage             "}
Group member before teardown: {"pid": 2539455, "state": "S", "ppid": 2539153, "pgid": 2539093, "start": "108479977", "command": "sh -c 'chrome-devtools-mcp' --userDataDir=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/chrome-stopped --headless --chrome-arg=--use-mock-keychain --chrome-arg=--password-store=basic --executablePath=/usr/bin/chromium --chrome-arg=--no-sandbox --chrome-arg=--disable-dev-shm-usage "}
Group member before teardown: {"pid": 2539456, "state": "S", "ppid": 2539455, "pgid": 2539093, "start": "108479977", "command": "chrome-devtools-mcp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "}
Stopped bridge before teardown: {"pid": 2539093, "state": "T", "ppid": 1, "pgid": 2539093, "start": "108479874", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ bash bin/fm-teardown.sh bridge-live-b1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: lsof is unavailable; cannot resolve the tmux pane process group for bridge-live-b1
teardown: stopping chrome-devtools-axi bridge process group for bridge-live-b1: 2537750
teardown: stopping chrome-devtools-axi bridge process group for bridge-live-b1: 2539093
teardown: force-killing chrome-devtools-axi bridge process group for bridge-live-b1: 2539093
teardown bridge-live-b1 complete (window none, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/gone-worktree, legacy record accepted without spawn_gen: endpoint missing, incarnation legacy-20261111T202016Z-2548170)
Backlog: bridge-live-b1 is closed in ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.jd9_0m8d/data/backlog.md. Run bin/fm-tasks-axi.sh ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due.
exit=0
After accepted teardown own: {"pid": 2537750, "state": "absent"}
After accepted teardown stopped: {"pid": 2539093, "state": "absent"}
Owned group member after teardown: {"pid": 2537750, "state": "absent"}
Owned group member after teardown: {"pid": 2537819, "state": "absent"}
Owned group member after teardown: {"pid": 2538495, "state": "absent"}
Owned group member after teardown: {"pid": 2538498, "state": "absent"}
Owned group member after teardown: {"pid": 2539093, "state": "absent"}
Owned group member after teardown: {"pid": 2539153, "state": "absent"}
Owned group member after teardown: {"pid": 2539455, "state": "absent"}
Owned group member after teardown: {"pid": 2539456, "state": "absent"}
After accepted teardown other-task: {"pid": 2540145, "state": "S", "ppid": 1, "pgid": 2540145, "start": "108480129", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
After accepted teardown other-home: {"pid": 2542073, "state": "S", "ppid": 1, "pgid": 2542073, "start": "108480380", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
After accepted teardown missing-inbox: {"pid": 2543298, "state": "S", "ppid": 1, "pgid": 2543298, "start": "108480649", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
After accepted teardown missing-task: {"pid": 2545454, "state": "S", "ppid": 1, "pgid": 2545454, "start": "108480909", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
After accepted teardown non-bridge: {"pid": 2548066, "state": "S", "ppid": 2537620, "pgid": 2548066, "start": "108481154", "command": "sleep 300 "}
$ chrome-devtools-axi pages
pages[1]{id,url,selected}:
  1,about:blank,false
help[2]:
  Run `chrome-devtools-axi selectpage <id>` to switch tabs
  Run `chrome-devtools-axi newpage <url>` to open a new tab
exit=0
OBSERVED: matching bridges stopped; stopped leader required KILL; all ownership exclusions survived; other task browser still responds.
LIVE BRIDGE SCENARIOS PASS
$ chrome-devtools-axi stop
status: stopped (no-op)
exit=0
$ chrome-devtools-axi stop
status: stopped (no-op)
exit=0
$ chrome-devtools-axi stop
status: stopped
exit=0
$ chrome-devtools-axi stop
status: stopped
exit=0
$ chrome-devtools-axi stop
status: stopped
exit=0
$ chrome-devtools-axi stop
status: stopped
exit=0
Disposable lab and owned bridge groups removed.
Evidence: Dirty-work refusal preserves responsive bridge

Source: Dirty-work refusal preserves responsive bridge

$ bash bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf
exit=0
$ git -C ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/project init -q -b main

exit=0
$ git -C ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/project -c user.name=Lab -c [email protected] commit -q --allow-empty -m baseline

exit=0
$ git clone -q ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/project ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/unlanded

exit=0
$ git -C ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/unlanded checkout -q -b task-unlanded

exit=0
$ chrome-devtools-axi start
status: ready
port: 50373
exit=0
BRIDGE refused: {"pid": 2542789, "state": "S", "ppid": 1, "pgid": 2542789, "start": "108480573", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ tasks-axi add bridge-refused-b1 Disposable live bridge validation --kind ship --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/data/backlog.md
ok: added bridge-refused-b1 (ship) -> Queued
task:
  id: bridge-refused-b1
  title: Disposable live bridge validation
  state: queued
  blocked: no
  blocked_by: none
  held: no
  hold_reason: "-"
  hold_kind: "-"
  hold_until: "-"
  kind: ship
  repo: "-"
  priority: "-"
  created: 2026-11-11
  closed: "-"
  deps: none
  links: none
  body: ""
help[2]:
  - Run `tasks-axi start bridge-refused-b1 --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/data/backlog.md` to move it to in flight
  - Run `tasks-axi block bridge-refused-b1 --by <other> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/data/backlog.md` to record a dependency
exit=0
$ tasks-axi start bridge-refused-b1 --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/data/backlog.md
ok: start bridge-refused-b1 -> In flight
help[1]:
  - Run `tasks-axi done bridge-refused-b1 --pr <url> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/data/backlog.md` when it ships
exit=0
$ bash bin/fm-teardown.sh bridge-refused-b1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.7juf34wf/unlanded has uncommitted changes.
uncommitted changes present (untracked-only leftovers)
untracked paths (up to 10):
  uncommitted.txt
Commit them (or get the captain's explicit OK to discard, then --force).
exit=1
After dirty-worktree refusal bridge: {"pid": 2542789, "state": "S", "ppid": 1, "pgid": 2542789, "start": "108480573", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi pages
pages[1]{id,url,selected}:
  1,about:blank,false
help[2]:
  Run `chrome-devtools-axi selectpage <id>` to switch tabs
  Run `chrome-devtools-axi newpage <url>` to open a new tab
exit=0
OBSERVED: dirty-worktree refusal preserved the byte-identical task record, uncommitted file, and responsive real bridge.
LIVE DIRTY REFUSAL PASS
$ chrome-devtools-axi stop
status: stopped
exit=0
Disposable lab and owned bridge groups removed.
Evidence: Proc override silently preserves bridge

Source: Proc override silently preserves bridge

$ bash bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo
exit=0
$ chrome-devtools-axi start
status: ready
port: 50227
exit=0
BRIDGE override: {"pid": 2542757, "state": "S", "ppid": 1, "pgid": 2542757, "start": "108480569", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ tasks-axi add bridge-live-b1 Disposable live bridge validation --kind ship --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md
ok: added bridge-live-b1 (ship) -> Queued
task:
  id: bridge-live-b1
  title: Disposable live bridge validation
  state: queued
  blocked: no
  blocked_by: none
  held: no
  hold_reason: "-"
  hold_kind: "-"
  hold_until: "-"
  kind: ship
  repo: "-"
  priority: "-"
  created: 2026-11-11
  closed: "-"
  deps: none
  links: none
  body: ""
help[2]:
  - Run `tasks-axi start bridge-live-b1 --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md` to move it to in flight
  - Run `tasks-axi block bridge-live-b1 --by <other> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md` to record a dependency
exit=0
$ tasks-axi start bridge-live-b1 --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md
ok: start bridge-live-b1 -> In flight
help[1]:
  - Run `tasks-axi done bridge-live-b1 --pr <url> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md` when it ships
exit=0
Teardown environment: FM_PROC_ROOT_OVERRIDE is set to the empty string.
$ bash bin/fm-teardown.sh bridge-live-b1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 5s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: lsof is unavailable; cannot resolve the tmux pane process group for bridge-live-b1
teardown bridge-live-b1 complete (window none, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/gone-worktree, legacy record accepted without spawn_gen: endpoint missing, incarnation legacy-20261111T202014Z-2545203)
Backlog: bridge-live-b1 is closed in ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.ht5y8vuo/data/backlog.md. Run bin/fm-tasks-axi.sh ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due.
exit=0
Real bridge after override teardown: {"pid": 2542757, "state": "S", "ppid": 1, "pgid": 2542757, "start": "108480569", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi pages
pages[1]{id,url,selected}:
  1,about:blank,false
help[2]:
  Run `chrome-devtools-axi selectpage <id>` to switch tabs
  Run `chrome-devtools-axi newpage <url>` to open a new tab
exit=0
OBSERVED: accepted teardown silently skipped bridge cleanup with a set-but-empty /proc override; bridge and browser remain responsive.
LIVE OVERRIDE PASS
$ chrome-devtools-axi stop
status: stopped
exit=0
Disposable lab and owned bridge groups removed.
Evidence: Original leak reproduced on base commit

Source: Original leak reproduced on base commit

$ bash bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5
exit=0
$ chrome-devtools-axi start
status: ready
port: 46337
exit=0
BRIDGE override: {"pid": 2571030, "state": "S", "ppid": 1, "pgid": 2571030, "start": "108486057", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ tasks-axi add bridge-live-b1 Disposable live bridge validation --kind ship --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md
ok: added bridge-live-b1 (ship) -> Queued
task:
  id: bridge-live-b1
  title: Disposable live bridge validation
  state: queued
  blocked: no
  blocked_by: none
  held: no
  hold_reason: "-"
  hold_kind: "-"
  hold_until: "-"
  kind: ship
  repo: "-"
  priority: "-"
  created: 2026-11-11
  closed: "-"
  deps: none
  links: none
  body: ""
help[2]:
  - Run `tasks-axi start bridge-live-b1 --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md` to move it to in flight
  - Run `tasks-axi block bridge-live-b1 --by <other> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md` to record a dependency
exit=0
$ tasks-axi start bridge-live-b1 --file ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md
ok: start bridge-live-b1 -> In flight
help[1]:
  - Run `tasks-axi done bridge-live-b1 --pr <url> --file=~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md` when it ships
exit=0
Baseline f3d13fb: FM_PROC_ROOT_OVERRIDE is absent; reproduce the reported process leak.
$ bash bin/.phase-baseline-teardown.sh bridge-live-b1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 5s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: lsof is unavailable; cannot resolve the tmux pane process group for bridge-live-b1
teardown bridge-live-b1 complete (window none, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/gone-worktree, legacy record accepted without spawn_gen: endpoint missing, incarnation legacy-20261111T202108Z-2571632)
Backlog: bridge-live-b1 is closed in ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-lab.2x7buum5/data/backlog.md. Run bin/fm-tasks-axi.sh ready for dependency-cleared candidates, check date gates, and dispatch only work whose blockers are gone and date is due.
exit=0
Leaked real bridge after baseline teardown: {"pid": 2571030, "state": "S", "ppid": 1, "pgid": 2571030, "start": "108486057", "command": "node /usr/lib/node_modules/chrome-devtools-axi/dist/bin/chrome-devtools-axi-bridge.js "}
$ chrome-devtools-axi pages
pages[1]{id,url,selected}:
  1,about:blank,false
help[2]:
  Run `chrome-devtools-axi selectpage <id>` to switch tabs
  Run `chrome-devtools-axi newpage <url>` to open a new tab
exit=0
OBSERVED BASELINE BUG: task record removed and backlog closed, but the finished task bridge still runs and serves browser requests.
BASELINE LEAK REPRODUCED
$ chrome-devtools-axi stop
status: stopped
exit=0
Disposable lab and owned bridge groups removed.
Evidence: Executable identity-change and inspection-failure injections

Source: Executable identity-change and inspection-failure injections

Executable KILL-identity regression: recorded member starttime changes before KILL.
2579166 2579166 Ss   node
Identity reads after TERM grace: 4
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/browser-bridge-kill-identity/project: already current
teardown task-x1 complete (window firstmate:fm-task-x1, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/browser-bridge-kill-identity/wt)
Backlog: task-x1 just finished (this home keeps no markdown backlog at ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/browser-bridge-kill-identity/data/backlog.md). Update ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/browser-bridge-kill-identity/data/backlog.md - move task-x1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
teardown: stopping chrome-devtools-axi bridge process group for task-x1: 2579166

Injected unavailable uid; executable exit=0; task record removed.
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-uid/project: already current
teardown task-x1 complete (window firstmate:fm-task-x1, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-uid/wt)
Backlog: task-x1 just finished (this home keeps no markdown backlog at ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-uid/data/backlog.md). Update ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-uid/data/backlog.md - move task-x1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: could not inspect chrome-devtools-axi bridges for task-x1 (uid is unavailable); cleanup continues

Injected unavailable snapshot; executable exit=0; task record removed.
~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-snapshot/project: already current
teardown task-x1 complete (window firstmate:fm-task-x1, worktree ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-snapshot/wt)
Backlog: task-x1 just finished (this home keeps no markdown backlog at ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-snapshot/data/backlog.md). Update ~/.no-mistakes/worktrees/7f0ec18181b6/01M75HG71DW0AXQEVWWFWAR53K/.phase-test-tmp/fm-teardown-tests.zLbmzV/bridge-inspection-snapshot/data/backlog.md - move task-x1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 0s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
warning: could not inspect chrome-devtools-axi bridges for task-x1; cleanup continues
- Outcome: 🔧 1 issue found ✅ across 2 runs (14m46s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ bin/fm-teardown.sh:2834 - Bridges are matched only on FM_TASK_ID == $ID and on the uid. The repo expects equal task ids in different homes (bin/fm-spawn.sh:7631: "the full home-identity hash isolates equal task ids across homes"), and a local secondmate home runs as the same user. Concrete sequence: the primary home and a local secondmate home each have a live task foo-b1 with a chrome-devtools-axi bridge. Tearing down foo-b1 in the primary sends TERM and then KILL to the secondmate's live bridge group, which breaks that task's browser session. The same check repeats at bin/fm-teardown.sh:2860 (the re-verify before signaling). A source-backed way to tell the homes apart is already in the bridge's environment: every launch exports FM_TASK_INBOX=$STATE_REAL/$ID.inbox (bin/fm-spawn.sh:7728, 7776), so the bridge could also be required to have FM_TASK_INBOX equal to this home's resolved $STATE/$ID.inbox when that variable is present. The intent says to match on FM_TASK_ID alone, so adding a second key narrows the authored rule. The narrowing, not the defect, is what needs authorization.
  • ⚠️ bin/fm-teardown.sh:2796 - On a host without /proc (macOS is supported: Darwin branches in bin/fm-backend.sh:368, bin/fm-bootstrap.sh:1002, and LaunchAgent handling), every successful teardown now prints "warning: could not inspect chrome-devtools-axi bridges for <id> (/proc is unavailable); cleanup continues". The bridges cannot be identified there at all, so this warning shows on every teardown and nothing can be done about it. Firstmate agents read teardown stderr, so the constant warning is noise that can send them investigating. Fix: return 0 without a message when /proc is absent, as the FM_PROC_ROOT_OVERRIDE branch already does, or gate the feature on Linux.
  • ⚠️ bin/fm-teardown.sh:2805 - Unrequired component: when FM_PROC_ROOT_OVERRIDE names a directory that exists, the first scan builds its snapshot from that fake /proc tree. The member scans (lines ~2867, 2917, 2950) still use real ps -u, and the kill calls signal real pgids. No caller uses this branch: the new tests run against the real /proc, and the existing teardown tests set the override to a missing no-proc directory, which takes the silent early return. No intent requirement needs the fake-tree snapshot, and it mixes fake and real process sources. Recommend removing it and keeping only the silent early return used when the override is set.

🔧 Fix applied.
5 issues (4 warnings, 1 info) still open:

  • ⚠️ bin/fm-teardown.sh:2834 - Bridges are matched only on FM_TASK_ID == $ID and on the uid. The repo expects equal task ids in different homes (bin/fm-spawn.sh:7631: "the full home-identity hash isolates equal task ids across homes"), and a local secondmate home runs as the same user. Concrete sequence: the primary home and a local secondmate home each have a live task foo-b1 with a chrome-devtools-axi bridge. Tearing down foo-b1 in the primary sends TERM and then KILL to the secondmate's live bridge group, which breaks that task's browser session. The same check repeats at bin/fm-teardown.sh:2860 (the re-verify before signaling). A source-backed way to tell the homes apart is already in the bridge's environment: every launch exports FM_TASK_INBOX=$STATE_REAL/$ID.inbox (bin/fm-spawn.sh:7728, 7776), so the bridge could also be required to have FM_TASK_INBOX equal to this home's resolved $STATE/$ID.inbox when that variable is present. The intent says to match on FM_TASK_ID alone, so adding a second key narrows the authored rule. The narrowing, not the defect, is what needs authorization.
  • ⚠️ bin/fm-teardown.sh:2796 - On a host without /proc (macOS is supported: Darwin branches in bin/fm-backend.sh:368, bin/fm-bootstrap.sh:1002, and LaunchAgent handling), every successful teardown now prints "warning: could not inspect chrome-devtools-axi bridges for <id> (/proc is unavailable); cleanup continues". The bridges cannot be identified there at all, so this warning shows on every teardown and nothing can be done about it. Firstmate agents read teardown stderr, so the constant warning is noise that can send them investigating. Fix: return 0 without a message when /proc is absent, as the FM_PROC_ROOT_OVERRIDE branch already does, or gate the feature on Linux.
  • ⚠️ bin/fm-teardown.sh:2805 - Unrequired component: when FM_PROC_ROOT_OVERRIDE names a directory that exists, the first scan builds its snapshot from that fake /proc tree. The member scans (lines ~2867, 2917, 2950) still use real ps -u, and the kill calls signal real pgids. No caller uses this branch: the new tests run against the real /proc, and the existing teardown tests set the override to a missing no-proc directory, which takes the silent early return. No intent requirement needs the fake-tree snapshot, and it mixes fake and real process sources. Recommend removing it and keeping only the silent early return used when the override is set.
  • ⚠️ bin/fm-teardown.sh:339 - The round-1 fix (commit 3a3af40) narrowed bridge ownership, but the script header still describes the old rule. The function points readers to this header ("See the script header for the ownership rules", bin/fm-teardown.sh:2783). The header still says a bridge is stopped when "FM_TASK_ID is exactly this task" and lists only "a different task id, a missing FM_TASK_ID, another user's process" as excluded. The code now also requires FM_TASK_INBOX to equal this home's resolved state dir + /<id>.inbox (bin/fm-teardown.sh:2823-2824, re-verified at 2851-2852), and it skips the whole cleanup without a message whenever FM_PROC_ROOT_OVERRIDE is set (bin/fm-teardown.sh:2790). The round-1 fix left both sibling docs behind: this header at lines 339-344, and the FM_PROC_ROOT_OVERRIDE entry at docs/configuration.md:3369, which still calls it only an alternate /proc root for identity readers. That entry should say that setting it also turns off browser-bridge cleanup at teardown. As a result, an operator reading the documented contract would expect a same-id bridge from another home, or one without FM_TASK_INBOX, to be stopped, and would not know that the override disables cleanup. Fix: add the FM_TASK_INBOX match and the override skip to the header, and add the override behavior to the configuration doc entry.
  • ℹ️ bin/fm-teardown.sh:2629 - Round 1 made stop_task_browser_bridges_inner return early whenever FM_PROC_ROOT_OVERRIDE is set and hard-coded proc_root=/proc. The new helpers that only this function uses still read ${FM_PROC_ROOT_OVERRIDE:-/proc}, so that override branch can no longer run: teardown_proc_pgrp:2629, teardown_proc_still_running:2646, teardown_proc_real_uid:2662, teardown_proc_env_value:2674, teardown_proc_comm:2691, teardown_pid_is_browser_bridge:2702, teardown_pid_holds_inode:2741, teardown_pid_is_shared_cdp_browser:2762. A simplification would be to use /proc directly in these helpers, matching teardown_shared_cdp_inodes. Separately, the three member scans (around 2858, 2908, 2941) ignore the pgid column that ps -o pid=,pgid=,comm= already returns. Instead they fork cat /proc/&lt;pid&gt;/stat for every process the user owns. Filtering on the ps pgid column first would avoid hundreds of forks per bridge group. This is not a correctness issue.

🔧 Fix applied.
7 issues (5 warnings, 2 infos) still open:

  • ⚠️ bin/fm-teardown.sh:2834 - Bridges are matched only on FM_TASK_ID == $ID and on the uid. The repo expects equal task ids in different homes (bin/fm-spawn.sh:7631: "the full home-identity hash isolates equal task ids across homes"), and a local secondmate home runs as the same user. Concrete sequence: the primary home and a local secondmate home each have a live task foo-b1 with a chrome-devtools-axi bridge. Tearing down foo-b1 in the primary sends TERM and then KILL to the secondmate's live bridge group, which breaks that task's browser session. The same check repeats at bin/fm-teardown.sh:2860 (the re-verify before signaling). A source-backed way to tell the homes apart is already in the bridge's environment: every launch exports FM_TASK_INBOX=$STATE_REAL/$ID.inbox (bin/fm-spawn.sh:7728, 7776), so the bridge could also be required to have FM_TASK_INBOX equal to this home's resolved $STATE/$ID.inbox when that variable is present. The intent says to match on FM_TASK_ID alone, so adding a second key narrows the authored rule. The narrowing, not the defect, is what needs authorization.
  • ⚠️ bin/fm-teardown.sh:2796 - On a host without /proc (macOS is supported: Darwin branches in bin/fm-backend.sh:368, bin/fm-bootstrap.sh:1002, and LaunchAgent handling), every successful teardown now prints "warning: could not inspect chrome-devtools-axi bridges for <id> (/proc is unavailable); cleanup continues". The bridges cannot be identified there at all, so this warning shows on every teardown and nothing can be done about it. Firstmate agents read teardown stderr, so the constant warning is noise that can send them investigating. Fix: return 0 without a message when /proc is absent, as the FM_PROC_ROOT_OVERRIDE branch already does, or gate the feature on Linux.
  • ⚠️ bin/fm-teardown.sh:2805 - Unrequired component: when FM_PROC_ROOT_OVERRIDE names a directory that exists, the first scan builds its snapshot from that fake /proc tree. The member scans (lines ~2867, 2917, 2950) still use real ps -u, and the kill calls signal real pgids. No caller uses this branch: the new tests run against the real /proc, and the existing teardown tests set the override to a missing no-proc directory, which takes the silent early return. No intent requirement needs the fake-tree snapshot, and it mixes fake and real process sources. Recommend removing it and keeping only the silent early return used when the override is set.
  • ⚠️ bin/fm-teardown.sh:339 - The round-1 fix (commit 3a3af40) narrowed bridge ownership, but the script header still describes the old rule. The function points readers to this header ("See the script header for the ownership rules", bin/fm-teardown.sh:2783). The header still says a bridge is stopped when "FM_TASK_ID is exactly this task" and lists only "a different task id, a missing FM_TASK_ID, another user's process" as excluded. The code now also requires FM_TASK_INBOX to equal this home's resolved state dir + /<id>.inbox (bin/fm-teardown.sh:2823-2824, re-verified at 2851-2852), and it skips the whole cleanup without a message whenever FM_PROC_ROOT_OVERRIDE is set (bin/fm-teardown.sh:2790). The round-1 fix left both sibling docs behind: this header at lines 339-344, and the FM_PROC_ROOT_OVERRIDE entry at docs/configuration.md:3369, which still calls it only an alternate /proc root for identity readers. That entry should say that setting it also turns off browser-bridge cleanup at teardown. As a result, an operator reading the documented contract would expect a same-id bridge from another home, or one without FM_TASK_INBOX, to be stopped, and would not know that the override disables cleanup. Fix: add the FM_TASK_INBOX match and the override skip to the header, and add the override behavior to the configuration doc entry.
  • ℹ️ bin/fm-teardown.sh:2629 - Round 1 made stop_task_browser_bridges_inner return early whenever FM_PROC_ROOT_OVERRIDE is set and hard-coded proc_root=/proc. The new helpers that only this function uses still read ${FM_PROC_ROOT_OVERRIDE:-/proc}, so that override branch can no longer run: teardown_proc_pgrp:2629, teardown_proc_still_running:2646, teardown_proc_real_uid:2662, teardown_proc_env_value:2674, teardown_proc_comm:2691, teardown_pid_is_browser_bridge:2702, teardown_pid_holds_inode:2741, teardown_pid_is_shared_cdp_browser:2762. A simplification would be to use /proc directly in these helpers, matching teardown_shared_cdp_inodes. Separately, the three member scans (around 2858, 2908, 2941) ignore the pgid column that ps -o pid=,pgid=,comm= already returns. Instead they fork cat /proc/&lt;pid&gt;/stat for every process the user owns. Filtering on the ps pgid column first would avoid hundreds of forks per bridge group. This is not a correctness issue.
  • ⚠️ bin/fm-teardown.sh:2856 - The shared-CDP protection covers only the Chromium browser process, not its child processes. The header (bin/fm-teardown.sh:343-345) says a shared CDP browser that "shares the bridge's process group" is never signaled, and the test models that browser as a single process. A real Chromium keeps its zygote, renderer, GPU and utility children in the same process group. Those children have comm chromium/chrome, a command line with --type=renderer (or zygote, gpu-process, and so on) but no --remote-debugging-port, and they do not hold the 9223/9224 listening socket. So teardown_pid_is_shared_cdp_browser (bin/fm-teardown.sh:2753-2768) returns false for them. In the TERM pass (2856-2865, signals sent at 2870-2878) and again in the KILL pass (2908-2926), they are added to targets and receive TERM, then KILL. Concrete sequence: a shared Chromium on port 9224 runs in the bridge's group with a zygote and renderers. Teardown keeps the browser pid but kills its zygote and renderers, so every tab crashes and no new tab can open. That breaks the shared browser for other live tasks, which is exactly what the protection exists to prevent. The final 'still running' check (2945-2953) has the same gap. The protection logic is the author's own addition (the intent only asks to stop the bridge's group), and the test at tests/fm-teardown.test.sh bridge-cdp uses a single-process 'chromium', so it cannot catch this. Remedy needs a decision: either extend the protection to every descendant of a protected browser (walk the ppid chain inside the group) in all three member scans, or, if a shared browser never actually shares a bridge's group, remove the shared-CDP protection component and its test.
  • ℹ️ bin/fm-teardown.sh:2915 - In the KILL pass, identity=$(task_process_identity &#34;$member&#34;) is computed but never used. Unlike the TERM pass, the identity is not added to targets (targets=&#34;$targets $member&#34;), so it works only as an existence filter. Simplification: drop the assignment, or carry the identity and re-verify it before kill -KILL as the TERM pass does at 2875.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ bin/fm-teardown.sh:2796 - On a host without /proc (macOS is supported: Darwin branches in bin/fm-backend.sh:368, bin/fm-bootstrap.sh:1002, and LaunchAgent handling), every successful teardown now prints "warning: could not inspect chrome-devtools-axi bridges for <id> (/proc is unavailable); cleanup continues". The bridges cannot be identified there at all, so this warning shows on every teardown and nothing can be done about it. Firstmate agents read teardown stderr, so the constant warning is noise that can send them investigating. Fix: return 0 without a message when /proc is absent, as the FM_PROC_ROOT_OVERRIDE branch already does, or gate the feature on Linux.
  • ℹ️ bin/fm-teardown.sh:2915 - In the KILL pass, identity=$(task_process_identity &#34;$member&#34;) is computed but never used. Unlike the TERM pass, the identity is not added to targets (targets=&#34;$targets $member&#34;), so it works only as an existence filter. Simplification: drop the assignment, or carry the identity and re-verify it before kill -KILL as the TERM pass does at 2875.

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • ℹ️ bin/fm-teardown.sh:2784 - Simplification only; behavior stays the same. stop_task_browser_bridges_inner repeats the same member-scan loop three times. Each copy runs ps -u and then, per pid, checks that teardown_proc_pgrp equals the group, that the real uid matches, and that teardown_proc_still_running holds: the TERM pass at bin/fm-teardown.sh:2784, the KILL pass at :2817 and the final still-running check at :2855. The leader-lookup loop that maps a pgid back to its leader pid and identity is also duplicated, at :2807 and :2844, along with the [ -r /proc/$leader/stat ] &amp;&amp; task_process_identity_matches guard after each copy. The initial scan also re-reads the pgrp (pgrp=$(teardown_proc_pgrp &#34;$pid&#34;), [ &#34;$pgrp&#34; = &#34;$pid&#34; ]) and rechecks own_pgrp right after teardown_pid_is_browser_bridge has already confirmed that pgrp equals pid. Suggested fix: one helper (for example teardown_bridge_group_members &lt;pgrp&gt; &lt;uid&gt; [with-identity]) that prints pid identity lines, plus a single leader-lookup helper; drop the repeated pgrp check from the initial scan. This keeps the uid filter, reads pgrp from /proc, and keeps the KILL-pass identity recheck the user asked for. Do not filter on the ps pgid column; the user ruled that out.
🔧 **Test** - 1 issue found ✅
  • ⚠️ live validation verdict: inconclusive (5 of 8 scenarios were driven live against the product); untested: KILL is skipped when no recorded member identity still matches, Unavailable uid or process snapshot produces a warning without failing accepted teardown, A host without procfs silently skips bridge cleanup
  • Live validation: ⚠️ inconclusive - 5 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Accepted teardown stops the task's real bridge, npm, and MCP process group ✅ pass live live-bridge-transcript.log; baseline-process-leak.log
A stopped bridge leader survives TERM and is removed by KILL ✅ pass live live-bridge-transcript.log
Other-task, other-home, missing-inbox, missing-task, and non-bridge processes survive teardown ✅ pass live live-bridge-transcript.log
Dirty-worktree refusal preserves task metadata, work, and a responsive real bridge ✅ pass live live-refusal-transcript.log
A set proc override silently skips bridge cleanup while teardown succeeds ✅ pass live live-override-transcript.log; test_teardown_proc_override_leaves_browser_bridges
KILL is skipped when no recorded member identity still matches ⏸️ untested no The prior payload records deterministic injection of a starttime change, not actual PID reuse, and explicitly marks the execution non-live. It does not establish a live result; validation requires an…
Unavailable uid or process snapshot produces a warning without failing accepted teardown ⏸️ untested no The prior payload records injected uid and snapshot failures and explicitly marks the execution non-live. It does not establish a live result; validation requires a runtime where uid or process inspec…
A host without procfs silently skips bridge cleanup ⏸️ untested no No host without /proc was available. Run this scenario on macOS or an isolated Linux runtime without procfs; no simulation seam was added.
  • Selected test_teardown_stops_own_browser_bridge_groups, test_teardown_refusal_leaves_browser_bridges, test_teardown_proc_override_leaves_browser_bridges, and test_teardown_bridge_kill_rechecks_member_identity from tests/fm-teardown.test.sh; loading also executed its existing opencode busy-plugin check.
  • python3 .phase-live-bridge.py: installed chrome-devtools-axi 0.1.46, isolated browser sessions, real process-group cleanup, SIGSTOP/KILL escalation, and ownership exclusions.
  • python3 .phase-live-refusal.py: corrected lab Git setup and verified dirty-worktree refusal with a responsive real bridge.
  • python3 .phase-live-override.py: verified set-but-empty FM_PROC_ROOT_OVERRIDE preserves a responsive real bridge.
  • bash tests/.phase-bridge-baseline.sh: reproduced surviving bridge and child processes after successful teardown using the base executable; the target regression also failed against base as expected.
  • bash tests/.phase-bridge-identity-evidence.sh: captured executable output and surviving process after injected member identity change.
  • bash tests/.phase-bridge-inspection-evidence.sh: verified unavailable-uid and failed-snapshot warnings remain best effort.
  • Checked for remaining processes naming disposable lab paths, removed transient worktree files, and confirmed clean git status --short.

✅ No issues found.

  • Live validation: ✅ go - 5 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Accepted cleanup stops the finished task's real bridge, npm, and MCP group and closes its record ✅ pass live Original leak reproduced on base commit; Live bridge cleanup, KILL escalation, and ownership exclusions
A suspended bridge survives TERM and is removed by KILL escalation ✅ pass live Live bridge cleanup, KILL escalation, and ownership exclusions
Cleanup preserves another task's bridge, another home's bridge, missing ownership markers, and a non-bridge process ✅ pass live Live bridge cleanup, KILL escalation, and ownership exclusions
Cleanup refuses uncommitted work and preserves the task record, file contents, and responsive bridge ✅ pass live Dirty-work refusal preserves responsive bridge
A set-but-empty proc override silently skips bridge cleanup while task cleanup succeeds ✅ pass live Proc override silently preserves bridge
KILL is skipped when no recorded member identity still matches ⏸️ untested no Executable fault injection passed, but real kernel PID/starttime replacement was not driven. Live reproduction requires a disposable environment with controlled PID reuse.
Unavailable uid or process snapshot warns without failing accepted cleanup ⏸️ untested no Both executable fault injections passed. This host provides working uid and process inspection; live reproduction requires a disposable host exhibiting those OS failures.
A host without procfs silently skips bridge cleanup ⏸️ untested no No host without /proc is available. Provide a macOS runner or another disposable environment without procfs.
Another user's bridge remains running ⏸️ untested no No second-user launch credential or authorized launcher was supplied. Provide a disposable second OS account to exercise this boundary live.
  • python3 ~/.no-mistakes/evidence/01M75HG71DW0AXQEVWWFWAR53K/round2-live-bridge-driver.py
  • python3 ~/.no-mistakes/evidence/01M75HG71DW0AXQEVWWFWAR53K/round2-live-refusal-driver.py
  • python3 ~/.no-mistakes/evidence/01M75HG71DW0AXQEVWWFWAR53K/round2-live-override-driver.py
  • python3 ~/.no-mistakes/evidence/01M75HG71DW0AXQEVWWFWAR53K/round2-live-baseline-driver.py using the teardown executable from base commit f3d13fb
  • TMPDIR=&#34;$PWD/.phase-test-tmp&#34; bash tests/.phase-teardown-selected.sh selecting the four browser-bridge regression tests
  • TMPDIR="$PWD/.phase-test-tmp" FM_PHASE_DETAIL_LOG=~/.no-mistakes/evidence/01M75HG71DW0AXQEVWWFWAR53K/round2-executable-faults.log bash tests/.phase-teardown-faults.sh
  • Removed temporary scripts and disposable labs; verified no lab processes remained and git status --short was clean.
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

Environment note

test_leaked_worktree_process_is_reaped fails in this environment because lsof is not installed.
That failure is unchanged and pre-existing.
This change does not install lsof and does not change that test.

peterOC26 and others added 5 commits November 11, 2026 21:14
Once cleanup is accepted, stop the chrome-devtools-axi bridge process group whose FM_TASK_ID is the torn-down task. Leave a different task, an unmarked process, and the shared CDP browsers running. A failure to stop a bridge does not undo the cleanup.
@peterOC26
peterOC26 force-pushed the fm/fm-teardown-stop-browser-bridges-b1 branch from dc6cbb9 to 380abda Compare November 11, 2026 20:24
@peterOC26 peterOC26 changed the title fix: stop task browser bridges during teardown fix: stop task browser bridge groups during teardown Nov 11, 2026
@peterOC26 peterOC26 closed this Nov 11, 2026
@peterOC26 peterOC26 reopened this Nov 11, 2026
@peterOC26
peterOC26 merged commit d37fbbd into main Nov 12, 2026
30 checks passed
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.

1 participant