fix(config): give each git worktree its own namespace for subdirectory configs #1168
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.75) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #1168"
general
weight: 0.35
jdx
Linked git worktrees of one repository now get separate namespaces even when
pitchfork.tomllives in a subdirectory or the worktree's directory name contains--. No per-worktree file is needed. Reported in https://github.com/jdx/pitchfork/discussions/1167.Config in a subdirectory of a worktree
Before, every worktree's
app/pitchfork.tomlderived the namespaceappfrom its own directory. Sopitchfork start apiin a second worktree saidapp/apiwas already running, andpitchfork stop apistopped the other worktree's daemon.A derived namespace for a project in a subdirectory of a linked git worktree is now prefixed with the worktree's directory name. This includes worktrees of a bare repository or a
--separate-git-dirclone:| Config | Namespace |
|--------|-----------|
|
~/demo/app/pitchfork.toml(main checkout) |app(unchanged) ||
~/feature-a/app/pitchfork.toml(linked worktree) |feature-a-app||
~/feature-a/pitchfork.toml(worktree root) |feature-a(unchanged) |An explicit
namespace = "..."and apitchfork config addnamespace registration still take precedence. The proxy and web UI read namespaces the same way, so they pick this up as well.Invalid directory names are sanitized
Before, a worktree directory such as
review--1234made the config fail to load withinvalid namespace 'review--1234' ... contains reserved sequence '--'. A derived name that is not a valid namespace is now sanitized: spaces and other ASCII punctuation become-, runs of-or.collapse, and leading or trailing-are trimmed. Soreview--1234becomesreview-1234. Names that are already valid are unchanged. Directory names with non-ASCII characters still need an explicitnamespace, because sanitizing them would drop most of the name. An invalid explicitnamespaceis still rejected and is never rewritten.Compatibility
A daemon already running from a subdirectory of a linked worktree stays registered under its old ID (for example
app/api). After upgrading, the same short name in that worktree resolves to the new ID (feature-a-app/api). Stop the old daemon by its qualified ID. Only git worktrees are detected; jj workspaces are not.Validation
review--1234), each withapp/pitchfork.toml. It covers derived namespaces at the checkout root and in subdirectories, worktrees of a bare repository, submodules (not treated as worktrees), and explicit-namespace precedence. I also checked a real bare-repository worktree pair by hand.mise run ci-devpasses.AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.332.
🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
- Project namespaces in linked worktrees now include the worktree directory name when the project config is in a repository subdirectory. Worktree roots and primary-checkout directories retain directory-based names.
- Derived ASCII names replace unsupported characters with hyphens, collapse repeated hyphens or periods, and trim edge hyphens.
- Non-ASCII directory names still require an explicit namespace, and explicitly configured namespaces must meet naming rules.
- Added examples showing namespace names in a main checkout and linked worktrees.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->