Skip to content

test: launch Grok in the liveness guard only on explicit opt-in - #7790

Open
c6aw wants to merge 2 commits into
kunchenguid:mainfrom
c6aw:fm/report-upstream-fm-live-harness-oauth
Open

c6aw wants to merge 2 commits into
kunchenguid:mainfrom
c6aw:fm/report-upstream-fm-live-harness-oauth

Conversation

@c6aw

@c6aw c6aw commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Intent

tests/fm-harness-liveness-drift-live-e2e.test.sh is a default-on live guard that launches every installed harness bare. The Grok CLI opens a browser to authenticate on first launch when it has no usable sign-in, so a plain full-suite run on a host with Grok installed but not signed in opens an unrequested browser sign-in. The guard should launch Grok only with an explicit opt-in (FM_GROK_LIVE_E2E=1, which the Grok-specific live test already uses, or FM_LIVE=1), and otherwise report Grok as skipped with the variable to set. Other harnesses stay unchanged.

What Changed

  • tests/fm-harness-liveness-drift-live-e2e.test.sh now skips Grok unless FM_GROK_LIVE_E2E=1 or FM_LIVE=1 is set. A bare launch without a usable sign-in opens a browser to authenticate. FM_GROK_LIVE_E2E=0 keeps Grok off even when FM_LIVE=1 is set. A skipped run prints a note that names FM_GROK_LIVE_E2E=1. The closing summary now reads "not installed or not opted in". The other harnesses are unchanged.
  • tests/fm-live-gate.test.sh adds test_liveness_guard_launches_grok_only_on_request. It runs the guard against a fake grok, on a PATH from which every real harness name is removed, and checks four cases:
    • With no variable set, Grok is not launched and the skip note appears.
    • FM_GROK_LIVE_E2E=1 launches Grok bare.
    • FM_LIVE=1 together with FM_GROK_LIVE_E2E=0 does not launch Grok.
    • FM_LIVE=1 alone launches Grok.
  • The same test also checks that a decoy claude in a system directory is never launched.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is limited to tests. It adds a narrow Grok skip to the liveness guard that matches fm_live_gate's precedence: FM_GROK_LIVE_E2E=1 launches Grok, FM_LIVE=1 launches it unless FM_GROK_LIVE_E2E=0, and otherwise Grok is skipped with the variable named. The other harnesses are unchanged. The new regression test runs the real guard against a fake grok on an isolated PATH and HOME, so no real harness can launch.

Testing

I ran the real default-on guard on a host with Grok installed and no opt-in. It checked all six other installed harnesses, and every one was classified alive and identified correctly. It skipped Grok with a message naming FM_GROK_LIVE_E2E=1, and it never started the grok binary. The new targeted test runs the real guard script against a fake grok. It shows four results: no opt-in skips Grok; FM_GROK_LIVE_E2E=1 launches it bare; FM_LIVE=1 launches it; and FM_GROK_LIVE_E2E=0 keeps it off even when FM_LIVE=1 is set. The same test fails against the guard from before the fix, because the old guard ran grok --version without an opt-in. These test results are not live product runs, so the opt-in, override and regression scenarios are recorded as untested live. I did not launch the real Grok opted in. On this host that could open the very browser sign-in the change exists to prevent. Nothing in this change has a visual surface, so there are no screenshots.

  • Live validation: ✅ go - 2 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A plain run of the default-on liveness guard on a host with Grok installed skips Grok, names FM_GROK_LIVE_E2E=1, and never runs the grok binary ✅ pass live guard-default-run.txt: '# skip: grok can open a browser sign-in when launched, so set FM_GROK_LIVE_E2E=1 to check its classification'; no grok version line, so the guard did not even run `grok --versi…
Other harnesses stay unchanged: the guard still launches and checks claude, codex, opencode, pi, cursor and muse ✅ pass live guard-default-run.txt: 12 'ok' lines for liveness and detection, then 'checked 6 installed harness(es)'
FM_GROK_LIVE_E2E=1 or FM_LIVE=1 makes the guard launch Grok bare ⏸️ untested no The prior payload did not establish a live result: this path was checked only by fm-live-gate.test.sh with a fake grok binary. Launching the real Grok opted in on this host could open the browser sign…
Adversarial: FM_GROK_LIVE_E2E=0 keeps Grok off even when FM_LIVE=1 is set ⏸️ untested no The prior payload did not establish a live result: this case was checked only by fm-live-gate.test.sh with the same fake grok binary, not against the real guard run with real Grok installed.
Regression: the new test fails against the guard from before the fix ⏸️ untested no The prior payload did not establish a live result: this was a test-suite run against the base-commit guard, which proves the test catches the old behaviour but is not a live product run.
Evidence: Real guard run with no opt-in (Grok skipped, the six other harnesses pass)

Source: Real guard run with no opt-in (Grok skipped, the six other harnesses pass)

# claude 2.1.304 (Claude Code): title='claude' foreground=[claude ]
ok - harness liveness: claude 2.1.304 (Claude Code) classifies alive
# claude 2.1.304 (Claude Code): ancestry verdicts=[comm claude]
ok - harness detection: claude 2.1.304 (Claude Code) is identified by the ancestry walk at comm strength
# codex codex-cli 0.157.1: title='codex' foreground=[codex ]
ok - harness liveness: codex codex-cli 0.157.1 classifies alive
# codex codex-cli 0.157.1: ancestry verdicts=[comm codex]
ok - harness detection: codex codex-cli 0.157.1 is identified by the ancestry walk at comm strength
# opencode 1.18.35: title='opencode' foreground=[opencode ]
ok - harness liveness: opencode 1.18.35 classifies alive
# opencode 1.18.35: ancestry verdicts=[comm opencode]
ok - harness detection: opencode 1.18.35 is identified by the ancestry walk at comm strength
# pi 1.0.4: title='pi' foreground=[pi ]
ok - harness liveness: pi 1.0.4 classifies alive
# pi 1.0.4: ancestry verdicts=[comm pi]
ok - harness detection: pi 1.0.4 is identified by the ancestry walk at comm strength
# skip: pi-signed is not installed on this machine, so its classification is unverified here
# skip: grok can open a browser sign-in when launched, so set FM_GROK_LIVE_E2E=1 to check its classification
# skip: kimi is not installed on this machine, so its classification is unverified here
# cursor 2026.10.01-e373342: title='cursor-agent' foreground=[MainThread ]
ok - harness liveness: cursor 2026.10.01-e373342 classifies alive
# cursor 2026.10.01-e373342: ancestry verdicts=[comm cursor]
ok - harness detection: cursor 2026.10.01-e373342 is identified by the ancestry walk at comm strength
# muse Muse Code 1.4.13 (1.4.13-R6996.1): title='muse-bin-1.4.13-R6996.1' foreground=[muse-bin-1.4.13 ]
ok - harness liveness: muse Muse Code 1.4.13 (1.4.13-R6996.1) classifies alive
# muse Muse Code 1.4.13 (1.4.13-R6996.1): ancestry verdicts=[comm muse]
ok - harness detection: muse Muse Code 1.4.13 (1.4.13-R6996.1) is identified by the ancestry walk at comm strength
# unverified on this machine (not installed or not opted in): pi-signed grok kimi
# checked 6 installed harness(es)
Evidence: fm-live-gate test run on the change

Source: fm-live-gate test run on the change

ok - a default-on guard runs wherever its tools are installed
ok - an absent tool is a named capability skip, not a silent pass
ok - a prompt-submitting guard stays off until it is asked for
ok - a guard's own variable turns it on
ok - a demanded run refuses to pass as a skip
ok - FM_LIVE switches the whole family
ok - a guard's own setting wins over FM_LIVE
ok - any entry point of a multi-mode guard turns it on
ok - the shared gate carries the gate-refusal bypass into every live guard
ok - a proceeding live run exports DISABLE_AUTOUPDATER=1
ok - DISABLE_AUTOUPDATER rides fm-spawn's claude launch through to the harness pane
ok - DISABLE_AUTOUPDATER is embedded in the launch so a daemon-built pane keeps it
ok - the default-on liveness guard launches grok only on request
ok - all 50 live guards refuse together on FM_LIVE=0
Evidence: New test failing against the guard from before the fix

Source: New test failing against the guard from before the fix

not ok - the liveness guard must not launch grok without an opt-in: launch:--version

ok - a default-on guard runs wherever its tools are installed
ok - an absent tool is a named capability skip, not a silent pass
ok - a prompt-submitting guard stays off until it is asked for
ok - a guard's own variable turns it on
ok - a demanded run refuses to pass as a skip
ok - FM_LIVE switches the whole family
ok - a guard's own setting wins over FM_LIVE
ok - any entry point of a multi-mode guard turns it on
ok - the shared gate carries the gate-refusal bypass into every live guard
ok - a proceeding live run exports DISABLE_AUTOUPDATER=1
ok - DISABLE_AUTOUPDATER rides fm-spawn's claude launch through to the harness pane
ok - DISABLE_AUTOUPDATER is embedded in the launch so a daemon-built pane keeps it
not ok - the liveness guard must not launch grok without an opt-in: launch:--version
launch:

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 5 scenarios driven live against the product
Scenario Result Live Evidence
A plain run of the default-on liveness guard on a host with Grok installed skips Grok, names FM_GROK_LIVE_E2E=1, and never runs the grok binary ✅ pass live guard-default-run.txt: '# skip: grok can open a browser sign-in when launched, so set FM_GROK_LIVE_E2E=1 to check its classification'; no grok version line, so the guard did not even run `grok --versi…
Other harnesses stay unchanged: the guard still launches and checks claude, codex, opencode, pi, cursor and muse ✅ pass live guard-default-run.txt: 12 'ok' lines for liveness and detection, then 'checked 6 installed harness(es)'
FM_GROK_LIVE_E2E=1 or FM_LIVE=1 makes the guard launch Grok bare ⏸️ untested no The prior payload did not establish a live result: this path was checked only by fm-live-gate.test.sh with a fake grok binary. Launching the real Grok opted in on this host could open the browser sign…
Adversarial: FM_GROK_LIVE_E2E=0 keeps Grok off even when FM_LIVE=1 is set ⏸️ untested no The prior payload did not establish a live result: this case was checked only by fm-live-gate.test.sh with the same fake grok binary, not against the real guard run with real Grok installed.
Regression: the new test fails against the guard from before the fix ⏸️ untested no The prior payload did not establish a live result: this was a test-suite run against the base-commit guard, which proves the test catches the old behaviour but is not a live product run.
  • env -u FM_LIVE -u FM_GROK_LIVE_E2E bash tests/fm-harness-liveness-drift-live-e2e.test.sh (the real guard on this host, with real claude, codex, opencode, pi, cursor-agent and muse installed, and Grok installed too)
  • bash tests/fm-live-gate.test.sh, including the new test_liveness_guard_launches_grok_only_on_request (the real guard script run against a fake grok that records each launch: no opt-in, FM_GROK_LIVE_E2E=1, FM_LIVE=1 with FM_GROK_LIVE_E2E=0, and FM_LIVE=1)
  • Regression check: bash tests/fm-live-gate.test.sh run against the guard from the base commit, then the fixed guard put back (worktree clean)
✅ **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: thank you @c6aw. Grok opening an unrequested browser sign-in during a plain full-suite run is exactly the kind of surprise a default-on guard shouldn't cause.

What I checked at 5f135240 against main 127f0f30: the change is tests only (tests/fm-harness-liveness-drift-live-e2e.test.sh and tests/fm-live-gate.test.sh). The guard now skips Grok unless FM_GROK_LIVE_E2E=1, or FM_LIVE=1 without FM_GROK_LIVE_E2E=0, which matches fm_live_gate's precedence. The skip note names the variable, and the other harnesses are unchanged. The new test runs the real guard against a fake grok, on a PATH with every real harness name removed. It has no workflow, credential or network surface. Your guard-default-run evidence shows Grok skipped and the six other harnesses checked.

Contract-class: opt-in (my own read). Launching Grok from this guard becomes off unless you turn it on. Nothing in the product changes.

VISION: One captain aligns (no surprise browser prompt) · Authority aligns ("never behavior that assumes consent", applied to a test that can trigger a sign-in) · Scripts aligns · Restart n/a · Delegation aligns (a regression test that fails on the old guard) · Vendor aligns (the other harnesses keep their coverage) · Scope aligns.

CI: the run on this head is still in progress. Main's own CI is currently red from the ubuntu 26.04 runner move, so some Linux serial shards will probably fail here for reasons that have nothing to do with this change. That is on our side, not yours. The no-mistakes check passes, and the attestation binds this head.

Status: waiting on CI. Nothing is needed from you. Once CI is green on this head and it's clean, this can merge.

@c6aw

c6aw commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

The red jobs in run 40338691919 look unrelated to this change, which touches only tests/fm-harness-liveness-drift-live-e2e.test.sh and tests/fm-live-gate.test.sh. Each failing script fails in the same shard on main at this PR's base, in run 40280579086 (127f0f3):

  • Behavior portable serial 1: tests/fm-supervision-host.test.sh
  • Behavior portable serial 3: tests/fm-public-followup.test.sh
  • Behavior portable serial 4: tests/fm-contributions.test.sh, tests/fm-fleet-ledger.test.sh and tests/fm-herdr-groups.test.sh
  • Behavior portable serial 5: tests/fm-record-export.test.sh
  • Behavior portable serial 7: tests/fm-backend-rex.test.sh and tests/fm-pr-health.test.sh
  • Behavior portable serial 9: tests/fm-watch-checkpoint.test.sh

None of these scripts runs the liveness guard or the live-gate test, and tests/fm-live-gate.test.sh passes in serial 9 of this run.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @c6aw, that breakdown is right. I checked run 40338691919 against main's run 40280579086 at 127f0f30. Serials 1, 3, 4, 5, 7 and 9 fail on the same scripts as main. Serial 2, which your list leaves out, didn't fail a test. It was cancelled at the 30-minute job cap on the ubuntu-26.04 image. That's the same slow-runner class we're seeing across the 26.04 move. None of it touches the liveness guard or tests/fm-live-gate.test.sh.

Head is still 5f135240, so my earlier read stands. Contract-class: opt-in, the no-mistakes attestation binds this head, and the review found nothing.

Main CI is red from the ubuntu 26.04 runner move. That's on our side, not yours, and a fix is pending. Status: waiting on CI, and nothing is needed from you. Once the fix lands we'll rerun this on fresh main, and when it's green and clean it merges.

@c6aw

c6aw commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Now that #7798 has pinned the runner image, could the failed serial jobs on head 5f13524 be rerun? On 10-26 they failed on the same scripts as main did on that image. If you would rather see a rebase onto current main, I can do that instead.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @c6aw. Yes, the red serials on run 40338691919 were the ubuntu-26.04 image, as we went through on 10-26. You don't need to rebase.

Rerunning those jobs wouldn't give a useful answer. A rerun replays the original workflow and merge ref, so it would stay on the unpinned image and the old main. Outside PRs now get the Full suite through the full-ci label, which starts a fresh run on current main with the pinned runner. That step is ours.

Head 5f135240 is unchanged, so my read stands: contract-class opt-in. The liveness guard launches Grok only with FM_GROK_LIVE_E2E=1, or with FM_LIVE=1 and no FM_GROK_LIVE_E2E=0. The change is tests only and still merges cleanly into current main. The no-mistakes attestation binds this head with every step completed, and live validation is go. There are no review threads. VISION aligns as in my earlier note.

Status: this is waiting on us to run the full suite, not on you. If it passes and the PR is still clean, it merges on a later pass.

@c6aw

c6aw commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Head 5f13524 is unchanged since the runner image was pinned. Following your note here that outside PRs now get the full suite through the full-ci label, would a full-ci run be the right next step?

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