Repository navigation
chore: a ledger for what we port from upstream, and a tool that ports it - #131
Merged
Merged
Conversation
We forked anomalyco/opencode and renamed the product; upstream keeps moving. A merge is off the table — the package was renamed on disk and in every import, and 95 files have changed on both sides — so fixes come across by content, and until now the only record of which ones was the text of one commit message. That is not tracking. Two scripts and one convention: - Every port carries an `Upstream: <sha>` trailer. `script/upstream-ported.txt` seeds the ledger with the fourteen fixes #98 brought over before the trailer existed. - `bun upstream:status` lists upstream commits since the fork point that touch what we track (not their hosted product or site), minus the ledger and release plumbing, by scope. Today: 54. - `bun upstream:port <sha…>` takes an upstream commit's diff, rewrites paths and package names to ours, applies it three-way, and commits it with the trailer. A hunk that no longer fits leaves diff3 markers and the script stops: what to keep there is a decision, and it does not make decisions. Tried on two commits: both stop where our rename of the product name meets upstream's prose, which is exactly the place a person should look. Claude-Session: https://claude.ai/code/session_014XwJPDhq1ahcm3rd454WzQ
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.
We forked
anomalyco/opencodeand renamed the product; upstream keeps moving. Since the fork point (2026-08-17) it has 243 commits, 84 of them in packages we track, and we had ported 14 of those by hand in #98 — recorded only in that commit's message. So "are we up to date?" had no answer the repository could give. This PR makes it answerable, and makes the next port cheap.The convention
Every port carries an
Upstream: <full sha>trailer.script/upstream-ported.txtseeds the ledger with the fourteen from #98, and only grows for ports that could not carry the trailer.bun upstream:statusLists upstream commits since the fork that touch what we track —
packages/opencode(ours:redcode), core, app, tui, ui, sdk, plugin, server and the rest; notconsole,web,stats, which are their hosted product and site — minus the ledger and their release plumbing (sync release versions,chore: generate). Grouped by scope, oldest first.--fetchfetches first,--jsonfor scripts. Today it says 54.bun upstream:port <sha…>For each commit: take its diff, rewrite
packages/opencode/→packages/redcode/,@opencode-ai/*→@reddb-io/redcode-*,OPENCODE_*→REDCODE_*,.opencode→.redcode, thengit apply --3way --index. A clean apply is committed at once with upstream's subject, "Ported from anomalyco/opencode ", upstream's body, and the trailer. A conflicted apply stops with diff3 markers in the tree and names the files — what to keep there is a decision, and the script does not make decisions. It deliberately leaves the bare word "opencode" in prose alone for the same reason.Tried on
7561b4a05(tui) and69c172e8a(provider): both apply with three-way and stop at two and one files respectively, every one of them the place where our rename of the product name meets upstream's text. That is the tool working.Next
The sync tranche, one PR per group, starting with the Anthropic thinking-block binding for Claude 5.1+ (
3f39a329c,9a71624d2,68abdce1a).https://claude.ai/code/session_014XwJPDhq1ahcm3rd454WzQ
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.