Skip to content

Configure Codex managed worktrees - #173

Merged
kyleve merged 4 commits into
mainfrom
codex/worktree-remote-setup
Aug 2, 2026
Merged

Configure Codex managed worktrees#173
kyleve merged 4 commits into
mainfrom
codex/worktree-remote-setup

Conversation

@kyleve

@kyleve kyleve commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Posted by an AI agent on kve's behalf.

Summary

  • add a checked-in Codex local environment for macOS and Linux worktrees
  • check latest origin/main during setup without changing the selected checkout
  • offer an explicit Update to latest main action that fast-forwards only directly stale checkouts and refuses divergent history
  • expose project generation, affected tests, and formatting lint as toolbar actions
  • delete only the worktree-owned simulator during cleanup
  • copy the gitignored local signing override into newly managed worktrees
  • make the explicit bootstrap trust each checkout before mise reads its config
  • make validation proportional so pure documentation and comment-only changes can skip irrelevant checks while behavior-bearing changes retain targeted validation

Motivation

Codex-managed worktrees use a new checkout path, so mise treats the existing repository config as untrusted and local signing configuration does not follow automatically. This makes a newly created worktree ready to build and test without opening Xcode or repeating machine-local setup.

Codex creates a worktree from the selected branch's current HEAD. The setup check makes stale main visible while preserving intentionally selected feature history, and the separate action provides a safe, explicit fast-forward when the checkout is directly behind main.

The environment reuses the existing Cursor installer on Linux rather than creating a second cloud bootstrap. Unsupported platforms fail explicitly.

Repository validation is now proportional to what a check can exercise. Pure prose and comment-only edits may skip irrelevant app checks, but semantic changes to configuration, scripts, generator inputs, executable examples, or rendered copy still require the narrowest applicable validation. Any skipped checks must be recorded.

Validation

Worktree implementation:

  • ./worktree --check-main && ./ide --bootstrap --no-open
  • isolated stale-main checkout — fast-forwarded exactly to origin/main and stayed clean
  • ./swiftformat --lint — 0 of 858 files require formatting
  • ./test — 1,622 unit tests passed
  • affected snapshots — 33 tests passed

Documentation-policy follow-up:

  • ./sync-agents
  • both edited skill frontmatters validated
  • git diff --check
  • ./swiftformat --lint and ./test not rerun — Markdown-only instruction changes outside their scope

Add checked-in setup, cleanup, and common actions for Codex worktrees. Carry the local signing override into new managed worktrees and make bootstrap trust each checkout before mise reads its config.

Validated with ./ide --bootstrap --no-open, ./swiftformat --lint, and ./test (1,622 unit tests and 33 snapshots).
Comment thread ide
# read an untrusted .mise.toml. Running this explicit bootstrap is the trust
# boundary, so make fresh checkouts usable without a separate manual step.
echo "==> mise trust"
"$MISE" trust

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent on kve's behalf.

Reviewer note: this intentionally treats an explicit ./ide --bootstrap invocation as the mise trust boundary. Plain ./ide still never trusts a previously unseen checkout path.

Add an advisory freshness check to managed-worktree setup and an explicit toolbar action that fast-forwards only checkouts directly behind origin/main. Divergent feature history is left untouched for an explicit merge or rebase.

Validated with the exact macOS setup command, an isolated stale-main fast-forward, ./swiftformat --lint, and ./test (1,622 unit tests and 33 snapshots).
Comment thread worktree
exit 1
fi

git merge --ff-only "$main_ref"

@kyleve kyleve Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent on kve's behalf.

Reviewer note: the action reaches this fast-forward only after proving HEAD is an ancestor of origin/main. A feature branch that already contains latest main is a no-op; divergent history is refused and left for an explicit merge or rebase.

kyleve added 2 commits August 2, 2026 11:48
The Codex environment is checked-in source maintained by the repository, so remove the header claiming it is autogenerated and should not be edited.

Validated with ./swiftformat --lint and ./test (1,622 unit tests and 33 snapshots).
Allow pure documentation and comment-only changes to skip checks that cannot exercise them, while preserving targeted validation for semantic configuration, tooling, generated-input, example, and rendered-copy changes. Keep the root contract and repo-owned GitHub and testing skills aligned.

Validated with ./sync-agents, git diff --check, and equivalent frontmatter checks for both edited skills. ./swiftformat --lint and ./test were not run because these Markdown-only policy changes are outside their scope.
Comment thread AGENTS.md
`./swiftformat --lint` when the changed files are in its scope, and run the
narrowest applicable `./test` tier for code, build, tooling, or behavior
changes. Pure documentation or comment-only changes may skip checks that
cannot exercise them; record skipped checks in the commit or PR validation.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted by an AI agent on kve's behalf.

Reviewer note: the exception is deliberately limited to pure documentation and comments, and skipped checks must be recorded. Semantic changes to configuration, scripts, generator inputs, executable examples, or rendered copy remain behavior-bearing and still require the narrowest applicable validation.

@kyleve
kyleve enabled auto-merge (squash) August 2, 2026 19:04
@kyleve
kyleve merged commit 4703543 into main Aug 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant