Skip to content

feat(supervision): port upstream self-update skill and ghost-text fix to herdr - #1

Merged
leo1oel merged 1 commit into
herdr-backendfrom
port-upstream-herdr
Jun 24, 2026
Merged

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

Conversation

@leo1oel

@leo1oel leo1oel commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What & why

Adapts the herdr-backend fork to two upstream firstmate commits that were genuinely missing after an audit of the post-fork upstream history. A straight rebase/merge of upstream/main was rejected on purpose: this fork deliberately dropped tmux + treehouse + fm-bootstrap and re-implemented those features for the herdr backend, so selective porting is the maintenance model. Base is herdr-backend (the fork's trunk), not main (which mirrors upstream).

Ported changes

kunchenguid#61 — self-update skill (/updatefirstmate)

  • New bin/fm-update.sh: fast-forwards the running firstmate repo and every registered secondmate home from origin, fast-forward only, mirroring fm-fleet-sync safety (never force / merge-commit / stash; skip + report dirty / diverged / offline / wrong-branch), so prime directive chore: port upstream brief-contract and skill-set doc fixes (#73, #72) #3 holds and no unlanded work is discarded.
  • herdr adaptation: upstream leases secondmate homes at a detached HEAD on the default branch (treehouse). This fork's homes are herdr worktrees on a lease branch secondmate-<id>, so ff_target accepts the default branch or that lease branch or a detached HEAD and fast-forwards it to origin/<default>. Nudges target fm-<id> (the herdr pane, resolved by fm-send) instead of tmux window targets.
  • New /updatefirstmate skill, AGENTS.md §12, and README entries.
  • New tests/fm-update.test.sh — 12 cases, including a herdr-specific lease-branch skip test.

kunchenguid#59 — composer detection ignores Claude ghost text

Claude renders a dim/faint predicted-next-prompt suggestion inside an otherwise-empty composer; the herdr composer detector (shared by the away-mode daemon and fm-send) would misread it as pending input. Both upstream prongs ported:

  • Prong 1: launch claude with CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false (per-launch env prefix in fm-spawn.sh, scoped to firstmate-launched agents; never touches the captain's global config).
  • Prong 2: fm-herdr-lib.sh now captures herdr pane read --format ansi and strips dim/faint (SGR 2) runs via a new fm_herdr_strip_ghost (ported verbatim from upstream's hardened awk, which preserves SGR-colored normal-intensity typed text) before the existing border-aware classification. The styled capture stays internal; fm-peek and human-facing reads stay plain.
  • New tests/fm-composer-ghost.test.sh — 9 cases. AGENTS.md §4/§8 synced.

Deferred (separate decision)

tasks-axi (kunchenguid#55/kunchenguid#60) intentionally not ported: tasks-axi is not installed here, upstream treats it as dormant/conditional scaffolding, and its wiring hangs off the fm-bootstrap this fork removed. Revisit if/when the tool is adopted.

Validation

  • All 8 behavior suites pass (incl. the 2 new ones).
  • shellcheck bin/*.sh tests/*.sh clean; bash -n clean.
  • CLAUDE.md → AGENTS.md and .claude/skills symlink invariants hold.
  • Live smoke: bin/fm-update.sh on a non-default branch safely skips (never forces), prints correct action lines, leaves HEAD untouched.

Note: the local no-mistakes gate is pinned to the repo default branch main (upstream mirror), so it could not validate a branch based on herdr-backend. Validation above was run by hand.

🤖 Generated with Claude Code

… to herdr

Port two upstream changes onto the herdr backend:

- kunchenguid#61 self-update: bin/fm-update.sh fast-forwards the firstmate repo and every
  secondmate home from origin, fast-forward-only with fm-fleet-sync safety
  (never force/merge-commit/stash; skip dirty/diverged/offline/wrong-branch).
  Secondmate homes are herdr worktrees on lease branch secondmate-<id> rather
  than detached-HEAD treehouse leases, and nudges target fm-<id> (herdr pane).
  Adds the /updatefirstmate skill, AGENTS.md section 12, README entries, and
  tests/fm-update.test.sh.

- kunchenguid#59 ghost text: launch claude with CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
  and make fm-herdr-lib.sh capture `herdr pane read --format ansi` then strip
  dim/faint (SGR 2) runs before border-aware classification, so Claude's
  predicted-prompt ghost text never reads as pending input. The styled capture
  stays internal; fm-peek stays plain. Adds tests/fm-composer-ghost.test.sh.
@leo1oel
leo1oel merged commit f4a4dfa into herdr-backend Jun 24, 2026
@leo1oel
leo1oel deleted the port-upstream-herdr branch June 24, 2026 22:05
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