feat: [ENG-2068] Dream executor, CLI command, and daemon wiring#385
feat: [ENG-2068] Dream executor, CLI command, and daemon wiring#385danhdoan merged 2 commits intoproj/dreamingfrom
Conversation
Implements the dream execution orchestrator (8-step flow with NO-OP operation stubs), `brv dream` CLI command with --force/--format flags, and wires dreaming into the daemon task pipeline. - DreamExecutor: lock lifecycle (release on success, rollback on error), dream state updates, curate log scanning for changed files, dream log persistence with processing→completed/error/partial status transitions - CLI: `brv dream` (gated) and `brv dream --force` (skip gates 1-3), text and JSON output with proper skip/completed distinction - schemas.ts: add 'dream' to TaskTypeSchema + optional force field - agent-process.ts: DreamTrigger check + DreamExecutor dispatch - curate-executor.ts: increment dream curation counter after Phase 4 - task-router.ts: forward force field in TaskExecute message
|
Claude finished @RyanNg1403's task in 4m 12s —— View job PR Review: feat: [ENG-2068] Dream executor, CLI command, and daemon wiringTasks
Overall Assessment: 3.5 / 5The implementation is well-structured and follows established codebase patterns. The 8-step flow is clearly documented, the fail-open design is consistent with how That said, there are a few issues worth addressing before merge. Issues FoundHigh Priority
Medium PriorityMagic string
Hardcoded Low PriorityDynamic import of
AbortController signal never passed to operations — Acknowledged in the PR, structurally correct for Phase 1. Add a TestingCoverage is solid for a Phase 1 implementation:
Missing (acceptable for Phase 1):
Positive Notes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91b315664f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Capture findChangedFilesSinceLastDream return value for future ops - Document why computeSummary.errors is always 0 (log-level, not per-op) - Remove `as` type assertion in dream CLI (use ternary narrowing) - Remove `result!` non-null assertion (use nullish fallback) - Static import DreamStateService in curate-executor (was dynamic) - Explicit if/else for lock release/rollback readability - Double-cast test stub for intentionality
|
Claude finished @RyanNg1403's task in 1m 59s —— View job PR Review: feat: [ENG-2068] Dream executor, CLI command, and daemon wiringTasks
Overall Assessment: 4 / 5Good follow-through on the previous round of feedback — most issues were addressed cleanly. The A few issues remain unfixed, one of which is a correctness bug. Issues RemainingHigh Priority
// line 515 — add 'dream'
type: z.enum(['curate', 'curate-folder', 'dream', 'query', 'search']),Processing-log write before
Move both calls inside the Medium PriorityMagic string Hardcoded
Low Priority
// line 124
expect(caught?.message).to.equal('disk full')Missing What Was Fixed vs Previous Review
TestingNo changes to test coverage in this revision. Coverage remains solid for Phase 1 — happy path, error path, lock lifecycle, trigger propagation, first vs. subsequent dream, state preservation. The |
Summary
DreamExecutorclass with 8-step flow (pre-state capture, dream state load, curate log scan, stub operations, post-dream propagation, dream log write, state update, lock release/rollback)brv dreamCLI command with--force,--format,--timeoutflags'dream'toTaskTypeSchema+ optionalforcebooleanagent-process.ts: DreamTrigger check + DreamExecutor dispatch in'dream'casecurate-executor.ts: incrementscurationsSinceDreamcounter after Phase 4 (fail-open)task-router.ts: forwardsforcefield in TaskExecute messageType of change
Scope (select all touched areas)
Linked issues
Root cause (bug fixes only, otherwise write
N/A)N/A
Test plan
test/unit/infra/executor/dream-executor.test.tsbrv dream(gate skip),brv dream --force(success),--format json(both skip and completed), curation counter lifecycleUser-visible changes
brv dream— runs background memory consolidation (gated by time, activity, queue, lock)brv dream --force/brv dream -f— skips time/activity/queue gatesbrv dream --format json— JSON outputbrv curateincrementscurationsSinceDreamin.brv/dream-state.jsonEvidence
Checklist
npm test)npm run lint)npm run typecheck)npm run build)proj/dreamingRisks and mitigations
brv dreameven though Phase 1 makes no LLM calls