> 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/prd/phase_41/session_03_hermes_route_modes_and_hooks.md).

# Session 03: Hermes Route Modes And Hooks

**Session ID**: `phase41-session03-hermes-route-modes-and-hooks` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Rename the ready Hermes live route state to `live-local` and make hook write capability match the bridge contract.

***

## Scope

### In Scope (MVP)

* Update `HermesRouteMode` and `getHermesRouteMode()` in `src/lib/hermes-types.ts`.
* Update `src/hooks/use-hermes.ts` and `src/hooks/use-hermes-admin.ts` so local readiness, automatic tokens, demo/privacy, and failure states align.
* Update route-mode, admin-type, hook, and parser tests tied to ready local behavior.

### Out of Scope

* Hermes shell component names and copy sweep owned by Session 07.
* Mutation-control execution owned by Session 08.

***

## Prerequisites

* [ ] Session 02 bridge status contract is complete.

***

## Deliverables

1. Hermes route and hook contracts centered on `live-local`, `All access`, and `Writes ready` semantics.
2. Hook-level blocked states only for real token, demo/privacy, production, offline, credential, or dependency failures.
3. Focused tests for route modes and hook capability decisions.

***

## Success Criteria

* [ ] Ready local Hermes resolves to `live-local`.
* [ ] `canUseAdmin` is true in normal local dev when automatic token readiness succeeds.
* [ ] Hook tests cover token bootstrap success and token failure.

***

## Folded Handoff Session Details

The following session-specific details were migrated from the former ongoing-projects handoff. They preserve the original objective, scope, outputs, dependencies, notes, and acceptance checks for this session.

#### Session 03: Hermes Route Modes And Hooks

**Objective**: Rename the ready Hermes live route state to `live-local` and make hook write capability match the bridge contract.

**Scope**:

* Rename or replace `HermesRouteMode` and `getHermesRouteMode()` semantics in `src/lib/hermes-types.ts` so ready local mode is `live-local`, not `read-only`.
* Update `src/hooks/use-hermes.ts` so sensitive read readiness, demo fallback, and ready local live mode no longer encode read-only as the default product posture.
* Update `src/hooks/use-hermes-admin.ts` so `canUseAdmin`, mutation preconditions, and error states align with local all-access readiness plus automatic token checks.
* Update Hermes route-mode, admin-type, hook, and parser tests that lock in ready `read-only` or default `adminEnabled: false` behavior.

**Outputs**:

* Hermes route and hook contracts centered on `live-local`, `All access`, and `Writes ready` semantics.
* Hook-level blocked states only for token failure, demo/privacy, production, offline, credential, or real dependency failures.
* Focused test coverage for route modes and hook capability decisions.

**Dependencies / Notes**:

* Depends on Session 02 so hook semantics match server status.
* Out of scope: visual component rename and copy sweep.

**Acceptance Checks**:

* Ready local Hermes resolves to `live-local` and is not treated as read-only by hooks or tests.
* `canUseAdmin` is true in normal local dev when automatic token readiness succeeds.
* Hook tests cover token bootstrap success and token failure without reintroducing manual admin setup.


---

# 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/prd/phase_41/session_03_hermes_route_modes_and_hooks.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.
