feat(auxiliary): generate agent guidance for coordinated worktrees#72
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79cef60da9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| pub fn write_guidance(primary_worktree: &Path, entry: &WorktreeEntry) -> AppResult<()> { | ||
| let path = primary_worktree.join(GUIDANCE_FILE); | ||
| let text = render_guidance(entry); | ||
| fs::write(&path, text).map_err(|error| { |
There was a problem hiding this comment.
Refuse to overwrite tracked guidance files
If the base branch already contains a tracked root WTK-AUXILIARY.md, the new worktree checks it out and this unconditional fs::write truncates it with generated guidance. The exclude rule does not apply to tracked files, so wtk new --ag can report success while leaving the Primary worktree dirty and replacing the repository’s tracked content; fail when the path already exists instead of overwriting it.
Useful? React with 👍 / 👎.
Summary
WTK-AUXILIARY.mdinside coordinated Primary worktrees with concrete Auxiliary Repository refs and targets./refs/and/WTK-AUXILIARY.mdto the true common.git/info/exclude, avoiding worktree-specificcore.excludesFilefor p10k compatibility.Validation
cargo testuv run --project e2e pytest e2e/test_auxiliary_group.pyuv run --project e2e pytest e2e/test_repo_mode.py::test_repo_mode_new_with_explicit_base_from_current_and_dirty_failuresuv run --project e2e pytest e2egit diff --check