Repository navigation
fix(bin): merge a secondmate child's PR through the owning home - #13
Merged
VasanthAmana merged 2 commits intoOct 15, 2026
Merged
VasanthAmana merged 2 commits into
VasanthAmana merged 2 commits into
Conversation
A parent home has no task record for work its secondmate spawned, so fm-pr-merge.sh refused a green, in-scope child PR as 'task metadata is unavailable' and only a manual merge could land it. --secondmate <id> now runs the same guarded merge in the home that owns the record, locally or on the secondmate's host through fm-on.sh, so every guard, captain hold, recorded outcome, and upward report applies there. The routed merge is attended and main-only because the owning home cannot see this home's away record or supervision actor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A task spawned by a secondmate has its task record only in that secondmate's home.
When the parent home tries to merge that task's PR,
bin/fm-pr-merge.sh(andbin/fm-pr-check.sh, which it calls) refuse withtask metadata is unavailable, because the record is not in the parent'sstate/.The only workaround was merging outside the guarded path, which skips the checks that record merge metadata and refuse an unproved merge.
What changed
bin/fm-pr-merge.shaccepts a leading--secondmate <secondmate-id>option. It reruns the same script, with the remaining arguments, in the secondmate home that owns the task record.FM_*override restated for that home.bin/fm-on.sh.data/secondmates.md.docs/architecture.md, and theship-landingskill.Testing
tests/fm-pr-merge.test.shgains five cases, written to fail before the fix:fm-pr-merge.sh <task-id> <url>to the secondmate's host, relays its output, and reports an ssh exit of 255 as an unknown outcome.The full
tests/fm-pr-merge.test.shsuite passes on bash 3.2, and ShellCheck is clean.The routing and refusal paths were also driven against two disposable lab homes.
A real forge merge and a real remote host were not exercised live; they are covered by the mocked-forge and fake-ssh cases above.