docs(worktree): fix stale rename example + document copyFiles properly#1328
docs(worktree): fix stale rename example + document copyFiles properly#1328
Conversation
Three related fixes around the `worktree.copyFiles` primitive: 1. Remove the `.env.example -> .env` rename example from reference/configuration.md and getting-started/overview.md. The `->` parser was removed in #739 (2026-03-19) because it caused the stale-credentials production bug in #228 — but the docs kept advertising it. A user writing `.env.example -> .env` today gets `parseCopyFileEntry` returning `{source: '.env.example -> .env', destination: '.env.example -> .env'}`, stat() fails with ENOENT, and the copy silently no-ops at debug level. 2. Replace the single-line "Default behavior: .archon/ is always copied" note with a proper "Worktree file copying" subsection that explains: - Why this exists (git worktree add = tracked files only; gitignored workflow inputs need this hook) - The `.archon/` default (no config needed for the common case) - Common entries: .env, .vscode/, .claude/, plans/, reports/, data fixtures - Semantics: source=destination, ENOENT silently skipped, per-entry error isolation, path-traversal rejected - Interaction with `worktree.path` (both layouts get the same treatment) 3. Update the overview example to drop the `.env.example + .env` pair (which implied rename semantics) in favor of `.env + plans/`, and call out that `.archon/` is auto-copied so users don't list it. No code changes. `bun run format:check` and `bun run lint` green.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughDocumentation updates for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Three related fixes around
worktree.copyFilesdocumentation. No code changes.Context
The
worktree.copyFilesprimitive copies gitignored files/dirs from the canonical repo into new worktrees — exactly the mechanism that lets workflows,.envfiles, local plans, agent reports etc. reach isolated branches even whengit worktree addalone would leave them behind. It's the right primitive for the common "team repo doesn't want `.archon/` committed" ask (see the #1144 close comment).But the docs have three problems that make it easy to miss or misuse:
Stale rename syntax example that silently does nothing. Both
reference/configuration.mdandgetting-started/overview.mdshowed- .env.example -> .env # Rename during copy. The->parser was removed in 🐛 [Bug]: Fix DOCS inside project pls #739 (2026-03-19) after it caused the stale-credentials bug in Feature Request: consider loosening (or overriding) URL validity for knowledge scraping #228 — but the docs kept advertising it. A user writing.env.example -> .envtoday getsparseCopyFileEntryreturning{source: '.env.example -> .env', destination: '.env.example -> .env'},stat()fails with ENOENT, and the copy silently no-ops at debug level. No error surfaced.No explanation of when or why to use it. Three mentions across all docs, all bare config snippets. No framing of the root cause (git worktree = tracked files only) or common entries beyond
.env..archon/default described vaguely, with no mention that users don't need to list it.Changes
reference/configuration.md-> .envrename line from the main config example.archon/default, common entries (.env,.vscode/,.claude/,plans/,reports/, data fixtures), full semantics (source=destination, ENOENT silent skip, per-entry error isolation, path-traversal rejected), and interaction withworktree.pathgetting-started/overview.md.env.example + .env(which implied rename) to.env + plans/.archon/is auto-copied so users don't list itTest plan
bun run format:checkandbun run lintgreen locally## Configurationsiblings, links still intactSummary by CodeRabbit