Skip to content

feat(bin): gate omp launches on Orca, force trace suppression, and preflight relaunch records - #2535

Closed
Lakescape wants to merge 9 commits into
kunchenguid:mainfrom
Lakescape:fm/atx1840-omp-harvest
Closed

Lakescape wants to merge 9 commits into
kunchenguid:mainfrom
Lakescape:fm/atx1840-omp-harvest

Conversation

@Lakescape

Copy link
Copy Markdown
Contributor

Intent

Harvest three behaviors from the preserved tag atx1840/omp-upstream-07450 (commit 9e2aed9) into firstmate main, adapting each to the CURRENT code rather than cherry-picking. This task changes firstmate's shared tracked material (bin/, .agents/skills/), so firstmate-coding-guidelines (knowledge-placement, one-owner, repo-style) are binding.

The omp candidate adapter already landed on main at 7cf00a0 (merged as db9aa5b). It is deliberately CANDIDATE-only: not live-verified, reachable only through an explicit --harness omp. Nothing here changes that dormancy. Do not live-verify or pilot omp. Do not change config/crew-harness, config/crew-dispatch.json, or any dispatch default. Do not touch the atx1840/omp-reference tag content or anything under projects/.

The three behaviors, in dependency order:

  1. backend=orca gate (from f4c8af4). omp must refuse to launch on any non-Orca backend. Implement require_omp_orca_backend(), resolved READ-ONLY before any mutation, with the resolved value RETAINED so it cannot drift between the refusal check and endpoint creation. This is the highest-value item — implement it first and make it independently testable. The refusal must happen before ANY lock, endpoint, worktree, state, config, registry, metadata, or extension mutation — the same standard the existing omp model-pin refusal already meets. Prove it in a test, not in prose.

  2. Trace suppression, enforced rather than assumed (from f4c8af4). Force SPAWN_TRACE_EFFECTIVE=off for omp and strip TRACEPARENT from the child via the launch template. The landed candidate only ASSERTS that no traceparent= reaches metadata and otherwise relies on the home default being off — that is an assumption, not an enforcement. Close it.

  3. Relaunch preflight before the locks (from cf4d08b + 9e2aed9). Move omp's model and backend gates ahead of every lock via a bounded READ-ONLY relaunch preflight, and reject unsafe relaunch records early. The landed candidate refuses a record-adopted relaunch at the adoption point, which is AFTER lock acquisition — weaker against the "refuse before any mutation" invariant. Related: bin/fm-spawn.sh now carries an Orca metadata-publication refusal placed immediately after the } > "$SPAWN_META_PATH" write and BEFORE the relaunch promotion. Item 3 work must not duplicate or weaken it. This implementation rejects unsafe relaunch records for every harness and applies omp model/backend gates before any lock; it does NOT change the general metadata temp-file promotion sequence (the existing Orca publication refusal before promotion is unchanged). Do not overstate that as closing the muse-disposition promotion gap.

Acceptance: each of the three behaviors is implemented against current main and independently covered by a test that FAILS without the change. tests/fm-omp-harness.test.sh and tests/fm-busy-adapter-wiring.test.sh pass, and tests/fm-backend-orca.test.sh stays at zero failures attributable to this change. bin/fm-lint.sh is clean. omp stays dormant: no change to shipped config/crew-harness, no new implicit default, no live-verified claim anywhere in docs or skills. .agents/skills/harness-adapters/SKILL.md's omp section is updated to describe what the adapter now does, still marked CANDIDATE / NOT LIVE-VERIFIED.

Implementation notes a reviewer should treat as deliberate: do not cherry-pick or merge the reference tag; reimplement semantically against current main (SPAWN_META_PATH/SPAWN_META_TMP publication plus relaunch promotion already exist). Tests exercise behavior through fm-spawn, not implementation-source bytes. The omp-harness suite defaults the test fixture backend to orca and stubs the Orca CLI so successful omp launches remain deterministic; non-Orca backends are refused by explicit --backend matrix. A host-local fm-backend-orca scout-teardown case can fail when tasks-axi is absent; that is a pre-existing environment gap, not this change (the omp-on-Orca cases in that suite pass).

What Changed

  • Wires the candidate omp crewmate/scout adapter into bin/fm-spawn.sh (with supporting changes in bin/fm-backend.sh, bin/fm-busy-lib.sh, bin/fm-harness.sh, bin/fm-teardown.sh, and bin/backends/tmux.sh), and adds require_omp_orca_backend(), which resolves the backend read-only and refuses any non-Orca backend before any lock, endpoint, worktree, state, config, registry, metadata, or extension mutation. The resolved value is retained so it cannot drift between the refusal check and endpoint creation, and the late relaunch gate re-checks the locked $BACKEND rather than the pre-lock snapshot.
  • Enforces trace suppression for omp instead of relying on the home default: SPAWN_TRACE_EFFECTIVE is forced to off and TRACEPARENT is stripped from the child via the launch template. Adds an Orca metadata-publication refusal that releases resources rather than promoting a partially written record, and validates live composite Orca worktree handles.
  • Adds a bounded read-only relaunch preflight that runs ahead of the watcher guard and every lock: --relaunch now rejects a state/<id>.meta that is a symlink, is not a regular file, or fails a two-descriptor stability check, and applies the omp model and backend gates before any mutation. This refusal is new for every harness, not just omp. Covered by the new tests/fm-omp-harness.test.sh suite plus additions to tests/fm-backend-orca.test.sh and tests/fm-busy-adapter-wiring.test.sh; omp stays CANDIDATE / NOT LIVE-VERIFIED, with no change to shipped config/crew-harness or any dispatch default.

Pipeline: Review and Document each raised informational-only findings (a defensive metadata-status branch that errexit already covers, a raw omp ... command string that bypasses the adapter contract, the new preflight's cross-harness blast radius, a duplicated refusal message string, and pre-existing SKILL.md wording). One tests/fm-backend-orca.test.sh case fails on this host because tasks-axi is absent; that case is untouched by this change and every omp-on-Orca case passes.

Risk Assessment

⚠️ Medium: No defects were found and all three required behaviors are implemented and independently tested, but the change reworks shared spawn-preamble ordering (moving the watcher guard below argument parsing) and adds new pre-lock relaunch refusals that apply to every harness rather than just the dormant omp adapter, so the blast radius extends past the candidate-only surface the intent describes.

Testing

Ran the three suites the intent names as acceptance, then drove the actual operator-facing behavior through real fm-spawn against stub executables and captured a CLI transcript for each of the three harvested behaviors: the non-Orca backend refusal with a post-refusal scan proving zero home mutations, the trace suppression showing the -u TRACEPARENT launch prefix and a metadata record with no traceparent= even from a trace-on home with an ambient carrier, and the pre-lock relaunch preflight refusing an unsafe/non-Orca/model-less record with no lock files left behind. I then neutered each behavior in turn and confirmed a distinct test failure for each, so the coverage genuinely bites, restoring the file byte-for-byte afterwards. fm-omp-harness and fm-busy-adapter-wiring are green; fm-backend-orca has one failure that is a pre-existing host gap (tasks-axi absent), unattributable to this change and unfixable from inside the worktree. This is a shell/CLI change with no rendered surface, so the evidence is CLI transcripts rather than screenshots.

Evidence: CLI transcript: all three omp behaviors driven through real fm-spawn

================================================================
BEHAVIOR 1 - omp refuses any backend other than orca, before any mutation
================================================================

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend tmux --mode no-mistakes --yolo off
error: omp requires backend=orca; resolved backend 'tmux' is not authorized for this adapter
exit status: 1

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend herdr --mode no-mistakes --yolo off
error: omp requires backend=orca; resolved backend 'herdr' is not authorized for this adapter
exit status: 1

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend zellij --mode no-mistakes --yolo off
error: omp requires backend=orca; resolved backend 'zellij' is not authorized for this adapter
exit status: 1

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend cmux --mode no-mistakes --yolo off
error: omp requires backend=orca; resolved backend 'cmux' is not authorized for this adapter
exit status: 1

-- everything the four refused spawns created under the home --
<nothing: no lock, endpoint, worktree, state, config, registry, metadata, or extension>

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend orca --mode no-mistakes --yolo off
warning: /var/folders/k7/pv977h6550z7pncjygnj7xn80000gn/T//fm-omp-evidence.aTbUKA/b1/home/data/ompbackend/brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
spawned ompbackend harness=omp kind=ship mode=no-mistakes yolo=off window=fm-ompbackend worktree=/var/folders/k7/pv977h6550z7pncjygnj7xn80000gn/T//fm-omp-evidence.aTbUKA/b1/wt
exit status: 0

================================================================
BEHAVIOR 2 - trace suppression is ENFORCED, not assumed
================================================================
home session trace-context decision: 70921 on
ambient TRACEPARENT in the operator shell: 00-0123456789abcdef0123456789abcdef-0123456789abcdef-01

$ TRACEPARENT=00-0123456789abcdef0123456789abcdef-0123456789abcdef-01 fm-spawn.sh omptrace <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend orca --mode no-mistakes --yolo off
warning: /var/folders/k7/pv977h6550z7pncjygnj7xn80000gn/T//fm-omp-evidence.aTbUKA/b2/home/data/omptrace/brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
spawned omptrace harness=omp kind=ship mode=no-mistakes yolo=off window=fm-omptrace worktree=/var/folders/k7/pv977h6550z7pncjygnj7xn80000gn/T//fm-omp-evidence.aTbUKA/b2/wt
exit status: 0

-- launch command actually delivered to the omp pane --
env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u CURSOR_AGENT -u CURSOR_INVOKED_AS -u TRACEPARENT FM_OMP_HARNESS=1 '<case>/fake/fakebin/omp' --approval-mode yolo --no-title --no-extensions --no-skills --tools read,write,edit,ls,grep,find,bash --model 'anthropic/claude-sonnet-4-5' -e '<case>/home/state/omptrace.omp-ext.ts' "$('<repo>/bin/fm-operational-input.sh' encode launch-brief < '<case>/home/data/omptrace/brief.md')"

-- every line sent to the pane (an enabled home would export TRACEPARENT here) --
export GOTMPDIR=/tmp/fm-omptrace/gotmp
env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u CURSOR_AGENT -u CURSOR_INVOKED_AS -u TRACEPARENT FM_OMP_HARNESS=1 '<case>/fake/fakebin/omp' --approval-mode yolo --no-title --no-extensions --no-skills --tools read,write,edit,ls,grep,find,bash --model 'anthropic/claude-sonnet-4-5' -e '<case>/home/state/omptrace.omp-ext.ts' "$('/Users/austinlakescapes/.no-mistakes/worktrees/90205a2052fe/01M0831ZAS325S08VHSQ54ACFM/bin/fm-operational-input.sh' encode launch-brief < '<case>/home/data/omptrace/brief.md')"


-- recorded metadata for the task --
window=fm-omptrace
endpoint_task_id=omptrace
worktree=<case>/wt
project=/var/folders/k7/pv977h6550z7pncjygnj7xn80000gn/T/fm-omp-evidence.aTbUKA/b2/project
harness=omp
kind=ship
mode=no-mistakes
yolo=off
tasktmp=/tmp/fm-omptrace
model=anthropic/claude-sonnet-4-5
effort=default
busy_gen=g1786979264.71816.3163
spawn_gen=s1786979264.71597.1520
backend=orca
orca_worktree_id=wt-omp-evidence
terminal=term-omp-evidence

traceparent= lines recorded: 0

================================================================
BEHAVIOR 3 - relaunch preflight runs BEFORE every lock
================================================================
durable task record (adopted by --relaunch):
window=fm-omprelaunch
endpoint_task_id=omprelaunch
worktree=<case>/wt
project=<case>/project
harness=omp
kind=crewmate
mode=no-mistakes
yolo=off
backend=tmux

$ fm-spawn.sh --relaunch omprelaunch --model anthropic/claude-sonnet-4-5
error: omp requires backend=orca; resolved backend 'tmux' is not authorized for this adapter
exit status: 1

$ fm-spawn.sh --relaunch omprelaunch      # recorded harness=omp, no --model flag
error: omp requires an explicit --model <provider>/<model> flag on every spawn; without one omp would resolve the provider itself
exit status: 1

-- unsafe relaunch record (metadata replaced by a symlink) --

$ fm-spawn.sh --relaunch omprelaunch --model anthropic/claude-sonnet-4-5
error: --relaunch needs an existing task record that is a regular, non-symlink metadata file for omprelaunch
exit status: 1

-- lock files any of the three relaunch refusals left behind --
<none: refused before the spawn lock and the meta lock>

================================================================
END OF TRANSCRIPT
================================================================
Evidence: Evidence harness that produced the transcript (re-runnable: FM_REPO=<worktree> bash omp-harvest-demo.sh)
#!/usr/bin/env bash
# Reviewer-facing demonstration of the three harvested omp behaviors, driven
# through the real bin/fm-spawn.sh against stub tmux/orca/omp executables.
# Prints an end-user CLI transcript: the exact command, the exact stderr the
# operator sees, and the observable state of the home afterwards.
set -u

. "$(dirname "${BASH_SOURCE[0]}")/../../../../.no-mistakes/worktrees/90205a2052fe/01M0831ZAS325S08VHSQ54ACFM/tests/lib.sh" 2>/dev/null \
  || . "${FM_REPO:?set FM_REPO to the firstmate worktree}/tests/lib.sh"

SPAWN="$ROOT/bin/fm-spawn.sh"
TMP_ROOT=$(fm_test_tmproot fm-omp-evidence)
MODEL="anthropic/claude-sonnet-4-5"

rule() { printf '\n================================================================\n%s\n================================================================\n' "$1"; }
cmd()  { printf '\n$ %s\n' "$1"; }

make_fixture() {  # <name> <id> -> case_dir|home|proj|wt|fakebin
  local name=$1 id=$2 case_dir home proj wt fakebin node_bin
  case_dir="$TMP_ROOT/$name"; home="$case_dir/home"; proj="$case_dir/project"; wt="$case_dir/wt"
  fakebin=$(fm_fakebin "$case_dir/fake")
  node_bin=$(command -v node); ln -sf "$node_bin" "$fakebin/node"
  cat > "$fakebin/tmux" <<'SH'
#!/usr/bin/env bash
set -u
case "$*" in
  *"#{pane_current_path}"*) printf '%s\n' "${FM_FAKE_PANE_PATH:-}"; exit 0 ;;
  *"#{pane_tty}"*) exit 0 ;;
  *"#{pane_current_command}"*) printf '%s\n' "${FM_FAKE_COMMAND:-zsh}"; exit 0 ;;
esac
if [ "${1:-}" = send-keys ] && [ -n "${FM_TMUX_LOG:-}" ]; then printf '%s\n' "${!#}" >> "$FM_TMUX_LOG"; fi
case "${1:-}" in
  display-message) printf 'firstmate\n'; exit 0 ;;
  list-windows) [ -z "${FM_FAKE_WINDOW:-}" ] || printf '%s\n' "$FM_FAKE_WINDOW"; exit 0 ;;
esac
exit 0
SH
  cat > "$fakebin/orca" <<'SH'
#!/usr/bin/env bash
set -u
case "${1:-} ${2:-}" in
  "status --json") printf '{"ok":true,"result":{"runtime":{"reachable":true,"state":"ready"}}}\n' ;;
  "repo show"|"repo add") printf '{"ok":true,"result":{"id":"repo-omp-evidence"}}\n' ;;
  "worktree create") printf '{"ok":true,"result":{"worktree":{"id":"wt-omp-evidence","path":"%s"},"terminal":{"handle":"term-omp-evidence"}}}\n' "${FM_FAKE_PANE_PATH:?}" ;;
  "terminal create") printf '{"ok":true,"result":{"terminal":{"handle":"term-omp-evidence"}}}\n' ;;
  "terminal send")
    text=; saw=0; shift 2
    while [ "$#" -gt 0 ]; do
      if [ "$1" = --text ] && [ "$#" -gt 1 ]; then text=$2; saw=1; shift 2; else shift; fi
    done
    [ "$saw" -eq 1 ] && [ -n "${FM_TMUX_LOG:-}" ] && printf '%s\n' "$text" >> "$FM_TMUX_LOG"
    printf '{"ok":true,"result":{}}\n' ;;
  *) printf '{"ok":true,"result":{}}\n' ;;
esac
SH
  chmod +x "$fakebin/tmux" "$fakebin/orca"
  fm_fake_exit0 "$fakebin" treehouse
  cat > "$fakebin/omp" <<'SH'
#!/usr/bin/env bash
set -u
if [ "${1:-}" = --version ]; then printf 'omp/17.2.9\n'; exit 0; fi
echo "omp stub refuses to run a session" >&2
exit 97
SH
  chmod +x "$fakebin/omp"
  mkdir -p "$home/data" "$home/projects" "$home/state" "$home/config"
  printf 'claude\n' > "$home/config/crew-harness"
  fm_git_worktree "$proj" "$wt" "wt-$name" >/dev/null
  touch "$home/state/.last-watcher-beat"
  mkdir -p "$home/data/$id"; printf 'brief for %s\n' "$id" > "$home/data/$id/brief.md"
  printf '%s|%s|%s|%s|%s\n' "$case_dir" "$home" "$proj" "$wt" "$fakebin"
}

spawn() {  # <home> <wt> <fakebin> <args...>
  local home=$1 wt=$2 fakebin=$3; shift 3
  FM_ROOT_OVERRIDE='' FM_HOME="$home" \
    FM_STATE_OVERRIDE="$home/state" FM_DATA_OVERRIDE="$home/data" \
    FM_PROJECTS_OVERRIDE="$home/projects" FM_CONFIG_OVERRIDE="$home/config" \
    FM_SPAWN_NO_GUARD=1 FM_FAKE_PANE_PATH="$wt" TMUX="fake,1,0" \
    GROK_HOME="$home/grok-home" PATH="$fakebin:$PATH" FM_BACKEND=orca \
    FM_TMUX_LOG="${FM_TMUX_LOG:-}" "$SPAWN" "$@" 2>&1
}

home_mutations() {  # <home> - everything the spawn could have created
  local home=$1
  find "$home/state" "$home/config" -mindepth 1 \
    ! -name '.last-watcher-beat' ! -name 'crew-harness' -print 2>/dev/null | sed "s|$home|<home>|" | sort
}

# ---------------------------------------------------------------- behavior 1
rule "BEHAVIOR 1 - omp refuses any backend other than orca, before any mutation"
IFS='|' read -r C H P W F <<<"$(make_fixture b1 ompbackend)"
for backend in tmux herdr zellij cmux; do
  cmd "fm-spawn.sh ompbackend <project> --harness omp --model $MODEL --backend $backend --mode no-mistakes --yolo off"
  spawn "$H" "$W" "$F" ompbackend "$P" --harness omp --model "$MODEL" --backend "$backend" --mode no-mistakes --yolo off
  printf 'exit status: %s\n' "$?"
done
printf '\n-- everything the four refused spawns created under the home --\n'
out=$(home_mutations "$H"); printf '%s\n' "${out:-<nothing: no lock, endpoint, worktree, state, config, registry, metadata, or extension>}"

cmd "fm-spawn.sh ompbackend <project> --harness omp --model $MODEL --backend orca --mode no-mistakes --yolo off"
spawn "$H" "$W" "$F" ompbackend "$P" --harness omp --model "$MODEL" --backend orca --mode no-mistakes --yolo off
printf 'exit status: %s\n' "$?"

# ---------------------------------------------------------------- behavior 2
rule "BEHAVIOR 2 - trace suppression is ENFORCED, not assumed"
IFS='|' read -r C H P W F <<<"$(make_fixture b2 omptrace)"
printf '%s\n' "$$" > "$H/state/.lock"
printf '%s on\n' "$$" > "$H/state/.trace-context-effective"   # home session frozen trace=ON
CARRIER='00-0123456789abcdef0123456789abcdef-0123456789abcdef-01'
printf 'home session trace-context decision: %s\n' "$(cat "$H/state/.trace-context-effective")"
printf 'ambient TRACEPARENT in the operator shell: %s\n' "$CARRIER"
LOG="$C/endpoint-sends"; : > "$LOG"
cmd "TRACEPARENT=$CARRIER fm-spawn.sh omptrace <project> --harness omp --model $MODEL --backend orca --mode no-mistakes --yolo off"
TRACEPARENT="$CARRIER" FM_TMUX_LOG="$LOG" spawn "$H" "$W" "$F" omptrace "$P" --harness omp --model "$MODEL" --backend orca --mode no-mistakes --yolo off
printf 'exit status: %s\n' "$?"
printf '\n-- launch command actually delivered to the omp pane --\n'
grep -F -- '--approval-mode' "$LOG" | tail -1 | sed "s|$ROOT|<repo>|g; s|$C|<case>|g"
printf '\n-- every line sent to the pane (an enabled home would export TRACEPARENT here) --\n'
sed "s|$C|<case>|g" "$LOG"
printf '\n-- recorded metadata for the task --\n'
sed "s|$C|<case>|g" "$H/state/omptrace.meta"
printf '\ntraceparent= lines recorded: %s\n' "$(grep -c 'traceparent=' "$H/state/omptrace.meta" || true)"

# ---------------------------------------------------------------- behavior 3
rule "BEHAVIOR 3 - relaunch preflight runs BEFORE every lock"
IFS='|' read -r C H P W F <<<"$(make_fixture b3 omprelaunch)"
fm_write_meta "$H/state/omprelaunch.meta" \
  "window=fm-omprelaunch" "endpoint_task_id=omprelaunch" "worktree=$W" "project=$P" \
  "harness=omp" "kind=crewmate" "mode=no-mistakes" "yolo=off" "backend=tmux"
printf 'durable task record (adopted by --relaunch):\n'; sed "s|$C|<case>|g" "$H/state/omprelaunch.meta"
cmd "fm-spawn.sh --relaunch omprelaunch --model $MODEL"
spawn "$H" "$W" "$F" --relaunch omprelaunch --model "$MODEL"
printf 'exit status: %s\n' "$?"
cmd "fm-spawn.sh --relaunch omprelaunch      # recorded harness=omp, no --model flag"
spawn "$H" "$W" "$F" --relaunch omprelaunch
printf 'exit status: %s\n' "$?"

printf '\n-- unsafe relaunch record (metadata replaced by a symlink) --\n'
rm -f "$H/state/omprelaunch.meta"
ln -s /etc/hosts "$H/state/omprelaunch.meta"
cmd "fm-spawn.sh --relaunch omprelaunch --model $MODEL"
spawn "$H" "$W" "$F" --relaunch omprelaunch --model "$MODEL"
printf 'exit status: %s\n' "$?"

printf '\n-- lock files any of the three relaunch refusals left behind --\n'
out=$(find "$H/state" -name '*.lock*' -print 2>/dev/null | sed "s|$H|<home>|" | sort)
printf '%s\n' "${out:-<none: refused before the spawn lock and the meta lock>}"

rule "END OF TRANSCRIPT"
Evidence: Fails-without-the-change proof (one mutation per behavior, with the resulting failure line)
Proof that each harvested behavior is independently covered by a test that
FAILS without it. Each mutation was applied to bin/fm-spawn.sh in the worktree,
tests/fm-omp-harness.test.sh was re-run, and bin/fm-spawn.sh was then restored
byte-for-byte (git status clean afterwards).

--------------------------------------------------------------------------
1. backend=orca gate
   mutation: require_omp_orca_backend() { return 0; ... }
   result:
     not ok - omp-backend-1: refusal did not name the launch pin

--------------------------------------------------------------------------
2a. trace suppression - enforced effective decision
   mutation: `if [ "$HARNESS" = omp ]` -> `if false` at the
             SPAWN_TRACE_EFFECTIVE=off / SPAWN_TRACEPARENT= branch
   result:
     not ok - the enabled home must not export trace context to OMP

2b. trace suppression - TRACEPARENT stripped by the launch template
   mutation: dropped `-u TRACEPARENT` from the omp launch_template
   result:
     not ok - omp launch argv is not the contained shape
              (missing: env -u CLAUDECODE ... -u CURSOR_INVOKED_AS
               -u TRACEPARENT FM_OMP_HARNESS=1 ...)

--------------------------------------------------------------------------
3. relaunch preflight ahead of every lock
   mutation: spawn_selection_is_omp() returns 1 for --relaunch, i.e. the
             pre-lock preflight no longer drives omp's model/backend gates
   result:
     not ok - the relaunch refusal did not enforce Orca

--------------------------------------------------------------------------
Unmutated runs (restored tree):
  bash tests/fm-omp-harness.test.sh        -> all fm-omp-harness tests passed
  bash tests/fm-busy-adapter-wiring.test.sh -> all fm-busy-adapter-wiring tests passed
  bash tests/fm-backend-orca.test.sh        -> 1 failure, pre-existing:
      "Orca scout teardown should succeed once report exists" (task orcateardownz3)
      "fm-decision-hold: compatible tasks-axi is required"
      `command -v tasks-axi` -> absent on this host; that case is untouched by
      this change (context-only in the diff), and every omp-on-Orca case in the
      suite passes, including the new omp teardown/extension-cleanup case.
Evidence: Backend gate refusal + zero-mutation proof (excerpt)
$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend tmux --mode no-mistakes --yolo off
error: omp requires backend=orca; resolved backend 'tmux' is not authorized for this adapter
exit status: 1
... (herdr, zellij, cmux refused identically)

-- everything the four refused spawns created under the home --
<nothing: no lock, endpoint, worktree, state, config, registry, metadata, or extension>

$ fm-spawn.sh ompbackend <project> --harness omp --model anthropic/claude-sonnet-4-5 --backend orca --mode no-mistakes --yolo off
spawned ompbackend harness=omp kind=ship mode=no-mistakes yolo=off window=fm-ompbackend worktree=<case>/wt
exit status: 0
Evidence: Enforced trace suppression from a trace-on home with an ambient carrier (excerpt)
home session trace-context decision: 70921 on
ambient TRACEPARENT in the operator shell: 00-0123456789abcdef0123456789abcdef-0123456789abcdef-01

-- launch command actually delivered to the omp pane --
env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS -u CURSOR_AGENT -u CURSOR_INVOKED_AS -u TRACEPARENT FM_OMP_HARNESS=1 '<case>/fake/fakebin/omp' --approval-mode yolo --no-title --no-extensions --no-skills --tools read,write,edit,ls,grep,find,bash --model 'anthropic/claude-sonnet-4-5' -e '<case>/home/state/omptrace.omp-ext.ts' "$(...encode launch-brief < brief.md)"

-- every line sent to the pane (an enabled home would export TRACEPARENT here) --
export GOTMPDIR=/tmp/fm-omptrace/gotmp
env -u ... -u TRACEPARENT FM_OMP_HARNESS=1 ... (launch)

traceparent= lines recorded in state/omptrace.meta: 0
Evidence: Relaunch preflight refusing ahead of every lock (excerpt)
durable task record (adopted by --relaunch): harness=omp ... backend=tmux

$ fm-spawn.sh --relaunch omprelaunch --model anthropic/claude-sonnet-4-5
error: omp requires backend=orca; resolved backend 'tmux' is not authorized for this adapter
exit status: 1

$ fm-spawn.sh --relaunch omprelaunch # recorded harness=omp, no --model flag
error: omp requires an explicit --model <provider>/<model> flag on every spawn; without one omp would resolve the provider itself
exit status: 1

-- unsafe relaunch record (metadata replaced by a symlink) --
$ fm-spawn.sh --relaunch omprelaunch --model anthropic/claude-sonnet-4-5
error: --relaunch needs an existing task record that is a regular, non-symlink metadata file for omprelaunch
exit status: 1

-- lock files any of the three relaunch refusals left behind --
<none: refused before the spawn lock and the meta lock>
- Outcome: ⚠️ 1 info across 1 run (7m53s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

🔧 **Rebase** - 1 issue found → auto-fixed ✅
  • ⚠️ bin/fm-spawn.sh - merge conflict rebasing onto origin/main

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

⚠️ **Review** - 4 infos
  • ℹ️ bin/fm-spawn.sh:3104 - The Orca metadata-publication refusal is dead code. The script runs under set -eu (line 219) and } &gt; &#34;$SPAWN_META_PATH&#34; is a top-level compound, so a failed redirect or a failed echo inside the group aborts via errexit before META_WRITE_STATUS=$? ever runs; if errexit somehow did not fire, the group's status is that of its last command (the if [ &#34;$SPAWN_CONTROL_PARENT&#34; = 1 ] ... test), which is 0 on the common path. tests/fm-backend-orca.test.sh:test_spawn_releases_orca_resources_when_metadata_write_fails confirms this: it asserts the raw bash &#34;Is a directory&#34; message, never &#34;failed to publish Orca metadata&#34;. The invariant (never promote broken metadata) does hold, but via errexit + the abort trap, not via this branch. Making it real is mechanical: if ! { ... } &gt; &#34;$SPAWN_META_PATH&#34;; then suppresses errexit for the group so the status is actually observable.
  • ℹ️ bin/fm-spawn.sh:3017 - A raw launch command whose first non-assignment word is omp (e.g. fm-spawn.sh &lt;id&gt; &lt;proj&gt; &#34;omp --model a/b&#34; --mode ... --yolo off) sets HARNESS=omp at line 1481, which then reaches the omp-specific branches — forced trace-off here, omp-ext busy wiring in fm-busy-lib.sh, harness=omp in metadata — while spawn_selection_is_omp deliberately returns 1 for any ARG3 containing a space, so the version pin, --model &lt;provider&gt;/&lt;model&gt; pin, and backend=orca gate are all skipped. The header comment states raw commands are intentionally outside every adapter contract, and muse handles this the other way (its secondmate refusal at line 1520 keys on $HARNESS and so does cover raw commands). Worth confirming the asymmetry is intended: as written, a raw omp ... string is one CLI argument away from an unpinned omp build launching on tmux while still being recorded and supervised as harness=omp.
  • ℹ️ bin/fm-spawn.sh:534 - The new preflight is the one part of this change that alters a shared, non-omp production path: every --relaunch, on every harness, now refuses before the watcher guard and every lock if state/&lt;id&gt;.meta is a symlink, is not a regular file, or fails the two-descriptor stability binding. Previously the relaunch path only required [ -f &#34;$RELAUNCH_META&#34; ], which follows symlinks. This matches the stated intent ("reject unsafe relaunch records early") and test_valid_nonomp_relaunch_passes_the_preflight covers the happy path, but the refusal is new for all adapters, not just the dormant omp one — noting it so the blast radius is a recorded decision rather than a surprise.
  • ℹ️ bin/fm-spawn.sh:1538 - The late relaunch gate re-implements the Orca check inline ([ &#34;$BACKEND&#34; != orca ] plus a byte-identical copy of the refusal message from require_omp_orca_backend at line 466) instead of sharing one emitter. The two checks legitimately read different sources of truth — the pre-lock resolved value versus the locked, record-adopted $BACKEND — so the duplicated logic is defensible, but the duplicated message string is a drift hazard: tests/fm-omp-harness.test.sh asserts on &#34;omp requires backend=orca&#34; and would silently stop covering one of the two sites if only one string changed. Extracting a small refuse_omp_non_orca_backend &lt;resolved&gt; helper that both call keeps the two independent resolutions and removes the duplicated literal.
⚠️ **Test** - 1 info
  • ℹ️ tests/fm-backend-orca.test.sh:955 - tests/fm-backend-orca.test.sh has one failure, "Orca scout teardown should succeed once report exists" (task orcateardownz3), because tasks-axi is absent on this host and the scout completion gate refuses without it (fm-decision-hold: compatible tasks-axi is required). That case is untouched by this change (context-only in the diff) and cannot be fixed from inside the worktree — installing tasks-axi is out of bounds. Every omp-on-Orca case in the suite passes, including the new omp teardown/extension-cleanup case.
  • bash tests/fm-omp-harness.test.sh — all passed (24 cases plus the 12-class model matrix and 8-row selection matrix, both self-reporting their row counts)
  • bash tests/fm-busy-adapter-wiring.test.sh — all passed, including the two omp-ext cases
  • bash tests/fm-backend-orca.test.sh — 1 failure, pre-existing host gap (see findings); the omp Orca launch and omp teardown/extension-cleanup cases pass
  • Manual CLI transcript via omp-harvest-demo.sh: real bin/fm-spawn.sh against stub tmux/orca/omp — backend matrix (tmux/herdr/zellij/cmux refused, orca launches) plus a post-refusal find over state/ and config/ showing zero mutations
  • Manual CLI transcript: TRACEPARENT=&lt;carrier&gt; fm-spawn.sh ... --harness omp --backend orca from a home whose .trace-context-effective is frozen on — captured the delivered launch argv, every pane send line, and the full recorded &lt;id&gt;.meta
  • Manual CLI transcript: fm-spawn.sh --relaunch &lt;id&gt; against a backend=tmux omp record, then without --model, then against a symlinked metadata record — captured each refusal plus a find for *.lock*
  • Fails-without-the-change proof: neutered require_omp_orca_backend, then the HARNESS = omp trace-force branch, then -u TRACEPARENT in the omp launch template, then the --relaunch arm of spawn_selection_is_omp; re-ran bash tests/fm-omp-harness.test.sh after each and restored bin/fm-spawn.sh (git status clean)
⚠️ **Document** - 1 info
  • ℹ️ .agents/skills/harness-adapters/SKILL.md:44 - Pre-existing wording in .agents/skills/harness-adapters/SKILL.md's new-harness verification checklist says the bin/backends/tmux.sh agent-process liveness classification is recorded "when the harness can launch a secondmate". Both muse and now omp are crewmate/scout-only yet correctly carry that classification for pane liveness, so the conditional under-describes when it is required. Left unedited as out of scope (the looseness predates this change and the omp section already documents its own anchored classification); worth a one-line wording fix in a follow-up.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

omp (Oh My Pi) joins as a CANDIDATE crewmate/scout adapter, not a verified
one: the wiring is deterministically proven against a stub executable, but
its first live pilot stays separately approval-gated, so nothing dispatches
real work on it yet.

It is reachable only through an explicit --harness omp or an explicit local
config/crew-harness value; it is never a coordinator, a backend, or an
implicit default, and the shipped configuration is unchanged.

Every omp launch is pinned twice. The executable must be the `omp` on PATH
reporting exactly omp/17.2.9, probed with --version and nothing else. The
model must arrive on this spawn's own --model flag as a fully qualified
provider/model, validated structurally and passed through byte-for-byte;
omp's legacy --provider flag is never passed, so no fuzzy match, provider
cycle, or fallback is reachable from the launch.

An absent, unqualified, malformed, or ambiguous model - and a secondmate
selection, on adapter identity alone - refuses before the watcher guard runs
and before any lock, endpoint, worktree, state, config, registry, metadata,
or extension mutation. The guard therefore moves below argument parsing and
the effective-selection resolution, and the positional harness split is
hoisted to that same point so it is resolved once, as pure string work,
before anything is created. A --relaunch adopts its harness from the task's
own record, so it reaches the identical refusals at that adoption point.

The launch clears the foreign CLAUDECODE, PI_CODING_AGENT, GROK_AGENT, and
FM_PI_HARNESS markers and sets the firstmate-owned FM_OMP_HARNESS=1;
--no-extensions and --no-skills leave the firstmate-written
state/<id>.omp-ext.ts as the only loaded extension; and the --tools
allowlist excludes omp's task subagent delegation plus its browser,
computer, web-search, and MCP surface. No effort flag is wired.

Liveness and the busy-state trust table both match the exact token `omp`,
never a substring, because `omp` occurs inside ordinary shell machinery such
as compinit, compdef, and composer. Teardown removes the per-task extension
in both its top-level and secondmate-child cleanup lists.

Non-omp harnesses are unchanged and still receive no model or provider flag
when none was requested.

tests/fm-omp-harness.test.sh adds two policy matrices that report their own
row counts rather than a bare pass: 12 equivalence classes of rejected model
value and 8 selection shapes, each proven to refuse before any mutation.
The landed omp candidate could still launch on a non-Orca backend, inherited
the home's frozen trace-context decision, and applied its model pin on
relaunch only after lock acquisition.

Resolve the backend read-only before any mutation, retain that value so the
refusal and endpoint creation cannot drift, and refuse any resolved backend
other than orca at the same early gate as the model pin. Force effective
trace propagation off for omp and strip TRACEPARENT from the child so an
ambient carrier cannot reach it.

Bind one read-only regular-file metadata snapshot before every lock so a
relaunch can apply omp's model and backend gates, and reject an unsafe
record, before the watcher guard, spawn lock, or any other mutation. The
locked endpoint validation remains authoritative. This does not change the
existing Orca metadata-publication refusal that already sits after the
temp-file write and before relaunch promotion.

omp stays a CANDIDATE adapter: no shipped default, no live-verified claim.
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

firstmate/bin/fm-spawn.sh

Lines 662 to 664 in 4f071a5

configured=$("$FM_ROOT/bin/fm-harness.sh" crew 2>/dev/null || true)
fi
[ "$configured" = omp ]

P1 Badge Refuse implicit omp selection from static config

Captain, when config/crew-harness contains omp, a spawn without --harness reaches this branch, satisfies the omp gates, and later launches the candidate adapter as the configured default. This bypasses the required per-invocation explicit selection and the rule that an unverified adapter found in static config must fall back to a verified adapter; it can therefore give real work to omp before its approval-gated pilot. Refuse this configured selection rather than treating it like an explicit --harness omp.

AGENTS.md reference: AGENTS.md:L187-L189

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@devin-ai-integration

Copy link
Copy Markdown

Closed as superseded — this work already landed on main via #3867.

— Kun's Firstmate

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