> 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/phases/phase_31/session_03_app_data_and_mutation_boundary.md).

# Session 03: App Data And Mutation Boundary

**Session ID**: `phase31-session03-app-data-and-mutation-boundary` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Make the app read frozen demo data and disable local write or collection behavior in public demo mode.

***

## Scope

### In Scope (MVP)

* Update `useLiveData()` to fetch `/demo/live-data.snapshot.json` in demo mode.
* Avoid `/__live-data` in public demo mode.
* Add public demo operator identity defaults.
* Suppress setup/onboarding auto-open behavior.
* Ensure no `/__just-installed` call happens in public demo mode.
* Update `useTimeSaved()` to use snapshot/default overlays without `/__time-saved-config`.
* Hide, disable, or replace local mutation controls for refresh, Dream jobs, aggregate actions, setup writes, scheduler jobs, source setup writes, Creator Lens writes, Knowledge Graph ingest/remove, and agent admin actions.
* Ensure status pills and unavailable states do not contact loopback-only endpoints.
* Ensure `TrendFinderRunProvider` and the top-bar run button return disabled demo-only state before any `/__token` fetch can happen.

### Out of Scope

* Extension-specific route data polish beyond shared mutation boundaries.
* Pages output generation.
* Release polish and mobile tuning.
* New hosted collection, scraping, scheduler, chat, upload, or admin behavior.

***

## Folded Source Details

Public demo mode host behavior:

* `useLiveData()` reads `/demo/live-data.snapshot.json`.
* Local mutation controls are hidden or replaced with read-only unavailable states.
* Setup/onboarding prompts do not auto-open.
* Operator identity uses public demo copy and assets, not localStorage or `.env.local` values.
* Status pills render demo or unavailable states without loopback-only requests.
* Refresh/run buttons cannot start collectors, Dream jobs, scheduler jobs, source setup writes, Creator Lens writes, Knowledge Graph ingest/remove, local agent writes, chat/uploads, document/admin actions, or setup writes.
* `useTimeSaved()` uses snapshot/default overlays only.
* Browser-local controls are allowed only when they cannot publish, mutate, or read private host state.

Host endpoints to avoid:

* `/__live-data`
* `/__time-saved-config`
* `/__just-installed`
* `/__operator-photo`
* `/__token`
* `/__refresh_data`
* `/__refresh_status`
* `/__run_dream`

Shared route expectations:

* Home renders from frozen snapshot with public operator identity and visible snapshot provenance.
* Usage panel shows frozen plan/window values and hides or disables refresh.
* Skills show curated skill cards and ROI controls as browser-local only.
* Memory shows snapshot graph/constellation data and no private note paths.
* Activity uses demo runs and public-safe output cards only.
* Workspaces use public labels and frozen session summaries only.
* Settings/setup hide setup/credential flows or mark them unavailable.

***

## Prerequisites

* [ ] Session 01 public demo mode helper is available.
* [ ] Session 02 snapshot fixture path exists.
* [ ] Local bridge inventory from the Phase 31 PRD is reviewed.
* [ ] Host routes using `useLiveData()`, `useTimeSaved()`, setup auto-open, and refresh/run controls are identified.

***

## Deliverables

1. App-wide demo data loading path backed by static `/demo/*` assets.
2. Read-only or browser-local UI states for local write paths.
3. Tests or focused assertions for no `/__live-data`, no setup auto-open, no `/__just-installed`, no `/__token`, and no time-saved bridge calls in demo mode.
4. Public demo identity defaults that do not read localStorage or `.env.local` private values.
5. Disabled demo-only state for shared run/refresh controls before token or local bridge fetches can happen.

***

## Success Criteria

* [ ] Home, skills, memory, activity, workspaces, settings/setup, and shared status UI render from snapshot/default state in demo mode.
* [ ] No public demo route triggers host refresh, collector, setup, scheduler, source setup, ingest, remove, chat, upload, or admin-write endpoints.
* [ ] User-facing copy clearly distinguishes unavailable hosted actions from broken controls.
* [ ] Browser-local controls cannot publish, mutate, or read private host state.
* [ ] A focused no-bridge assertion covers the host endpoint set above.


---

# 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/phases/phase_31/session_03_app_data_and_mutation_boundary.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.
