feat: Track main projects independently from issue worktrees (IW-148) #236

Merged
mprihoda merged 20 commits from IW-148 into main 2026-03-03 19:49:52 +00:00
mprihoda commented 2026-03-03 11:31:33 +00:00 (Migrated from github.com)

Summary

Adds project registration support to the dashboard so projects appear even when they have zero active issue worktrees. This solves the chicken-and-egg problem where users couldn't create worktrees from the dashboard for a project that had never had one.

Problem

Projects were only derived from worktree paths — a project with no worktrees was invisible in the dashboard. Users had to fall back to the CLI (./iw start <issue-id>) to bootstrap their first worktree.

Solution

  • Domain: ProjectRegistration value object, ServerState.projects map
  • Application: ProjectRegistrationService for register/deregister logic, MainProjectService.resolveProjects() merges registered + derived projects
  • Infrastructure: PUT /api/v1/projects/:projectName endpoint, ServerClient.registerProject(), auto-pruning of stale registrations
  • Presentation: Updated empty states to mention ./iw register
  • CLI: register.scala context-aware (project from main branch, worktree+project from issue branch), start.scala auto-registers parent project, projects.scala includes registered projects

Key decisions

  • Path as storage key, project name for display (matches existing worktree approach)
  • Idempotent PUT semantics for all registrations
  • Auto-prune stale projects on dashboard load (same pattern as worktree pruning)
  • Best-effort registration in CLI (warn on failure, never error)

Test plan

  • 1687 unit tests passing (added ~50 new tests across 5 phases)
  • No compilation warnings
  • Code review passed for all phases
  • Manual verification: run ./iw register from main project dir
  • Manual verification: run ./iw start <issue-id> and verify project appears in dashboard
  • Manual verification: dashboard shows projects with zero worktrees

Phase PRs

  1. Domain Layer: #231
  2. Application Layer: #232
  3. Infrastructure Layer: #233
  4. Presentation Layer: #234
  5. CLI Integration: #235

🤖 Generated with Claude Code

## Summary Adds project registration support to the dashboard so projects appear even when they have zero active issue worktrees. This solves the chicken-and-egg problem where users couldn't create worktrees from the dashboard for a project that had never had one. ### Problem Projects were only derived from worktree paths — a project with no worktrees was invisible in the dashboard. Users had to fall back to the CLI (`./iw start <issue-id>`) to bootstrap their first worktree. ### Solution - **Domain**: `ProjectRegistration` value object, `ServerState.projects` map - **Application**: `ProjectRegistrationService` for register/deregister logic, `MainProjectService.resolveProjects()` merges registered + derived projects - **Infrastructure**: `PUT /api/v1/projects/:projectName` endpoint, `ServerClient.registerProject()`, auto-pruning of stale registrations - **Presentation**: Updated empty states to mention `./iw register` - **CLI**: `register.scala` context-aware (project from main branch, worktree+project from issue branch), `start.scala` auto-registers parent project, `projects.scala` includes registered projects ### Key decisions - Path as storage key, project name for display (matches existing worktree approach) - Idempotent PUT semantics for all registrations - Auto-prune stale projects on dashboard load (same pattern as worktree pruning) - Best-effort registration in CLI (warn on failure, never error) ## Test plan - [x] 1687 unit tests passing (added ~50 new tests across 5 phases) - [x] No compilation warnings - [x] Code review passed for all phases - [ ] Manual verification: run `./iw register` from main project dir - [ ] Manual verification: run `./iw start <issue-id>` and verify project appears in dashboard - [ ] Manual verification: dashboard shows projects with zero worktrees ## Phase PRs 1. Domain Layer: #231 2. Application Layer: #232 3. Infrastructure Layer: #233 4. Presentation Layer: #234 5. CLI Integration: #235 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.