> 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/phase33-session01-capture-local-demo-runs/spec.md).

# Session Specification

**Session ID**: `phase33-session01-capture-local-demo-runs` **Phase**: 33 - Cloudflare Pages Real Product Fixtures **Status**: Not Started **Created**: 2026-06-25

***

## 1. Session Overview

This session produces and reviews the local Trend Finder and Dream Review data candidate that later sessions will freeze into public Cloudflare Pages demo fixtures. It stays on the private local side of the boundary: local scheduler jobs, aggregate refresh, generated `src/data/live-data.json`, and local-only review notes are in scope; committed public fixture writes are not.

It is next because Phase 33 has no completed sessions and every later Phase 33 session depends on a reviewed capture candidate. The current generated data is a viable baseline to inspect: `src/data/live-data.json` is generated at `2026-06-24T21:00:31.667Z`, contains a populated Trend Finder branch with 8 topics and 201 evidence items, and contains a Dream branch with 4 prescriptions. The current committed public snapshot proves the gap by omitting Dream and key Trend Finder run artifacts.

The output of this session is capture evidence, not public demo data. A later session will run `bun run demo:snapshot` and commit deterministic public fixtures after projection policy is verified.

***

## 2. Objectives

1. Run or verify the local Trend Finder capture path with explicit extension enablement and no credential disclosure.
2. Run or verify the local Dream Review path with explicit Dream activation and aggregate refresh when Dream writes new output.
3. Inspect `src/data/live-data.json` for populated Trend Finder and Dream branches, including counts, provenance, and sanitized Engine Replay state.
4. Record local-only capture notes that identify the selected capture candidate, manual review status, release blockers, and follow-up inputs for fixture freezing.

***

## 3. Prerequisites

### Required Sessions

* [x] `phase31-session07-release-polish-and-documentation` - Provides the static Cloudflare Pages demo boundary and existing fixture/exporter tooling.
* [x] `phase32-session05-gameplay-test-coverage` - Completes the AI Rogue mobile fix phase so Phase 33 can proceed.

### Required Tools Or Knowledge

* Bun 1.3.14 and existing package scripts in `package.json`.
* Local Trend Finder scheduler commands documented in `docs/runbooks/trend-finder-collector-logging.md`.
* Local Dream scheduler commands documented in `docs/runbooks/ai-os-dream.md`.
* Generated-data shape from `src/data/live-data.json`, `src/extensions/trend-finder/schema.ts`, and `src/lib/home-transforms.ts`.

### Environment Requirements

* Local `.env.local` or shell environment supplies any private source/runtime credentials required for the selected Trend Finder and Dream runs.
* No credential values, account-auth files, scheduler logs, private diagnostics, local paths, or generated private Dream output are committed.
* `src/data/live-data.json` remains local generated input and is not treated as the committed public fixture.

***

## 4. Scope

### In Scope (MVP)

* Operator can refresh or verify Trend Finder local generated data - use `VITE_CLAUDE_OS_ENABLED_EXTENSIONS=trend-finder bun run scheduler:trend-finder:run` or a deliberate full `bun run aggregate` when the complete writer is needed.
* Operator can refresh or verify Dream Review local generated data - use `AI_OS_DREAM_ENABLED=true bun run scheduler:dream:run`, or `bun run scripts/dashboard-dream-run.ts` when Dream should be followed by aggregate refresh.
* Operator can inspect generated data safely - record counts, provenance, source commit, capture time, and Engine Replay/Dream readiness without printing private payload bodies.
* Operator can select or reject the local capture candidate - record manual quality and public-safety review results in local-only session notes.

### Out Of Scope (Deferred)

* Committing public fixtures - Reason: Session 02 owns `bun run demo:snapshot` writes to `demo-website/public/demo/*`.
* Changing exporter projection policy - Reason: Sessions 03 and 04 own Trend Finder and Dream projection hardening.
* Deploying Cloudflare Pages - Reason: Session 06 owns build, scan, smoke, and deploy verification.
* Printing or documenting credential values - Reason: private runtime material stays outside browser state, logs, docs, and committed artifacts.

***

## 5. Technical Approach

### Architecture

Use the existing scheduler and aggregate boundaries without adding new runtime surfaces. Trend Finder refresh runs through the scoped scheduler job when possible, and Dream runs through the Dream scheduler with explicit activation. After the chosen local runs, inspect the generated `src/data/live-data.json` branch for `extensions.items["trend-finder"].data` and `dream` counts, provenance, and artifact availability.

Session notes are kept under this session directory as local planning evidence. They should summarize counts and review decisions, not copy raw source rows, prompts, provider bodies, private diagnostics, scheduler logs, credentials, or local filesystem paths.

### Design Patterns

* Script-first verification: Existing `package.json` scripts and runbooks are the authoritative local operations entry points.
* Static demo boundary preservation: Public Pages builds consume committed fixtures only and must not run schedulers, collectors, account auth, local bridge reads, or Dream Review.
* Browser-safe projection awareness: Capture review checks the data required by later projection sessions while keeping private local material out of committed files.

***

## 6. Deliverables

### Files To Create

| File                                                                                   | Purpose                                                                                             | Est. Lines |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ---------- |
| `.spec_system/specs/phase33-session01-capture-local-demo-runs/implementation-notes.md` | Local-only capture notes, command outcomes, counts, provenance, manual review status, and blockers. | \~180      |

### Files To Modify

| File                                                                                   | Changes                                                                                                         | Est. Lines |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ---------- |
| `src/data/live-data.json`                                                              | Generated private data refreshed by local scheduler or aggregate commands when needed; must remain uncommitted. | generated  |
| `.spec_system/specs/phase33-session01-capture-local-demo-runs/implementation-notes.md` | Append reviewed capture candidate details and selected/rejected status.                                         | \~180      |

***

## 7. Success Criteria

### Functional Requirements

* [ ] Trend Finder local data contains at least one strong public-evidence topic with creator-angle support.
* [ ] Trend Finder Hidden Gems, Sources, Watchlist, Brief support, and Engine Replay have meaningful local content or explicit blocker notes.
* [ ] Trend Finder `engineTrace.state` is `sanitized` with non-empty decision, source, evidence, runtime, artifact, section, or narration state.
* [ ] Dream Review local data contains multiple useful prescriptions with titles, summaries, next actions, priorities, tags, or safe impact fields when available.
* [ ] Capture notes record generated timestamp, source commit, source set, source-set notes, analysis provenance, source provenance, and high-level counts for both product areas.

### Testing Requirements

* [ ] Focused JSON inspections completed without printing credential values or raw private payload bodies.
* [ ] Scheduler status commands reviewed for Trend Finder and Dream after runs when available.
* [ ] Verification commands confirm `package.json` still keeps public demo fixture generation separate from Pages builds.

### Non-Functional Requirements

* [ ] No credential values, token-shaped strings, local private paths, raw prompts, provider bodies, source dumps, scheduler logs, or private Dream output are copied into committed session artifacts.
* [ ] Cloudflare Pages static-only boundary is unchanged.
* [ ] Release is blocked if sanitized Engine Replay trace data is missing from the selected local capture candidate.

### Quality Gates

* [ ] All files ASCII-encoded.
* [ ] Unix LF line endings.
* [ ] Code follows project conventions.

***

## 8. Implementation Notes

### Working Assumptions

* Phase 33 Session 01 is executable next: analyzer output reports `current_phase` 33, `current_session` null, no completed Phase 33 sessions, and `session_01_capture_local_demo_runs` as the first unfinished candidate. Planning can proceed because later candidate stubs depend on this selected capture output.
* Current generated data is a viable baseline candidate to inspect before deciding whether to rerun: `src/data/live-data.json` reports generated time `2026-06-24T21:00:31.667Z`, Trend Finder has 8 topics, 201 evidence items, 12 sources, 3 watchlist rows, 1 run narrative, 5 industry events, 8 movement analyses, 1 hidden gem, sanitized Engine Replay state, and Dream has 4 prescriptions. This is sufficient to plan concrete verification tasks while still allowing implementation to rerun local capture if review fails.
* Local credentials and source configuration are intentionally not verified during planning: the session can proceed because the current generated data exists and rerun failures can be recorded as capture blockers without weakening the static public-demo boundary.

### Conflict Resolutions

* The Phase 33 PRD records preferred frozen provenance strings that are not currently accepted by Trend Finder schema. Session 01 will record source-run truth from local generated data and leave schema/projection migration to later sessions.
* The current public snapshot shows `dream: null` and omits Trend Finder `engineTrace`, `collectionHealth`, `runNarratives`, `industryEvents`, and `movementAnalyses`, while local generated data contains Dream and several omitted Trend Finder artifacts. This session treats local generated data as the review candidate and treats the committed snapshot as evidence of the later fixture gap, not as the capture source.

### Key Considerations

* Keep `src/data/live-data.json`, scheduler state, Dream output, source diagnostics, and `.env.local` private.
* Do not run `bun run demo:snapshot` as the final fixture write in this session; Session 02 owns fixture freezing.
* Record enough count/provenance detail for Session 02 to know whether the selected local input is acceptable.

### Potential Challenges

* Missing or stale credentials: Record the run as skipped, blocked, degraded, or fallback based on scheduler output, then use the current generated candidate only if manual review still accepts it.
* Engine Replay trace missing after capture: Treat as a release blocker for Phase 33 and do not silently proceed to fixture freezing.
* Dream activation skipped: Use explicit `AI_OS_DREAM_ENABLED=true` for CLI runs or record Dream snapshot unavailability for later public-demo handling.

### Relevant Considerations

* \[P31/P32] **Pages demo stays static-only**: This session must not add hosted runtime behavior, Pages Functions, collectors, analytics, or writes.
* \[P31/P32] **Public-demo release gates stay bundled**: Capture notes should preserve the evidence needed by later build, scan, route-smoke, and privacy checks.
* \[P02] **Extension payloads and labels stay bounded**: Count review should watch payload size and explicit live, fixture, fallback, degraded, blocked, and unavailable states.
* \[P06] **Apify actor outputs remain operator-dependent**: Source collection quality can be degraded or blocked and must be represented explicitly.
* \[P24] **Browser-safe export and triage boundaries**: Do not expose local triage notes, private paths, or raw evidence in review artifacts.

### Behavioral Quality Focus

Checklist active: Yes Top behavioral risks for this session:

* Local commands may skip, degrade, or fall back; notes must distinguish those states from successful capture.
* Generated data may be populated but unsafe; manual review must reject candidate data that leaks private material or lacks sanitized Engine Replay.
* Public-demo boundary can be weakened by accidental fixture writes; fixture generation and deployment remain out of scope.

***

## 9. Testing Strategy

### Unit Tests

* No new unit tests are expected for this capture-only session unless a verification helper is added during implementation.

### Integration Tests

* Use existing scheduler status and generated-data JSON inspections to verify Trend Finder and Dream local run outcomes.

### Runtime Verification

* Run or verify `VITE_CLAUDE_OS_ENABLED_EXTENSIONS=trend-finder bun run scheduler:trend-finder:run`.
* Run or verify `AI_OS_DREAM_ENABLED=true bun run scheduler:dream:run` or `bun run scripts/dashboard-dream-run.ts`.
* Run `bun run aggregate` when needed to refresh `src/data/live-data.json` after selected local outputs are available.

### Edge Cases

* Trend Finder scheduler returns degraded, blocked, fallback, or deterministic fallback states.
* Dream scheduler skips because explicit activation is missing.
* `src/data/live-data.json` exists but has empty Trend Finder or Dream branches.
* Engine Replay trace is missing, unsanitized, or empty.
* Capture notes accidentally include private paths or token-shaped strings.

***

## 10. Dependencies

### Other Sessions

* Depends on: `phase31-session07-release-polish-and-documentation`, `phase32-session05-gameplay-test-coverage`.
* Depended by: `phase33-session02-freeze-public-fixtures`, `phase33-session03-harden-trend-finder-projection`, `phase33-session04-harden-dream-projection`, `phase33-session05-polish-public-demo-ui-states`, `phase33-session06-scan-build-and-deploy`.

***

## Next Steps

Run the `implement` workflow step to begin implementation.


---

# 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/phase33-session01-capture-local-demo-runs/spec.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.
