From 657b132553613208cbd2156fd6249706f7eb5927 Mon Sep 17 00:00:00 2001 From: minhn4 Date: Wed, 15 Jul 2026 15:09:47 +0700 Subject: [PATCH 1/2] docs: normalize the version before applying the upstream patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream's manifests carry the plain version at the FROM tag, so while the fork sits on a revision suffix every upstream version hunk conflicts. Since the lockstep bump put the suffix on all 29 manifests, that is now 29 hand resolutions per sync — it was 1 at the last one, when only the opencode manifest carried a fork value. Dropping the suffix with `bun bump ${FROM#v}` first makes the hunks apply cleanly and land on TO by themselves. `git add` is required: `git apply --index` rejects unstaged changes, and staging folds the normalization into the sync commit. Co-Authored-By: Claude Opus 4.8 (1M context) --- DIVERGENCES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DIVERGENCES.md b/DIVERGENCES.md index f92c9763f0..09cab61bf2 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -30,6 +30,15 @@ git checkout -b sync-upstream main # FROM = current version in packages/opencode/package.json; TO = target release FROM=v1.17.15 TO=v1.17.16 +# Drop the fork's revision suffix first. Upstream's manifests carry the plain +# version at FROM, so while ours read 1.17.15-2 every one of their version hunks +# conflicts (~29 manifests); matching FROM lets them apply clean and land on TO +# by themselves. Skip if the fork is already on the plain value — `bump` refuses +# a no-op. `git add` is required: `git apply --index` rejects unstaged changes +# with "does not match index", and staging folds this into the sync commit. +bun bump ${FROM#v} +git add -A + # `git apply` is atomic: hunks against files the fork deleted (locales, docs # translations — see the table below) hard-error and roll back the entire patch, # so filter them out first. A path is skipped only if it existed in FROM and is From b3a70a24ed55a55751b32619061b15b3bda0138f Mon Sep 17 00:00:00 2001 From: minhn4 Date: Wed, 15 Jul 2026 15:14:11 +0700 Subject: [PATCH 2/2] docs: stop the README forbidding the sync's own bump step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "do not bump manually" became false the moment the sync procedure started running `bun bump ${FROM#v}` to drop the fork suffix. The rule it was reaching for is that you never pick a version on a sync — upstream's value arrives on its own — so say that, and point at the procedure so the script turning up there isn't a surprise. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f761657d5c..1b1573be5c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ CoDev Code is a fork of [OpenCode](https://github.com/anomalyco/opencode) that t All workspace packages share one version — the one releases publish — kept in lockstep (`packages/codev-gateway` is fork-only and versions independently). There are only two ways it changes: -- **Upstream sync** — the version comes from upstream; do not bump manually. The sync restores the plain upstream value (e.g. `1.17.18-2` → `1.17.19`). +- **Upstream sync** — the version comes from upstream; never pick one yourself. The sync restores the plain upstream value (e.g. `1.17.18-2` → `1.17.19`). Its [procedure](DIVERGENCES.md#syncing-with-upstream) drops the fork's suffix with the same script on the way, so upstream's version applies cleanly. - **Fork-only re-release between syncs** — append or increment a numeric revision suffix: `1.17.18` → `1.17.18-1` → `1.17.18-2` (the Nth fork build of that upstream release). Semver sorts the suffixed form below the bare `1.17.18`, but installs follow the `latest` dist-tag, so that quirk is harmless. For a fork-only bump, run the script — it rewrites every manifest in lockstep, regenerates `bun.lock`, and verifies nothing was missed: