Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .agents/skills/firstmate-coding-guidelines/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ Every such check needs two tests, because they fail for different reasons:
- A portable regression in `tests/` that pins the logic with real processes and no harness, so CI enforces the classifier everywhere it runs tmux.
Drive the signals apart deliberately and assert the verdict survives losing one; assert the divergence itself so the case cannot go quietly vacuous.
Confirm which signal a given construction actually blinds on each supported platform rather than assuming, because the same trick can break different sources on macOS and Linux.
- A live guard in the `live-harness-optin` family (`bin/fm-test-run.sh`), env-gated and self-skipping, that exercises every INSTALLED harness for real and fails naming the harness and version.
- A live guard in the `live-harness-optin` family (`bin/fm-test-run.sh`) that exercises every INSTALLED harness for real and fails naming the harness and version.
Report an absent harness explicitly rather than passing silently over it, and refuse a pass that checked nothing.
This guard is opt-in and on-demand because standard CI has neither harness binaries nor credentials; run it after every harness upgrade and before trusting refreshed per-harness evidence.
Open it with `fm_live_gate` from `tests/lib.sh`, which is the single owner of that decision: a guard that spends no model tokens runs by default wherever its tools are installed, a guard that submits prompts stays opt-in, and its own variable or `FM_LIVE` forces it on (an absent tool then fails rather than skips) or off.
The portable serial CI lane has no credentials and installs the public Pi package, so token-free guards exercise the available Pi surfaces while unavailable tools capability-skip; run a prompt-submitting guard after every harness upgrade and before trusting refreshed per-harness evidence.

Record the dated per-harness result in `docs/verification/runtime-backends.md`, and point at the live guard as the command that refreshes it, rather than leaving a version-scoped observation to rot into a false claim.

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,17 @@ jobs:
set -eu
npm install -g tasks-axi
tasks-axi --version
- name: Install the Pi package for the Pi extension tests
run: |
set -eu
npm install -g @earendil-works/pi-coding-agent
npm ls -g --depth 0 @earendil-works/pi-coding-agent
- name: Run portable parallel shard 1
run: |
set -eu
mkdir -p "$RUNNER_TEMP/fm-test"
bin/fm-test-run.sh --lane portable-parallel-1 \
--fail-on-gate-skip 'installed @earendil-works/pi-coding-agent package not found' \
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
--json "$RUNNER_TEMP/fm-test/fm-test-timing-portable-parallel-1.json"
- name: Upload shard 1 timing artifact
if: always()
Expand Down Expand Up @@ -165,6 +171,14 @@ jobs:
set -eu
npm install -g tasks-axi
tasks-axi --version
# The Pi extension tests read the installed Pi package's own types and
# runtime, so without it they gate-skip and pass silently. It is a public
# npm package and needs no credential, so CI can hold the real thing.
- name: Install the Pi package for the Pi extension tests
run: |
set -eu
npm install -g @earendil-works/pi-coding-agent
npm ls -g --depth 0 @earendil-works/pi-coding-agent
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
- name: Run portable serial shard ${{ matrix.shard }}
env:
# job-total rather than a literal, so shrinking or growing the matrix
Expand All @@ -175,7 +189,10 @@ jobs:
run: |
set -eu
mkdir -p "$RUNNER_TEMP/fm-test"
# The Pi package is installed above, so a skip for its absence means
# the install broke rather than that this host cannot run the test.
bin/fm-test-run.sh --lane "$FM_SERIAL_LANE" \
--fail-on-gate-skip 'installed @earendil-works/pi-coding-agent package not found' \
--json "$RUNNER_TEMP/fm-test/fm-test-timing-portable-serial-${FM_SERIAL_SHARD}.json"
- name: Upload portable serial shard ${{ matrix.shard }} timing artifact
if: always()
Expand Down
47 changes: 38 additions & 9 deletions bin/fm-test-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
# fm-test-run.sh --aggregate-json <out.json> <lane.json> [more lane.json...]
#
# Options:
# --json <path> write a deterministic timing artifact after the run
# --json <path> write a deterministic timing artifact after the run. Each
# script record carries its family, expected gate-skip class,
# exit, duration, whether it gate-skipped, and the reason it
# gave (empty when it ran), so a lane can say which harness or
# tool this host could not exercise.
# --list print selected script paths (one per line) and exit 0
# --list-scheduled
# print selected paths longest-hint-first and exit 0
Expand Down Expand Up @@ -90,7 +94,13 @@
# --fail-on-gate-skip token appears, the measured duration exceeds
# --max-wall-ms, timing-artifact finalization fails, or a concurrent worker
# violates its isolation check. Other gate skips (first meaningful line
# matching ^skip:) remain successful and are counted as skipped_gate.
# matching ^skip:) remain successful and are counted as skipped_gate; each one
# is logged with its reason and recorded in the timing artifact.
#
# expected_gate_skip classes name why a family is allowed to skip: herdr (the
# pinned real-Herdr lane), optional-binary (a backend whose binary is optional),
# live-capability (a live-harness guard governed by fm_live_gate, which records
# unavailable tools and explicit policy skips; see tests/lib.sh), or none.
#
# Family labels, the changed-file map, and production portable-shard composition
# live in this script only (one owner). The proven-isolated candidate set remains
Expand Down Expand Up @@ -329,6 +339,7 @@ family_for_basename() {
fm-no-mistakes-required.test.sh|fm-peek-remote.test.sh|\
fm-pending-reply.test.sh|fm-pi-branch-extension.test.sh|\
fm-procevent-quota.test.sh|fm-procevent-when.test.sh|fm-procevent.test.sh|\
fm-live-gate.test.sh|\
fm-project-origin.test.sh|fm-public-followup.test.sh|fm-quota-choose.test.sh|\
fm-remote-entrypoint.test.sh|fm-remote-secondmate-parent-binding.test.sh|\
fm-send-remote-delivery.test.sh|fm-spawn-pool-base-freshen.test.sh|\
Expand All @@ -346,7 +357,7 @@ family_for_basename() {
expected_gate_skip_for_family() {
case "$1" in
real-herdr-gated) printf '%s\n' herdr ;;
live-harness-optin) printf '%s\n' optin-env ;;
live-harness-optin) printf '%s\n' live-capability ;;
cmux|zellij|orca) printf '%s\n' optional-binary ;;
snapshot-bearings) printf '%s\n' optional-binary ;;
*) printf '%s\n' none ;;
Expand Down Expand Up @@ -515,8 +526,8 @@ is_proven_isolated_script() {

# The portable serial remainder: every tests/*.test.sh that is neither
# proven-isolated nor real-herdr-gated. Watcher, lock, AFK, real tmux, daemon,
# secondmate lifecycle, bootstrap, live-harness opt-in, GUI-backend, and other
# unproven work stays here. Derived rather than enumerated so a newly added test
# secondmate lifecycle, bootstrap, the live-harness-optin family, GUI-backend,
# and other unproven work stays here. Derived rather than enumerated so a newly added test
# lands here by default instead of falling out of every lane.
list_portable_serial() {
local s base fam
Expand Down Expand Up @@ -598,6 +609,7 @@ tests/fm-home-summary-refresh.test.sh 34793
tests/fm-inactive-reconcile.test.sh 41826
tests/fm-kimi-harness.test.sh 18015
tests/fm-lint-workflows.test.sh 855
tests/fm-live-gate.test.sh 6000
tests/fm-muse-harness.test.sh 55572
tests/fm-muse-signals-live-e2e.test.sh 23
tests/fm-no-mistakes-required.test.sh 370
Expand Down Expand Up @@ -1497,6 +1509,17 @@ detect_gate_skip() {
esac
}

# Echo the reason a gate skip gave, i.e. the first meaningful output line with
# its leading "skip:" removed. Tabs and stray whitespace are folded so the
# reason stays one field of the tab-separated record the JSON artifact is built
# from. Callers only use this once detect_gate_skip has already said yes.
gate_skip_reason() {
local file=$1 first
first=$(awk 'NF { print; exit }' "$file" 2>/dev/null || true)
first=${first#skip:}
printf '%s\n' "$first" | tr '\t' ' ' | sed -e 's/^ *//' -e 's/ *$//'
}

# True when any output line contains "skip: <token>" (token may contain spaces).
detect_gate_skip_token() {
local file=$1 token=$2
Expand Down Expand Up @@ -1550,14 +1573,15 @@ with open(records_file, encoding="utf-8") as fh:
line = line.rstrip("\n")
if not line:
continue
path, family, expected, exit_s, dur_s, gate = line.split("\t")
path, family, expected, exit_s, dur_s, gate, reason = line.split("\t")
scripts.append({
"path": path,
"family": family,
"expected_gate_skip": expected,
"duration_ms": int(dur_s),
"exit": int(exit_s),
"gate_skip": gate == "true",
"gate_skip_reason": reason,
})

families = []
Expand Down Expand Up @@ -2063,7 +2087,7 @@ family_bump() {

record_script_result() {
local script=$1 rc=$2 duration=$3 out=$4 end_iso=$5
local base family expected gate_skip fail_delta
local base family expected gate_skip gate_reason fail_delta
base=$(basename "$script")
family=$(family_for_basename "$base")
expected=$(expected_gate_skip_for_family "$family")
Expand All @@ -2074,9 +2098,14 @@ record_script_result() {
fi

gate_skip=false
gate_reason=
if [ "$rc" -eq 0 ] && detect_gate_skip "$out"; then
gate_skip=true
gate_reason=$(gate_skip_reason "$out")
SKIPPED_GATE=$((SKIPPED_GATE + 1))
# A capability skip is the runner's only record of what this host could not
# exercise, so name it rather than leaving a silent green.
log "gate skip: $script: ${gate_reason:-<no reason given>}"
fi

printf 'FM_TEST_END %s %s exit=%s duration_ms=%s gate_skip=%s\n' \
Expand All @@ -2089,8 +2118,8 @@ record_script_result() {
AGG_RC=1
fi

printf '%s\t%s\t%s\t%s\t%s\t%s\n' \
"$script" "$family" "$expected" "$rc" "$duration" "$gate_skip" >>"$RECORDS"
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
"$script" "$family" "$expected" "$rc" "$duration" "$gate_skip" "$gate_reason" >>"$RECORDS"
family_bump "$family" "$duration" "$fail_delta"
TOTAL=$((TOTAL + 1))
}
Expand Down
2 changes: 1 addition & 1 deletion docs/captain-hold-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ The reconcile path is pinned in the same suite: a reconcile answer arriving thro
It also proves the two verification outcomes - an evidence-backed `reconciled` close that records the evidence under its own label and never as the captain's words, and a note that leaves the call queued, held, and dated - while both outcomes refuse without a pending board request, each durable mutation applies only once across close, probe, and request-retirement failures, a later distinct request with the same note still appends its own dated record, every failed retirement is surfaced with its pending request retained, incompatible resolution modes cannot replay as captain answers, and normal close, release, and replay paths retire pending requests.
The captured-source coverage proves Lavish deduplicates each card before separating versioned structured selections from notes, bare and annotated Reconcile choices never reach keyed answers, genuine current and legacy choices still close normally, legacy bare and separator-annotated reconcile values feed neither intake, mixed repeated selections preserve every other card's final value, the generic runner creates a request only through a verified bound source, chat reconcile text creates none, and the resulting board request authorizes evidence-backed closure.
The board's half is pinned in `tests/fm-bearings-board.test.sh`: every published decision card carries exactly one reconcile option, authored options reserve that value across every card type, recommendations name authored options, a decision card whose structured subject appears in the payload's landed rows is dropped while a genuinely open one is kept even when an unrelated landed id contains its key after a newline, a build requires a fresh authoritative listed-open result before binding or arming, a reopen retires the pre-reopen source generation and waits for a fresh live listener, and a rebuild of an already-armed board with no live listener starts one.
That suite drives its Lavish session through a protocol-shaped stub, and `tests/fm-bearings-board-lavish-live-e2e.test.sh` is the opt-in guard for the installed provider; [`verification/process-event-sources.md`](verification/process-event-sources.md) owns the version-scoped evidence.
That suite drives its Lavish session through a protocol-shaped stub, and `tests/fm-bearings-board-lavish-live-e2e.test.sh` is the default-on capability guard for the installed provider; [`verification/process-event-sources.md`](verification/process-event-sources.md) owns the version-scoped evidence.
`tests/fm-procevent.test.sh` pins the ownership half: a dead generation whose recorded state-root identity no longer matches is reclaimed by reconcile into a replacement that actually runs, `retire` releases the same claim instead of refusing, and neither a live generation nor a crashed leader whose owned group survives is reclaimed under that same drift.

`tests/fm-classify-decision-key.test.sh` pins `status_key_closing_verb` itself: it separates a resolution from the durable-transfer close and from a still-open key, reports the last real transition across re-openings and both key positions, and treats a prose mention as no transition.
Expand Down
2 changes: 1 addition & 1 deletion docs/fm-test-portable-shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The two parallel lanes use longest-processing-time assignment from those measure
## Portable serial remainder

`portable-serial` includes every `tests/*.test.sh` that is neither proven-isolated nor `real-herdr-gated`.
It keeps watcher, lock, AFK, real tmux, daemon, secondmate lifecycle, bootstrap, live-harness opt-in, GUI-backend, and other unproven work serial.
It keeps watcher, lock, AFK, real tmux, daemon, secondmate lifecycle, bootstrap, the `live-harness-optin` family, GUI-backend, and other unproven work serial.
Membership is derived rather than enumerated, so a newly added test lands here by default.

## Portable serial CI shards
Expand Down
2 changes: 1 addition & 1 deletion docs/verification/muse.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ That is the same terminal shape the `echo`-provider interrupt produced, now conf

## Refreshing this record

Run both opt-in live guards after any muse upgrade, because the version-suffixed process name, session protocol, and styled composer are vendor-controlled surfaces:
Run both live guards after any muse upgrade, because the version-suffixed process name, session protocol, and styled composer are vendor-controlled surfaces:

```
FM_HARNESS_LIVENESS_DRIFT=1 bin/fm-test-run.sh tests/fm-harness-liveness-drift-live-e2e.test.sh
Expand Down
28 changes: 25 additions & 3 deletions docs/verification/runtime-backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Observed identities, and the resulting verdict:
| grok | 0.2.118 | `grok-0.2.118-ma` | `grok` | alive |
| kimi | 0.31.1 | `kimi` | `kimi` | alive |

Claude Code is the harness whose title no longer attributes it at all; every other adapter is currently attributed by both sources.
In that 2026-08-03 seven-adapter run, Claude Code was the only harness whose title did not attribute it; every other adapter was attributed by both sources.
Codex reported `codex-aarch64-a` at 0.145.0 and `codex` at 0.146.0, and Kimi Code reported `kimi-code` as its foreground `comm` at 0.29.1 and `kimi` at 0.31.1, so these identities move between ordinary patch releases in both directions.
That is the evidence for treating any single process name as a surface under vendor control rather than a stable contract.

Expand Down Expand Up @@ -84,14 +84,36 @@ alive
On macOS the pane command reflected the rewritable title while the full install path could survive in `ps -o comm=`; in the Linux portable regression those roles reversed for the version-named native executable, with the identifying path retained in argv[0].
The classifier therefore accepts a harness basename first, then an exact harness path component in the full executable path, then the same component in argv[0], without depending on which field carries it on a given platform.

The portable regression is CI-enforced, while the real-harness drift guard is opt-in under the policy in `.agents/skills/firstmate-coding-guidelines/SKILL.md`.
The portable regression is CI-enforced.
The real-harness drift guard spends no model tokens, so under the policy in `.agents/skills/firstmate-coding-guidelines/SKILL.md` it runs by default wherever tmux is installed and reports a capability skip elsewhere; `FM_HARNESS_LIVENESS_DRIFT=1` additionally turns an absent tool into a failure.
Run the live guard after any harness upgrade and before trusting or refreshing the table above:

```sh
FM_HARNESS_LIVENESS_DRIFT=1 bin/fm-test-run.sh tests/fm-harness-liveness-drift-live-e2e.test.sh
```

Bounded output from the run that produced the table:
### 2026-09-06 default-on drift refresh, and the Cursor editor CLI collision

Running the guard with no variable set on macOS 26.5.2 arm64 checked 8 installed harnesses and classified every one `alive`:

```text
# claude 2.1.263 (Claude Code): title='2.1.263' foreground=[/Users/kunchen/.local/bin/claude <defunct> <defunct> ]
# codex codex-cli 0.147.0: title='codex' foreground=[/opt/homebrew/bin/codex ]
# opencode 1.18.29: title='opencode' foreground=[/opt/homebrew/bin/opencode ]
# pi 0.84.4: title='pi-launcher' foreground=[/opt/homebrew/bin/pi-signed .../pi ]
# pi-signed 0.84.4: title='pi-launcher' foreground=[/opt/homebrew/bin/pi-signed .../pi ]
# grok grok 1.0.13 (5e9a58528b76) [stable]: title='grok-1.0.13-mac' foreground=[/Users/kunchen/.local/bin/grok ]
# cursor 2026.09.02-c22c1a3: title='node' foreground=[/Users/kunchen/.local/bin/cursor-agent ]
# muse Muse Code 1.0.3 (1.0.3-R2198.1): title='muse-bin-1.0.3-' foreground=[/Users/kunchen/.local/bin/muse-bin-1.0.3-R2198.1 ]
# checked 8 installed harness(es)
```

The first default-on run failed on Cursor with `LIVENESS DRIFT: cursor unknown is running but classifies 'missing'`, observed title `zsh`.
The classifier was not at fault: the guard resolved the harness through a generic `command -v cursor`, which on a machine that also has the Cursor editor finds `~/.local/bin/cursor` - the editor launcher, not the agent.
That binary exits immediately, leaving a bare shell in the pane.
The guard now asks `fm_cursor_resolve_binary` first for `cursor`, which is the same verified owner `bin/fm-spawn.sh` uses, so the probe launches `cursor-agent` and the editor CLI can no longer masquerade as the harness.

Bounded output from the 2026-08-03 run that produced the first table above:

```text
ok - harness liveness: claude 2.1.220 (Claude Code) classifies alive
Expand Down
19 changes: 8 additions & 11 deletions tests/fm-afk-pi-herdr-return-e2e.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# Real Pi/Herdr end-to-end regression for the 2026-07-14 two-owner incident.
#
# Opt-in because it launches a real interactive Pi primary, a real away daemon,
# and a real isolated Herdr lab session. Every explicit and production-adapter
# Herdr call is routed through fm-herdr-lab.sh. The scenario proves:
# and a real isolated Herdr lab session. Real model turns, real side effects,
# and heavyweight lab setup put it outside the token-free default-on class, so
# it does not run merely because its tools are installed. Every explicit and
# production-adapter Herdr call is routed through fm-herdr-lab.sh. The scenario
# proves:
# - a live blocked status is classified and durably queued while away;
# - a pending Pi composer refuses injection and receives no forced Enter;
# - the existing wedge alarm remains observable and deduped;
Expand All @@ -15,20 +18,14 @@ set -u

# shellcheck source=tests/lib.sh
. "$(dirname "${BASH_SOURCE[0]}")/lib.sh"

fm_live_gate opt-in FM_AFK_PI_HERDR_E2E herdr jq pi python3

# shellcheck source=/dev/null
. "$ROOT/bin/fm-supervise-daemon.sh"
# shellcheck source=/dev/null
. "$ROOT/bin/fm-backend.sh"

if [ "${FM_AFK_PI_HERDR_E2E:-0}" != 1 ]; then
echo "skip: set FM_AFK_PI_HERDR_E2E=1 to run the real Pi/Herdr away-return regression"
exit 0
fi

for tool in herdr jq pi python3; do
command -v "$tool" >/dev/null 2>&1 || { echo "skip: $tool not found"; exit 0; }
done

LAB_HELPER=${HERDR_LAB_HELPER:-$ROOT/bin/fm-herdr-lab.sh}
SESSION=$("$LAB_HELPER" name fm-afk-pi-return-e2e)
TMP_ROOT=$(fm_test_tmproot fm-afk-pi-return-e2e)
Expand Down
Loading
Loading