fix: harden routing and task lifecycle safety - #35
Open
ruby-dlee wants to merge 34 commits into
Open
Conversation
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
2 times, most recently
from
July 27, 2026 23:43
8b18148 to
2b973b4
Compare
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
from
July 28, 2026 05:56
2b973b4 to
1367bbe
Compare
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
from
July 29, 2026 02:05
cafb4c6 to
af18a84
Compare
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
from
July 29, 2026 03:33
af18a84 to
1063b2c
Compare
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
from
July 29, 2026 04:54
4130ede to
d80c249
Compare
ruby-dlee
force-pushed
the
fm/fm-routing-suite-s2
branch
from
July 29, 2026 05:07
d80c249 to
e0afca5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Make tests/fm-account-routing.test.sh genuinely green as a whole on macOS Bash 3.2 and Linux CI, restoring PR 35's Behavior checks without weakening or deleting safety assertions for provisional metadata persistence, endpoint installation, secondmate routing-off behavior, or related contracts. Preserve run-unique self-cleaning task temp roots, normalized Darwin sticky-mode parsing, and the supplied secondmate registry fixture. Fix newly exposed defects at their source, replace only genuinely unobservable failure fixtures with deterministic observable injection, and do not modify accepted pre-existing Herdr or checkpoint signal failures unless proven branch-specific. Obtain actual CI runner evidence. Keep fm/fm-routing-suite-s2 rebased onto exact base commit 18f29ab with minimal conflict resolution and verify it cleanly.
What Changed
Risk Assessment
✅ Low: The prior unsafe rollback cleanup is now exercised through both direct and managed rollback paths with deterministic failure injection, outside-data preservation, and retry-metadata assertions, with no new material source risks found.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
bin/fm-spawn.sh:1723- Rollback cleanup bypasses the new descriptor-pinned remover and callsrm -rf "$TASK_TMP"directly. Because task roots now live beneath$STATE/.task-tmp, a concurrent replacement of that ancestor with a symlink can redirect deletion outside the task namespace. Usefm_account_safe_remove_task_tmp "$ID" "$TASK_TMP" "$SPAWN_GENERATION_ID"here and in the equivalent managed rollback path at line 1802.🔧 Fix: Harden rollback task temp cleanup
1 warning still open:
tests/fm-account-routing.test.sh:1624- The regression only greps for two exact source strings, so it never executes either rollback path or verifies the new fail-safe behavior when descriptor-pinned removal refuses. Use the existing task-temp failure hook to trigger rollback cleanup and assert that outside data survives and retry metadata is retained; otherwise control-flow regressions can pass this test unchanged.🔧 Fix: Exercise rollback temp cleanup failures
✅ Re-checked - no issues remain.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.