diff --git a/.github/github.json b/.github/github.json index 972d5e092b68..17b0aed507ed 100644 --- a/.github/github.json +++ b/.github/github.json @@ -2,7 +2,8 @@ "defaultBranch": "local/cbusillo-overlay", "projectType": "every-code-product", "upstreamForkBaseBranch": "fork-main", - "overlayBranch": "local/cbusillo-overlay", + "currentProductBranch": "local/cbusillo-overlay", + "plannedProductBranch": "main", "docs": { "overview": "README.md", "agentGuide": "AGENTS.md", @@ -29,7 +30,7 @@ "scripts": { "waitForGitHubRun": "scripts/wait-for-gh-run.sh --workflow Release --branch local/cbusillo-overlay", "cleanupSpace": "just local-cleanup-space --apply", - "overlayUpdate": "just local-overlay-update" + "upstreamImport": "just local-upstream-import" }, "docsRequiredWhen": [ "CLI behavior changes", diff --git a/.github/workflows/binary-release.yml b/.github/workflows/binary-release.yml index 61cf947308c6..c0312d74edc8 100644 --- a/.github/workflows/binary-release.yml +++ b/.github/workflows/binary-release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_tag: - description: Release tag to create or update, for example overlay-v0.6.93.1 + description: Example every-code-v0.6.98.1 required: true release_name: description: Optional display name for the GitHub release @@ -17,6 +17,7 @@ on: default: true push: tags: + - every-code-v* - overlay-v* concurrency: @@ -54,13 +55,13 @@ jobs: if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then tag="${GITHUB_REF_NAME}" prerelease=false - release_name="Code ${tag}" + release_name="Every Code ${tag}" else tag="${RELEASE_TAG}" prerelease="${PRERELEASE}" release_name="${RELEASE_NAME}" if [[ -z "${release_name}" ]]; then - release_name="Code ${tag}" + release_name="Every Code ${tag}" fi fi diff --git a/AGENTS.md b/AGENTS.md index 7f9824624c3a..e02e62fbb328 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,18 +66,37 @@ Examples: ## Upstream Import Workflow -- Until #87 renames the default branch, `local/cbusillo-overlay` is the canonical Every Code branch and source of truth for the `code` binary installed on this machine. +- `main` is the planned Every Code product branch. Until #87 completes the + GitHub default-branch cutover, `local/cbusillo-overlay` remains the factual + protected/default branch and source of truth for the `code` binary installed + on this machine. - Use `just local-code-rebuild` to rebuild the current branch into the PATH-resolved binary. - After `./build-fast.sh`, run `just local-code-rebuild` again before release smoke checks; the fast build can leave the PATH-resolved `code` pointing at a dev-fast binary that reports `0.0.0`. - Before leaving a local work session, run `just local-cleanup-space --apply` to remove rebuildable target/cache artifacts while preserving `code-rs/target/release/code`. -- Use `just local-overlay-update` only from a clean `local/*` branch. It fetches `upstream/main`, merges it into the current Every Code branch, replays any commits listed in `scripts/local/overlay-picks.txt`, then rebuilds the release binary. -- Commits already on `local/cbusillo-overlay` persist automatically across future upstream imports. They do not need to be duplicated in `scripts/local/overlay-picks.txt`. -- If you make a new Every Code fix that should remain part of the product, commit it through the normal task-branch/PR flow into `local/cbusillo-overlay` first. Do not leave important local changes only as an unmerged side branch. -- Add a commit SHA to `scripts/local/overlay-picks.txt` only for a patch that intentionally lives outside the overlay branch and still needs to be cherry-picked in during `just local-overlay-update`. Keep the list ordered and comment each entry with the source branch or purpose. -- Old side branches are archival context, not the runtime source of truth. They do not need to merge cleanly as branches; only the specific carried commits must cherry-pick cleanly onto the current overlay branch. -- If a legacy pick no longer cherry-picks cleanly, leave it commented out in `scripts/local/overlay-picks.txt`, manually re-port the fix against current upstream, commit the new port on `local/cbusillo-overlay`, then replace the old SHA in the manifest if you still want automatic replay. +- Use `just local-upstream-import` only from a clean product branch. Today that + means `local/cbusillo-overlay`; after #87 it means `main`. The helper fetches + `upstream/main`, merges it into the current Every Code branch, replays any + commits listed in `scripts/local/overlay-picks.txt`, then rebuilds the release + binary. +- Commits already on the product branch persist automatically across future + upstream imports. They do not need to be duplicated in + `scripts/local/overlay-picks.txt`. +- If you make a new Every Code fix that should remain part of the product, + commit it through the normal task-branch/PR flow into the product branch + first. Do not leave important local changes only as an unmerged side branch. +- Add a commit SHA to `scripts/local/overlay-picks.txt` only for a patch that + intentionally lives outside the product branch and still needs to be + cherry-picked in during `just local-upstream-import`. Keep the list ordered + and comment each entry with the source branch or purpose. +- Old side branches are archival context, not the runtime source of truth. They + do not need to merge cleanly as branches; only the specific carried commits + must cherry-pick cleanly onto the current product branch. +- If a legacy pick no longer cherry-picks cleanly, leave it commented out in + `scripts/local/overlay-picks.txt`, manually re-port the fix against current + upstream, commit the new port on the product branch, then replace the old SHA + in the manifest if you still want automatic replay. - For Every Code-owned surfaces, release steps, remote names, and conflict hot spots, see `docs/local-overlay.md`. ## How to Git Push diff --git a/docs/local-overlay.md b/docs/local-overlay.md index 4814ec8057d9..e79b68086d90 100644 --- a/docs/local-overlay.md +++ b/docs/local-overlay.md @@ -1,10 +1,15 @@ # Upstream Import And Local Runtime Policy -Every Code owns its product direction, defaults, releases, and UX. Until the -default branch is renamed in #87, `local/cbusillo-overlay` remains the canonical -branch for the local `code` binary on this machine. It imports useful upstream -changes from `just-every/code` while keeping Every Code-specific behavior in the -product branch. +Every Code owns its product direction, defaults, releases, and UX. The product +branch is moving from `local/cbusillo-overlay` to `main` in #87. Until GitHub's +default branch and protection rules are changed together, `local/cbusillo-overlay` +remains the canonical branch for the local `code` binary on this machine. + +Important cutover blocker: `origin/main` already exists and diverges heavily +from `origin/local/cbusillo-overlay`. Do not overwrite, delete, or repoint it as +an experiment. The branch cutover must explicitly choose `local/cbusillo-overlay` +as the source-of-truth commit, move branch protection to `main`, update the +GitHub default branch, and verify Actions before retiring the old branch name. Treat `codex-rs/` as a read-only mirror of `openai/codex`; put editable Rust changes under `code-rs/`. @@ -12,8 +17,8 @@ changes under `code-rs/`. Remote map: - `upstream`: `just-every/code`, the normal import source. -- `origin` / `fork`: `cbusillo/code`, where Every Code branches and tags are - pushed until the repository identity transition finishes. +- `origin` / `fork`: `cbusillo/code`, where Every Code product branches and tags + are pushed. - `openai`: reference remote for `openai/codex`; do not use it for routine imports or pushes. @@ -28,16 +33,18 @@ Remote map: - **Patch harness:** local validation for changed files, project tool discovery, and workspace-aware validator execution. - **Release workflow:** binary releases and local PATH rebuilds are Every Code - infrastructure. The `overlay-v*` tag format remains temporary until #87. + infrastructure. New releases should use `every-code-v*`; legacy `overlay-v*` + tags remain supported only so existing release history and notes keep working. - **Model defaults:** local defaults may intentionally differ from upstream, but request wire compatibility should use upstream model metadata when available. ## Upstream Sync -Use the import helper from a clean `local/*` branch: +Use the import helper from a clean product branch. Today that is +`local/cbusillo-overlay`; after #87 completes it should be `main`: ```sh -just local-overlay-update +just local-upstream-import ``` After conflicts are resolved, preserve upstream fixes unless they contradict an @@ -51,17 +58,17 @@ outside the product branch and must be replayed. Cut an Every Code release after every successful upstream import or local hotfix that should be installed elsewhere. -Temporary tag format, pending #87: +Tag format: ```text -overlay-v. +every-code-v. ``` Examples: -- `overlay-v0.6.95.1` for the first Every Code release on upstream `0.6.95` -- `overlay-v0.6.95.2` for a second Every Code hotfix on the same upstream base -- `overlay-v0.6.96.1` after the next upstream version bump +- `every-code-v0.6.98.1` for the first Every Code release on upstream `0.6.98`. +- `every-code-v0.6.98.2` for a second hotfix on the same upstream base. +- `every-code-v0.6.99.1` after the next upstream version bump. Required release gate: @@ -102,9 +109,9 @@ Run without `--apply` to preview deletions. Use `--keep-current-fast-cache` or Then push the product branch and tag to `origin`, and monitor `Binary Release`: ```sh -git tag overlay-v0.6.96.1 -git push origin local/cbusillo-overlay -git push origin overlay-v0.6.96.1 +git tag every-code-v0.6.98.1 +git push origin HEAD +git push origin every-code-v0.6.98.1 ``` Do not push Every Code releases to `upstream` or `openai`. @@ -114,7 +121,7 @@ Do not push Every Code releases to `upstream` or `openai`. Run this before and after upstream syncs: ```sh -scripts/local/fork-health.sh +just local-product-health ``` Pay particular attention to changes under `code-rs/tui/src/chatwidget.rs`, diff --git a/justfile b/justfile index 5db56e61bd39..f093ec746bf7 100644 --- a/justfile +++ b/justfile @@ -67,10 +67,18 @@ bazel-lock-check: local-code-rebuild: ./scripts/local/rebuild-path-code.sh +[no-cd] +local-upstream-import: + ./scripts/local/update-overlay-from-upstream.sh + [no-cd] local-overlay-update: ./scripts/local/update-overlay-from-upstream.sh +[no-cd] +local-product-health: + ./scripts/local/fork-health.sh + [no-cd] local-fork-health: ./scripts/local/fork-health.sh diff --git a/scripts/local/fork-health.sh b/scripts/local/fork-health.sh index 4689c81eeadc..3051875e6944 100755 --- a/scripts/local/fork-health.sh +++ b/scripts/local/fork-health.sh @@ -6,20 +6,23 @@ cd "$repo_root" current_branch="$(git symbolic-ref --quiet --short HEAD || echo HEAD)" upstream_ref="${UPSTREAM_REF:-upstream/main}" -latest_overlay_tag="$(git tag --list 'overlay-v*' --sort=-v:refname | head -n 1 || true)" +product_branch="${PRODUCT_BRANCH:-$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##')}" +product_branch="${product_branch:-local/cbusillo-overlay}" +latest_product_tag="$(git tag --list 'every-code-v*' 'overlay-v*' --sort=-v:refname | head -n 1 || true)" latest_upstream_tag="$(git tag --list 'v*' --sort=-v:refname | head -n 1 || true)" package_version="$(node -p "require('$repo_root/codex-cli/package.json').version" 2>/dev/null || true)" -echo "Fork health" -echo "===========" +echo "Every Code health" +echo "=================" echo "branch: $current_branch" +echo "product branch: $product_branch" echo "upstream ref: $upstream_ref" echo "head: $(git rev-parse --short HEAD)" -echo "origin overlay: $(git rev-parse --short origin/local/cbusillo-overlay 2>/dev/null || echo unknown)" +echo "origin product: $(git rev-parse --short "origin/$product_branch" 2>/dev/null || echo unknown)" echo "upstream head: $(git rev-parse --short "$upstream_ref" 2>/dev/null || echo unknown)" echo "package version: ${package_version:-unknown}" echo "latest upstream tag: ${latest_upstream_tag:-none}" -echo "latest overlay tag: ${latest_overlay_tag:-none}" +echo "latest product tag: ${latest_product_tag:-none}" echo echo "status:" diff --git a/scripts/local/generate-overlay-release-notes.sh b/scripts/local/generate-overlay-release-notes.sh index d76b097f3da2..734acd10c56e 100755 --- a/scripts/local/generate-overlay-release-notes.sh +++ b/scripts/local/generate-overlay-release-notes.sh @@ -11,10 +11,28 @@ Usage: scripts/local/generate-overlay-release-notes.sh \ --dist-dir DIR \ --output FILE -Generates GitHub release notes for fork-owned overlay binary releases. +Generates GitHub release notes for Every Code binary releases. USAGE } +strip_release_tag_version() { + local release_tag="$1" + case "$release_tag" in + every-code-v*) + printf '%s\n' "${release_tag#every-code-v}" + ;; + overlay-v*) + printf '%s\n' "${release_tag#overlay-v}" + ;; + v*) + printf '%s\n' "${release_tag#v}" + ;; + *) + printf '%s\n' "$release_tag" + ;; + esac +} + tag="" code_version="" commit="" @@ -65,14 +83,16 @@ if [[ -z "$tag" || -z "$code_version" || -z "$commit" || -z "$ref_name" || -z "$ exit 2 fi -previous_tag="$(git tag --list 'overlay-v*' --merged "$commit" --sort=-v:refname \ +previous_tag="$(git tag --list 'every-code-v*' 'overlay-v*' \ + --merged "$commit" --sort=-v:refname \ | grep -Fxv "$tag" \ | head -n 1 || true)" if [[ -n "$previous_tag" ]]; then range_base="$previous_tag" else - upstream_tag="v${tag#overlay-v}" + tag_version="$(strip_release_tag_version "$tag")" + upstream_tag="v${tag_version}" upstream_tag="${upstream_tag%.*}" if git rev-parse --verify --quiet "${upstream_tag}^{commit}" >/dev/null \ && git merge-base --is-ancestor "$upstream_tag" "$commit"; then @@ -152,7 +172,7 @@ write_section() { { echo "## What's Changed" echo "" - echo "This overlay release carries local fork updates on top of upstream Code $code_version." + echo "This Every Code release carries product updates on top of upstream Code $code_version." if [[ -n "$previous_tag" ]]; then echo "It includes $listed_entry_count listed changes since $previous_tag." fi @@ -175,7 +195,7 @@ write_section() { echo "" echo "Built from \`$ref_name\` at \`$commit\`." if [[ -n "$previous_tag" ]]; then - echo "Previous overlay release: \`$previous_tag\`." + echo "Previous Every Code release: \`$previous_tag\`." fi echo "" echo "### Assets" diff --git a/scripts/local/overlay-picks.txt b/scripts/local/overlay-picks.txt index 188522e828ac..b38db007c6d5 100644 --- a/scripts/local/overlay-picks.txt +++ b/scripts/local/overlay-picks.txt @@ -1,21 +1,21 @@ -# Ordered local fixes/features to replay onto local/cbusillo-overlay. +# Ordered Every Code fixes/features to replay during upstream imports. # # Format: # # optional note # # Workflow: -# - Commits already present on local/cbusillo-overlay survive future upstream -# merges automatically; do not list them again here. -# - Commit new local fixes onto local/cbusillo-overlay first. +# - Commits already present on the product branch survive future upstream +# imports automatically; do not list them again here. +# - Commit new product fixes onto the product branch first. # - Add a SHA here only if the fix intentionally lives outside the overlay -# branch and should be auto-replayed during future `just local-overlay-update` +# branch and should be auto-replayed during future `just local-upstream-import` # runs. # - If an old carried fix stops cherry-picking cleanly, keep it commented out, # manually re-port it to current upstream, then replace the SHA here with the # new ported commit once it is known-good. # Current state: -# - The previously reviewed legacy backlog is now either already present on -# local/cbusillo-overlay or manually re-ported there. +# - The previously reviewed legacy backlog is now either already present on the +# product branch or manually re-ported there. # - Leave this file empty until a future patch intentionally lives outside the -# overlay branch and must be auto-replayed after `just local-overlay-update`. +# product branch and must be auto-replayed after `just local-upstream-import`. diff --git a/scripts/local/update-overlay-from-upstream.sh b/scripts/local/update-overlay-from-upstream.sh index d71abafa9a3e..14f2938dadc7 100755 --- a/scripts/local/update-overlay-from-upstream.sh +++ b/scripts/local/update-overlay-from-upstream.sh @@ -11,8 +11,8 @@ if [[ -z "$branch" ]]; then exit 1 fi -if [[ "$branch" != local/* ]]; then - echo "error: expected a local/* overlay branch, got '$branch'" >&2 +if [[ "$branch" != local/* && "$branch" != main ]]; then + echo "error: expected main or a local/* product branch, got '$branch'" >&2 exit 1 fi @@ -22,7 +22,7 @@ if ! git diff --quiet || ! git diff --cached --quiet; then fi if [[ ! -f "$manifest" ]]; then - echo "error: overlay branch manifest not found: $manifest" >&2 + echo "error: upstream import manifest not found: $manifest" >&2 exit 1 fi @@ -33,7 +33,7 @@ echo "Merging upstream/main into $branch" git merge --no-edit upstream/main echo -echo "Applying overlay commit stack from $(basename "$manifest")" +echo "Applying carried commit stack from $(basename "$manifest")" while IFS= read -r raw_line || [[ -n "$raw_line" ]]; do line="${raw_line%%#*}" pick_commit="$(printf '%s' "$line" | xargs)" @@ -42,7 +42,7 @@ while IFS= read -r raw_line || [[ -n "$raw_line" ]]; do fi if ! git cat-file -e "$pick_commit^{commit}" 2>/dev/null; then - echo "error: overlay commit '$pick_commit' does not exist" >&2 + echo "error: carried commit '$pick_commit' does not exist" >&2 exit 1 fi