Skip to content

fix(bin): let a released task land through the sanctioned merge path - #34

Merged
sbracewell64 merged 3 commits into
mainfrom
fm/fork-land-landing-record
Aug 3, 2026
Merged

sbracewell64 merged 3 commits into
mainfrom
fm/fork-land-landing-record

Conversation

@sbracewell64

Copy link
Copy Markdown
Owner

Intent

Repair the sanctioned landing path so a task released before its PR lands can still be landed
through it. The captain's parked-completion ruling releases a worker once its PR is green and
mergeable — before it lands — which stranded every such PR from the only sanctioned merge
command with task metadata is unavailable.

What changed

Teardown now preserves a minimal landing record for a task released with an unlanded PR, and
the merge/check commands accept a task whose metadata is gone, deriving landing identity
from the forge rather than from the caller
. Two defects the review caught were fixed in the
same round:

  • An existing landing record's pr= must now match the requested URL; reconstruction
    happens only when no record exists. Previously a caller-supplied URL could silently rebind
    any open PR to a released task id and merge it — on a repo where one branch is
    simultaneously a fork PR and a live upstream contribution, that is not theoretical.
  • A malformed record is now refused rather than silently reconstructed. Reconstruction on
    absent is correct; reconstruction on malformed defeated the tamper guard.

Validation

Suites green on the moved trunk: fm-pr-merge 16, fm-teardown 43, fm-pr-check-security
41, plus lint, doc-audience and the coverage guard — and four independent negative
controls
, each constructing the failing condition and confirming the refusal fires.

merge-tree against trunk 1149178f exits 0, and its result tree equals this branch's
tree exactly, so no trunk content is lost.

Provenance

This is a fork-landing branch built from current trunk. It carries no pipeline signature and
none was copied
— the pipeline raises against upstream, where this work is already open as
PR 1561, whose branch is deliberately left untouched. The signature check is expected to fail
for that reason, not because the content is unvalidated.

The captain's parked-completion ruling releases a ship worker once its pull
request is done, green, and mergeable - that is, before it lands. Cleanup then
removes state/<id>.meta, and both bin/fm-pr-merge.sh and bin/fm-pr-check.sh
refused with "task metadata is unavailable" without it. Following the ruling
therefore stranded the pull request from the only sanctioned merge command, and
AGENTS.md section 7 forbids reaching around that guard with a lower-level one.

Landing identity now comes from the forge rather than from the caller:

- bin/fm-teardown.sh leaves a minimal private state/<id>.landing record (pr,
  the forge's pr_head, project) when it releases a ship task whose request has
  not landed. The forge decides: the record is written unless the forge
  positively reports the request merged, because an unreachable forge is not
  evidence that anything landed. A failed write warns and never blocks cleanup,
  and the pending landing is reported so the released request is not forgotten.
- bin/fm-pr-lib.sh resolves "the task's PR identity record" in one place, as the
  meta while a task is live and the landing record once it is released. The
  merge poll's validity and retirement checks go through that resolver, so a
  released task's merge watch can be rearmed and still retires normally.
- bin/fm-pr-check.sh and bin/fm-pr-merge.sh accept a released task through that
  record, and rebuild one from a forge read of the request itself for a task
  released before landing records existed. Nothing is asserted by the caller.
- A merge through a landing record re-reads the request at its forge and refuses
  unless it is still open, so no stale local value decides anything. It arms no
  poll, because a released task has nothing left to watch and the merge is
  synchronous, and the spent record is removed once the request lands.

The metadata refusal is preserved exactly where it still means something: a task
with no meta, no landing record, and no request the forge can resolve is refused
before gh-axi is called, as before.
@sbracewell64
sbracewell64 merged commit 5e6e90f into main Aug 3, 2026
13 of 14 checks passed
sbracewell64 added a commit that referenced this pull request Aug 9, 2026
Squash-reconcile of the fork trunk (48 commits through ed376cf, fork PRs
#8-#48 plus CI mirrors) rebased onto upstream main at 74230fc, resolving
72 conflicted files. The fork trunk carries: the fm-launch-lib.sh
one-owner launch refactor, the slot-base/contribution-target task base
contract (fm-task-base-lib.sh), the zero-budget model registry, fleet
admission control stages 0/1, the wake-outcome ledger, the LoopSpec
canonical representation, the research-approved-work corpus scanner, the
70% compaction doctrine, from-firstmate steer markers, the fleet launcher
menu and Windows-to-WSL bridge, forge-verified merge gates, and the
fleet-view per-argument cap fix.

Conflict-resolution decisions a reviewer cannot see from the diff alone:

- Where the fork carried an older in-flight import of upstream work
  (delivery contracts kunchenguid#1563, remote secondmate homes kunchenguid#1576, trace context
  kunchenguid#995, and every add/add remote-secondmate file), upstream's landed and
  further-evolved version wins outright; nothing fork-specific lived in
  those copies (verified blob-by-blob against upstream history).
- Upstream's --relaunch lifecycle control plane and the fork's task base
  contract both survive: base derivation and the brief base-contract
  guard are gated to fresh spawns (RELAUNCH=0) because a relaunch reuses
  the recorded worktree and bases, and the trunk may have moved since.
- Launch commands stay one-owner in bin/fm-launch-lib.sh: upstream's Muse
  Code adapter is ported into the library (template arm, model flag,
  effort mapping with max->ultra) instead of resurrecting the inline
  fm-spawn template, and fm-spawn's post-template FM_PI_HARNESS prefix is
  dropped because the library's pi templates carry the marker themselves.
- Herdr presentation spaces keep upstream's 0.8.0-floor semantics
  (config off/on/empty, two-argument fm_backend_herdr_presentation_enabled)
  across spawn, config inheritance, docs, and tests.
- fm-pr-check derives its per-task lock from state/<id>.meta explicitly
  so upstream's kunchenguid#1568 meta locking coexists with the fork's #34 landing
  records (fm_meta_lock_path rejects a .landing path).
- tests/lib.sh keeps both the fork's identity-verified background-process
  reaper and upstream's fm_fake_version_tool fixture.
- Merged prose follows upstream's X-mode -> Relay rename.

Pre-existing on both parents, not introduced here:
tests/fm-calm-pi-extension.test.sh fails under system Node 22
(ERR_UNKNOWN_FILE_EXTENSION), verified identical on the base commit.

Co-Authored-By: Claude Fable 5 <[email protected]>
sbracewell64 added a commit that referenced this pull request Aug 9, 2026
…34)

* fix(bin): keep a released task's PR landable through the sanctioned path

The captain's parked-completion ruling releases a ship worker once its pull
request is done, green, and mergeable - that is, before it lands. Cleanup then
removes state/<id>.meta, and both bin/fm-pr-merge.sh and bin/fm-pr-check.sh
refused with "task metadata is unavailable" without it. Following the ruling
therefore stranded the pull request from the only sanctioned merge command, and
AGENTS.md section 7 forbids reaching around that guard with a lower-level one.

Landing identity now comes from the forge rather than from the caller:

- bin/fm-teardown.sh leaves a minimal private state/<id>.landing record (pr,
  the forge's pr_head, project) when it releases a ship task whose request has
  not landed. The forge decides: the record is written unless the forge
  positively reports the request merged, because an unreachable forge is not
  evidence that anything landed. A failed write warns and never blocks cleanup,
  and the pending landing is reported so the released request is not forgotten.
- bin/fm-pr-lib.sh resolves "the task's PR identity record" in one place, as the
  meta while a task is live and the landing record once it is released. The
  merge poll's validity and retirement checks go through that resolver, so a
  released task's merge watch can be rearmed and still retires normally.
- bin/fm-pr-check.sh and bin/fm-pr-merge.sh accept a released task through that
  record, and rebuild one from a forge read of the request itself for a task
  released before landing records existed. Nothing is asserted by the caller.
- A merge through a landing record re-reads the request at its forge and refuses
  unless it is still open, so no stale local value decides anything. It arms no
  poll, because a released task has nothing left to watch and the merge is
  synchronous, and the spent record is removed once the request lands.

The metadata refusal is preserved exactly where it still means something: a task
with no meta, no landing record, and no request the forge can resolve is refused
before gh-axi is called, as before.

* no-mistakes(review): enforce landing identity before reconstruction

* no-mistakes(document): Document released-task landing identity
sbracewell64 added a commit that referenced this pull request Aug 10, 2026
…34)

* fix(bin): keep a released task's PR landable through the sanctioned path

The captain's parked-completion ruling releases a ship worker once its pull
request is done, green, and mergeable - that is, before it lands. Cleanup then
removes state/<id>.meta, and both bin/fm-pr-merge.sh and bin/fm-pr-check.sh
refused with "task metadata is unavailable" without it. Following the ruling
therefore stranded the pull request from the only sanctioned merge command, and
AGENTS.md section 7 forbids reaching around that guard with a lower-level one.

Landing identity now comes from the forge rather than from the caller:

- bin/fm-teardown.sh leaves a minimal private state/<id>.landing record (pr,
  the forge's pr_head, project) when it releases a ship task whose request has
  not landed. The forge decides: the record is written unless the forge
  positively reports the request merged, because an unreachable forge is not
  evidence that anything landed. A failed write warns and never blocks cleanup,
  and the pending landing is reported so the released request is not forgotten.
- bin/fm-pr-lib.sh resolves "the task's PR identity record" in one place, as the
  meta while a task is live and the landing record once it is released. The
  merge poll's validity and retirement checks go through that resolver, so a
  released task's merge watch can be rearmed and still retires normally.
- bin/fm-pr-check.sh and bin/fm-pr-merge.sh accept a released task through that
  record, and rebuild one from a forge read of the request itself for a task
  released before landing records existed. Nothing is asserted by the caller.
- A merge through a landing record re-reads the request at its forge and refuses
  unless it is still open, so no stale local value decides anything. It arms no
  poll, because a released task has nothing left to watch and the merge is
  synchronous, and the spent record is removed once the request lands.

The metadata refusal is preserved exactly where it still means something: a task
with no meta, no landing record, and no request the forge can resolve is refused
before gh-axi is called, as before.

* no-mistakes(review): enforce landing identity before reconstruction

* no-mistakes(document): Document released-task landing identity
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…34)

* fix(bin): keep a released task's PR landable through the sanctioned path

The captain's parked-completion ruling releases a ship worker once its pull
request is done, green, and mergeable - that is, before it lands. Cleanup then
removes state/<id>.meta, and both bin/fm-pr-merge.sh and bin/fm-pr-check.sh
refused with "task metadata is unavailable" without it. Following the ruling
therefore stranded the pull request from the only sanctioned merge command, and
AGENTS.md section 7 forbids reaching around that guard with a lower-level one.

Landing identity now comes from the forge rather than from the caller:

- bin/fm-teardown.sh leaves a minimal private state/<id>.landing record (pr,
  the forge's pr_head, project) when it releases a ship task whose request has
  not landed. The forge decides: the record is written unless the forge
  positively reports the request merged, because an unreachable forge is not
  evidence that anything landed. A failed write warns and never blocks cleanup,
  and the pending landing is reported so the released request is not forgotten.
- bin/fm-pr-lib.sh resolves "the task's PR identity record" in one place, as the
  meta while a task is live and the landing record once it is released. The
  merge poll's validity and retirement checks go through that resolver, so a
  released task's merge watch can be rearmed and still retires normally.
- bin/fm-pr-check.sh and bin/fm-pr-merge.sh accept a released task through that
  record, and rebuild one from a forge read of the request itself for a task
  released before landing records existed. Nothing is asserted by the caller.
- A merge through a landing record re-reads the request at its forge and refuses
  unless it is still open, so no stale local value decides anything. It arms no
  poll, because a released task has nothing left to watch and the merge is
  synchronous, and the spent record is removed once the request lands.

The metadata refusal is preserved exactly where it still means something: a task
with no meta, no landing record, and no request the forge can resolve is refused
before gh-axi is called, as before.

* no-mistakes(review): enforce landing identity before reconstruction

* no-mistakes(document): Document released-task landing identity
sbracewell64 added a commit that referenced this pull request Aug 11, 2026
…34)

* fix(bin): keep a released task's PR landable through the sanctioned path

The captain's parked-completion ruling releases a ship worker once its pull
request is done, green, and mergeable - that is, before it lands. Cleanup then
removes state/<id>.meta, and both bin/fm-pr-merge.sh and bin/fm-pr-check.sh
refused with "task metadata is unavailable" without it. Following the ruling
therefore stranded the pull request from the only sanctioned merge command, and
AGENTS.md section 7 forbids reaching around that guard with a lower-level one.

Landing identity now comes from the forge rather than from the caller:

- bin/fm-teardown.sh leaves a minimal private state/<id>.landing record (pr,
  the forge's pr_head, project) when it releases a ship task whose request has
  not landed. The forge decides: the record is written unless the forge
  positively reports the request merged, because an unreachable forge is not
  evidence that anything landed. A failed write warns and never blocks cleanup,
  and the pending landing is reported so the released request is not forgotten.
- bin/fm-pr-lib.sh resolves "the task's PR identity record" in one place, as the
  meta while a task is live and the landing record once it is released. The
  merge poll's validity and retirement checks go through that resolver, so a
  released task's merge watch can be rearmed and still retires normally.
- bin/fm-pr-check.sh and bin/fm-pr-merge.sh accept a released task through that
  record, and rebuild one from a forge read of the request itself for a task
  released before landing records existed. Nothing is asserted by the caller.
- A merge through a landing record re-reads the request at its forge and refuses
  unless it is still open, so no stale local value decides anything. It arms no
  poll, because a released task has nothing left to watch and the merge is
  synchronous, and the spent record is removed once the request lands.

The metadata refusal is preserved exactly where it still means something: a task
with no meta, no landing record, and no request the forge can resolve is refused
before gh-axi is called, as before.

* no-mistakes(review): enforce landing identity before reconstruction

* no-mistakes(document): Document released-task landing identity
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