From fe441858597f8cf076a0440d52d41b497d9cc5aa Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:04:23 -0400 Subject: [PATCH 01/11] chore(porch): bugfix-1199 init bugfix --- .../status.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml new file mode 100644 index 000000000..cb55ebfc1 --- /dev/null +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -0,0 +1,14 @@ +id: bugfix-1199 +title: afx-status-recommends-afx-towe +protocol: bugfix +phase: investigate +plan_phases: [] +current_plan_phase: null +gates: + pr: + status: pending +iteration: 1 +build_complete: false +history: [] +started_at: '2026-07-18T09:04:23.549Z' +updated_at: '2026-07-18T09:04:23.549Z' From 25e450ede9e9d014a7a3a59f65f05963d20fa2e6 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:06:46 -0400 Subject: [PATCH 02/11] chore(porch): bugfix-1199 fix phase-transition --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index cb55ebfc1..46aa79164 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1199 title: afx-status-recommends-afx-towe protocol: bugfix -phase: investigate +phase: fix plan_phases: [] current_plan_phase: null gates: @@ -11,4 +11,4 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T09:04:23.549Z' +updated_at: '2026-07-18T09:06:46.202Z' From 7ea226d016e84c4d6730df915be8a76cad90de63 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:13:48 -0400 Subject: [PATCH 03/11] [Bugfix #1199] Fix: recommend workspace start for inactive workspace --- packages/codev/src/agent-farm/commands/status.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/codev/src/agent-farm/commands/status.ts b/packages/codev/src/agent-farm/commands/status.ts index 29309326f..ebb003fae 100644 --- a/packages/codev/src/agent-farm/commands/status.ts +++ b/packages/codev/src/agent-farm/commands/status.ts @@ -265,7 +265,7 @@ export async function status(options: StatusOptions = {}): Promise { // Workspace not found in tower, show "not active" logger.kv('Workspace', chalk.gray('not active in tower')); - logger.info(`Run 'afx tower start' to activate this workspace`); + logger.info(`Run 'afx workspace start' to activate this workspace`); return; } From 6f60e33d3efbb21584ab1c34eddc853ed3f2636f Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:13:48 -0400 Subject: [PATCH 04/11] [Bugfix #1199] Test: cover distinct status startup recommendations --- codev/state/bugfix-1199_thread.md | 15 +++++++ .../__tests__/spec-1057-status-owner.test.ts | 43 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 codev/state/bugfix-1199_thread.md diff --git a/codev/state/bugfix-1199_thread.md b/codev/state/bugfix-1199_thread.md new file mode 100644 index 000000000..8f6934dd4 --- /dev/null +++ b/codev/state/bugfix-1199_thread.md @@ -0,0 +1,15 @@ +# Bugfix #1199 Thread + +## Investigate + +- Confirmed no existing PR or prior implementation for issue #1199. +- Reproduced the bug against the running Tower from a temporary, unregistered Codev workspace: `status()` reported `Workspace: not active in tower` and recommended `afx tower start`. +- Root cause: the Tower-running/unregistered-workspace branch in `packages/codev/src/agent-farm/commands/status.ts` contains a stale hard-coded `afx tower start` recommendation. The separate Tower-down branch correctly uses `afx tower start` to start the daemon. +- Fix scope is BUGFIX-appropriate: one production string plus focused unit coverage for the Tower-running/unregistered and Tower-down branches. No architectural changes are needed. + +## Fix + +- Changed only the unregistered-workspace recommendation to `afx workspace start`. +- Added deterministic unit coverage for both required branches and their distinct recommendations in `spec-1057-status-owner.test.ts`. +- Focused regression suite passed: 17/17 tests. +- Porch build and full test checks passed. The shared environment's `/tmp/.git` marker and global `~/.codev/config.json` initially contaminated unrelated non-hermetic tests; isolating `TMPDIR` and `HOME` made the unchanged baseline tests pass without out-of-scope edits. diff --git a/packages/codev/src/agent-farm/__tests__/spec-1057-status-owner.test.ts b/packages/codev/src/agent-farm/__tests__/spec-1057-status-owner.test.ts index 14dccb75a..9295067d8 100644 --- a/packages/codev/src/agent-farm/__tests__/spec-1057-status-owner.test.ts +++ b/packages/codev/src/agent-farm/__tests__/spec-1057-status-owner.test.ts @@ -323,3 +323,46 @@ describe('afx status — Tower-running human path (Spec 1057)', () => { expect(rows.map((r) => r[0])).toEqual(['builder-feedback-1']); }); }); + +// ============================================================================ +// Startup recommendations (Bugfix #1199) +// ============================================================================ + +describe('afx status — startup recommendations', () => { + beforeEach(() => { + vi.clearAllMocks(); + mockLoadState.mockReturnValue({ + architect: null, + architects: [], + builders: [], + utils: [], + annotations: [], + }); + }); + + it('recommends workspace start when Tower is running but the workspace is unregistered', async () => { + mockIsRunning.mockResolvedValue(true); + mockGetHealth.mockResolvedValue({ + uptime: 100, + activeWorkspaces: 1, + memoryUsage: 1024 * 1024, + }); + mockGetWorkspaceStatus.mockResolvedValue(null); + + await status(); + + const info = mockLoggerInfo.mock.calls.map((c) => stripAnsi(String(c[0]))); + expect(info).toContain(`Run 'afx workspace start' to activate this workspace`); + expect(info).not.toContain(`Run 'afx tower start' to activate this workspace`); + }); + + it('continues to recommend tower start when Tower is not running', async () => { + mockIsRunning.mockResolvedValue(false); + + await status(); + + const info = mockLoggerInfo.mock.calls.map((c) => stripAnsi(String(c[0]))); + expect(info).toContain(`Run 'afx tower start' to start the tower daemon`); + expect(info).not.toContain(`Run 'afx workspace start' to start the tower daemon`); + }); +}); From 103c1e123a47b68487039f867746242856844935 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:15:31 -0400 Subject: [PATCH 05/11] chore(porch): bugfix-1199 pr phase-transition --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index 46aa79164..65ae0c144 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1199 title: afx-status-recommends-afx-towe protocol: bugfix -phase: fix +phase: pr plan_phases: [] current_plan_phase: null gates: @@ -11,4 +11,4 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T09:06:46.202Z' +updated_at: '2026-07-18T09:15:02.783Z' From c664aee56b5098d18e3150e14fd216c572d070ea Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:16:31 -0400 Subject: [PATCH 06/11] chore(porch): bugfix-1199 record PR #1200 --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index 65ae0c144..0501342b1 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -11,4 +11,9 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T09:15:02.783Z' +updated_at: '2026-07-18T09:16:31.779Z' +pr_history: + - phase: pr + pr_number: 1200 + branch: builder/bugfix-1199 + created_at: '2026-07-18T09:16:31.778Z' From 4414698cc58371c3b0a40301a27a05e5694b1b86 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 05:18:20 -0400 Subject: [PATCH 07/11] [Bugfix #1199] Docs: record PR review status --- codev/state/bugfix-1199_thread.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codev/state/bugfix-1199_thread.md b/codev/state/bugfix-1199_thread.md index 8f6934dd4..a6faf30cf 100644 --- a/codev/state/bugfix-1199_thread.md +++ b/codev/state/bugfix-1199_thread.md @@ -13,3 +13,9 @@ - Added deterministic unit coverage for both required branches and their distinct recommendations in `spec-1057-status-owner.test.ts`. - Focused regression suite passed: 17/17 tests. - Porch build and full test checks passed. The shared environment's `/tmp/.git` marker and global `~/.codev/config.json` initially contaminated unrelated non-hermetic tests; isolating `TMPDIR` and `HOME` made the unchanged baseline tests pass without out-of-scope edits. + +## PR + +- Published the branch through the contributor fork and opened upstream PR #1200. +- CMAP results so far: Gemini `APPROVE` (high confidence); Codex `APPROVE` (high confidence). +- Blocked before the PR gate: the required Claude lane was attempted twice but the Claude CLI quota is exhausted until 9am America/Toronto. The architect was notified; no verdict was fabricated and the gate was not requested. From 346a32be695197dd1b0c99c5e6600b40b414b6a0 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 17:12:29 -0400 Subject: [PATCH 08/11] [Bugfix #1199] Docs: record completed CMAP --- codev/state/bugfix-1199_thread.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/state/bugfix-1199_thread.md b/codev/state/bugfix-1199_thread.md index a6faf30cf..b97c726fd 100644 --- a/codev/state/bugfix-1199_thread.md +++ b/codev/state/bugfix-1199_thread.md @@ -17,5 +17,5 @@ ## PR - Published the branch through the contributor fork and opened upstream PR #1200. -- CMAP results so far: Gemini `APPROVE` (high confidence); Codex `APPROVE` (high confidence). -- Blocked before the PR gate: the required Claude lane was attempted twice but the Claude CLI quota is exhausted until 9am America/Toronto. The architect was notified; no verdict was fabricated and the gate was not requested. +- CMAP completed with all three required verdicts: Gemini `APPROVE` (high confidence), Codex `APPROVE` (high confidence), and Claude `APPROVE` (high confidence). +- The Claude lane initially hit its CLI quota, then succeeded when retried after the quota window reset. No reviewer requested changes. From 91f62b7c0da6b00eb774c618f2fb28f60fab6e3c Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 17:12:37 -0400 Subject: [PATCH 09/11] chore(porch): bugfix-1199 pr gate-requested --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index 0501342b1..664f77f99 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -7,13 +7,15 @@ current_plan_phase: null gates: pr: status: pending + requested_at: '2026-07-18T21:12:37.974Z' iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T09:16:31.779Z' +updated_at: '2026-07-18T21:12:37.974Z' pr_history: - phase: pr pr_number: 1200 branch: builder/bugfix-1199 created_at: '2026-07-18T09:16:31.778Z' +pr_ready_for_human: true From be713d7739fe0de6ea3004879678dfb4f6daf7c8 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 17:16:42 -0400 Subject: [PATCH 10/11] chore(porch): bugfix-1199 pr gate-approved --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index 664f77f99..52d272e5e 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -6,16 +6,17 @@ plan_phases: [] current_plan_phase: null gates: pr: - status: pending + status: approved requested_at: '2026-07-18T21:12:37.974Z' + approved_at: '2026-07-18T21:16:42.226Z' iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T21:12:37.974Z' +updated_at: '2026-07-18T21:16:42.226Z' pr_history: - phase: pr pr_number: 1200 branch: builder/bugfix-1199 created_at: '2026-07-18T09:16:31.778Z' -pr_ready_for_human: true +pr_ready_for_human: false From db79193bf2606db99edda2efa6acf7a35613e966 Mon Sep 17 00:00:00 2001 From: Mohid Makhdoomi Date: Sat, 18 Jul 2026 17:17:09 -0400 Subject: [PATCH 11/11] chore(porch): bugfix-1199 protocol complete --- .../bugfix-1199-afx-status-recommends-afx-towe/status.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml index 52d272e5e..e9f4a309f 100644 --- a/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml +++ b/codev/projects/bugfix-1199-afx-status-recommends-afx-towe/status.yaml @@ -1,7 +1,7 @@ id: bugfix-1199 title: afx-status-recommends-afx-towe protocol: bugfix -phase: pr +phase: verified plan_phases: [] current_plan_phase: null gates: @@ -13,7 +13,7 @@ iteration: 1 build_complete: false history: [] started_at: '2026-07-18T09:04:23.549Z' -updated_at: '2026-07-18T21:16:42.226Z' +updated_at: '2026-07-18T21:17:09.868Z' pr_history: - phase: pr pr_number: 1200