--- phase: 10-multi-question-schema plan: 04 type: execute wave: 3 depends_on: ["10-02", "10-03"] files_modified: - src/test/e2e/edge-cases.test.ts - src/test/e2e/recovery-scenarios.test.ts autonomous: true --- Update E2E tests to use questions array schema and add multi-question E2E scenario. Purpose: Prove multi-question flow works end-to-end through dispatch/coordination. Output: E2E tests pass with new schema, multi-question scenario validated. @~/.claude/get-shit-done/workflows/execute-plan.md @~/.claude/get-shit-done/templates/summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/phases/10-multi-question-schema/10-02-SUMMARY.md @.planning/phases/10-multi-question-schema/10-03-SUMMARY.md @src/test/e2e/edge-cases.test.ts @src/test/e2e/recovery-scenarios.test.ts Task 1: Update existing E2E tests for questions array src/test/e2e/edge-cases.test.ts, src/test/e2e/recovery-scenarios.test.ts Update all E2E tests that use question scenarios: 1. edge-cases.test.ts: - Find all setAgentQuestion calls, update to new signature with id - Update any direct scenario setting to use questions array - Update assertions checking question data 2. recovery-scenarios.test.ts: - Update Q&A flow tests to use questions array format - Update resume calls to pass answers as Record - Update assertions for getPendingQuestions Replace patterns: - `harness.setAgentQuestion(name, question)` → `harness.setAgentQuestion(name, 'q1', question)` - `agentManager.resume(id, answer)` → `agentManager.resume(id, { q1: answer })` npm run test:e2e passes Existing E2E tests pass with questions array schema Task 2: Add multi-question E2E test src/test/e2e/recovery-scenarios.test.ts Add new test in "Agent Q&A extended scenarios" describe block: ```typescript it('should handle agent asking multiple questions at once', async () => { // Setup: agent asks two questions harness.setAgentQuestions('worker', [ { id: 'q1', question: 'Which database?', options: [{ label: 'SQLite' }, { label: 'Postgres' }] }, { id: 'q2', question: 'Include tests?', options: [{ label: 'Yes' }, { label: 'No' }] }, ]); // Dispatch task await harness.dispatchManager.queueTask({ ... }); await harness.dispatchManager.processQueue(); await harness.waitForEvent('agent:waiting'); // Verify both questions present const pending = await harness.getPendingQuestions('worker'); expect(pending?.questions).toHaveLength(2); expect(pending?.questions[0].id).toBe('q1'); expect(pending?.questions[1].id).toBe('q2'); // Resume with answers for both questions harness.setAgentDone('worker'); const agent = await harness.agentManager.getByName('worker'); await harness.agentManager.resume(agent!.id, { q1: 'SQLite', q2: 'Yes', }); // Wait for completion await harness.waitForEvent('agent:stopped'); // Verify task completed const task = await harness.taskRepository.findById(...); expect(task?.status).toBe('completed'); }); ``` npm run test:e2e passes including new multi-question test Multi-question E2E test validates full flow Before declaring plan complete: - [ ] `npm run test` passes (all unit + E2E tests) - [ ] Multi-question scenario test exists and passes - [ ] No references to old single-question format in E2E tests - All tasks completed - All E2E tests updated to questions array format - New multi-question E2E test validates batched answers - All tests pass After completion, create `.planning/phases/10-multi-question-schema/10-04-SUMMARY.md`