Rework #61 into a fork-aware upstream porter (report-only) - #5
Merged
Conversation
…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.
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.
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 fromorigin. For this fork that's exactly backwards:originis upstream (kunchenguid), the fork diverged at the psmux port, and a FF/merge from upstream would drag back rawtmux,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 applyneeds-adapt- touches rawtmux/AGENTS.md/ a psmux-adapted script; re-apply the$FM_MUXandCLAUDE.mddeltaslikely-skip- the secondmate subsystem this fork omitsModes:
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 -npasses onfm-port.shand the test.tmuxintroduced - the porter is multiplexer-agnostic.Docs
CLAUDE.mdsection 0 andREADME.md(toolbelt + test list) document the porter as the fork's upstream-maintenance path.