> 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_16/session_03_data_layer_demo_fixtures.md).

# Session 03: Data Layer And Demo Fixtures

**Session ID**: `phase16-session03-data-layer-demo-fixtures` **Status**: Complete **Estimated Tasks**: \~16-20 **Estimated Duration**: 3-4 hours

***

## Objective

Extend the client data layer to consume the new endpoints and add demo fixtures for every new domain so demo mode renders the full expanded page with zero bridge. Source-code anchors are the v2.3 inline payload/demo shapes and the AIOS hook/type/demo-data extension points listed below; this also completes the client-hook + typed-payload work for the Phase 16 bridge endpoints.

***

## Scope

### In Scope (MVP)

**Client data layer (queries + mutations):**

* Extend `AIOS/src/hooks/use-hermes.ts` (`:172`) with React Query queries for the new read endpoints (connections, profiles, pantheon\_templates, missions GET, documents GET/file/trash), preserving the `HermesQueryView` shape and the `live` / `offline` / `endpoint-error` / `setup-required` / `demo` modes.
* Extend `AIOS/src/hooks/use-hermes-admin.ts` (`:236`) with mutations for the new write endpoints. The existing mutations at `:272` (validate), `:283` (install), `:294` (create) are the copy-paste templates. **All mutations go through `useHermesAdmin`** -- the only sanctioned write path; it holds the token.

**Typed payload shapes:**

* Port v2.3's payload shapes into `AIOS/src/lib/hermes-types.ts` (read shapes) and `AIOS/src/lib/hermes-admin-types.ts` (write bodies). v2.3 reference types: `LiveIntegration`, `PersonaYaml`, `HermesMemoryData` (inline in the v2.3 route).
* Add validators + tests mirroring `AIOS/src/lib/__tests__/validate-live-data.test.ts`.

**Demo fixtures (full-page demo with no bridge):**

* Extend `AIOS/src/lib/hermes-demo-data.ts` with demo fixtures for every new domain: connections, missions, documents, profiles, templates, chat threads. v2.3 reference fixtures: `DEMO_*` consts at `V23/src/routes/agents.hermes.tsx:259-556`; `HERMES_LOCAL_LOGOS` `:90`; `PANTHEON_AVATARS` `:175`.
* Unit-test each new type guard / transform (mirror the existing `validate-live-data` tests).

### Out of Scope

* UI components and new tabs (Phases 17-20).
* Bridge endpoint handlers (Session 02 -- already landed).
* The Mnemosyne data derivation specifics (Phase 18 Session 02 derives from local memory files).

***

## Prerequisites

* [ ] Session 02 complete (all read/write endpoints registered with security tests passing).
* [ ] `use-hermes.ts`, `use-hermes-admin.ts`, `hermes-types.ts`, `hermes-admin-types.ts`, and `hermes-demo-data.ts` are the extension points.

***

## Deliverables

1. New queries in `use-hermes.ts` and new mutations in `use-hermes-admin.ts` for every new endpoint, preserving `HermesQueryView` and the five modes.
2. Typed read/write payload shapes in `hermes-types.ts` / `hermes-admin-types.ts` with validators and tests.
3. Demo fixtures for connections, missions, documents, profiles, templates, and chat threads so demo mode renders the full page with no bridge.

***

## Success Criteria

* [ ] Every new endpoint has a corresponding hook query/mutation; all writes go through `useHermesAdmin`.
* [ ] v2.3 payload shapes are typed and validated; validator tests pass and mirror `validate-live-data.test.ts`.
* [ ] Demo mode renders the full expanded page (all planned domains) with zero bridge running.
* [ ] Each new type guard/transform has a unit test; typecheck and lint pass.


---

# 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_16/session_03_data_layer_demo_fixtures.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.
