# Synthesis — Terminal / Workspace Orchestration

**Packet:** `terminal-workspace-orchestration` · **Date:** 2026-05-29
**Method:** Research Diamond — 4 parallel field lanes (HCI, terminal-persistence, observability, integration), gap-analysed and synthesized against the live `ironsilk`/`tide` runtime, the Miadi web surfaces, and `rispecs/tide-runtime`.
**Confidence:** High. The four lanes converge; the only divergence is a naming decision, resolved below. 3 of ~40 sources are training-knowledge-only (non-load-bearing).

---

## 1. The unified model (resolves the muddy vocabulary)

The four lanes agree on a single coherent hierarchy. It keeps every concept that earns its place, retires the duplicate, and — crucially — **dissolves the apparent `workspace` vs `session` tension** by separating the *definition* from the *running instance*:

```
domain            logical identity, detected per terminal ("miadi", "aureon")        [R1]
└─ project        a repository carrying .miadi/tide.yaml; belongs to one domain
   └─ workspace   a NAMED, RESUMABLE LAYOUT SPEC for a {project × profile × branch × issue}
      │           — the reproducible definition. = ABC "activity". Replaces & retires "scene".
      ├─ profile  the parameterization of a workspace (coding | review | incident | research)
      └─ session  a LIVE INSTANCE of a workspace — a named, resumable tmux/continuation unit  [R7]
         └─ pane  one PTY / TerminalContext                                                  [R2]

snapshot          a live, read-only observation of all panes grouped by domain/project       [R2]
                  (rename from "context snapshot"; it is a view, not a persisted entity)
```

**Why this is defensible, not arbitrary:**

- **`workspace` = activity.** Bardram's Activity-Based Computing (CHI 2006; CACM 2019) establishes the *activity* — a suspendable/resumable bundle of resources named by its goal — as the human-scale unit of work, not the application or window. Naming the user-visible container `workspace` maps it 1:1 to that primitive. `Henderson & Card (Rooms, 1986)` adds *why it helps*: people orient by **where** they were working (spatial memory), not by which windows were open.
- **The definition/instance split is corroborated twice.** The persistence lane found that the best tools treat *the workspace as a shareable file/spec* (tmuxinator/sesh/Zellij-KDL) and *the session as a live running instance* of it. The HCI lane independently reserves `session` for "the resumable terminal layer below workspace." Both point at the same shape: **workspace is the score; session is the performance.**
- **The lifecycle already matches.** Laevo (UIST 2014) defines the activity lifecycle `created → active → suspended → archived`. The runtime's `Scene.status` is already `active / snapshot / archived`. Renaming `scene→workspace` therefore needs **no schema change** — only an alias retirement.
- **`profile` names the parameterization, not the layout** — mirroring Arc's `Space` vs `Profile` split. `coding/review/research` are degree-of-interest filters on the same project (Kersten & Murphy, Mylyn, 2006), not different workspaces.
- **Empirical stakes.** Vetter et al. (2016) measured a **~10 s resumption penalty + higher cognitive load** when work is *not* held in dedicated per-task workspaces — recovered after ~3 switches. The muddiness is not cosmetic; it taxes every context switch.

**Decision the synthesis cannot make for you (genuinely yours):** the durable *product/package name* (today `ironsilk`/`hermes-navigator`/`tide` are codenames) and the *state-root* (`~/.hermes` → likely `~/.miadi` or `~/.ironsilk`). Everything else is determined.

---

## 2. Cross-lane convergences (high confidence)

| Finding | Lanes that agree | Anchor |
|---|---|---|
| `workspace` is canonical; `scene` must be retired on a hard date, not coexist | HCI + integration + the code itself | NN/g consistency (Krause 2021); SemVer; PEP 387/702 |
| Hierarchy = `domain → project → workspace(profile) → session → pane`; `snapshot` is a view | HCI + persistence | Bardram ABC; sesh/Zellij "spec vs instance" |
| Transport must be **daemon + Unix socket**, not `exec()` — and spec 05 *already says so* | integration + (the existing UI spec) | UDS ~130 µs vs TCP 334 µs; `05-ui-surface.spec.md` architecture block |
| The "unknown" pile becomes **"Unattached terminals" + a "Detect/assign domain" action** (a triage queue, not a discard pile) | observability + HCI | Grafana signal-vs-noise; Shneiderman overview-first |
| **Resume = orientation before action**: restore layout instantly, defer execution behind consent | persistence + observability + (existing approval queue) | Zellij "Press ENTER to run…"; decision-support inspector |
| Converge the two web pages: feed the structured `navigator` UI with **live** `tide` data | (all, applied to our surfaces) | `_data.ts` interfaces ≈ runtime models |

---

## 3. Recommendations, by decision

### Decision A — Model & naming (resolve the vocabulary)

1. **Adopt the §1 hierarchy as a written vocabulary contract** (`rispecs/vocabulary.md`): every API field, CLI flag, and UI label must use exactly these terms. (HCI engineering implication.)
2. **Retire `scene` on a SemVer schedule** (integration lane): MINOR release keeps `scene` as a documented alias emitting `DeprecationWarning` (PEP 702 `@warnings.deprecated`); the next MAJOR removes it and reserves the name. Today the alias is *dual-emitted* (`Scene.to_dict()` returns both `scene_id` and `workspace_id`) — that is the migration's start state, not its end. Provide `tide migrate scene→workspace`.
3. **Pick one confidence scale.** Canonical is **0–100 int** (`models.py` thresholds 40/50/70/80; `_data.ts` `SIGNAL_CONFIDENCE`). The web `ConfidenceBar` treats `domain_confidence` as a bare number — align it to 0–100 and the existing thresholds, or normalize once at the package boundary. (Observed inconsistency; pick 0–100.)

### Decision B — Web UI (make activity legible)

Converge the two existing surfaces: **the `navigator` mock already implements the structured UI** (Medicine-Wheel domain map, session sidebar, approval cards, hierarchical tree) the spec calls for — it is only fed by hardcoded `_data.ts`. **`tide-live` already has live data.** Join them: render live `tide` data through the `navigator` structure.

Concrete moves (observability + HCI lanes), in impact order:

1. **Drift / "what changed".** Keep `previous` + `current` snapshots in state; flash `▲ new` (3 s), `~ moved` on domain change, fade-out (2 s) on disappearance; persistent "updated Xs ago" chip; amber "Reconnecting…" on poll failure. *Highest-impact single change* against the "static wall" feeling.
2. **"Unknown" → "Unattached terminals" triage queue.** Collapsible `⚠ Unattached (N)`, sorted `captured_at DESC`, labelled by `cwd` basename + last command, with a **"Detect / assign domain"** action that writes back to `domains.yml`. An undetected pane is a call-to-action, not a mystery.
3. **Domains as activity-sorted cards**, each with pane-count + a 5-point activity sparkline, sorted by most-recent member activity (weighted 0.7 recency / 0.3 command-rate to avoid reorder thrash); `is_active` pane gets an accent border.
4. **Confidence as a tiered fill-bar** (low<40 / med / high>75), color + label (never the raw number), tooltip naming the signal that classified it (`EXPLICIT/TMUX_NAME/GIT_REMOTE/PATH_PREFIX/HEURISTIC`).
5. **Inspector as decision-support:** domain chip + confidence + `classified_by`, command timeline (oldest dimmed), relative time, and a **"Force domain"** override (a training signal).
6. **Surface the hierarchy + sessions:** default to the spec's tree (`domain → session → pane`) with a dense-grid toggle (D5); show the session sidebar (D6) fed by `tide session list`; render approval cards (D7) for `tide operator` proposals — the routes (`peek`, `steer`) already exist.

### Decision C — Package & transport (`packages/tide`)

Replace the brittle `exec("/home/jgi/anaconda3/bin/tide … --format json")` in all three API routes with a real package — the spec's own `Unix-socket → daemon` architecture.

- **`@miadi/<name>`** contains: `DaemonClient` (persistent UDS connection, newline-delimited JSON-RPC), generated `types.ts`, a thin Next.js `server-adapter`, and **`schemas/tide-api.schema.json` as the single source of truth** consumed by both TS (`openapi-typescript`/`json-schema-to-ts`) and Python (`jsonschema` validation). CI fails on schema/type drift.
- **Transport ladder:** UDS now (single host, <5 ms, streaming); HTTP/JSON sidecar (FastAPI+OpenAPI) when multi-host is needed — *swap only the transport, no consumer changes*. CLI `execFile` remains the **fallback** when the daemon is down (git plumbing-as-stable-contract philosophy).
- **Kill the hardcoded path:** resolve via `which tide` / `TIDE_BIN`; socket via `TIDE_SOCKET` (default under the chosen state-root).
- The package's typed shape should mirror the `navigator` `_data.ts` interfaces (`Domain`, `Pane`/`TerminalContext`, `Session`+`intent`, `Proposal`, `Workspace{state:'active'|'suspended'|'archived'}`) so the UI consumes it directly.

---

## 4. Implementation-level flags (found while grounding)

- **Confidence 0–1 vs 0–100** mismatch between `tide-live`/observability assumptions and `models.py`/`_data.ts` — resolve at the package boundary (Decision A.3).
- **`NamedSession` lacks `intent`.** The `navigator` mock's `Session.intent` and the runtime's own reflection RQ-02 both want it; add `intent` to `NamedSession` (human-readable "why", rehydrated as the next turn's opening line).
- **Three API routes each hardcode the absolute `tide` path** and `exec` — single point of brittleness, removed by Decision C.

---

## 5. What success makes easier downstream

One vocabulary, one data contract (the schema), one transport (the daemon socket) — so the desktop overlay (spec 05, still "not started"), the web surface, the Telegram bridge, and any NCP export consume the *same* typed client. The operator stops seeing "one workspace and unknown things" and starts seeing **their activities, where work is live, and what changed** — which is the whole point.

> Crosswalk: this packet shares fields by name with the root **Storyweaver** foundations packet
> (HCI/IA, MAS/orchestration, knowledge-organization/provenance). Session/snapshot persistence and
> append-only registries are grounded there; not re-researched here. The Medicine-Wheel domain
> relational graph (R10) is grounded in `rispecs/.../10-domain-relational-graph.spec.md` and the
> Storyweaver `ritual-design-indigenous-research-paradigms/` field.
