fix(bin): port upstream clean fixes — landed round-robin, handoff home parse, pr-merge set -u (#640 #686 #205) - #42
Merged
Conversation
…e parse, pr-merge set -u (kunchenguid#640 kunchenguid#686 kunchenguid#205) Three low-risk upstream bug fixes to scripts the fork runs, ported to herdr-backend. First of several catch-up rounds after kunchenguid#555. - fm-bearings-snapshot.sh (kunchenguid#640): the default landed baseline is now balanced round-robin across deterministic home order (each home keeps its own newest-first order) instead of a single global newest-first pass, so a home with the newest dates cannot crowd every other home out of a tight overall cap. --all-landed still reveals the full global newest-first set. - fm-backlog-handoff.sh (kunchenguid#686): resolve the (home: ...) field with a greedy prefix so a parenthetical in the summary/scope prose before that field no longer makes the entry look like it "has no home". - fm-pr-merge.sh (kunchenguid#205): use the set -u-safe "${arr[@]+"${arr[@]}"}" idiom for merge_args, which expands an empty array to nothing. Expanding an empty array under set -u fails on bash < 4.4 (stock macOS bash 3.2), which happens when the caller forwards an explicit merge method. The fork's fm-spawn already used this idiom; only fm-pr-merge needed it. Tests: a bearings round-robin balance test (two homes, tight cap → one per home, not both from the newest home) and a handoff parenthetical-home test. Local gate: shellcheck bin/*.sh tests/*.sh clean; all tests/*.test.sh pass.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_0eb6aa4f-c8a5-4bea-b9be-11637e0e83a8) |
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.
First catch-up round after kunchenguid#555. Three low-risk upstream bug fixes to scripts the fork already runs.
kunchenguid#640 — balanced landed baseline (
fm-bearings-snapshot.sh)Default
landedis now round-robin across deterministic home order (each home keeps its own newest-first order) instead of one global newest-first pass, so a home with the newest dates can't crowd every other home out of a tight overall cap.--all-landedstill gives the full global newest-first set.kunchenguid#686 — parse home after a parenthetical (
fm-backlog-handoff.sh)Resolve the
(home: ...)field with a greedy prefix, so a parenthetical in the summary/scope prose before that field no longer makes the entry look like it "has no home".kunchenguid#205 — set -u-safe array expansion (
fm-pr-merge.sh)Use
${arr[@]+"${arr[@]}"}formerge_args— an empty-array expansion underset -ufails on bash < 4.4 (stock macOS bash 3.2), which happens when the caller forwards an explicit merge method. The fork'sfm-spawnalready had this idiom; onlyfm-pr-mergeneeded it.Tests
Local gate:
shellcheck bin/*.sh tests/*.shclean; alltests/*.test.shpass (26 suites).Next rounds (separate PRs): kunchenguid#637+kunchenguid#636 (guard/session-start, more involved), kunchenguid#556 (PR-check hardening), kunchenguid#687/kunchenguid#656 (features), kunchenguid#593 (durable decision holds), doc cherry-picks.
Note
Low Risk
Localized script and jq projection changes with regression tests; no auth, data migration, or API surface changes.
Overview
Ports three upstream script fixes with matching behavior tests.
fm-bearings-snapshot.sh— Default boundedlandedselection no longer sorts all homes globally by merge date. It keeps per-home newest-first caps, then round-robins across homes so a tight overall cap cannot be filled entirely by the main home.--all-landedis unchanged (full global newest-first).fm-backlog-handoff.sh—secondmate_homeparsing no longer requires no parentheses before(home: …); a greedy match finds the structured home field even when summary prose has earlier parentheticals.fm-pr-merge.sh— Uses${merge_args[@]+"${merge_args[@]}"}so an emptymerge_argsunderset -udoes not break on bash 3.2 when the caller passes an explicit merge method.Tests cover round-robin landed balance and handoff after a parenthetical before
(home: …).Reviewed by Cursor Bugbot for commit d4f995f. Bugbot is set up for automated code reviews on this repo. Configure here.