> 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_18/session_01_memory_upgrade_write.md).

# Session 01: Memory Upgrade (Sensitive Reads + Obsidian Write)

**Session ID**: `phase18-session01-memory-upgrade-write` **Status**: Completed **Estimated Tasks**: \~16-22 **Estimated Duration**: 3-4 hours

***

## Objective

Upgrade the Memory tab to v2.3 parity: three-layer memory, manuscript page, conversation history strip, profile memory grid (sensitive read), and the Obsidian vault write through an allow-listed, confined endpoint. Source-code anchors are the V23 memory section and Obsidian bridge references listed below.

***

## Scope

### In Scope (MVP)

* Source components: `HermesMemorySection` V23 `agents.hermes.tsx:4921`, `MemoryThreeLayers` `:4992`, `ManuscriptPage` `:5042`, `CharCountRing` `:5202`, `ConversationHistoryStrip` `:5267`, `ProfileMemoryGrid` `:5321`, `ObsidianBridge` `:5421` *(write; localStorage keys `:5418-5419`)*.
* Target: extend `AIOS/src/components/hermes/hermes-memory-card.tsx` (`:85`).
* **Sensitive reads (loopback + token):** full memory bodies, profile grids (`/__hermes_profiles`, V23 `:1231`), Obsidian vault contents.
* **Obsidian vault write (Write Inventory #16):** through `/__hermes_obsidian` (landed Phase 16 Session 02). Writes *outside* the Hermes home, so it uses a user-configured vault-path allow-list (not a fixed base dir), `confinePath` against the allow-listed root, and a confirm step. Client mutation through `useHermesAdmin`; persist vault config via the localStorage keys ported from v2.3 `:5418-5419`.
* Write affordances disabled with an "admin mode required" hint without the token.

### Out of Scope

* Mnemosyne 3D constellation (Session 02).
* Mission/Documents/Connections surfaces.

***

## Prerequisites

* [ ] Phase 16 complete: `/__hermes_profiles` (token-gated) and `/__hermes_obsidian` (allow-list write) registered with security tests; the profiles query and Obsidian mutation present in the hooks.
* [ ] Phase 17 visual shell available.

***

## Deliverables

1. Upgraded `hermes-memory-card.tsx` with three-layer memory, manuscript, char-count ring, conversation history strip, and profile memory grid.
2. The Obsidian bridge UI wired through `useHermesAdmin` with vault-path allow-list config, confinement, and confirm.
3. Token-gating proof for sensitive reads; mode-matrix coverage and a `hermes-sections.test.tsx` extension.

***

## Success Criteria

* [ ] Full memory bodies, profile grids, and Obsidian contents require the token (sensitive reads).
* [ ] The Obsidian write only targets allow-listed, confined vault paths; `../` traversal is refused; the write is admin-gated and confirmed.
* [ ] Mode matrix renders; typecheck, lint, and tests 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_18/session_01_memory_upgrade_write.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.
