> 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_40/session_01_baseline_and_port_invariants.md).

# Session 01: Baseline And Port Invariants

**Session ID**: `phase40-session01-baseline-and-port-invariants` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Confirm the upstream Claude OS 2.9 through 2.10.1 delta, current AI OS Hermes state, and non-negotiable port boundaries before any implementation changes.

***

## Scope

### In Scope (MVP)

* Re-read the upstream patch, stat, name-status, changelog, and cited Hermes source snippets for 2.9, 2.10, and 2.10.1.
* Capture `git status --short` and focused Hermes test baselines before edits.
* Verify split Hermes route, component, hook, schema, public bridge, and admin bridge ownership.
* Confirm loopback, same-run token, public/demo, admin, chat SSE, graph, media, package identity, and docs naming boundaries.
* Classify upstream changes as direct translation, AI OS adaptation, intentional non-port, or already covered.

### Out of Scope

* Implementing bridge endpoints or UI features.
* Copying upstream route or Vite middleware files into AI OS.
* Changing docs beyond baseline implementation notes.

***

## Prerequisites

* [ ] Phase 40 artifacts exist.
* [ ] Upstream checkout and diff files named in the folded Phase 40 source record are locally available.
* [ ] Phase 39 is complete in state tracking.

***

## Deliverables

1. Baseline audit notes for the implementation summary.
2. Explicit invariant and decision list for later sessions.
3. Initial not-ported and adaptation classification for upstream changes.

***

## Success Criteria

* [ ] Focused Hermes baseline test output is recorded.
* [ ] Public demo and write-gate expectations are documented before endpoints are added.
* [ ] No upstream monolithic route or Vite middleware is copied.
* [ ] Later sessions can cite an explicit invariant or decision.

***

## Folded Source Session Split

The section below preserves the original Phase 40 session split detail for this session, including dependencies, decisions, outputs, and acceptance checks.

### Session 01: Baseline And Port Invariants

**Objective**: Confirm the upstream delta, local AI OS state, and non-negotiable port boundaries before any implementation changes.

**Scope**:

* Re-read the upstream patch, stat, name-status, changelog, and cited upstream Hermes source snippets for 2.9, 2.10, and 2.10.1.
* Capture `git status --short` and focused Hermes test baselines before editing bridge, hook, chat, Ministry, or voice files.
* Verify the current split Hermes architecture, Vite route registration points, public/demo behavior, loopback checks, same-run token checks, and admin gates.
* Confirm response-envelope differences, chat SSE event differences, graph file ownership, media limits, package identity, and docs naming boundaries.
* Classify each upstream change as direct translation, AI OS adaptation, decision required, or intentional non-port candidate.

**Outputs**:

* Baseline audit notes for the first implementation summary.
* A confirmed invariant list that later sessions reference.
* A resolved decision list for stderr `info` events, live pricing, connection probes, voice key persistence, graph ignores, demo data, asset handling, and package metadata.

**Dependencies / Notes**:

* This session runs first.
* Assumption: the upstream checkout and diff files named in this document are available locally when implementation starts.
* Decision: port sanitized stderr as `info` SSE events for observability, but never append those diagnostics as normal assistant reply text.

**Acceptance Checks**:

* Focused Hermes baseline tests have recorded pass/fail output.
* Public demo and write-gate expectations are documented before new endpoints are added.
* No upstream monolithic route or Vite middleware is copied into AI OS.
* Later sessions can point to an explicit invariant or decision.


---

# 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_40/session_01_baseline_and_port_invariants.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.
