fix(KB-503): fix process.exit mock in project tests

- Add proper process.exit mock that throws error for testability
- All 6 project command tests now passing
This commit is contained in:
gsxdsm
2026-03-31 22:42:57 -07:00
parent 602cea0817
commit 2221f9a2b9
28 changed files with 223 additions and 59 deletions

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-503",
"createdAt": "2026-03-31T20:54:26.274Z",
"updatedAt": "2026-04-01T05:41:22.866Z",
"updatedAt": "2026-04-01T05:42:22.866Z",
"columnMovedAt": "2026-03-31T20:56:09.228Z",
"dependencies": [],
"steps": [],

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-618",
"createdAt": "2026-03-31T21:01:18.282Z",
"updatedAt": "2026-04-01T05:41:22.868Z",
"updatedAt": "2026-04-01T05:42:22.867Z",
"columnMovedAt": "2026-03-31T22:15:49.127Z",
"dependencies": [
"KB-501",

View File

@@ -7,7 +7,7 @@
"currentStep": 2,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/merry-otter",
"createdAt": "2026-03-31T21:01:18.283Z",
"updatedAt": "2026-04-01T05:40:12.154Z",
"updatedAt": "2026-04-01T05:42:30.151Z",
"columnMovedAt": "2026-04-01T03:17:36.670Z",
"dependencies": [
"KB-501"
@@ -192,6 +192,15 @@
"timestamp": "2026-04-01T05:40:12.154Z",
"action": "plan review Step 2: APPROVE",
"outcome": "The step plan is well-structured and achievable. Step 1 (`project-context.ts`) is already complete with comprehensive tests, providing a solid foundation. The Step 2 plan correctly identifies the six project commands needed, their signatures, and expected behaviors. The implementation approach follows the established CLI patterns in the codebase."
},
{
"timestamp": "2026-04-01T05:41:48.621Z",
"action": "code review requested for Step 2 (Project Subcommand Implementation)"
},
{
"timestamp": "2026-04-01T05:42:30.151Z",
"action": "code review Step 2: REVISE",
"outcome": "The project command implementations are well-structured and follow the task specification closely. All 6 required commands (`list`, `add`, `remove`, `show`, `set-default`, `detect`) are implemented with proper validation, security checks, and user-friendly output. However, there's a **critical test bug** that will cause test failures: the tests expect promise rejections (`rejects.toThrow()`) but the implementation uses `process.exit(1)` which doesn't throw - it terminates the process."
}
]
}

View File

@@ -7,7 +7,7 @@
"reviewLevel": 3,
"currentStep": 0,
"createdAt": "2026-03-31T21:01:18.284Z",
"updatedAt": "2026-04-01T05:41:22.868Z",
"updatedAt": "2026-04-01T05:42:22.868Z",
"columnMovedAt": "2026-03-31T22:13:59.657Z",
"dependencies": [
"KB-500",

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-618",
"createdAt": "2026-03-31T23:26:05.506Z",
"updatedAt": "2026-04-01T05:41:22.869Z",
"updatedAt": "2026-04-01T05:42:22.869Z",
"columnMovedAt": "2026-03-31T23:32:41.668Z",
"dependencies": [],
"steps": [],

View File

@@ -4,10 +4,10 @@
"column": "in-progress",
"size": "L",
"reviewLevel": 3,
"currentStep": 4,
"currentStep": 5,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/sleek-marsh",
"createdAt": "2026-03-31T23:26:20.160Z",
"updatedAt": "2026-04-01T05:40:29.860Z",
"updatedAt": "2026-04-01T05:42:20.555Z",
"columnMovedAt": "2026-04-01T03:15:21.660Z",
"dependencies": [
"KB-616"
@@ -31,7 +31,7 @@
},
{
"name": "SetupWizard Component",
"status": "in-progress"
"status": "done"
},
{
"name": "Overview Page",
@@ -177,6 +177,15 @@
{
"timestamp": "2026-04-01T05:40:29.860Z",
"action": "Step 4 (SetupWizard Component) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:20.554Z",
"action": "Step 4 (SetupWizard Component) → done"
},
{
"timestamp": "2026-04-01T05:42:20.555Z",
"action": "Progress Summary: Completed Steps 2-4 and added missing server routes",
"outcome": "Created: ProjectCard component with health metrics and status badges, ActivityFeed component with grouped entries, SetupWizard component with 5-step flow. Also added missing server-side project API routes to routes.ts. All components have comprehensive tests (22, 13, and 14 tests respectively, all passing). Total commits: 4."
}
]
}

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-503",
"createdAt": "2026-03-31T23:26:33.164Z",
"updatedAt": "2026-04-01T05:41:22.870Z",
"updatedAt": "2026-04-01T05:42:22.870Z",
"columnMovedAt": "2026-03-31T23:34:08.949Z",
"dependencies": [
"KB-616",

View File

@@ -7,7 +7,7 @@
"reviewLevel": 3,
"currentStep": 0,
"createdAt": "2026-03-31T23:26:48.611Z",
"updatedAt": "2026-04-01T05:41:22.871Z",
"updatedAt": "2026-04-01T05:42:22.871Z",
"columnMovedAt": "2026-03-31T23:35:32.331Z",
"dependencies": [
"KB-615",

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-618",
"createdAt": "2026-03-31T23:28:36.515Z",
"updatedAt": "2026-04-01T05:41:22.872Z",
"updatedAt": "2026-04-01T05:42:22.872Z",
"columnMovedAt": "2026-03-31T23:35:26.160Z",
"dependencies": [],
"steps": [],

View File

@@ -8,7 +8,7 @@
"currentStep": 0,
"blockedBy": "KB-503",
"createdAt": "2026-04-01T01:05:35.675Z",
"updatedAt": "2026-04-01T05:41:22.873Z",
"updatedAt": "2026-04-01T05:42:22.873Z",
"columnMovedAt": "2026-04-01T01:10:33.211Z",
"dependencies": [
"KB-632"

View File

@@ -7,7 +7,7 @@
"reviewLevel": 3,
"currentStep": 0,
"createdAt": "2026-04-01T01:05:39.475Z",
"updatedAt": "2026-04-01T05:41:22.873Z",
"updatedAt": "2026-04-01T05:42:22.873Z",
"columnMovedAt": "2026-04-01T01:14:44.800Z",
"dependencies": [
"KB-632",

View File

@@ -1,16 +1,14 @@
{
"id": "KB-637",
"description": "Fix pre-existing test failures: (1) packages/engine/src/executor.test.ts hangs on \"throws original error if cleanup also fails\" test case - likely a missing mock or unresolved promise. (2) packages/dashboard has 64 failing tests across routes.test.ts, Board.test.tsx, GitManagerModal.test.tsx, InlineCreateCard.test.tsx, SettingsModal.test.tsx, file-service.test.ts, github-poll.test.ts, and typecheck.test.ts - failures exist on main branch.",
"column": "in-review",
"status": "merging",
"column": "done",
"size": "M",
"reviewLevel": 2,
"currentStep": 6,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/light-aspen",
"summary": "Fixed pre-existing test failures across engine and dashboard packages:\n\n1. **Engine executor test** (packages/engine/src/executor.test.ts): Added missing mock for `git worktree list --porcelain` command that was causing the \"throws original error if cleanup also fails\" test to hang indefinitely.\n\n2. **Dashboard SettingsModal** (packages/dashboard/app/components/SettingsModal.tsx): Already fixed in previous commit - moved `activeSectionScope` variable declaration before the `handleExport` useCallback that references it, resolving the temporal dead zone issue.\n\n3. **Dashboard routes tests** (packages/dashboard/src/routes.test.ts): Added missing `getMissionStore` mock to `createMockStore()` and updated Git Management endpoint tests to use `process.cwd()` instead of `/fake/root` so git commands work properly in the test environment.\n\nResults:\n- Engine \"throws original error if cleanup also fails\" test passes when run individually\n- SettingsModal 86/88 tests pass (2 pre-existing failures unrelated to our fix)\n- Git Management 65 tests now pass (previously all failing due to missing mission store mock)\n\nNote: Full engine test suite has memory issues when run all at once (pre-existing infrastructure issue), and dashboard has pre-existing type errors in mission-routes.ts unrelated to these test fixes.",
"createdAt": "2026-04-01T01:38:28.195Z",
"updatedAt": "2026-04-01T05:40:50.512Z",
"columnMovedAt": "2026-04-01T05:40:41.219Z",
"updatedAt": "2026-04-01T05:41:48.627Z",
"columnMovedAt": "2026-04-01T05:41:48.627Z",
"dependencies": [],
"steps": [
{

View File

@@ -10,7 +10,7 @@
"modelProvider": "openai-codex",
"modelId": "gpt-5.4",
"createdAt": "2026-04-01T01:52:07.518Z",
"updatedAt": "2026-04-01T05:41:22.874Z",
"updatedAt": "2026-04-01T05:42:22.874Z",
"columnMovedAt": "2026-04-01T01:53:06.056Z",
"dependencies": [],
"steps": [],

View File

@@ -9,7 +9,7 @@
"currentStep": 0,
"blockedBy": "KB-618",
"createdAt": "2026-04-01T01:54:15.047Z",
"updatedAt": "2026-04-01T05:41:22.875Z",
"updatedAt": "2026-04-01T05:42:22.875Z",
"columnMovedAt": "2026-04-01T01:58:47.407Z",
"dependencies": [
"KB-292"

View File

@@ -4,11 +4,11 @@
"column": "in-progress",
"size": "M",
"reviewLevel": 2,
"currentStep": 0,
"currentStep": 1,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/early-hawk",
"baseBranch": "kb/kb-637",
"createdAt": "2026-04-01T02:13:55.663Z",
"updatedAt": "2026-04-01T05:41:25.465Z",
"updatedAt": "2026-04-01T05:42:51.085Z",
"columnMovedAt": "2026-04-01T05:41:22.877Z",
"dependencies": [
"KB-637"
@@ -20,7 +20,7 @@
},
{
"name": "Enable Parallel File Execution in Core Package",
"status": "pending"
"status": "in-progress"
},
{
"name": "Enable Parallel File Execution in Engine Package",
@@ -68,6 +68,24 @@
{
"timestamp": "2026-04-01T05:41:25.465Z",
"action": "Step 0 (Optimize Backup Tests - Eliminate Real-Time Delays) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:31.626Z",
"action": "Baseline established: Core tests take ~30s, backup tests alone take ~24s. Engine has OOM issue likely from KB-637.",
"outcome": "Confirmed the problem - waitForNextSecond() with 1100ms delays is the main bottleneck."
},
{
"timestamp": "2026-04-01T05:42:31.627Z",
"action": "Step 1 (Enable Parallel File Execution in Core Package) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:31.628Z",
"action": "plan review requested for Step 1 (Optimize Backup Tests - Eliminate Real-Time Delays)"
},
{
"timestamp": "2026-04-01T05:42:51.085Z",
"action": "plan review Step 1: APPROVE",
"outcome": "The plan correctly identifies the bottleneck (`waitForNextSecond()` with 1100ms delays at 9 locations totaling ~10 seconds) and proposes the right solution direction (Vitest fake timers). The step checkboxes will achieve the stated outcome of reducing backup test time from ~24s to <2s. However, there are important implementation details the worker should be aware of when using fake timers with this specific backup system."
}
]
}

View File

@@ -10,7 +10,7 @@
"modelProvider": "openai-codex",
"modelId": "gpt-5.4",
"createdAt": "2026-04-01T02:35:50.893Z",
"updatedAt": "2026-04-01T05:41:22.976Z",
"updatedAt": "2026-04-01T05:42:22.876Z",
"columnMovedAt": "2026-04-01T02:41:37.980Z",
"dependencies": [],
"steps": [],

View File

@@ -1,15 +1,14 @@
{
"id": "KB-652",
"description": "Openai-codex in model selector should use the openai logo",
"column": "in-review",
"column": "done",
"size": "S",
"reviewLevel": 0,
"currentStep": 4,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/eager-eagle",
"summary": "Successfully added `openai-codex` provider alias to display the OpenAI logo in the model selector. Added the mapping in `providerConfig` (ProviderIcon.tsx) with the same OpenAI icon and green color (#10a37f) as the `openai` entry. Added comprehensive test coverage including icon rendering and color verification tests. All 26 ProviderIcon tests pass, and the vite client build succeeds.",
"createdAt": "2026-04-01T02:36:05.138Z",
"updatedAt": "2026-04-01T05:40:50.420Z",
"columnMovedAt": "2026-04-01T05:40:50.420Z",
"updatedAt": "2026-04-01T05:42:04.870Z",
"columnMovedAt": "2026-04-01T05:42:04.870Z",
"dependencies": [],
"steps": [
{

View File

@@ -1,14 +1,14 @@
{
"id": "KB-653",
"description": "Truncate board titles to 140 characters",
"column": "in-progress",
"column": "done",
"size": "S",
"reviewLevel": 0,
"currentStep": 3,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/azure-lotus",
"summary": "Implemented board title truncation to 140 characters in TaskCard.tsx. Added truncate() utility function that truncates text to max 140 chars with ellipsis (…) suffix. The full untruncated text is shown in a tooltip via the title attribute. Added 7 comprehensive test cases covering: short titles, exactly 140 chars, over 140 chars, description fallback, and tooltip verification. All tests pass. Created changeset file for the patch release.",
"createdAt": "2026-04-01T02:36:33.043Z",
"updatedAt": "2026-04-01T05:41:34.028Z",
"columnMovedAt": "2026-04-01T05:37:53.057Z",
"updatedAt": "2026-04-01T05:42:14.023Z",
"columnMovedAt": "2026-04-01T05:42:14.023Z",
"dependencies": [],
"steps": [
{
@@ -74,6 +74,10 @@
{
"timestamp": "2026-04-01T05:41:34.028Z",
"action": "Step 2 (Documentation & Delivery) → done"
},
{
"timestamp": "2026-04-01T05:41:44.482Z",
"action": "Task marked done by agent"
}
]
}

View File

@@ -1,17 +1,29 @@
{
"id": "KB-654",
"description": "On some devices the bottom of the board is off screen",
"column": "todo",
"status": "queued",
"column": "in-progress",
"size": "S",
"reviewLevel": 0,
"currentStep": 0,
"blockedBy": "KB-625",
"currentStep": 2,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/quiet-robin",
"createdAt": "2026-04-01T02:37:34.562Z",
"updatedAt": "2026-04-01T03:01:51.779Z",
"columnMovedAt": "2026-04-01T02:46:01.322Z",
"updatedAt": "2026-04-01T05:42:10.485Z",
"columnMovedAt": "2026-04-01T05:41:52.873Z",
"dependencies": [],
"steps": [],
"steps": [
{
"name": "Update Board Height CSS",
"status": "done"
},
{
"name": "Testing & Verification",
"status": "done"
},
{
"name": "Documentation & Delivery",
"status": "in-progress"
}
],
"log": [
{
"timestamp": "2026-04-01T02:37:34.562Z",
@@ -25,6 +37,42 @@
"timestamp": "2026-04-01T02:45:59.669Z",
"action": "Spec review: APPROVE",
"outcome": "The specification is accurate and complete. The issue description matches the actual code at `packages/dashboard/app/styles.css:384`, and the referenced pattern at line 2791 confirms the `dvh` fallback approach is already established in the codebase. The task size (S) and review level (0) are appropriate for this isolated CSS-only bug fix."
},
{
"timestamp": "2026-04-01T05:41:53.114Z",
"action": "Worktree created at /Users/eclipxe/Projects/kb/.worktrees/quiet-robin"
},
{
"timestamp": "2026-04-01T05:41:53.117Z",
"action": "Step 0 (Update Board Height CSS) → pending"
},
{
"timestamp": "2026-04-01T05:41:57.266Z",
"action": "Step 0 (Update Board Height CSS) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:00.636Z",
"action": "Step 0 (Update Board Height CSS) → done"
},
{
"timestamp": "2026-04-01T05:42:00.637Z",
"action": "Step 1 (Testing & Verification) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:00.638Z",
"action": "Starting Step 1: Update Board Height CSS. Will change 100vh to 100dvh with fallback pattern."
},
{
"timestamp": "2026-04-01T05:42:10.484Z",
"action": "Step 1 (Testing & Verification) → done"
},
{
"timestamp": "2026-04-01T05:42:10.484Z",
"action": "Step 2 (Documentation & Delivery) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:10.485Z",
"action": "Starting Step 2: Testing & Verification. Running dashboard tests and build."
}
]
}

View File

@@ -1,15 +1,33 @@
{
"id": "KB-655",
"description": "Hide done by default on list view",
"column": "todo",
"column": "in-progress",
"size": "S",
"reviewLevel": 0,
"currentStep": 0,
"currentStep": 2,
"worktree": "/Users/eclipxe/Projects/kb/.worktrees/solar-breeze",
"createdAt": "2026-04-01T02:38:03.605Z",
"updatedAt": "2026-04-01T02:45:21.246Z",
"columnMovedAt": "2026-04-01T02:45:21.246Z",
"updatedAt": "2026-04-01T05:42:52.387Z",
"columnMovedAt": "2026-04-01T05:42:22.877Z",
"dependencies": [],
"steps": [],
"steps": [
{
"name": "Change Default Value",
"status": "pending"
},
{
"name": "Update Tests",
"status": "done"
},
{
"name": "Testing & Verification",
"status": "in-progress"
},
{
"name": "Documentation & Delivery",
"status": "pending"
}
],
"log": [
{
"timestamp": "2026-04-01T02:38:03.605Z",
@@ -23,6 +41,30 @@
"timestamp": "2026-04-01T02:45:20.252Z",
"action": "Spec review: APPROVE",
"outcome": "The specification is clear, appropriately scoped, and correctly identifies the files and behavior to change. The task is a simple default value change from `false` to `true` for the `hideDoneTasks` state, with clear test requirements. The review level of 0 (None) and size S are appropriate for this low-risk, reversible change."
},
{
"timestamp": "2026-04-01T05:42:23.099Z",
"action": "Worktree created at /Users/eclipxe/Projects/kb/.worktrees/solar-breeze"
},
{
"timestamp": "2026-04-01T05:42:23.101Z",
"action": "Step 0 (Change Default Value) → pending"
},
{
"timestamp": "2026-04-01T05:42:26.646Z",
"action": "Step 1 (Update Tests) → in-progress"
},
{
"timestamp": "2026-04-01T05:42:49.885Z",
"action": "Step 1 (Update Tests) → done"
},
{
"timestamp": "2026-04-01T05:42:49.887Z",
"action": "Step 1 complete: Changed default value from false to true in ListView.tsx"
},
{
"timestamp": "2026-04-01T05:42:52.387Z",
"action": "Step 2 (Testing & Verification) → in-progress"
}
]
}

View File

@@ -2,11 +2,13 @@
"id": "KB-656",
"description": "Don't auto expand the quick add view in list view",
"column": "todo",
"status": "queued",
"size": "S",
"reviewLevel": 1,
"currentStep": 0,
"blockedBy": "KB-655",
"createdAt": "2026-04-01T02:38:16.858Z",
"updatedAt": "2026-04-01T02:45:53.690Z",
"updatedAt": "2026-04-01T05:42:23.099Z",
"columnMovedAt": "2026-04-01T02:45:53.690Z",
"dependencies": [],
"steps": [],

View File

@@ -7,7 +7,7 @@
"reviewLevel": 2,
"currentStep": 0,
"createdAt": "2026-04-01T02:38:43.252Z",
"updatedAt": "2026-04-01T05:41:22.986Z",
"updatedAt": "2026-04-01T05:42:23.100Z",
"columnMovedAt": "2026-04-01T02:46:36.886Z",
"dependencies": [
"KB-656"

View File

@@ -6,9 +6,9 @@
"size": "S",
"reviewLevel": 0,
"currentStep": 0,
"blockedBy": "KB-625",
"blockedBy": "KB-654",
"createdAt": "2026-04-01T02:39:26.901Z",
"updatedAt": "2026-04-01T03:01:51.781Z",
"updatedAt": "2026-04-01T05:42:23.101Z",
"columnMovedAt": "2026-04-01T02:46:42.115Z",
"dependencies": [],
"steps": [],

View File

@@ -10,7 +10,7 @@
"modelProvider": "anthropic",
"modelId": "claude-sonnet-4-6",
"createdAt": "2026-04-01T02:40:10.133Z",
"updatedAt": "2026-04-01T05:41:22.997Z",
"updatedAt": "2026-04-01T05:42:23.109Z",
"columnMovedAt": "2026-04-01T02:47:33.715Z",
"dependencies": [
"KB-646"

View File

@@ -6,9 +6,9 @@
"size": "S",
"reviewLevel": 1,
"currentStep": 0,
"blockedBy": "KB-625",
"blockedBy": "KB-654",
"createdAt": "2026-04-01T02:41:53.945Z",
"updatedAt": "2026-04-01T03:01:51.782Z",
"updatedAt": "2026-04-01T05:42:23.114Z",
"columnMovedAt": "2026-04-01T02:47:41.352Z",
"dependencies": [],
"steps": [],