> 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_17/session_03_pantheon_upgrade_write.md).

# Session 03: Pantheon Upgrade (Write: Edit/Delete/Templates/GitHub Sync)

**Session ID**: `phase17-session03-pantheon-upgrade-write` **Status**: Not Started **Estimated Tasks**: \~16-22 **Estimated Duration**: 3-4 hours

***

## Objective

Upgrade the Pantheon tab to v2.3 feature parity: persona templates read, the rich persona catalog/edit UI, and the remaining unported Pantheon write -- GitHub sync. create/edit/delete/install/validate are already wired server-side. This session's source-code anchors are the V23 Pantheon components, templates handler, and sync handler references listed below.

***

## Scope

### In Scope (MVP)

* Source components: `PantheonCatalog` V23 `agents.hermes.tsx:3488`, `PersonaCard` `:3975`, `PersonaEditModal` `:4084` *(write)*, `AddPersonaTile` `:3576` *(write, templates)*, `HermesPantheonGitHubSync` `:4752` *(write, sync)*, `GHSyncStepCard` `:4792`, `GH_SYNC_STEPS` `:4662`, `ModelDropdown` `:4544`, `SyncBadge` `:4492`, `HermesProfileTemplates` `:3414`, `PANTHEON_AVATARS` `:175`.
* Target: extend `AIOS/src/components/hermes/hermes-pantheon.tsx` (`:59`).
* **Already wired** (reuse, do not re-implement): create (`hermes-admin-bridge.ts:851`), install (`:816`), edit/delete (`:908`, DELETE `:878`), validate (`:781`). v2.3 clients: install `agents.hermes.tsx:794`, create `:3615`, edit `:758`, delete `:4161`.
* **Add: templates read** via `/__hermes_pantheon_templates` (V23 `:1734`), through `use-hermes.ts`.
* **Add: GitHub-sync write** (Write Inventory #12, highest-risk net + exec): endpoint `/__hermes_pantheon_sync` (V23 `:1984` GET status + git push) landed in Phase 16 Session 02 with args-array git, no shell interpolation of refs, confirm step, and dedicated security tests; add the client mutation through `useHermesAdmin` and the sync UI (`GHSyncStepCard` / `GH_SYNC_STEPS`).
* Write affordances disabled with an "admin mode required" hint without the token.

### Out of Scope

* Memory/Mission/Documents/Mnemosyne/Connections surfaces.
* Re-implementing the 5 already-wired persona writes.

***

## Prerequisites

* [ ] Phase 16 complete: `/__hermes_pantheon_templates` and `/__hermes_pantheon_sync` registered with security tests; their hook query/mutation present.
* [ ] Open Question 4 (GitHub sync auth: ambient `git`/`gh` creds vs. scoped token) resolved before shipping the sync write.

***

## Deliverables

1. Upgraded `hermes-pantheon.tsx` with the rich catalog, persona edit modal, model dropdown, sync badge, and templates read.
2. GitHub-sync UI wired through `useHermesAdmin` with the confirm step and the step-card progress display.
3. Mode-matrix coverage and an extension of `hermes-sections.test.tsx`.

***

## Success Criteria

* [ ] Pantheon reads templates and renders the rich catalog/edit UI at v2.3 parity.
* [ ] GitHub sync runs git via args-array (no shell interpolation), requires confirmation, is admin-gated, and passes its security tests.
* [ ] The five already-wired persona writes still function unchanged.
* [ ] 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_17/session_03_pantheon_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.
