Repository navigation
fix(bin): parameterize task-branch prefix and retry swallowed herdr Enter - #2706
chappellerj wants to merge 5 commits into
Conversation
fm-send to a herdr-backed claude pane repeatedly reported the Enter swallowed with the text left in the composer, while a manual operator follow-up fm-send --key Enter reliably landed the same text every time. fm_backend_herdr_send_text_submit's retry loop now runs a bounded (FM_BACKEND_HERDR_SWALLOW_RETRIES, default 2) Enter-only sweep itself when it is about to report a genuine idle-baseline swallow, instead of failing out and leaving the operator to do it by hand. Every other unsubmittable state still reports pending/unknown exactly as before.
Generated ship briefs hardcoded fm/<id> branch language, which overrode per-task instructions to use a different prefix in a shared repo where another fleet already owns the fm/* namespace, and crews pushed into that other fleet's namespace. bin/fm-brief.sh now reads a local, gitignored config/branch-prefix file (absent = default fm/) and uses it consistently across the branch-creation step, the push rule, and every mode's <prefix><id> mention.
…d FM_BACKEND_HERDR_SWALLOW_RETRIES, missing fm-brief CONFIG resolution note, and hardcoded fm/ branch text in fm-promote.sh
…efix code gap for follow-up
…-diff The no-mistakes document gate flagged that bin/fm-merge-local.sh and bin/fm-review-diff.sh still hardcoded fm/<id> and did not read config/branch-prefix, so a captain who configures a non-default prefix would have local-only merges and diff review silently look for the wrong branch name and fail - a functional hole in the branch-prefix feature this branch ships, not a documentation gap. Extracted the resolution into bin/fm-branch-prefix-lib.sh (fm_branch_prefix_resolve) as the single owner, and pointed bin/fm-brief.sh at the shared helper too so all three scripts agree on the same branch name.
|
Speaking as Kun's firstmate: Scheduled firstmate-oss pass. Diff reviewed against main (head Split classification (do not treat as one bucket):
VISION (per section, both halves unless noted):
Merge-eligible: YES. Neither half is default-behavior. Overlap: this PR and #2700 both add |
kunchenguid
left a comment
There was a problem hiding this comment.
Speaking as Kun's firstmate: reviewed the full diff. No security risk. Split: prefix is opt-in, herdr swallow sweep is corrective. Approve pending first-time fork CI.
What Changed
bin/fm-brief.shnow resolves the ship task branch prefix fromconfig/branch-prefix(defaulting tofm/) instead of hardcoding it, andbin/fm-promote.shfollows the same resolved prefix when promoting a scout to a ship branch.bin/backends/herdr.shdetects a swallowed follow-up Enter on herdr Claude panes and retries it, preventing a submitted send from silently stalling.AGENTS.md,docs/configuration.md,docs/architecture.md,docs/herdr-backend.md, anddocs/verification/runtime-backends.mdto document the branch-prefix config and the herdr swallow-retry behavior, correcting a stale swallow-verdict claim and an undocumentedFM_BACKEND_HERDR_SWALLOW_RETRIESvariable.tests/fm-brief.test.sh(branch-prefix default, configured value, blank-file fallback) andtests/fm-backend-herdr.test.sh(swallow detection and retry sweep).Risk Assessment
✅ Low: Both changes are narrowly scoped, well-tested with exact-call-count assertions, and the one known gap (fm-merge-local.sh/fm-review-diff.sh not yet honoring config/branch-prefix) is explicitly and accurately disclosed in docs rather than silently left broken.
Testing
Ran the colocated fm-brief.sh test suite (23/23 passing, including all three new branch-prefix tests) and isolated the two new/modified herdr swallow-sweep tests plus a baseline non-swallow regression test (all passing); the full fm-backend-herdr.test.sh suite was still running cleanly (76+ passed, 0 failed) at report time due to its real-sleep-based timing. Beyond unit tests, I produced direct CLI evidence generating real briefs with bin/fm-brief.sh under a configured config/branch-prefix (ryan-fm/) and confirmed the branch-creation step, push rule, and definition-of-done text consistently use the configured prefix across no-mistakes and local-only modes, while an unconfigured home still defaults to fm/ — demonstrating the end-user-facing behavior the change was meant to fix.
Evidence: fm-brief.sh branch-prefix end-to-end CLI transcript (configured ryan-fm/ prefix across no-mistakes/local-only modes, and default fm/ when unconfigured)
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-brief.test.sh(full file, 23/23 ok, including the 3 new branch-prefix tests: test_branch_prefix_defaults_to_fm, test_branch_prefix_honors_configured_value, test_branch_prefix_blank_file_falls_back_to_default)Isolated run oftest_send_text_submit_detects_swallowed_enterandtest_send_text_submit_swallow_sweep_lands_a_stubborn_enterfrom tests/fm-backend-herdr.test.sh via a spliced runner sourcing tests/lib.sh and tests/herdr-test-safety.sh — both passIsolated run oftest_send_text_submit_detects_landed_send(baseline non-swallow path, unmodified by this change) to confirm no regression in the ordinary send-confirmation pathFullbash tests/fm-backend-herdr.test.shsuite run in background (in progress at report time: 76+/181 tests passed, 0 failures, spanning tests both before and after the modified swallow-sweep tests in file order)Manual end-to-end CLI verification:FM_HOME=<tmp> bin/fm-brief.sh <id> firstmate --mode no-mistakeswith config/branch-prefix=ryan-fm/, --mode local-only with the same config, and --mode no-mistakes with no config file present, inspecting the generated brief.md branch-creation/push/DOD lines directlybash -nsyntax check on bin/backends/herdr.sh, bin/fm-brief.sh, bin/fm-promote.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.