fix: accept landed tasks after default history rewrites - #38
Open
ruby-dlee wants to merge 20 commits into
Open
Conversation
ruby-dlee
force-pushed
the
fm/fm-teardown-stale-branch-false-refusal
branch
from
July 27, 2026 15:35
167edd5 to
dbc65fa
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
Fix Firstmate teardown falsely refusing a landed task branch when main was history-rewritten after branch creation. Preserve the destructive-safety contract: accept only when the task's net changes are proven present in the authoritative up-to-date default branch, while retaining worktrees for unlanded additions, unlanded deletions, non-default branch baselines, missing reflog/fork-point evidence, or any inconclusive proof. Verify the real teardown lifecycle, including endpoint quiescence and task-metadata removal. Keep the landed-work contract owned by bin/fm-teardown.sh and tests colocated in tests/fm-teardown.test.sh. Ship through a PR without merging it; the PR must state that this Firstmate CLI change has no web-app, API, realtime, or manual operator deploy lane.
What Changed
Risk Assessment
✅ Low: The change is narrowly scoped, fails closed when creation-base evidence is absent or inconclusive, protects additions and deletions, and verifies successful endpoint and metadata cleanup.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
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"🔧 Fix: Repair teardown lifecycle test endpoint fixture
1 error still open:
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"🔧 Fix: Stabilize watcher lock takeover lifecycle fixture
1 error still open:
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.