> 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/docs/phase-40-port-closeout.md).

# Phase 40 Port Closeout

Phase 40 ports Claude OS 2.9, 2.10, and 2.10.1 Hermes behavior into AI OS using semantic, code-owned changes rather than wholesale upstream file copies. This ledger records shipped behavior, intentional non-ports, repository metadata decisions, graph seed decisions, and validation evidence for the documentation closeout session.

## Shipped Behavior

Phase 40 shipped the AI OS interpretation of actionable Claude OS 2.9, 2.10, and 2.10.1 Hermes changes. The implementation keeps AI OS as the host application and maps Hermes behavior into existing bridge, hook, parser, and component owners.

### Local API And Bridge Contracts

* Hermes public reads remain local Vite middleware, not public product APIs.
* `/__hermes_models` returns configured defaults, provider catalog groups, MoA mixture summaries, configured provider aliases, catalog provenance, and declared-versus-fallback context metadata.
* `/__hermes_model_intelligence` returns Ministry rows, rankings, bundled metric provenance, bundled pricing snapshot provenance, optional live OpenRouter pricing status, and fallback reasons.
* Sensitive reads still require the same-run token from `/__token`.
* Admin behavior remains local-dev-only, loopback-only, same-run-token gated, `HERMES_DASHBOARD_ADMIN=1` gated, and unavailable in production.

### Chat

* `/__hermes_chat` accepts bounded prompt text, optional session id, optional model/provider/toolsets overrides, and strict `yolo` and `graph` booleans.
* `provider: "moa"` requires a model override.
* Chat streams `chunk`, sanitized `info`, `done`, and controlled `error` events, with heartbeat comments and timeout, idle, and disconnect cleanup.
* The Chat tab includes the model selector, approximate context meter, MoA preset send path, assistant reply copy, elapsed thinking state, compact flow, command menu, and slash actions.
* Compact summarizes the current local chat into visible carryover for a fresh chat. It does not promise exact tokenizer reclamation.

### Commands And MoA Save

* `/__hermes_cmd` runs only allowlisted Hermes commands: `version`, `status`, `insights`, `doctor`, and confirmation-gated `update`.
* Command output is bounded and sanitized before reaching the browser.
* `/__hermes_moa_save` validates a strict MoA preset payload, backs up local Hermes config, merges the preset, sets it as default, and atomically replaces the local config file.
* The browser receives safe MoA save metadata: preset name, default preset, and backup label.

### Ministry And Pantheon

* Pantheon still owns personas, validation, default install, create/update, delete, and mirror sync.
* The Ministry builder sits above persona workflows and reads `/__hermes_model_intelligence`.
* Ministry includes safe provider assets, candidate rankings, recommended lineup reset, click and drag seat assignment, duplicate and max-expert enforcement, analytics provenance, YAML preview, copy fallback, save prompt, and admin-gated MoA save.

### Voice And Hermes Intelligence

* Hermes Intelligence is the portal name; Voice is the speech capability inside that portal.
* `/__start_voice` accepts empty launches and `{}`, rejects browser-supplied provider config, reads `OPENAI_API_KEY` and optional `OPENAI_BASE_URL` from ignored local environment, starts `bun run voice`, and passes the same-run token to the child as `AI_OS_VOICE_TOKEN`.
* The local broker exposes `/api/health` and token-gated `/api/session`.
* Browser code sends `{}` to `/__start_voice` and only `voice` and `mode` to `/api/session`.
* No-reprompt parity is environment-backed broker respawn, not browser provider-key persistence.
* Public demo mode can render the portal surface but does not start live voice or perform writes.

## Intentionally Not Ported

* Browser localStorage provider-key persistence is not ported. AI OS keeps provider credentials environment-only.
* Browser-supplied provider keys, provider base URLs, and provider config bodies are not accepted by `/__start_voice` or `/api/session`.
* The upstream standalone `voice-lab/index.html` demo and `/api/sample` TTS path are not AI OS product surfaces.
* Obsolete upstream `src/components/agent-core-3d.tsx` remains skipped.
* Upstream internal `INTEGRATION.md` merge notes remain skipped.
* Upstream monolithic Hermes route or middleware files are not copied into AI OS. Behavior is mapped into the existing split owners.
* Browser provider-key persistence is not reintroduced as a setup shortcut.
* No hosted writes, public Hermes API, public voice API, or public local-control plane API is documented as shipped.
* Dream engine-selection behavior is not documented as shipped by Phase 40.
* Package rename, new package scripts, and dependency changes are not part of this closeout. The standard `updateprd` release bookkeeping owns the patch version bump.
* Broad graph ignore rules are not copied over committed AI OS graph seed files.

## Package Metadata Decision

No package dependency, script, repository, privacy, or identity metadata change is required for Session 17. The standard `updateprd` workflow still owns the patch version bump after validation.

Current audited state:

* `package.json` keeps `name: "ai-os"`.
* `version` advanced from `0.5.121` to `0.5.122` during Session 18 `updateprd`.
* `private` remains `true`.
* Repository metadata points to the AI OS repository.
* Existing setup, dev, voice, demo, scheduler, Trend Finder, Dream, runtime, lint, typecheck, test, and build scripts remain intact.

Rationale:

* Session 17 is documentation and metadata closeout only.
* No shipped Phase 40 behavior requires a new dependency, script, package name, or package prefix in this session.
* AI OS is the current host application identity. Claude OS names remain only where they are compatibility contracts, such as inherited env names.

## Gitignore Decision

No `.gitignore` change is required for Session 17.

Current audited state:

* Generated graphify output is already ignored by `graphify-out/`.
* Runtime generated data remains ignored, including `src/data/live-data.json`, private data files, logs, cache directories, local env files, test output, and local runtime roots.
* `src/data/graphs/index.json` and `src/data/graphs/ai-os.json` are not ignored.

Rationale:

* Phase 40 did not introduce a new generated graph artifact that needs an ignore rule.
* Copying broad upstream graph ignore rules would conflict with AI OS committed graph seed contracts.
* Existing ignore rules already protect generated/private runtime output.

## Graph Seed Preservation

AI OS intentionally preserves committed graph seed files:

* `src/data/graphs/index.json`
* `src/data/graphs/ai-os.json`

These files provide the bundled AI OS self-graph seed for fresh clones, demo mode, offline fallback, and local Knowledge Graph route resilience. They use workspace-relative source references and browser-safe metadata.

Generated graphify output remains separate:

* Local graphify execution writes generated output to `graphify-out/`, which is gitignored.
* Accepted local graph artifacts may be registered through the local admin bridge under `src/data/graphs/`, but the bundled seed remains a committed fallback contract.

Preserving the seed avoids a fresh-clone blank Knowledge Graph route and keeps public/demo behavior deterministic.

## Validation Evidence

Session 17 source-truth checks before documentation edits:

* Analyzer resolved current session to `phase40-session17-docs-metadata-and-gitignore-closeout`.
* Phase 40 tracker showed Sessions 01-16 complete, Session 17 not started, and Session 18 not started.
* Session 16 implementation notes queued the voice documentation boundaries.
* Admin bridge source confirmed `/__hermes_chat`, `/__hermes_cmd`, and `/__hermes_moa_save` route names, gates, payloads, and safe errors.
* Dev bridge source confirmed `/__hermes_models` and `/__hermes_model_intelligence` route names, provenance, and fallback contracts.
* Voice launch bridge and broker source confirmed empty launch acceptance, browser provider-config rejection, environment-backed provider config, and same-run token use.
* Package, `.gitignore`, and graph seed audits confirmed no metadata diff is required.

Final phrase, privacy, formatting, ASCII, and line-ending scans are recorded in the Session 17 implementation notes after the testing tasks run.

## Follow-Up Boundary

Session 18 owns full validation and handoff after this documentation closeout. It should not rediscover the Phase 40 docs and metadata decisions above as unfinished implementation work.


---

# 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/docs/phase-40-port-closeout.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.
