> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase38-session07-dream-engine-product-integration/tasks.md).

# Task Checklist

**Session ID**: `phase38-session07-dream-engine-product-integration` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-30

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Progress Summary

| Metric              | Value   |
| ------------------- | ------- |
| Tasks Completed     | 20 / 20 |
| Estimated Remaining | 0 tasks |
| Blockers            | 0       |

***

## Setup (3 tasks)

* [x] T001 \[S3807] Verify upstream Dream engine, dashboard, setup, and Vite hunks against AI OS Dream targets (`/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/scripts/run-dream.ts`, `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/src/routes/index.tsx`, `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/src/routes/setup.tsx`, `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/vite.config.ts`)
* [x] T002 \[S3807] Characterize current Dream execution, setup, dashboard, and local control-plane guard ownership before editing (`scripts/lib/dream/execution.ts`, `scripts/dashboard-dream-run.ts`, `src/components/setup/setup-modal.tsx`, `src/components/home/dream-hero.tsx`, `vite.config.ts`)
* [x] T003 \[S3807] Create the implementation evidence file for upstream supersession audit, selected-engine behavior, endpoint verification, and runtime proof (`.spec_system/specs/phase38-session07-dream-engine-product-integration/implementation-notes.md`)

***

## Foundation (4 tasks)

* [x] T004 \[S3807] Add Dream engine contract types, readiness states, safe labels, and export wiring (`scripts/lib/dream/contracts.ts`, `scripts/lib/dream/index.ts`)
* [x] T005 \[S3807] Implement AI OS Dream engine config read/write, legacy read compatibility, auto-selection, and safe browser projections with schema-validated input and explicit error mapping (`scripts/lib/dream/engine-config.ts`)
* [x] T006 \[S3807] Add pure Dream engine endpoint helpers for guarded reads and token-gated writes with sanitized responses (`scripts/lib/dream/engine-endpoints.ts`)
* [x] T007 \[S3807] Wire selected-engine resolution into AI OS Dream execution while preserving activation gates, locks, output validation, continuity, timeouts, and no silent fallback to unsupported engines (`scripts/lib/dream/execution.ts`, `scripts/dashboard-dream-run.ts`, `scripts/scheduler-runner.ts`)

***

## Implementation (8 tasks)

* [x] T008 \[S3807] Add `/__dream_engines` and `/__set_dream_engine` middleware using existing loopback, Host-header, token, body-size, and safe JSON patterns (`vite.config.ts`)
* [x] T009 \[S3807] Create the Dream engines client hook with explicit loading, empty, error, offline, save-failure, and public-demo states (`src/lib/use-dream-engines.ts`)
* [x] T010 \[S3807] Extend Dream run controls for selected-engine context with duplicate-trigger prevention while in-flight and endpoint failure recovery copy (`src/lib/use-dream-run.ts`)
* [x] T011 \[S3807] Extend setup config shape, setup defaults, draft persistence, and step titles so Dream engine follows Dream cadence (`src/components/setup/types.ts`, `src/components/setup/config-helpers.ts`, `src/components/setup/constants.ts`)
* [x] T012 \[S3807] Create the setup Dream engine step with ready-engine selection, no-ready recovery, save failure, public-demo parity, and platform-appropriate accessibility labels, focus management, and input support (`src/components/setup/step-dream-engine.tsx`)
* [x] T013 \[S3807] Wire the setup modal to render the Dream engine step and preserve draft continuity on cancel or finish (`src/components/setup/setup-modal.tsx`)
* [x] T014 \[S3807] Create the dashboard Dream engine control with health-aware Connect/Generate states, selected-engine switching, stale and silent-failure recovery copy, and duplicate-trigger prevention while in-flight (`src/components/home/dream-engine-control.tsx`)
* [x] T015 \[S3807] Mount Dream engine and health projections on the home route and Dream hero so generated reviews, no-ready-engine, stale, silent-failure, skipped, and public-demo states render as product-facing copy only (`src/lib/home-transforms.ts`, `src/lib/use-home-data.ts`, `src/routes/index.tsx`, `src/components/home/dream-hero.tsx`)

***

## Testing (5 tasks)

* [x] T016 \[S3807] \[P] Add script tests for engine config, legacy read compatibility, write safety, auto-selection, endpoint helpers, invalid input, token-gated writes, and sanitized error mapping (`scripts/lib/__tests__/dream-engine-config.test.ts`, `scripts/lib/__tests__/dream-engine-endpoints.test.ts`)
* [x] T017 \[S3807] \[P] Add Dream execution tests proving selected-engine config is used by scheduled and dashboard runs and unsupported engines do not silently fall back (`scripts/lib/__tests__/dream-execution.test.ts`, `scripts/lib/__tests__/scheduler-dream-handler.test.ts`)
* [x] T018 \[S3807] \[P] Add setup, hook, and dashboard tests for step order, persistence, save failure, loading, empty, error, offline, health states, generated-review rendering, and public-demo behavior (`src/routes/__tests__/setup-modal.test.tsx`, `src/lib/__tests__/use-dream-engines.test.tsx`, `src/lib/__tests__/use-dream-run.test.tsx`, `src/components/home/__tests__/dream-engine-control.test.tsx`, `src/components/home/__tests__/dream-hero.test.tsx`)
* [x] T019 \[S3807] Run targeted script and UI tests for Dream engine integration and record exact outcomes (`bun run test -- scripts/lib/__tests__/dream-engine-config.test.ts scripts/lib/__tests__/dream-engine-endpoints.test.ts scripts/lib/__tests__/dream-execution.test.ts scripts/lib/__tests__/scheduler-dream-handler.test.ts src/routes/__tests__/setup-modal.test.tsx src/lib/__tests__/use-dream-engines.test.tsx src/lib/__tests__/use-dream-run.test.tsx src/components/home/__tests__/dream-engine-control.test.tsx src/components/home/__tests__/dream-hero.test.tsx`)
* [x] T020 \[S3807] Run required quality gates and validate ASCII/LF requirements for all session artifacts and changed files (`bun run lint`, `bun run typecheck`, `bun run typecheck:scripts`, `.spec_system/specs/phase38-session07-dream-engine-product-integration/`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` to continue the implement -> creview -> validate sequence

***

## Next Steps

Run the `creview` workflow step.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase38-session07-dream-engine-product-integration/tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
