> 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/sessions/phase26-session07-hermes-chat-grounding-graph-toolset/tasks.md).

# Task Checklist

**Session ID**: `phase26-session07-hermes-chat-grounding-graph-toolset` **Total Tasks**: 22 **Estimated Duration**: 3-4 hours **Created**: 2026-06-09

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[SNNMM]` = Session reference (NN=phase number, MM=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 6      | 6      | 0         |
| Implementation | 8      | 8      | 0         |
| Testing        | 5      | 5      | 0         |
| **Total**      | **22** | **22** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S2607] Verify Sessions 05 and 06 prerequisites, active project shape, starter-chip event name, and Hermes chat exports (`.spec_system/PRD/phase_26/session_07_hermes_chat_grounding_graph_toolset.md`)
* [x] T002 \[S2607] Inspect upstream Hermes chat, codegraph mount, and chat bridge references for behavior mapping only (`/home/aiwithapex/projects/claudeos/claude-os-v2.4/src/routes/agents.hermes.tsx`)
* [x] T003 \[S2607] Confirm current Hermes admin gate, chat send path, and test seams before extending payload fields (`src/hooks/use-hermes-admin.ts`)

***

## Foundation (6 tasks)

Core structures and base implementations.

* [x] T004 \[S2607] \[P] Add typed Hermes chat grounding and send-option contracts for seed context, visible label/accent, toolsets, and yolo (`src/components/hermes/chat/chat-types.ts`)
* [x] T005 \[S2607] \[P] Create the Knowledge Graph Hermes grounding helper with deterministic seed context, active graph fallback text, safe label/accent projection, and no token/header/direct mutation text (`src/lib/knowledge-graph-hermes-grounding.ts`)
* [x] T006 \[S2607] Define optional grounding props, first-turn tracking state, and prefill listener scaffolding with cleanup on scope exit for all acquired resources (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T007 \[S2607] \[P] Extend the Hermes admin chat view with backward-compatible send options for `toolsets` and `yolo` while preserving duplicate-trigger prevention while in-flight (`src/hooks/use-hermes-admin.ts`)
* [x] T008 \[S2607] \[P] Add bridge-side payload validation scaffolding for optional `toolsets` and strict `yolo` with schema-validated input and explicit error mapping (`scripts/lib/hermes-admin-bridge.ts`)
* [x] T009 \[S2607] Define the Knowledge Graph grounded chat wrapper props and hook composition around active graph, selected session, Hermes reads, and admin status (`src/components/knowledge-graph/knowledge-graph-grounded-chat.tsx`)

***

## Implementation (8 tasks)

Main feature implementation.

* [x] T010 \[S2607] Implement `HermesChatTab` `hermes-chat-prefill` listener to replace the draft prompt, focus the composer, no-op safely outside the browser, and clean up on unmount (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T011 \[S2607] Implement first-turn invisible seed prefix composition with image attachments, displayed-message separation, resumed-thread bypass, and state reset or revalidation on re-entry (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T012 \[S2607] Implement the visible grounding chip for fresh grounded chats with bounded project text, accent styling, accessibility labels, and exhaustive fallback behavior (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T013 \[S2607] Forward chat `toolsets` and `yolo` options from `HermesChatTab` into `admin.chat.sendPrompt` without changing existing Hermes route callers (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T014 \[S2607] Serialize `toolsets` and `yolo` in `useHermesAdmin().chat.sendPrompt` with validated optional fields, duplicate-trigger prevention while in-flight, abort handling, and existing query invalidation (`src/hooks/use-hermes-admin.ts`)
* [x] T015 \[S2607] Append `-t <toolsets>` and `--yolo -s graphify` in `/__hermes_chat` using argv arrays only, after unchanged loopback/token/admin preflight and before spawn (`scripts/lib/hermes-admin-bridge.ts`)
* [x] T016 \[S2607] Implement `KnowledgeGraphGroundedChat` with active-project seed context, selected-session state, `useHermes`, `useHermesAdmin`, explicit loading/empty/error/offline states, and the `kg-chat-anchor` target (`src/components/knowledge-graph/knowledge-graph-grounded-chat.tsx`)
* [x] T017 \[S2607] Mount the grounded chat in the Knowledge Graph page near starter chips and connect prompt without hiding or reordering existing graph read, ingest, and side-rail content (`src/components/knowledge-graph/knowledge-graph-page.tsx`)

***

## Testing (5 tasks)

Verification and quality assurance.

* [x] T018 \[S2607] \[P] Write grounding helper unit tests for seed context, graph path fallback, active project label/accent, graphify guidance, and absence of token/header/direct mutation text (`src/lib/__tests__/knowledge-graph-hermes-grounding.test.ts`)
* [x] T019 \[S2607] \[P] Extend Hermes chat tests for prefill, focus behavior, grounding chip, first-turn seed prefix, displayed-message separation, resumed-thread bypass, and tool option calls (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T020 \[S2607] \[P] Extend Hermes admin hook tests for chat `toolsets`/`yolo` payload serialization, abort behavior, and duplicate-trigger prevention while in-flight (`src/hooks/__tests__/use-hermes-admin.test.tsx`)
* [x] T021 \[S2607] \[P] Extend Hermes admin bridge tests for invalid `toolsets`, strict `yolo`, unchanged preflight failures, argv-only prompt handling, and appended graphify flags (`scripts/lib/__tests__/hermes-admin-bridge.test.ts`)
* [x] T022 \[S2607] Write grounded chat and page composition tests, run focused tests, and validate ASCII encoding for all Session 07 files (`src/components/knowledge-graph/__tests__/knowledge-graph-grounded-chat.test.tsx`)

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] implementation-notes.md updated
* [x] Ready for the validate workflow step

***

## Next Steps

Run the implement workflow step to begin AI-led implementation.


---

# 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/sessions/phase26-session07-hermes-chat-grounding-graph-toolset/tasks.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.
