Repository navigation
fix(bin): report the push's own error when remote inheritance fails - #5658
Merged
kunchenguid merged 1 commit intoSep 25, 2026
Merged
Conversation
Fixes kunchenguid#5295 Session start now reports a remote inheritance failure using the push's own error line instead of the first unchanged item that happened to print before it, and the shared captain preferences header check now names the first required phrase it did not find, on both the local and remote inheritance paths.
Owner
|
Speaking as Kun's firstmate: this is merged. Thank you @karotkriss — really appreciate you taking the time on this. |
mituso89
pushed a commit
to mituso89/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5658) Fixes kunchenguid#5295 Session start now reports a remote inheritance failure using the push's own error line instead of the first unchanged item that happened to print before it, and the shared captain preferences header check now names the first required phrase it did not find, on both the local and remote inheritance paths.
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5658) Fixes kunchenguid#5295 Session start now reports a remote inheritance failure using the push's own error line instead of the first unchanged item that happened to print before it, and the shared captain preferences header check now names the first required phrase it did not find, on both the local and remote inheritance paths.
mehulbhagwani
pushed a commit
to mehulbhagwani/firstmate
that referenced
this pull request
Sep 26, 2026
…henguid#5658) Fixes kunchenguid#5295 Session start now reports a remote inheritance failure using the push's own error line instead of the first unchanged item that happened to print before it, and the shared captain preferences header check now names the first required phrase it did not find, on both the local and remote inheritance paths.
ashkonmousavi
added a commit
to ashkonmousavi/firstmate
that referenced
this pull request
Sep 26, 2026
Intent
Fixes #5295
When pushing inherited material to a remote second mate fails, session start reports
SECONDMATE_SYNC: ... remote inheritance failed on <host>: <reason>with the first line of the push's combined output as the reason.The push prints one
unchanged:line per item before it fails, so the reported reason names the first unchanged item (for exampleconfig/crew-dispatch.json) instead of the error that stopped the push, and the reader is sent to the wrong file.Separately, the shared captain preferences header check fails with a generic message that does not say which required phrase is missing, which leaves a home whose header states the requirements in another language no way to tell what the check wants.
Make the session-start line report the push's own error line when there is one (falling back to today's first line when there is not), and make the header check's failure name the first required phrase it did not find, on both the local and the remote inheritance paths.
Do not change which headers pass the check.
What Changed
remote_inherit_failure_reasoninfm-ff-lib.shand used it infm-bootstrap.sh'ssecondmate_sync, so theSECONDMATE_SYNC: ... remote inheritance failedline reports the push's ownerror:line, falling back to the first output line only when there is none, instead of naming the firstunchanged:item.shared_captain_header_validinfm-config-inherit-lib.shprint the first required phrase it did not find and return 1, and had bothpropagate_shared_captain_preferences(local path) andfm-remote-inherit-push.sh(remote path) appendmissing "<phrase>"to their header-rejection message; the remote script now reuses the library function instead of its own copy. The accepted header set is unchanged.fm-bootstrap-network-parallel.test.shandfm-shared-captain-inheritance.test.shto cover the new failure-reason and missing-phrase reporting.Risk Assessment
✅ Low: Small, well-bounded shell fix that surfaces the push's own error line and names the missing header phrase without altering the accept set, with behavioral tests and a net reduction via deduplication.
Testing
Both affected test suites pass, including the two new regression tests. I additionally drove the two changed shell functions directly: the reason helper now returns the push's
error:line (not the leadingunchanged: config/crew-dispatch.json) and falls back to the first line for an interrupted push with no error, and the header check returns empty/rc0 for a valid header while naming the first missing phrase (must not be edited there, ormain-authoritativefor a header in another language) with rc1. The full bootstrap E2E test confirms the SECONDMATE_SYNC line reports the shared-captain header problem rather than an earlier unchanged item. These are backend CLI/shell behaviors with no rendered UI surface, so evidence is CLI transcripts rather than screenshots. Worktree left clean; evidence written to the evidence directory.bash tests/fm-bootstrap-network-parallel.test.shnew test drives fm-bootstrap.sh end-to-end; SECONDMATE_SYNC line names the shared-captain header problem and asserts nounchanged:in the reason (i…error:line returns the first line unchanged (failure-reason-old-vs-new.log)bash tests/fm-shared-captain-inheritance.test.shnew test; plus live shared_captain_header_valid returningmust not be edited thereandmain-authoritative(header-check-names-missing-phrase.log)shared captain preferences have no valid primary-authoritative headeroriginates from that script's die path (inherit-fail…Evidence: Failure reason: old first_line vs new error-line selection + fallback
Source: Failure reason: old first_line vs new error-line selection + fallback
OLD (first_line): unchanged: config/crew-dispatch.json NEW (remote_inherit_failure_reason): error: shared captain preferences have no valid primary-authoritative header: missing "must not be edited there" No-error fallback: connection reset by host-smEvidence: Header check names the first missing phrase; valid header still passes
Source: Header check names the first missing phrase; valid header still passes
valid header: rc=0 missing='' missing a phrase: rc=1 missing='must not be edited there' foreign-language header: rc=1 missing='main-authoritative'Evidence: Bootstrap E2E: SECONDMATE_SYNC failure line output
Source: Bootstrap E2E: SECONDMATE_SYNC failure line output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-bootstrap-network-parallel.test.shnew test drives fm-bootstrap.sh end-to-end; SECONDMATE_SYNC line names the shared-captain header problem and asserts nounchanged:in the reason (i…error:line returns the first line unchanged (failure-reason-old-vs-new.log)bash tests/fm-shared-captain-inheritance.test.shnew test; plus live shared_captain_header_valid returningmust not be edited thereandmain-authoritative(header-check-names-missing-phrase.log)shared captain preferences have no valid primary-authoritative headeroriginates from that script's die path (inherit-fail…bash tests/fm-bootstrap-network-parallel.test.sh(includes new test_remote_inheritance_failure_names_its_own_error_not_an_unchanged_item, drives fm-bootstrap.sh + fm-remote-inherit-push.sh end-to-end)bash tests/fm-shared-captain-inheritance.test.sh(includes new test_header_check_names_the_missing_phrase)Manual live invocation ofremote_inherit_failure_reasonfrom fm-ff-lib.sh contrasting old first_line vs new behavior and the no-error-line fallbackManual live invocation ofshared_captain_header_validfrom fm-config-inherit-lib.sh on a valid, a phrase-missing, and a foreign-language header✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.