Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
2cccb2f
feat(protocols/pir): add PIR protocol + skeleton mirror
amrmelsayed May 13, 2026
4222c17
fix(porch/artifacts): resolve artifacts for prefix-N project IDs
amrmelsayed May 13, 2026
2d835ef
feat(agent-farm): add spawnPir, dispatch pir + bugfix separately, DB …
amrmelsayed May 13, 2026
1b67cb0
feat(porch/state): recognize pir-* worktrees in detectProjectIdFromCwd
amrmelsayed May 13, 2026
ae50b8b
feat(porch/status): --json flag for structured gate state
amrmelsayed May 13, 2026
3487b72
feat(overview): surface PIR code-review gate in blocked allowlist + d…
amrmelsayed May 13, 2026
48e672a
fix(agent-farm/utils): add 'pir' to buildAgentName
amrmelsayed May 13, 2026
8956e15
feat(porch): wire up gate notifications via generic notifyTerminal pr…
amrmelsayed May 13, 2026
fffb628
feat(vscode): encode protocol in tree contextValue for menu scoping
amrmelsayed May 13, 2026
0ab5857
feat(vscode): View Plan / View Review File for PIR builders
amrmelsayed May 13, 2026
44f1298
feat(vscode): make state-change commands await results and update sid…
amrmelsayed May 13, 2026
c59bb0b
feat(vscode): toast when a builder reaches a human-approval gate
amrmelsayed May 13, 2026
d372c0b
test(porch): lock in PIR protocol shape
amrmelsayed May 13, 2026
d367df8
docs: add PIR to CLAUDE.md / AGENTS.md + file-resolution guidance
amrmelsayed May 13, 2026
ff05315
refactor(porch, vscode): drop architect-bound gate notifications
amrmelsayed May 13, 2026
419c1f3
fix(agent-farm/cleanup): invalidate Tower overview after removing bui…
amrmelsayed May 13, 2026
7f3d204
fix(agent-farm/spawn): pass porch project ID (not builder agent name)…
amrmelsayed May 13, 2026
7a22531
fix(agent-farm/overview): recognize PIR worktrees + branches
amrmelsayed May 13, 2026
622d7e3
fix(porch/approve): skip builder wake-up when caller is the builder i…
amrmelsayed May 13, 2026
567887e
fix(porch/cli): broadcast overview-changed after mutating commands
amrmelsayed May 13, 2026
17b784a
fix(vscode/review-diff): detect default branch per worktree, don't ha…
amrmelsayed May 13, 2026
e61c39d
fix(vscode/approve): use canonical gate name + correct cwd for porch …
amrmelsayed May 13, 2026
57f3eca
feat(vscode): inline Approve Gate button + drop View Review File
amrmelsayed May 13, 2026
7d37732
refactor(vscode): merge Needs Attention into Builders + redirect toas…
amrmelsayed May 13, 2026
4873c48
[Bugfix #737] Fix: sync Tower PTY dimensions on terminal open
amrmelsayed May 13, 2026
dc177c8
refactor(pir): align PIR project ID with SPIR — drop protocol prefix
amrmelsayed May 13, 2026
8efe115
docs(pir): scrub stale pir-<id>-<slug> filename references
amrmelsayed May 13, 2026
ac934b0
refactor(vscode): replace View Diff with Open Worktree in New Window
amrmelsayed May 15, 2026
3056f70
fix(pir): align CMAP execution with SPIR — porch-driven, no double-run
amrmelsayed May 15, 2026
6928942
feat(vscode): inline review comments on plan/spec files via Comments API
amrmelsayed May 15, 2026
ffaef44
feat(vscode): add Spawn Builder and New Shell to workspace sidebar
amrmelsayed May 15, 2026
46e65ed
fix(vscode): include PIR in spawn protocol picker
amrmelsayed May 15, 2026
04006b7
docs(pir): tighten protocol description to match SPIR's style
amrmelsayed May 15, 2026
dedb092
fix(vscode): close builder terminal tabs when builder is cleaned up
amrmelsayed May 15, 2026
014f745
refactor(vscode): reorder builder context menu — primary actions first
amrmelsayed May 15, 2026
b198f86
feat(pir): add pr gate — builder no longer runs gh pr merge
amrmelsayed May 15, 2026
481c503
fix(vscode): use last-write-wins in OverviewCache to survive SSE bursts
amrmelsayed May 15, 2026
aa99b9b
refactor(pir): rename code-review gate to dev-approval for naming con…
amrmelsayed May 15, 2026
0b23e13
docs(pir): reflect three-gate set in CLAUDE.md / AGENTS.md
amrmelsayed May 15, 2026
7d58039
feat(vscode): gate-toast action picks the most useful artifact per gate
amrmelsayed May 15, 2026
a896494
feat(vscode): richer approve dialog + one-click Approve from gate-pen…
amrmelsayed May 15, 2026
7862be1
fix(vscode): per-gate toast actions — use canonical gate key for lookup
amrmelsayed May 15, 2026
ca75e30
refactor(pir): builder runs merge after pr gate approval
amrmelsayed May 15, 2026
9fe711d
Merge fix/codex-sdk-cert-revocation into feat/691-pir-protocol
amrmelsayed May 15, 2026
11c98ec
feat(vscode): surface assigned-to-me backlog issues + click-to-spawn
amrmelsayed May 15, 2026
e2749a6
feat(vscode): View Issue backlog action; default click opens issue in…
amrmelsayed May 15, 2026
1511ed7
feat(vscode): show live item counts in Builders/Pull Requests/Backlog…
amrmelsayed May 15, 2026
ead62cd
feat(vscode): periodic overview refresh while the sidebar is visible
amrmelsayed May 16, 2026
3c23e16
feat(vscode): Recently Closed gets refresh button + live count
amrmelsayed May 16, 2026
0dc9652
fix(forge): recently-closed/merged dropped genuinely-recent items (ba…
amrmelsayed May 16, 2026
f0f2fe7
fix(vscode): quote gate-toast issue title; persist seen-set across re…
amrmelsayed May 16, 2026
90a8760
fix(pir): align review phase with max_iterations:1 single-pass design
amrmelsayed May 17, 2026
f0d3e4d
feat(vscode): Codev-managed dev server for the current workspace
amrmelsayed May 17, 2026
2c7b7e2
feat(vscode): dev server terminals open in the bottom panel
amrmelsayed May 17, 2026
8e2bb60
feat(vscode): Team view — clickable issue/PR rows, Refresh, Assigned …
amrmelsayed May 17, 2026
1ff16f2
feat(vscode): Team — collapse assigned-issues and open-PRs to counts
amrmelsayed May 17, 2026
deff725
feat(vscode): toggle Codev sidebar via Cmd+Alt+C (mac) / Ctrl+K C
amrmelsayed May 17, 2026
9464eb0
fix(vscode): Workspace Start/Stop Dev Server are mutually exclusive
amrmelsayed May 17, 2026
e146fb0
feat(vscode): symmetric Cmd+Alt / Ctrl+Alt keybindings for Codev actions
amrmelsayed May 18, 2026
9e72ec9
feat(vscode): friendly builder tab titles (Codev: #<id> <title>)
amrmelsayed May 18, 2026
986f56c
fix(vscode): backlog issue preview reuses one editor group
amrmelsayed May 18, 2026
00d1345
fix(team): use GitHub search.issueCount for true per-member counts
amrmelsayed May 18, 2026
3da673b
docs(vscode): changelog [Unreleased] + README refresh
amrmelsayed May 18, 2026
7ecd6c6
Merge origin/main into feat/691-pir-and-vscode-workflow
amrmelsayed May 18, 2026
0988eff
fix(db): reintroduce 'pir' builders.type migration as v10 (local DB)
amrmelsayed May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 56 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,34 @@ You are working in the Codev project itself, with multiple development protocols
- **ASPIR**: Autonomous SPIR (no human gates on spec/plan) - `codev/protocols/aspir/protocol.md`
- **AIR**: Autonomous Implement & Review for small features - `codev/protocols/air/protocol.md`
- **BUGFIX**: Bug fixes from GitHub issues - `codev/protocols/bugfix/protocol.md`
- **PIR**: Plan / Implement / Review — issue-driven with two pre-PR human gates (plan-approval, dev-approval) plus a post-PR `pr` gate. Lighter than SPIR; stronger than BUGFIX/AIR. Useful when a change needs design review before coding OR pre-PR testing of running code (e.g., mobile / UI / cross-platform). See `codev/protocols/pir/protocol.md`.
- **EXPERIMENT**: Disciplined experimentation - `codev/protocols/experiment/protocol.md`
- **MAINTAIN**: Codebase maintenance (code hygiene + documentation sync) - `codev/protocols/maintain/protocol.md`
- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique - `codev/protocols/research/protocol.md`

### File Resolution (How Codev Finds Protocols and Templates)

Codev resolves protocol files, prompts, agent definitions, and roles through a four-tier lookup (highest priority first):

1. `.codev/<path>` — user override (project-local customization)
2. `codev/<path>` — project-local copy (customized and checked in)
3. Runtime cache
4. **Installed package skeleton** — ships with `@cluesmith/codev` (the default for every standard protocol)

**The absence of `codev/protocols/<name>/` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`.

**Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol (e.g., PIR), do NOT drop the reference because `codev/protocols/<name>/` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes the protocol from the user's available-protocol list while it's still callable from the CLI.

### Protocol Verification (When You Don't Recognize a Protocol Name)

If the user mentions a protocol name you don't immediately recognize, verify against the CLI before responding:

```bash
afx spawn --protocol <name> --help
```

This succeeds if the protocol is registered (including via the skeleton fallback in tier 4 of the resolution chain) and errors helpfully otherwise. The CLI is the source of truth — defer to it when in doubt.

Key locations:
- Protocol details: `codev/protocols/` (Choose appropriate protocol)
- **Project tracking**: GitHub Issues (source of truth for all projects)
Expand Down Expand Up @@ -144,6 +168,26 @@ validated: [gemini, codex, claude]

**AIR uses GitHub Issues as source of truth.** Two phases: Implement → Review. See `codev/protocols/air/protocol.md`.

### Use PIR for (engineer-judged — based on the nature of the work, not its size):

Pick PIR when ONE or BOTH of the following apply to a GitHub-issue-driven change:

**1. The approach needs review before coding starts**:
- Root cause is ambiguous; multiple valid fixes exist
- Area is unfamiliar or high-blast-radius (shared utilities, auth, migrations, public APIs)
- Design-sensitive (affects conventions, patterns, architecture)
- Cheaper to redirect at plan time than at PR time

**2. The implementation needs to be TESTED before a PR is created** (PR diff alone is insufficient):
- Mobile app changes (needs device testing on Android, iOS, possibly web)
- UI / UX changes (visual inspection, interaction flow, accessibility)
- Hardware-adjacent behavior (sensors, camera, permissions, notifications)
- Integration with external services that don't mock cleanly (OAuth, payments, analytics)
- User-journey changes that need a full-flow exercise
- Performance-sensitive changes that need profiling on the running app

**PIR uses GitHub Issues as source of truth.** Three phases: Plan (gated by `plan-approval`) → Implement (gated by `dev-approval`) → Review (PR + CMAP-2 at PR, then gated by `pr` for merge synchronization — matching SPIR's pr-gate pattern but with no post-merge verify phase). Plan and review artifacts live in `codev/plans/` and `codev/reviews/` on the builder branch, ship to main with the merge. Review file is shaped identically to SPIR's (Summary + Architecture Updates + Lessons Learned + supporting sections) so `codev/reviews/` stays semantically consistent across protocols. Lighter than SPIR (no spec phase — the issue body is the implicit spec; consult footprint matches BUGFIX/AIR's "one consult at PR" pattern). Stronger than BUGFIX/AIR (two human gates pre-PR — the human reviews the running worktree at the `dev-approval` gate, not the PR diff post-creation). CMAP at the PR is a **single advisory pass** (`max_iterations: 1`) — no iterate-until-APPROVE loop; a `REQUEST_CHANGES` is escalated to the human at the `pr` gate, not auto-re-reviewed. The CMAP-2 footprint is a design invariant: porch's model precedence is *config > protocol*, so a project-wide `porch.consultation.models` (e.g. a SPIR-tuned 3-model list) silently inflates PIR — leave it unset or scope it per-protocol to preserve the BUGFIX/AIR-parity cost. See `codev/protocols/pir/protocol.md`.

### Use SPIR for (new features):
- Creating a **new feature from scratch** (no existing spec to amend)
- New protocols or protocol variants
Expand Down Expand Up @@ -286,7 +330,7 @@ When configured, each builder worktree (`.builders/<id>/`) becomes runnable —
"worktree": {
"symlinks": ["..."], // glob patterns of files to symlink from root into each new worktree
"postSpawn": ["..."], // shell commands run inside each new worktree after createWorktree
"devCommand": "..." // consumed by `afx dev <builder-id>`
"devCommand": "..." // consumed by `afx dev <builder-id|main>`
}
}
```
Expand All @@ -301,10 +345,13 @@ When configured, each builder worktree (`.builders/<id>/`) becomes runnable —

```bash
afx dev <builder-id> # start the dev server in <builder-id>'s worktree
afx dev --stop # stop the currently running dev PTY
afx dev main # start the dev server in the MAIN workspace (Codev-managed)
afx dev --stop # stop the currently running dev PTY (builder or main)
```

Only one dev PTY runs at a time (by design — see "URLs are load-bearing" below). Running `afx dev` while another builder's dev is up prompts for swap. Same-builder requests print the existing terminal URL and exit.
Only one dev PTY runs at a time (by design — see "URLs are load-bearing" below), across **{main + all builders}**. `main` is a reserved target: it runs `worktree.devCommand` in the main checkout as a Codev-managed, swappable PTY, symmetric with builders. Starting any target while another is up prompts for swap (`afx dev <builder>` while `main` runs, or vice-versa); same-target requests print the existing terminal URL and exit. Like builder dev, main dev is a **non-persistent** PTY — a Tower restart (`pnpm -w run local-install`, crash) kills it; re-run to restart.

**Launch main dev via `afx dev main`, not a bare `pnpm dev`.** A manually-run `pnpm dev` at the repo root is invisible to Codev (the deliberate "never kill what it didn't spawn" policy) — start a builder dev while it holds the ports and the builder dev silently fails to bind, or worse serves main's code under the worktree URL. `afx dev main` makes it a managed PTY that swap-detection can cleanly stop first. This only helps if you use it *consistently*; a hand-started `pnpm dev` stays unmanaged.

### VSCode

Expand All @@ -317,11 +364,16 @@ The same actions are available via right-click on any builder row in the Codev s
- **Codev: Run Dev Server** — reads `worktree.devCommand` from `.codev/config.json`, asks Tower to spawn a dev PTY in the builder's worktree, and opens it as a VSCode terminal tab named `Codev: <name> (dev)`. If another builder's dev is already running, you get a modal asking whether to swap.
- **Codev: Stop Dev Server** — kills the running dev PTY and closes its tab.

The Codev sidebar's **Workspace** view also carries a dev server for *whatever folder this VSCode window is rooted at* (it is not "main"-specific):

- **Start Dev Server** — runs `worktree.devCommand` for the current workspace. Target is resolved from the open folder: the main checkout → `main`; a `.builders/<id>/` worktree opened as its own window (e.g. via *Open Worktree as Workspace*) → that builder. Same single-slot swap model as builder dev (prompts if another dev is running). The row tooltip names the resolved target.
- **Stop Dev Server** — stops this workspace's dev server; the row appears only while it is running. Scoped to the resolved target — it does not touch other devs.

The three commands are also available from the command palette (Cmd+Shift+P). No default keybindings; bind via `keybindings.json` if you use them often.

### URLs are load-bearing

The dev PTY uses **the same ports and URLs as main** intentionally. OAuth callbacks, CORS allowlists, cookie scoping, CSP `connect-src`, webhook URLs are all keyed off origin — running the worktree on a different port would break them. Consequence: stop main's `pnpm dev` before `afx dev`. If you don't, the spawned dev fails at bind time with its own `EADDRINUSE`.
The dev PTY uses **the same ports and URLs as main** intentionally. OAuth callbacks, CORS allowlists, cookie scoping, CSP `connect-src`, webhook URLs are all keyed off origin — running the worktree on a different port would break them. Consequence: stop main's `pnpm dev` before `afx dev`. If you don't, the spawned dev fails at bind time with its own `EADDRINUSE`. Prefer `afx dev main` (or the Workspace view's *Start Dev Server* row) over a hand-run `pnpm dev` so Codev owns the PTY and swap-detection can stop it for you automatically.

### Cleanup semantics

Expand Down
60 changes: 56 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,34 @@ You are working in the Codev project itself, with multiple development protocols
- **ASPIR**: Autonomous SPIR (no human gates on spec/plan) - `codev/protocols/aspir/protocol.md`
- **AIR**: Autonomous Implement & Review for small features - `codev/protocols/air/protocol.md`
- **BUGFIX**: Bug fixes from GitHub issues - `codev/protocols/bugfix/protocol.md`
- **PIR**: Plan / Implement / Review — issue-driven with two pre-PR human gates (plan-approval, dev-approval) plus a post-PR `pr` gate. Lighter than SPIR; stronger than BUGFIX/AIR. Useful when a change needs design review before coding OR pre-PR testing of running code (e.g., mobile / UI / cross-platform). See `codev/protocols/pir/protocol.md`.
- **EXPERIMENT**: Disciplined experimentation - `codev/protocols/experiment/protocol.md`
- **MAINTAIN**: Codebase maintenance (code hygiene + documentation sync) - `codev/protocols/maintain/protocol.md`
- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique - `codev/protocols/research/protocol.md`

### File Resolution (How Codev Finds Protocols and Templates)

Codev resolves protocol files, prompts, agent definitions, and roles through a four-tier lookup (highest priority first):

1. `.codev/<path>` — user override (project-local customization)
2. `codev/<path>` — project-local copy (customized and checked in)
3. Runtime cache
4. **Installed package skeleton** — ships with `@cluesmith/codev` (the default for every standard protocol)

**The absence of `codev/protocols/<name>/` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`.

**Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol (e.g., PIR), do NOT drop the reference because `codev/protocols/<name>/` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes the protocol from the user's available-protocol list while it's still callable from the CLI.

### Protocol Verification (When You Don't Recognize a Protocol Name)

If the user mentions a protocol name you don't immediately recognize, verify against the CLI before responding:

```bash
afx spawn --protocol <name> --help
```

This succeeds if the protocol is registered (including via the skeleton fallback in tier 4 of the resolution chain) and errors helpfully otherwise. The CLI is the source of truth — defer to it when in doubt.

Key locations:
- Protocol details: `codev/protocols/` (Choose appropriate protocol)
- **Project tracking**: GitHub Issues (source of truth for all projects)
Expand Down Expand Up @@ -144,6 +168,26 @@ validated: [gemini, codex, claude]

**AIR uses GitHub Issues as source of truth.** Two phases: Implement → Review. See `codev/protocols/air/protocol.md`.

### Use PIR for (engineer-judged — based on the nature of the work, not its size):

Pick PIR when ONE or BOTH of the following apply to a GitHub-issue-driven change:

**1. The approach needs review before coding starts**:
- Root cause is ambiguous; multiple valid fixes exist
- Area is unfamiliar or high-blast-radius (shared utilities, auth, migrations, public APIs)
- Design-sensitive (affects conventions, patterns, architecture)
- Cheaper to redirect at plan time than at PR time

**2. The implementation needs to be TESTED before a PR is created** (PR diff alone is insufficient):
- Mobile app changes (needs device testing on Android, iOS, possibly web)
- UI / UX changes (visual inspection, interaction flow, accessibility)
- Hardware-adjacent behavior (sensors, camera, permissions, notifications)
- Integration with external services that don't mock cleanly (OAuth, payments, analytics)
- User-journey changes that need a full-flow exercise
- Performance-sensitive changes that need profiling on the running app

**PIR uses GitHub Issues as source of truth.** Three phases: Plan (gated by `plan-approval`) → Implement (gated by `dev-approval`) → Review (PR + CMAP-2 at PR, then gated by `pr` for merge synchronization — matching SPIR's pr-gate pattern but with no post-merge verify phase). Plan and review artifacts live in `codev/plans/` and `codev/reviews/` on the builder branch, ship to main with the merge. Review file is shaped identically to SPIR's (Summary + Architecture Updates + Lessons Learned + supporting sections) so `codev/reviews/` stays semantically consistent across protocols. Lighter than SPIR (no spec phase — the issue body is the implicit spec; consult footprint matches BUGFIX/AIR's "one consult at PR" pattern). Stronger than BUGFIX/AIR (two human gates pre-PR — the human reviews the running worktree at the `dev-approval` gate, not the PR diff post-creation). CMAP at the PR is a **single advisory pass** (`max_iterations: 1`) — no iterate-until-APPROVE loop; a `REQUEST_CHANGES` is escalated to the human at the `pr` gate, not auto-re-reviewed. The CMAP-2 footprint is a design invariant: porch's model precedence is *config > protocol*, so a project-wide `porch.consultation.models` (e.g. a SPIR-tuned 3-model list) silently inflates PIR — leave it unset or scope it per-protocol to preserve the BUGFIX/AIR-parity cost. See `codev/protocols/pir/protocol.md`.

### Use SPIR for (new features):
- Creating a **new feature from scratch** (no existing spec to amend)
- New protocols or protocol variants
Expand Down Expand Up @@ -286,7 +330,7 @@ When configured, each builder worktree (`.builders/<id>/`) becomes runnable —
"worktree": {
"symlinks": ["..."], // glob patterns of files to symlink from root into each new worktree
"postSpawn": ["..."], // shell commands run inside each new worktree after createWorktree
"devCommand": "..." // consumed by `afx dev <builder-id>`
"devCommand": "..." // consumed by `afx dev <builder-id|main>`
}
}
```
Expand All @@ -301,10 +345,13 @@ When configured, each builder worktree (`.builders/<id>/`) becomes runnable —

```bash
afx dev <builder-id> # start the dev server in <builder-id>'s worktree
afx dev --stop # stop the currently running dev PTY
afx dev main # start the dev server in the MAIN workspace (Codev-managed)
afx dev --stop # stop the currently running dev PTY (builder or main)
```

Only one dev PTY runs at a time (by design — see "URLs are load-bearing" below). Running `afx dev` while another builder's dev is up prompts for swap. Same-builder requests print the existing terminal URL and exit.
Only one dev PTY runs at a time (by design — see "URLs are load-bearing" below), across **{main + all builders}**. `main` is a reserved target: it runs `worktree.devCommand` in the main checkout as a Codev-managed, swappable PTY, symmetric with builders. Starting any target while another is up prompts for swap (`afx dev <builder>` while `main` runs, or vice-versa); same-target requests print the existing terminal URL and exit. Like builder dev, main dev is a **non-persistent** PTY — a Tower restart (`pnpm -w run local-install`, crash) kills it; re-run to restart.

**Launch main dev via `afx dev main`, not a bare `pnpm dev`.** A manually-run `pnpm dev` at the repo root is invisible to Codev (the deliberate "never kill what it didn't spawn" policy) — start a builder dev while it holds the ports and the builder dev silently fails to bind, or worse serves main's code under the worktree URL. `afx dev main` makes it a managed PTY that swap-detection can cleanly stop first. This only helps if you use it *consistently*; a hand-started `pnpm dev` stays unmanaged.

### VSCode

Expand All @@ -317,11 +364,16 @@ The same actions are available via right-click on any builder row in the Codev s
- **Codev: Run Dev Server** — reads `worktree.devCommand` from `.codev/config.json`, asks Tower to spawn a dev PTY in the builder's worktree, and opens it as a VSCode terminal tab named `Codev: <name> (dev)`. If another builder's dev is already running, you get a modal asking whether to swap.
- **Codev: Stop Dev Server** — kills the running dev PTY and closes its tab.

The Codev sidebar's **Workspace** view also carries a dev server for *whatever folder this VSCode window is rooted at* (it is not "main"-specific):

- **Start Dev Server** — runs `worktree.devCommand` for the current workspace. Target is resolved from the open folder: the main checkout → `main`; a `.builders/<id>/` worktree opened as its own window (e.g. via *Open Worktree as Workspace*) → that builder. Same single-slot swap model as builder dev (prompts if another dev is running). The row tooltip names the resolved target.
- **Stop Dev Server** — stops this workspace's dev server; the row appears only while it is running. Scoped to the resolved target — it does not touch other devs.

The three commands are also available from the command palette (Cmd+Shift+P). No default keybindings; bind via `keybindings.json` if you use them often.

### URLs are load-bearing

The dev PTY uses **the same ports and URLs as main** intentionally. OAuth callbacks, CORS allowlists, cookie scoping, CSP `connect-src`, webhook URLs are all keyed off origin — running the worktree on a different port would break them. Consequence: stop main's `pnpm dev` before `afx dev`. If you don't, the spawned dev fails at bind time with its own `EADDRINUSE`.
The dev PTY uses **the same ports and URLs as main** intentionally. OAuth callbacks, CORS allowlists, cookie scoping, CSP `connect-src`, webhook URLs are all keyed off origin — running the worktree on a different port would break them. Consequence: stop main's `pnpm dev` before `afx dev`. If you don't, the spawned dev fails at bind time with its own `EADDRINUSE`. Prefer `afx dev main` (or the Workspace view's *Start Dev Server* row) over a hand-run `pnpm dev` so Codev owns the PTY and swap-detection can stop it for you automatically.

### Cleanup semantics

Expand Down
Loading
Loading