Skip to content

fix: preserve whitespace in teardown patch matching - #7910

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
WTF-Am-ID:fm/up-fm-7781
Oct 28, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
WTF-Am-ID:fm/up-fm-7781

Conversation

@WTF-Am-ID

@WTF-Am-ID WTF-Am-ID commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7781

Review was single-family (Codex) by the owner's temporary choice.

What Changed

  • Use whitespace-preserving patch IDs in bin/fm-teardown.sh so indentation changes cannot count as landed patches. If Git lacks --verbatim, fall back to content checks or refuse cleanup.
  • Add regression coverage for exact patch replays, amended YAML indentation, and unsupported Git versions.

Risk Assessment

✅ Low: The bounded change preserves whitespace in both sides of patch matching, retains exact replay support, and safely rejects unavailable patch IDs.

Testing

Reproduced unsafe baseline acceptance and passed all live teardown probes using real Git, Treehouse, tmux, and teardown with offline PR responses and injected old-Git rejection. The canonical teardown suite passed after correcting temporary fixture placement. Product transcripts and the replay driver were retained.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Teardown refuses unpushed YAML and Python indentation amendments and preserves the commit, branch, and task metadata ✅ pass live Baseline and live teardown transcripts: baseline-yaml, amended-yaml, amended-python
Teardown accepts an exact patch replay with a different parent and completes cleanup ✅ pass live Baseline and live teardown transcripts: exact
Git rejecting --verbatim causes safe refusal without --stable fallback or loss of task state ✅ pass live Baseline and live teardown transcripts: old-git-exact, old-git-amended
Evidence: Baseline and live teardown transcripts

Source: Baseline and live teardown transcripts

mode=baseline-yaml
revision=417cec2feb4e2976c0acdb2527b87b3ccc71535f
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=0
local_head_before=8eaa8e3018179a664fc2cfad2f6021cc0d04e7e8
merged_head=65574c673bf371a1c1bcc42970e0649923105f0a
local content before teardown:
a:
b: 1
stdout:
🌳 Worktree returned to pool.
repo: already current
teardown task-x1 complete (window fm-lab-7781:fm-task-x1, worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/baseline-yaml/pool/.treehouse/repo-b120d5/1/repo)
Backlog: task-x1 just finished (this home keeps no markdown backlog at ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/baseline-yaml/home/data/backlog.md). Update ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/baseline-yaml/home/data/backlog.md - move task-x1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/baseline-yaml/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local_head_after=cb1f33a5b660959820ad87178b013ed673e24366
task_branch=removed
task_record=removed
mode=amended-yaml
revision=3366e893056c69d30593db27050993644c0da8d3
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=1
local_head_before=5f84517cb80b9b5ee07b8e9123dd0d8c2aa5ba47
merged_head=3638fe3e353e011cb8ef541e33a6e3bb1e204ca5
local content before teardown:
a:
b: 1
stdout:
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/amended-yaml/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/amended-yaml/pool/.treehouse/repo-1ba4fb/1/repo has work not on any remote and not landed.
unpushed commits:
5f84517 add semantic indentation
Push the branch, land its PR, or get the captain's explicit OK to discard, then --force.
local_head_after=5f84517cb80b9b5ee07b8e9123dd0d8c2aa5ba47
task_branch=retained
task_record=retained
mode=amended-python
revision=3366e893056c69d30593db27050993644c0da8d3
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=1
local_head_before=a16c95b306983ecba7b4185105246ba6a72970a7
merged_head=c620a8488700497c9263f5a5aa200497b8c2984a
local content before teardown:
if False:
    pass
print("never")
stdout:
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/amended-python/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/amended-python/pool/.treehouse/repo-4babff/1/repo has work not on any remote and not landed.
unpushed commits:
a16c95b add semantic indentation
Push the branch, land its PR, or get the captain's explicit OK to discard, then --force.
local_head_after=a16c95b306983ecba7b4185105246ba6a72970a7
task_branch=retained
task_record=retained
mode=exact
revision=3366e893056c69d30593db27050993644c0da8d3
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=0
local_head_before=d1772bbc812823c8a582de0c4cc3c149bd2b7d91
merged_head=c231c5283b1729eb7a17427b848089598e5b9696
local content before teardown:
a:
  b: 1
stdout:
🌳 Worktree returned to pool.
repo: already current
teardown task-x1 complete (window fm-lab-7781:fm-task-x1, worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/exact/pool/.treehouse/repo-35ee86/1/repo)
Backlog: task-x1 just finished (this home keeps no markdown backlog at ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/exact/home/data/backlog.md). Update ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/exact/home/data/backlog.md - move task-x1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/exact/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 0s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local_head_after=69f86b95a1e0a74575541fc91f85b27ea0601611
task_branch=removed
task_record=removed
mode=old-git-exact
revision=3366e893056c69d30593db27050993644c0da8d3
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=1
local_head_before=27bc300b25671aae5bcce0866498e55976544c52
merged_head=aab28e114275805935bfa10e7dbc130096b4bdab
local content before teardown:
a:
  b: 1
stdout:
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/old-git-exact/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/old-git-exact/pool/.treehouse/repo-83400d/1/repo has work not on any remote and not landed.
unpushed commits:
27bc300 add semantic indentation
Push the branch, land its PR, or get the captain's explicit OK to discard, then --force.
local_head_after=27bc300b25671aae5bcce0866498e55976544c52
task_branch=retained
task_record=retained
patch-id --verbatim
mode=old-git-amended
revision=3366e893056c69d30593db27050993644c0da8d3
command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1
exit=1
local_head_before=33fab1a838f005a50ca34b3e73abca293e243908
merged_head=66ddfe82e16a8b29dd4c57dc12fcf58924e482bc
local content before teardown:
a:
b: 1
stdout:
stderr:
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/old-git-amended/home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 1s ago).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: worktree ~/.no-mistakes-upstream-codex/worktrees/b5ea3869ea6e/01M616RBW0B9HP0T9V5MFFGC02/.phase-test/live/old-git-amended/pool/.treehouse/repo-c7a554/1/repo has work not on any remote and not landed.
unpushed commits:
33fab1a add semantic indentation
Push the branch, land its PR, or get the captain's explicit OK to discard, then --force.
local_head_after=33fab1a838f005a50ca34b3e73abca293e243908
task_branch=retained
task_record=retained
patch-id --verbatim
Evidence: Replay driver with isolated fixture setup and assertions

Source: Replay driver with isolated fixture setup and assertions

#!/usr/bin/env bash
set -euo pipefail
ROOT=$PWD
EVIDENCE=~/.no-mistakes-upstream-codex/evidence/01M616RBW0B9HP0T9V5MFFGC02
export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1
export GIT_AUTHOR_NAME=probe [email protected]
export GIT_COMMITTER_NAME=probe [email protected]
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR
unset FM_ROOT_OVERRIDE FM_STATE_OVERRIDE FM_DATA_OVERRIDE FM_CONFIG_OVERRIDE FM_PROJECTS_OVERRIDE FM_GATE_REFUSE_BYPASS
unset TASKS_AXI_FILE TASKS_AXI_BACKEND
REAL_GIT=$(command -v git)
export REAL_GIT
export TMUX='.phase-test/tmux.sock,0,0'
cleanup() {
  tmux -S .phase-test/tmux.sock kill-server 2>/dev/null || true
  rm -f bin/.phase-baseline-teardown.sh
  rm -rf .phase-test/live
}
trap cleanup EXIT
mkdir -p .phase-test/live
git show 417cec2feb4e2976c0acdb2527b87b3ccc71535f:bin/fm-teardown.sh > bin/.phase-baseline-teardown.sh
chmod +x bin/.phase-baseline-teardown.sh

for mode in baseline-yaml amended-yaml amended-python exact old-git-exact old-git-amended; do
  CASE="$ROOT/.phase-test/live/$mode"
  mkdir -p "$CASE"
  LAB="$CASE/home"
  bash bin/fm-lab-home.sh create "$LAB" >/dev/null
  export FM_HOME="$LAB"
  export TREEHOUSE_ROOT="$CASE/pool"
  git init -q --bare --initial-branch=main "$CASE/origin.git"
  git clone -q "$CASE/origin.git" "$LAB/projects/repo" 2>/dev/null
  PROJ="$LAB/projects/repo"
  git -C "$PROJ" commit -q --allow-empty -m baseline
  git -C "$PROJ" push -q origin main
  WT=$(cd "$PROJ" && treehouse get --lease --no-fetch --branch fm/task-x1 2> "$CASE/treehouse-get.log")
  printf 'local parent\n' > "$WT/parent.txt"
  git -C "$WT" add parent.txt
  git -C "$WT" commit -q -m 'local parent'
  git -C "$WT" push -q origin HEAD:refs/heads/fm/task-x1
  git -C "$PROJ" fetch -q origin
  file=config.yml
  good=$'a:\n  b: 1\n'
  bad=$'a:\nb: 1\n'
  if [ "$mode" = amended-python ]; then
    file=logic.py
    good=$'if False:\n    print("never")\n'
    bad=$'if False:\n    pass\nprint("never")\n'
    # Keep the change whitespace-only while changing execution.
    good=$'if False:\n    pass\n    print("never")\n'
  fi
  printf '%s' "$good" > "$WT/$file"
  git -C "$WT" add "$file"
  git -C "$WT" commit -q -m 'add semantic indentation'
  git clone -q "$CASE/origin.git" "$CASE/merged"
  git -C "$CASE/merged" checkout -q -b merged-head
  printf '%s' "$good" > "$CASE/merged/$file"
  git -C "$CASE/merged" add "$file"
  git -C "$CASE/merged" commit -q -m 'add semantic indentation'
  PR_HEAD=$(git -C "$CASE/merged" rev-parse HEAD)
  git -C "$CASE/merged" push -q origin HEAD:refs/pull/7/head
  git -C "$WT" fetch -q origin refs/pull/7/head
  case "$mode" in
    baseline-yaml|amended-*)
      printf '%s' "$bad" > "$WT/$file"
      git -C "$WT" add "$file"
      git -C "$WT" commit -q --amend --no-edit ;;
  esac
  if [ "$mode" = old-git-amended ]; then
    printf '%s' "$bad" > "$WT/$file"
    git -C "$WT" add "$file"
    git -C "$WT" commit -q --amend --no-edit
  fi
  HEAD_BEFORE=$(git -C "$WT" rev-parse HEAD)
  [ "$HEAD_BEFORE" != "$PR_HEAD" ]
  mkdir -p "$CASE/inputbin"
  # Only the forge response and pipeline lookup are offline inputs.
  # The executable under test, Git, Treehouse, tmux, and filesystem are real.
  cat > "$CASE/inputbin/gh" <<'SH'
#!/usr/bin/env bash
if [ "${1:-} ${2:-}" = 'pr view' ]; then
  printf 'MERGED\t%s\thttps://github.com/example/repo/pull/7\n' "$PROBE_PR_HEAD"
else
  exit 1
fi
SH
  cat > "$CASE/inputbin/no-mistakes" <<'SH'
#!/usr/bin/env bash
# This disposable task has no pipeline. Never contact the operator daemon.
exit 0
SH
  chmod +x "$CASE/inputbin/gh" "$CASE/inputbin/no-mistakes"
  export PROBE_PR_HEAD="$PR_HEAD"
  if [[ "$mode" = old-git-* ]]; then
    cat > "$CASE/inputbin/git" <<'SH'
#!/usr/bin/env bash
if [ "${1:-}" = patch-id ]; then
  printf '%s\n' "$*" >> "$PROBE_GIT_LOG"
  if [ "${2:-}" = --verbatim ]; then
    echo 'error: unknown option `verbatim`' >&2
    exit 129
  fi
fi
exec "$REAL_GIT" "$@"
SH
    chmod +x "$CASE/inputbin/git"
  fi
  export PROBE_GIT_LOG="$CASE/git.log"
  tmux -S .phase-test/tmux.sock new-window -d -t fm-lab-7781 -n fm-task-x1 -c "$ROOT" 'sleep 600'
  cat > "$LAB/state/task-x1.meta" <<EOF
window=fm-lab-7781:fm-task-x1
endpoint_task_id=task-x1
spawn_gen=live-probe-$mode
worktree=$WT
project=$PROJ
kind=ship
mode=no-mistakes
pr=https://github.com/example/repo/pull/7
pr_head=$PR_HEAD
EOF
  cp "$LAB/state/task-x1.meta" "$CASE/meta.before"
  touch "$LAB/state/.last-watcher-beat"
  tool="$ROOT/bin/fm-teardown.sh"
  [ "$mode" != baseline-yaml ] || tool="$ROOT/bin/.phase-baseline-teardown.sh"
  set +e
  PATH="$CASE/inputbin:$PATH" "$tool" task-x1 > "$CASE/stdout" 2> "$CASE/stderr"
  rc=$?
  set -e
  {
    printf 'mode=%s\nrevision=' "$mode"
    if [ "$mode" = baseline-yaml ]; then echo 417cec2feb4e2976c0acdb2527b87b3ccc71535f; else git rev-parse HEAD; fi
    printf 'command=FM_HOME=<marked-lab> TREEHOUSE_ROOT=<lab-pool> bin/fm-teardown.sh task-x1\nexit=%s\nlocal_head_before=%s\nmerged_head=%s\n' "$rc" "$HEAD_BEFORE" "$PR_HEAD"
    printf 'local content before teardown:\n%s' "$(git -C "$WT" show "$HEAD_BEFORE:$file")"
    printf '\nstdout:\n'
    cat "$CASE/stdout"
    printf 'stderr:\n'
    cat "$CASE/stderr"
    printf 'local_head_after=%s\n' "$(git -C "$WT" rev-parse HEAD)"
    if git -C "$WT" show-ref --verify --quiet refs/heads/fm/task-x1; then echo task_branch=retained; else echo task_branch=removed; fi
    if [ -e "$LAB/state/task-x1.meta" ]; then echo task_record=retained; else echo task_record=removed; fi
    if [ -f "$CASE/git.log" ]; then cat "$CASE/git.log"; fi
  } > "$EVIDENCE/live-$mode.log"
  cat "$EVIDENCE/live-$mode.log"
  case "$mode" in
    baseline-yaml|exact)
      [ "$rc" = 0 ]
      [ ! -e "$LAB/state/task-x1.meta" ]
      ! git -C "$WT" show-ref --verify --quiet refs/heads/fm/task-x1 ;;
    *)
      [ "$rc" = 1 ]
      grep -q 'REFUSED:.*not landed' "$CASE/stderr"
      [ "$(git -C "$WT" rev-parse HEAD)" = "$HEAD_BEFORE" ]
      [ "$(git -C "$WT" symbolic-ref --short HEAD)" = fm/task-x1 ]
      cmp "$CASE/meta.before" "$LAB/state/task-x1.meta" ;;
  esac
  if [[ "$mode" = old-git-* ]]; then
    grep -q -- 'patch-id --verbatim' "$CASE/git.log"
    ! grep -q -- '--stable' "$CASE/git.log"
  fi
  tmux -S .phase-test/tmux.sock kill-window -t fm-lab-7781:fm-task-x1 2>/dev/null || true
  rm -rf "$CASE"
done

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 - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Teardown refuses unpushed YAML and Python indentation amendments and preserves the commit, branch, and task metadata ✅ pass live Baseline and live teardown transcripts: baseline-yaml, amended-yaml, amended-python
Teardown accepts an exact patch replay with a different parent and completes cleanup ✅ pass live Baseline and live teardown transcripts: exact
Git rejecting --verbatim causes safe refusal without --stable fallback or loss of task state ✅ pass live Baseline and live teardown transcripts: old-git-exact, old-git-amended
  • TMPDIR=&#34;$PWD/.phase-test/tmp&#34; FM_HOME=&#34;$PWD/.phase-test/home&#34; bash bin/fm-test-run.sh tests/fm-teardown.test.sh: initial fixture-placement refusal.
  • TMPDIR=/tmp FM_HOME=&#34;$PWD/.phase-test/home&#34; bash bin/fm-test-run.sh tests/fm-teardown.test.sh: exit 0, no gate skips.
  • tmux -S .phase-test/tmux.sock new-session -d -s fm-lab-7781 -c &#34;$PWD&#34; &#39;sleep 600&#39; followed by bash .phase-test/live-probe.sh: exit 0, baseline reproduction and candidate probes.
  • git status --short, git diff --exit-code, and scratch inventory: tracked tree unchanged; remaining scratch identified after cleanup refusal.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "fix: preserve whitespace when proving pa..." · Reviewed by Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Thank you @WTF-Am-ID. This fixes #7781. patch_id_for_commit switches from --stable to --verbatim, and both sides of unpushed_patches_are_in_pr_head go through it, so an indentation-only amend no longer counts as already landed. On Git without --verbatim the id comes back empty, and teardown falls back to the content check or refuses, never to whitespace-insensitive matching. The new test covers an exact replay (allowed), an amended YAML indent (refused) and old Git (refused). Live validation is 3 of 3, the no-mistakes attestation binds 3366e893, and Greptile found nothing.

CI: 19 checks pass. Behavior portable serial 7 failed in tests/fm-remote-reply.test.sh ("the NUL-bearing line was not captured"), a known intermittent remote-reply flake that this diff doesn't touch. fm-teardown.test.sh passed in that same shard. I re-ran the failed job once (run 40688399283, attempt 2). If it comes back green and the PR is still clean, I'll merge it on a later pass. Nothing is needed from you.

Related, not duplicates: #7820 (no-mistakes mirror counted as landed) edits the line right next to this one in unpushed_patches_are_in_pr_head, and #7915 and #7909 are other teardown checks. If any of them conflict, that's ours to fix.

contract-class: restore. Teardown already promises to refuse unlanded work and accept only "equivalent patch ids", and a whitespace-only amend broke that refusal path.

VISION.md, per rule:

  • One captain, one interface: aligns (no silent work loss).
  • Authority is explicit: aligns (discarding work needs explicit word, and this closes a silent path).
  • Scripts own the mechanics: aligns (an exact patch identity).
  • A restart is a non-event: aligns (unlanded work survives).
  • Delegation with a spine: aligns ("Unlanded work is never torn down").
  • The fleet outlives any vendor: n/a.
  • Scope: aligns.

@kunchenguid
kunchenguid merged commit 2cf6816 into kunchenguid:main Oct 28, 2026
40 of 41 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @WTF-Am-ID — really appreciate you taking the time on this.