Commit Graph

725 Commits

Author SHA1 Message Date
Lukas May
437e76ed78 feat(01.1-01): define domain events with typed payloads and tests
- Add ProcessSpawnedEvent, ProcessStoppedEvent, ProcessCrashedEvent
- Add ServerStartedEvent, ServerStoppedEvent
- Add LogEntryEvent for stdout/stderr capture
- Create DomainEventMap union type for type-safe handling
- Add comprehensive tests for emit/on, once, off, multiple handlers
- Verify typed event payloads work correctly
2026-01-30 13:54:40 +01:00
Lukas May
83e6adb0f8 feat(01.1-01): create EventBus port interface and EventEmitter adapter
- Define EventBus interface (PORT) with emit, on, off, once methods
- Define base DomainEvent interface with type, timestamp, payload
- Implement EventEmitterBus class (ADAPTER) using Node.js EventEmitter
- Export createEventBus() factory function for easy instantiation
2026-01-30 13:53:43 +01:00
Lukas May
03d55276a6 chore(01.1-01): install and configure Vitest test framework
- Add vitest as dev dependency
- Create vitest.config.ts with globals, TypeScript support, coverage
- Add npm scripts: test, test:watch, test:coverage
2026-01-30 13:53:00 +01:00
Lukas May
655fc296b6 docs(01.1): update roadmap and state with plan details
- 6 plans in 3 waves documented
- Wave structure: parallel foundation → parallel refactors → integration
- Ready for execution
2026-01-30 13:50:10 +01:00
Lukas May
5c5632dccf docs(01.1): create phase plan
Phase 01.1: Hexagonal Architecture
- 6 plans in 3 waves
- Wave 1: Event bus + tRPC foundation (parallel)
- Wave 2: Process, logging, server module refactors (parallel)
- Wave 3: CLI tRPC integration
- Ready for execution
2026-01-30 13:49:07 +01:00
Lukas May
1da8e4f795 docs(1.1): capture phase context
Phase 1.1: Hexagonal Architecture
- Vision and goals documented
- Essential requirements identified
- Scope boundaries defined
2026-01-30 13:42:53 +01:00
Lukas May
2d021ffa02 docs(01): complete core-infrastructure phase 2026-01-30 13:29:11 +01:00
Lukas May
6f64ec3e8c docs(01-05): complete server mode plan
Tasks completed: 2/2
- HTTP server with health endpoint and PID file
- Graceful shutdown with signal handlers

SUMMARY: .planning/phases/01-core-infrastructure/01-05-SUMMARY.md

Phase 1 (Core Infrastructure) complete.
2026-01-30 13:28:15 +01:00
Lukas May
59b233792a feat(01-05): implement graceful shutdown with signal handlers
- GracefulShutdown class handles SIGTERM, SIGINT, SIGHUP
- 10-second timeout before force exit
- Double SIGINT forces immediate exit
- Shutdown sequence: stop HTTP server, stop processes, cleanup
- Integrates with CoordinationServer and ProcessManager
2026-01-30 13:23:58 +01:00
Lukas May
bec46aa234 feat(01-05): add HTTP server with health endpoint and PID file
- CoordinationServer class using node:http
- GET /health returns status, uptime, processCount
- GET /status returns full server state and process list
- PID file at ~/.cw/server.pid prevents duplicate servers
- CLI --server flag and --port option for server mode
- CW_PORT env var support for custom port
2026-01-30 13:22:35 +01:00
Lukas May
f117227fed docs(01-04): complete logging infrastructure plan
Tasks completed: 2/2
- Create log directory management
- Create per-process log writer

SUMMARY: .planning/phases/01-core-infrastructure/01-04-SUMMARY.md
2026-01-30 13:18:17 +01:00
Lukas May
3e7b9f24bd docs(01-03): complete process management plan
Tasks completed: 2/2
- Create process types and registry
- Create process manager with spawn/stop

SUMMARY: .planning/phases/01-core-infrastructure/01-03-SUMMARY.md
2026-01-30 13:17:03 +01:00
Lukas May
2f3df1d529 feat(01-03): create process manager with spawn/stop
- ProcessManager class with execa for child process spawning
- spawn() starts detached background processes
- stop() graceful shutdown with SIGTERM then SIGKILL after 5s timeout
- stopAll() terminates all managed processes
- restart() stops and respawns with same config
- isRunning() probes actual process state
- Proper promise handling for killed processes
2026-01-30 13:15:31 +01:00
Lukas May
57a4d938fa docs(01-02): complete CLI entry point plan
Tasks completed: 2/2
- Create CLI with commander
- Enable global installation via npm link

SUMMARY: .planning/phases/01-core-infrastructure/01-02-SUMMARY.md
2026-01-30 13:14:28 +01:00
Lukas May
fc410e212a feat(01-04): create per-process log writer
- ProcessLogWriter class for stdout/stderr capture
- Timestamps each line with [YYYY-MM-DD HH:mm:ss.SSS] format
- Backpressure handling via drain events
- getStdoutStream/getStderrStream for direct piping
- Module index exports types, classes, and createLogger helper
- createLogger convenience function for default config
2026-01-30 13:13:37 +01:00
Lukas May
40a66175a2 feat(01-03): create process types and registry
- ProcessInfo interface for tracking process metadata
- SpawnOptions interface for spawn configuration
- ProcessRegistry class with Map-based storage
- CRUD operations: register, unregister, get, getAll, getByPid, clear
- Additional helpers: updateStatus, size getter
2026-01-30 13:13:06 +01:00
Lukas May
e64e243407 feat(01-04): create log directory management
- LogLevel, LogEntry, LogConfig types in types.ts
- LogManager class with directory management
- Cross-platform paths using node:os and node:path
- ensureLogDir/ensureProcessDir for directory creation
- getLogPath returns ~/.cw/logs/{processId}/{stream}.log
- cleanOldLogs removes directories older than N days
- listLogs enumerates all process log directories
2026-01-30 13:12:55 +01:00
Lukas May
bf7ba668b1 feat(01-02): create CLI with commander
- Add createCli() function with commander configuration
- Register placeholder commands: status, agent, task
- Add graceful error handling for uncaught exceptions
- Read version from package.json via index.ts export
2026-01-30 13:12:54 +01:00
Lukas May
5329349878 docs(01-01): complete project foundation plan
Tasks completed: 2/2
- Initialize Node.js project with TypeScript and ESM
- Create source structure and entry point

SUMMARY: .planning/phases/01-core-infrastructure/01-01-SUMMARY.md
2026-01-30 13:11:19 +01:00
Lukas May
d284603694 chore(01-01): initialize TypeScript project with ESM
- Configure package.json with type: module, ESM-compatible setup
- Add dependencies: commander, execa
- Add devDependencies: typescript, tsx, rimraf, @types/node
- Configure tsconfig.json for ES2022/NodeNext
- Add .gitignore with node_modules and dist
- Create src/index.ts and src/bin/cw.ts placeholders
2026-01-30 13:09:43 +01:00
Lukas May
074f79b855 docs(01): create phase 1 plan
Phase 01: Core Infrastructure
- 5 plans in 3 waves
- Wave 1: Project foundation (01-01)
- Wave 2: CLI, process mgmt, logging (01-02, 01-03, 01-04) [parallel]
- Wave 3: Server mode & shutdown (01-05)
- Ready for execution
2026-01-30 13:06:38 +01:00
Lukas May
a315b286fd docs: create roadmap (7 phases, 27 requirements)
Multi-agent workspace for orchestrating Claude Code agents.

Phases:
1. Core Infrastructure: INFRA-01 through INFRA-05
2. Data Layer: TASK-02, TASK-03
3. Git Integration: GIT-01 through GIT-04
4. Agent Lifecycle: AGENT-01 through AGENT-07 (except AGENT-06)
5. Task Dispatch: AGENT-06, TASK-01, TASK-04, TASK-05
6. Coordination: COORD-01, COORD-02
7. File System UI: FSUI-01 through FSUI-04

All v1 requirements mapped to phases.
2026-01-30 12:55:55 +01:00
Lukas May
5ff63c1991 docs: define v1 requirements
27 requirements across 6 categories.
8 requirements deferred to v2.

Core value: Coordinate multiple Claude Code agents without losing track or stepping on each other.
2026-01-30 12:52:06 +01:00
Lukas May
777d1c5043 docs: research multi-agent orchestration ecosystem
Researched stack, features, architecture, and pitfalls for Codewalk District.

Key findings:
- Stack: Commander.js + tRPC + Drizzle/better-sqlite3 + execa
- Architecture: Hexagonal monolith with SQLite task queue
- Critical pitfall: Process tree cleanup, SQLite WAL handling

Ready for roadmap creation.
2026-01-30 12:39:28 +01:00
Lukas May
e98e2a03f1 docs: initialize Codewalk District
Multi-agent workspace for orchestrating Claude Code agents with task breakdown, worktree management, and fsui.

Creates PROJECT.md with requirements and constraints.
2026-01-30 12:31:16 +01:00