fix(crew-state): stop claiming a PR outcome the reader never checked #5
Loading…
Reference in a new issue
No description provided.
Delete branch "fm/fm-crew-state-pr-claim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the line in firstmate's own state reader that asserted a pull-request outcome it never checked. It is the root cause of seven false "done" reports in a single day.
What was wrong
A validation-pipeline outcome of
passedmeans the pipeline finished. It does not mean a pull request was opened, and certainly not merged or closed. The run'sprstep is skipped routinely —no-mistakes pr+ci skipped due to mid-run target_changedwas observed repeatedly — and the outcome is stillpassed.So firstmate asserted a merged pull request that may never have existed. The string is generated locally from a state file: no worker is involved and no forge is ever contacted. Confirmed by two tasks on the same day printing identical text, where one genuinely had a pull request and the other had a pushed branch and none at all.
The cost was not cosmetic. It was believed, reported to the captain, and the mistake was attributed to workers and to "leftover run records in reused workspaces" — twice written into the fleet's own notes as a worker defect when it was firstmate's own line all along.
What changed
The detail now says only what is known, and names a pull request only when local task metadata records one:
run_detail_with_recorded_prappendsrecorded PR: <url>— and the recorded head when present — fromstate/<id>.meta. With nopr=, it appends nothing rather than implying one exists.The header comment now states the invariant directly: a terminal pipeline outcome proves no PR lifecycle state.
Constraints honoured
curl,wget,ghor API references introduced. This script runs constantly, inside loops and guards; a forge call here would be a latency and failure-mode disaster.done,failed,working,parked,unknown— is unchanged. This is a wording and honesty fix, not a state-machine change.Test environment note
This machine produces several failures unrelated to any branch, each verified today against clean
mainand in some cases pureupstream/main: the herdr presentation suite (these sessions run inside a real herdr), theMISSING-tool checks in bootstrap and session-start (/usr/bin/nodeexists here),fm-onandfm-remote-doctor(herdr, tasks-axi, treehouse and harness are all installed), and the calm-extension and documentation-audience suites. Two more can fail under concurrency and pass alone.Also worth recording: run the suite with
FM_HOMEscoped to the worktree under test or unset. Pointing it at the primary home while testing a worktree makesfm-arm-pretool-checkcase A13 fail falsely — a trap that cost a full diagnostic pass today.