Skip to content

feat(bin): continue published PR branches through a guarded resync owner - #49

Closed
Pibomeister wants to merge 12 commits into
mainfrom
fm/fm-pr-published-head-resync
Closed

Pibomeister wants to merge 12 commits into
mainfrom
fm/fm-pr-published-head-resync

Conversation

@Pibomeister

@Pibomeister Pibomeister commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

What Changed

  • Adds bin/fm-pr-resync.sh, a single owner for continuing a branch whose PR head the no-mistakes pipeline may have rebased and republished. It checks the published head on origin and compares the local branch against it. Then it either leaves the branch alone (equal or ahead:N) or moves it forward with an old-OID-conditional ref update. A diverged local branch is first saved under refs/heads/archive/<task>-pre-rebase-<sha8>. A detached worktree is switched onto the branch first, and the switch is reported as a change. Before anything moves it reads custody with no-mistakes axi sync --check, and it only takes the native recover, adopt or bind-archive actions. Exit 3 means a run is still active and prints monitoring-only lines. A --check mode plans the action without changing any ref. It never force-pushes, force-moves or deletes a ref.
  • Adds --pr-branch <branch> to fm-spawn.sh, fm-brief.sh and fm-promote.sh for continuing an existing published branch. Spawn runs the resync owner instead of the base refresh, and promote runs it before the task record changes. The brief tells the worker it is already on the branch, so it does not create one. Also adds --from-branch <branch> so a ship or scout can start from origin's <branch> while its PR still targets the default or --base-branch. On a fresh launch, spawn checks it against the brief's Source branch: line. A ship relaunch whose recorded branch exists on origin runs the resync first. A fresh clean Orca copy is detached before the continuation resync.
  • Worker guidance in fm-dod-lib.sh and the validation-supervision skill now sends a branch that is stale or diverged against the published head to fm-pr-resync.sh instead of hand-run archive, reset or sync steps. fm_brief_base_branches also recognises the new PR-continuation Setup sentence. The docs cover the new flags and the relaunch resync, and there is a new tests/fm-pr-resync.test.sh plus additions to the brief, DoD, spawn, relaunch and delivery tests.

Risk Assessment

🚨 High: The new resync owner wrongly refuses continuation spawns and promotions from copies detached at a current origin/main once main moves (reproduced), so the required stale-branch recovery still needs hand-run steps in the most common case.

Testing

I ran the resync owner, promotion and brief generation live against throwaway git origins in which a pipeline rebase and lease-publish left a stale local branch, inside a marked lab home that was removed afterwards. All live scenarios passed and the transcripts are saved as evidence. The seven focused test files for the changed scripts also passed; they cover fm-spawn, relaunch, Orca and pool copies, plus custody verdicts from a no-mistakes stand-in. Those spawn/relaunch and custody scenarios are recorded as untested live, because only the test suites exercised them. Live custody checks against a real no-mistakes gate were not run, because this phase may not invoke no-mistakes sync or init. The change has no UI, so there are no screenshots.

  • Live validation: ✅ go - 10 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Continuing a PR whose head the pipeline rebased: the resync owner archives the stale local commit under archive/<task>-pre-rebase-<sha8> and advances the branch to the published head without pushing ✅ pass live live-fm-pr-resync-transcript.txt S1c: result=archived-advanced, the archive ref holds the stale commit, the branch is at the published head, origin is unchanged; S1d rerun gives result=equal
Adversarial: a dirty worktree refuses before any archive or advance ✅ pass live live-fm-pr-resync-transcript.txt S1b: exit 1, 'changed: nothing', branch still at the stale commit
--check plans the action without changing any ref or writing FETCH_HEAD ✅ pass live live-fm-pr-resync-transcript.txt S1a: planned:archive-advance, refs unchanged, no FETCH_HEAD
A detached pool copy at an origin/main that moved past the PR base is accepted and placed on the published head ✅ pass live live-fm-pr-resync-transcript.txt S2: branch created at the published head, exit 0
Adversarial: a detached copy with a genuinely unanchored commit refuses and leaves HEAD unchanged ✅ pass live live-fm-pr-resync-transcript.txt S3: exit 1, HEAD unchanged and still detached, no branch created
Adversarial: an archive name already held by another commit refuses without moving the branch ✅ pass live live-fm-pr-resync-transcript.txt S4
Unpublished local commits ahead of the published head are kept (ahead:N) ✅ pass live live-fm-pr-resync-transcript.txt S5: result=ahead:1
fm-promote --pr-branch on a dirty scout refuses through the owner, leaving the task record, branch and worktree untouched ✅ pass live live-fm-promote-brief-transcript.txt P1
fm-promote --pr-branch puts the scout worktree on the published head, archives the stale head, records branch=, and the instructions say not to create a branch ✅ pass live live-fm-promote-brief-transcript.txt P2
A successor ship brief with --pr-branch continues the exact branch, PR policy unchanged (default branch), and the DoD calls bin/fm-pr-resync.sh instead of hand recovery ✅ pass live live-fm-promote-brief-transcript.txt B1, plus B2 refusal of the --branch-prefix combination
fm-spawn --pr-branch, Orca, pool-copy and relaunch paths resync from the published head, with negative controls ⏸️ untested no The prior payload did not establish a live result. Only tests/fm-spawn-pool-base-freshen, fm-spawn-orca-worktree, fm-control-relaunch and fm-task-delivery (all exit 0) exercised these paths, running t…
No-mistakes custody handling (blocked_diverged, recover_custody, the bind-archive path, and active-run exit 3 monitoring-only) ⏸️ untested no The prior payload did not establish a live result. Only tests/fm-pr-resync.test.sh and tests/fm-task-delivery.test.sh (exit 0) covered this, using a no-mistakes stand-in that replays recorded v1.84.0…
Evidence: Live fm-pr-resync transcript (stale branch vs pipeline-rebased head; refusals; detached cases)

Source: Live fm-pr-resync transcript (stale branch vs pipeline-rebased head; refusals; detached cases)

=== S1 pipeline-rebased published head vs stale local branch (stale=40cf3753b13e0813f85d796b2609da866e5b6067 pub=63b44a2829038712bd28d6d87a5ff455d96e3656)
$ git -C task status -sb
## fm/demo...origin/fm/demo
[exit 0]
--- S1a --check plans, changes nothing
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/demo --check
fm-pr-resync: result=planned:archive-advance archive=- custody=none head=40cf3753b13e0813f85d796b2609da866e5b6067
[exit 0]
refs unchanged by --check: OK
no FETCH_HEAD: OK
--- S1b dirty tree refuses before archive/advance
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/demo
fm-pr-resync: refused: worktree has local changes and fm/demo must move to the published head 63b44a2829038712bd28d6d87a5ff455d96e3656
fm-pr-resync: changed: nothing; no commit was made unreachable
fm-pr-resync: result=planned:archive-advance archive=- custody=refused head=40cf3753b13e0813f85d796b2609da866e5b6067
[exit 1]
$ git -C task for-each-ref refs/heads
40cf3753b13e0813f85d796b2609da866e5b6067 commit	refs/heads/fm/demo
28ab518074bd583744b044e1823333936b2da07a commit	refs/heads/main
[exit 0]
--- S1c real run
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/demo
fm-pr-resync: result=archived-advanced archive=refs/heads/archive/demo-pre-rebase-40cf3753 custody=none head=63b44a2829038712bd28d6d87a5ff455d96e3656
[exit 0]
$ git -C task for-each-ref --format=%(refname) %(objectname:short) refs/heads
refs/heads/archive/demo-pre-rebase-40cf3753 40cf375
refs/heads/fm/demo 63b44a2
refs/heads/main 28ab518
[exit 0]
$ git -C task log --oneline -3
63b44a2 review fix
a65b7e5 task work
9150902 main moves
[exit 0]
$ git -C task status -sb
## fm/demo...origin/fm/demo
[exit 0]
origin fm/demo now: 63b44a2829038712bd28d6d87a5ff455d96e3656 (pub 63b44a2829038712bd28d6d87a5ff455d96e3656) -- no push happened
stale commit still reachable via archive: archive/demo-pre-rebase-40cf3753
--- S1d rerun is idempotent
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/demo
fm-pr-resync: result=equal archive=- custody=none head=63b44a2829038712bd28d6d87a5ff455d96e3656
[exit 0]
=== S2 detached copy at a moved origin/main (beyond the PR base) — must be accepted
$ git -C pool status -sb
## HEAD (no branch)
[exit 0]
$ bin/fm-pr-resync.sh demo2 $TMPDIR/fmlive.PQxK/pool fm/demo
fm-pr-resync: created local branch fm/demo at the published head 63b44a2829038712bd28d6d87a5ff455d96e3656
fm-pr-resync: result=equal archive=- custody=none head=63b44a2829038712bd28d6d87a5ff455d96e3656
[exit 0]
$ git -C pool status -sb
## fm/demo
[exit 0]
=== S3 adversarial: detached copy with a genuinely unanchored commit — must refuse, HEAD unchanged
$ bin/fm-pr-resync.sh demo3 $TMPDIR/fmlive.PQxK/lost fm/demo
fm-pr-resync: refused: detached HEAD 93ca851b01c75f9271e138b6c8ea92134ad378e6 contains commits absent from fm/demo, the published head and origin; HEAD is unchanged
fm-pr-resync: changed: nothing; no commit was made unreachable
fm-pr-resync: result=planned:none archive=- custody=refused head=-
[exit 1]
HEAD after refusal: 93ca851b01c75f9271e138b6c8ea92134ad378e6 (was 93ca851b01c75f9271e138b6c8ea92134ad378e6); branch: detached; local fm/demo: none
=== S4 adversarial: existing archive name held by another commit refuses
$ bin/fm-pr-resync.sh demo4 $TMPDIR/fmlive.PQxK/coll fm/demo
fm-pr-resync: refused: archive refs/heads/archive/demo4-pre-rebase-40cf3753 already exists at 63b44a2829038712bd28d6d87a5ff455d96e3656, not 40cf3753b13e0813f85d796b2609da866e5b6067
fm-pr-resync: changed: nothing; no commit was made unreachable
fm-pr-resync: result=planned:archive-advance archive=- custody=refused head=40cf3753b13e0813f85d796b2609da866e5b6067
[exit 1]
fm/demo still at 40cf3753b13e0813f85d796b2609da866e5b6067 (stale 40cf3753b13e0813f85d796b2609da866e5b6067)
=== S5 ahead: unpublished local commits on top of the published head are kept
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/demo
fm-pr-resync: result=ahead:1 archive=- custody=none head=c667e9c390c3789ff18aaa2c7dab049e6c83e4e7
[exit 0]
=== S6 branch origin lacks refuses
$ bin/fm-pr-resync.sh demo $TMPDIR/fmlive.PQxK/task fm/nope
fm-pr-resync: refused: worktree is on branch fm/demo, not fm/nope
fm-pr-resync: changed: nothing; no commit was made unreachable
fm-pr-resync: result=planned:none archive=- custody=refused head=-
[exit 1]
Evidence: Live fm-promote --pr-branch and fm-brief --pr-branch transcript in a lab home

Source: Live fm-promote --pr-branch and fm-brief --pr-branch transcript in a lab home

=== lab home $TMPDIR/fm-lab.bYPbD1; stale local feature/pr=1b34661743873db86e912c770403d1324bf91d58; pipeline-published head=c0e93f2de5736a6603f9650e4fbe64c73cdb925f
$ fm-brief.sh live-pr1 fixture-project --scout
scaffolded: $TMPDIR/fm-lab.bYPbD1/data/live-pr1/brief.md (scout; replace {TASK} and {FIRSTMATE_SPEC})
[exit 0]
--- P1 adversarial: dirty scout worktree refuses promotion, nothing moves
$ fm-promote.sh live-pr1 --mode direct-PR --yolo off --pr-branch feature/pr
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  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.
●  down 0s.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
fm-pr-resync: refused: detached worktree has local changes; cannot switch to feature/pr
fm-pr-resync: changed: nothing; no commit was made unreachable
fm-pr-resync: result=planned:none archive=- custody=refused head=1b34661743873db86e912c770403d1324bf91d58
error: cannot promote live-pr1 onto feature/pr: bin/fm-pr-resync.sh exited 1 in '$TMPDIR/fm-lab.bYPbD1/repos/wt' (output above); the task record is unchanged
[exit 1]
task record unchanged: OK
local feature/pr: 1b34661743873db86e912c770403d1324bf91d58 (stale 1b34661743873db86e912c770403d1324bf91d58)
worktree: detached
--- P2 clean promotion continues from the published head
$ fm-promote.sh live-pr1 --mode direct-PR --yolo off --pr-branch feature/pr
WARNING: watcher still down (same stale episode; last beat: never, grace 300s; down 1s) - full banner already printed this episode.
fm-pr-resync: switched the detached worktree to feature/pr
fm-pr-resync: result=archived-advanced archive=refs/heads/archive/live-pr1-pre-rebase-1b346617 custody=none head=c0e93f2de5736a6603f9650e4fbe64c73cdb925f
promoted live-pr1 to ship mode=direct-PR yolo=off (teardown protection restored)
wrote ship instructions for mode=direct-PR: $TMPDIR/fm-lab.bYPbD1/data/live-pr1/ship-instructions.md
next: FM_HOME=$TMPDIR/fm-lab.bYPbD1 bin/fm-send.sh fm-live-pr1 "$(cat $TMPDIR/fm-lab.bYPbD1/data/live-pr1/ship-instructions.md)"
[exit 0]
meta:
window=fm-live-pr1
worktree=$TMPDIR/fm-lab.bYPbD1/repos/wt
kind=ship
mode=direct-PR
yolo=off
branch=feature/pr
worktree branch: refs/heads/feature/pr at c0e93f2de5736a6603f9650e4fbe64c73cdb925f (published c0e93f2de5736a6603f9650e4fbe64c73cdb925f)
refs/heads/archive/live-pr1-pre-rebase-1b346617 1b34661743873db86e912c770403d1324bf91d58
origin feature/pr: c0e93f2de5736a6603f9650e4fbe64c73cdb925f (unchanged; no push)
ship-instructions branch step:
11:3. Promotion already put this worktree on `feature/pr` at its verified published head (or ahead of it by unpublished local commits); keep your scratch state out of it and do not create a branch.
=== B1 successor ship brief: --pr-branch continues the branch, PR targets the default branch
$ fm-brief.sh live-pr2 fixture-project --mode no-mistakes --pr-branch feature/pr
scaffolded: $TMPDIR/fm-lab.bYPbD1/data/live-pr2/brief.md (ship, mode=no-mistakes; replace {TASK} and {FIRSTMATE_SPEC})
[exit 0]
16:You are in a disposable git worktree of fixture-project, already on branch feature/pr, which contains its verified published pull-request head: equal to it, or ahead of it by the unpublished local commits the launch reported.
22:1. First action: confirm `git status --short --branch` shows feature/pr; do not create a branch.
26:1. Never push to the default branch. Never merge a PR.
100:Ship branch: feature/pr
117:When `branch_sync` reports this branch diverged from or rewritten against the pipeline's published head, never archive, reset, or sync it by hand: run `bin/fm-pr-resync.sh live-pr2 "$(git rev-parse --show-toplevel)" feature/pr`; on exit 3 follow its monitoring-only lines, and on any other nonzero exit report a blocker with its output.
--- B2 adversarial: --pr-branch with --branch-prefix refused
error: --pr-branch applies only to ship briefs and cannot be combined with --branch-prefix or --from-branch
[exit 1]
lab removed
Evidence: Resync owner core result
fm-pr-resync: result=archived-advanced archive=refs/heads/archive/demo-pre-rebase-40cf3753 custody=none head=63b44a28… (origin fm/demo unchanged: no push)
Evidence: fm-pr-resync test log

Source: fm-pr-resync test log

ok - diverged stale local branch is archived and advanced to the pipeline-rebased published head
ok - behind branch advances without an archive
ok - equal branch changes nothing, even with an untracked file
ok - ahead branch changes nothing and reports ahead:1
ok - a dirty tree refuses when the branch must move
status: waiting for both good and bad commits
ok - an in-progress operation refuses
ok - a branch checked out in another worktree refuses
ok - a worktree on a different named branch refuses
ok - a branch missing on origin refuses
ok - a fetched head that differs from the advertised head refuses
ok - an archive name held by another commit refuses before any move
ok - an archive already at the stale head is reused
ok - a remote move after the advance refuses with the archive and verified head reported
ok - a concurrent local commit refuses the old-OID-conditional advance
ok - a concurrent local commit after the conditional advance is preserved and reported
ok - an index update failure refuses and reports the preserved archive and conditional advance
ok - a detached HEAD capture failure refuses without switching or losing its commit
ok - a detached unpublished commit refuses without switching HEAD
ok - a copy detached at an origin/main newer than the published head's base continues the branch
ok - a copy detached at a moved origin/main switches to and archive-advances its stale branch
ok - an unanchored detached commit on top of a moved origin/main still refuses
ok - Git network timeout refuses safely at normal operation 1
ok - Git network timeout refuses safely at normal operation 2
ok - Git network timeout refuses safely at normal operation 3
ok - Git network timeout refuses safely at normal operation 4
ok - Git network timeout refuses safely at check operation 1
ok - Git network timeout refuses safely at check operation 2
ok - Git network timeout refuses safely at check operation 3
ok - a remote move before the advance refuses with nothing moved
ok - custody active at preflight exits 3 with nothing changed
ok - blocked_diverged custody settles after archive and advance
ok - recover_custody runs its fixed command and re-checks to settled
ok - adopt_published runs its fixed command and re-checks to settled
ok - a recovery whose fresh re-check is not settled refuses
ok - a preserved pipeline-head fetch timeout refuses before binding or recovering
ok - terminal-run manual reconciliation archives, binds and recovers only under verified proof
ok - keep-local recovery without a verified own-archive proof refuses (unverified)
ok - keep-local recovery without a verified own-archive proof refuses (foreign)
ok - keep-local recovery without a verified own-archive proof refuses (preserved)
ok - keep-local recovery without a verified own-archive proof refuses (required)
ok - an unhandled native verdict refuses with its output
ok - a native verdict outside the handled set refuses before any change
ok - a native verdict outside the handled set just before the move refuses with nothing moved
ok - unreadable custody refuses before any change
ok - --check reports the planned action and changes nothing
ok - --check refuses when origin moves to an already-present commit around its fetch (after read 1)
ok - --check refuses when origin moves to an already-present commit around its fetch (after read 2)
ok - custody taken between preflight and move is caught before any ref moves
ok - custody taken after the pre-move check is reported with the archive and advance
ok - a detached worktree without a local branch reports the created branch on exit 3
ok - a detached worktree switched to its existing branch reports the switch on exit 3
ok - an unsettled verdict after a detached switch refuses and reports the switch
ok - an invalid timeout cannot disable the Git network bound
ok - a relative worktree is a usage error
Evidence: fm-task-delivery test log

Source: fm-task-delivery test log

ok - fm-spawn/fm-promote: authorized intent preserves exact words and refuses operator-address lines
ok - fm-spawn: every legacy worker receives scoped role instructions without changing project or primary instructions
ok - fm-spawn: a ship spawn requires a valid explicit mode and yolo before anything is created
ok - fm-spawn: scout and secondmate spawns refuse ship delivery flags
ok - fm-spawn: the brief's recorded mode and the spawn's explicit mode must agree
ok - fm-spawn: a rigor downgrade against the registered posture is announced, never blocked
ok - fm-spawn: a scout spawn resolves no delivery posture from the registry
ok - fm-promote: promotion requires the delivery contract and records it exactly once
ok - fm-promote: a symlinked task record is refused and its target is left untouched
ok - fm-promote: a promoted worker receives the same mode-specific delivery contract a briefed one does
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  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.
●  down 0s.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ok - fm-promote: a selected branch prefix reaches both worker instructions and durable task state
ok - fm-promote --pr-branch: the owner settles the worktree on the published head before the record changes; its refusal changes nothing
Switched to a new branch '$(touch${IFS}$TMPDIR/fm-task-delivery.8ufc3j/promote-branch-shell-safe-marker)/promote-branch-safe-e3'
ok - fm-promote: ref-format-valid shell metacharacters stay literal in promotion branch commands
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  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.
●  down 0s.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ok - fm-merge-local: a registry change cannot redirect an in-flight local-only task
ok - fm-project-mode: the registry lookup matches a whole multi-word name, not just its first token
ok - fm-project-mode: the conditional policy is accepted, mapped for mechanical callers, and readable raw
ok - fm-project-mode: the forge binds from its own token and is reported only through --forge
ok - fm-project-mode: only a malformed forge binding refuses; every other token keeps its old tolerance
ok - forge=gerrit: yolo is refused with its reason, never silently dropped
ok - forge=external: promoting a scout is refused because only a ship spawn installs the push guard
ok - forge=gerrit: no-mistakes runs with its forge steps skipped, recovers its fixes, then publishes one change
ok - forge=gerrit: direct-PR publishes one squashed change and a stack is refused with its reason
ok - fm-spawn: a registered forge must reach the worker's brief
ok - fm-spawn: the brief must carry the spawn's selected ship branch, and the selection is validated before anything is created
ok - fm-spawn: a ship branch that deviates from the registered prefix is announced, never blocked
ok - fm-spawn: a registry forge token the parser refuses stops the launch, reason included
ok - fm-promote: a promoted worker receives the project's registered forge contract with no flag to remember
ok - forge=forgejo: spawn agreement and promotion carry the binding, name tea, and keep yolo
ok - fm-spawn/fm-promote: leftover Task placeholders are refused until both subsections are filled
ok - fm-project-mode: --branch-prefix resolves order-independently and defaults to the legacy fm/ prefix
# all fm-task-delivery tests passed
- Outcome: ⚠️ 1 info across 1 run (19m1s)

Evidence and verification status

agent-kit verify gate not recorded: no runner-attested verifier on this host (known boundary); host-unattested verifier receipt attached.

Host-unattested verifier receipt

An independent verifier seat (different model from the author) ran each ticket's verification command at the exact clean pre-pipeline head through a runner that refuses unless the worktree is clean at that head. Every receipt below records isolation: host-unattested and attestation: null. Together they are an independent receipt. They are not a recorded agent-kit verify gate.

field value
host-unattested yes: no runner-attested verifier seat exists on this host
revision 40d528543b1643b3de1fdb13486399708b14536b (clean tree, empty diff hash)
verifier seat codex-gpt-6-1-sol-verifier; implementer seat claude-opus-5-5-author
ticket check command exit result
T1 owner owner-suite bash tests/fm-pr-resync.test.sh 0 passed
T1 owner owner-controls per-guard mutation controls against bin/fm-pr-resync.sh 0 24/24 controls red (ALL-CONTROLS-RED)
T2 integrations integration-suites fm-task-delivery, fm-spawn-pool-base-freshen, fm-control-relaunch, fm-brief suites 0 passed
T2 integrations integration-controls per-guard mutation controls against spawn, promote, relaunch and brief 0 19/19 controls red
T3 guidance guidance-suite bash tests/fm-brief.test.sh and bash tests/fm-dod-lib.test.sh 0 passed
T3 guidance lint-docs bin/fm-lint.sh and bin/fm-doc-audience-check.sh 0 passed

The two controls checks first failed in an earlier attempt at this revision. In both cases the cause was four control mutation patterns that no longer matched the rewritten source lines. They were not product failures. The patterns were corrected (all 24 and 19 patterns now match the current source exactly once), and the two checks were rerun fresh. Both passed, and the logs showed no fixture errors.

This receipt covers 40d52854. The pipeline later added the review-round fixes listed below, and the verifier was not rerun at the PR head. Per policy, verify is re-run after merge.

Pipeline evidence at the published PR head (separate from the receipt above)

  • After the rebase onto current main, 40d52854 became df3ca95f. The pipeline's review fixes added 8684a105 and 2548564c, and the document step added d926f79b, which is the PR head.
  • The pipeline test step ran at 2548564c. All seven focused suites exited 0: fm-pr-resync, fm-task-delivery, fm-spawn-pool-base-freshen, fm-spawn-orca-worktree, fm-control-relaunch, fm-brief and fm-dod-lib. The live scenarios in the Testing section above also passed.
  • CI at d926f79b: status is reported by the checks on this PR and is updated here when they finish.

Earlier independent review (pre-pipeline, at cbad5bcd)

A different-model review panel found eight P2 findings, all fixed at 40d52854 with 28 new per-guard negative controls (28/28 red when their guard is reverted):

  • continuation briefs keep their Base branch: line;
  • a fresh Orca copy is detached before resync, with its initial branch kept;
  • keep-local identity-mismatch cases are covered;
  • monitoring-only (exit 3) contract assertions;
  • active-custody refusal at fresh spawn and at promotion;
  • every Git network call is bounded (FM_PR_RESYNC_TIMEOUT, default 120s), including the relaunch pre-probe;
  • the advance is conditional on the old object id;
  • a detached HEAD holding unanchored commits refuses before switching.

Review coverage gaps, stated plainly: the project-standards seat was unavailable (its packet lacked file-to-criteria pairing), and the maintainability seat was unavailable (model capacity). No agent-kit review-delta or readiness gate was run; that remaining coverage went through this pipeline's review.

Pipeline review rounds (this PR)

  • Round 1 fixed F1: a copy detached at an origin/main newer than the PR base was wrongly refused. Commits already on origin now count as safely anchored. Genuinely unanchored commits still refuse.
  • Round 1 also fixed F2: a detached switch or branch creation before a refusal is now reported as a change.
  • Round 2 fixed R2-1: promotion runs every read-only brief and publication check before the resync can switch, archive or advance the copy, and a regression test proves a refused promotion leaves HEAD, the branch and archive refs untouched.
  • Round 2 also fixed R2-2: the owner's header now states its guarantee accurately.
  • F3 (remove --check) was declined deliberately. --check is the approved operator dry-run contract, and its no-ref, no-FETCH_HEAD, no-recovery behaviour is tested and was shown live in the test step.
  • The final review pass re-verified the three files touched by the fix rounds. It reports that the other ten changed files were not re-verified in that last pass; they were covered in round 1.

Known boundaries and follow-ups

  • No runner attestation exists on this host, so no agent-kit verify, review or readiness gate is recorded for this PR.
  • Live custody verdicts against a real no-mistakes gate (blocked_diverged, recover_custody, bind-archive, blocked_remote_rewritten) are covered only through a no-mistakes stand-in in the suites. No runtime evidence of blocked_remote_rewritten was available.
  • Follow-up, not changed here: when tests/lib.sh cannot create its TMPDIR registries, suites that source it with a bare . lib.sh can keep running and print ok for cases whose assertions never executed. This is a pre-existing class across tests/*.test.sh; a fix is . lib.sh || exit 1 or failing hard inside lib.sh.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • 🚨 bin/fm-pr-resync.sh:230 - The detached-HEAD guard refuses when the detached HEAD has commits absent from both the local branch and the published head, but it doesn't exclude commits already on origin. A pooled, Orca or scout copy detached at a current origin/main therefore refuses whenever main has moved past the PR's last pipeline rebase. Reproduced in a scratch repo: a worktree detached at origin/main one commit past the PR head's base got 'refused: detached HEAD ... contains commits absent from feat and the published head', exit 1. This breaks intent (1) for fm-spawn --pr-branch and fm-promote --pr-branch in the common case. Sibling sites: bin/fm-spawn.sh:5751-5761 (pooled copy with freshen skipped; detached Orca copy) and bin/fm-promote.sh:252-260 (scout worktree freshened to current origin/main). No test covers this: the fixtures detach before main moves (tests/fm-task-delivery.test.sh, tests/fm-spawn-pool-base-freshen.test.sh) or have no moved main (tests/fm-spawn-orca-worktree.test.sh). Fix in the owner by also excluding --remotes, e.g. rev-list "$detached_head" --not "$pub" ${local_head:+"$local_head"} --remotes, and add a regression test with the copy detached at the moved origin/main.
  • ⚠️ bin/fm-pr-resync.sh:236 - In a detached worktree the script switches to <branch> (or creates <branch> at the published head) before the no-mistakes custody read at lines 258-264. That contradicts the header (lines 47-50), which promises an unhandled verdict refuses before anything moves. The switch to an existing branch is only printed with say, never recorded with note_change, so a refusal prints 'changed: nothing' after HEAD moved, and exit 3 leaves the copy switched. Sibling paths: the fresh-spawn exit-3 refusal (bin/fm-spawn.sh:3881-3889) leaves the pooled copy on the branch; tests/fm-task-delivery.test.sh has to re-detach the scout after its exit-3 promotion; bin/fm-promote.sh:252-260 runs the owner before the self-repository publication gate (lines 264-273), so a gate refusal comes after archive/advance changes while the message says only 'the task record is unchanged'. Fix: record the switch with note_change or run the custody preflight before switching, and move the promotion resync after the publication gate.
  • ⚠️ bin/fm-pr-resync.sh:208 - The --check dry-run mode (lines 73-77, 208-216, 265) has no caller and no intent requirement asks for it. It adds its own objects-only fetch and re-advertise path. Spawn, promote, relaunch, the generated DoD block and validation-supervision all call the owner without --check; only tests/fm-pr-resync.test.sh uses it. Recommend removing it unless it is wanted as an operator tool; that is the author's call.

🔧 Fix applied.
5 issues (1 error, 3 warnings, 1 info) still open:

  • 🚨 bin/fm-pr-resync.sh:230 - The detached-HEAD guard refuses when the detached HEAD has commits absent from both the local branch and the published head, but it doesn't exclude commits already on origin. A pooled, Orca or scout copy detached at a current origin/main therefore refuses whenever main has moved past the PR's last pipeline rebase. Reproduced in a scratch repo: a worktree detached at origin/main one commit past the PR head's base got 'refused: detached HEAD ... contains commits absent from feat and the published head', exit 1. This breaks intent (1) for fm-spawn --pr-branch and fm-promote --pr-branch in the common case. Sibling sites: bin/fm-spawn.sh:5751-5761 (pooled copy with freshen skipped; detached Orca copy) and bin/fm-promote.sh:252-260 (scout worktree freshened to current origin/main). No test covers this: the fixtures detach before main moves (tests/fm-task-delivery.test.sh, tests/fm-spawn-pool-base-freshen.test.sh) or have no moved main (tests/fm-spawn-orca-worktree.test.sh). Fix in the owner by also excluding --remotes, e.g. rev-list "$detached_head" --not "$pub" ${local_head:+"$local_head"} --remotes, and add a regression test with the copy detached at the moved origin/main.
  • ⚠️ bin/fm-pr-resync.sh:236 - In a detached worktree the script switches to <branch> (or creates <branch> at the published head) before the no-mistakes custody read at lines 258-264. That contradicts the header (lines 47-50), which promises an unhandled verdict refuses before anything moves. The switch to an existing branch is only printed with say, never recorded with note_change, so a refusal prints 'changed: nothing' after HEAD moved, and exit 3 leaves the copy switched. Sibling paths: the fresh-spawn exit-3 refusal (bin/fm-spawn.sh:3881-3889) leaves the pooled copy on the branch; tests/fm-task-delivery.test.sh has to re-detach the scout after its exit-3 promotion; bin/fm-promote.sh:252-260 runs the owner before the self-repository publication gate (lines 264-273), so a gate refusal comes after archive/advance changes while the message says only 'the task record is unchanged'. Fix: record the switch with note_change or run the custody preflight before switching, and move the promotion resync after the publication gate.
  • ⚠️ bin/fm-pr-resync.sh:208 - The --check dry-run mode (lines 73-77, 208-216, 265) has no caller and no intent requirement asks for it. It adds its own objects-only fetch and re-advertise path. Spawn, promote, relaunch, the generated DoD block and validation-supervision all call the owner without --check; only tests/fm-pr-resync.test.sh uses it. Recommend removing it unless it is wanted as an operator tool; that is the author's call.
  • ⚠️ bin/fm-promote.sh:267 - Sibling left behind by the round-1 F2 fix (fm-promote.sh:252-273). The fix moved the --pr-branch resync after the self-repository publication gate, but the resync still runs before the brief-content refusals at bin/fm-promote.sh:283-307: the {TASK}/{FIRSTMATE_SPEC} placeholder check, the content-validity check, the operator-address check and the provenance-marked intent check. Concrete sequence: a scout whose brief still has a placeholder is promoted with --pr-branch onto a pipeline-rebased branch. fm-pr-resync switches the detached scout worktree, archives the stale local head and advances the branch (exit 0). Promotion then exits 1 with only the brief error, so the scout worktree has been switched, archived and advanced although the promotion was refused. That is the 'mutation before a refusal' F2 was meant to close. Those four checks only read the brief, so the smallest fix is to move the PR_BRANCH_SET resync block below line 307, just before the ship instructions are rendered. A test would promote with a placeholder brief and assert the worktree HEAD and branch ref are unchanged.
  • ℹ️ bin/fm-pr-resync.sh:51 - The header line edited in the fix round says an unhandled custody verdict 'refuses before any ref moves'. That is still not true in one case: with a detached worktree and no local branch, line 242 creates refs/heads/<branch> at the published head before the custody read at lines 260-263. Creating that ref is reported correctly (note_change) and matches the authorized behavior in lines 17-20, but the header claim is wrong. Reword it to e.g. 'refuses before any archive or advance (a detached switch or branch creation is reported)' so the comment doesn't overstate the guarantee.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-pr-resync.sh:208 - The --check dry-run mode (lines 73-77, 208-216, 265) has no caller and no intent requirement asks for it. It adds its own objects-only fetch and re-advertise path. Spawn, promote, relaunch, the generated DoD block and validation-supervision all call the owner without --check; only tests/fm-pr-resync.test.sh uses it. Recommend removing it unless it is wanted as an operator tool; that is the author's call.
⚠️ **Test** - 1 info
  • ℹ️ bin/fm-pr-resync.sh:208 - F3 disposition carried forward: the --check dry-run mode is intentionally kept. It is the approved spec1g, plan and T1 AC4 operator contract, the removal suggestion was declined, and this is not a pending product question. A live run in this step showed --check changes no refs and writes no FETCH_HEAD.
  • Live validation: ✅ go - 10 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Continuing a PR whose head the pipeline rebased: the resync owner archives the stale local commit under archive/<task>-pre-rebase-<sha8> and advances the branch to the published head without pushing ✅ pass live live-fm-pr-resync-transcript.txt S1c: result=archived-advanced, the archive ref holds the stale commit, the branch is at the published head, origin is unchanged; S1d rerun gives result=equal
Adversarial: a dirty worktree refuses before any archive or advance ✅ pass live live-fm-pr-resync-transcript.txt S1b: exit 1, 'changed: nothing', branch still at the stale commit
--check plans the action without changing any ref or writing FETCH_HEAD ✅ pass live live-fm-pr-resync-transcript.txt S1a: planned:archive-advance, refs unchanged, no FETCH_HEAD
A detached pool copy at an origin/main that moved past the PR base is accepted and placed on the published head ✅ pass live live-fm-pr-resync-transcript.txt S2: branch created at the published head, exit 0
Adversarial: a detached copy with a genuinely unanchored commit refuses and leaves HEAD unchanged ✅ pass live live-fm-pr-resync-transcript.txt S3: exit 1, HEAD unchanged and still detached, no branch created
Adversarial: an archive name already held by another commit refuses without moving the branch ✅ pass live live-fm-pr-resync-transcript.txt S4
Unpublished local commits ahead of the published head are kept (ahead:N) ✅ pass live live-fm-pr-resync-transcript.txt S5: result=ahead:1
fm-promote --pr-branch on a dirty scout refuses through the owner, leaving the task record, branch and worktree untouched ✅ pass live live-fm-promote-brief-transcript.txt P1
fm-promote --pr-branch puts the scout worktree on the published head, archives the stale head, records branch=, and the instructions say not to create a branch ✅ pass live live-fm-promote-brief-transcript.txt P2
A successor ship brief with --pr-branch continues the exact branch, PR policy unchanged (default branch), and the DoD calls bin/fm-pr-resync.sh instead of hand recovery ✅ pass live live-fm-promote-brief-transcript.txt B1, plus B2 refusal of the --branch-prefix combination
fm-spawn --pr-branch, Orca, pool-copy and relaunch paths resync from the published head, with negative controls ⏸️ untested no The prior payload did not establish a live result. Only tests/fm-spawn-pool-base-freshen, fm-spawn-orca-worktree, fm-control-relaunch and fm-task-delivery (all exit 0) exercised these paths, running t…
No-mistakes custody handling (blocked_diverged, recover_custody, the bind-archive path, and active-run exit 3 monitoring-only) ⏸️ untested no The prior payload did not establish a live result. Only tests/fm-pr-resync.test.sh and tests/fm-task-delivery.test.sh (exit 0) covered this, using a no-mistakes stand-in that replays recorded v1.84.0…
  • bin/fm-pr-resync.sh demo &lt;wt&gt; fm/demo --check, run live on a stale local branch against a pipeline-rebased origin head
  • bin/fm-pr-resync.sh demo &lt;wt&gt; fm/demo, run live: dirty-tree refusal, archived-advanced, idempotent rerun, ahead:1, and a branch origin lacks
  • bin/fm-pr-resync.sh run live on a detached copy at a moved origin/main (accepted), a detached copy with an unanchored commit (refused) and an archive-name collision (refused)
  • bin/fm-promote.sh live-pr1 --mode direct-PR --yolo off --pr-branch feature/pr in a bin/fm-lab-home.sh lab home: dirty refusal, then a clean promotion
  • bin/fm-brief.sh live-pr2 fixture-project --mode no-mistakes --pr-branch feature/pr, plus --pr-branch combined with --branch-prefix (refused)
  • bash tests/fm-pr-resync.test.sh (exit 0)
  • bash tests/fm-task-delivery.test.sh (exit 0)
  • bash tests/fm-spawn-pool-base-freshen.test.sh (exit 0)
  • bash tests/fm-spawn-orca-worktree.test.sh (exit 0)
  • bash tests/fm-control-relaunch.test.sh (exit 0)
  • bash tests/fm-brief.test.sh (exit 0)
  • bash tests/fm-dod-lib.test.sh (exit 0)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

bin/fm-pr-resync.sh verifies a branch's published head on origin, archives
stale non-contained local history under archive/<task>-pre-rebase-<sha8>,
advances with reset --keep on a clean tree, and settles no-mistakes branch
custody only through native-offered actions with refusals and no force.
tests/fm-pr-resync.test.sh reproduces a pipeline-rebased published head
against a stale local branch with a real bare remote.
…--check ref-free

The resync owner now refuses a native no-mistakes verdict outside its handled
set at the preflight and pre-move reads, before any archive or advance, and
--check fetches objects only so no remote-tracking ref or FETCH_HEAD changes.
--check now reads origin's advertised head before and after its ref-free
fetch and refuses when they differ, so a move to an already-present commit
cannot pass the fetched/advertised check; the redundant unreadable-custody
branch is folded into the handled-verdict refusal.
fm-brief and fm-spawn gain --pr-branch for continuing an existing
published branch: the brief ships that exact branch, and the spawn runs
bin/fm-pr-resync.sh on the pooled copy instead of the hard-reset base
refresh, refusing unless it settles. --from-branch starts a ship or scout
from origin's source branch while the pull request keeps its default
target. A ship relaunch whose recorded branch is on origin runs the owner
in the recorded worktree first and embeds its monitoring-only contract
when a run is active; fm-promote --pr-branch runs the owner before the
task record changes.
…nuation's ship line

A successor launched with --from-branch keeps its brief's Source branch
line, so checking it on relaunch refused every relaunch of that task.
The agreement now binds only the launch that selects the start. A
--pr-branch launch also no longer inherits the legacy default-branch
warning: its brief must carry the matching Ship branch line.
The no-mistakes driving block now names bin/fm-pr-resync.sh with the task and
branch for a branch diverged from or rewritten against the pipeline's
published head, and validation-supervision names it for supervisors, so
neither teaches a hand-run archive/reset/sync sequence.
… test

The validation-supervision check grepped skill source, which the coding
guidelines forbid; the rendered DoD assertions stay.
The no-mistakes driving block now names each brief's task and branch in the
resync owner command, so the gerrit/default forge comparison maps that line
the same way it already maps the arm command.
The advance is now conditional on the branch tip captured at classification,
so a concurrent local commit makes the owner refuse instead of resetting it
away, and a detached HEAD holding commits absent from the branch and the
published head refuses before any switch. Every Git network call, including
the relaunch pre-probe, runs under the existing bounded runner and refuses on
timeout while reporting earlier changes.

A PR continuation brief keeps its Base branch line so spawn accepts
--pr-branch with --base-branch, and a fresh Orca copy is detached before the
continuation resync while its initial branch stays.

Tests cover mismatched keep-local identities, the monitoring-only contract's
permissions and release condition, and active-custody refusal at fresh
continuation and promotion.
@Pibomeister

Copy link
Copy Markdown
Owner Author

Closing as superseded by #50, which contains all of this PR's commits plus the review fixes. Per the captain's decision (GS-003-firstmate).

@Pibomeister Pibomeister closed this Nov 2, 2026
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