← חזרה לכל השלבים

Orion Studio — Specification (P5, stage: SPEC)

Owner: specification agent. Autonomous stage (P6 — not a creative gate). Upstream:
vision/vision.md, brand/brand.md. Downstream: ARCHITECTURE. Executable (P3): if the
implementation differs from this spec, the implementation is wrong. Scope: v1 only
(Observe tier-1 + Terminal). Every requirement here is testable; acceptance criteria are
measurable; there are zero TBDs.

0 · Scope statement

In (v1): read-only Observe of Orion (runtime) + PRISM (factory) in one cockpit, plus an

embedded VPS terminal, secured by defense-in-depth, reading only existing stores.

Out (v1, trigger-gated fast-follows): approve/reject gates (Review, tier 2), replay

(tier 3), submit PrismTask (Create, tier 4). Out (forever): any file-editing IDE surface

— the terminal is the escape hatch (Vision Lock 1).

1 · Actors & trust

never writes to Orion's stores in v1. Truth = Orion's DB + Directus, surfaced verbatim.

2 · Functional requirements

FR-1 — Observe Orion: runs list

project, status, started-at, duration, total cost, total tokens.

Observe API exposes a stream; no manual reload required.

(not blank, not spinner-forever): no runs yet / orion observe API unreachable.

FR-2 — Observe Orion: trace detail (waterfall)

(trace_id/parent_trace_id hierarchy), each step a tool-call card: agent/step name, status,

duration, cost, token delta, and expandable metadata (JSONB payload).

(classify_failure output: type/subtype/origin/confidence) when present.

FR-3 — Observe PRISM: factory state

(Research→Vision→Brand→Spec→Architecture→Tasks→Implement→Review→Evaluate→Knowledge).

read-only "needs you" indicator. (Acting on them = tier 2, out of v1.)

decisions) read-only, rendered from the repo files.

shadow_logs rows under the prism-studio project — orion-integration-map.md §5).

FR-4 — VPS terminal

the same secured surface as the Studio.

Studio UI itself exposes no file editor and no write to Orion's DB.

FR-5 — Data sources (read-only, no parallel store)

wraps the same functions Sherlock uses). The Studio holds no Orion data store of its own.

(Dependency: §6.)

the repo files. No second source of truth is created.

never computed or inferred locally.

FR-6 — Security (defense in depth)

Caddy auto-TLS.

TLS → passkey → ttyd auth.)

FR-7 — Layout & brand conformance

workspace (trace detail / terminal), per brand.md §3`.

IBM Plex Sans/Mono, instrument motion gated on prefers-reduced-motion).

no functionality lost on a phone-width viewport.

3 · Non-functional requirements

5s on a warm Observe API, with zero terminal commands required (Vision metric).

the Studio (no separate SSH / psql / browser tab).

field; no transformation that changes meaning. Verified by a drift check (§5 AC-Trust).

genuinely required (brand-isolation; automatable check).

reduced-motion honored.

has an explicit calm failure state (FR-1.4 pattern); no infinite spinners, no blank panels.

4 · Data contracts (consumed, read-only)

4.1 Orion Observe API (Orion-owned — P10; PRISM consumes)

Full contract + drift-guard ask: architecture/observe-api-contract.md (grounded in the real

agent_runs/tasks/shadow_logs columns, read from orion-os source). Read-only surface:

agent_name, status, source_channel, cost_usd, started_at, completed_at }`.

parent_trace_id, agent_name, task_type, tool_used, outcome, failure_category, error_message,

duration_seconds, cost_usd, model_used, latency_ms, tokens_in, tokens_out, retry_count,

fallback_used, metadata }, ordered by created_at, tree via parent_trace_id`.

All fields map 1:1 to existing Orion columns — no field is invented by PRISM. (Note: per-step

duration is duration_seconds; tokens are tokens_in+tokens_out.)

4.2 Directus (existing CRM — read-only)

field names are discovered from the live instance at ARCH time; the Studio adds no

collections and writes nothing in v1.

4.3 Repo files (read-only)

5 · Acceptance criteria (measurable — EVALUATE gates on these)

fields; a running run shows the amber live signal. (pass/fail)

status matching the Observe API response byte-for-byte on those fields. (diff = 0)

every displayed field to the API value; 0 discrepancies. Studio holds no Orion store

(verified: no Orion-data persistence layer in the codebase). (pass/fail)

products//; memory browser lists every file under memory/. (pass/fail)*

works in localhost and remote modes. (pass/fail)

the Studio is reachable only via the Tailscale address. (0 ports)

terminal. (401/redirect on 100% of routes)

rest. (≤1)

disables breathe/tick. (pass/fail)

panel shows its calm failure message; no spinner-forever, no blank. (pass/fail, 3 cases)

6 · Dependencies & sequencing (hard)

API** (explicit non-goal); observability today is the Sherlock CLI over shadow_logs. The real

dependency is therefore **"Orion builds the Observe API (Observe tier) per

architecture/observe-api-contract.md"** — Orion-owned (P10), triggered by this product's

existence. Until it ships, the Observe panels run against a fixture/stub shaped to the real

Orion columns; live cutover = config flip OBSERVE_BACKEND=live (no code change — the seam).

PRISM also proposes Orion publish observe_api.v1.schema.json + a drift-guard (mirror

prism_task.v1) so the contract cannot silently rot.

installed on the VPS (ARCH specifies versions/config).

7 · Open technical decisions handed to ARCHITECTURE (autonomous, document reasoning)

(in/beside orion-os vs standalone talking to the Observe API — Vision says both are valid;

ARCH picks v1's home with reasoning).

mechanism for passkeys; ttyd embedding approach; fixture/stub design for D-1.

forward (js-budget-gate, lighthouse/a11y where applicable).