refactor: [ENG-2884] remove legacy LLM-driven brv dream path
Tool-mode subcommands (`brv dream scan / finalize / undo / sessions /
cancel`, shipped in ENG-2858) cover the same workflow deterministically
— daemon enumerates candidates, agent decides via `brv curate`, daemon
archives via `finalize`. No provider required. With tool-mode as the
project default the legacy LLM-driven entry surface is orphaned, so
remove it cleanly.
`brv dream` (no subcommand) is now a thin topic root that prints a
migration hint. `--force`, `--timeout`, `--undo` on the topic root are
gone; users hit `brv dream undo` instead. The `buildUndoDeps` export
stays here since the `undo` subcommand imports it.
Removed
- `src/oclif/commands/dream.ts` LLM-driven `run()` body (was a 200-line
block dispatching dream tasks through the daemon). Topic root keeps
the `buildUndoDeps` helper for the `undo` subcommand.
- `case 'dream'` in `agent-process.ts` — daemon-side LLM dispatch.
- `AgentIdleTimeoutPolicy.onAgentIdle` dream-eligibility branch and
`preDispatchCheck` for `task.type === 'dream'` in `brv-server.ts`.
The auto-dispatch had no provider-config guard, so on tool-mode
projects it would silently try to dispatch and fail — removal closes
that latent issue. Idle agents are now just cleaned up.
- `src/server/infra/executor/dream-executor.ts` + its test.
- `src/server/infra/dream/dream-trigger.ts` + its test.
- `src/server/infra/dream/operations/{consolidate,synthesize,prune}.ts`
+ their tests. Tool-mode subcommands use `src/server/infra/dream/
tool-mode/*` instead.
- `src/server/infra/dream/parse-dream-response.ts` +
`dream-response-schemas.ts` + their tests — no consumer after the
operations files are gone.
- `src/oclif/lib/timeout-deprecation.ts` + its test — only consumer
was the legacy dream command.
Trimmed
- `test/commands/dream.test.ts` rewritten as a 1-case smoke that
asserts the new topic-root behaviour (prints the subcommand listing).
- `test/unit/infra/runtime-signals/sidecar-failure-logging.test.ts`
dropped the `dream operations` describe block (consolidate / prune
sidecar warnings). Other describe blocks (curate-tool, archive
service, manifest, search, commit-6 wiring) keep their coverage.
Kept
- `src/server/infra/dream/dream-undo.ts`, `dream-state-service.ts`,
`dream-lock-service.ts`, `dream-log-store.ts` — LLM-agnostic services
reused by the tool-mode pipeline.
- `src/server/infra/dream/tool-mode/*.ts` — the subcommand pipeline.
- `src/oclif/commands/dream/{scan,finalize,sessions,cancel,undo}.ts`.
Verified
- npm run typecheck: clean
- npm run lint: 0 errors (256 pre-existing warnings)
- npm test: 8337 passing, 16 pending, 0 failing (was 8521 — net -184
from the dead test deletions; matches the deleted file inventory).
Migration
- `brv dream` (no subcommand) now prints "Use a subcommand: brv dream
{scan|finalize|undo|sessions|cancel}" and exits 0.
- `brv dream --force` / `--timeout` / `--undo` removed. Use the
subcommands.
- Background dream is no longer daemon-scheduled; the agent decides
when to run `brv dream scan` (e.g. post-curate burst, on session
start). The v2 model is agent-driven cadence. C
Cuong committed
13d83a6382b34f1d608229431da982cda0558654
Parent: eb3add2