Skip to content

feat: park workers awaiting external GitHub PR changes - #7578

Closed
mikaelz wants to merge 6 commits into
kunchenguid:mainfrom
mikaelz:fm/fm-velocity-f7
Closed

mikaelz wants to merge 6 commits into
kunchenguid:mainfrom
mikaelz:fm/fm-velocity-f7

Conversation

@mikaelz

@mikaelz mikaelz commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Velocity audit fix F7 "Firstmate: park external waits without a live session", selected by the captain on the velocity audit page, then "firstmate fixes A": deliver each firstmate fix as its own upstream pull request.

The audit describes F7 as: A task waiting on a maintainer or fork-CI approval should drop its session; the watcher polls gh pr checks and respawns when something changes. The no-mistakes eval worker polled every 55 min for about 45 hours.

A scout already wrote and tested the change as a patch. This is the first slice the scout delivered:

  • New bin/fm-pr-park.sh with park/changed/resume-note/unpark, built on the existing fm-procevent-when condition->action watch and fm-control exit/relaunch. park <id> <pr-url> records the PR fingerprint in state/.park, arms watch when-park- (poll every 300 s, fire on first change), then stops the worker with fm-control exit, keeping endpoint, worktree, and uncommitted work; it refuses a non-GitHub PR, a secondmate, an already-parked task, and an unreadable PR, and rolls back if the watch cannot be armed or the worker cannot be stopped. The fingerprint is PR state, head commit, review decision, review count, comment count, and every check reduced to pending or its result. changed <id> is the condition (0 changed, 1 unchanged, 2 error); resume-note <id> is the action and writes data//park-resume.md; unpark <id> retires the watch and removes the record, idempotently.
  • Teardown unparks a task that has a park record, so a watch never outlives its task.
  • Brief pause wording: when only a person outside the fleet can clear a wait on the worker's PR, the worker names the PR URL in its paused: line and ends its turn instead of reattaching a blocking command.
  • Skill and docs updates (ship-landing holds the park rule, validation-supervision points fork-CI waits at it, process-event-sources says a when-park- result means relaunch per the script header; docs/scripts.md inventory row), and tests.

Firstmate relaunches the worker on the watch wake (fm-control relaunch with the resume note, then unpark, then acknowledge the result). Automatic respawn, quiet parking in the watcher, other forges and automatic parking are out of scope; describe them in the PR description as the follow-up design: automatic respawn by making the watch action the relaunch once refusals can be surfaced; quiet parking by treating a valid park record as an authoritative wait in the watcher's pause resurfacing; GitLab, Forgejo, and Gerrit fingerprints through the existing PR readers; automatic park on the paused line.

What Changed

  • Add fm-pr-park.sh to stop ship/scout sessions while awaiting external GitHub PR changes, retain their work, poll PR fingerprints every 300 seconds, and write a resume note for Firstmate-managed relaunch.
  • Retire park watches during teardown; update briefs, supervision guidance, and documentation, with tests covering fingerprints, refusals, rollback, resume notes, and cleanup.
  • Follow-up design: automatic relaunch once refusals can be surfaced; quiet parking through authoritative park records; GitLab, Forgejo, and Gerrit fingerprints through existing PR readers; automatic parking from paused lines.

Risk Assessment

✅ Low: The change is bounded, follows the accepted intent and recorded decisions, and uses existing lifecycle and watch interfaces without substantiated material defects.

Testing

Targeted regressions and isolated live CLI scenarios passed using real lifecycle scripts and gh against disposable PR responses. Cursor proved full worker resumption after Codex trust blocked setup. CLI transcripts and generated instructions were retained; no visual layout changed. All disposable resources were removed.

  • Live validation: ✅ go - 12 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Park a running worker while preserving its endpoint and uncommitted work ✅ pass live round2-cursor-live.txt: stopped labpark; private endpoint and uncommitted file retained
Relaunch with the generated resume note and resume actual task processing ✅ pass live round2-cursor-live.txt: relaunched labpark and RESUMED TASK FILE: RESUMED; round2-cursor-after.txt
Detect meaningful PR changes while ignoring a pending check starting to run ✅ pass live round2-cursor-live.txt: unchanged and IN_PROGRESS return 1; PR state, head, review decision, review count, comment count, and completed check mutations return 0
Run the registered watch and generate a resume note on its first detected change ✅ pass live round2-cursor-live.txt: registered watch produces fired and writes the baseline/current resume note
Fail PR reads and expire a watch without triggering task resumption ✅ pass live round2-park-diagnostics.txt: condition-error and never-true; no resume note; park record retained
Reject unsupported or invalid parking requests without stopping unrelated work ✅ pass live round2-cursor-live.txt: unknown task, non-GitHub URL, secondmate, unreadable PR, and duplicate park refusals
Roll back parking when worker exit or watch registration fails ✅ pass live round2-cursor-live.txt: invalid endpoint rolls back; conflicting watch refuses registration and removes the staged park record
Retire a parked wait and acknowledge its result idempotently ✅ pass live round2-cursor-live.txt: repeated unpark succeeds; repeated acknowledgement returns already-handled
Park a maximum-length task ID within the source-name limit ✅ pass live round2-cursor-live.txt: 64-character task ID parks and unparks through the real watch registry
Park successfully with FM_HOME unset ✅ pass live round2-default-home.txt: FM_HOME unset; real control accepts the resolved marked default home
Clean up a parked task without leaving its watch registered ✅ pass live round2-park-teardown-live.txt: task metadata, park record, and registered wait removed
Generate worker instructions containing the external-PR pause rule and waiting exception ✅ pass live round2-generated-scout-brief.md
Evidence: Live park, change detection, and successful worker resumption

Source: Live park, change detection, and successful worker resumption

$ gh pr view https://github.com/acme/widget/pull/42 --json state,headRefOid,reviewDecision,statusCheckRollup,comments,reviews
exit=0
{"comments":[],"headRefOid":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","reviewDecision":"","reviews":[],"state":"OPEN","statusCheckRollup":[{"__typename":"CheckRun","completedAt":"0001-01-01T00:00:00Z","conclusion":"","detailsUrl":"","name":"test","startedAt":"0001-01-01T00:00:00Z","status":"QUEUED","workflowName":""}]}

$ tmux -L fm-lab new-session -d -s lab -n fm-labpark -x 120 -y 40 -c ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF
exit=0

$ tmux -L fm-lab display-message -p #{socket_path}
exit=0
~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/t/tmux-1000/fm-lab

$ tmux -L fm-lab send-keys -t lab:fm-labpark cd ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work && env -u HTTPS_PROXY -u SSL_CERT_FILE /usr/bin/cursor-agent --trust --yolo --workspace ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work 'Reply READY. Do not use tools.' Enter
exit=0

$ tmux -L fm-lab capture-pane -p -t lab:fm-labpark
exit=0
/ 	31%
/home 	84%
cd ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work && env -u HTTPS_PROXY -u SSL_CERT_F
ILE /usr/bin/cursor-agent --trust --yolo --workspace ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FA
HJWVYF/.c/work 'Reply READY. Do not use tools.'
7:40:39 mike@mike-pc:4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF wt:2 $ cd ~/.no-mistakes/worktrees/4e4f35680e79/01
M5NE3CGFXBCW16A0FAHJWVYF/.c/work && env -u HTTPS_PROXY -u SSL_CERT_FILE /usr/bin/cursor-agent --trust --yolo --workspace
 ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work 'Reply READY. Do not use tools.'


  Cursor Agent
  v2026.10.22-27dcf5f
  Tip: Hit shift+tab to enable Plan Mode for large or complex changes.


  Reply READY. Do not use tools.


  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ … Thought for 3.2s                                                                                               │
  │ The user requested a READY reply without using tools.                                                            │
  │                                                                                                                  │
  │ I considered whether to address the user as "captain" under the Firstmate AGENTS.md rules, but the instruction   │
  │ is                                                                                                               │
  │ simple enough to follow directly.                                                                                │
  │                                                                                                                  │
  │ I will include "captain" in the response to satisfy the Firstmate rule, likely as "Captain, READY."              │
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  READY, captain.




  → Add a follow-up


  Auto · 10%                                                                               Run Everything -- INSERT --
  ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work · labpark


$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=0
stopped labpark harness=cursor backend=tmux endpoint=lab:fm-labpark worktree=~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work
parked: labpark on https://github.com/acme/widget/pull/42
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c

PARK RECORD:
fm-pr-park-v1
https://github.com/acme/widget/pull/42
OPEN aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  0 0 test=pending

$ tmux -L fm-lab list-windows -t lab
exit=0
0: fm-labpark* (1 panes) [120x40] [layout {"V":2,"L":{"t":"p","w":120,"h":40,"x":0,"y":0,"a":true,"i":0,"I":"%0"}}] @0 (active)

$ bin/fm-procevent.sh list
exit=0
SOURCE                       ADAPTER      OWNER      PENDING
when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 when         none       0

$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=1
error: fm-pr-park: labpark is already parked; unpark it first

$ bin/fm-pr-park.sh changed labpark
exit=1

$ bin/fm-pr-park.sh changed labpark
exit=1

API mutation: state
$ bin/fm-pr-park.sh changed labpark
exit=0

API mutation: headRefOid
$ bin/fm-pr-park.sh changed labpark
exit=0

API mutation: reviewDecision
$ bin/fm-pr-park.sh changed labpark
exit=0

API mutation: reviews
$ bin/fm-pr-park.sh changed labpark
exit=0

API mutation: comments
$ bin/fm-pr-park.sh changed labpark
exit=0

$ bin/fm-pr-park.sh changed labpark
exit=0

$ bin/fm-pr-park.sh changed labpark
exit=2

$ bin/fm-procevent.sh reconcile
exit=0
reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0

CAPTURED RESULT:
when: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28
status: fired
detail: the condition held and the action exited 0
condition_polls: 1
action_exit: 0
output:
~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/data/labpark/park-resume.md

$ bin/fm-procevent-when.sh classify ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/procevent-inbox/when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28.1.result
exit=0
fired

RESUME NOTE:
Your session was parked while you waited on an external change to https://github.com/acme/widget/pull/42.
That pull request changed while you were parked.
Before: OPEN aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  0 0 test=pending
Now: OPEN aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  0 0 test=success
Read the change, reattach to any active no-mistakes run with `no-mistakes axi run`, and continue the task under your brief.

$ tmux -L fm-lab send-keys -t lab:fm-labpark cd ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work Enter
exit=0

$ bin/fm-control.sh labpark relaunch --note-file ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/data/labpark/park-resume.md
exit=0
relaunched labpark harness=cursor from=cursor model=default effort=default backend=tmux endpoint=lab:fm-labpark worktree=~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  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.
●  After draining queued wakes, repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNING: queued wakes pending - drain them with bin/fm-wake-drain.sh before anything else.

RESUMED TASK FILE: RESUMED

$ tmux -L fm-lab capture-pane -p -t lab:fm-labpark
exit=0
  │ handled/, and reply RESUMED. I noticed a contradiction between the instruction to avoid external tools and the   │
  │ requirement to check the inbox and reattach to no-mistakes.                                                      │
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  Checking the steering inbox first, then continuing the relaunch brief.

  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ … Thought for 7.2s                                                                                               │
  │ ... (5 lines hidden above) · ctrl+o to expand                                                                    │
  │ The pull request status changed from pending to success. The task requires writing RESUMED to resumed.txt and    │
  │ replying RESUMED. No other commands or external tools should be run.                                             │
  │                                                                                                                  │
  │ Reconsidering whether to run no-mistakes axi run despite the instruction to avoid other commands. The core       │
  │ task                                                                                                             │
  │ remains writing RESUMED to resumed.txt and replying RESUMED. This appears to be a disposable resume test.        │
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  $ find '~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/labpark.inbox' -maxdepth
    1 -name '*.msg' 2>/dev/null | sort -V && ls -la
    '~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/labpark.inbox/' 2>/dev/null;
    ls -la .; cat resumed.txt 2>/dev/null; cat uncommitted.txt 2>/dev/null 712ms
    … 4 output lines hidden · ctrl+o to expand
    -rw-r--r-- 1 mike users   31 Oct 24 07:40 uncommitted.txt
    preserve this uncommitted work

  Inbox is empty. Writing RESUMED per the brief.

    Edited resumed.txt +1

    ▎    1 + RESUMED

 ⠰⠳ Editing  522 tokens


  → Add a follow-up                                                                                     ctrl+c to stop


  Auto · 10.8% · 1 file edited                                                             Run Everything -- INSERT --
  ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work · labpark


$ bin/fm-pr-park.sh unpark labpark
exit=0
unparked: labpark

$ bin/fm-pr-park.sh unpark labpark
exit=0
unparked: labpark

$ bin/fm-procevent.sh handled when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 1
exit=0
handled: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 1

$ bin/fm-procevent.sh handled when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 1
exit=0
already-handled: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 1

$ bin/fm-pr-park.sh park unknown https://github.com/acme/widget/pull/42
exit=1
error: fm-pr-park: no task record for unknown in this home

$ bin/fm-pr-park.sh park labpark https://gitlab.com/acme/widget/-/merge_requests/42
exit=1
error: fm-pr-park: only GitHub pull requests can be parked: https://gitlab.com/acme/widget/-/merge_requests/42

$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=1
error: fm-pr-park: only a ship or scout worker can be parked; labpark is kind=secondmate

$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=1
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c
REFUSED: tmux endpoint 'lab:fm-wrong' is malformed or does not belong to task labpark; preserving task state.
error: fm-pr-park: cannot stop the worker for labpark; the park was rolled back and the worker keeps its session

$ bin/fm-procevent.sh list
exit=0
no sources registered

$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=1
error: fm-pr-park: cannot read pull request https://github.com/acme/widget/pull/42

$ tmux -L fm-lab new-window -t lab -n fm-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -c ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work
exit=0

$ bin/fm-pr-park.sh park xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx https://github.com/acme/widget/pull/42
exit=0
already-stopped xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx harness=cursor backend=tmux endpoint=lab:fm-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx worktree=~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work
parked: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx on https://github.com/acme/widget/pull/42
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c

$ bin/fm-procevent.sh list
exit=0
SOURCE                       ADAPTER      OWNER      PENDING
when-park-7ce100971f64e7001e8fe5a51973ecdfe1ced42befe7ee8d5fd621 when         none       0

$ bin/fm-pr-park.sh unpark xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
exit=0
unparked: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

$ bin/fm-procevent-when.sh arm park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28 --condition ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh changed labpark --action ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh resume-note labpark
exit=0
armed: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path

$ bin/fm-pr-park.sh park labpark https://github.com/acme/widget/pull/42
exit=1
error: watch already exists or left state behind: ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/when/when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28.spec (retire it first)
error: fm-pr-park: cannot arm the park watch for labpark; the worker keeps its session

$ bin/fm-procevent-when.sh retire park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28
exit=0
retired: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28
retired: when-park-e4b8a68a5fdbb78cef8be11861d6bb8bbf5abdc0da28e91ab73f28

ALL DRIVEN CONTRACT ASSERTIONS PASSED
RESUME_PROOF=True
CLEANUP: private tmux server stopped; disposable home removed
Evidence: Replacement worker creates RESUMED and preserves uncommitted work

Source: Replacement worker creates RESUMED and preserves uncommitted work

  │ handled/, and reply RESUMED. I noticed a contradiction between the instruction to avoid external tools and the   │
  │ requirement to check the inbox and reattach to no-mistakes.                                                      │
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  Checking the steering inbox first, then continuing the relaunch brief.

  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ … Thought for 7.2s                                                                                               │
  │ ... (5 lines hidden above) · ctrl+o to expand                                                                    │
  │ The pull request status changed from pending to success. The task requires writing RESUMED to resumed.txt and    │
  │ replying RESUMED. No other commands or external tools should be run.                                             │
  │                                                                                                                  │
  │ Reconsidering whether to run no-mistakes axi run despite the instruction to avoid other commands. The core       │
  │ task                                                                                                             │
  │ remains writing RESUMED to resumed.txt and replying RESUMED. This appears to be a disposable resume test.        │
  └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  $ find '~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/labpark.inbox' -maxdepth
    1 -name '*.msg' 2>/dev/null | sort -V && ls -la
    '~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/state/labpark.inbox/' 2>/dev/null;
    ls -la .; cat resumed.txt 2>/dev/null; cat uncommitted.txt 2>/dev/null 712ms
    … 4 output lines hidden · ctrl+o to expand
    -rw-r--r-- 1 mike users   31 Oct 24 07:40 uncommitted.txt
    preserve this uncommitted work

  Inbox is empty. Writing RESUMED per the brief.

    Edited resumed.txt +1

    ▎    1 + RESUMED

 ⠰⠳ Editing  522 tokens


  → Add a follow-up                                                                                     ctrl+c to stop


  Auto · 10.8% · 1 file edited                                                             Run Everything -- INSERT --
  ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.c/work · labpark
Evidence: API-error and deadline outcomes

Source: API-error and deadline outcomes

$ bin/fm-procevent-when.sh arm api-error --interval 0.1 --stable 1 --condition ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh changed diagnostic --action ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh resume-note diagnostic
exit=0
armed: when-api-error
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
$ bin/fm-procevent.sh reconcile
exit=0
reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0
CAPTURED RESULT:
when: when-api-error
status: condition-error
detail: the condition exited 2 on 3 consecutive polls; the action was not run
condition_polls: 3
output:
$ bin/fm-procevent-when.sh classify ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.d/state/procevent-inbox/when-api-error.1.result
exit=0
condition-error
$ bin/fm-procevent.sh handled when-api-error 1
exit=0
handled: when-api-error 1
$ bin/fm-procevent-when.sh retire api-error
exit=0
retired: when-api-error
retired: when-api-error
$ bin/fm-procevent-when.sh arm deadline --interval 0.1 --stable 1 --deadline 1 --condition ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh changed diagnostic --action ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh resume-note diagnostic
exit=0
armed: when-deadline
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
$ bin/fm-procevent.sh reconcile
exit=0
reconciled: published=0 started=1 stopped=0 uncertain=0 failed=0
CAPTURED RESULT:
when: when-deadline
status: never-true
detail: the condition never held for 1 consecutive polls within 1s of arming
condition_polls: 3
output:
$ bin/fm-procevent-when.sh classify ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.d/state/procevent-inbox/when-deadline.1.result
exit=0
never-true
$ bin/fm-procevent.sh handled when-deadline 1
exit=0
handled: when-deadline 1
$ bin/fm-procevent-when.sh retire deadline
exit=0
retired: when-deadline
retired: when-deadline
$ bin/fm-procevent.sh list
exit=0
no sources registered
OBSERVED: neither API failure nor deadline ran the resume-note action. Park record retained.
CLEANUP: API endpoint stopped; disposable home removed.
Evidence: Default-home parking

Source: Default-home parking

$ tmux -L fm-lab new-session -d -s defaultproof -n fm-defaultproof -x 120 -y 40 -c ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF
exit=0
$ tmux -L fm-lab display-message -p #{socket_path}
exit=0
~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.f/t/tmux-1000/fm-lab
$ ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.f/bin/fm-pr-park.sh park defaultproof https://github.com/acme/widget/pull/42
exit=0
already-stopped defaultproof harness=codex backend=tmux endpoint=defaultproof:fm-defaultproof worktree=~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.f/work
parked: defaultproof on https://github.com/acme/widget/pull/42
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.f
$ ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.f/bin/fm-pr-park.sh unpark defaultproof
exit=0
unparked: defaultproof
OBSERVED: FM_HOME unset; real control accepted the resolved default marked lab home.
CLEANUP: endpoint and disposable home removed.
Evidence: Task cleanup retires its PR watch

Source: Task cleanup retires its PR watch

$ bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e
exit=0
~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e
$ tmux -L fm-lab new-session -d -s cleanup -n fm-cleanup -x 120 -y 40 -c ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF
exit=0
$ tmux -L fm-lab display-message -p #{socket_path}
exit=0
~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e/t/tmux-1000/fm-lab
$ bin/fm-procevent-when.sh arm park-611496f412cac947be720d17a0ee6d7463221d14731fbc18244756 --interval 300 --stable 1 --condition ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh changed cleanup --action ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/bin/fm-pr-park.sh resume-note cleanup
exit=0
armed: when-park-611496f412cac947be720d17a0ee6d7463221d14731fbc18244756
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
$ bin/fm-teardown.sh cleanup
exit=0
teardown cleanup complete (window cleanup:fm-cleanup, worktree ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e/vanished-work)
Backlog: cleanup just finished (this home keeps no markdown backlog at ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e/data/backlog.md). Update ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e/data/backlog.md - move cleanup 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.
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/4e4f35680e79/01M5NE3CGFXBCW16A0FAHJWVYF/.e
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  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.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$ bin/fm-procevent.sh list
exit=0
no sources registered
OBSERVED: task metadata, park record and registered wait all removed.
private tmux kill-server exit=1
CLEANUP: disposable home removed.
Evidence: Validation setup, limitations, and cleanup record

Source: Validation setup, limitations, and cleanup record

Live validation of 6a3b900a289eebc74cc3c859ab99fe07634257bb

The real fm-pr-park, fm-control, fm-procevent-when, fm-procevent and fm-teardown scripts ran in disposable marked lab homes under the gate worktree, with private 120-column x 40-row tmux sessions. The real gh CLI read deterministic PR responses from a disposable local TLS API fixture. No GitHub PR was changed.

Full running-worker proof used the installed authenticated Cursor CLI with its invocation-scoped --trust option. Transcript round2-cursor-live.txt records stopped, fired, relaunched, and the worker-created resumed.txt content RESUMED. round2-cursor-after.txt captures its actual editing output and the preserved uncommitted.txt content. Neither the worker CLI nor the lifecycle scripts were substituted. Initial Codex attempts, including invocation-only project trust settings and --no-daemon, stopped at folder trust; they are setup limitations, superseded for the required runtime-independent proof by the successful Cursor run. No persistent trust was approved manually.

Targeted regression command completed exit 0:
  bin/fm-test-run.sh tests/fm-pr-park.test.sh tests/fm-brief.test.sh tests/fm-teardown.test.sh

Additional executed evidence drivers (all completed exit 0 after correcting disposable setup):
  python3 <evidence>/round2-driver-cursor.py
  python3 <evidence>/round2-driver-diagnostic.py
  python3 <evidence>/round2-driver-cleanup.py
  python3 <evidence>/round2-driver-default.py

The default-home driver copies the unchanged real bin directory into a marked lab home and invokes its park script with FM_HOME unset; no lifecycle substitutes are used. Its initial attempt lacked a worktree identity and safely rolled back; adding a real disposable git repository resolved that setup error.

The generated scout brief is retained as the emitted public instruction contract. The task scope changes command-line behavior and generated instructions, with no visual layout change.

Every driver stopped its private server/API endpoint and removed its lab home in finally cleanup. Transient certificate, API and wrapper directories were then removed from the worktree. No source modifications were made.
  • Outcome: 🔧 1 issue found → no changes applied ✅ across 2 runs (17m13s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

🔧 **Rebase** - 1 issue found → auto-fixed ✅
  • ⚠️ bin/fm-brief.sh - merge conflict rebasing onto origin/main

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

✅ **Review** - passed

✅ No issues found.

🔧 **Test** - 1 issue found → no changes applied ✅
  • ⚠️ live validation verdict: inconclusive (11 of 12 scenarios were driven live against the product); untested: Stop a running worker and resume task processing after relaunch
  • Live validation: ⚠️ inconclusive - 11 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Park an already-stopped worker while preserving its endpoint and uncommitted work ✅ pass live Live parking and PR-change transcript
Detect PR state, head, review, comment and completed-check changes while ignoring queued-to-running transitions ✅ pass live Live parking and PR-change transcript
Run the registered monitor after a PR change and capture a fired result with a resume note ✅ pass live Live parking and PR-change transcript; Generated resume note
Refuse unknown tasks, secondmates, non-GitHub PRs and duplicate parking ✅ pass live Live parking and PR-change transcript
Refuse unreadable PRs and return condition-error status rather than treating read failure as change ✅ pass live Live parking and PR-change transcript
Roll back parking when registration or worker-stop validation refuses ✅ pass live Live parking and PR-change transcript
Park and unpark a 64-character task ID using a bounded source name ✅ pass live Live parking and PR-change transcript
Classify repeated API failures and deadline expiry without running the resume-note action ✅ pass live Error and deadline outcomes
Repeat unpark and result acknowledgement safely ✅ pass live Live parking and PR-change transcript
Clean up a task whose workspace disappeared and retire its remaining PR wait ✅ pass live Live task cleanup
Generate scout instructions containing the external-PR pause rule and waiting exception ✅ pass live Generated scout instructions; bash tests/fm-brief.test.sh
Stop a running worker and resume task processing after relaunch ⏸️ untested no Launched real Codex in a disposable git worktree on a private 120×40 tmux terminal. Initial launch and replacement reached the persistent folder-trust dialog; lifecycle control correctly refused the u…
  • bash tests/fm-pr-park.test.sh
  • bash tests/fm-brief.test.sh
  • test_parked_task_watch_retires_with_teardown via a temporary focused selector
  • python3 .live-park/live.py: real product scripts and GitHub CLI against a disposable local TLS API, with private tmux endpoints
  • python3 .live-park/diagnostic.py: captured condition-error and deadline outcomes
  • python3 .live-park/cleanup.py: real task cleanup with a vanished workspace
  • FM_HOME=&#34;$PWD/.b&#34; bin/fm-brief.sh emitted fixture --scout with wait-no-turns enabled
  • Removed disposable homes and temporary drivers; confirmed clean git status and no remaining named lab tmux launch processes

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 12 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Park a running worker while preserving its endpoint and uncommitted work ✅ pass live round2-cursor-live.txt: stopped labpark; private endpoint and uncommitted file retained
Relaunch with the generated resume note and resume actual task processing ✅ pass live round2-cursor-live.txt: relaunched labpark and RESUMED TASK FILE: RESUMED; round2-cursor-after.txt
Detect meaningful PR changes while ignoring a pending check starting to run ✅ pass live round2-cursor-live.txt: unchanged and IN_PROGRESS return 1; PR state, head, review decision, review count, comment count, and completed check mutations return 0
Run the registered watch and generate a resume note on its first detected change ✅ pass live round2-cursor-live.txt: registered watch produces fired and writes the baseline/current resume note
Fail PR reads and expire a watch without triggering task resumption ✅ pass live round2-park-diagnostics.txt: condition-error and never-true; no resume note; park record retained
Reject unsupported or invalid parking requests without stopping unrelated work ✅ pass live round2-cursor-live.txt: unknown task, non-GitHub URL, secondmate, unreadable PR, and duplicate park refusals
Roll back parking when worker exit or watch registration fails ✅ pass live round2-cursor-live.txt: invalid endpoint rolls back; conflicting watch refuses registration and removes the staged park record
Retire a parked wait and acknowledge its result idempotently ✅ pass live round2-cursor-live.txt: repeated unpark succeeds; repeated acknowledgement returns already-handled
Park a maximum-length task ID within the source-name limit ✅ pass live round2-cursor-live.txt: 64-character task ID parks and unparks through the real watch registry
Park successfully with FM_HOME unset ✅ pass live round2-default-home.txt: FM_HOME unset; real control accepts the resolved marked default home
Clean up a parked task without leaving its watch registered ✅ pass live round2-park-teardown-live.txt: task metadata, park record, and registered wait removed
Generate worker instructions containing the external-PR pause rule and waiting exception ✅ pass live round2-generated-scout-brief.md
  • bin/fm-test-run.sh tests/fm-pr-park.test.sh tests/fm-brief.test.sh tests/fm-teardown.test.sh — exit 0
  • python3 ~/.no-mistakes/evidence/01M5NE3CGFXBCW16A0FAHJWVYF/round2-driver-cursor.py — exit 0
  • python3 ~/.no-mistakes/evidence/01M5NE3CGFXBCW16A0FAHJWVYF/round2-driver-diagnostic.py — exit 0
  • python3 ~/.no-mistakes/evidence/01M5NE3CGFXBCW16A0FAHJWVYF/round2-driver-cleanup.py — exit 0
  • python3 ~/.no-mistakes/evidence/01M5NE3CGFXBCW16A0FAHJWVYF/round2-driver-default.py — exit 0 after correcting disposable metadata
  • Codex live attempts with invocation-only trust settings and --no-daemon; folder-trust blocker avoided by using authenticated Cursor
  • FM_HOME=&lt;disposable-lab&gt; bin/fm-brief.sh pause-proof widget --scout with wait-no-turns enabled; retained emitted instructions
  • Verified disposable processes stopped, removed transient setup directories, and confirmed a clean working tree
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@mikaelz

mikaelz commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

The failing Behavior tests (Herdr) check is not related to this PR.

  • Failing test: tests/fm-backend-herdr-presentation-e2e.test.sh, case concurrent secondmate recovery failed, with error: herdr presentation recovery could not acquire its session lock; refusing a concurrent resume (job log).
    The rm: ... Permission denied lines come after the failure, during the test's cleanup.
  • This PR does not change that test, Herdr presentation recovery, or the session lock.
    The new fm-pr-park.sh unpark call in teardown runs only for a task with a park record, and this test creates none.
  • The same case fails the same way on six unrelated PRs in this repository: CI runs 39436949332, 39421951978, 39409508866, 39397929699, 39396132062, and 39327950180 (branches fm/board-risk-plakette-20261019, fm/fm-7296-mouse-noise-clear, fm/fm-crew-state-run-attribution-fix, fm/fm-97-upstream-part3, fm/review-feedback-at-ci-gate, fm/fm-upstream-issues-check).
  • Local runs on herdr 0.9.5 in an isolated lab session both pass with 25 ok and exit 0: one at this PR's head f9b88216, one at upstream main 3eabd356.

The evidence points to an intermittent lock-contention race in that test, not to a regression from this change.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mikaelz. Dropping a session that only waits on a maintainer is a real token and attention win, and fm-pr-park.sh is carefully built. It refuses unsupported cases, rolls back when it can't arm the watch or stop the worker, uses a private record file, and teardown retires the watch. I reviewed head f9b88216 against current main 3eabd356. It's mergeable, the no-mistakes attestation binds this head, and the diff has no workflow or CI-script changes and nothing that touches secrets.

This is waiting on you. Here's what's needed:

  1. Live validation of the resume. The pipeline reports 8 of 9 scenarios live. The untested one, a relaunch from the generated resume note followed by the worker actually continuing, is the payoff of this whole feature. Could you drive it live and post the evidence here, or re-raise through no-mistakes with it covered? For example: park a real worker on a scratch PR, change the PR, let the watch fire, fm-control.sh relaunch --note-file with the note, unpark, and show the worker continuing. Pre-trusting the lab folder in the harness should get past the folder-trust dialog.
  2. CI. Behavior tests (Herdr) failed in tests/fm-backend-herdr-presentation-e2e.test.sh ("concurrent secondmate recovery"). Your evidence, the same failure on six unrelated PRs plus local passes on both this head and main, makes a pre-existing flake plausible, and I'm not holding that against the PR. It still needs a green run before this can move, and a fresh push for item 1 will retrigger CI.

Contract-class: new-default. The opt-in part is narrow: fm-pr-park.sh only runs when firstmate calls it. But this PR also changes default instructions. The worker brief's pause section, which every crewmate gets, now tells workers to end their turn instead of reattaching a blocking wait, "even a no-mistakes drive call". ship-landing and validation-supervision tell firstmate to park workers on external PR waits. The unconfigured fleet would behave differently, so once otherwise ready this goes to Kun for a merge-or-leave call. It won't auto-merge. (The title and the "selected by the captain" intent are noted, but they don't decide the class.)

VISION.md, rule by rule

  • One captain, one interface: aligns. Parked waits are silent, and the wake comes only when the PR changes.
  • Authority is explicit and never inferred: aligns. Park stops a session but keeps the endpoint, worktree and uncommitted work, and relaunch stays a firstmate step.
  • Scripts own the mechanics, agents own the judgment: aligns. The fingerprint and watch are exact, and firstmate decides when to park and relaunch.
  • A restart is a non-event: aligns. There's a durable park record and watch, and teardown retires them.
  • Delegation with a spine: aligns in intent. The resume step that hands the task back is the part without live proof yet (item 1).
  • The fleet outlives any vendor: partially. It's GitHub-only, with other forges left as stated follow-up design, and it refuses non-GitHub PRs rather than misbehaving.
  • Scope: aligns. Command-layer session management. CI is still read from the forge, not reimplemented.

Overlap: your #7048 also edits bin/fm-teardown.sh and tests/fm-teardown.test.sh, for a different concern, so expect a small conflict for whichever lands second. #7560 also edits .agents/skills/ship-landing/SKILL.md (different lines). #7045 and #7119 add a different fm-control park verb for stopped seats. The naming is close, so please make sure the two "park" ideas stay distinguishable in docs. No file overlap with #6129.

@mikaelz mikaelz changed the title feat(bin): park workers during external GitHub PR waits feat: park workers during external GitHub PR waits Oct 21, 2026
@mikaelz

mikaelz commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Live resume validation (the scenario that was untested)

This run used a real Claude worker in an isolated lab, built at this PR's head f9b88216 with bin/fm-live-lab.sh up --harness claude --worker.
The lab ran its own primary, watcher, and supervision host on a private tmux server, and registered the lab's Claude trust, so no folder-trust dialog appeared.
The worker was a real fm-spawn.sh ship task, held on a gate file with paused:.
The watched PR was a disposable scratch PR on the author's fork, mikaelz#1, which is now closed and its branch deleted.

  1. Park (05:10:01Z): bin/fm-pr-park.sh park lab200194b879af-worker https://github.com/mikaelz/firstmate/pull/1
    stopped lab200194b879af-worker harness=claude backend=tmux endpoint=firstmate:fm-lab200194b879af-worker worktree=.../notes
    parked: lab200194b879af-worker on https://github.com/mikaelz/firstmate/pull/1
    
    The worker pane fell back to its shell (cmd=zsh), and the watch source when-park-dfd4739e... was registered.
  2. Change the PR (05:10:15Z): one comment on the scratch PR, and the worker's gate file touched.
  3. Watch fired (about 05:15Z, on the next 300 s poll): it wrote data/<id>/park-resume.md, where only the comment count changed (0 0 to 0 1).
    It then retired its source and queued check: procevent when when-park-dfd4739e... 1 in the lab home's wake queue.
  4. Relaunch (05:15:21Z):
    $ bin/fm-control.sh lab200194b879af-worker relaunch --note-file data/lab200194b879af-worker/park-resume.md
    relaunched lab200194b879af-worker harness=claude from=claude model=sonnet effort=low backend=tmux ...
    $ bin/fm-pr-park.sh unpark lab200194b879af-worker
    unparked: lab200194b879af-worker
    $ bin/fm-procevent.sh handled when-park-dfd4739e... 1
    handled: when-park-dfd4739e... 1
    
    The park record was gone after the unpark.
  5. The worker continued: the relaunched Claude session read the note, found the gate, and in 17 s implemented its task (count_notes() with a unit test, 2 tests pass).
    It committed b069114 Add count_notes() and appended done [at=1792559739]: ready in branch fm/lab200194b879af-worker.
  6. Cleanup: fm-live-lab.sh down stopped the lab and removed its Claude trust entries and temp directories; ~/.treehouse was unchanged.

@mikaelz

mikaelz commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the review. Two updates:

  1. Live resume proof: done and posted above (feat: park workers awaiting external GitHub PR changes #7578 (comment)). A real Claude worker was parked on a scratch PR. The watch fired on a PR change. fm-control.sh relaunch --note-file brought the worker back, and it finished and committed its task. This push also names fm-pr-park.sh a "PR-wait park, not an fm-control.sh verb" in its header, docs/scripts.md, and ship-landing, so it stays distinct from the fm-control park verb proposed in feat(bin): add park/unpark control verbs to suppress watcher loops on stopped seats #7045 and feat(bin): add fm-control park verb so stopped seats stop re-flagging stale #7119.
  2. CI on 84f5a21c: 19 checks passed and 0 failed, including Behavior tests (Herdr). One job, Behavior portable serial 2, was cancelled at the 30-minute job limit, not failed, while it was inside tests/fm-supervision-host.test.sh.
    • The same job stopped in the same test today on unrelated PRs: runs 39548713441 (fm/router-p1-capacity-facts) and 39547977848 (fm/six-seat-design-implementation).
    • Locally, tests/fm-supervision-host.test.sh is intermittent on main itself. At main 0e82f3ee, one run passed (75 ok) and a second run failed one case, "hook write failure: the Stop hook did not finish". This PR's head fails the same case. This PR does not touch that test, the supervision host, or the Stop hook.

Could you rerun that job? https://github.com/kunchenguid/firstmate/actions/runs/39549653726/job/119055696405
I could not rerun it myself, because a rerun needs admin rights on this repository.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mikaelz, that's exactly the evidence I asked for. A real Claude worker parked on a scratch PR, the watch fired on the change, relaunch --note-file and unpark ran, and the worker continued and finished its task. That covers the payoff path.

I re-read the new head 84f5a21c against main. Compared with f9b88216, where you ran the live resume, the PR diff only changes wording (the "PR-wait park, not an fm-control.sh verb" naming in the script header, ship-landing and docs/scripts.md), so the live evidence still applies. The attestation binds this head. There are still no workflow, CI-script or secret changes.

CI: everything passes except Behavior portable serial 2, which was cancelled at the 30-minute job ceiling (known infra limit, #7255). I re-ran just that job once (run 39549653726). Nothing is needed from you for it.

Contract-class: new-default (unchanged). The worker brief's pause section and the ship-landing / validation-supervision skills change default behavior for an unconfigured fleet. So this won't auto-merge. Once that re-run is green it goes to Kun as a merge-or-leave decision (a captain-decision hold, not waiting on you).

VISION.md: One captain aligns · Authority aligns (keeps endpoint/worktree/work; relaunch stays a firstmate step) · Scripts aligns · Restart aligns (durable park record + watch, teardown retires it) · Delegation aligns (resume now proven live) · Vendor partial (GitHub-only for now, refuses other forges) · Scope aligns.

A worker whose PR waits only on a person outside the fleet (maintainer
review, merge, or fork-CI approval) kept its session alive and polled
for hours. Add bin/fm-pr-park.sh: park records the PR fingerprint, arms
a when-park-<id> condition->action watch on fm-procevent-when, and
stops the worker with fm-control exit; the watch wakes firstmate when
the PR changes so it can relaunch the worker with a resume note.
Teardown unparks a parked task, briefs tell workers to end their turn
on such a wait, and the ship-landing, validation-supervision, and
process-event-sources skills point at the new script.
…erbs

Keep the PR-wait park owned by fm-pr-park.sh distinguishable from any fm-control.sh lifecycle verb in its header, the scripts inventory, and the ship-landing rule.
@mikaelz mikaelz changed the title feat: park workers during external GitHub PR waits feat: park workers awaiting external GitHub PR changes Oct 24, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mikaelz.

I re-read head 6a3b900a. It's a rebase of the same six commits onto a newer main: the range-diff against 84f5a21c (where you proved the live resume) only differs in context lines from main, and the PR's own diff is the same 11 files. The live resume evidence still applies, the no-mistakes attestation binds this head, it's mergeable, and all 19 checks are green, including serial 1/2 and the no-mistakes check. No workflow, CI-script or secret changes.

Contract-class: new-default (my own read, unchanged). The worker brief's pause section and the ship-landing / validation-supervision skills change what an unconfigured fleet does when a worker waits on someone outside the fleet. VISION.md: One captain aligns · Authority aligns (endpoint, worktree and work are kept; relaunch stays a first-mate step) · Scripts aligns · Restart aligns (durable park record + watch; teardown retires it) · Delegation aligns (resume proven live) · Vendor partial (GitHub-only for now, refuses other forges) · Scope aligns.

Where it stands: this is ready on everything I check, so it now goes to Kun as a merge-or-leave decision. That's a standing captain hold. It isn't waiting on you, and there's nothing more you need to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants