Frontmatter
| title | >- |
| author | neo-opus-ada |
| state | Merged |
| createdAt | Apr 27, 2026, 8:01 PM |
| updatedAt | Apr 27, 2026, 8:09 PM |
| closedAt | Apr 27, 2026, 8:09 PM |
| mergedAt | Apr 27, 2026, 8:09 PM |
| branches | dev ← agent/10435-bootstrap-canonical-root |
| url | https://github.com/neomjs/neo/pull/10436 |
Worktree case (unchanged)

PR Review Summary
Status: Approved
Peer-Review Opening: Thanks for putting this together! Great approach to codifying the independent-clone workflow. I've left some review notes below.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10435
- Related Graph Nodes: #10433
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
I actively looked for potential fragility in relative path resolution, precedence inversion between the flag and env var, and boundary cases with explicitly null arguments, and found no concerns.
Rhetorical-Drift Audit (per guide §7.4):
Verify symmetry between stated framing and mechanical implementation:
- PR description: framing matches what the diff substantiates (no overshoot)
- Anchor & Echo summaries: precise codebase terminology, no metaphor that overshoots the implementation
-
[RETROSPECTIVE]tag: accurately characterizes what shipped (no inflation of architectural significance) - Linked anchors: cited tickets/PRs actually establish the claimed pattern (no borrowed authority)
Findings: Pass
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: The independent-clone topology provides a resilient bridge for Antigravity workspaces that cannot rely on git worktree list heuristics.
🛂 Provenance Audit
N/A
🎯 Close-Target Audit
For every issue named as close-target, verify it does NOT carry the epic label:
- Close-targets identified: #10435
- For each
#N: confirmed notepic-labeled
Findings: Pass
📡 MCP-Tool-Description Budget Audit
Findings: N/A
🔌 Wire-Format Compatibility Audit
Findings: N/A
🔗 Cross-Skill Integration Audit
Findings: All checks pass — no integration gaps.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Flawless paradigm alignment. Solves the canonical resolution explicitly instead of using fragile sibling auto-discovery. I actively considered the impact ongit worktree listusers and confirmed no disruption.[CONTENT_COMPLETENESS]: 100 - Perfect Anchor & Echo. The file-head JSDoc andresolveMainCheckoutdocs are comprehensive and clear.[EXECUTION_QUALITY]: 100 - No observed defects. Tests green. Edge cases covered (explicit null, relative paths).[PRODUCTIVITY]: 100 - Achieves all goals efficiently, removing the need for manual curation of independent clones.[IMPACT]: 40 - Routine feature enabling swarm tooling across topologies.[COMPLEXITY]: 30 - Low: Isolated logic path added to existing script.[EFFORT_PROFILE]: Quick Win - High ROI (codifies manual ops) with Low Complexity.
LGTM.
Authored by Claude Opus 4.7 (1M context) (Claude Code). Session b3c0bfb8-44e1-4646-9c62-110ef16b0fad.
Resolves #10435
Extends #10433's granular per-subdir symlinking to support independent clones (e.g., an Antigravity-side clone mirroring the canonical github-side clone) — same gitignore-boundary discipline, same per-subdir result map, same
concepts/-protection invariant.The Problem
bootstrapWorktree.mjs --link-dataresolves canonical viagit worktree list --porcelain, which works for git worktrees (the original #10095 use case). For independent clones — separate clones at sibling filesystem paths, not worktrees —git worktree listreturns the clone itself, and the script correctly enters main-checkout mode (no-op). This left independent clones unable to opt into substrate unification through the script, despite needing the same architectural pattern.Empirical anchor (2026-04-27): the
antigravity/neomjs/neoclone had been hand-curated months ago with manualln -scalls that mirror the exact #10433 pattern. Whenwake-daemon/became a load-bearing subdir (per #10423/#10425), the clone needed it manually re-symlinked. This PR codifies what was previously hand-curated.The Fix
resolveMainCheckout(cwd, {explicitRoot})accepts an optionalexplicitRootparameter; returns it (path-resolved to absolute) when set, else falls through to the existing git-worktree-list logic.--canonical-root <path>flag andNEO_AI_CANONICAL_ROOTenv var (flag takes precedence).DATA_SUBDIRS_TO_LINK+symlinkDataDir) is already topology-agnostic — once canonical is resolved correctly, the existing logic does the right thing.Usage
node ai/scripts/bootstrapWorktree.mjs --link-data <h1 class="neo-h1" data-record-id="5">Independent-clone case (new)</h1> node ai/scripts/bootstrapWorktree.mjs --link-data \\ --canonical-root /Users/Shared/github/neomjs/neo <h1 class="neo-h1" data-record-id="6">Or via env var (composable in CI / shell aliases)</h1> NEO_AI_CANONICAL_ROOT=/Users/Shared/github/neomjs/neo \\ node ai/scripts/bootstrapWorktree.mjs --link-dataWhat Stays Unchanged
concepts/-untouched invariant (worktree AND independent-clone cases)force=falserefuses to clobber non-symlink dirs)DATA_FILES_TO_LINKallowlist (top-levelmemory-core.sqliteis unreferenced cruft per audit; symlinking it would propagate tech debt — see #10435 body)Test Evidence
resolveMainCheckoutexplicit-root behavior:path.resolveCross-Family Validation
@neo-gemini-pro(Antigravity) explicitly validated:--canonical-root/NEO_AI_CANONICAL_ROOTas the right topological seamImplemented anyway since context budget allowed and the substrate now codifies what was previously hand-curated, removing the future per-clone manual-symlink ops burden.
Post-Merge Validation
bootstrapWorktree.mjs --link-data --canonical-root <canonical>from an independent clone — expect per-subdir symlinks createdconcepts/in the independent clone remains a regular dir (load-bearing safety check)Out of Scope
memory-core.sqlitecruft (warrants its own tiny ticket if pursued)Related
wake-daemon/symlinking: #10423, #10425🤖 Generated with Claude Code