# Intent Understanding — Terminal / Workspace Orchestration

**Packet:** `terminal-workspace-orchestration` · **Date:** 2026-05-29

---

## Why this packet exists

A first prototype web surface (`app/docs/miadi-agent/tide-live`) renders live `tide` data, but
the operator's lived experience of it is "just one workspace and unknown things" — flat,
undifferentiated, dominated by an `unknown` pile. The structure that *should* organize the
experience (`domain → workspace/project → session → pane`) exists in the runtime and in a
separate **mock** UI, but the live surface does not yet express it. The runtime itself carries
a half-finished rename (`scene → workspace`) that leaks two vocabularies into every layer.

The intent is **not** to explain this model to the operator — they know it. The intent is to
ground, in recognized fields, a set of concrete refinements so the capability **advances**
toward a coherent, efficient, repeatable surface: a clearer model, a redesigned UI that shows
real activity in real structure, and a real package that embeds the runtime intelligence.

## Intended audiences

- **The operator** (William / Guillaume): wants to *experience* many concurrent terminals as a
  legible living space, resume work cleanly, and act safely — without ceremony before it is invited.
- **Engineering** (Mia-class): needs a defensible model, a non-brittle integration boundary, and
  a deprecation path that does not break running state.
- **Stewardship** (Kherix academic rigor; MiaClaw structure/routing): needs the design decisions
  legitimized by fields and traceable in a source ledger.

## Desired outcome

1. **One model, one vocabulary.** `domain → project → workspace → session → pane`, with `scene`
   fully retired (no dual-emitted ids, no alias classes in new code), and a chosen durable
   product name + state-root (`~/.hermes` → a Miadi-owned root).
2. **Live + structured UI.** The real `tide` snapshot rendered through the structured hierarchy
   the spec already defines (the `navigator` mock's Medicine-Wheel + session sidebar + hierarchical
   tree), so the operator sees *where activity is concentrated*, *what changed*, and *what is
   resumable* — and the `unknown` pile becomes a small, actionable "needs classification" affordance,
   not the dominant surface.
3. **A real package.** A `packages/<name>` TypeScript package that is the typed client + transport
   to the Python runtime (the spec's daemon-socket architecture), replacing the hardcoded
   `exec("/home/jgi/anaconda3/bin/tide …")` routes — usable by the Next.js app and other consumers.

## Current reality (2026-05-29)

- Two non-converged web surfaces: a structured **mock** (`navigator/`, fed by `_data.ts`) and a
  flat **live** view (`tide-live/`, fed by `tide context`). Neither is the product.
- Integration is brittle: three API routes each `exec()` a hardcoded absolute `tide` path, single
  host, 10 s timeout, untyped stdout JSON, no streaming, no auth.
- The runtime is functional and well-tested (196 tests; R1/R2/R4/R5/R7 + ECF implemented) but the
  **desktop overlay / real interaction surface is "not started"**, and the web routes diverge from
  the specified Unix-socket transport.
- Naming debt is pervasive and dual-emitted (`scene_id` + `workspace_id`), plus transitional
  codenames (`ironsilk`/`hermes-navigator`/`tide`) and state-root (`~/.hermes`).
- `packages/tide` is a stub (`AGENTS.md` only).

## Structural tension

The desired outcome (one coherent, live, structured, typed surface) and the current reality
(two split surfaces, brittle transport, doubled vocabulary) form the generative tension this
packet holds. The research lanes supply the **fields that resolve each strand** of that tension:

- naming/nesting tension → **HCI activity-workspace model**;
- resume/persistence tension → **terminal-multiplexer inspiration**;
- "unknown pile" / legibility tension → **multi-entity observability**;
- brittle-transport / doubled-vocabulary tension → **integration architecture & API evolution**.

Resolution advances the prototype from "it works but feels wrong" toward "this is the surface,"
without rushing past the parts (overlay, registry, naming) that are not yet stable.

## Decisions this packet must support

1. **Naming + nesting**: the final user-facing terms and their nesting; the `scene→workspace`
   retirement sequence; the durable product name + state-root.
2. **UI convergence**: feed the structured `navigator` surface with live `tide` data; design the
   `unknown` affordance; choose the live-update + "what changed" pattern.
3. **Integration pattern**: pick one of {CLI-exec, daemon+Unix-socket, HTTP/gRPC sidecar} for the
   web↔runtime boundary, with a typed contract.
4. **Package shape**: what `packages/<name>` contains (client + types + thin server adapter) vs.
   what stays in the Python runtime; the package's own name.

## What success makes easier downstream

- The desktop overlay (spec 05, R6a) and the web surface share **one** vocabulary, one data
  contract, and one transport — so building either no longer re-litigates the model.
- New domains/projects/sessions appear correctly classified, so the operator trusts the surface.
- The runtime can be renamed and versioned without breaking the web app, because the package
  isolates the contract.
- Other Miadi surfaces (NCP export, chronicle, Telegram bridge) can consume the same typed client.
