Skip to content

fix(bin): port upstream clean fixes — landed round-robin, handoff home parse, pr-merge set -u (#640 #686 #205) - #42

Merged
leo1oel merged 1 commit into
herdr-backendfrom
port-upstream-fixes-1
Jul 25, 2026
Merged

leo1oel merged 1 commit into
herdr-backendfrom
port-upstream-fixes-1

Conversation

@leo1oel

@leo1oel leo1oel commented Jul 19, 2026 •

Copy link
Copy Markdown
Owner

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 landed is 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-landed still 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[@]}"} for merge_args — an empty-array expansion 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 had this idiom; only fm-pr-merge needed it.

Tests

  • bearings round-robin balance (two homes, tight cap → one per home, not both from the newest home)
  • handoff parenthetical-home resolution

Local gate: shellcheck bin/*.sh tests/*.sh clean; all tests/*.test.sh pass (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 bounded landed selection 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-landed is unchanged (full global newest-first).

fm-backlog-handoff.sh — secondmate_home parsing 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 empty merge_args under set -u does 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.

…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.
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@leo1oel
leo1oel merged commit 2e0805a into herdr-backend Jul 25, 2026
1 check passed
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