> 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_20/session_02_cleanup_parity_signoff.md).

# Session 02: Cleanup, Dead-Code Removal And Full Parity Sign-off

**Session ID**: `phase20-session02-cleanup-parity-signoff` **Status**: Not Started **Estimated Tasks**: \~16-22 **Estimated Duration**: 3-4 hours

***

## Objective

Close the Hermes v2.3 port by removing dead scaffolding, proving that every feature is routed through the aios architecture and safety gates, updating docs, and validating full side-by-side parity with v2.3. Source-code anchors are the full V23 component/endpoint inventory in the Phase 16 PRD and the completed AIOS implementation from Phases 16-20.

***

## Scope

### In Scope (MVP)

* Delete dead v2.3-only scaffolding, temporary porting code, unused demo constants, and unused assets introduced during Phases 16-20.
* Search for and remove/replace direct raw fetches, raw `setInterval` polling, direct filesystem mutation paths, or client writes that bypass `useHermes`/`useHermesAdmin`.
* Confirm every write in the Phase 16 Complete Write Operation Inventory is admin-gated and still has passing security tests: chat send; mission optimize/create/tick/clear; image upload; Pantheon install/ create/edit/delete/validate/GitHub sync; document soft-delete/restore/purge; Obsidian vault write.
* Confirm all sensitive reads are token-gated: full memory bodies, profile grids, Obsidian vault contents.
* Run the whole-port completion checklist from `.spec_system/PRD/phase_16/PRD_phase_16.md`: all features reachable from `/agents/hermes` or the global status pill; all 5 missing read endpoints and 10 missing write endpoints exist and are gated; demo mode renders the entire page without a bridge; no write bypasses `useHermesAdmin`; no sensitive read bypasses the token; side-by-side visual parity is confirmed.
* Update `AIOS/README.md` with the aios Hermes surface and `~/.hermes/` layout parity notes; update `AIOS/docs/CHANGELOG.md` with the port record.
* Run final validation: typecheck, script typecheck, lint, format check, test suite, bundle budget, and manual/Playwright parity checks as available.

### Out of Scope

* New features beyond the source v2.3 Hermes parity inventory.
* Rebranding AI OS back to Claude OS / Hermes.
* Weakening loopback/token/admin gating to match v2.3's looser write model.
* Importing superseded `.png`/`.jpg` assets when aios already has optimized `.webp` versions.

***

## Prerequisites

* [ ] Phase 20 Session 01 complete.
* [ ] Phases 16-19 complete and validated.
* [ ] All open questions from Phase 16 are resolved or recorded with explicit decisions in their owning session notes.

***

## Deliverables

1. A cleaned Hermes code surface with no dead v2.3-only scaffolding and no hook/admin bypasses.
2. Updated README/changelog documentation for the completed aios Hermes port and local `~/.hermes/` layout.
3. A final parity/sign-off record in the session implementation notes and validation artifact.

***

## Success Criteria

* [ ] Every v2.3 Hermes feature in the Phase 16 inventory is reachable from the aios Hermes page or global status pill.
* [ ] All endpoint, hook, write-gate, sensitive-read, demo-mode, and side-by-side visual parity checks pass.
* [ ] No raw fetch/polling/write path bypasses the hook or admin layers.
* [ ] README/changelog updates are accurate and do not overclaim planned work.
* [ ] Typecheck, script typecheck, lint, format check, tests, bundle budget, and manual/Playwright parity validation pass or have documented, actionable residual gaps.


---

# 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_20/session_02_cleanup_parity_signoff.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.
