|
| 1 | +# 260827 release train — dev 7c333f30e to published |
| 2 | + |
| 3 | +Research and decisions for promoting `dev` to both published channels. Written before any |
| 4 | +branch moves, because a promotion that drops a real commit is not recoverable by rerunning it. |
| 5 | + |
| 6 | +## Starting state, measured |
| 7 | + |
| 8 | +| Thing | Value | |
| 9 | +| --- | --- | |
| 10 | +| `dev` | `7c333f30e`, 293 commits ahead of `main` | |
| 11 | +| `main` | `ec51e42d7`, `release: v2.33.0` | |
| 12 | +| `preview` | `678517f56`, `release: v2.33.0-preview.20260825` | |
| 13 | +| `package.json` on dev | `2.34.0` | |
| 14 | +| npm `latest` | `2.33.0` | |
| 15 | +| npm `preview` | `2.33.0-preview.20260825` | |
| 16 | +| package name | `@bitkyc08/opencodex` | |
| 17 | + |
| 18 | +Both channels are a full release behind `dev`. |
| 19 | + |
| 20 | +## The preview reconciliation question |
| 21 | + |
| 22 | +`preview` is 2 commits *ahead* of `dev`, which on its face means promoting `dev` onto |
| 23 | +`preview` would discard work. It does not, and the reason is worth writing down rather than |
| 24 | +asserting. |
| 25 | + |
| 26 | +The two commits are `cf762b1f5` (a `dev` merge) and `678517f56` (the version bump). |
| 27 | +`cf762b1f5` shows a 24-line change to `tests/api-usage.test.ts`, which looks like real |
| 28 | +content — and `git merge-base --is-ancestor cf762b1f5 origin/dev` answers **NO**, so it is |
| 29 | +genuinely not in `dev`'s history. |
| 30 | + |
| 31 | +The resolution is that ancestry and content are different questions. Measuring content |
| 32 | +directly: |
| 33 | + |
| 34 | +``` |
| 35 | +git diff --stat origin/dev origin/preview -- tests/api-usage.test.ts # empty |
| 36 | +git diff $(git merge-base origin/dev origin/preview) origin/preview --name-only |
| 37 | +# -> package.json |
| 38 | +``` |
| 39 | + |
| 40 | +So since the merge-base (`e1fb67559`), the *only* file `preview` changes is `package.json`, |
| 41 | +and the only change is the version string. `cf762b1f5` is a merge whose second parent IS the |
| 42 | +merge-base, so the test change it displays arrived on `dev` through a different commit and is |
| 43 | +already present there. Nothing real is lost. |
| 44 | + |
| 45 | +**Decision:** promote `dev` onto `preview` and let the release bump re-establish the version. |
| 46 | +The stale `2.33.0-preview.20260825` string is exactly what the bump is going to overwrite. |
| 47 | + |
| 48 | +## Version numbers |
| 49 | + |
| 50 | +The published scheme, read from the registry rather than assumed: |
| 51 | +`2.29.0-preview.20260821`, `2.30.0-preview.20260821`, `2.31.0-preview.20260822`, |
| 52 | +`2.32.0-preview.20260824`, `2.32.1-preview.20260825`, `2.33.0-preview.20260825`. So preview is |
| 53 | +`<version>-preview.<YYYYMMDD>` and stable is plain semver. |
| 54 | + |
| 55 | +- preview target: **`2.34.0-preview.20260827`** |
| 56 | +- stable target: **`2.34.0`** |
| 57 | + |
| 58 | +`2.34.0` is what `dev`'s `package.json` already reads (wp2 of the hardening unit moved it |
| 59 | +there), it is unused on npm (404) and unused as a git tag, and both targets move their |
| 60 | +channel forward past `2.33.0`, which is what `assertChannelVersionMovesForward` requires. |
| 61 | + |
| 62 | +## Mechanics that constrain the plan |
| 63 | + |
| 64 | +`main` and `preview` rulesets are `[deletion, non_fast_forward, pull_request]` with bypass |
| 65 | +actors `DeployKey = always` and `RepositoryRole 5 = pull_request`. Two consequences: |
| 66 | + |
| 67 | +- Content promotion cannot be a push. It travels as a PR merged with `--admin`. |
| 68 | +- The release bump push *can* work, but only through the deploy key. `scripts/release.ts` |
| 69 | + reads `OCX_RELEASE_SSH_KEY`; the key at `~/.ssh/opencodex_release_ed25519` was confirmed to |
| 70 | + authenticate and to see both branches. |
| 71 | + |
| 72 | +`scripts/release.ts` is the release authority and does the whole sequence: preflight |
| 73 | +(clean tree, `audit:high`, `tsc`, the CI-matching test grouping, `privacy:scan`), bump, |
| 74 | +commit, push, wait for **both** Cross-platform CI and Service lifecycle at the release sha, |
| 75 | +then dispatch `release.yml` with `version`, `tag`, `expected-sha`, `dry-run`. |
| 76 | + |
| 77 | +`release.yml` requires `expected-sha` and defaults `dry-run=true`, so a dry run exercises the |
| 78 | +real release commit. Re-running with `--publish` is the documented second step and the script |
| 79 | +is written to be idempotent across it. |
| 80 | + |
| 81 | +## Constraint that shapes execution |
| 82 | + |
| 83 | +The preflight runs the full test suite locally, which this session is forbidden to do. That |
| 84 | +is not a reason to bypass the preflight — it is a reason to run the suite where it belongs |
| 85 | +(`ssh lidge` via `ocx-run` at the exact release sha) and to let the workflow gates be the |
| 86 | +binding check. The plan records how each phase satisfies the preflight's intent without |
| 87 | +running `bun run test` on this machine. |
| 88 | +## Amendment — two things the first pass got wrong or left open |
| 89 | + |
| 90 | +### The preflight is not the binding gate (resolves the `020` open question) |
| 91 | + |
| 92 | +`020` framed the local test suite as a problem to work around. Reading `release.yml` |
| 93 | +end to end shows the gates that actually bind are all server-side, and the script's local |
| 94 | +preflight duplicates them as a convenience: |
| 95 | + |
| 96 | +| Gate | Where it lives | |
| 97 | +| --- | --- | |
| 98 | +| `expected-sha` matches the checked-out commit | `release.yml` "Verify dispatched SHA" | |
| 99 | +| version equals `package.json` | "Verify version matches package.json" | |
| 100 | +| branch/version/dist-tag agree (main=stable+latest, preview=prerelease+preview) | "Require successful Cross-platform CI" | |
| 101 | +| a **push-event** `ci.yml` run succeeded for this sha on this branch | same step — a PR run explicitly does not qualify | |
| 102 | +| Service lifecycle succeeded when service paths changed since the previous merged tag | same step | |
| 103 | +| `audit:high` | "Dependency audit" job step | |
| 104 | +| typecheck + build | `prepublishOnly`, run by `npm publish` | |
| 105 | +| tag/release do not already exist at another sha | "Preflight release metadata" | |
| 106 | + |
| 107 | +The workflow also creates the git tag and the GitHub Release itself (`git tag` / |
| 108 | +`gh release create`), so nothing about tagging depends on the local script. |
| 109 | + |
| 110 | +So the route is: bump and push the release commit, let the branch's own push-event CI run, |
| 111 | +then dispatch `release.yml` directly with `gh workflow run`. That is exactly what |
| 112 | +`scripts/release.ts` does at its end, minus the local suite. Recording it this way is not a |
| 113 | +shortcut around a gate; it is declining to run a *duplicate* of gates the workflow enforces |
| 114 | +anyway, on a machine that is not allowed to run them. |
| 115 | + |
| 116 | +The suite still runs — on `ssh lidge` at the exact release sha, as every phase of the |
| 117 | +hardening unit did. |
| 118 | + |
| 119 | +### `[WRONG BRANCH]` on promotion PRs is expected, and is how this repo has always released |
| 120 | + |
| 121 | +`010` guessed that `enforce-target` would complain. It does more than complain: |
| 122 | +`ALLOWED_BASES = ["dev"]` (`enforce-pr-target.yml:254`), so a promotion PR gets a |
| 123 | +`wrong_base` failure AND has `[WRONG BRANCH] ` prepended to its title. |
| 124 | + |
| 125 | +This is not a new problem to solve. Every promotion in this repository's history carries it: |
| 126 | + |
| 127 | +``` |
| 128 | +#2553 codex/promote-main-2330 -> main [WRONG BRANCH] merge dev into main for the v2.33.0 release |
| 129 | +#2507 dev -> main [WRONG BRANCH] release: promote dev into main for v2.32.1 |
| 130 | +#2551 dev -> preview [WRONG BRANCH] merge dev into preview for the v2.33.0-preview... |
| 131 | +``` |
| 132 | + |
| 133 | +All merged. The gate has no promotion exemption and the maintainers evidently merge through |
| 134 | +it with admin rather than teaching it about release branches. Follow that precedent rather |
| 135 | +than inventing an exemption: the check failing on a promotion PR is a known false positive, |
| 136 | +and the merge is `--admin` regardless. |
| 137 | + |
| 138 | +Worth stating plainly since it looks alarming in the checks list: on a promotion PR, |
| 139 | +`enforce-target` failing is the expected outcome, not a signal to stop. |
0 commit comments