> 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_38/session_01_tier_0_parity_fixes.md).

# Session 01: Tier 0 Parity Fixes

**Session ID**: `phase38-session01-tier-0-parity-fixes` **Status**: Complete **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Ship the low-risk correctness and chat-semantics fixes that unblock later Claude OS v2.8.1 port work.

***

## Non-Negotiable Delivery Bar

Every changed behavior must prove the user's intended outcome end to end: real execution, visible result, recovery path, tests, and platform proof. Do not mark this session complete for scaffolding, type-only plumbing, or mocked happy paths that do not exercise the shipped behavior.

***

## Source Items

* 0.1 `PORT`: fix `memory.tsx` hardcoded source count.
* 0.2 `PORT`: add cross-platform `seed:data`.
* 0.3 `PORT`: decouple Hermes chat `graph` from `yolo`.

***

## Scope

### In Scope (MVP)

* Replace the hardcoded Memory source count with the real source-list length for Pinecone-on and Pinecone-off states.
* Add cross-platform `scripts/seed-data.ts` and wire `package.json` to use it.
* Preserve the AI OS seed source `src/data/live-data.example.json`.
* Add independent `graph` and `yolo` payload handling through the Hermes bridge, hook, chat types, and Knowledge Graph caller.
* Preserve graph as a programmatic send option unless a general graph UI toggle is intentionally added.
* Add or extend focused tests for Memory count, seed-data behavior, payload validation, and all graph/yolo argv combinations.

### Out of Scope

* Shared platform helper foundation.
* Windows scheduler support.
* Runtime Host-header hardening.
* Voice broker or Intelligence portal work.

***

## Detailed Port Items

### 0.1 Memory Source Count

Upstream fixed a hardcoded `3` to the real source-list length.

* Upstream source: `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/src/routes/memory.tsx` at patch line 6307.
* Upstream change: use `sources: ALL_SOURCES.length`.
* AI OS target: `/home/aiwithapex/projects/aios/src/routes/memory.tsx:196` currently reads `sources: 3`.
* Local context: `ALL_SOURCES` is computed at `/home/aiwithapex/projects/aios/src/routes/memory.tsx:63` from `hasPinecone ? PINECONE_SOURCES : BASE_SOURCES`.
* Action: replace `sources: 3` with `sources: ALL_SOURCES.length`.
* Risk: trivial, but the visible card must prove both source-list modes.
* DoD: Memory card renders the real count for both Pinecone-on and Pinecone-off states; tests in `src/routes/__tests__/` assert both counts.

### 0.2 Cross-Platform Seed Data

Upstream replaced the Unix `test -f ... || cp ...` one-liner with a TypeScript script so Windows works.

* Upstream source: `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/scripts/seed-data.ts` at patch line 1740.
* Upstream package source: `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/package.json` at patch line 521.
* AI OS targets: `/home/aiwithapex/projects/aios/scripts/seed-data.ts` and `/home/aiwithapex/projects/aios/package.json:50`.
* Current AI OS script: `"seed:data": "test -f src/data/live-data.json || cp src/data/live-data.example.json src/data/live-data.json"`.
* Action: create or adapt a TypeScript seed script that copies `src/data/live-data.example.json` to `src/data/live-data.json` only when the destination is missing.
* Recovery path: if the example file is missing or unreadable, print a clear actionable error and exit nonzero.
* Risk: low, but `seed:data` runs on `dev` and `build` paths, so smoke-test it.
* DoD: `bun run seed:data` creates `src/data/live-data.json` from the example on a clean tree, is a no-op when the file exists, handles missing source clearly, is verified on Windows and macOS/Linux or faithful platform harnesses, and has tests under `scripts/lib/__tests__/` or an equivalent script test owner.

### 0.3 Hermes Graph/Yolo Decoupling

Upstream split the Graphify skill from `--yolo` in `/__hermes_chat` by adding a separate `graph` payload flag. AI OS currently hard-couples them, which blocks graphify without yolo and yolo without graphify.

* Upstream source: `/home/aiwithapex/projects/claudeos/claude-os-v2.8.1/vite.config.ts` at patch line 6506.
* Upstream behavior: `const graph = payload.graph === true;`, `if (yolo) args.push("--yolo");`, and `if (graph) args.push("-s", "graphify");`.
* AI OS bridge target: `/home/aiwithapex/projects/aios/scripts/lib/hermes-admin-bridge.ts:1463` currently builds `...(yolo ? ["--yolo", "-s", "graphify"] : [])`.
* AI OS payload validation targets: `/home/aiwithapex/projects/aios/scripts/lib/hermes-admin-bridge.ts` near `readStrictYolo` around lines 555 and 1433.
* AI OS type/hook targets: `/home/aiwithapex/projects/aios/src/components/hermes/chat/chat-types.ts` `HermesChatSendOptions` and `/home/aiwithapex/projects/aios/src/hooks/use-hermes-admin.ts` `chatPayloadOptions`.
* Knowledge Graph caller target: `/home/aiwithapex/projects/aios/src/lib/knowledge-graph-hermes-grounding.ts:87` currently sends `{ toolsets: "graphify", yolo: true }`.
* Action: add `graph?: boolean` to send options and payload validation, push `--yolo` and `-s graphify` independently, and preserve grounded Knowledge Graph chat by sending `{ toolsets: "graphify", yolo: true, graph: true }`.
* Optional UI target: `/home/aiwithapex/projects/aios/src/components/hermes/chat/chat-composer.tsx`. Add a visible Graph toggle only if product scope wants general Graphify outside grounded Knowledge Graph chat; otherwise keep `graph` programmatic.
* Risk: low-medium because it changes real chat execution semantics.
* DoD: the bridge supports graph off/yolo off, graph on/yolo off, yolo on/graph off, and both. Each combination produces correct `hermes chat` argv against a real or faithful run path and visible streamed answer. If no UI toggle ships, Knowledge Graph chat must exercise `graph:true` and ordinary Hermes chat must exercise `yolo:true, graph:false`. Bad values are rejected with clear errors. Unit tests cover all four argv combinations.

***

## Prerequisites

* [x] Phase 38 PRD and this session stub are available.
* [x] Existing Memory, seed-data, Hermes chat, and Knowledge Graph tests are identified before edits.
* [x] The current `package.json` seed-data call sites are known.

***

## Deliverables

1. Updated Memory source-count behavior in `src/routes/memory.tsx`.
2. New or adapted `scripts/seed-data.ts`.
3. Updated `package.json` `seed:data` script.
4. Independent `graph` and `yolo` handling in the Hermes chat bridge path.
5. Updated chat send types, hook payload options, and Knowledge Graph grounded chat payload.
6. Focused tests proving visible and execution behavior.

***

## Success Criteria

* [x] Memory card renders and tests the real source count for Pinecone-on and Pinecone-off states.
* [x] `bun run seed:data` creates `src/data/live-data.json` from the AI OS example on a clean tree and is a no-op when the file exists.
* [x] Missing seed source recovery path prints a clear error.
* [x] Hermes bridge tests prove graphify and yolo are independently applied in all four boolean combinations.
* [x] Knowledge Graph chat still requests Graphify behavior explicitly.
* [x] No Tier 1, voice, or Intelligence work is accidentally pulled into this session.


---

# 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_38/session_01_tier_0_parity_fixes.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.
