Skip to content

Let sibling worktrees coexist and quiet upgrade bounce alerts - #10

Merged
quantizor merged 4 commits into
mainfrom
feat/worktree-coexistence
Jul 28, 2026
Merged

Let sibling worktrees coexist and quiet upgrade bounce alerts#10
quantizor merged 4 commits into
mainfrom
feat/worktree-coexistence

Conversation

@quantizor

Copy link
Copy Markdown
Owner

Summary

  • Sibling git worktrees can both run under supervision without editing devservers.json: auto-rebind, ephemeral worktree-*.localhost hosts, and agent context that points at the live URL
  • Discarded checkouts are pruned on boot and status --all, with identity-safe teardown so recycled PIDs are never signaled
  • Composite servers can claim a port span / named subports as a block; lock resume settles until the claim is free; why keeps terminal evidence and works for file-backed projects
  • Install/restart no longer banners expected daemon-restart bounce events, finishes recover before accepting clients, and restores serially so siblings do not double-claim a port

Test plan

  • make test
  • scripts/smoke.sh
  • Ensure the same server from two worktrees of one repo: preferred host stays on the main origin, worktree gets an ephemeral host/port, both healthy
  • Discard a worktree path and confirm boot / status --all stops its servers and drops registry state
  • Install or restart the daemon with servers running: no false “x has crashed” banners; servers come back without EADDRINUSE races
  • devctl why on a file-only trusted project (no ad-hoc registry specs) returns real findings
  • Optional: Candor-style composite with portEnv + portSpan rebinds the whole block on a sibling ensure

Auto-rebind and ephemeral worktree hosts keep both checkouts supervised, while unrelated holders stay a loud refuse and agents always see the live URL.
When a registered project path is gone, the daemon stops children (with
start-time identity checks so recycled PIDs are never signaled), drops
registry/state/locks, and frees the ephemeral worktree host on boot and
status --all, without a doctor --fix pass.
Sibling rebind frees portSpan and named subports together, resume refuses a dirty claim instead of racing a bind, and why keeps terminal evidence across ensure truncate so exit-0 refusals stay diagnosable.
Install/restart was racing recover, double-spawning siblings onto the same port and banner-notifying expected daemon-restart events; why also skipped file-backed specs.
Copilot AI review requested due to automatic review settings July 28, 2026 15:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@quantizor
quantizor merged commit b7bc910 into main Jul 28, 2026
3 checks passed
@quantizor
quantizor deleted the feat/worktree-coexistence branch July 28, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants