diff --git a/.agents/skills/ael/references/loop-commands.md b/.agents/skills/ael/references/loop-commands.md index 133c83a..66e644a 100644 --- a/.agents/skills/ael/references/loop-commands.md +++ b/.agents/skills/ael/references/loop-commands.md @@ -33,7 +33,7 @@ No task (`ael`, "hi", "what can you do"): offer, numbered, 1) build my workflow, ## Studio -Stage commands (`run`, `goal`, `gate`, `verify`, `review-pack`, `deliver`, `node start|activity|complete`) stream into an open Studio; `status --json` reports `studioUrl`. Emit `npx ai-engineering-loop activity heartbeat --run --phase --message ` only during long manual work, never before every stage. Before asking the human, persist the question with `npx ai-engineering-loop interaction question --run --id --message ` so it appears once in Studio. +`ael studio` opens one machine-wide, read-only monitor of every registered project; it reuses a running instance (`~/.ai-engineering-loop/studio.json`). `--background` keeps it running for notifications, `--stop` ends it, `--no-notify`, `--port`, `--no-open`. Studio only reads Run artifacts: it cannot start, edit, cancel or answer anything. Its one write is Freeze of a waiting Goal; `goal freeze` then answers `alreadyFrozen: true`, so continue. `status --json` reports `studioUrl`. Emit `npx ai-engineering-loop activity heartbeat --run --phase --message ` only during long manual work, never before every stage. Before asking the human, persist the question with `npx ai-engineering-loop interaction question --run --id --message ` so Studio shows the Run as waiting and notifies once (`docs local-workflow-studio`). ## Budget diff --git a/.agents/skills/ael/references/loop-goal.md b/.agents/skills/ael/references/loop-goal.md index 16206c5..7eebfdf 100644 --- a/.agents/skills/ael/references/loop-goal.md +++ b/.agents/skills/ael/references/loop-goal.md @@ -13,7 +13,7 @@ - Write `.ai-engineering-loop/drafts/goal.json`, then `npx ai-engineering-loop goal draft --json --run --file --revision `. Show `goal show --run --human` and `impactPreview`. - Write `objective`, AC `statement` and `failureCases` in STE style (`docs goal-contract`): short, active, testable. Fix `readability` warnings before asking for the freeze. - If `goal draft` returns `diagramOptions`, offer the recommended view or freeze; render only the pick (`goal diagram --view `), then ask: freeze, another view, or add AC for `?`/side effects. -- Freeze: show the Goal, ask one host question **Freeze** / **Revise** (`loop-hosts`). Only after Freeze: `goal freeze --json --latest --run --by ""`. `--by` is that person, never `agent`, `ael-agent`, a model id, or empty. Never set `AEL_GOAL_FREEZE_OK`. T0: `quick start`. +- Freeze: show the Goal, ask one host question **Freeze** / **Revise** (`loop-hosts`). Only after Freeze: `goal freeze --json --latest --run --by ""`. `--by` is that person, never `agent`, `ael-agent`, a model id, or empty. Never set `AEL_GOAL_FREEZE_OK`. T0: `quick start`. `alreadyFrozen`: the human froze it in Studio; continue. - Otherwise the freeze writes a DRAFT blast-radius map: `impact show --run `. ASSISTED: the human confirms or edits it (`impact confirm --by [--allow ] [--remove ]`); copy/CSS/comment-only goals: `impact skip --by --reason ` (`docs blast-radius-map`). - Do not edit production code until the Goal gate passes. - After the freeze, work from the frozen contract (`goal show --run `), not the drafting chat; compact the conversation there if the host supports it. diff --git a/.claude/skills/ael/references/loop-commands.md b/.claude/skills/ael/references/loop-commands.md index 133c83a..66e644a 100644 --- a/.claude/skills/ael/references/loop-commands.md +++ b/.claude/skills/ael/references/loop-commands.md @@ -33,7 +33,7 @@ No task (`ael`, "hi", "what can you do"): offer, numbered, 1) build my workflow, ## Studio -Stage commands (`run`, `goal`, `gate`, `verify`, `review-pack`, `deliver`, `node start|activity|complete`) stream into an open Studio; `status --json` reports `studioUrl`. Emit `npx ai-engineering-loop activity heartbeat --run --phase --message ` only during long manual work, never before every stage. Before asking the human, persist the question with `npx ai-engineering-loop interaction question --run --id --message ` so it appears once in Studio. +`ael studio` opens one machine-wide, read-only monitor of every registered project; it reuses a running instance (`~/.ai-engineering-loop/studio.json`). `--background` keeps it running for notifications, `--stop` ends it, `--no-notify`, `--port`, `--no-open`. Studio only reads Run artifacts: it cannot start, edit, cancel or answer anything. Its one write is Freeze of a waiting Goal; `goal freeze` then answers `alreadyFrozen: true`, so continue. `status --json` reports `studioUrl`. Emit `npx ai-engineering-loop activity heartbeat --run --phase --message ` only during long manual work, never before every stage. Before asking the human, persist the question with `npx ai-engineering-loop interaction question --run --id --message ` so Studio shows the Run as waiting and notifies once (`docs local-workflow-studio`). ## Budget diff --git a/.claude/skills/ael/references/loop-goal.md b/.claude/skills/ael/references/loop-goal.md index 16206c5..7eebfdf 100644 --- a/.claude/skills/ael/references/loop-goal.md +++ b/.claude/skills/ael/references/loop-goal.md @@ -13,7 +13,7 @@ - Write `.ai-engineering-loop/drafts/goal.json`, then `npx ai-engineering-loop goal draft --json --run --file --revision `. Show `goal show --run --human` and `impactPreview`. - Write `objective`, AC `statement` and `failureCases` in STE style (`docs goal-contract`): short, active, testable. Fix `readability` warnings before asking for the freeze. - If `goal draft` returns `diagramOptions`, offer the recommended view or freeze; render only the pick (`goal diagram --view `), then ask: freeze, another view, or add AC for `?`/side effects. -- Freeze: show the Goal, ask one host question **Freeze** / **Revise** (`loop-hosts`). Only after Freeze: `goal freeze --json --latest --run --by ""`. `--by` is that person, never `agent`, `ael-agent`, a model id, or empty. Never set `AEL_GOAL_FREEZE_OK`. T0: `quick start`. +- Freeze: show the Goal, ask one host question **Freeze** / **Revise** (`loop-hosts`). Only after Freeze: `goal freeze --json --latest --run --by ""`. `--by` is that person, never `agent`, `ael-agent`, a model id, or empty. Never set `AEL_GOAL_FREEZE_OK`. T0: `quick start`. `alreadyFrozen`: the human froze it in Studio; continue. - Otherwise the freeze writes a DRAFT blast-radius map: `impact show --run `. ASSISTED: the human confirms or edits it (`impact confirm --by [--allow ] [--remove ]`); copy/CSS/comment-only goals: `impact skip --by --reason ` (`docs blast-radius-map`). - Do not edit production code until the Goal gate passes. - After the freeze, work from the frozen contract (`goal show --run `), not the drafting chat; compact the conversation there if the host supports it. diff --git a/.gitattributes b/.gitattributes index 5874452..a8c10f4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,7 @@ tests/fixtures/*.md text eol=lf vendor/egm/** text eol=lf adapters/spec/** text eol=lf +studio/**/*.js text eol=lf +studio/**/*.css text eol=lf +studio/**/*.html text eol=lf +studio/**/*.json text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f538b0..88ff646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,31 @@ All notable changes to this project are documented here. Versions follow [Semant ## Unreleased -_No changes yet._ +- **Fixed:** a Studio Freeze now records the same Run history as `goal freeze`: one `GOAL_FROZEN` lifecycle event (or the goal node's `NODE_COMPLETED` on a workflow Run) with the Studio actor, and the draft impact map, so recap and node evidence show Studio-frozen Runs. A background Studio no longer crashes when the starting terminal drops the IPC channel first. On phones the guest card sits clear of the Details button. +- **Fixed:** Studio on phones (600px and narrower). The kitchen camera frames the active station with its neighbours and pans with the bot instead of shrinking the whole counter; the six stations sit in a scrollable strip under the scene; the guest card is a bottom card that is never clipped; the run header is compact and takes over the "waiting for you" block; the ticket label moves clear of the bot's speech bubble (or hides) and bubbles stay inside the scene; buttons are at least 44px tall. The zoomed station view, on desktop too, is framed from the bot's size so the whole toque is visible. +- **Changed:** Studio chef bot and props. The bot wears a tall pleated chef's toque at every station (laurel on the brim at Order; the Critic swaps it for a dark beret). Its eyes are flat, unlit capsules drawn on the sphere with lid shapes for each mood: focused, serious at the Cook, a narrow suspicious squint at the Critic, worried, annoyed, angry, a blink and ^ ^ on click. The Cook tosses a frying pan (food flips and lands) over a flame that bursts with each toss and lights the scene warmly; reduced motion keeps a steady flame. The Head chef tastes a plated dish at the pass with a spoon and nods, rings the bell on a pass and pushes the plate back toward the Cook on an iterate; the gavel and hammer are gone. The Critic holds the magnifier over the plate, Taste and Order use the spoon, bowl, quill and notepad, Serve carries a tray with a cloche. Domes, bells and lids are no longer inside out, and polished metal reads as metal in both themes. +- **Changed:** Studio kitchen art and bot. The bot is a glossy orange sphere with two tall capsule eyes that carry its moods (blink, squint, angry tilt, wide eyes with a question mark, ^ ^ on click) and small station accessories (chef hat, laurel and quill, monocle and a near-black body for the Critic, gavel, tray with cloche); diners are spheres of the same family. The kitchen gets a warm tiled backsplash, a bracketed back shelf, a hood over the Cook station, pendant lamps over the pass, veined marble, brushed steel and wood grain, warm key, fill and rim lights with per-theme exposure, and larger, clearer props; the bot stands on the counter. Subtle micro-interactions: squash and stretch on hops, eyes follow the pointer, station hover lift, a bell wobble when the Judge passes, diners glancing at the bot, a check on a successful Freeze. Reduced motion keeps only fades. +- **Fixed:** the order sketch opens instantly: the recommended view is prepared while a Run waits for Freeze, the sheet shows a skeleton until a view loads, tabs keep their iframe and load lazily, and `goal/diagram?view=…&rev=` is cacheable while that hash is current. Switching projects in Studio no longer shows the shelves and jars twice: the kitchen is repainted in place instead of stacking a second one. +- **Added:** look before you freeze in Studio. While a draft with a `flow` waits for Freeze, the guest table, the Freeze chip and the project list offer **Look at the order sketch**: a sheet with the State, Storyboard and Lanes diagrams (recommended first), the undecided, hotspot and side-effect counts, and Freeze at the bottom. New read-only `GET /api/projects/:id/runs/:runId/goal/diagram?view=…` serves the diagram in a sandboxed iframe with its own hash-based CSP and writes no file; the Run detail carries `diagramOptions` and `flowCounts`. `freeze_diagram: off` hides it. The diagram page no longer uses inline style attributes. +- **Changed:** the Studio turntable is now an open restaurant kitchen: one counter read left to right with six stations (Order, Cook, Taste, Critic, Head chef, Serve) labelled with their AEL stage, status lamps (green done, pulsing orange now, dim pending, grey skipped), a ticket rail whose orange ticket follows the active station, a dashed "Sent back to the kitchen" path and "Iteration n of m" ticket after a Run goes back, a chef bot that walks between stations, the Devil's Advocate as a dark food critic, and a guest table for you ("Confirm the order?" with Freeze, "Bring it out?" for delivery approval). Wait lines are restaurant-flavoured. The flat ring fallback carries the same text. +- **Added:** Studio diners: a small dining area with animated NPC diners and hover/focus name tags. The named diners (a nod to people who inspired AEL) ship in `studio/diners.json`, generic diners fill the other chairs; override them with `studio.diners` in `~/.ai-engineering-loop/config.json` (max 6, validated, escaped). +- **Changed:** the Studio Saturn ring is now a turntable diorama: six procedural stage rooms on a round plinth (philosopher's study, workshop, lab, a dim Devil's Advocate room, courtroom, shipping dock) that turns the current stage to the front, status plaques and lamps per room, and the room view zooms into the same room instead of opening a separate scene. The bot is redesigned as a small robot with a clearcoat shell, glass visor and mood eyes. Rendering uses ACES tone mapping, soft shadows and a generated studio environment, all with core three.js (no addons, no downloaded models). +AEL Studio rebuilt as a read-only bot monitor with one action, Freeze (`docs/superpowers/specs/2026-11-22-studio-redesign-design.md`). + +- **Breaking:** Studio is machine-wide. `ael studio` shows every project in the registry (`ael projects list`) and their worktree Runs, and reuses a running instance recorded in `~/.ai-engineering-loop/studio.json` (pid, port, URL; never the token). New flags: `--background` (detached, log in `~/.ai-engineering-loop/studio.log`), `--stop`, `--no-notify`; `--port` and `--no-open` stay. The per-project `/.ai-engineering-loop/studio.json` is no longer written. `studio-layouts/` is no longer written either; it stays in the private runtime ignore list for one more release so 2.17 folders do not show as untracked, and is safe to delete. +- **Breaking:** the old control panel is removed: the wiring and recipe editor, layout save, node start/complete/fail/approve/retry, Run create/cancel/duplicate, Goal edit and unfreeze, answering questions and decisions, delivery adapter select, loop-limit changes, and their about 40 endpoints (`/api/bootstrap`, `/api/live`, `/api/validate`, `/api/install`, `/api/layout`, ...). Do these in the agent host or the CLI (`ael run`, `ael run --abandon`, `ael goal draft`, recipe files and `ael recipe`, `ael generate-adapter`); the table is in `core/local-workflow-studio.md`. +- **Added:** the new API: `GET /api/projects`, `GET /api/projects/:id/runs/:runId`, `GET|PUT /api/me` (the Freeze actor, stored as `studioActor` in `~/.ai-engineering-loop/config.json`), `POST /api/projects/:id/runs/:runId/goal/freeze` (requires `expectedHash`), `GET /api/events` (`projects` snapshots), `GET /healthz`. Projects are addressed by opaque ids; the browser never sends a path, and only `.ai-engineering-loop/` inside registry paths and their worktrees is read. +- **Added:** Freeze from the project list or the Run view in both `goalFreeze` modes (`goal.approval: "studio"`). `goal freeze` is now idempotent: freezing the same draft again returns `alreadyFrozen: true` with the original channel and actor, so the host question and Studio can both approve and the first answer wins. +- **Added:** one OS notification per new wait (Goal waiting for Freeze, delivery waiting for approval, agent question) via `osascript` on macOS and `notify-send` on Linux; never repeated, never for routine progress. +- **Added:** the selected Run as the loop ring of the approved design (option C): a card with the ` · · iteration n/m` eyebrow, the six stages as labelled dots on a front-facing circle (done green, in progress orange with a halo), the bot on the ring at the current stage (or the last done stage of a settled Run), and the current activity in the centre (for example "Devil's Advocate" with "3 findings · 1 blocking"). The ring is readable text at every width, including 375 px; there is no separate stage rail. With WebGL the bot is a glossy three.js sphere that glides to the new stage; without WebGL, with reduced motion, or if three.js fails it is a CSS bot. Project list rows show the bot icons (working, waiting with an outline, idle grey), ` · Freeze?` for Freeze waits, and the selected row as a raised card. three.js 0.185.1 (MIT) is vendored in `studio/vendor/`; still no build step and no runtime dependency. +- **Added:** Studio bot moods and rooms. A waiting bot escalates from a calm "?" (under 30 s) to tapping its foot, to annoyed (2 min), to ranting with steam (5 min), with fixed bubble copy per wait kind. Clicking the bot zooms into a stage room (low-poly diorama from primitives) with a glass card, the Freeze button when it applies, Previous/Next (←/→) across projects with an active Run, and Esc to zoom back out. +- **Changed:** the Studio Run view is one screen. The loop ring is a tilted, Saturn-like three.js ring (bands, gaps, drifting dust, pulsing current stage) with DOM stage names projected under each marker and a bigger bot riding it; the flat option C ring is the fallback without WebGL. The eyebrow, title, start time, wait chip and Freeze button float on the stage; findings, PR, receipt, Goal and assumptions moved into a **Details** bottom sheet (`D`, Esc, drag down on touch). Below 900 px the project list is a **Projects** menu. +- **Added:** Studio Goal tabs (Formatted, the default, and Markdown), a product top bar with count chips and a Live/Reconnecting/Offline indicator, and an interactive bot: a button that names what the bot is doing, per-stage animations (Goal writes like a philosopher, Review turns dark as the Devil's Advocate, Maker, Verify, Judge and Deliver have their own props), a hop-and-spin reaction on click or Enter, and a glance toward the mouse. The bot's glow is toned down. Reduced motion keeps still poses. +- **Changed:** the AEL orange brand on warm paper (light) or ink (dark, following the OS), all colours in `studio/tokens.css`, Geist when installed, motion per Emil Kowalski's rules with reduced motion keeping fades. +- **Fixed:** a Goal drafted with `goal draft` showed as "Agent asks you" instead of **Freeze?**, and after a Studio Freeze the Run kept waiting. The draft's freeze question is now shown as the Freeze wait; a Studio Freeze and a repeat `goal freeze` of a frozen draft answer it. A repeat `goal freeze` refuses an agent-like `--by` before recording anything. The list Freeze button sends the hash of the draft it was rendered with, so a changed draft gets 409. +- **Fixed:** a malformed request target (`GET http://[`) crashed Studio before auth; it now gets `400 Bad request`. `--background` no longer writes the session token to `studio.log` (the URL reaches your terminal over IPC, the log is `0600`), and its error output keeps multibyte log history intact. `readInstance` rebuilds the loopback URL from the stored port. Notifications run asynchronously with a timeout and are not repeated for waits already open when Studio restarts. A finished worktree Run shows an idle bot. List Freeze buttons name their target for screen readers. +- **Removed:** `ael studio --json`, which was accepted but did nothing; it is now an unknown flag. +- **Fixed:** the project list and Run meta showed `[object Object]` for Runs whose recorded tier is an object (`{ current, auto, source, ... }`); Studio now shows the current tier, and a T0 Run with such a tier dims Review and Judge. ## 2.17.0 - 2026-11-22 diff --git a/README.md b/README.md index d23059e..d012c3e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It plans, builds, tests its own claims, lets a Devil’s Advocate attack the res [![license](https://img.shields.io/badge/license-MIT-181c19?style=flat-square)](LICENSE) [![website](https://img.shields.io/badge/site-ael.egagofur.studio-fc6404?style=flat-square)](https://ael.egagofur.studio) -**[Watch a Run play out →](https://ael.egagofur.studio)** · [Get started](#get-started-in-a-minute) · [How a Run works](#how-a-run-works) · [Workflow Studio](#meet-workflow-studio) · [Docs](core/) +**[Watch a Run play out →](https://ael.egagofur.studio)** · [Get started](#get-started-in-a-minute) · [How a Run works](#how-a-run-works) · [AEL Studio](#meet-ael-studio) · [Docs](core/) @@ -44,13 +44,13 @@ Then start a new agent session and tell it: That is the intended experience. You do not need to memorize the internal commands—the agent can operate the loop for you. -Want the visual workspace? +Want to watch the bots? ```bash npx ai-engineering-loop studio ``` -Workflow Studio opens locally in your browser and follows the active Run live. Your project and run evidence stay on your machine. +AEL Studio opens locally in your browser and shows every registered project's Run. Your project and run evidence stay on your machine. On first setup, `.ai-engineering-loop/` is added to your project’s `.gitignore` so plans and Run evidence stay private by default. Want to share that context with your team? Simply remove that line from `.gitignore`. @@ -79,38 +79,17 @@ The experience is organized into four moments: Under the hood, these moments use eight evidence-backed stages: `Specify (stages 0-1)` → `Make (stages 2-4)` → `Review (stages 5-7)` → `Deliver (stage 8)`. The rigor is there when you need it, but it does not have to dominate the experience. -## Meet Workflow Studio +## Meet AEL Studio -Workflow Studio makes agent work feel like a product, not a terminal session. It is a live window on your Runs, not a second place to author workflows. +AEL Studio is one read-only window on every bot on your machine. It shows which projects have a Run in progress, where each Run is in the loop, and which one is waiting for you. It is not a second place to run the loop. -### Watch the Run as it happens +- **Project list**: waiting for you first, then working, then idle, with stage, tier and elapsed time. Worktree Runs sit under their project. +- **Loop ring**: the six stages (Goal, Maker, Verify, Review, Judge, Deliver) on a tilted, Saturn-like 3D ring that fills the screen, with the bot riding it at the current stage and what is happening now in the centre (for example Devil's Advocate, 3 findings · 1 blocking). Details (findings, PR, receipt, Goal) open in a bottom sheet (`D`). Without WebGL the ring is a flat circle. +- **Detail**: the human Goal, review findings, PR status (branch, merged and URL from the Run's own records), receipt and unconfirmed assumptions. +- **Freeze**: the one action. Freeze a waiting Goal with one click; if the agent asked in the host at the same time, the first answer wins. +- **Notifications** on macOS and Linux when a bot starts waiting for you. `ael studio --background` keeps them coming with the tab closed; `ael studio --stop` ends it. -- A compact live view: stage rail, heartbeat, tier, mode, iteration, and budget -- Compliance chips for guard warnings, scope drift, and receipt verification -- Pending questions and approvals in a banner at the top -- Real-time updates pushed over `GET /api/events` (no polling; it falls back to a light stat-poll where file watching is unavailable) - -### Rewire, safely - -Workflow structure is read-only in Studio. **Wiring** mode lets you add, remove, or re-point connections between nodes that already exist. Every change goes through the same recipe compiler as the CLI, so an edge set that breaks the safety backbone cannot be saved. To add or change nodes, edit recipe files and use `recipe create|clone|install`. - -### Start with a Goal—not a vague prompt - -Write the task in plain language, add the outcomes that matter, and **Freeze** the Goal when it is ready. The agent cannot quietly move the finish line after work begins. - -### Follow every Run - -Runs have human-friendly names instead of cryptic hashes. Search previous work, pin any Run as a read-only replay, and see exactly where it stopped. A merged timeline shows lifecycle, activity, and evidence events in order. - -### Continue with your AI agent - -Use **Start with AI Agent** to copy a ready-to-use handoff for the selected Run. The agent continues with the same Goal, workflow, and evidence instead of starting from scratch. - -If the agent needs clarification, its questions can appear inside Workflow Studio. You answer them there, and the answer stays attached to the Run. - -### Repeat only the steps that need another pass - -Recipes can declare independent Loop Groups with a maximum number of passes. Studio shows a separate `Iteration 2 / 3` counter for each group, and a loop that reaches its limit pauses for a human decision instead of retrying forever. +Everything else happens in your agent host or the CLI: recipes are files, Runs start with `ael run`, and agent questions are answered with the host's question buttons. Details: [AEL Studio](core/local-workflow-studio.md). ## Bring your own AI agent @@ -252,7 +231,7 @@ Smart context keeps review path-first instead of transcript-heavy. It can build ```bash npx ai-engineering-loop context index -npx ai-engineering-loop context query createStudioRun +npx ai-engineering-loop context query createRun npx ai-engineering-loop context related lib/studio-server.js npx ai-engineering-loop context fast-path --json npx ai-engineering-loop context diff-hunks --run @@ -370,11 +349,11 @@ The same engineering flow stays consistent even when teams use different deliver The rules that decide whether AI-generated work is trustworthy should be inspectable. AI Engineering Loop keeps its schemas, safety policies, verification logic, recipes, and agent prompts in the repository. -No hidden cloud control plane is required. No project source is uploaded by Workflow Studio. +No hidden cloud control plane is required. No project source is uploaded by AEL Studio. ## Documentation -- [Workflow Studio](core/local-workflow-studio.md) +- [AEL Studio](core/local-workflow-studio.md) - [Workflow recipes](core/workflow-recipes.md) - [Personal workflow](core/personal-workflow.md) - [Bench: compliance self-check](core/bench.md) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 09c5364..be4fbfc 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -9,6 +9,14 @@ AEL vendors design and animation skills from `emilkowalski/skills` so `ai-engine The vendored skill text remains authored by the original project. See the upstream repository for updates and full project context. +## three.js + +Studio's loop ring renders with a vendored, unmodified copy of three.js. It is a shipped static file, not an npm dependency. + +- Source: https://github.com/mrdoob/three.js (npm package `three`, version 0.185.1, fetched with `npm pack three@0.185.1`) +- License: MIT, shipped as `studio/vendor/three.LICENSE` +- AEL files shipped: `studio/vendor/three.module.min.js` and the `studio/vendor/three.core.min.js` it imports, both copied from the package `build/` folder. + ## google/elephant-goldfish-model (Elephant-Goldfish Model, EGM) AEL ships a modified derivative of EGM as the `spec` host pack (issue #96; installed by default since 2.17). diff --git a/bin/ai-engineering-loop.js b/bin/ai-engineering-loop.js index d8613c7..ed9d8b8 100755 --- a/bin/ai-engineering-loop.js +++ b/bin/ai-engineering-loop.js @@ -155,6 +155,8 @@ const { const { appendRunAnswer, appendRunQuestion, + closeFreezeQuestions: closeRunFreezeQuestions, + freezeQuestionMessage, listRunInteractions } = lazyFunctions('../lib/run-interactions.js'); const { @@ -164,6 +166,7 @@ const { } = lazyFunctions('../lib/run-lifecycle.js'); const { freezeGoal, + humanFreezeActor, loadGoalDraft, saveGoalDraft } = lazyFunctions('../lib/goal-runtime.js'); @@ -206,7 +209,8 @@ const { readHandoff, verifyHandoff } = lazyFunctions('../lib/handoff.js'); -const { createStudioServer, readStudioUrl } = lazyFunctions('../lib/studio-server.js'); +const { createStudioServer } = lazyFunctions('../lib/studio-server.js'); +const { readStudioUrl } = lazyFunctions('../lib/studio/instance.js'); const VERSION = require('../package.json').version; const CWD = process.cwd(); @@ -2330,18 +2334,11 @@ function executeGate(gate, runId) { return run; } -const FREEZE_QUESTION = /^Freeze Goal draft revision \d+/; - // The freeze answers the pending freeze question(s) that `goal draft` asked, // so Studio does not keep showing them. Best effort. function closeFreezeQuestions(runId, actor) { try { - const { listRunInteractions, appendRunAnswer } = require('../lib/run-interactions.js'); - for (const question of listRunInteractions(CWD, runId).pending) { - if (FREEZE_QUESTION.test(question.message)) { - appendRunAnswer(CWD, runId, question.questionId, { message: 'Goal frozen', actor }); - } - } + closeRunFreezeQuestions(CWD, runId, actor); } catch (err) { console.error(`! freeze question not closed: ${err.message}`); } @@ -3654,7 +3651,7 @@ function handleGoal() { // without a separate `interaction question` call. try { extra.question = appendRunQuestion(CWD, runId, { - message: `Freeze Goal draft revision ${result.metadata.revision} (and accept its blast radius)?`, + message: freezeQuestionMessage(result.metadata.revision), actor: argValue('--by') || 'agent' }); appendRunLifecycle(CWD, runId, { type: 'AGENT_WAITING', phase: 'goal', actor: argValue('--by') || 'agent', message: `Waiting for answer to Q${extra.question.number}` }); @@ -3698,20 +3695,25 @@ function handleGoal() { interactiveConfirmed: approval.via === 'tty' }); const human = result.goal.actor; - appendRunLifecycle(CWD, runId, { - type: goalNode ? 'NODE_COMPLETED' : 'GOAL_FROZEN', - ...(goalNode ? { nodeId: goalNode.id } : {}), - phase: 'goal', - actor: human, - message: 'Goal Contract frozen' - }); - ensureImpactMap(runId); - closeFreezeQuestions(runId, human); - // One human stop: the same person accepts the Goal and its blast radius - // (shown as impactPreview with the draft). - if (process.argv.includes('--confirm-impact')) { - const confirmed = impactMap.confirmImpactMap(CWD, { runId, by: human }); - extra.impact = { status: confirmed.map ? confirmed.map.status : 'CONFIRMED' }; + if (result.alreadyFrozen) { + extra.alreadyFrozen = true; + closeFreezeQuestions(runId, humanFreezeActor(argValue('--by'), runId)); + } else { + appendRunLifecycle(CWD, runId, { + type: goalNode ? 'NODE_COMPLETED' : 'GOAL_FROZEN', + ...(goalNode ? { nodeId: goalNode.id } : {}), + phase: 'goal', + actor: human, + message: 'Goal Contract frozen' + }); + ensureImpactMap(runId); + closeFreezeQuestions(runId, human); + // One human stop: the same person accepts the Goal and its blast radius + // (shown as impactPreview with the draft). + if (process.argv.includes('--confirm-impact')) { + const confirmed = impactMap.confirmImpactMap(CWD, { runId, by: human }); + extra.impact = { status: confirmed.map ? confirmed.map.status : 'CONFIRMED' }; + } } } else if (action === 'diagram') { Object.assign(extra, renderGoalDiagram(runId)); @@ -3722,6 +3724,11 @@ function handleGoal() { } if (!process.argv.includes('--json') && ['draft', 'freeze'].includes(action)) { const meta = result?.metadata || {}; + if (extra.alreadyFrozen) { + log.success(`✓ Goal already frozen by ${result.goal.actor} (${result.goal.approval})`); + console.log('- Next: Maker (implement), then `gate maker --from-git`. Agents: add --json.'); + return; + } log.success(`✓ goal ${action}: Run ${runId}${meta.revision != null ? `, revision ${meta.revision}` : ''}${meta.contentHash ? ` (${String(meta.contentHash).slice(0, 12)})` : ''}`); if (action === 'draft' && extra.human) { console.log(''); @@ -3845,29 +3852,185 @@ function handleActivity() { } } -function handleStudio() { - const requestedPort = argValue('--port'); - const port = requestedPort == null ? 4317 : Number(requestedPort); - if (!Number.isSafeInteger(port) || port < 0 || port > 65535) { - log.error('--port must be an integer from 0 to 65535'); +const STUDIO_START_WAIT_MS = 5000; +const STUDIO_STOP_WAIT_MS = 3000; + +function sleepMs(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function studioLogPath(home) { + return path.join(home, '.ai-engineering-loop', 'studio.log'); +} + +function pidIsAlive(pid) { + try { + process.kill(pid, 0); + return true; + } catch (error) { + return error.code === 'EPERM'; + } +} + +async function studioAnswersHealth(instance) { + try { + const response = await fetch(`http://127.0.0.1:${instance.port}/healthz`, { signal: AbortSignal.timeout(1500) }); + const body = await response.json(); + return body.app === 'ael-studio' && body.pid === instance.pid; + } catch { + return false; + } +} + +async function waitForExit(pid, ms) { + const deadline = Date.now() + ms; + while (pidIsAlive(pid) && Date.now() < deadline) await sleepMs(50); + return !pidIsAlive(pid); +} + +async function stopStudio(home) { + const { readInstance, clearInstance } = require('../lib/studio/instance.js'); + const instance = readInstance({ home }); + if (!instance) { + console.log('Studio is not running'); + return; + } + if (!(await studioAnswersHealth(instance))) { + clearInstance({ home }); + console.log('Studio is not running (removed a stale instance file)'); + return; + } + try { + process.kill(instance.pid, 'SIGTERM'); + } catch { + clearInstance({ home }); + console.log('Studio stopped'); + return; + } + let gone = await waitForExit(instance.pid, STUDIO_STOP_WAIT_MS); + if (!gone) { + try { + process.kill(instance.pid, 'SIGKILL'); + } catch { + gone = !pidIsAlive(instance.pid); + } + gone = gone || await waitForExit(instance.pid, 1000); + } + if (!gone) { + log.error(`Studio (pid ${instance.pid}) did not exit; instance file kept`); process.exitCode = 1; return; } - const { server, token } = createStudioServer(CWD); + clearInstance({ home }); + console.log('Studio stopped'); +} + +function studioUrlFromChild(child, timeoutMs) { + return new Promise((resolve) => { + let timer; + const finish = (url) => { + clearTimeout(timer); + resolve(url); + }; + timer = setTimeout(() => finish(null), timeoutMs); + child.on('message', (message) => { + if (message && typeof message.url === 'string') finish(message.url); + }); + child.on('exit', () => finish(null)); + child.on('error', () => finish(null)); + }); +} + +async function startStudioInBackground(home, port) { + const { readInstance } = require('../lib/studio/instance.js'); + const logFile = studioLogPath(home); + fs.mkdirSync(path.dirname(logFile), { recursive: true, mode: 0o700 }); + const startOffset = fs.existsSync(logFile) ? fs.statSync(logFile).size : 0; + const fd = fs.openSync(logFile, 'a', 0o600); + fs.chmodSync(logFile, 0o600); + const childArgs = [__filename, 'studio', '--no-open', '--port', String(port)]; + if (process.argv.includes('--no-notify')) childArgs.push('--no-notify'); + const child = spawn(process.execPath, childArgs, { detached: true, stdio: ['ignore', fd, fd, 'ipc'] }); + fs.closeSync(fd); + const url = await studioUrlFromChild(child, STUDIO_START_WAIT_MS); + if (child.connected) child.disconnect(); + child.unref(); + if (url && readInstance({ home })) { + console.log(url); + return; + } + const written = fs.readFileSync(logFile).subarray(startOffset).toString('utf8'); + log.error('Studio did not start in the background. Last log lines:'); + console.error(written.split('\n').filter(Boolean).slice(-10).join('\n')); + process.exitCode = 1; +} + +function startStudioInForeground(home, port) { + const { writeInstance, clearInstance, clearInstanceIfOwned } = require('../lib/studio/instance.js'); + const { osNotifier } = require('../lib/studio/notify.js'); + const notifier = process.argv.includes('--no-notify') ? undefined : osNotifier(); + const { server, token, close } = createStudioServer({ home, notifier }); server.on('error', (error) => { log.error(`Unable to start Studio: ${error.message}`); process.exitCode = 1; }); + const shutdown = () => { + clearInstanceIfOwned({ home, pid: process.pid }); + try { + close(); + } finally { + process.exit(0); + } + }; + process.on('SIGINT', shutdown); + process.on('SIGTERM', shutdown); + process.on('exit', () => clearInstanceIfOwned({ home, pid: process.pid })); server.listen(port, '127.0.0.1', () => { - const address = server.address(); - const url = `http://127.0.0.1:${address.port}/?token=${token}`; - log.success('✓ Workflow Studio is running locally'); + const actualPort = server.address().port; + writeInstance({ home, pid: process.pid, port: actualPort }); + const url = `http://127.0.0.1:${actualPort}/?token=${token}`; + log.success('✓ AEL Studio is running locally'); + if (typeof process.send === 'function') { + console.log(`http://127.0.0.1:${actualPort}/ (running in the background; stop it with \`ael studio --stop\`)`); + process.send({ url }, () => { + if (process.connected) process.disconnect(); + }); + return; + } console.log(url); console.log('Press Ctrl+C to stop. The session token is valid only for this process.'); if (!process.argv.includes('--no-open')) openStudio(url); }); } +async function handleStudio() { + const home = homeDir(); + if (process.argv.includes('--stop')) { + await stopStudio(home); + return; + } + const requestedPort = argValue('--port'); + const port = requestedPort == null ? 4317 : Number(requestedPort); + if (!Number.isSafeInteger(port) || port < 0 || port > 65535) { + log.error('--port must be an integer from 0 to 65535'); + process.exitCode = 1; + return; + } + const { readInstance } = require('../lib/studio/instance.js'); + const running = readInstance({ home }); + if (running) { + console.log(running.url); + console.log('Studio is already running; if the browser asks for a session, run `ael studio --stop` then `ael studio`'); + if (!process.argv.includes('--no-open') && !process.argv.includes('--background')) openStudio(running.url); + return; + } + if (process.argv.includes('--background')) { + await startStudioInBackground(home, port); + return; + } + startStudioInForeground(home, port); +} + function handleInteraction() { const action = args[1] || 'list'; const runId = argValue('--run'); @@ -5384,8 +5547,10 @@ Commands: show [--json] validate [--mode ] [--json] explain | graph | simulate [--mode ] [--json] - studio Open the localhost-only live-run Studio - [--port <0-65535>] [--no-open] + studio Open the localhost-only, read-only bot monitor for every registered project + [--port <0-65535>] [--no-open] [--no-notify] + --background keep Studio running detached; log in ~/.ai-engineering-loop/studio.log + --stop stop the running Studio handoff Export or verify a redacted, integrity-bound knowledge transfer create [--run ] [--audience developer|agent|auditor] [--output |-] [--json] @@ -5438,7 +5603,7 @@ Everyday: ael status is this project ready, and what is running? ael run "" start or resume a Run; the agent drives the rest ael quick start "" a tiny change in two calls (T0) - ael studio watch the Run in your browser + ael studio watch every project's bot on this machine (read-only, Freeze) ael doctor check this machine (git, agent skill, gh/glab) Help: diff --git a/core/local-workflow-studio.md b/core/local-workflow-studio.md index ae9a284..354157d 100644 --- a/core/local-workflow-studio.md +++ b/core/local-workflow-studio.md @@ -1,106 +1,98 @@ -# Local Workflow Studio +# AEL Studio -Workflow Studio is a localhost-only live view of recipe-bound and classic CLI runs. It is the place to glance at what the agent is doing and whether the run is still compliant. It does not execute models, shell commands, arbitrary node code, or inject prompts into an external AI conversation. The existing recipe compiler and controlled workflow runtime remain the source of truth. +AEL Studio is a localhost-only, read-only window on every bot running on this machine. Open it to see in a few seconds which projects have a Run in progress, where each Run is in the loop, and whether one is waiting for you. The one action it allows is **Freeze** of a Goal that is waiting. It does not run models, shell commands or nodes, and it cannot change a Run, a recipe or a gate. The CLI and the Run artifacts stay the source of truth. -## Start +## Start and stop ```bash -ai-engineering-loop studio +ael studio # start, or reuse the running Studio, and open it +ael studio --background # keep it running detached (log: ~/.ai-engineering-loop/studio.log) +ael studio --stop # stop the running Studio ``` -The CLI binds only to `127.0.0.1`, creates a random process-local session token, and opens a tokenized bootstrap URL. The server exchanges that URL for an `HttpOnly; SameSite=Strict` cookie and removes the token from the address bar. Use `--no-open` when you want to copy the printed URL manually, or `--port 0` to let the operating system choose an available port. +| Flag | Effect | +|---|---| +| `--background` | Start detached and print the session URL to your terminal; notifications keep working with the browser tab closed. The log gets only the tokenless URL and is private (`0600`). | +| `--stop` | Stop the Studio recorded in `~/.ai-engineering-loop/studio.json` (only that process) and remove the file. | +| `--no-notify` | Do not send OS notifications. | +| `--port <0-65535>` | Port to bind (default `4317`; `0` lets the OS choose). | +| `--no-open` | Print the URL instead of opening the browser. | -The server rejects non-local `Host` headers. Static assets are bundled in the npm package; there are no CDNs, analytics, remote fonts, or browser-side model calls. Responses use a restrictive Content Security Policy and are not cached. +There is one Studio per machine. It writes its pid, port and URL to `~/.ai-engineering-loop/studio.json` (never the token). A plain `ael studio` that finds a running instance prints its URL and opens it instead of starting a second one. If the browser then asks for a session, run `ael studio --stop` and `ael studio`. `status --json` and `run --json` report a tokenless `studioUrl`; it returns 401 without a session. -Studio watches one project root — the working directory where it was launched. The header shows that root. `status --json` and `run --json` include `studioUrl` when a Studio process for that root is alive. That field identifies the running Studio; it is tokenless and returns 401 without a session. Do not write the session token to disk or into agent-visible output. Open the browser session from the tokenized URL printed by `ael studio`. +## Security -## Real-time sync +- Binds `127.0.0.1` only and rejects a non-local `Host` header. +- A random per-process token is printed once in the URL on the terminal that started Studio (with `--background` the detached process hands it to that terminal over an IPC channel); the server exchanges it for an `HttpOnly; SameSite=Strict` cookie and removes it from the address bar. The token is never written to disk: not to `studio.json`, not to `studio.log`. A request target that is not a valid URL gets `400 Bad request`. +- CSP `default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'`. Static files come from an explicit allowlist bundled in the package: no CDN, analytics or remote fonts. three.js 0.185.1 (MIT) is vendored in `studio/vendor/`. +- Read scope: each project in the registry (`~/.ai-engineering-loop/projects.json`, `ael projects list`) and each worktree listed in its `.ai-engineering-loop/worktrees.json`, and only the `.ai-engineering-loop/` folder inside them. Symlinks out of that folder are refused. The browser never sends a path: projects are addressed by an opaque id (a hash of the real path). -Studio does not poll `/api/live` on a timer. One `RunWatcher` per process recursively watches `.ai-engineering-loop/runs/` and `current.json`. On a change it re-reads only the changed artifact and pushes a typed event on `GET /api/events` (SSE). +## What you see -Event types: `run.created`, `run.state`, `lifecycle`, `artifact.impact`, `artifact.drift`, `artifact.guard`, `artifact.verification`, `artifact.findings`, `artifact.verdict`, `artifact.receipt`, `artifact.delivery`, `current.changed`, `presence`. Each event carries `runId`, a monotonic `seq`, and a minimal payload. +- **Project list** (left; on top on narrow screens): waiting for you first, then working, then idle, then missing. Each row shows the project, the stage, the tier, elapsed time, and "waiting for you" with the reason (Goal waiting for Freeze, delivery waiting for approval, agent question). Worktree Runs are listed under their parent project; a registered worktree of another registered project is folded under that parent. +- **Project list** bots: orange when working, orange with an outline ring when waiting for you, grey when idle. A Run waiting for a Freeze reads ` · Freeze?` with a Freeze button under it; other waits show their reason on the second line. The selected project is a raised card. +- **Run stage**: the selected Run fills the screen next to the list. A glass card in the top-left shows ` · · iteration n of m`, the Run title (full text on hover), when it started, and the wait as a chip (**Freeze?**, **Approve delivery?**, **Agent asks you**); a Goal waiting for Freeze keeps its Freeze button right there. **Details** (bottom right, or press `D`) opens the findings, PR, receipt, Goal and assumptions in a bottom sheet: it slides up over the stage, closes with Esc, the Close button, a tap on the dimmed backdrop, or a downward drag on touch, keeps focus inside while open, and returns focus to the button. Below 900 px the project list folds into a **Projects** menu in the top bar so the stage keeps the whole screen. +- **Kitchen**: with WebGL the Run is a warm open restaurant kitchen seen slightly from above: a cream tiled backsplash, a wooden back shelf on iron brackets with jars, a steel hood over the Cook station, a steel back counter, pendant lamps over the pass that cast soft pools of light, a marble counter on a wooden front and a terracotta dining floor. It reads left to right along the counter with six stations: **Order** (Goal: an open order book, an ink pot with a quill and a ticket spike), **Cook** (Maker: a hob with a pan and a stock pot, steam while cooking), **Taste** (Verify: a cutting board with soup and a spoon, shakers and herbs), **Critic** (Review: a plate on a velvet cloth, a magnifier on a stand and a glass of wine, under a dim red spot), **Head chef** (Judge: a service bell, ticket slips and a stamp) and **Serve** (Deliver: a plate under a cloche and a stack of plates). Hover a station with a mouse and it lifts slightly while its label lights up. Under each station its name and AEL stage are page text projected from the scene (for example "Taste / Verify"). A lamp on the counter front shows each station's status: green done, warm orange with a soft pulse in progress, dim not started, greyed skipped (T0 skips Critic and Head chef). Order tickets hang on a rail on the back wall; this Run's orange ticket slides to the active station, reading "Your order" or, after a Run went back, "Iteration 2 of 3", and a dashed "Sent back to the kitchen" path runs from Head chef to Cook. The bot stands on the counter behind its station's props and hops between stations with a little squash and stretch when the stage changes. When the Judge passes, the Head chef's bell wobbles. In front of the counter is the guest table, **You, the guest**: when the Run waits for a Freeze it asks **Confirm the order?** with the Freeze button; a delivery approval reads **Bring it out?** and an agent question "The waiter asks you something" (both answered in the agent host). A small dining area holds NPC diners (round bots like the chef in their own colours) who lift a fork, sip or chat on staggered loops and now and then glance at the bot while the kitchen works; hover or focus one for its name tag (name, note, "Eating while their workflow cooks"). The top-right caption shows what is happening now (the current stage's agent, "Waiting for Freeze", "Delivered", with the findings count when there is a ledger). Rendering is procedural (no downloaded models): rounded and bevelled forms, PBR materials (veined marble, brushed steel, wood grain, glazed tiles), warm key, fill and rim lights, soft shadows, contact shadows, ACES tone mapping with a per-theme exposure, and a generated environment; static geometry is merged per material. It renders only while something moves (an idle bot wakes it only to blink) and pauses in a hidden tab, and a finished Run's diners hold still. Switching projects repaints the same kitchen behind a short fade; Previous/Next in the station view slides a second kitchen in and disposes the old one. Without WebGL, or if three.js fails, the Run is a flat circle with the same station names, the ticket, the return note and the guest prompt as text. With `prefers-reduced-motion` the chef cuts to the next station with a short fade, lamps do not pulse and diners hold a still pose. Recipe nodes that do not map to a stage are listed in the details. +- **Top bar**: the AEL mark, the project count, bots working (orange chip with a live dot) and waiting for you (outlined chip), and the connection state (Live, Reconnecting, Offline). It stays at the top while you scroll. +- **Bot**: one glossy orange sphere with two tall black capsule eyes set a little right of centre, as if looking sideways, and a soft contact shadow; no visor, no mouth. It is a button, and its name says what it is doing (for example "Bot is reviewing: Devil's Advocate, 3 findings · 1 blocking"). Small accessories show the station: a laurel wreath and a quill at Order, a chef hat with a spatula at Cook and with a spoon at Taste, a monocle, a magnifier, a near-black body and dim red eyes as the Critic, a chef hat and a gavel at Head chef, a chef hat and a tray with a cloche at Serve. The eyes carry the mood: they blink every few seconds, squint while reviewing, widen with a question mark when the agent asks you something, tilt angrily during a long wait, and turn to ^ ^ when you click. A waiting bot looks around, then taps, then grumbles, then rants with steam; a finished Run's bot smiles and rests. Click, tap or Enter makes it bounce and spin; on a mouse its eyes follow the pointer. With `prefers-reduced-motion` (the OS setting) it holds a still pose and only fades remain. These are decoration; the page text is the source of truth. +- **Waiting moods**: while a Run waits for you, the bot gets more impatient with how long the wait has lasted (thresholds in `WAIT_LEVEL_SECONDS`, `studio/js/mood.js`): first a polite line ("Your order, please?", "Bring it out?"), from 30 s it taps its foot (**…**), from 2 min it is annoyed ("The kitchen is waiting…"), from 5 min it rants (hops, steam puffs, rotating lines such as "Confirm the order!" or "The food's getting cold!"). All lines are fixed copy in one table (`WAIT_COPY`), never file contents. Screen readers hear the line once when the level changes, not on every rotation. With reduced motion the bot holds a still pose and the bubble shows one line. +- **Station view**: click, tap or press Enter on the bot (or click its station) and the camera dollies to that station in the same kitchen; a glass card shows the project, Run title, activity, stage, tier, iteration, the wait, and the Freeze button when the Goal waits for Freeze. **Previous** / **Next** (or ←/→) move to the previous or next project with an active Run, and the list selection follows: the kitchens slide past each other. **Close** or Esc zooms back out and returns focus to the bot. It is a modal dialog with focus kept inside. With reduced motion the zoom and the switch are cuts. Without WebGL the view shows the card only. +- **Goal**: shown **Formatted** (headings, lists, emphasis, code, http(s) links; everything else is escaped text) or as raw **Markdown**, switched with the tabs (arrow keys, Home, End). +- **Details** (the sheet): the human Goal, Devil's Advocate and Judge findings (total, blocking), PR status, receipt state, and unconfirmed assumptions (`provenance.json`). PR status is the branch (from `worktrees.json` or `delivery.json`), whether a merge was recorded, and the merge URL, all read from the Run's own records (`merge.json`); Studio never queries GitHub or GitLab, so checks and review state stay in `ael pr status`. +- A finished worktree Run (reported, delivered, cancelled or escalated) shows an idle bot, not a working one. +- Theme: AEL orange on warm paper (light) or ink (dark), following the OS. All colours live in `studio/tokens.css`. Motion follows Emil Kowalski's rules; reduced motion keeps fades and removes movement. -The first SSE frame is `hello` with `mode` (`watch` or `poll`), `root`, `currentRunId`, and `seq`. The status pill shows `live: watch` or `live: poll`. Where `fs.watch` is unavailable (or `AEL_STUDIO_FS_WATCH=0`), Studio falls back to a 1 s stat-poll of the same files. +### Diners -`Last-Event-ID` and `?after=` replay from an in-memory ring. A gap larger than the ring sends `resync`; the client then reloads `/api/bootstrap`. If the event stream ends or errors, the client reconnects with `setTimeout` backoff (500 ms, 1 s, 2 s, max 5 s) and resumes from the last `seq`; a failed resume falls back to `/api/bootstrap`. The Retry button still calls the same resync. The stream covers every run in the project. The UI follows `current.json` by default and can pin any run, including a classic run with no bound workflow and a run driven with `--run ` that is not current. +The named diners are a nod to people who inspired AEL, relaxing over dinner while their own workflows cook; they come from `studio/diners.json` (`[{ "name", "note" }]`, at most 6). Generic diners without name tags fill the empty chairs. To seat your own, add `studio.diners` to `~/.ai-engineering-loop/config.json`: -`GET /api/runs/:id/lifecycle` remains as a bounded REST ledger. `GET /api/runs/:id/lifecycle/stream` and `POST /api/import/*` return 404. - -## Live run view - -The default route is the live run view. It follows the open run over `GET /api/events`. - -- A progress rail for goal, maker, verify, review, judge, and deliver. Each stage shows its status and duration, and the running stage is highlighted. -- A question banner when the run is waiting on a person, with Answer in Studio. -- A current-step card with the node, iteration, running time, latest activity, evidence chips recorded so far, Open node details, and Start with AI Agent. -- Compliance and budget chips for mode, tier, iteration, guard warns and blocks, drift, receipt, and tokens. Tokens read `unknown` when the host reports no usage. A delivered run with no receipt reads “no receipt: run predates receipts”. -- Latest events with clock times, and a timeline grouped by step. -- The header shows when the run started and the heartbeat age. Every time is a `