Skip to content

feat(backends): add Paseo runtime backend - #5

Merged
ryannmicua merged 26 commits into
mainfrom
fm/paseo-backend-adapter-branch-rebuild
Sep 28, 2026
Merged

ryannmicua merged 26 commits into
mainfrom
fm/paseo-backend-adapter-branch-rebuild

Conversation

@ryannmicua

@ryannmicua ryannmicua commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Intent

Continue delivering the Paseo runtime backend adapter for firstmate (the existing PR is #1): a new backend adapter that lets firstmate dispatch and supervise crewmates through the Paseo agent-orchestration platform (bin/backends/paseo.sh), including spawn, status, control, teardown, and launch-environment handling. The previous validation run on the existing branch crashed and left the pipeline unable to reconcile or start any new run against that branch name, with no supported non-destructive recovery path found. The captain authorized rebuilding the already-reviewed implementation onto a fresh branch name in a new worker on the Herdr runtime instead of continuing to fight the stuck branch. Preserve the existing PR when the delivery path allows retargeting it to the new branch; otherwise open a new PR and report the exact outcome plainly.

Also apply two corrections already decided: (1) launch the Paseo CLI with each allowlisted environment value passed directly as its own --env NAME=value pair instead of the previous approach of writing a private file and passing only --env BASH_ENV=<path>, because the Paseo-launched provider process never goes through a bash shell that would source BASH_ENV, so that file was never actually reaching the provider; document in docs/paseo-backend.md and docs/configuration.md that on the Paseo backend, allowlisted launch values are passed via Paseo's --env flag and are therefore visible in process listings on the host running the Paseo daemon. (2) Remove the unconditional --mode auto-review case hardcoded for the codex provider in bin/backends/paseo.sh; leave the opencode --mode build case untouched.

What Changed

  • Add an experimental, explicit-only Paseo backend that creates labeled agents and isolated worktrees, with provider checks for Claude and backend integration for spawn, control, relaunch, and teardown.
  • Route Paseo status and busy checks, interrupts, stop confirmation, and archive cleanup through its CLI; keep agent liveness unverified and secondmate spawns unsupported.
  • Pass eligible allowlisted launch values as individual --env NAME=value arguments and document their visibility in daemon-host process listings. Keep OpenCode’s --mode build and leave Codex without a forced mode.

Risk Assessment

🚨 High: The change has a deterministic relaunch failure, can discard work during rollback, and introduces security and environment-handling defects on supported launch paths.

Testing

Paseo 0.9.2's real adapter preflight reached daemon 0.9.1; focused stub-backed adapter, spawn-environment/abort, and control checks passed, and the required launch-environment documentation was reviewed. No live agent scenarios were run because only the shared user-home daemon was configured and no isolated test credentials were available. The worktree remained clean.

  • Live validation: ⚠️ inconclusive - 1 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Select Paseo with a reachable daemon; Firstmate's runtime preflight succeeds. ✅ pass live Live Paseo adapter readiness artifact
Spawn a Codex crewmate with an allowlisted value; Paseo passes it through --env and Codex receives no forced auto-review mode. ⏸️ untested no A live launch requires an isolated Paseo daemon and non-production Codex credentials. Only the shared user-home daemon is configured, and the workspace boundary bars creating test agents there. Provid…
Spawn an OpenCode crewmate through Paseo; it starts with build mode. ⏸️ untested no A live launch requires an isolated Paseo daemon and non-production OpenCode credentials. Only the shared user-home daemon is configured, and the workspace boundary bars creating test agents there. Pro…
Inspect, message, interrupt, and tear down a Paseo crewmate; Firstmate routes by its recorded agent and workspace IDs and confirms archival. ⏸️ untested no Live lifecycle actions require an isolated Paseo daemon and non-production provider credentials. Only the shared user-home daemon is configured. Provide an isolated daemon/home with its worktree in th…
Abort a spawn after Paseo creates a worktree containing an ignored .env; Firstmate retains it and reports both IDs and the reason. ⏸️ untested no Reaching this abort path live requires creating an agent in an isolated Paseo daemon with non-production credentials. Only the shared user-home daemon is configured. Provide an isolated daemon/home wi…
Evidence: Live Paseo adapter readiness

Source: Live Paseo adapter readiness

adapter_runtime_check=ready paseo_cli=0.9.2 daemonVersion: 0.9.1 connectedDaemon: reachable

adapter_runtime_check=ready
paseo_cli=0.9.2
daemonVersion: 0.9.1
connectedDaemon: reachable
- Outcome: ⚠️ 1 warning across 2 runs (15m35s)

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** - 16 issues (8 errors, 8 warnings)
  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses

🔧 Fix applied.
10 issues (6 errors, 4 warnings) still open:

  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses
  • 🚨 bin/backends/paseo.sh:122 - paseo logs prints a formatted transcript, not JSON; the official logs implementation calls console.log, so jq fails on real output. The new capture route at bin/fm-backend.sh:752 exposes this to all capture callers, and bin/fm-watch.sh:2725-2732 then skips text-based stale detection for Paseo agents. The mock at tests/fm-backend-paseo.test.sh:35-37 returns JSON and masks the mismatch. Consume the transcript format the CLI actually emits.
  • 🚨 bin/fm-spawn.sh:2954 - This conflicts with the required criterion: “each allowlisted environment value passed directly as its own --env NAME=value pair.” A valid allowlist containing PASEO_AGENT_ID is silently skipped here; the same invariant is also blocked when a set value contains CR/LF at bin/fm-spawn.sh:2958-2961, which aborts the spawn. The Bash 3.2 forwarding fix round changed the unset check but left these exclusions in place. Confirm whether these values must be forwarded or whether the intent should specify these exceptions.
  • ⚠️ docs/paseo-backend.md:24 - The new guide says on line 22 that liveness is unverified because Paseo exposes no worker PID, then repeats the same limitation here. No intent requirement needs both statements; remove this duplicate sentence.

🔧 Fix applied.
10 issues (6 errors, 4 warnings) still open:

  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses
  • 🚨 bin/backends/paseo.sh:122 - paseo logs prints a formatted transcript, not JSON; the official logs implementation calls console.log, so jq fails on real output. The new capture route at bin/fm-backend.sh:752 exposes this to all capture callers, and bin/fm-watch.sh:2725-2732 then skips text-based stale detection for Paseo agents. The mock at tests/fm-backend-paseo.test.sh:35-37 returns JSON and masks the mismatch. Consume the transcript format the CLI actually emits.
  • 🚨 bin/fm-spawn.sh:2954 - This conflicts with the required criterion: “each allowlisted environment value passed directly as its own --env NAME=value pair.” A valid allowlist containing PASEO_AGENT_ID is silently skipped here; the same invariant is also blocked when a set value contains CR/LF at bin/fm-spawn.sh:2958-2961, which aborts the spawn. The Bash 3.2 forwarding fix round changed the unset check but left these exclusions in place. Confirm whether these values must be forwarded or whether the intent should specify these exceptions.
  • ⚠️ bin/fm-spawn.sh:2944 - The Paseo launch arguments omit two established worker environment values. When trace context is enabled, SPAWN_TRACEPARENT is resolved at bin/fm-spawn.sh:4601-4627, after the adapter launch at bin/fm-spawn.sh:2973; its usual export at bin/fm-spawn.sh:4942-4955 is inside the Paseo-skipped block beginning at bin/fm-spawn.sh:4798. The changed docs/trace-context.md:28 therefore promises propagation that never reaches the worker. LAVISH_AXI_HOST is also omitted from the Paseo arguments at bin/fm-spawn.sh:2944-2950; its generic launch export at bin/fm-spawn.sh:4886-4887 is skipped too, despite the every-worker contract in AGENTS.md:84. Include both values in Paseo's --env arguments, resolving trace context before launch.

🔧 Fix applied.
12 issues (7 errors, 5 warnings) still open:

  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses
  • 🚨 bin/backends/paseo.sh:122 - paseo logs prints a formatted transcript, not JSON; the official logs implementation calls console.log, so jq fails on real output. The new capture route at bin/fm-backend.sh:752 exposes this to all capture callers, and bin/fm-watch.sh:2725-2732 then skips text-based stale detection for Paseo agents. The mock at tests/fm-backend-paseo.test.sh:35-37 returns JSON and masks the mismatch. Consume the transcript format the CLI actually emits.
  • 🚨 bin/fm-spawn.sh:2954 - This conflicts with the required criterion: “each allowlisted environment value passed directly as its own --env NAME=value pair.” A valid allowlist containing PASEO_AGENT_ID is silently skipped here; the same invariant is also blocked when a set value contains CR/LF at bin/fm-spawn.sh:2958-2961, which aborts the spawn. The Bash 3.2 forwarding fix round changed the unset check but left these exclusions in place. Confirm whether these values must be forwarded or whether the intent should specify these exceptions.
  • ⚠️ bin/fm-spawn.sh:2944 - The Paseo launch arguments omit two established worker environment values. When trace context is enabled, SPAWN_TRACEPARENT is resolved at bin/fm-spawn.sh:4601-4627, after the adapter launch at bin/fm-spawn.sh:2973; its usual export at bin/fm-spawn.sh:4942-4955 is inside the Paseo-skipped block beginning at bin/fm-spawn.sh:4798. The changed docs/trace-context.md:28 therefore promises propagation that never reaches the worker. LAVISH_AXI_HOST is also omitted from the Paseo arguments at bin/fm-spawn.sh:2944-2950; its generic launch export at bin/fm-spawn.sh:4886-4887 is skipped too, despite the every-worker contract in AGENTS.md:84. Include both values in Paseo's --env arguments, resolving trace context before launch.
  • 🚨 bin/fm-spawn.sh:1241 - Fix round 6ff6043 introduced a race in the retain-on-dirty cleanup: paseo run --background returns while the agent keeps running, so this status check can see a clean tree before the agent writes and the archive runs. Archiving the workspace can remove its owned worktree, losing those edits. The same cleanup suppresses archive failures at bin/fm-spawn.sh:1245; the archiver archives the agent and then workspace at bin/backends/paseo.sh:211 and bin/backends/paseo.sh:213, leaving no recovery IDs if either operation fails. Quiesce the agent before the final status check, and retain and report both IDs if cleanliness or archive completion cannot be confirmed. Paseo background-run behavior, workspace archive behavior.
  • ⚠️ bin/fm-watch.sh:2730 - The new failed-log fallback calls window_is_busy and discards its result, so it changes no busy or stale state; the normal capture path already classifies Paseo status. The added assertion at tests/fm-watch-triage.test.sh:6045 makes this extra read-only inspect call a requirement. No stated intent requires this discarded poll; remove the fallback and its assertion.

🔧 Fix applied.
13 issues (8 errors, 5 warnings) still open:

  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses
  • 🚨 bin/backends/paseo.sh:122 - paseo logs prints a formatted transcript, not JSON; the official logs implementation calls console.log, so jq fails on real output. The new capture route at bin/fm-backend.sh:752 exposes this to all capture callers, and bin/fm-watch.sh:2725-2732 then skips text-based stale detection for Paseo agents. The mock at tests/fm-backend-paseo.test.sh:35-37 returns JSON and masks the mismatch. Consume the transcript format the CLI actually emits.
  • 🚨 bin/fm-spawn.sh:2954 - This conflicts with the required criterion: “each allowlisted environment value passed directly as its own --env NAME=value pair.” A valid allowlist containing PASEO_AGENT_ID is silently skipped here; the same invariant is also blocked when a set value contains CR/LF at bin/fm-spawn.sh:2958-2961, which aborts the spawn. The Bash 3.2 forwarding fix round changed the unset check but left these exclusions in place. Confirm whether these values must be forwarded or whether the intent should specify these exceptions.
  • ⚠️ bin/fm-spawn.sh:2944 - The Paseo launch arguments omit two established worker environment values. When trace context is enabled, SPAWN_TRACEPARENT is resolved at bin/fm-spawn.sh:4601-4627, after the adapter launch at bin/fm-spawn.sh:2973; its usual export at bin/fm-spawn.sh:4942-4955 is inside the Paseo-skipped block beginning at bin/fm-spawn.sh:4798. The changed docs/trace-context.md:28 therefore promises propagation that never reaches the worker. LAVISH_AXI_HOST is also omitted from the Paseo arguments at bin/fm-spawn.sh:2944-2950; its generic launch export at bin/fm-spawn.sh:4886-4887 is skipped too, despite the every-worker contract in AGENTS.md:84. Include both values in Paseo's --env arguments, resolving trace context before launch.
  • 🚨 bin/fm-spawn.sh:1241 - Fix round 6ff6043 introduced a race in the retain-on-dirty cleanup: paseo run --background returns while the agent keeps running, so this status check can see a clean tree before the agent writes and the archive runs. Archiving the workspace can remove its owned worktree, losing those edits. The same cleanup suppresses archive failures at bin/fm-spawn.sh:1245; the archiver archives the agent and then workspace at bin/backends/paseo.sh:211 and bin/backends/paseo.sh:213, leaving no recovery IDs if either operation fails. Quiesce the agent before the final status check, and retain and report both IDs if cleanliness or archive completion cannot be confirmed. Paseo background-run behavior, workspace archive behavior.
  • 🚨 bin/fm-spawn.sh:1243 - Round 8c9e248 made abort cleanup stop the agent before checking the worktree, but this Git status check still treats ignored files as clean. For example, a Paseo worktree setup hook can copy an ignored .env; if a later spawn step fails, cleanup can archive the workspace and remove that file. The same gap reaches normal Paseo teardown: bin/fm-teardown.sh:1791 checks status, then its new archive route at bin/fm-teardown.sh:3575 reaches bin/backends/paseo.sh:213. Paseo’s worktree guide documents both setup hooks that copy .env and removal of the worktree when its last workspace is archived. Please decide whether ignored setup/user files may be discarded on these paths; if not, both cleanup gates need to retain and report them.
  • ⚠️ bin/fm-spawn.sh:2964 - The f00c5d3 environment-forwarding round added GOTMPDIR=/tmp/fm-$ID/gotmp here, but Firstmate creates that directory only after paseo run returns at bin/fm-spawn.sh:3000. Paseo runs this command with --background, which returns while the worker continues; a worker that invokes Go before the directory is created can fail because Go does not create GOTMPDIR. Create the directory before launching the worker.

🔧 Fix applied.
16 issues (8 errors, 8 warnings) still open:

  • 🚨 bin/backends/paseo.sh:108 - A Paseo relaunch passes the existing workspace at lines 74–76, but the CLI reports Using workspace &lt;id&gt; and its run result has no workspaceId; neither parser branch here recovers that ID, so line 111 fails after creating the replacement agent. fm-spawn.sh:2973,2983 only arms cleanup after this function returns successfully, leaving the new agent untracked while relaunch fails. Use the supplied workspace_id when reusing a workspace. Paseo run workspace resolution and result shape
  • 🚨 bin/fm-spawn.sh:1239 - After Paseo returns, PASEO_DIRECT stays set until metadata and backlog publication complete (fm-spawn.sh:2983,5165); any earlier failure runs the EXIT cleanup at fm-spawn.sh:1237-1239, which archives the agent and workspace without checking for edits. The brief has already been sent at fm-spawn.sh:2973, and archiving the final workspace reference removes its managed worktree. Conversely, if paseo run returns nonzero after creating the workspace but before creating the agent, this adapter returns at line 105 without capturing or cleaning up that workspace; the CLI creates the workspace before attempting agent creation. The missing policy decision is whether partially started work should be retained/reconciled or discarded; changing that recovery and retention behavior needs authorization. Paseo workspace creation order, workspace archive behavior
  • 🚨 bin/fm-spawn.sh:2985 - Paseo receives GOTMPDIR=/tmp/fm-$ID/gotmp at fm-spawn.sh:2949, but this mkdir -p reuses a preexisting path without checking for symlinks, ownership, or writable-by-others permissions. A local user can precreate /tmp/fm-$ID as a symlink to a writable directory, causing provider scratch writes to land there. The private-root checks at fm-spawn.sh:4178-4187 are skipped by the enclosing BACKEND != paseo guard at line 4118; apply that validation to the Paseo path too.
  • 🚨 bin/fm-spawn.sh:2956 - This contradicts the required criterion: “each allowlisted environment value is passed directly as its own --env NAME=value pair.” The project supports stock macOS Bash 3.2, but [ -v &#34;$paseo_env_name&#34; ] uses a test operator added in Bash 4.2; under 3.2 the test errors and || continue silently skips every allowlisted value. Use a Bash 3.2-compatible unset check. GNU Bash 4.2 release notice
  • ⚠️ bin/fm-spawn.sh:2963 - Allowlisted names are appended after the fixed worker values, and Paseo processes repeated --env keys in order with the last value winning. For example, if the allowlist contains COMPACT_ADVISER_DISABLE and Firstmate inherits 0, the worker receives 0 despite the documented guarantee that this remains 1. The same collision applies to FM_TASK_ID, FIRSTMATE_HOME, FIRSTMATE_STATE, FM_TURNEND, and GOTMPDIR from lines 2945–2950. Reject these reserved names or ensure Firstmate's values win. Paseo repeated environment parsing, configuration guarantee
  • ⚠️ bin/backends/paseo.sh:83 - If origin/HEAD is absent or stale, this fallback selects a local main or master branch before checking other refs. The Paseo path skips Firstmate's fresh-base step at fm-spawn.sh:4114-4115; with a stale local main, a fresh task therefore starts from old code even though Paseo fetches remote refs. Prefer the current remote default ref before falling back to local branches. Paseo worktree base guidance
  • ⚠️ bin/fm-control.sh:427 - wait_paseo_status returns success for any nonempty status, then relaunch marks the agent confirmed and prints relaunched. Paseo exposes error and closed statuses, so a replacement that immediately enters error is reported as successfully relaunched. Treat failure or closed states as unsuccessful readiness. Paseo lifecycle statuses
  • 🚨 bin/backends/paseo.sh:122 - paseo logs prints a formatted transcript, not JSON; the official logs implementation calls console.log, so jq fails on real output. The new capture route at bin/fm-backend.sh:752 exposes this to all capture callers, and bin/fm-watch.sh:2725-2732 then skips text-based stale detection for Paseo agents. The mock at tests/fm-backend-paseo.test.sh:35-37 returns JSON and masks the mismatch. Consume the transcript format the CLI actually emits.
  • 🚨 bin/fm-spawn.sh:2954 - This conflicts with the required criterion: “each allowlisted environment value passed directly as its own --env NAME=value pair.” A valid allowlist containing PASEO_AGENT_ID is silently skipped here; the same invariant is also blocked when a set value contains CR/LF at bin/fm-spawn.sh:2958-2961, which aborts the spawn. The Bash 3.2 forwarding fix round changed the unset check but left these exclusions in place. Confirm whether these values must be forwarded or whether the intent should specify these exceptions.
  • ⚠️ bin/fm-spawn.sh:2944 - The Paseo launch arguments omit two established worker environment values. When trace context is enabled, SPAWN_TRACEPARENT is resolved at bin/fm-spawn.sh:4601-4627, after the adapter launch at bin/fm-spawn.sh:2973; its usual export at bin/fm-spawn.sh:4942-4955 is inside the Paseo-skipped block beginning at bin/fm-spawn.sh:4798. The changed docs/trace-context.md:28 therefore promises propagation that never reaches the worker. LAVISH_AXI_HOST is also omitted from the Paseo arguments at bin/fm-spawn.sh:2944-2950; its generic launch export at bin/fm-spawn.sh:4886-4887 is skipped too, despite the every-worker contract in AGENTS.md:84. Include both values in Paseo's --env arguments, resolving trace context before launch.
  • 🚨 bin/fm-spawn.sh:1241 - Fix round 6ff6043 introduced a race in the retain-on-dirty cleanup: paseo run --background returns while the agent keeps running, so this status check can see a clean tree before the agent writes and the archive runs. Archiving the workspace can remove its owned worktree, losing those edits. The same cleanup suppresses archive failures at bin/fm-spawn.sh:1245; the archiver archives the agent and then workspace at bin/backends/paseo.sh:211 and bin/backends/paseo.sh:213, leaving no recovery IDs if either operation fails. Quiesce the agent before the final status check, and retain and report both IDs if cleanliness or archive completion cannot be confirmed. Paseo background-run behavior, workspace archive behavior.
  • 🚨 bin/fm-spawn.sh:1243 - Round 8c9e248 made abort cleanup stop the agent before checking the worktree, but this Git status check still treats ignored files as clean. For example, a Paseo worktree setup hook can copy an ignored .env; if a later spawn step fails, cleanup can archive the workspace and remove that file. The same gap reaches normal Paseo teardown: bin/fm-teardown.sh:1791 checks status, then its new archive route at bin/fm-teardown.sh:3575 reaches bin/backends/paseo.sh:213. Paseo’s worktree guide documents both setup hooks that copy .env and removal of the worktree when its last workspace is archived. Please decide whether ignored setup/user files may be discarded on these paths; if not, both cleanup gates need to retain and report them.
  • ⚠️ bin/fm-spawn.sh:2964 - The f00c5d3 environment-forwarding round added GOTMPDIR=/tmp/fm-$ID/gotmp here, but Firstmate creates that directory only after paseo run returns at bin/fm-spawn.sh:3000. Paseo runs this command with --background, which returns while the worker continues; a worker that invokes Go before the directory is created can fail because Go does not create GOTMPDIR. Create the directory before launching the worker.
  • ⚠️ bin/backends/paseo.sh:211 - fm_backend_paseo_kill archives the agent before the workspace. If workspace archiving fails, teardown retains the task record, but retry attempts to archive the agent again; Paseo’s CLI rejects already archived agents (source), so the workspace archive is never retried. The same sequence is used by spawn abort cleanup at bin/fm-spawn.sh:1247; the shared agent-archive helper is also used by the exit fallback at bin/fm-control.sh:553. Make the shared archive step idempotent for already archived agents.
  • ⚠️ bin/fm-spawn.sh:1239 - Fix round 8c9e248 added this stop-proof gate to abort cleanup. Paseo stop cancels a running turn; its normal post-turn state is idle (CLI, lifecycle). The shared proof explicitly treats idle as failure at bin/backends/paseo.sh:170, so after a successful background launch followed by a setup failure, cleanup skips even the Git check and leaves a clean agent/workspace for manual reconciliation. Add an abort-specific quiescence check that accepts idle after a successful stop before checking Git and archiving; retain the stricter exit behavior at bin/fm-control.sh:550-553.
  • ⚠️ bin/fm-control-lib.sh:70 - The handoff component pins a new, user-visible lifecycle command to task paseo-backend-adapter, its former tmux endpoint, and its old branch, then creates a replacement tmux session (bin/fm-control.sh:10,1092; bin/fm-spawn.sh:3349). The accepted intent calls for rebuilding on a fresh branch with a Herdr worker and adding the Paseo adapter; it does not require this task-specific tmux recovery path. Under the simplification requirement, remove this unrequired component. Removing the added control behavior needs user authorization.
⚠️ **Test** - 1 warning
  • ⚠️ Live proof is missing for the Paseo runtime scenarios. The only configured target is the shared user-home daemon; creating an agent would persist agent and workspace state outside this worktree. Provide an isolated Paseo daemon with its state and managed worktree inside the worktree, plus non-production provider credentials, to enable a live rerun; otherwise decide whether to proceed with the stub-based evidence.
  • ⚠️ live validation verdict: inconclusive (0 of 3 scenarios were driven live against the product); untested: Launch a Paseo Codex crewmate; set allowlisted values reach the provider through individual --env arguments, with Paseo-owned values excluded and host process-list visibility documented., Launch Codex and OpenCode crewmates; Codex receives no forced auto-review mode while OpenCode retains build mode., Check, message, interrupt, and tear down a Paseo crewmate; Firstmate routes operations using the recorded agent and workspace identities.
  • Live validation: ⚠️ inconclusive - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Launch a Paseo Codex crewmate; set allowlisted values reach the provider through individual --env arguments, with Paseo-owned values excluded and host process-list visibility documented. ⏸️ untested no No isolated Paseo daemon and non-production provider credentials are configured. The available daemon is shared; creating an agent would write state outside the worktree. Provide an isolated daemon an…
Launch Codex and OpenCode crewmates; Codex receives no forced auto-review mode while OpenCode retains build mode. ⏸️ untested no No isolated Paseo daemon and non-production provider credentials are configured. The available daemon is shared; creating agents would write state outside the worktree. Provide an isolated daemon and…
Check, message, interrupt, and tear down a Paseo crewmate; Firstmate routes operations using the recorded agent and workspace identities. ⏸️ untested no No isolated Paseo daemon and non-production provider credentials are configured. The available daemon is shared; creating agents would write state outside the worktree. Provide an isolated daemon and…
  • tests/fm-backend-paseo.test.sh
  • bash tests/fm-spawn-paseo-env.test.sh
  • paseo --version; paseo daemon status
  • paseo provider ls --json
  • paseo --help; paseo daemon --help; paseo run --help
  • `rg -n -C 3 'Paseo|launch.env|process listings|--env' docs/configuration.md

🔧 Fix applied.
1 warning still open:

  • ⚠️ live validation verdict: inconclusive (1 of 5 scenarios were driven live against the product); untested: Spawn a Codex crewmate with an allowlisted value; Paseo passes it through --env and Codex receives no forced auto-review mode., Spawn an OpenCode crewmate through Paseo; it starts with build mode., Inspect, message, interrupt, and tear down a Paseo crewmate; Firstmate routes by its recorded agent and workspace IDs and confirms archival., Abort a spawn after Paseo creates a worktree containing an ignored .env; Firstmate retains it and reports both IDs and the reason.
  • Live validation: ⚠️ inconclusive - 1 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Select Paseo with a reachable daemon; Firstmate's runtime preflight succeeds. ✅ pass live Live Paseo adapter readiness artifact
Spawn a Codex crewmate with an allowlisted value; Paseo passes it through --env and Codex receives no forced auto-review mode. ⏸️ untested no A live launch requires an isolated Paseo daemon and non-production Codex credentials. Only the shared user-home daemon is configured, and the workspace boundary bars creating test agents there. Provid…
Spawn an OpenCode crewmate through Paseo; it starts with build mode. ⏸️ untested no A live launch requires an isolated Paseo daemon and non-production OpenCode credentials. Only the shared user-home daemon is configured, and the workspace boundary bars creating test agents there. Pro…
Inspect, message, interrupt, and tear down a Paseo crewmate; Firstmate routes by its recorded agent and workspace IDs and confirms archival. ⏸️ untested no Live lifecycle actions require an isolated Paseo daemon and non-production provider credentials. Only the shared user-home daemon is configured. Provide an isolated daemon/home with its worktree in th…
Abort a spawn after Paseo creates a worktree containing an ignored .env; Firstmate retains it and reports both IDs and the reason. ⏸️ untested no Reaching this abort path live requires creating an agent in an isolated Paseo daemon with non-production credentials. Only the shared user-home daemon is configured. Provide an isolated daemon/home wi…
  • paseo --version
  • paseo daemon status
  • Live adapter preflight: . bin/fm-backend.sh; fm_backend_source paseo; fm_backend_paseo_runtime_check
  • tests/fm-backend-paseo.test.sh
  • bash tests/fm-spawn-paseo-env.test.sh
  • tests/fm-control.test.sh
  • git diff fc409dd1b1c93c59e542367f9892ae62d41ae573..e9659c33c7e30b244f4c5698c150c1fc56443277 -- docs/paseo-backend.md docs/configuration.md docs/herdr-backend.md
  • git status --short && git ls-files --others --exclude-standard
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

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

✅ **Push** - passed

✅ No issues found.

tiago-peixoto and others added 26 commits September 28, 2026 08:39
…ted the bootstrap test’s accepted-backend list. The focused watcher regression, full bootstrap suite, `bin/fm-lint.sh --partition 1of2`, and `git diff --check` pass. CI Lint 1 ended with signal 143 and no lint diagnostic; the local partition completed cleanly
…nd-paseo.test.sh](/home/rgm/.no-mistakes/worktrees/ff5e17b6f5de/01M3JQ3ZH38JJ7KE1SMNRKFBSK/tests/fm-backend-paseo.test.sh:4) and removing the unused `dirty` parameter from [fm-spawn-paseo-env.test.sh](/home/rgm/.no-mistakes/worktrees/ff5e17b6f5de/01M3JQ3ZH38JJ7KE1SMNRKFBSK/tests/fm-spawn-paseo-env.test.sh:71) and its seven calls. `bin/fm-lint.sh --partition 2of2`, both Paseo tests, the board-render test, the full bearings snapshot test, and `git diff --check` passed. CI’s behavior failure was the board-render test reporting no live listener owner after reconciliation; the targeted rerun and full snapshot suite pass locally, and the relevant board/process-event code is unchanged in this PR, so that finding did not warrant a code change
@ryannmicua
ryannmicua merged commit fb15b78 into main Sep 28, 2026
19 checks passed
@ryannmicua
ryannmicua deleted the fm/paseo-backend-adapter-branch-rebuild branch September 28, 2026 21:27
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