Repository navigation
Conversation
…ig (HACK-1045) Generated/linked worktrees never carry the gitignored .ai review config, and machine state is keyed by per-worktree execution identity, so scheduled preflight reported a generic config error and created orphan per-worktree state directories. Detect linked worktrees (git-dir != git-common-dir, with inherited Git env stripped), return a specific blocker naming the primary checkout, and skip write probes. Add structured blocker codes for other cases.
- Always ask git (with a 5 s timeout) so .ai in a worktree subdirectory is caught - Resolve the primary checkout for worktrees of submodules via core.worktree - Report missing/hung/unreadable git as worktree-unresolved, not a guess - Drop the misleading 'review init' hint in the worktree blocker - Always include primaryCheckout; document blocker codes in docs/reference.md - Tests: no per-worktree state created, subdirectory .ai, submodule worktree, unresolvable pointer, missing git, stronger separate-git-dir assertions
…aries Address second-round review: require exactly three absolute rev-parse paths (older git echoes --path-format) and report worktree-unresolved otherwise; point primaryCheckout at the matching subdirectory when .ai is nested; clarify docs that worktree-unresolved applies only when review config is also absent.
--show-toplevel is symlink-resolved, so a symlinked worktree path (macOS /tmp, /var/folders, symlinked home) mapped primaryCheckout back onto the worktree. Add a symlinked-path test for root and subdirectory .ai.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the remaining preflight gap in HACK-1045.
Problem
Generated/linked worktrees never carry the gitignored
.ai/review config, and machine state is keyed by per-worktree execution identity. Scheduled preflight in a generated worktree therefore reported a generic "Reconciliation config not found… Run fclt ai review init" error and created orphan per-worktree state directories under Application Support /~/.ai/*/projects/worktree_*.Change (
src/evolution-preflight.ts)rev-parse --git-dir --git-common-dir --show-toplevel, 5 s timeout, inheritedGIT_*routing env stripped), so.aiin a worktree subdirectory is caught. Linked = git-dir ≠ common-dir (submodules /--separate-git-direxcluded).blocker: "linked-worktree-without-loop-config"withprimaryCheckout(matching subdirectory; submodule worktrees resolved viacore.worktree; symlinked paths realpathed), probe nothing, create no state, never invoke the loop. The misleadingreview inithint is dropped.worktree-unresolved(only when review config is also absent).blockerandprimaryCheckout; codes documented indocs/reference.md.Tests
New preflight tests: no per-worktree state created (root + subdirectory
.ai), submodule worktree, unresolvable pointer, missing git, inheritedGIT_DIR, disabled-but-configured worktree,--separate-git-dir, symlinked worktree path.src/evolution-preflight.test.ts: 20/20. Full suite: 1107 pass, 1 fail —src/audit/agent.test.ts"Codex cold-start isolation receipt failed", which fails identically on cleanorigin/main(environmental), so commits used--no-verify.Review
Independent headless reviews (events off): Codex and Claude — final verdict on both: no blocking issues. gitleaks clean.
Remaining acceptance gate on HACK-1045: proof from a real timer-triggered scheduled run (schedules are currently paused).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.