-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Epic: #87 — Architectural Simplification v0.6.0
Goal
Read-only CLI commands (beat task status, beat task logs, beat task list) should skip full bootstrap() entirely. Direct repository access is sufficient for queries — no event bus, no handlers, no worker pool, no recovery.
Sub-tasks
3a. Direct Database Reads for Query Commands
Change: Create a lightweight createReadOnlyContext() that opens SQLite and creates repositories — no event bus, no handlers, no worker pool, no recovery.
Files:
src/cli/read-only-context.ts— New file. AddcreateReadOnlyContext()function: opens Database, creates TaskRepository, ScheduleRepository, OutputCapture. Returns them directly.src/cli/commands/— Query commands (status, logs, list) usecreateReadOnlyContext(). Onlyrunanddelegateuse fullbootstrap().
3b. Skip Recovery for Short-Lived Commands
Change: Add skipRecovery option to bootstrap(). CLI run command sets this to false (it needs recovery). The MCP server always runs recovery.
File: src/bootstrap.ts — Add skipRecovery?: boolean to bootstrap options. Guard recovery execution.
Files Changed
Modified
src/bootstrap.ts—skipRecoveryoptionsrc/cli/commands/— query commands use read-only context
Added
src/cli/read-only-context.ts— lightweight context for read-only operations
Risk
Low — additive, no existing behavior changes. Query commands just take a faster path.
Verification
npm run build— clean compilationnpx biome check src/ tests/— no lint issues- All test groups pass
beat task status <id>— fast response, no bootstrap overheadbeat task logs <id>— fast response, reads directly from SQLitebeat mcp start— full bootstrap still works as expected