Skip to content

Rework #61 into a fork-aware upstream porter (report-only) - #5

Merged
augustomklee merged 1 commit into
mainfrom
port-upstream-batch-4
Jun 24, 2026
Merged

Rework #61 into a fork-aware upstream porter (report-only)#5
augustomklee merged 1 commit into
mainfrom
port-upstream-batch-4

Conversation

@augustomklee

Copy link
Copy Markdown
Owner

What

The last item of the upstream-port work, and the only rework rather than a straight port.

Upstream's kunchenguid#61 added fm-update.sh, which fast-forwards the repo from origin. For this fork that's exactly backwards: origin is upstream (kunchenguid), the fork diverged at the psmux port, and a FF/merge from upstream would drag back raw tmux, AGENTS.md, and the secondmate subsystem. So kunchenguid#61 is inverted into a report-only porter that scripts the cherry-pick-and-port workflow we used for batches 1-3.

Per your call: mode A (guided checklist), no automated edits.

Pieces

  • bin/fm-port.sh - enumerates commits upstream has that the fork lacks and classifies each:

    • clean - no fork-adapted surface; a cherry-pick should apply
    • needs-adapt - touches raw tmux / AGENTS.md / a psmux-adapted script; re-apply the $FM_MUX and CLAUDE.md deltas
    • likely-skip - the secondmate subsystem this fork omits

    Modes: list (default, oldest-first), --json (for the skill), <sha> (one commit's per-file buckets + diff), --no-fetch. The fork-owned surfaces are data-driven lists, easy to extend as the fork diverges further.

  • .agents/skills/port-upstream/SKILL.md - the workflow contract: see what's new, port a chosen commit as a gated PR, with hard guardrails.

  • tests/fm-port.test.sh - fake two-remote repo asserting the four buckets, that the porter never mutates the fork (HEAD unchanged), and that the source contains no merge/pull/ff command. 6/6 green.

The load-bearing guardrail

There is deliberately no merge or fast-forward path in fm-port.sh. It only reads and reports; porting is a human/agent cherry-pick-and-adapt, gated as a PR you merge - same rule as every firstmate-repo change.

Verified on the live divergence

Run against the real upstream-vs-fork gap, the porter reproduces the exact split I worked out by hand at the start of this effort:

Verification

  • bash -n passes on fm-port.sh and the test.
  • Test suite 6/6 green; behavioral report-only guarantee (HEAD unchanged) asserted.
  • No raw tmux introduced - the porter is multiplexer-agnostic.

Docs

CLAUDE.md section 0 and README.md (toolbelt + test list) document the porter as the fork's upstream-maintenance path.

…uid#61)

Upstream's kunchenguid#61 added fm-update.sh, which FAST-FORWARDS the repo from origin. For
this fork that is wrong: origin is upstream (kunchenguid), the fork diverged at
the psmux port, and a FF/merge from upstream would drag back raw tmux, AGENTS.md,
and the secondmate subsystem. So kunchenguid#61 is reworked rather than ported - inverted
into a report-only porter that scripts the cherry-pick-and-port workflow used for
batches 1-3.

Mode A (guided checklist), per captain's call - no automated edits:
- bin/fm-port.sh: enumerate commits upstream has that the fork lacks
  (<local-default>..<upstream>/<default>) and classify each:
    clean        - no fork-adapted surface; cherry-pick should apply
    needs-adapt  - touches raw tmux / AGENTS.md / a psmux-adapted script; re-apply
                   the $FM_MUX and CLAUDE.md deltas by hand
    likely-skip  - the secondmate subsystem this fork omits
  Modes: list (default, oldest-first), --json (for the skill), <sha> (one commit's
  per-file buckets + diff), --no-fetch. Data-driven surface lists, easy to extend.
- .agents/skills/port-upstream/SKILL.md: the workflow contract - see what's new,
  port a chosen commit as a gated PR, hard guardrails (never merge/FF from
  upstream; every change is a captain-merged PR; skip secondmate unless adopted).
- tests/fm-port.test.sh: fake two-remote repo asserting the four buckets, that the
  porter never mutates the fork (HEAD unchanged), and that the source has no
  merge/pull/ff command. 6/6 green.

Guardrail: there is deliberately NO merge or fast-forward path in fm-port.sh.

Verified on the live divergence: the porter reproduces the exact split of the 11
upstream commits worked out by hand this session - 1 clean (kunchenguid#45), 6 needs-adapt
(kunchenguid#31/kunchenguid#54/kunchenguid#55/kunchenguid#59/kunchenguid#60/kunchenguid#61), 4 likely-skip (kunchenguid#37/kunchenguid#42/kunchenguid#43/kunchenguid#56).

Docs: CLAUDE.md section 0 and README.md (toolbelt + test list) document the porter
as the fork's upstream-maintenance path.
@augustomklee
augustomklee merged commit 576ede4 into main Jun 24, 2026
@augustomklee
augustomklee deleted the port-upstream-batch-4 branch June 24, 2026 14:40
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