> 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/phase31-session02-snapshot-exporter-and-fixtures/tasks.md).

# Task Checklist

**Session ID**: `phase31-session02-snapshot-exporter-and-fixtures` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-24

***

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

***

## Setup (3 tasks)

* [x] T001 \[S3102] Verify Session 01 validation evidence, Session 02 stub requirements, and current data inputs before editing (`.spec_system/specs/phase31-session01-demo-mode-foundation/validation.md`, `.spec_system/PRD/phase_31/session_02_snapshot_exporter_and_fixtures.md`, `src/data/live-data.example.json`, `src/data/graphs/index.json`)
* [x] T002 \[S3102] Inventory existing LiveData, Knowledge Graph, Trend Finder static Brief, evidence asset, and source-compliance contracts that the exporter must reuse (`src/lib/validate-live-data.ts`, `src/lib/knowledge-graph-types.ts`, `src/extensions/trend-finder/schema.ts`, `scripts/extensions/trend-finder/static-brief-qa.ts`, `docs/sources/`)
* [x] T003 \[S3102] Create the implementation evidence log for commands, generated fixture decisions, Trend Finder field inclusion notes, and residual risk (`.spec_system/specs/phase31-session02-snapshot-exporter-and-fixtures/implementation-notes.md`)

***

## Foundation (7 tasks)

* [x] T004 \[S3102] Create the demo fixture boundary directories, README, and public-demo fixture policy text without adding a forked React app (`demo-website/README.md`, `demo-website/public/demo/`, `demo-website/public/demo/graphs/`, `demo-website/public/demo/trend-finder-assets/README.md`)
* [x] T005 \[S3102] Add explicit generated-only ignore coverage for Pages output while preserving existing build-output ignores (`.gitignore`)
* [x] T006 \[S3102] Create exporter constants, types, route coverage definitions, input source descriptors, and manifest contracts (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T007 \[S3102] Implement public demo privacy scan rules for local paths, `file://`, loopback/private-LAN URLs, `/__*`, auth terms, token-shaped strings, prompts, transcripts, command output, memory text, and private labels (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T008 \[S3102] Implement allowlist-first LiveData projection with schema-validated input and explicit error mapping plus bounded arrays and deterministic ordering (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T009 \[S3102] Implement Knowledge Graph registry and graph projection with schema-validated input and explicit error mapping (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T010 \[S3102] Implement Trend Finder payload and asset projection using reviewed schema/static-Brief/source-compliance fields with fixture/demo fallbacks for unclear fields (`scripts/lib/pages-demo-snapshot.ts`, `scripts/extensions/trend-finder/static-brief-qa.ts`)

***

## Implementation (6 tasks)

* [x] T011 \[S3102] Implement manifest, metadata, redaction-count, scan-result, and source-commit generation (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T012 \[S3102] Implement atomic fixture writes with idempotency protection, transaction boundaries, and compensation on failure (`scripts/lib/pages-demo-snapshot.ts`)
* [x] T013 \[S3102] Create the local-only snapshot exporter CLI with argument parsing, redacted summaries, stable exit codes, and explicit error mapping (`scripts/demo/export-pages-snapshot.ts`)
* [x] T014 \[S3102] Wire the package script so `bun run demo:snapshot` invokes the local-only exporter and does not affect normal build scripts (`package.json`)
* [x] T015 \[S3102] Generate and commit public-safe fixture outputs after projection and scan success (`demo-website/public/demo/live-data.snapshot.json`, `demo-website/public/demo/snapshot-metadata.json`, `demo-website/public/demo/graphs/index.json`, `demo-website/public/demo/graphs/ai-os.json`, `demo-website/snapshot-manifest.json`)
* [x] T016 \[S3102] Document that Cloudflare Pages builds consume committed fixtures and never run `demo:snapshot`, while `_headers`, `_redirects`, and final Pages output remain Session 05 scope (`demo-website/README.md`)

***

## Testing (4 tasks)

* [x] T017 \[S3102] \[P] Write focused tests for LiveData allowlist projection, graph projection, manifest fields, deterministic output, and no raw `src/data/live-data.json` copying (`scripts/lib/__tests__/pages-demo-snapshot.test.ts`)
* [x] T018 \[S3102] \[P] Write focused tests for privacy scanner rejection of private fields, local paths, bridge URLs, auth labels, prompts, transcripts, command output, token-shaped strings, and failed-write cleanup (`scripts/lib/__tests__/pages-demo-snapshot.test.ts`)
* [x] T019 \[S3102] Run focused exporter tests, script typecheck, and `bun run demo:snapshot`, then repair failures without weakening public-demo privacy contracts (`scripts/lib/__tests__/pages-demo-snapshot.test.ts`, `tsconfig.scripts.json`, `scripts/demo/export-pages-snapshot.ts`)
* [x] T020 \[S3102] Validate ASCII/LF, fixture parseability, fixture privacy scan results, ignored `demo-website/dist/`, and implementation evidence completeness (`demo-website/public/demo/`, `demo-website/snapshot-manifest.json`, `.spec_system/specs/phase31-session02-snapshot-exporter-and-fixtures/implementation-notes.md`)

***

## 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 `implement` to start the implement -> creview -> validate sequence

***

## Next Steps

Run the `implement` 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/phase31-session02-snapshot-exporter-and-fixtures/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.
