Repository navigation
Feature A: Start new task branches at their published head - #1097
oxa-agent[bot] wants to merge 15 commits into
Conversation
A task for an already pushed branch (for example a pull request's head) started a fresh worktree at the captured base, because the local branch did not exist. The worker then audited and continued a tree that predates the published commits and redid work that was already on the head. Before creating the worktree, a task branch that has no local ref is created at the lone remote-tracking tip of the same name when that tip descends from the captured base and carries commits the base lacks. No fetch runs, the update is a compare-and-swap that can only create the ref, and several diverging tips, an unrelated tip or a tip equal to the base keep the base. An existing local branch, including a retained or unfinished one, is untouched. Tests: work_continue starts from a deleted local branch with a fetched origin/agent/test and asserts the worker's tree and the branch both sit at the pushed commit. Fixes #1052
|
First-pass review by oxa → oxc →
TIER: T2 🤖 Generated with Claude Code (oxa review lane) |
Adopting the published head created refs/heads/<task> before the worktree existed, but the sandboxed checkout still ran `git checkout -b <task> HEAD` for a task without a local branch and failed with "a branch named '<task>' already exists", blocking every task whose branch had just been adopted. The adoption now reports whether it created the ref. When it did, the worktree attaches to that branch and the sandboxed checkout only materialises its tree; otherwise the previous detached worktree at the base and the sandbox-side branch creation are unchanged. Tests: work_continue asserts the task branch, HEAD and the worker's tree all sit at the pushed commit.
…heckout The published-head test asserted `symbolic-ref HEAD` in the source checkout, which `oxa work` deliberately never moves: it stays on the captured base while the task branch is created for the worktree. The assertion therefore checked the wrong repository and failed. It now asserts the task worktree's HEAD and that the source checkout is still on the base. Adoption also read the base with a strict `rev-parse`, so a base that does not resolve failed the run before the ordinary path could report it; it is now skipped and left to that path. The zero old value for the compare-and-swap follows the repository's hash algorithm instead of assuming SHA-1, and a ref that appears between the check and the update no longer fails the run: the caller attaches the existing branch, as it does for any existing branch. Tests: the published-head test now asserts both HEADs; a second test pushes an orphan branch under the task name and asserts the worktree and the local branch both stay at the base without its file.
|
First-pass review by oxa → oxc →
🤖 Generated with Claude Code (oxa review lane) |
|
@codex review |
|
@codex security review |
Codex Review Summary: 🔄 RunningThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (2)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: ca01b0031a
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| args.push(if create { | ||
| published.as_deref().unwrap_or(base) |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Reapprove adopted branch code before running checkout hooks
When a trusted repo has an installed checkout hook that invokes tracked code, sandbox networking is on, and gh is logged in, a fetched attacker-controlled remote branch matching a new task is adopted here and checked out before that tip is approved. The checkout command contains git, so NetSandbox injects the owner GH_TOKEN; tip-controlled hook code can send it off-host. Descendant/unique-tip checks do not establish trust, and source trust covers only the current checkout. Disable callbacks/network/token while materializing the tip, then approve its executable content before hooks.
SECURITY.md reference: SECURITY.md:L9-L10
Useful? React with 👍 / 👎.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 7b6dfa1118
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| args.push(if create { | ||
| published.as_deref().unwrap_or(base) | ||
| } else { |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Reapprove adopted Git hooks before saving
Required conditions: a trusted repo has core.hooksPath pointing to a tracked directory, sandbox networking is on, gh is logged in, a matching attacker-controlled remote branch was fetched, and the worker makes a change. This revision now disables hooks only for the adopted checkout (fresh evidence beyond the earlier comment); Save later restores with_net and runs an ordinary git commit, so the adopted pre-commit inherits GH_TOKEN and can exfiltrate it. Reapprove the adopted executable content, or keep hooks, network, and credentials disabled through Save.
SECURITY.md reference: SECURITY.md:L9-L11
Useful? React with 👍 / 👎.
# Conflicts: # oxa/oxa-cli/src/work_checks.rs # oxa/oxa-cli/tests/common/work.rs # oxa/oxa-work/src/committed.rs # oxa/oxa-work/src/lib.rs # oxa/oxa-work/src/tree.rs
# Conflicts: # oxa/oxa-cli/tests/common/work.rs
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Feature A (#1214), T3. Fixes #1052. Ports #307's worktree lifecycle and post-commit publish row: a fresh task starts at its unambiguous published task head, preserving earlier work.
Published-head selection reads Git metadata only. It collects every matching remote tip before deduplication and ancestry validation. A sole eligible head becomes the detached worktree's start commit; the existing checkout supervisor creates the task branch without replacing a concurrent writer's branch. Adopted materialization uses the restricted execution policy. Automatic local save and merge retain sandboxed callback execution, refusal and work preservation.
Current source
e9af6ccad122d38f547e927c4a100d506cb7b934normally merges main1f80c439after GitHub confirmed an actual new conflict following Ready. The only text conflict was the shared test runner: the tests now reuse main's generic configuration helper, removing the duplicate wrapper and retaining every input/assertion. The PR's product patch is identical to approved parent18bc55c7; Checkout, Merge and Save code and the entire worktree implementation are unchanged from that parent. Main's publication/save-recovery, diagnostic scrub, reviewed-head, checkpoint and lock/handover guards remain. Landed #1043 normalization, holder cleanup, original-OID/no-deref updates, frozen batch inputs and ordinary checkout callbacks remain alongside adopted policy. No new store or checkpoint schema.Validation:
522bf832failed at runtime before the repair: the x86 inventory ran 4,744 tests, with the two intended callback assertions failing after successful task completion; 4,742 passed and three existing opt-in tests were skipped. The initial09f29dbbrun stopped at an existing sandbox guard and is fixture feedback, not product failure proof.18bc55c7passed lane 44204858138: all 28 oxa crates plus oxc-rs on x86_64 and ARM64. This includes both repaired callback regressions and the combined adopted/normalization control. The owner explicitly read and approved that repaired parent source.e9af6cca: lane 44207390279 and Ready full required CI 44207311487 are running, with one observer each. Fresh current-head Cloud Code/security reviews and normal landing gates remain required. Parent green and the old Draft cheap workflow do not qualify this composition.Retains the complete existing
oxa/issue-1052history. No new branch or history rewrite. Helpers remain paused; no lab script changes.