Commit Graph

168 Commits

Author SHA1 Message Date
Lukas May
4d42da9496 feat(11-04): add initiative tRPC procedures
- Add requireInitiativeRepository helper function
- Add createInitiative mutation procedure
- Add listInitiatives query with optional status filter
- Add getInitiative query with NOT_FOUND error handling
- Add updateInitiative mutation procedure
2026-01-31 19:11:23 +01:00
Lukas May
75f8887b53 feat(11-03): add mode field to AgentRepository
- Add AgentMode import to agent-repository.ts
- Add mode optional field to CreateAgentData interface
- Update DrizzleAgentRepository.create() to handle mode (default 'execute')
2026-01-31 19:11:12 +01:00
Lukas May
3bf7e2c9cb feat(11-04): add initiative and phase repositories to tRPC context
- Import InitiativeRepository and PhaseRepository types
- Add optional initiativeRepository to TRPCContext interface
- Add optional phaseRepository to TRPCContext interface
- Update CreateContextOptions and createContext function
2026-01-31 19:10:51 +01:00
Lukas May
00990de661 docs(11-01): complete agent mode schema extension plan
Tasks completed: 3/3
- Add AgentMode type and database column
- Create mode-specific output schemas
- Update MockAgentManager for mode support

SUMMARY: .planning/phases/11-architect-agent/11-01-SUMMARY.md
2026-01-31 19:09:37 +01:00
Lukas May
f7edac7a5c fix(11-01): add mode column to test database schema
- Add mode column to agents table in test-helpers CREATE_TABLES_SQL
- Generate drizzle migration for mode column
2026-01-31 19:07:54 +01:00
Lukas May
131a97e1c5 docs(11-02): complete Initiative & Phase Repositories plan
Tasks completed: 3/3
- Add findByStatus to InitiativeRepository
- Add findByNumber and getNextNumber to PhaseRepository
- Verify repository exports

SUMMARY: .planning/phases/11-architect-agent/11-02-SUMMARY.md
2026-01-31 19:06:55 +01:00
Lukas May
0abf02ac14 feat(11-01): update MockAgentManager for mode support
- Add context_complete scenario for discuss mode
- Add breakdown_complete scenario for breakdown mode
- Import Decision and PhaseBreakdown types from schema
- Handle context_complete status with decisions array
- Handle breakdown_complete status with phases array
- Extend AgentStoppedEvent reason type for new completion reasons
2026-01-31 19:06:40 +01:00
Lukas May
3f8d6d5357 feat(11-01): create mode-specific output schemas
- Export questionItemSchema and add QuestionItem type
- Add Decision type for discuss mode (topic/decision/reason)
- Add PhaseBreakdown type for breakdown mode
- Create discussOutputSchema (questions/context_complete/error)
- Create breakdownOutputSchema (questions/breakdown_complete/error)
- Add discussOutputJsonSchema for Claude CLI --json-schema
- Add breakdownOutputJsonSchema for Claude CLI --json-schema
2026-01-31 19:05:27 +01:00
Lukas May
67cfd4d201 feat(11-02): add findByNumber and getNextNumber to PhaseRepository
- Add findByNumber method to lookup phase by initiative and number
- Add getNextNumber method to get next available phase number
- Implement both methods in DrizzlePhaseRepository adapter
- Use drizzle-orm max() and and() for query construction
2026-01-31 19:05:04 +01:00
Lukas May
91e57c66eb feat(11-01): add AgentMode type and database column
- Add AgentMode type: 'execute' | 'discuss' | 'breakdown'
- Add mode column to agents table with 'execute' default
- Update SpawnAgentOptions to accept optional mode
- Update AgentInfo interface to include mode field
- Update ClaudeAgentManager.toAgentInfo to map mode
- Fix MockAgentManager to include mode in spawn
- Fix dispatch manager tests to include mode
2026-01-31 19:03:42 +01:00
Lukas May
768c4d265e feat(11-02): add findByStatus method to InitiativeRepository
- Add findByStatus method to InitiativeRepository port interface
- Implement findByStatus in DrizzleInitiativeRepository adapter
- Filter initiatives by status (active/completed/archived)
2026-01-31 19:03:26 +01:00
Lukas May
1942d98ebb docs(11-01): expand schemas with prompt alignment
- Add Decision and PhaseBreakdown reusable types
- Add complete JSON schemas for Claude CLI --json-schema
- Add comments explaining prompt-schema contract
- Schemas match what prompts tell agent to output
2026-01-31 19:00:34 +01:00
Lukas May
93a939ea99 docs(11-05): add comprehensive agent prompts
- Add prompts.ts module with mode-specific agent prompts
- Discuss prompt includes question categories and output format
- Breakdown prompt includes phase design rules
- Execute prompt for standard worker agents
2026-01-31 18:59:19 +01:00
Lukas May
934373bf68 docs(11): create phase plan
Phase 11: Architect Agent
- 8 plans in 4 waves
- 6 parallel (Wave 1-2), 2 sequential (Wave 3-4)
- Ready for execution
2026-01-31 18:21:39 +01:00
Lukas May
8c93ce24c9 docs(10-04): complete E2E test updates plan
Tasks completed: 2/2
- Verified existing E2E tests use questions array format
- Added multi-question E2E test

Phase 10: Multi-Question Schema complete (4/4 plans)
SUMMARY: .planning/phases/10-multi-question-schema/10-04-SUMMARY.md
2026-01-31 18:09:27 +01:00
Lukas May
cd840929c4 test(10-04): add multi-question E2E test
- Tests agent asking two questions at once
- Verifies both questions present in pending questions
- Validates resume with answers for all questions
- Confirms task completes after batched answer resume
2026-01-31 18:08:30 +01:00
Lukas May
7c02b85974 docs(10-03): complete TestHarness & test updates plan
Tasks completed: 2/2
- Update TestHarness convenience methods
- Update all tests for questions array

SUMMARY: .planning/phases/10-multi-question-schema/10-03-SUMMARY.md
2026-01-31 18:06:30 +01:00
Lukas May
e1827865d9 docs(10-02): complete manager implementation plan
Tasks completed: 2/2
- Update ClaudeAgentManager for batched answers
- Update MockAgentManager for batched answers

SUMMARY: .planning/phases/10-multi-question-schema/10-02-SUMMARY.md
2026-01-31 18:04:28 +01:00
Lukas May
2c41e52029 fix(10-02): update downstream code for batched answers API
- Update resumeAgentInputSchema: prompt → answers (Record<string, string>)
- Update tRPC router to pass answers map
- Update CLI to accept JSON or single answer (fallback to q1 key)
- Update E2E tests for new resume signature
2026-01-31 18:03:00 +01:00
Lukas May
a9e46a2843 feat(10-02): update MockAgentManager for batched answers
- Change resume() signature from (agentId, prompt) to (agentId, answers)
- Accept Record<string, string> mapping question IDs to user answers
- Clear pendingQuestions on resume
- Update mock-manager tests for new signature
2026-01-31 18:02:54 +01:00
Lukas May
d012680dbe feat(10-02): update ClaudeAgentManager for batched answers
- Change resume() signature from (agentId, prompt) to (agentId, answers)
- Accept Record<string, string> mapping question IDs to user answers
- Format answers as structured prompt for Claude CLI
- Update AgentManager interface in types.ts
- Update manager tests for new signature
2026-01-31 18:02:51 +01:00
Lukas May
185a125307 feat(10-03): add setAgentQuestion convenience helper
- Add single-question convenience method to TestHarness
- Wraps question in array for questions scenario
- Keeps setAgentQuestions for multi-question cases
2026-01-31 18:01:45 +01:00
Lukas May
d3bdeda12a docs(10-01): complete multi-question schema plan
Tasks completed: 3/3
- Update agent output schema to questions array
- Update PendingQuestion type to PendingQuestions
- Update AgentWaitingEvent payload

SUMMARY: .planning/phases/10-multi-question-schema/10-01-SUMMARY.md
2026-01-31 17:58:50 +01:00
Lukas May
151a4c99f7 feat(10-01): extend agent schema to multi-question array
- Change status from 'question' to 'questions' (plural)
- Add QuestionItem with id field for answer matching
- Update PendingQuestion to PendingQuestions with questions array
- Update AgentWaitingEvent payload to questions array
- Update ClaudeAgentManager and MockAgentManager adapters
- Update TestHarness and all test files
2026-01-31 17:57:34 +01:00
Lukas May
9dd0e46060 docs(10): create phase plan
Phase 10: Multi-Question Schema
- 4 plans in 3 waves
- Wave 1: Schema & types (01)
- Wave 2: Manager implementations + unit tests (02, 03 parallel)
- Wave 3: E2E tests (04)
- Ready for execution
2026-01-31 17:51:18 +01:00
Lukas May
b3941e5431 docs: create milestone v1.2 Architect & Multi-Question (4 phases)
Phases:
- 10. multi-question-schema: Extend agent output schema to return multiple questions
- 11. architect-agent: Agent modes for concept refinement and phase breakdown
- 12. phase-task-decomposition: Agents break phases into tasks with questions
- 13. real-claude-e2e-tests: Verify flows with actual Claude CLI
2026-01-31 17:47:28 +01:00
Lukas May
aacfe53492 chore: complete v1.1 milestone
- Created MILESTONES.md with v1.0 and v1.1 entries
- Evolved PROJECT.md with validated requirements and current state
- Reorganized ROADMAP.md with collapsed v1.1 milestone
- Created milestone archive: milestones/v1.1-ROADMAP.md
- Updated STATE.md for next milestone planning
2026-01-31 16:31:57 +01:00
Lukas May
c6a4fb3cfe docs(09-01): complete conflict & parallel E2E tests plan
Tasks completed: 2/2
- Conflict hand-back round-trip tests
- Multi-agent parallel completion tests

SUMMARY: .planning/phases/09-extended-scenarios/09-01-SUMMARY.md
2026-01-31 15:46:37 +01:00
Lukas May
cc405c6e2f docs(09-02): complete recovery & resume E2E tests plan
Tasks completed: 2/2
- Create recovery/resume scenario tests
- Create extended agent Q&A scenario tests

SUMMARY: .planning/phases/09-extended-scenarios/09-02-SUMMARY.md
2026-01-31 15:46:17 +01:00
Lukas May
62b13d8e84 test(09-02): add recovery and Q&A E2E scenario tests
- Queue state survives in database (source of truth)
- In-progress task recoverable after agent crash
- Blocked task state persists and can be unblocked
- Merge queue state recoverable
- Question enters waiting state and completes after resume
- Question surfaces as structured PendingQuestion
- Agent resumes with answer and completes successfully
- Waiting agent status transitions correctly through full cycle
2026-01-31 15:44:57 +01:00
Lukas May
6ac9df7619 test(09-01): create multi-agent parallel completion E2E tests
- Multiple agents complete tasks in parallel
- Parallel merges process in correct dependency order
- Parallel dispatch with mixed outcomes (success + crash)
- 3 parallel work tests passing
2026-01-31 15:44:16 +01:00
Lukas May
878f2a28d7 test(09-01): create conflict hand-back round-trip E2E tests
- Full conflict cycle: detect conflict -> agent resolves -> merge succeeds
- Conflict resolution preserves original task context
- Multiple sequential conflicts resolved in order
- 3 conflict round-trip tests passing
2026-01-31 15:43:56 +01:00
Lukas May
e318a92413 docs(08.1-02): complete MockAgentManager schema alignment plan
Tasks completed: 3/3
- Update MockAgentManager to use schema-aligned scenarios
- Update TestHarness setAgentScenario helper
- Update MockAgentManager tests

SUMMARY: .planning/phases/08.1-agent-output-schema/08.1-02-SUMMARY.md
2026-01-31 15:33:12 +01:00
Lukas May
565f9fdae9 test(08.1-02): update tests to use schema-aligned scenarios
- Update MockAgentManager tests to use status-based scenarios
- Change outcome:'crash' to status:'unrecoverable_error' with error field
- Change outcome:'waiting_for_input' to status:'question' with question field
- Change outcome:'success' to status:'done' with result field
- Add tests for structured question data (options, multiSelect)
- Add tests for getPendingQuestion and resume clearing pending question
- Update E2E edge-cases tests with new scenario format
- Update harness tests with new scenario format
2026-01-31 15:31:56 +01:00
Lukas May
8e38bd298b feat(08.1-02): add TestHarness convenience methods for scenarios
- Add setAgentDone() for done status scenarios
- Add setAgentQuestion() for question status scenarios
- Add setAgentError() for unrecoverable_error scenarios
- Add getPendingQuestion() to harness interface
- Import PendingQuestion type from agent/types
2026-01-31 15:29:27 +01:00
Lukas May
ead4614383 feat(08.1-02): update MockAgentManager to schema-aligned scenarios
- Change MockAgentScenario from outcome-based to status-based discriminated union
- Align with agent output schema: done/question/unrecoverable_error
- Update completeAgent() to handle new status types
- Update resume() to use new scenario format
2026-01-31 15:28:38 +01:00
Lukas May
ee0d6eae33 docs(08.1-01): complete agent output schema plan
Tasks completed: 3/3
- Define agent output schema with Zod
- Update ClaudeAgentManager to use schema and handle question flow
- Update AgentWaitingEvent to include structured question data

SUMMARY: .planning/phases/08.1-agent-output-schema/08.1-01-SUMMARY.md
2026-01-31 15:26:47 +01:00
Lukas May
3a3d3f4c08 feat(08.1-01): update AgentWaitingEvent with structured question data
- Add options array for predefined question choices
- Add multiSelect boolean for multi-selection questions
- Update dispatch manager test mock with getPendingQuestion
2026-01-31 15:25:11 +01:00
Lukas May
d9673d54a3 feat(08.1-01): update ClaudeAgentManager to use structured schema
- Pass --json-schema flag to Claude CLI for validated output
- Parse discriminated union (done/question/unrecoverable_error) in handleAgentCompletion
- Add getPendingQuestion method to AgentManager interface
- Add PendingQuestion type for structured question data
- Store pending question in ActiveAgent for later retrieval
- Remove hacky string matching for waiting_for_input detection
- Update MockAgentManager with getPendingQuestion and options support
- Update tests for new CLI arguments and result format
2026-01-31 15:25:07 +01:00
Lukas May
41598f577f feat(08.1-01): define agent output schema with Zod
- Discriminated union with done/question/unrecoverable_error status
- Options schema for structured question choices
- JSON schema export for Claude CLI --json-schema flag
- Type export for runtime validation
2026-01-31 15:21:09 +01:00
Lukas May
3168b30185 docs(08.1, 09): insert agent output schema phase, update phase 9
Phase 8.1: Agent Output Schema (INSERTED)
- 2 plans in 2 waves (sequential)
- Defines discriminated union schema (done/question/error)
- Updates ClaudeAgentManager to use --json-schema flag
- Aligns MockAgentManager with new schema

Phase 9: Extended Scenarios (updated)
- 2 plans in 1 wave (parallel)
- Now depends on Phase 8.1
- Updated scenario format references
2026-01-31 15:19:14 +01:00
Lukas May
05f6f64fbe docs(09): create phase plan
Phase 09: Extended Scenarios
- 2 plans in 1 wave
- 2 parallel, 0 sequential
- Ready for execution
2026-01-31 15:06:47 +01:00
Lukas May
5152f0baa4 docs(09): capture phase context
Phase 9: Extended Scenarios
- Vision and goals documented
- Four core scenarios: conflict hand-back, multi-agent, recovery, question/answer
- CI deferred - focus on test coverage
2026-01-31 09:45:13 +01:00
Lukas May
761c59f3a3 docs(08-01): complete happy path E2E tests plan
Tasks completed: 2/2
- Create E2E happy path test file
- Add complex dependency flow test

SUMMARY: .planning/phases/08-e2e-scenario-tests/08-01-SUMMARY.md
2026-01-31 09:16:06 +01:00
Lukas May
a572a90e7e docs(08-02): complete edge case E2E tests plan
Tasks completed: 3/3
- Create E2E edge case tests (crash, waiting, blocking)
- Add merge conflict scenario tests
- Add test module index export

SUMMARY: .planning/phases/08-e2e-scenario-tests/08-02-SUMMARY.md
2026-01-31 09:15:46 +01:00
Lukas May
fd2f8ec9e3 test(08-01): add complex dependency flow test
- Multi-level dependency graph with COMPLEX_FIXTURE
- Complete 5 tasks sequentially with priority ordering
- Verify fixture dependencies stored in task_dependencies table
- Validate Task 4A depends on both Task 2A and Task 3A
2026-01-31 09:14:11 +01:00
Lukas May
ac0812861d docs(08-02): add E2E test module index
- Documents test module structure
- Lists test files and their purposes
2026-01-31 09:13:59 +01:00
Lukas May
ebeb538e21 test(08-02): add merge conflict scenario tests
- Merge conflict detection with merge:conflicted event
- Conflict appears in queue state as conflicted
- handleConflict creates conflict-resolution task
- Successful merge after separate task without conflict
2026-01-31 09:13:40 +01:00
Lukas May
6952e5e287 test(08-01): create E2E happy path test file
- Single task flow: queue -> dispatch -> complete
- Sequential dependencies: priority ordering, queue state
- Parallel dispatch: multiple agents, different tasks
- Full merge flow: task completion -> merge queue -> process
2026-01-31 09:13:26 +01:00
Lukas May
e0d8fc85c6 test(08-02): create E2E edge case tests for crash, waiting, and blocking
- Agent crash scenario: spawned -> crashed events, status not completed
- Agent waiting for input: waiting event with question, resume flow
- Task blocking: blocked list, event emission, not dispatchable
2026-01-31 09:12:45 +01:00