Configure Codex managed worktrees - #173
Conversation
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).
| # 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 |
There was a problem hiding this comment.
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).
| exit 1 | ||
| fi | ||
|
|
||
| git merge --ff-only "$main_ref" |
There was a problem hiding this comment.
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.
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.
| `./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. |
There was a problem hiding this comment.
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.
Summary
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:
Documentation-policy follow-up: