Skip to content

feat: support omp remote secondmates and Bun launcher detection - #4690

Closed
mdc2122 wants to merge 8 commits into
kunchenguid:mainfrom
mdc2122:fm/remote-omp-verify-07
Closed

mdc2122 wants to merge 8 commits into
kunchenguid:mainfrom
mdc2122:fm/remote-omp-verify-07

Conversation

@mdc2122

@mdc2122 mdc2122 commented Sep 17, 2026 •

Copy link
Copy Markdown

Intent

Move the factory-studio2 secondmate onto the omp harness running SWE-2. The immediate blocker: bin/fm-remote-secondmate-control.sh refuses omp as an unverified remote-secondmate harness in two places (the cmd_launch and cmd_relaunch case statements, currently claude|codex|opencode|pi|pi-signed|grok|kimi|cursor).

What Changed

  • Allow omp in remote secondmate spawn, launch, and relaunch gates, and accept it in remote doctor readiness checks.
  • Recognize omp’s OMPCODE=1 marker and Bun launcher across harness detection, session-lock ownership, and process liveness.
  • Add regression coverage for remote omp placement and process identity, isolate harness tests from inherited omp markers, and update remote operation documentation.

Risk Assessment

✅ Low: The changes consistently enable remote OMP launch and recovery and recognize its newer launcher shape; source inspection found no substantiated material defects.

Testing

Three targeted test files and four live CLI scenarios passed after resolving setup issues. Captured CLI evidence and removed temporary fixtures. Remote SWE-2 launch/recovery and actual OMP process detection remain untested; previously declined remote-validation limitations were not raised again.

  • Live validation: ⚠️ inconclusive - 4 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Launching an OMP remote secondmate on a non-Herdr backend is refused ✅ pass live live-cli.txt: launch with tmux rejected
Invalid harness and effort selections remain blocked ✅ pass live live-cli.txt: launch and relaunch reject unverified harnesses and invalid effort
OMP recovery passes harness validation but refuses an invalid endpoint ✅ pass live live-cli.txt: OMP relaunch reaches endpoint validation and refuses missing metadata
Doctor accepts OMP as the sole installed harness ✅ pass live live-cli.txt: worker-tool-probe reports required harness=omp and exits 0 after supplying interpreter paths
Ordinary remote spawn starts factory-studio2 on OMP running SWE-2 ⏸️ untested no Requires authorization for remote Herdr session and secondmate-home writes outside this worktree, plus an isolated remote environment with SWE-2 credentials.
Remote relaunch restores an operational OMP secondmate running SWE-2 ⏸️ untested no Requires an authorized remote OMP endpoint and permission to change its session and home outside this worktree.
A running OMP Bun launcher is recognized correctly without claiming unrelated processes ⏸️ untested no Regression checks use simulated harness processes. Live confirmation requires an isolated OMP session with all persistent profile writes confined to an authorized location.
Evidence: Live remote-control guards and OMP-only tool discovery

Source: Live remote-control guards and OMP-only tool discovery

$ bin/fm-remote-secondmate-control.sh launch lab-omp omp SWE-2 - tmux
error: a remote secondmate runs only on the herdr backend, not 'tmux'
exit=1

$ bin/fm-remote-secondmate-control.sh launch lab-omp unverified SWE-2 - herdr
error: unverified remote secondmate harness: unverified
exit=1

$ bin/fm-remote-secondmate-control.sh relaunch lab-omp unverified SWE-2 -
error: unverified remote secondmate harness: unverified
exit=1

$ bin/fm-remote-secondmate-control.sh launch lab-omp omp SWE-2 bogus herdr
error: invalid remote secondmate effort: bogus
exit=1

$ bin/fm-remote-secondmate-control.sh relaunch lab-omp omp SWE-2 bogus
error: invalid remote secondmate effort: bogus
exit=1

$ bin/fm-remote-secondmate-control.sh relaunch lab-omp omp SWE-2 -
error: remote secondmate lab-omp endpoint metadata is invalid; refusing access until it is explicitly migrated
exit=1

$ FM_REMOTE_JOB_ACTIVE=1 PATH=<real tools, omp as sole harness> bin/fm-remote-doctor.sh --worker-tool-probe
required git=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/git
required jq=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/jq
required herdr=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/herdr
required tasks-axi=MISSING (incompatible)
required treehouse=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/treehouse
required harness=omp:~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/omp
exit=1

Retry with node and bun available for installed tool launchers:
required git=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/git
required jq=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/jq
required herdr=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/herdr
required tasks-axi=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/tasks-axi
required treehouse=~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/treehouse
required harness=omp:~/.no-mistakes/worktrees/62b3bc0be3e5/01M2RN6A24SJRH4TXHCS58JECG/.test-phase-tmp/only-omp-bin/omp
exit=0
- Outcome: ⚠️ 1 warning across 1 run (2m39s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (4 of 7 scenarios were driven live against the product); untested: Ordinary remote spawn starts factory-studio2 on OMP running SWE-2, Remote relaunch restores an operational OMP secondmate running SWE-2, A running OMP Bun launcher is recognized correctly without claiming unrelated processes
  • Live validation: ⚠️ inconclusive - 4 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Launching an OMP remote secondmate on a non-Herdr backend is refused ✅ pass live live-cli.txt: launch with tmux rejected
Invalid harness and effort selections remain blocked ✅ pass live live-cli.txt: launch and relaunch reject unverified harnesses and invalid effort
OMP recovery passes harness validation but refuses an invalid endpoint ✅ pass live live-cli.txt: OMP relaunch reaches endpoint validation and refuses missing metadata
Doctor accepts OMP as the sole installed harness ✅ pass live live-cli.txt: worker-tool-probe reports required harness=omp and exits 0 after supplying interpreter paths
Ordinary remote spawn starts factory-studio2 on OMP running SWE-2 ⏸️ untested no Requires authorization for remote Herdr session and secondmate-home writes outside this worktree, plus an isolated remote environment with SWE-2 credentials.
Remote relaunch restores an operational OMP secondmate running SWE-2 ⏸️ untested no Requires an authorized remote OMP endpoint and permission to change its session and home outside this worktree.
A running OMP Bun launcher is recognized correctly without claiming unrelated processes ⏸️ untested no Regression checks use simulated harness processes. Live confirmation requires an isolated OMP session with all persistent profile writes confined to an authorized location.
  • git diff 5e879bad d2a07192 -- bin and targeted test-source inspection
  • bash tests/fm-remote-doctor.test.sh
  • bash tests/fm-remote-secondmate-omp.test.sh — passed after moving incidental test fixtures outside the active home
  • bash tests/fm-omp-harness.test.sh — passed after detaching from Codex process ancestry
  • Direct fm-remote-secondmate-control.sh launch/relaunch guard checks with an isolated worktree-local home
  • fm-remote-doctor.sh --worker-tool-probe with real installed tools and OMP as the sole harness
  • Removed transient worktree fixtures and confirmed clean git status --short
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

First look on HEAD f14bb62c9661dd783ccc65581aec8a8c4417bab2.

Attestation: MATCH.
Contract-class: opt-in — widens the remote-secondmate / doctor / parent-spawn allowlists so captains who already choose omp can use it remotely; unconfigured hosts without omp unchanged. Not restore (verification unlock), not new-default (harness still captain-selected).
VISION: aligns with fleet-outlives-vendor + authority-explicit (harness choice stays captain-owned).
CI/NM: fork workflows were action_required; approved this pass after tip diff review (9 files, no .github/**, security clean). Queued: CI 35197324400, NM 35197324397.
Outcome: waiting-ci — re-check when green; opt-in + MATCH + green can auto-merge. No Firstmate flag.

@mdc2122
mdc2122 force-pushed the fm/remote-omp-verify-07 branch 3 times, most recently from aa67451 to 53ef582 Compare September 17, 2026 21:31
@mdc2122 mdc2122 changed the title feat(bin): verify omp as a remote secondmate harness feat: support omp for remote secondmates Sep 17, 2026
@mdc2122
mdc2122 force-pushed the fm/remote-omp-verify-07 branch from fc9efa6 to 11f86fe Compare September 17, 2026 21:50
@mdc2122 mdc2122 changed the title feat: support omp for remote secondmates feat: support omp remote secondmates and Bun launcher detection Sep 17, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Re-triage after tip moved past prior stamp (f14bb62c… → 11f86fe9dfe037d64df1e0e60722cc0050e6814b).

Attestation: MATCH.
Contract-class: opt-in — remote secondmate / spawn / doctor allowlists gain omp only when the captain already selects that harness; unconfigured hosts without omp (or without choosing it) stay refused/unchanged. Bun-launcher + OMPCODE=1 detection restores identity for omp ≥18.1.22 without changing non-omp unconfigured paths (anchored */omp argv rule; not *omp*).
VISION: aligns — fleet-outlives-vendor (another verified harness on the remote path); authority-explicit (harness remains captain-selected, not assumed); scripts own detection/allowlist mechanics; no new always-on captain-facing surface.
CI/NM: tip fork workflows were action_required; approved this pass after tip diff review (26 files vs main, no .github/**, security clean). Queued/running: CI 35278914691 (in_progress), NM 35278950331+35278914729 SUCCESS. Prior tip CI failure on serial 4 is stale relative to this HEAD — re-check when green.
Outcome: waiting-ci — opt-in + MATCH + green can auto-merge. No Firstmate flag. No linked issues.

@mdc2122
mdc2122 force-pushed the fm/remote-omp-verify-07 branch 2 times, most recently from 753447f to b04a9c2 Compare September 23, 2026 23:26
fm-remote-secondmate-control.sh refused omp in cmd_launch and
cmd_relaunch. omp is already verified for crew, scout, secondmate, and
primary work on Herdr, and the remote path runs the identical
fm-spawn.sh launch inside the fm-remote Herdr session, so the verified
launch contract carries over. Verified on studio2 with omp 18.1.20.
omp 18.1.22 changed from a Bun-compiled single binary (comm=omp) to a
bun script (comm=bun, argv 'bun .../.bun/bin/omp'), which broke harness
detection: the session lock, agent-process classifier, tmux backend
liveness, and fm-harness verdict all missed it.

Add fm_omp_args_are_omp() in fm-session-lock-lib.sh as the single owner
of the bun-launcher rule (argv[0] is bun, next arg is a path ending in
/omp) and consult it from the ancestry matcher, the agent-process
classifier, the tmux foreground-args liveness check, and the fm-harness
verdict. Anchored exactly like the binary shape so ompd/comp and bun
processes carrying other harness names in their arguments never match.
The fm-remote-doctor.sh edit adding omp to HARNESS_TOOLS changed the
script's sha256; update the pinned DOCTOR_SHA256 in the entrypoint so the
no-git trusted bootstrap path still authenticates the doctor.
@mdc2122

mdc2122 commented Oct 5, 2026

Copy link
Copy Markdown
Author

Closing: stale and conflicting with main. Half A has since landed elsewhere; I may re-offer the remainder as a fresh PR against current main.

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