Skip to content

fix(bin): re-create a rebound herdr endpoint in its own presentation space - #6700

Closed
maiarowsky wants to merge 3 commits into
kunchenguid:mainfrom
maiarowsky:fm/fm-herdr-rebind-projection
Closed

maiarowsky wants to merge 3 commits into
kunchenguid:mainfrom
maiarowsky:fm/fm-herdr-rebind-projection

Conversation

@maiarowsky

@maiarowsky maiarowsky commented Oct 6, 2026 •

Copy link
Copy Markdown

Intent

Kontekst: 2026-10-06 firstmate przełączył dwóch workerów z harnessu pi/GPT na Claude przez bin/fm-control.sh <task> relaunch --harness claude .... Worker fm-strip-hooks-vs-project-gate miał żywy endpoint i został w swojej jednozadaniowej przestrzeni Herdr (workspace └ strip-hooks-vs-project-gate). Endpoint workera fm-merge-required-checks-fallback (dawny workspace prezentacyjny w6K) był udowodniony jako nieistniejący, więc rebind w bin/fm-spawn.sh celowo utworzył płaską kartę fm-fm-merge-required-checks-fallback wewnątrz przestrzeni samego firstmate (wT:t5), zamiast odtworzyć jednozadaniową przestrzeń prezentacyjną. Komentarz w fm-spawn.sh przy rebindzie mówi, że to świadomie kształt FLAT („projection is a presentation-only layout … flat is already the documented fallback for every recovery it cannot bind exactly”). Skutek dla kapitana: obca karta workera pojawia się w zakładkach przestrzeni firstmate. Kapitan zapytał, dlaczego powstała osobna karta w obecnym firstmate, firstmate zaproponował zgłoszenie poprawki, żeby ponowne uruchomienie odtwarzało osobną przestrzeń.

Słowa kapitana, dosłownie:
„dlaczego stworzyles osobna karte w obenym firsmate?”
„zgłoś poprawkę”

What Changed

  • bin/fm-spawn.sh: ship/scout --relaunch rebind endpointu udowodnionego jako nieistniejący, gdy presentation spaces są włączone, odtwarza teraz endpoint w świeżej jednozadaniowej przestrzeni prezentacyjnej w nagranej sesji Herdr, pod tym samym dokładnym parent workspace, którego użyłby świeży spawn (nowe spawn_herdr_rebind_projection). Ma te same uzbrojone dokładne abort cleanup i binding journala co świeża projekcja. Wcześniej tworzył płaską kartę fm-<id> wewnątrz przestrzeni launchera. Wcześniejszy presentation journal jest usuwany (spawn_herdr_rebind_retire_journal) tylko wtedy, gdy jego token workspace jest potwierdzony jako nieobecny w tej sesji. W każdym przypadku, którego nie da się bezpiecznie obsłużyć, zostaje dotychczasowy płaski layout: projekcja wyłączona, brak focus locka, brak lub niejednoznaczny parent, journal zachowany. Dotyczy to też przypadku, w którym journal jest nieczytelny, należy do innej sesji albo jego przestrzeń nadal istnieje.
  • bin/backends/herdr.sh: fm_backend_herdr_presentation_enabled i fm_backend_herdr_projection_create_task przyjmują opcjonalny argument <session>. Rebind sprawdza więc version floor i tworzy projekcję na serwerze z nagranej sesji, a nie z sesji ambient.
  • Dokumentacja i testy: docs/agent-control.md i docs/herdr-backend.md opisują teraz projektowany kształt reclaimu, warunki retire journala i przejście do flat, a znane ograniczenie z husk pane zawężają do layoutu flat. tests/fm-control-relaunch.test.sh dostał trzy przypadki: rebind odtwarza presentation space, zostaje flat przy wyłączonej prezentacji, zachowuje journal, którego przestrzeń nadal istnieje.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Zmiana jest wąska i realizuje intencję: odzyskanie endpointu, którego nieobecność udowodniono, tworzy teraz własną przestrzeń prezentacyjną w nagranej sesji. Odtwarza przy tym istniejące bramki ścieżki fresh-spawn, czyli blokadę sesji, dokładnego rodzica, journal oraz abort cleanup. Bezpiecznie wraca do układu flat, a stary journal usuwa dopiero wtedy, gdy jego token zniknął z sesji. Prześledziłem scenariusz z intencji, ścieżkę cross-session, ścieżkę bez panelu herdr i ponowienie po nieudanym tworzeniu i nie znalazłem błędów poprawności.

Testing

Całą ścieżkę z incydentu przeprowadziłem na żywo na prawdziwym herdr 0.9.1. Z panelu „firstmate” w izolowanej sesji fm-lab-* (jednorazowy, oznaczony lab home) uruchomiłem świeży spawn workera pi w przestrzeni prezentacyjnej, zniszczyłem jego przestrzeń i wykonałem fm-control.sh relaunch --harness claude. Rebind utworzył nową przestrzeń └ rbp · p:&lt;nowy token&gt; z kartą fm-rbp, a przestrzeń firstmate nadal miała wyłącznie własną kartę. Rekord wskazuje nową przestrzeń, a dziennik prezentacji został wymieniony na nowe, dokładne powiązanie w wersji 2. Przypadek przeciwny (przestrzeń z tokenem wciąż obecna) poprawnie zostawił dziennik bajt w bajt nietknięty i przeszedł na płaski układ z ostrzeżeniem. Przy off zachowany jest płaski układ. Ukierunkowany zestaw tests/fm-control-relaunch.test.sh przechodzi, także trzy nowe przypadki. Harness w panelu workera to nieaktywna atrapa (pi/claude na PATH), bo zmiana dotyczy umiejscowienia endpointu, a nie samego harnessu. Dzięki temu test nie zapisuje zaufania w prawdziwym ~/.claude.json. Wynik ogólny: zmiana spełnia intencję kapitana. Zmiana nie dotyczy interfejsu graficznego, więc zamiast zrzutów ekranu dowodem są zrzuty układu workspace/tab z prawdziwego herdr w transkrypcie.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Kapitan ponownie uruchamia workera, którego przestrzeń prezentacyjna zniknęła (pi → claude), a worker trafia do własnej, nowej jednozadaniowej przestrzeni └ &lt;id&gt; · p:&lt;token&gt;, nie jako karta w przest… ✅ pass live live-rebind-transcript.txt, kroki 1–2: po fm-control.sh rbp relaunch --harness claude powstała w3 "└ rbp · p:XFkI…" z kartą fm-rbp; w1 "firstmate" ma tylko kartę "1"; meta herdr_workspace_id=w3, har…
Rebind przy dzienniku, którego przestrzeń z tokenem nadal istnieje: dziennik zostaje nietknięty, nie powstaje druga projekcja, płaski układ z ostrzeżeniem ✅ pass live live-rebind-transcript.txt, krok 3: ostrzeżenie „not confirmed gone; retaining it…”; cmp dziennika przed i po: identyczny; nowa karta fm-rbp w w1, bez nowego workspace create
Przy config/herdr-presentation-spaces=off rebind zachowuje płaski układ (karta w przestrzeni firstmate, brak dziennika) ✅ pass live live-rebind-transcript.txt, kroki 4–5: po relaunch rbo karta "fm-rbo" w w1, meta herdr_workspace_id=w1, journal: <absent>
Rebind zostaje w sesji herdr zapisanej w rekordzie ✅ pass live live-rebind-transcript.txt: endpoint=fm-lab-rebind-proj-89777-17645:w3:p2, czyli ta sama sesja co w rekordzie; dodatkowo tests/fm-control-relaunch.test.sh „a herdr rebind is created in the session t…
Evidence: Transkrypt na żywo: spawn → zniszczenie endpointu → relaunch, z układami przestrzeni herdr i rekordami

Source: Transkrypt na żywo: spawn → zniszczenie endpointu → relaunch, z układami przestrzeni herdr i rekordami

lab session: fm-lab-rebind-proj-89777-17645 (herdr herdr 0.9.1)
launcher workspace=w1 pane=w1:p1

=== step 1: fresh ship spawn rbp (presentation spaces default)
$ (in launcher pane w1:p1, HERDR_PANE_ID set by herdr) bin/fm-spawn.sh rbp /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-rebind-live.KNAR68/proj pi --mode no-mistakes --yolo off --backend herdr
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no ship branch; defaulting to legacy branch fm/rbp
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
    spawned rbp harness=pi kind=ship mode=no-mistakes yolo=off window=fm-lab-rebind-proj-89777-17645:w2:p2 worktree=~/.treehouse/proj-173165/1/proj
    [exit 0]

--- herdr layout: after fresh spawn of rbp
  workspace w1 "firstmate"
      tab w1:t1 "1"
  workspace w2 "└ rbp · p:-9GpTDHqDs0GK2cAo1bDgQ"
      tab w2:t2 "fm-rbp"
    meta: window=fm-lab-rebind-proj-89777-17645:w2:p2
    meta: harness=pi
    meta: herdr_workspace_id=w2
    journal: version=2
    journal: task_id=rbp
    journal: projection_id=-9GpTDHqDs0GK2cAo1bDgQ
    journal: home=/private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    journal: session=fm-lab-rebind-proj-89777-17645
    journal: workspace_id=w2
    journal: tab_id=w2:t2
    journal: pane_id=w2:p2
    journal: parent_workspace_id=w1
    journal: parent_label=firstmate
    journal: workspace_label=└ rbp · p:-9GpTDHqDs0GK2cAo1bDgQ
    journal: task_label=fm-rbp

=== destroy rbp's endpoint: close its presentation workspace w2 (the w6K-gone shape)
    closed

--- herdr layout: after destroying rbp's endpoint
  workspace w1 "firstmate"
      tab w1:t1 "1"

=== step 2: reclaim rbp onto claude
$ (in launcher pane w1:p1, HERDR_PANE_ID set by herdr) bin/fm-control.sh rbp relaunch --harness claude --note switched from pi to claude after the endpoint was proven gone
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no ship branch; defaulting to legacy branch fm/rbp
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
    relaunched rbp harness=claude from=pi model=default effort=default backend=herdr endpoint=fm-lab-rebind-proj-89777-17645:w3:p2 worktree=~/.treehouse/proj-173165/1/proj
    [exit 0]

--- herdr layout: after relaunch of rbp
  workspace w1 "firstmate"
      tab w1:t1 "1"
  workspace w3 "└ rbp · p:XFkIriF7m5I1EWLYdR-h5A"
      tab w3:t2 "fm-rbp"
    meta: window=fm-lab-rebind-proj-89777-17645:w3:p2
    meta: harness=claude
    meta: herdr_workspace_id=w3
    journal: version=2
    journal: task_id=rbp
    journal: projection_id=XFkIriF7m5I1EWLYdR-h5A
    journal: home=/private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    journal: session=fm-lab-rebind-proj-89777-17645
    journal: workspace_id=w3
    journal: tab_id=w3:t2
    journal: pane_id=w3:p2
    journal: parent_workspace_id=w1
    journal: parent_label=firstmate
    journal: workspace_label=└ rbp · p:XFkIriF7m5I1EWLYdR-h5A
    journal: task_label=fm-rbp
    pi launches: ~/.treehouse/proj-173165/1/proj	-e /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/state/rbp.pi-ext.ts ⁣FIRSTMATE_OP: v1 launch-brief: # Current worker role contract
You are a crewmate: an autonomous worker agent managed by firstmate.
This section establishes your current identity before every project or task instruction below and supersedes any conflicting role identity in those instructions.
Do the assigned work yourself and report only to firstmate; do not adopt a firstmate or secondmate supervisor identity, delegate the task, run fleet supervision, or address the captain.
Your steering inbox is `/private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/state/rbp.inbox`; this exact path belongs to your current task even when it is outside the worktree or under the supervising firstmate home, so read and acknowledge its messages and do not reject it as another home's state.
Never inspect or change any other home's endpoint namespace; this authorization is limited to the exact task paths named by this brief.
When this task works on Firstmate itself, the repository root `AGENTS.md` (also imported by `CLAUDE.md`) is project content and the supervisor contract for the firstmate managing you: follow this brief instead of that supervisor contract.
Project instructions still govern the work wherever they do not conflict with this worker identity, including `CONTRIBUTING.md` and `firstmate-coding-guidelines` for Firstmate changes.
If the `firstmate-coding-guidelines` skill name does not resolve in this session, read `~/.no-mistakes/worktrees/bd45d26a4aa0/01M48HAK3FQMT90S9YKAFHJKZE/.agents/skills/firstmate-coding-guidelines/SKILL.md` instead.

# Task
## Captain's intent
Rebind fixture rbp.

## Firstmate spec
Stay idle.

# Current no-mistakes intent contract
This section supersedes every earlier brief instruction about constructing `--intent`, but not later clarifications actually supplied by the captain.
Use everything under `## Captain intent authorized for --intent` through the end of this brief, including any nested subheadings but excluding that heading, plus any later words the captain actually supplied as `--intent`; never include Firstmate specification or other mixed Task content.
Preserve those words without adding speaker labels or direct address.
Firstmate-authored constraints, acceptance criteria, implementation details, decisions, and tradeoffs are specification, not captain intent.
The Definition of done's rule that `--intent` must be self-sufficient still governs the string you pass: resolve any report, decision, or PR the intent below refers to into its substance rather than passing the pointer.

## Captain intent authorized for --intent
Rebind fixture rbp.
    claude launches: 

=== adversarial: plant a decoy workspace still carrying rbp's journal token, then destroy the real endpoint
    closed real projected workspace w3

--- herdr layout: before adversarial relaunch
  workspace w1 "firstmate"
      tab w1:t1 "1"
  workspace w4 "└ rbp · p:XFkIriF7m5I1EWLYdR-h5A"
      tab w4:t1 "1"

=== step 3: reclaim rbp while a token-bearing space is still present
$ (in launcher pane w1:p1, HERDR_PANE_ID set by herdr) bin/fm-control.sh rbp relaunch --harness claude --note switched from pi to claude after the endpoint was proven gone
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no ship branch; defaulting to legacy branch fm/rbp
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbp/launch-brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
    warning: herdr presentation journal for rbp still names a space that is not confirmed gone; retaining it and re-creating the endpoint in the ordinary flat layout
    relaunched rbp harness=claude from=claude model=default effort=default backend=herdr endpoint=fm-lab-rebind-proj-89777-17645:w1:p2 worktree=~/.treehouse/proj-173165/1/proj
    [exit 0]

--- herdr layout: after adversarial relaunch
  workspace w1 "firstmate"
      tab w1:t1 "1"
      tab w1:t2 "fm-rbp"
  workspace w4 "└ rbp · p:XFkIriF7m5I1EWLYdR-h5A"
      tab w4:t1 "1"
    meta: window=fm-lab-rebind-proj-89777-17645:w1:p2
    meta: harness=claude
    meta: herdr_workspace_id=w1
    journal: version=2
    journal: task_id=rbp
    journal: projection_id=XFkIriF7m5I1EWLYdR-h5A
    journal: home=/private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    journal: session=fm-lab-rebind-proj-89777-17645
    journal: workspace_id=w3
    journal: tab_id=w3:t2
    journal: pane_id=w3:p2
    journal: parent_workspace_id=w1
    journal: parent_label=firstmate
    journal: workspace_label=└ rbp · p:XFkIriF7m5I1EWLYdR-h5A
    journal: task_label=fm-rbp
    journal byte-identical to before: yes

=== step 4: fresh ship spawn rbo with presentation spaces off
$ (in launcher pane w1:p1, HERDR_PANE_ID set by herdr) bin/fm-spawn.sh rbo /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-rebind-live.KNAR68/proj pi --mode no-mistakes --yolo off --backend herdr
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbo/launch-brief.md records no ship branch; defaulting to legacy branch fm/rbo
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbo/launch-brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
    spawned rbo harness=pi kind=ship mode=no-mistakes yolo=off window=fm-lab-rebind-proj-89777-17645:w1:p3 worktree=~/.treehouse/proj-173165/2/proj
    [exit 0]

=== destroy rbo's endpoint: close pane w1:p3
    closed

=== step 5: reclaim rbo with presentation spaces off
$ (in launcher pane w1:p1, HERDR_PANE_ID set by herdr) bin/fm-control.sh rbo relaunch --harness claude --note switched from pi to claude after the endpoint was proven gone
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbo/launch-brief.md records no ship branch; defaulting to legacy branch fm/rbo
    warning: /private/var/folders/h9/pytlt6s52cg8ln8m8zxw26kc0000gn/T/fm-lab.q47SgA/data/rbo/launch-brief.md records no delivery contract line (scaffolded before ship briefs recorded one); launching on the explicit --mode no-mistakes - confirm its definition of done matches
    relaunched rbo harness=claude from=pi model=default effort=default backend=herdr endpoint=fm-lab-rebind-proj-89777-17645:w1:p4 worktree=~/.treehouse/proj-173165/2/proj
    [exit 0]

--- herdr layout: after relaunch of rbo (off)
  workspace w1 "firstmate"
      tab w1:t1 "1"
      tab w1:t2 "fm-rbp"
      tab w1:t4 "fm-rbo"
  workspace w4 "└ rbp · p:XFkIriF7m5I1EWLYdR-h5A"
      tab w4:t1 "1"
    meta: window=fm-lab-rebind-proj-89777-17645:w1:p4
    meta: harness=claude
    meta: herdr_workspace_id=w1
    journal: <absent>

=== done
Evidence: Skrypt sterujący testem na żywo (fm-herdr-lab, jednorazowy lab home)

Source: Skrypt sterujący testem na żywo (fm-herdr-lab, jednorazowy lab home)

#!/usr/bin/env bash
# Live driver: real herdr lab session, real fm-spawn / fm-control relaunch,
# run from a "firstmate" launcher pane inside the lab, to show where a rebind
# of a proven-gone endpoint lands.
set -u
ROOT=${ROOT:?}
EV=${EV:?}
LOG="$EV/live-rebind-transcript.txt"
: > "$LOG"
say() { printf '%s\n' "$*" | tee -a "$LOG"; }
unset HERDR_ENV HERDR_PANE_ID HERDR_TAB_ID HERDR_WORKSPACE_ID HERDR_SOCKET_PATH HERDR_SESSION
SCR=$(mktemp -d "$(cd "${TMPDIR:-/tmp}" && pwd -P)/fm-rebind-live.XXXXXX")
LAB=$(mktemp -d "$(cd "${TMPDIR:-/tmp}" && pwd -P)/fm-lab.XXXXXX")
"$ROOT/bin/fm-lab-home.sh" create "$LAB" >/dev/null || exit 1
SESSION=$("$ROOT/bin/fm-herdr-lab.sh" name rebind-proj) || exit 1
FAKEBIN="$SCR/fakebin"; mkdir -p "$FAKEBIN" "$SCR/claude-config"
printf '{}\n' > "$SCR/claude-config/.claude.json"
cat > "$FAKEBIN/claude" <<EOF
#!/usr/bin/env bash
case "\${1:-}" in --help|-h|--version|-v) echo "inert test harness"; exit 0 ;; esac
printf '%s\t%s\n' "\$PWD" "\$*" >> "$SCR/claude-launches"
exec sleep 100000
EOF
cp "$FAKEBIN/claude" "$FAKEBIN/pi"
sed -i '' 's/claude-launches/pi-launches/' "$FAKEBIN/pi"
chmod +x "$FAKEBIN/claude" "$FAKEBIN/pi"
LAB_READY=0
WTS=""
cleanup() {
  local wt
  for wt in $WTS; do
    [ -d "$wt" ] && treehouse return --force "$wt" >/dev/null 2>&1
    case "$wt" in "$HOME"/.treehouse/proj-*/*) rm -rf "${wt%/*/*}" ;; esac
  done
  [ "$LAB_READY" = 1 ] && "$ROOT/bin/fm-herdr-lab.sh" teardown "$SESSION" >/dev/null 2>&1
  chmod -R u+w "$SCR" "$LAB" 2>/dev/null
  rm -rf "$SCR" "$LAB"
}
trap cleanup EXIT
lab() { "$ROOT/bin/fm-herdr-lab.sh" run "$SESSION" "$@"; }

PROJ="$SCR/proj"; mkdir -p "$PROJ"
git -C "$PROJ" init -q; printf '# fixture\n' > "$PROJ/README.md"; git -C "$PROJ" add README.md
git -C "$PROJ" -c user.name=t -c [email protected] commit -qm initial
git clone --quiet --bare "$PROJ" "$PROJ.origin.git"; git -C "$PROJ" remote add origin "file://$PROJ.origin.git"
for id in rbp rbo; do
  mkdir -p "$LAB/data/$id"
  printf '# Task\n## Captain'"'"'s intent\nRebind fixture %s.\n\n## Firstmate spec\nStay idle.\n' "$id" > "$LAB/data/$id/brief.md"
done

PATH="$FAKEBIN:$PATH" "$ROOT/bin/fm-herdr-lab.sh" provision "$SESSION" || { say "provision failed"; exit 1; }
LAB_READY=1
say "lab session: $SESSION (herdr $(herdr --version))"

# The launcher seat: a 'firstmate' workspace whose root pane runs every command,
# mirroring a firstmate primary sitting in its own Herdr workspace.
OUT=$(lab workspace create --cwd "$ROOT" --label firstmate --focus) || { say "launcher create failed"; exit 1; }
LWS=$(printf '%s' "$OUT" | jq -r '.result.workspace.workspace_id')
LPANE=$(printf '%s' "$OUT" | jq -r '.result.root_pane.pane_id')
say "launcher workspace=$LWS pane=$LPANE"
sleep 1

STEP=0
in_pane() {  # <description> <command...>: run in the launcher pane, wait, print output
  STEP=$((STEP + 1))
  local desc=$1; shift
  local script="$SCR/step$STEP.sh" i
  {
    printf '#!/usr/bin/env bash\ncd %q || exit 99\n' "$ROOT"
    printf 'env -u NO_MISTAKES_GATE -u FM_GATE_REFUSE_BYPASS -u FM_ROOT_OVERRIDE -u FM_STATE_OVERRIDE -u FM_DATA_OVERRIDE -u FM_CONFIG_OVERRIDE -u FM_PROJECTS_OVERRIDE FM_HOME=%q CLAUDE_CONFIG_DIR=%q FM_SPAWN_NO_GUARD=1 PATH=%q' "$LAB" "$SCR/claude-config" "$FAKEBIN:$PATH"
    printf ' %q' "$@"
    printf ' > %q 2>&1\necho $? > %q\n' "$SCR/step$STEP.out" "$SCR/step$STEP.rc"
  } > "$script"
  chmod +x "$script"
  lab pane send-text "$LPANE" "bash $script" >/dev/null
  lab pane send-keys "$LPANE" Enter >/dev/null
  for i in $(seq 1 450); do [ -f "$SCR/step$STEP.rc" ] && break; sleep 0.2; done
  say ""
  say "=== step $STEP: $desc"
  say "\$ (in launcher pane $LPANE, HERDR_PANE_ID set by herdr) $*"
  sed 's/^/    /' "$SCR/step$STEP.out" 2>/dev/null | tee -a "$LOG" >/dev/null
  say "    [exit $(cat "$SCR/step$STEP.rc" 2>/dev/null || echo TIMEOUT)]"
}
layout() {  # <title>
  local ws
  say ""
  say "--- herdr layout: $1"
  lab workspace list | jq -r '.result.workspaces[] | "\(.workspace_id)\t\(.label)"' | while IFS=$'\t' read -r ws label; do
    say "  workspace $ws \"$label\""
    lab tab list --workspace "$ws" | jq -r '.result.tabs[] | "      tab \(.tab_id) \"\(.label)\""' | tee -a "$LOG"
  done
}
meta() { grep -E "^(window|herdr_workspace_id|harness)=" "$LAB/state/$1.meta" | sed 's/^/    meta: /' | tee -a "$LOG"; }
journal() { if [ -f "$LAB/state/$1.herdr-presentation" ]; then sed 's/^/    journal: /' "$LAB/state/$1.herdr-presentation" | tee -a "$LOG"; else say "    journal: <absent>"; fi; }
remember_wt() { local wt; wt=$(sed -n 's/^worktree=//p' "$LAB/state/$1.meta" | tail -1); WTS="$WTS $wt"; }

# ---------- Scenario 1: fresh spawn, endpoint destroyed, relaunch --harness claude --note "switched from pi to claude after the endpoint was proven gone"
in_pane "fresh ship spawn rbp (presentation spaces default)" \
  bin/fm-spawn.sh rbp "$PROJ" pi --mode no-mistakes --yolo off --backend herdr
remember_wt rbp
layout "after fresh spawn of rbp"; meta rbp; journal rbp
OLD_WS=$(sed -n 's/^herdr_workspace_id=//p' "$LAB/state/rbp.meta" | tail -1)
say ""; say "=== destroy rbp's endpoint: close its presentation workspace $OLD_WS (the w6K-gone shape)"
lab workspace close "$OLD_WS" >/dev/null && say "    closed"
sleep 1
layout "after destroying rbp's endpoint"
in_pane "reclaim rbp onto claude" bin/fm-control.sh rbp relaunch --harness claude --note "switched from pi to claude after the endpoint was proven gone"
layout "after relaunch of rbp"; meta rbp; journal rbp
say "    pi launches: $(cat "$SCR/pi-launches" 2>/dev/null)"
say "    claude launches: $(cat "$SCR/claude-launches" 2>/dev/null)"

# ---------- Scenario 3 (adversarial): journal still names a present workspace
NEW_WS=$(sed -n 's/^herdr_workspace_id=//p' "$LAB/state/rbp.meta" | tail -1)
TOKEN=$(sed -n 's/^projection_id=//p' "$LAB/state/rbp.herdr-presentation" | tail -1)
say ""; say "=== adversarial: plant a decoy workspace still carrying rbp's journal token, then destroy the real endpoint"
lab workspace create --cwd "$SCR" --label "└ rbp · p:$TOKEN" --no-focus >/dev/null 2>&1 || lab workspace create --cwd "$SCR" --label "└ rbp · p:$TOKEN" >/dev/null
lab workspace focus "$LWS" >/dev/null 2>&1 || true
lab workspace close "$NEW_WS" >/dev/null && say "    closed real projected workspace $NEW_WS"
cp "$LAB/state/rbp.herdr-presentation" "$SCR/journal-before"
sleep 1
layout "before adversarial relaunch"
in_pane "reclaim rbp while a token-bearing space is still present" bin/fm-control.sh rbp relaunch --harness claude --note "switched from pi to claude after the endpoint was proven gone"
layout "after adversarial relaunch"; meta rbp; journal rbp
if cmp -s "$SCR/journal-before" "$LAB/state/rbp.herdr-presentation"; then say "    journal byte-identical to before: yes"; else say "    journal byte-identical to before: NO"; fi

# ---------- Scenario 2: presentation spaces off keeps the flat layout
printf 'off\n' > "$LAB/config/herdr-presentation-spaces"
in_pane "fresh ship spawn rbo with presentation spaces off" \
  bin/fm-spawn.sh rbo "$PROJ" pi --mode no-mistakes --yolo off --backend herdr
remember_wt rbo
RBO_PANE=$(sed -n 's/^window=//p' "$LAB/state/rbo.meta" | tail -1); RBO_PANE=${RBO_PANE#*:}
say ""; say "=== destroy rbo's endpoint: close pane $RBO_PANE"
lab pane close "$RBO_PANE" >/dev/null && say "    closed"
sleep 1
in_pane "reclaim rbo with presentation spaces off" bin/fm-control.sh rbo relaunch --harness claude --note "switched from pi to claude after the endpoint was proven gone"
layout "after relaunch of rbo (off)"; meta rbo; journal rbo
say ""; say "=== done"
Evidence: Układ herdr przed relaunch i po nim (presentation spaces domyślnie włączone)
after destroying rbp's endpoint:
workspace w1 "firstmate"
tab w1:t1 "1"
$ bin/fm-control.sh rbp relaunch --harness claude --note ...
relaunched rbp harness=claude from=pi ... endpoint=fm-lab-rebind-proj-89777-17645:w3:p2
after relaunch of rbp:
workspace w1 "firstmate"
tab w1:t1 "1"
workspace w3 "└ rbp · p:XFkIriF7m5I1EWLYdR-h5A"
tab w3:t2 "fm-rbp"
meta: herdr_workspace_id=w3 journal: version=2 workspace_id=w3 parent_workspace_id=w1
Evidence: Przypadek przeciwny: dziennik wskazuje obecną przestrzeń
warning: herdr presentation journal for rbp still names a space that is not confirmed gone; retaining it and re-creating the endpoint in the ordinary flat layout
journal byte-identical to before: yes
workspace w1 "firstmate": tab "1", tab "fm-rbp" (flat fallback)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-spawn.sh:3590 - spawn_herdr_rebind_projection powiela prawie dosłownie blok tworzenia projekcji ze ścieżki fresh-spawn: utworzenie journala i etykiety, fm_backend_herdr_projection_create_task, uzbrojenie abort cleanup w gałęzi CLEANUP_SAFE, przepisanie globali endpointu, order_best_effort, home_identity, live_binding_matches i journal_bind razem z tym samym ostrzeżeniem. Odpowiedniki: bin/fm-spawn.sh:3590-3625 oraz bin/fm-spawn.sh:3885-3922. Obie kopie już się rozjechały. Przy launcher status 1 fresh-spawn wychodzi od razu, a rebind przechodzi na flat i zostawia odmowę container_ensure. Kolejność server_ensure i blokady też jest inna. Każda przyszła poprawka sekwencji tworzenie → bind → cleanup musi więc trafić w dwa miejsca. Proponuję czysto refaktoryzacyjną zmianę: wyciągnąć wspólny helper (np. spawn_herdr_projection_create_and_bind &lt;cwd&gt; &lt;session&gt; &lt;parent&gt; &lt;parent-label&gt; &lt;home&gt;) i wywoływać go w obu ścieżkach. Bramki wejściowe każdej ścieżki zostają, tak jak są.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Kapitan ponownie uruchamia workera, którego przestrzeń prezentacyjna zniknęła (pi → claude), a worker trafia do własnej, nowej jednozadaniowej przestrzeni └ &lt;id&gt; · p:&lt;token&gt;, nie jako karta w przest… ✅ pass live live-rebind-transcript.txt, kroki 1–2: po fm-control.sh rbp relaunch --harness claude powstała w3 "└ rbp · p:XFkI…" z kartą fm-rbp; w1 "firstmate" ma tylko kartę "1"; meta herdr_workspace_id=w3, har…
Rebind przy dzienniku, którego przestrzeń z tokenem nadal istnieje: dziennik zostaje nietknięty, nie powstaje druga projekcja, płaski układ z ostrzeżeniem ✅ pass live live-rebind-transcript.txt, krok 3: ostrzeżenie „not confirmed gone; retaining it…”; cmp dziennika przed i po: identyczny; nowa karta fm-rbp w w1, bez nowego workspace create
Przy config/herdr-presentation-spaces=off rebind zachowuje płaski układ (karta w przestrzeni firstmate, brak dziennika) ✅ pass live live-rebind-transcript.txt, kroki 4–5: po relaunch rbo karta "fm-rbo" w w1, meta herdr_workspace_id=w1, journal: <absent>
Rebind zostaje w sesji herdr zapisanej w rekordzie ✅ pass live live-rebind-transcript.txt: endpoint=fm-lab-rebind-proj-89777-17645:w3:p2, czyli ta sama sesja co w rekordzie; dodatkowo tests/fm-control-relaunch.test.sh „a herdr rebind is created in the session t…
  • bin/fm-herdr-lab.sh name|provision|run|teardown — izolowana sesja fm-lab-rebind-proj-* na prawdziwym herdr 0.9.1, plus bin/fm-lab-home.sh create jako jednorazowy FM_HOME
  • Z panelu startowego „firstmate” w laboratoryjnej sesji (HERDR_PANE_ID ustawiony przez herdr): bin/fm-spawn.sh rbp &lt;proj&gt; pi --mode no-mistakes --yolo off --backend herdr (świeży spawn z projekcją)
  • herdr workspace close przestrzeni prezentacyjnej rbp (endpoint udowodniony jako nieistniejący, jak w6K w incydencie), potem bin/fm-control.sh rbp relaunch --harness claude --note ...
  • Test przeciwny: podłożona przestrzeń-wabik z tokenem dziennika rbp, zamknięcie prawdziwej przestrzeni, ponowny fm-control.sh rbp relaunch --harness claude i porównanie dziennika bajt po bajcie (cmp)
  • config/herdr-presentation-spaces=off: fm-spawn.sh rbo ..., herdr pane close, fm-control.sh rbo relaunch --harness claude
  • Po każdym kroku zrzut układu herdr workspace list + tab list, a także pliki state/&lt;id&gt;.meta i state/&lt;id&gt;.herdr-presentation
  • bash tests/fm-control-relaunch.test.sh — ukierunkowany zestaw testów relaunch/reclaim, w tym trzy nowe przypadki rebind-projection (wszystkie ok)
  • Sprzątanie sprawdzone: została tylko sesja default, brak katalogów tymczasowych lab/scratch, pula treehouse usunięta, worktree czysty
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Jarosław Macioszek added 2 commits October 6, 2026 12:57
A relaunch that replaces a proven-gone Herdr endpoint now re-creates it in a fresh one-task presentation workspace when presentation spaces are enabled, instead of a flat tab inside the launcher's own workspace. An earlier journal is retired only when its token workspace is confirmed gone; every unsafe case keeps the flat fallback.
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds rebind logic to the workspace projection system.

The PR appears safe to merge; no outstanding finding or distinct new issue was identified.

Reviews (2) · Last reviewed commit: "no-mistakes(ci): ci-1 (Greptile): narusz..."

Comment thread bin/fm-spawn.sh Resolved
Comment thread tests/fm-control-relaunch.test.sh Resolved
…ojekcji, uzbrajanie abort cleanup i wiązanie journala muszą przebiegać identycznie przy świeżym spawnie i przy rebindzie. Wydzieliłem te kroki do jednej funkcji `spawn_herdr_projection_create_bind <session> <cwd> <home> <parent> <parent-label>` w `bin/fm-spawn.sh`. Używają jej świeży spawn i `spawn_herdr_rebind_projection`. Każda ścieżka zachowuje własne kontrole wejścia: gate presentation, lock, tożsamość launchera, wycofanie journala, parent. Zwykły spawn działa jak wcześniej. Przekazanie `$HERDR_SES` jako sesji odpowiada poprzedniemu wywołaniu bez argumentu, bo zmienna zawiera tę samą sesję ambient. `FM_HOME`/home identity to nadal `HERDR_LABEL_HOME` (przy rebindzie `FM_HOME`). Usunąłem zbędne zmienne lokalne i globalne (`HERDR_PROJECTION_ID/LABEL`, `HERDR_HOME_ID`). Nigdzie indziej nie były używane. ci-2: w `tests/fm-control-relaunch.test.sh` dodałem test `test_herdr_rebind_projection_failure_quarantines_its_journal`. Stub herdr dostał dwie flagi: `herdr-tab-create-fails` i `herdr-projection-stray-pane`. Test obejmuje trzy porażki po wycofaniu starego journala: - `workspace create` się nie udaje; - `tab create` się nie udaje; - obie operacje create się udają, ale workspace nie zbiega się do jednego pane'u. Za każdym razem sprawdza: exit 1, świeży niepowiązany journal (version=1, token inny niż stary), brak płaskiej karty w `wsparent`, brak `workspace close`. Przy niejednoznacznych create sprawdza też, że abort cleanup nie dotyka żadnego pane'u. Przy dokładnych ID sprawdza, że cleanup celuje dokładnie w `%9` i `%8`. Test mutacyjny (abort cleanup ustawiony na 0) powoduje porażkę nowego testu; po przywróceniu kodu test przechodzi. Weryfikacja: - `tests/fm-control-relaunch.test.sh`: wszystkie testy ok (rc=0), łącznie z czterema testami rebind projekcji. - `tests/fm-backend-herdr.test.sh`: rc=0, 230 ok. - `fm-backend-herdr-launcher-workspace-e2e`: rc=0. - `fm-backend-herdr-focus-flash-e2e`: rc=0. - `fm-backend-herdr-presentation-e2e`: 17 ok i 0 porażek do chwili raportu; ten przebieg wciąż trwał, więc jego końcowy kod wyjścia jest niepotwierdzony. - shellcheck: tylko istniejące wcześniej informacje SC1091
@maiarowsky maiarowsky closed this Oct 30, 2026
tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Nov 18, 2026
…t-PR branch PRs (#120)

* fix(bin): treat a declared wait as a standing declaration, not the log's last event

`state/<id>.status` is an append-only event log, and every declared-wait
gate read it last-event-wins. A worker that appended `paused: <external
wait>` kept its wedge-alarm suppression only until the next line landed,
from anyone: its own armed background reporter, a pipeline step notice, a
firstmate note. That line became the newest event, current state flipped
away from the declaration, the possible-wedge ladder restarted from zero,
and nothing reported that the suppression had been voided.

`status_standing_wait_line` in `bin/fm-classify-lib.sh` folds the log the
way keyed decisions are already folded: a `paused:` or `captain-held:` line
declares the wait, and only a line the worker writes to say its situation
changed - `done`, `needs-decision`, `blocked`, `failed`, `resolved`, or a
replacing declaration - retracts it. `working:`, `note:` and free-text
prose leave it standing. A `resolved` line retracts a pause only when it
carries the pause's own phase key, where a keyless line is its own phase
distinct from a stated `[key=default]`, matching upstream's
`status_declared_wait_line`; a captain hold is retracted by any `resolved`
line because the hold waits on firstmate's answer. Every declared-wait
gate reads that fold: `fm-crew-state.sh`, `fm-watch.sh`,
`fm-supervise-daemon.sh`, and `fm-push-transition-lib.sh`'s Herdr fast
path. The re-surface throttle is scoped to the declaration line rather
than the status-log signature. The daemon's captain-relevance and terminal
reads, and the watcher's wedge wait evidence, keep upstream's
`status_declared_wait_line` read.

Fork patch F6. Tracks kunchenguid#2713 (open); upstream PR
kunchenguid#4811 proposes a narrower cadence fix for the same
issue. Rebuilt on upstream a8572f6, whose 5587 introduced
`status_declared_wait_line` at these gates; each conflicting gate keeps
the standing fold on top of upstream's surrounding change.

Upstream issue: kunchenguid#2713 (open)
Upstream PR: kunchenguid#4811 (open)
(cherry picked from commit 4bfc53c)

* feat(spawn): lease Treehouse copies for the task lifetime

A process-bound `treehouse get` hold lapses when no process remains in
the copy, so a later `get` could be handed a live task's recorded
worktree while that task was merely idle between turns. Its next
relaunch, teardown, or worktree read then pointed at someone else's work.

Fresh ship and scout Treehouse spawns now acquire the copy with
`treehouse get --lease --lease-holder <task-id>` from the spawning
project instead of opening a process-bound subshell in the pane. A
leased worktree is never handed out by a later `get` and never removed by
prune, even with no process running inside it, until `treehouse return` -
and teardown returns it only after the landed-work test passes.

After acquiring, spawn refuses a copy that another live task in this home
or any locally registered home already records, including pre-lease tasks
whose hold has lapsed; a relaunch of the same task reuses the copy its own
record names. The pane is then seated with a top-level `cd` into the
leased path and polled until two consecutive reads agree on it. The
pool-slot ownership claim is kept alongside the lease, because that
marker is what teardown reads to leave a reassigned slot untouched.
Upstream spawn fixtures are taught the lease so tests added after this
patch keep passing.

The occupancy walk reuses upstream's fm_local_firstmate_state_dirs, the
same local-home set teardown reads, and a spawn that aborts before any
lease was armed skips the lease return.

Fork patch. Tracks kunchenguid#2754, kunchenguid#1924 and kunchenguid#947 (all
open); the upstream PR that carried this design, kunchenguid#2760, was closed by
its own author on 2026-09-21, not declined by the maintainer.

Upstream issue: kunchenguid#2754 (open); also kunchenguid#1924 and kunchenguid#947 (open)
Upstream PR: kunchenguid#2760 (closed unmerged by its author; the open issues above still track the defect)
(cherry picked from commit eacfbf4)

* fix(bin): lease a secondmate's worktree from its own clone (#64)

* fix(bin): lease a secondmate's worktree from its own clone

Treehouse names a pool by directory name and origin URL, not by clone
path, so a secondmate home's clone of a project shares the pool of the
main home's clone of the same origin. A spawn from the secondmate home
was handed a copy linked to the main home's clone, and Claude trust
pre-registration refused it ("is not a worktree of project"), so no
claude worker could start there.

Acquisition now holds such a copy leased while it retries, so Treehouse
cannot hand it out again and creates a copy from the spawning clone,
then returns the held copies. The trust refusal is unchanged for fresh
spawns. A relaunch of a task already recorded in another clone's copy
of the same origin registers trust against that clone, so existing work
can move to claude; an unrelated repository's copy is still refused.

Refs kunchenguid#4348

* test(pi): stop a killed fork from deleting the dead-lock fixture

The free-or-dead-lock case made its dead pid with `sleep 30 &` followed
at once by `kill`. A TERM that reaches the forked child before it drops
the suite's TERM trap runs fm_test_cleanup there, and the child shares
the suite's cleanup registry, so it deleted the fixture root while the
test kept running. CI saw the second extension load fail with
ERR_MODULE_NOT_FOUND. A child that exits on its own yields a dead pid
without sending any signal.

Upstream issue: kunchenguid#4348 (open)
Fork PR: #64
(cherry picked from commit 8cef12e)

* fix(bin): refresh the watcher beacon between slow poll phases (#65)

* fix(bin): refresh the watcher beacon between slow poll phases

A round of checks can outlast the liveness grace while the watcher is
still moving, so a live watcher is reported dead.
kunchenguid#5408

* fix(bin): treat a beacon generation change as the next poll

Mid-cycle liveness touches moved the beacon mtime during a slow round, so a cycle wait reaped the watcher before wedge classification.

Upstream issue: kunchenguid#5408 (open)
Fork PR: #65
Includes the wedge-suite fixture correction from fork PR #100 (fork commit 44a9daa), which reads a completed watcher poll from the beacon's generation rather than its modification time, because this carry refreshes that time between slow phases.
(cherry picked from commit c01eae6)

* fix(bin): carry the machine-capacity rule in every ship and scout brief (#76)

* fix(bin): carry the machine-capacity rule in every ship and scout brief

Ship and scout briefs said nothing about the heavy-run slots that every
Firstmate home on a machine shares, so each home hand-wrote its own copy
of the rule. One copy named a slot by a bare suffix, which two lanes
resolved to two different paths: each held a genuine lock and both ran
heavy suites at once.

fm-brief.sh now emits one "# Machine capacity" section in ship and scout
briefs. It spells each of this home's slot paths in full, in claim order,
states the 1-minute load bar, and sends every claim through the new
bin/fm-heavy-slot.sh. The helper claims a slot by one atomic mkdir of its
full path, records the task and a pid that lives for the whole heavy
command, and releases only the task's own slot. The slot list and load
bar come from config/heavy-suite-slots and config/heavy-suite-load.

* fix(bin): leave a project's own slot-claiming suite script unwrapped

A project on this server runs its full suite through its own script,
which claims a heavy slot by itself. Wrapped in fm-heavy-slot.sh as the
brief directed, that script would wait on the slot its own wrapper
already holds. The capacity rule now tells the worker to run such a
script as the project says instead.

Upstream issue: kunchenguid#4453 (open; a full-check limit for parallel workers on one machine)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #76
(cherry picked from commit d6d65e4)

Current successor: kunchenguid#8006 (open).

* fix(bin): serve heavy-slot waiters in arrival order and show live holders (#77)

Heavy-slot admission was bare mkdir contention, so a home whose tasks
released and retook a slot faster than another home polled could keep
it indefinitely. A waiter could not tell that starvation from honest
queuing behind working holders either: the owner pid was its only
liveness evidence, and a suite's short-lived processes leave any one pid
dead while the suite still works.

fm-heavy-slot.sh now refreshes the owner file's time while the command
runs, so its age shows a working holder even between a suite's
processes. Waiters keep a refreshed ticket in a queue beside the slots,
and a free slot goes to the longest live waiter that may use it. The new
status subcommand reads each slot as working, between commands, idle, or
stale, and the brief escalates only a holder not shown to be working.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #77
(cherry picked from commit 27b3cc2)

Current successor: kunchenguid#8006 (open).

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence (#78)

* test(heavy-slot): end fake suites when a failed test removes their directory

Two fake suites in tests/fm-heavy-slot.test.sh wait for a "go" file that
only the passing path creates. When a test failed first, the test root was
removed but the suite kept polling for a file that could no longer appear,
so it ran until someone killed it and held any pipe on the test's output
open. Each loop now also ends once its case directory is gone.

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence

Nothing could tell an abandoned heavy slot from one whose suite still ran.
The owner pid is the launcher's, and a wrapper killed outright leaves its
suite running under other pids, so a sweep keyed on a dead pid would clear
a live slot and start a second suite beside it. Slots on this machine also
came in older shapes, plain files and bare-pid owner lines, that status
lumped together as unreadable.

fm-heavy-slot.sh run now exports FM_HEAVY_SLOT_HELD=<slot>:<task> into the
heavy command, so every process the suite starts carries the claim's mark.
The new clear subcommand is for firstmate only and removes one slot only
when the record is past its bound, no recorded pid is alive, no live
process carries the mark, and no no-mistakes pipeline step runs. It checks
the record's age last, so a slot claimed again during the scans is left
alone. Status now names plain-file claims and legacy owner lines, and the
brief tells workers that only firstmate clears a slot.

* fix(bin): refuse to clear a heavy slot the helper did not mark

clear derived a claim's mark from its owner line, so a claim written by
hand in that shape, or one with no pid at all, looked as if no process
carried its mark and cleared on age alone. All three slots live on this
machine today are hand-made claims, and one records no pid, so a suite
running under it would have been invisible to every check.

Every claim fm-heavy-slot.sh makes now holds a mark file, and run exports
that file's line as the mark. clear trusts only that file; any other claim
is refused unless firstmate passes --owner-ended after confirming the
owning task has ended, and the recorded-pid, pipeline-step, and age checks
still apply.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #78
(cherry picked from commit 9430517)

Current successor: kunchenguid#8006 (open).

On macOS, clear refuses occupied slots even with --owner-ended because ps can hide a live process environment. The protected-process regression fails before this guard and passes afterward. Ordinary claim, run, and owner release are unchanged.

* fix(bin): relaunch a gone herdr worker into its own presentation space (#79)

When fm-control relaunch re-created a worker whose Herdr pane was gone,
fm-spawn always used the flat per-home container. A second mate runs
fm-control from its own pane, so the replacement tab landed inside the
second mate's own workspace instead of a presentation space of its own.

The rebind now follows the fresh-spawn placement rules in the recorded
session: the projected create moves into spawn_herdr_projection_create,
shared by both paths. A journal whose token workspace is positively gone
is retired first; a space that is still present or unreadable is left
untouched and the replacement falls back flat with a warning. A projected
replacement also gets the projection's abort cleanup.

tests/fm-control-relaunch.test.sh reproduces the defect against a
stateful stand-in Herdr. tests/fm-control-herdr-relaunch-space-e2e.test.sh
checks the same placement against real Herdr where a default session
exists, and skips elsewhere.

Upstream PR: kunchenguid#6700 (closed unmerged by its author; re-create a rebound herdr endpoint in its own presentation space)
Upstream issue: kunchenguid#5356 (open)
Fork PR: #79
Includes the Herdr fixture correction from fork PR #100 (fork commit 42f55e0): the inert opencode stand-in answers upstream's --version probe.
(cherry picked from commit 38b19bf)

* fix(bin): tell the no-mistakes validation handoff from the finished report (#86)

A no-mistakes worker was told to append done at commit time and again when
its pull request was green, so one status line could not say which event it
reported, and the handoff sentence did not name who starts the validation run.

The handoff line now opens with the fixed words 'ready for validation, not
pushed', and the instructions say that firstmate sends the /no-mistakes
instruction and the worker starts the run only then. A secondmate home no
longer publishes that handoff to its parent as finished work.

A bare done: {summary} from a worker launched on older instructions stays an
ungated handoff, as before.

Refs kunchenguid#7251

Upstream issue: kunchenguid#7251 (open)
Fork PR: #86
(cherry picked from commit 1e01205)

* fix: match Pi Codex quota accounts by recorded sign-in source (#92)

Upstream issue: kunchenguid#7483 (open)
Fork PR: #92
(cherry picked from commit 5b55c4a)

* fix(bin): read a green PR waiting on a merge as held, not finished (#75)

* fix(bin): read a green PR waiting on a merge as held, not finished

A secondmate home summary counted every in-flight child that
fm-crew-state.sh reads as done as terminal_in_flight. A no-mistakes ship
whose run passed reads done while its PR is still open and waiting on a
maintainer, so Bearings reported those homes as having unreconciled
books and the parent queued a reconcile request for each of them.

A done child whose run-step reading shows its PR still open is now a
child-state hold. Merged, closed, unknown, and status-log done readings
still count as terminal_in_flight, so a finished task that was never
cleaned up still reads as a mismatch.

* ci: expect the added Bearings regression test in the stock Bash count

The stock macOS Bash job pins the number of Bearings tests it must see.
The parked-PR regression test makes that 61.

Upstream PR: kunchenguid#7493 (open; same job), also kunchenguid#6565 (open)
Upstream issue: kunchenguid#3941 (open; related)
Fork PR: #75
(cherry picked from commit 5876427)

* fix(bin): require a handoff or disposition receipt to acknowledge a review with findings (#109)

Upstream issue: kunchenguid#8046

* fix(bin): keep a correlated reply distinct from the child's completion (#110)

Upstream issue: kunchenguid#8047

* fix(status): validate status event writes (#111)

Upstream issue: kunchenguid#8048

* fix(bin): refresh the watcher beacon between pane-scan windows (#113)

One pane scan reads every recorded window in turn. A pane seen stable for
the first time costs a current-state read, which can spend its whole
no-mistakes bound, so many windows together outlast the beacon grace while
the watcher is still working. The arm then refuses a live watcher with
"lock held by live pid ... but heartbeat is stale".

Refresh the beacon at the start of each window, as the check loop already
does between checks. One window whose reads hang past the grace still reads
stale.

Upstream issue: kunchenguid#8095

* feat(bin): deliver verified document snapshots with secondmate --doc reports (#114)

Capture document bytes before publishing a report and bind the report to their digest.
Verify remote bytes before making the snapshot available to the parent.
Preserve upstream interrupt cleanup for remote download temporary files.

Upstream PR: kunchenguid#8243
Fork PR: #114

* fix(bin): reuse unchanged pending-reply decisions within a tick (#115)

Reuse one decision fold while task status identity, contents, kind, and classification settings remain unchanged within a tick. Invalidate the cached verdict on changed evidence and keep calls outside a tick uncached.

Upstream PR: kunchenguid#8241

Fork PR: #115

* fix(bin): preserve Claude worker local settings during spawn and relaunch (#119)

* fix: preserve Claude worker settings during spawn and relaunch

* no-mistakes(test): Seed Claude worker settings from the primary clone

* no-mistakes(document): Document that local Claude settings seed workers

* fix(contributions): wake on an unanswered inline comment from an app bot

A GitHub App reviewer such as CodeRabbit posts inline findings as a Bot
account with no repository association, so the observer dropped them unless a
home listed the bot. Admit such an inline comment while its thread has no later
reply from the contribution author, and key it without the edit time so the
bot rewriting its own comment does not wake again.

* fix(pr-health): record a direct-PR ship's branch PR when no ready line names it

A direct-PR worker that reports readiness in other words, or only through a
paused merge wait, leaves no done line that a PR registration path reads, so the
task never records pr= and never arms a merge poll. The monitor already finds
the open PR on each live task copy's branch; record it through fm-pr-check.sh
for a direct-PR ship that has none. Other modes open their PR before the work
is ready, so they keep relying on their ready report.

Document both this and the app-bot inline comment admission in the
configuration reference, the script index and the ship-landing skill.

* fix(pr-health): never re-arm a merge poll on a PR whose merge was reported

After a merge the watcher retires the poll but keeps pr=, and the contribution
record can stay non-final for a pass, so branch registration skipped a PR the
merge poll already reported, as fm-pr-check.sh scan does. Also correct the
registration-scan section, which said pr= could only come from a manual run.

* ci: trigger checks after Actions were re-enabled on the fork

* no-mistakes(document): docs: state full direct-PR registration rule
tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Nov 25, 2026
…t-PR branch PRs (#120)

* fix(bin): treat a declared wait as a standing declaration, not the log's last event

`state/<id>.status` is an append-only event log, and every declared-wait
gate read it last-event-wins. A worker that appended `paused: <external
wait>` kept its wedge-alarm suppression only until the next line landed,
from anyone: its own armed background reporter, a pipeline step notice, a
firstmate note. That line became the newest event, current state flipped
away from the declaration, the possible-wedge ladder restarted from zero,
and nothing reported that the suppression had been voided.

`status_standing_wait_line` in `bin/fm-classify-lib.sh` folds the log the
way keyed decisions are already folded: a `paused:` or `captain-held:` line
declares the wait, and only a line the worker writes to say its situation
changed - `done`, `needs-decision`, `blocked`, `failed`, `resolved`, or a
replacing declaration - retracts it. `working:`, `note:` and free-text
prose leave it standing. A `resolved` line retracts a pause only when it
carries the pause's own phase key, where a keyless line is its own phase
distinct from a stated `[key=default]`, matching upstream's
`status_declared_wait_line`; a captain hold is retracted by any `resolved`
line because the hold waits on firstmate's answer. Every declared-wait
gate reads that fold: `fm-crew-state.sh`, `fm-watch.sh`,
`fm-supervise-daemon.sh`, and `fm-push-transition-lib.sh`'s Herdr fast
path. The re-surface throttle is scoped to the declaration line rather
than the status-log signature. The daemon's captain-relevance and terminal
reads, and the watcher's wedge wait evidence, keep upstream's
`status_declared_wait_line` read.

Fork patch F6. Tracks kunchenguid#2713 (open); upstream PR
kunchenguid#4811 proposes a narrower cadence fix for the same
issue. Rebuilt on upstream a8572f6, whose 5587 introduced
`status_declared_wait_line` at these gates; each conflicting gate keeps
the standing fold on top of upstream's surrounding change.

Upstream issue: kunchenguid#2713 (open)
Upstream PR: kunchenguid#4811 (open)
(cherry picked from commit 4bfc53c)

* feat(spawn): lease Treehouse copies for the task lifetime

A process-bound `treehouse get` hold lapses when no process remains in
the copy, so a later `get` could be handed a live task's recorded
worktree while that task was merely idle between turns. Its next
relaunch, teardown, or worktree read then pointed at someone else's work.

Fresh ship and scout Treehouse spawns now acquire the copy with
`treehouse get --lease --lease-holder <task-id>` from the spawning
project instead of opening a process-bound subshell in the pane. A
leased worktree is never handed out by a later `get` and never removed by
prune, even with no process running inside it, until `treehouse return` -
and teardown returns it only after the landed-work test passes.

After acquiring, spawn refuses a copy that another live task in this home
or any locally registered home already records, including pre-lease tasks
whose hold has lapsed; a relaunch of the same task reuses the copy its own
record names. The pane is then seated with a top-level `cd` into the
leased path and polled until two consecutive reads agree on it. The
pool-slot ownership claim is kept alongside the lease, because that
marker is what teardown reads to leave a reassigned slot untouched.
Upstream spawn fixtures are taught the lease so tests added after this
patch keep passing.

The occupancy walk reuses upstream's fm_local_firstmate_state_dirs, the
same local-home set teardown reads, and a spawn that aborts before any
lease was armed skips the lease return.

Fork patch. Tracks kunchenguid#2754, kunchenguid#1924 and kunchenguid#947 (all
open); the upstream PR that carried this design, kunchenguid#2760, was closed by
its own author on 2026-09-21, not declined by the maintainer.

Upstream issue: kunchenguid#2754 (open); also kunchenguid#1924 and kunchenguid#947 (open)
Upstream PR: kunchenguid#2760 (closed unmerged by its author; the open issues above still track the defect)
(cherry picked from commit eacfbf4)

* fix(bin): lease a secondmate's worktree from its own clone (#64)

* fix(bin): lease a secondmate's worktree from its own clone

Treehouse names a pool by directory name and origin URL, not by clone
path, so a secondmate home's clone of a project shares the pool of the
main home's clone of the same origin. A spawn from the secondmate home
was handed a copy linked to the main home's clone, and Claude trust
pre-registration refused it ("is not a worktree of project"), so no
claude worker could start there.

Acquisition now holds such a copy leased while it retries, so Treehouse
cannot hand it out again and creates a copy from the spawning clone,
then returns the held copies. The trust refusal is unchanged for fresh
spawns. A relaunch of a task already recorded in another clone's copy
of the same origin registers trust against that clone, so existing work
can move to claude; an unrelated repository's copy is still refused.

Refs kunchenguid#4348

* test(pi): stop a killed fork from deleting the dead-lock fixture

The free-or-dead-lock case made its dead pid with `sleep 30 &` followed
at once by `kill`. A TERM that reaches the forked child before it drops
the suite's TERM trap runs fm_test_cleanup there, and the child shares
the suite's cleanup registry, so it deleted the fixture root while the
test kept running. CI saw the second extension load fail with
ERR_MODULE_NOT_FOUND. A child that exits on its own yields a dead pid
without sending any signal.

Upstream issue: kunchenguid#4348 (open)
Fork PR: #64
(cherry picked from commit 8cef12e)

* fix(bin): refresh the watcher beacon between slow poll phases (#65)

* fix(bin): refresh the watcher beacon between slow poll phases

A round of checks can outlast the liveness grace while the watcher is
still moving, so a live watcher is reported dead.
kunchenguid#5408

* fix(bin): treat a beacon generation change as the next poll

Mid-cycle liveness touches moved the beacon mtime during a slow round, so a cycle wait reaped the watcher before wedge classification.

Upstream issue: kunchenguid#5408 (open)
Fork PR: #65
Includes the wedge-suite fixture correction from fork PR #100 (fork commit 44a9daa), which reads a completed watcher poll from the beacon's generation rather than its modification time, because this carry refreshes that time between slow phases.
(cherry picked from commit c01eae6)

* fix(bin): carry the machine-capacity rule in every ship and scout brief (#76)

* fix(bin): carry the machine-capacity rule in every ship and scout brief

Ship and scout briefs said nothing about the heavy-run slots that every
Firstmate home on a machine shares, so each home hand-wrote its own copy
of the rule. One copy named a slot by a bare suffix, which two lanes
resolved to two different paths: each held a genuine lock and both ran
heavy suites at once.

fm-brief.sh now emits one "# Machine capacity" section in ship and scout
briefs. It spells each of this home's slot paths in full, in claim order,
states the 1-minute load bar, and sends every claim through the new
bin/fm-heavy-slot.sh. The helper claims a slot by one atomic mkdir of its
full path, records the task and a pid that lives for the whole heavy
command, and releases only the task's own slot. The slot list and load
bar come from config/heavy-suite-slots and config/heavy-suite-load.

* fix(bin): leave a project's own slot-claiming suite script unwrapped

A project on this server runs its full suite through its own script,
which claims a heavy slot by itself. Wrapped in fm-heavy-slot.sh as the
brief directed, that script would wait on the slot its own wrapper
already holds. The capacity rule now tells the worker to run such a
script as the project says instead.

Upstream issue: kunchenguid#4453 (open; a full-check limit for parallel workers on one machine)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #76
(cherry picked from commit d6d65e4)

Current successor: kunchenguid#8006 (open).

* fix(bin): serve heavy-slot waiters in arrival order and show live holders (#77)

Heavy-slot admission was bare mkdir contention, so a home whose tasks
released and retook a slot faster than another home polled could keep
it indefinitely. A waiter could not tell that starvation from honest
queuing behind working holders either: the owner pid was its only
liveness evidence, and a suite's short-lived processes leave any one pid
dead while the suite still works.

fm-heavy-slot.sh now refreshes the owner file's time while the command
runs, so its age shows a working holder even between a suite's
processes. Waiters keep a refreshed ticket in a queue beside the slots,
and a free slot goes to the longest live waiter that may use it. The new
status subcommand reads each slot as working, between commands, idle, or
stale, and the brief escalates only a holder not shown to be working.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #77
(cherry picked from commit 27b3cc2)

Current successor: kunchenguid#8006 (open).

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence (#78)

* test(heavy-slot): end fake suites when a failed test removes their directory

Two fake suites in tests/fm-heavy-slot.test.sh wait for a "go" file that
only the passing path creates. When a test failed first, the test root was
removed but the suite kept polling for a file that could no longer appear,
so it ran until someone killed it and held any pipe on the test's output
open. Each loop now also ends once its case directory is gone.

* fix(bin): let firstmate clear an abandoned heavy slot only on positive evidence

Nothing could tell an abandoned heavy slot from one whose suite still ran.
The owner pid is the launcher's, and a wrapper killed outright leaves its
suite running under other pids, so a sweep keyed on a dead pid would clear
a live slot and start a second suite beside it. Slots on this machine also
came in older shapes, plain files and bare-pid owner lines, that status
lumped together as unreadable.

fm-heavy-slot.sh run now exports FM_HEAVY_SLOT_HELD=<slot>:<task> into the
heavy command, so every process the suite starts carries the claim's mark.
The new clear subcommand is for firstmate only and removes one slot only
when the record is past its bound, no recorded pid is alive, no live
process carries the mark, and no no-mistakes pipeline step runs. It checks
the record's age last, so a slot claimed again during the scans is left
alone. Status now names plain-file claims and legacy owner lines, and the
brief tells workers that only firstmate clears a slot.

* fix(bin): refuse to clear a heavy slot the helper did not mark

clear derived a claim's mark from its owner line, so a claim written by
hand in that shape, or one with no pid at all, looked as if no process
carried its mark and cleared on age alone. All three slots live on this
machine today are hand-made claims, and one records no pid, so a suite
running under it would have been invisible to every check.

Every claim fm-heavy-slot.sh makes now holds a mark file, and run exports
that file's line as the mark. clear trusts only that file; any other claim
is refused unless firstmate passes --owner-ended after confirming the
owning task has ended, and the recorded-pid, pipeline-step, and age checks
still apply.

Upstream issue: kunchenguid#4453 (open)
Upstream PR for the same job: kunchenguid#7614 (closed unmerged; superseded)
Fork PR: #78
(cherry picked from commit 9430517)

Current successor: kunchenguid#8006 (open).

On macOS, clear refuses occupied slots even with --owner-ended because ps can hide a live process environment. The protected-process regression fails before this guard and passes afterward. Ordinary claim, run, and owner release are unchanged.

* fix(bin): relaunch a gone herdr worker into its own presentation space (#79)

When fm-control relaunch re-created a worker whose Herdr pane was gone,
fm-spawn always used the flat per-home container. A second mate runs
fm-control from its own pane, so the replacement tab landed inside the
second mate's own workspace instead of a presentation space of its own.

The rebind now follows the fresh-spawn placement rules in the recorded
session: the projected create moves into spawn_herdr_projection_create,
shared by both paths. A journal whose token workspace is positively gone
is retired first; a space that is still present or unreadable is left
untouched and the replacement falls back flat with a warning. A projected
replacement also gets the projection's abort cleanup.

tests/fm-control-relaunch.test.sh reproduces the defect against a
stateful stand-in Herdr. tests/fm-control-herdr-relaunch-space-e2e.test.sh
checks the same placement against real Herdr where a default session
exists, and skips elsewhere.

Upstream PR: kunchenguid#6700 (closed unmerged by its author; re-create a rebound herdr endpoint in its own presentation space)
Upstream issue: kunchenguid#5356 (open)
Fork PR: #79
Includes the Herdr fixture correction from fork PR #100 (fork commit 42f55e0): the inert opencode stand-in answers upstream's --version probe.
(cherry picked from commit 38b19bf)

* fix(bin): tell the no-mistakes validation handoff from the finished report (#86)

A no-mistakes worker was told to append done at commit time and again when
its pull request was green, so one status line could not say which event it
reported, and the handoff sentence did not name who starts the validation run.

The handoff line now opens with the fixed words 'ready for validation, not
pushed', and the instructions say that firstmate sends the /no-mistakes
instruction and the worker starts the run only then. A secondmate home no
longer publishes that handoff to its parent as finished work.

A bare done: {summary} from a worker launched on older instructions stays an
ungated handoff, as before.

Refs kunchenguid#7251

Upstream issue: kunchenguid#7251 (open)
Fork PR: #86
(cherry picked from commit 1e01205)

* fix: match Pi Codex quota accounts by recorded sign-in source (#92)

Upstream issue: kunchenguid#7483 (open)
Fork PR: #92
(cherry picked from commit 5b55c4a)

* fix(bin): read a green PR waiting on a merge as held, not finished (#75)

* fix(bin): read a green PR waiting on a merge as held, not finished

A secondmate home summary counted every in-flight child that
fm-crew-state.sh reads as done as terminal_in_flight. A no-mistakes ship
whose run passed reads done while its PR is still open and waiting on a
maintainer, so Bearings reported those homes as having unreconciled
books and the parent queued a reconcile request for each of them.

A done child whose run-step reading shows its PR still open is now a
child-state hold. Merged, closed, unknown, and status-log done readings
still count as terminal_in_flight, so a finished task that was never
cleaned up still reads as a mismatch.

* ci: expect the added Bearings regression test in the stock Bash count

The stock macOS Bash job pins the number of Bearings tests it must see.
The parked-PR regression test makes that 61.

Upstream PR: kunchenguid#7493 (open; same job), also kunchenguid#6565 (open)
Upstream issue: kunchenguid#3941 (open; related)
Fork PR: #75
(cherry picked from commit 5876427)

* fix(bin): require a handoff or disposition receipt to acknowledge a review with findings (#109)

Upstream issue: kunchenguid#8046

* fix(bin): keep a correlated reply distinct from the child's completion (#110)

Upstream issue: kunchenguid#8047

* fix(status): validate status event writes (#111)

Upstream issue: kunchenguid#8048

* fix(bin): refresh the watcher beacon between pane-scan windows (#113)

One pane scan reads every recorded window in turn. A pane seen stable for
the first time costs a current-state read, which can spend its whole
no-mistakes bound, so many windows together outlast the beacon grace while
the watcher is still working. The arm then refuses a live watcher with
"lock held by live pid ... but heartbeat is stale".

Refresh the beacon at the start of each window, as the check loop already
does between checks. One window whose reads hang past the grace still reads
stale.

Upstream issue: kunchenguid#8095

* feat(bin): deliver verified document snapshots with secondmate --doc reports (#114)

Capture document bytes before publishing a report and bind the report to their digest.
Verify remote bytes before making the snapshot available to the parent.
Preserve upstream interrupt cleanup for remote download temporary files.

Upstream PR: kunchenguid#8243
Fork PR: #114

* fix(bin): reuse unchanged pending-reply decisions within a tick (#115)

Reuse one decision fold while task status identity, contents, kind, and classification settings remain unchanged within a tick. Invalidate the cached verdict on changed evidence and keep calls outside a tick uncached.

Upstream PR: kunchenguid#8241

Fork PR: #115

* fix(bin): preserve Claude worker local settings during spawn and relaunch (#119)

* fix: preserve Claude worker settings during spawn and relaunch

* no-mistakes(test): Seed Claude worker settings from the primary clone

* no-mistakes(document): Document that local Claude settings seed workers

* fix(contributions): wake on an unanswered inline comment from an app bot

A GitHub App reviewer such as CodeRabbit posts inline findings as a Bot
account with no repository association, so the observer dropped them unless a
home listed the bot. Admit such an inline comment while its thread has no later
reply from the contribution author, and key it without the edit time so the
bot rewriting its own comment does not wake again.

* fix(pr-health): record a direct-PR ship's branch PR when no ready line names it

A direct-PR worker that reports readiness in other words, or only through a
paused merge wait, leaves no done line that a PR registration path reads, so the
task never records pr= and never arms a merge poll. The monitor already finds
the open PR on each live task copy's branch; record it through fm-pr-check.sh
for a direct-PR ship that has none. Other modes open their PR before the work
is ready, so they keep relying on their ready report.

Document both this and the app-bot inline comment admission in the
configuration reference, the script index and the ship-landing skill.

* fix(pr-health): never re-arm a merge poll on a PR whose merge was reported

After a merge the watcher retires the poll but keeps pr=, and the contribution
record can stay non-final for a pass, so branch registration skipped a PR the
merge poll already reported, as fm-pr-check.sh scan does. Also correct the
registration-scan section, which said pr= could only come from a manual run.

* ci: trigger checks after Actions were re-enabled on the fork

* no-mistakes(document): docs: state full direct-PR registration rule
Upstream issue: maps to kunchenguid#8753 (app-bot inline comments)
Upstream issue: maps to kunchenguid#8754 (direct-PR branch PR record)
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.

1 participant