Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/binary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,6 +17,7 @@ on:
default: true
push:
tags:
- every-code-v*
- overlay-v*

concurrency:
Expand Down Expand Up @@ -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

Expand Down
33 changes: 26 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 26 additions & 19 deletions docs/local-overlay.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# 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/`.

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.

Expand All @@ -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
Expand All @@ -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<upstream-version>.<fork-patch>
every-code-v<upstream-version>.<product-patch>
```

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:

Expand Down Expand Up @@ -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`.
Expand All @@ -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`,
Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions scripts/local/fork-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
30 changes: 25 additions & 5 deletions scripts/local/generate-overlay-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions scripts/local/overlay-picks.txt
Original file line number Diff line number Diff line change
@@ -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:
# <commit-sha> # 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`.
10 changes: 5 additions & 5 deletions scripts/local/update-overlay-from-upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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)"
Expand All @@ -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

Expand Down