ai-engineering-loop 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,11 +6,17 @@ const {
6
6
  TERMINAL_STATES,
7
7
  createRun,
8
8
  getCurrentRun,
9
+ loadRun,
9
10
  newRunId,
10
- normalizeRunMode
11
+ normalizeRunMode,
12
+ transitionRun
11
13
  } = require('./run-state.js');
12
14
  const { assertModeAllowed } = require('./runtime-policy.js');
13
- const { createWorkflowBundle, startWorkflowExecution } = require('./workflow-runtime.js');
15
+ const {
16
+ cancelWorkflowRun,
17
+ createWorkflowBundle,
18
+ startWorkflowExecution
19
+ } = require('./workflow-runtime.js');
14
20
 
15
21
  function studioRuntimeError(message, code) {
16
22
  const error = new Error(message);
@@ -37,10 +43,18 @@ function createStudioRun(
37
43
  assertModeAllowed(rootDir, normalizedMode);
38
44
  const current = getCurrentRun(rootDir);
39
45
  if (current && !TERMINAL_STATES.has(current.state)) {
40
- throw studioRuntimeError(
46
+ const error = studioRuntimeError(
41
47
  `Run ${current.runId} is already active; finish it before creating a sibling execution`,
42
48
  'ACTIVE_RUN'
43
49
  );
50
+ error.activeRun = {
51
+ runId: current.runId,
52
+ displayName: current.displayName,
53
+ task: current.task,
54
+ state: current.state,
55
+ updatedAt: current.updatedAt
56
+ };
57
+ throw error;
44
58
  }
45
59
  const loaded = loadRecipe(rootDir, recipeId);
46
60
  const plan = compileRecipe(loaded.recipe, { mode: normalizedMode });
@@ -70,4 +84,37 @@ function executeStudioRun(rootDir, runId, { now = new Date() } = {}) {
70
84
  return startWorkflowExecution(rootDir, { runId, now });
71
85
  }
72
86
 
73
- module.exports = { createStudioRun, executeStudioRun };
87
+ function cancelStudioRun(
88
+ rootDir,
89
+ runId,
90
+ { actor = 'human', reason = 'Replaced by a new Goal', now = new Date() } = {}
91
+ ) {
92
+ const run = loadRun(rootDir, runId);
93
+ if (TERMINAL_STATES.has(run.state)) {
94
+ throw studioRuntimeError(`Run ${runId} is already finished`, 'RUN_ALREADY_FINISHED');
95
+ }
96
+ const cleanActor = String(actor || '').trim();
97
+ const cleanReason = String(reason || '').trim();
98
+ if (!/^[A-Za-z0-9@._-]{1,64}$/.test(cleanActor)) {
99
+ throw studioRuntimeError('Cancellation actor must be a short account identifier', 'INVALID_RUN_ACTOR');
100
+ }
101
+ if (!cleanReason || cleanReason.length > 500) {
102
+ throw studioRuntimeError('Cancellation reason must be 1-500 characters', 'INVALID_CANCEL_REASON');
103
+ }
104
+ if (run.workflow) {
105
+ return cancelWorkflowRun(rootDir, {
106
+ runId,
107
+ actor: cleanActor,
108
+ reason: cleanReason,
109
+ now
110
+ }).run;
111
+ }
112
+ return transitionRun(rootDir, runId, 'CANCELLED', {
113
+ gate: 'run-cancelled',
114
+ reason: cleanReason,
115
+ historyMetadata: { actor: cleanActor },
116
+ now
117
+ });
118
+ }
119
+
120
+ module.exports = { cancelStudioRun, createStudioRun, executeStudioRun };
@@ -39,7 +39,7 @@ const {
39
39
  listRunInteractions
40
40
  } = require('./run-interactions.js');
41
41
  const { saveGoalDraft, freezeGoal, unfreezeGoal } = require('./goal-runtime.js');
42
- const { createStudioRun, executeStudioRun } = require('./studio-runtime.js');
42
+ const { cancelStudioRun, createStudioRun, executeStudioRun } = require('./studio-runtime.js');
43
43
  const { createHandoff, handoffBrief, recordDecision } = require('./handoff.js');
44
44
  const { loadStudioLayout, saveStudioLayout } = require('./studio-layout.js');
45
45
  const {
@@ -150,6 +150,7 @@ function createStudioServer(rootDir, { token = crypto.randomBytes(24).toString('
150
150
  const scopedRun = url.pathname.match(/^\/api\/runs\/([^/]+)$/);
151
151
  const scopedArtifact = url.pathname.match(/^\/api\/runs\/([^/]+)\/artifacts$/);
152
152
  const scopedExecute = url.pathname.match(/^\/api\/runs\/([^/]+)\/execute$/);
153
+ const scopedCancel = url.pathname.match(/^\/api\/runs\/([^/]+)\/cancel$/);
153
154
  const scopedGoal = url.pathname.match(/^\/api\/runs\/([^/]+)\/goal$/);
154
155
  const scopedGoalFreeze = url.pathname.match(/^\/api\/runs\/([^/]+)\/goal\/freeze$/);
155
156
  const scopedGoalUnfreeze = url.pathname.match(/^\/api\/runs\/([^/]+)\/goal\/unfreeze$/);
@@ -307,6 +308,13 @@ function createStudioServer(rootDir, { token = crypto.randomBytes(24).toString('
307
308
  const body = await readBody(request);
308
309
  const run = createStudioRun(rootDir, body);
309
310
  json(response, 201, { ok: true, run });
311
+ } else if (request.method === 'POST' && scopedCancel) {
312
+ const body = await readBody(request);
313
+ const run = cancelStudioRun(rootDir, decodeURIComponent(scopedCancel[1]), {
314
+ actor: body.actor || 'human',
315
+ reason: body.reason || 'Replaced by a new Goal'
316
+ });
317
+ json(response, 200, { ok: true, run });
310
318
  } else if (request.method === 'PATCH' && url.pathname === '/api/run/name') {
311
319
  const body = await readBody(request);
312
320
  const run = updateRunDisplayName(rootDir, body.runId, body.displayName, {
@@ -470,7 +478,13 @@ function createStudioServer(rootDir, { token = crypto.randomBytes(24).toString('
470
478
  response.end(fs.readFileSync(path.join(ASSET_DIR, asset)));
471
479
  }
472
480
  } catch (error) {
473
- json(response, 400, { ok: false, code: error.code || 'STUDIO_ERROR', error: error.message, details: error.details || [] });
481
+ json(response, 400, {
482
+ ok: false,
483
+ code: error.code || 'STUDIO_ERROR',
484
+ error: error.message,
485
+ details: error.details || [],
486
+ ...(error.activeRun ? { activeRun: error.activeRun } : {})
487
+ });
474
488
  }
475
489
  });
476
490
  return { server, token };
@@ -1047,6 +1047,53 @@ function workflowStatus(rootDir, { runId } = {}) {
1047
1047
  return loadWorkflow(rootDir, resolveRunId(rootDir, runId));
1048
1048
  }
1049
1049
 
1050
+ function cancelWorkflowRun(
1051
+ rootDir,
1052
+ { runId, actor = 'human', reason = 'Replaced by a new Goal', now = new Date() } = {}
1053
+ ) {
1054
+ const resolved = resolveRunId(rootDir, runId);
1055
+ return withWorkflowLock(rootDir, resolved, () => {
1056
+ let workflow = loadWorkflow(rootDir, resolved);
1057
+ if (!/^[A-Za-z0-9@._-]{1,64}$/.test(String(actor))) {
1058
+ throw runtimeError('Cancellation actor must be a short account identifier', 'INVALID_RUN_ACTOR');
1059
+ }
1060
+ const cleanReason = redactSecrets(String(reason || '').trim()).text;
1061
+ if (!cleanReason || cleanReason.length > 500) {
1062
+ throw runtimeError('Cancellation reason must be 1-500 characters', 'INVALID_CANCEL_REASON');
1063
+ }
1064
+ workflow.run = transitionRun(rootDir, resolved, RUN_STATES.CANCELLED, {
1065
+ gate: 'run-cancelled',
1066
+ reason: cleanReason,
1067
+ historyMetadata: { actor: String(actor) },
1068
+ now
1069
+ });
1070
+ const changes = [];
1071
+ for (const node of workflow.plan.nodes) {
1072
+ const current = workflow.state.nodes[node.id];
1073
+ if (!SUCCESS_STATES.has(current.status)) {
1074
+ changes.push(...nodeChanges(workflow, node.id, NODE_STATES.BLOCKED, {
1075
+ reason: cleanReason,
1076
+ activity: null
1077
+ }, now));
1078
+ }
1079
+ }
1080
+ const loopChanges = (workflow.plan.loopGroups || [])
1081
+ .filter((group) => !['EXITED', 'STOPPED'].includes(workflow.state.loopGroups[group.id]?.status))
1082
+ .map((group) => loopChange(workflow, group.id, { status: 'STOPPED' }, now));
1083
+ workflow = commitChanges(
1084
+ rootDir,
1085
+ workflow,
1086
+ 'RUN_CANCELLED',
1087
+ changes,
1088
+ { actor: String(actor), reason: cleanReason },
1089
+ now,
1090
+ false,
1091
+ loopChanges
1092
+ );
1093
+ return { run: workflow.run, workflow };
1094
+ });
1095
+ }
1096
+
1050
1097
  function unfreezeWorkflowGoal(rootDir, { runId, transitionOptions, now = new Date() } = {}) {
1051
1098
  const resolved = resolveRunId(rootDir, runId);
1052
1099
  return withWorkflowLock(rootDir, resolved, () => {
@@ -1123,6 +1170,7 @@ module.exports = {
1123
1170
  createWorkflowBundle,
1124
1171
  loadWorkflow,
1125
1172
  workflowStatus,
1173
+ cancelWorkflowRun,
1126
1174
  unfreezeWorkflowGoal,
1127
1175
  startWorkflowExecution,
1128
1176
  startWorkflowNode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-engineering-loop",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A visual workspace that helps AI coding agents plan, build, review, and ship reliable software.",
5
5
  "main": "bin/ai-engineering-loop.js",
6
6
  "bin": {
package/studio/app.js CHANGED
@@ -37,6 +37,7 @@ let selectedCheckoutRun;
37
37
 
38
38
  const DISPLAY_NAME_MAX = 80;
39
39
  const ROOT_TYPES = new Set(['goal-contract', 'trigger']);
40
+ const TERMINAL_RUN_STATES = new Set(['DELIVERED', 'REPORTED', 'ESCALATED', 'CANCELLED']);
40
41
 
41
42
  function displayName(item) {
42
43
  return item?.displayName || item?.name || item?.id || 'Untitled';
@@ -1110,21 +1111,61 @@ async function ensureStudioRun() {
1110
1111
  return activeRunId;
1111
1112
  }
1112
1113
  const task = byId('goal-task').value.trim();
1113
- const created = await api('/api/runs', {
1114
- method: 'POST',
1115
- body: JSON.stringify({
1116
- task,
1117
- constraints: byId('goal-constraints').value.trim(),
1118
- displayName: byId('goal-run-name').value.trim(),
1119
- recipeId: loadedRecipeId,
1120
- mode: draft.compatibleModes.includes('ASSISTED') ? 'ASSISTED' : draft.compatibleModes[0]
1121
- })
1122
- });
1114
+ const request = {
1115
+ task,
1116
+ constraints: byId('goal-constraints').value.trim(),
1117
+ displayName: byId('goal-run-name').value.trim(),
1118
+ recipeId: loadedRecipeId,
1119
+ mode: draft.compatibleModes.includes('ASSISTED') ? 'ASSISTED' : draft.compatibleModes[0]
1120
+ };
1121
+ let created;
1122
+ try {
1123
+ created = await api('/api/runs', {
1124
+ method: 'POST',
1125
+ body: JSON.stringify(request)
1126
+ });
1127
+ } catch (error) {
1128
+ if (error.payload?.code !== 'ACTIVE_RUN' || !error.payload.activeRun) throw error;
1129
+ const action = await resolveActiveRunConflict(error.payload.activeRun);
1130
+ if (action !== 'replace') return null;
1131
+ await api(`/api/runs/${encodeURIComponent(error.payload.activeRun.runId)}/cancel`, {
1132
+ method: 'POST',
1133
+ body: JSON.stringify({
1134
+ actor: 'human',
1135
+ reason: 'Ended in Studio before creating a new Goal'
1136
+ })
1137
+ });
1138
+ created = await api('/api/runs', {
1139
+ method: 'POST',
1140
+ body: JSON.stringify(request)
1141
+ });
1142
+ }
1123
1143
  activeRunId = created.run.runId;
1124
1144
  await refreshLive();
1125
1145
  return activeRunId;
1126
1146
  }
1127
1147
 
1148
+ function resolveActiveRunConflict(run) {
1149
+ return new Promise((resolve) => {
1150
+ const dialog = byId('active-run-dialog');
1151
+ byId('active-run-message').textContent = `${run.displayName || run.runId} · ${run.state}`;
1152
+ byId('continue-active-run').onclick = async () => {
1153
+ dialog.close();
1154
+ activeRunId = run.runId;
1155
+ byId('goal-dialog').close();
1156
+ showWorkspace('runs');
1157
+ await loadRuns();
1158
+ await loadRunDetail(run.runId);
1159
+ resolve('continue');
1160
+ };
1161
+ byId('replace-active-run').onclick = () => {
1162
+ dialog.close();
1163
+ resolve('replace');
1164
+ };
1165
+ dialog.showModal();
1166
+ });
1167
+ }
1168
+
1128
1169
  async function saveGoalFromForm() {
1129
1170
  try {
1130
1171
  const task = byId('goal-task').value.trim();
@@ -1142,6 +1183,7 @@ async function saveGoalFromForm() {
1142
1183
  return null;
1143
1184
  }
1144
1185
  const runId = await ensureStudioRun();
1186
+ if (!runId) return null;
1145
1187
  const contract = goalContractFromForm(runId);
1146
1188
  await api(`/api/runs/${encodeURIComponent(runId)}/goal`, {
1147
1189
  method: 'PUT',
@@ -1283,13 +1325,21 @@ async function loadRuns() {
1283
1325
  if (!runs.length) {
1284
1326
  list.innerHTML = '<div class="empty-state"><h2>No runs found</h2><p>Create a task from the workflow trigger.</p></div>';
1285
1327
  } else {
1286
- list.innerHTML = runs.map((run) => `
1287
- <button class="run-row" data-run-id="${escapeHtml(run.runId)}">
1328
+ const active = runs.find((run) => !TERMINAL_RUN_STATES.has(run.status));
1329
+ const historyRuns = runs.filter((run) => run.runId !== active?.runId);
1330
+ const row = (run, isActive = false) => `
1331
+ <button class="run-row${isActive ? ' active-run-row' : ''}" data-run-id="${escapeHtml(run.runId)}">
1288
1332
  <strong>${escapeHtml(run.displayName)}</strong>
1289
1333
  <span>${escapeHtml(run.status)} · ${escapeHtml(new Date(run.updatedAt).toLocaleString())}</span>
1290
1334
  <small>${escapeHtml(run.task)}</small>
1291
- </button>
1292
- `).join('');
1335
+ </button>`;
1336
+ list.innerHTML = [
1337
+ active ? `<div class="run-list-label"><i></i>Active now</div>${row(active, true)}` : '',
1338
+ `<div class="run-list-label history-label">History</div>`,
1339
+ historyRuns.length
1340
+ ? historyRuns.map((run) => row(run)).join('')
1341
+ : '<p class="muted run-list-empty">Completed Runs will stay here.</p>'
1342
+ ].join('');
1293
1343
  list.querySelectorAll('.run-row').forEach((button) => {
1294
1344
  button.onclick = () => loadRunDetail(button.dataset.runId);
1295
1345
  });
@@ -1802,6 +1852,7 @@ async function refreshLive() {
1802
1852
  renderLive();
1803
1853
  await refreshSelectedCheckout();
1804
1854
  await refreshCheckoutInteractions();
1855
+ if (!byId('runs-view').hidden) await loadRuns();
1805
1856
  } catch {
1806
1857
  // A transient refresh failure must not discard the draft.
1807
1858
  }
package/studio/index.html CHANGED
@@ -183,6 +183,15 @@
183
183
  </footer>
184
184
  </form>
185
185
  </dialog>
186
+ <dialog id="active-run-dialog" class="resizable-dialog">
187
+ <header><div><small>ACTIVE RUN</small><h2>A Run is already in progress</h2></div></header>
188
+ <p id="active-run-message"></p>
189
+ <div class="goal-state draft">Starting a new Goal will end the current Run. Its history and evidence will remain available.</div>
190
+ <footer>
191
+ <button type="button" id="continue-active-run">Continue current Run</button>
192
+ <button type="button" id="replace-active-run" class="primary">End Run &amp; create new Goal</button>
193
+ </footer>
194
+ </dialog>
186
195
  <dialog id="loop-dialog" class="resizable-dialog">
187
196
  <form id="loop-form">
188
197
  <header><div><small>ITERATION LOOP</small><h2>Repeat only the selected steps</h2></div><div class="dialog-actions"><button type="button" class="dialog-maximize" aria-label="Maximize dialog">□</button><button type="button" data-close="loop-dialog" aria-label="Close">×</button></div></header>
package/studio/styles.css CHANGED
@@ -41,8 +41,8 @@ dialog{border:1px solid #505057;border-radius:4px;background:var(--panel);color:
41
41
  .selection-actions{position:absolute;z-index:12;left:50%;top:14px;transform:translateX(-50%);padding:6px;background:#29292e;border:1px solid var(--line);border-radius:8px}.selection-actions span{margin:0 8px;color:var(--muted)}#selection-marquee{position:absolute;display:none;border:1px solid var(--accent);background:#28ad0018;pointer-events:none}
42
42
  .loop-group{position:absolute;z-index:1;border:1px dashed #28ad0099;border-radius:12px;background:#28ad000a;pointer-events:none}.loop-group>header{position:absolute;left:14px;top:-16px;height:31px;display:flex;align-items:center;gap:10px;padding:4px 5px 4px 10px;border:1px solid #28ad006e;border-radius:5px;background:#1b2818;pointer-events:auto}.loop-group header span{display:flex;align-items:center;gap:8px;white-space:nowrap}.loop-group header b{font-size:10px;text-transform:uppercase;letter-spacing:.08em}.loop-group header small{margin:0;color:#91dc7c;font:9px ui-monospace,monospace}.loop-group header button{padding:3px 7px;border:0;background:transparent;color:var(--muted);font-size:9px}.loop-group.blocked{border-color:var(--warning);background:#e4a8530a}.loop-group.exited{opacity:.72}.loop-return{stroke:#28ad00;stroke-dasharray:7 6}.edge-label{position:absolute;z-index:6;transform:translate(-50%,-50%);padding:3px 6px;border:1px solid #4d4d54;border-radius:4px;background:#202024;color:#d6d6da;font:9px ui-monospace,monospace;white-space:nowrap;pointer-events:none}.loop-label{border-color:#28ad007a;color:#91dc7c}
43
43
  .custom-node-action{width:calc(100% - 20px);margin:4px 10px 14px;border-color:var(--accent);color:#91dc7c}
44
- .runs-view{position:absolute;inset:0 0 0 56px;padding:28px 34px;overflow:auto;background:var(--canvas)}.runs-header{display:flex;align-items:end;justify-content:space-between;gap:30px;max-width:1440px;margin:auto}.runs-header h1{margin:5px 0;font-size:32px;letter-spacing:-.04em}.runs-header p{color:var(--muted)}.run-filters{display:flex;align-items:end;gap:7px}.run-filters label{margin:0}.run-filters input,.run-filters select{display:block;max-width:150px;margin-top:6px;padding:10px;border:1px solid var(--line);background:var(--bg);border-radius:3px}.run-search{width:min(300px,32vw)}.run-search input{width:100%;max-width:none}.runs-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:16px;max-width:1440px;margin:22px auto}.run-list,.run-detail{min-height:520px;border:1px solid var(--line);border-radius:4px;background:var(--panel);padding:12px}.run-row{display:block;width:100%;margin-bottom:7px;padding:16px;text-align:left;background:transparent;border-color:transparent;border-radius:3px}.run-row:hover{background:var(--raised);border-color:#4d4d54}.run-row strong,.run-row span,.run-row small{display:block}.run-row span{margin:7px 0;color:#91dc7c;font-size:10px;letter-spacing:.04em}.run-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.run-detail{padding:24px;overflow:hidden}.run-detail h2{font-size:26px;margin:5px 0;letter-spacing:-.03em}.timeline p{display:grid;grid-template-columns:180px 1fr;gap:12px;border-top:1px solid var(--line);padding:9px 0}.timeline time{color:var(--muted);font:10px ui-monospace,monospace}.empty-state{padding:50px 22px;text-align:center;color:var(--muted)}
45
- .checkout-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.checkout-header .quiet{float:none;margin:0 0 14px -10px}.checkout-actions{display:flex;gap:7px;flex-shrink:0}.checkout-meta{display:flex;gap:16px;padding:13px 0;margin:16px 0;border-block:1px solid var(--line);color:var(--muted);font:10px ui-monospace,monospace}.checkout-canvas{position:relative;width:max(100%,var(--checkout-width));height:var(--checkout-height);min-height:330px;margin:20px 0;overflow:auto;background-color:#1e1e21;background-image:radial-gradient(#414147 1px,transparent 1px);background-size:24px 24px;border:1px solid var(--line)}.checkout-canvas svg{position:absolute;inset:0;width:var(--checkout-width);height:var(--checkout-height);pointer-events:none}.checkout-canvas path{fill:none;stroke:#696972;stroke-width:2}.checkout-node{position:absolute;width:224px;min-height:104px;padding:15px 17px;text-align:left;background:#2d2d32;border:1px solid #515158;border-radius:4px;box-shadow:6px 6px 0 #111114}.checkout-node small,.checkout-node strong,.checkout-node span{display:block}.checkout-node strong{margin:13px 0 10px}.checkout-node span{font:10px ui-monospace,monospace;color:var(--muted)}.checkout-node.status-passed{border-left:5px solid var(--ok)}.checkout-node.status-running{border-color:var(--accent)}.checkout-node.status-ready{border-left:5px solid var(--warning)}.checkout-node.status-failed{border-left:5px solid var(--danger)}.checkout-node.status-blocked{opacity:.62}.node-io-panel,.agent-interactions{margin-top:18px;padding:20px;border:1px solid var(--line);background:#1d1d20}.io-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line)}.io-grid>section{min-width:0;padding:18px;background:#202024}.io-grid h4{margin-top:0;text-transform:uppercase;font-size:10px;letter-spacing:.12em;color:#91dc7c}.io-grid pre{max-height:260px;overflow:auto;white-space:pre-wrap;background:#151518;padding:13px;font-size:11px}.artifact-path{overflow-wrap:anywhere;color:var(--muted);font:10px ui-monospace,monospace}.agent-interactions>header{display:flex;justify-content:space-between}.agent-question{padding:16px 0;border-top:1px solid var(--line)}.agent-question form{display:grid;grid-template-columns:1fr auto;gap:8px}.agent-question textarea{min-height:72px;padding:11px;background:#17171a;border:1px solid var(--line);color:var(--text);resize:vertical}.agent-answer{padding:12px;border-left:3px solid var(--accent);background:var(--accent-soft)}
44
+ .runs-view{position:absolute;inset:0 0 0 56px;padding:28px 34px;overflow:auto;background:var(--canvas)}.runs-header{display:flex;align-items:end;justify-content:space-between;gap:30px;max-width:1440px;margin:auto}.runs-header h1{margin:5px 0;font-size:32px;letter-spacing:-.04em}.runs-header p{color:var(--muted)}.run-filters{display:flex;align-items:end;gap:7px}.run-filters label{margin:0}.run-filters input,.run-filters select{display:block;max-width:150px;margin-top:6px;padding:10px;border:1px solid var(--line);background:var(--bg);border-radius:3px}.run-search{width:min(300px,32vw)}.run-search input{width:100%;max-width:none}.runs-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:16px;max-width:1440px;margin:22px auto}.run-list,.run-detail{min-height:520px;border:1px solid var(--line);border-radius:4px;background:var(--panel);padding:12px}.run-list-label{display:flex;align-items:center;gap:8px;margin:8px 7px 10px;color:#91dc7c;font:9px ui-monospace,monospace;text-transform:uppercase;letter-spacing:.12em}.run-list-label i{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 0 #28ad0066;animation:active-pulse 1.7s ease-out infinite}.run-list-label.history-label{margin-top:22px;color:var(--muted)}.run-list-empty{padding:8px}.run-row{display:block;width:100%;margin-bottom:7px;padding:16px;text-align:left;background:transparent;border-color:transparent;border-radius:3px}.run-row:hover{background:var(--raised);border-color:#4d4d54}.run-row.active-run-row{background:#28ad000d;border-color:#28ad0066}.run-row strong,.run-row span,.run-row small{display:block}.run-row span{margin:7px 0;color:#91dc7c;font-size:10px;letter-spacing:.04em}.run-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.run-detail{padding:24px;overflow:hidden}.run-detail h2{font-size:26px;margin:5px 0;letter-spacing:-.03em}.timeline p{display:grid;grid-template-columns:180px 1fr;gap:12px;border-top:1px solid var(--line);padding:9px 0}.timeline time{color:var(--muted);font:10px ui-monospace,monospace}.empty-state{padding:50px 22px;text-align:center;color:var(--muted)}@keyframes active-pulse{70%{box-shadow:0 0 0 8px #28ad0000}100%{box-shadow:0 0 0 0 #28ad0000}}
45
+ .checkout-header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.checkout-header .quiet{float:none;margin:0 0 14px -10px}.checkout-actions{display:flex;gap:7px;flex-shrink:0}.checkout-meta{display:flex;gap:16px;padding:13px 0;margin:16px 0;border-block:1px solid var(--line);color:var(--muted);font:10px ui-monospace,monospace}.checkout-canvas{position:relative;width:max(100%,var(--checkout-width));height:var(--checkout-height);min-height:330px;margin:20px 0;overflow:auto;background-color:#1e1e21;background-image:radial-gradient(#414147 1px,transparent 1px);background-size:24px 24px;border:1px solid var(--line)}.checkout-canvas svg{position:absolute;inset:0;width:var(--checkout-width);height:var(--checkout-height);pointer-events:none}.checkout-canvas path{fill:none;stroke:#696972;stroke-width:2}.checkout-node{position:absolute;width:224px;min-height:104px;padding:15px 17px;text-align:left;background:#2d2d32;border:1px solid #515158;border-radius:4px;box-shadow:6px 6px 0 #111114}.checkout-node small,.checkout-node strong,.checkout-node span{display:block}.checkout-node strong{margin:13px 0 10px}.checkout-node span{font:10px ui-monospace,monospace;color:var(--muted)}.checkout-node.status-passed{border-left:5px solid var(--ok)}.checkout-node.status-running{border-color:var(--accent);box-shadow:0 0 0 1px #28ad0055,0 0 24px #28ad0026;animation:running-node 1.7s ease-in-out infinite}.checkout-node.status-ready{border-left:5px solid var(--warning)}.checkout-node.status-failed{border-left:5px solid var(--danger)}.checkout-node.status-blocked{opacity:.62}.node-io-panel,.agent-interactions{margin-top:18px;padding:20px;border:1px solid var(--line);background:#1d1d20}.io-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line)}.io-grid>section{min-width:0;padding:18px;background:#202024}.io-grid h4{margin-top:0;text-transform:uppercase;font-size:10px;letter-spacing:.12em;color:#91dc7c}.io-grid pre{max-height:260px;overflow:auto;white-space:pre-wrap;background:#151518;padding:13px;font-size:11px}.artifact-path{overflow-wrap:anywhere;color:var(--muted);font:10px ui-monospace,monospace}.agent-interactions>header{display:flex;justify-content:space-between}.agent-question{padding:16px 0;border-top:1px solid var(--line)}.agent-question form{display:grid;grid-template-columns:1fr auto;gap:8px}.agent-question textarea{min-height:72px;padding:11px;background:#17171a;border:1px solid var(--line);color:var(--text);resize:vertical}.agent-answer{padding:12px;border-left:3px solid var(--accent);background:var(--accent-soft)}@keyframes running-node{50%{box-shadow:0 0 0 2px #28ad0080,0 0 30px #28ad0040}}
46
46
  .checkout-loop{position:absolute;z-index:0;border:1px dashed #28ad0099;background:#28ad0008;border-radius:8px;pointer-events:none}.checkout-loop b,.checkout-loop span{position:relative;top:-13px;display:inline-block;padding:3px 6px;background:#1b2818;font-size:9px}.checkout-loop span{color:#91dc7c;font-family:ui-monospace,monospace}.checkout-node{z-index:2}
47
47
  .classic-run{margin:20px 0;padding:24px;border:1px solid var(--line);background:#1d1d20}.classic-run h3{margin:8px 0;font-size:18px}.classic-run>p{max-width:720px;color:var(--muted);line-height:1.6}.classic-run .timeline{margin-top:20px}
48
48
  .wide-dialog{width:min(800px,calc(100vw - 40px))}dialog header{display:flex;align-items:flex-start;justify-content:space-between}dialog header h2{margin:4px 0 18px;font-size:24px;letter-spacing:-.03em}dialog header button{border:0;background:transparent;font-size:20px}dialog label{clear:both;font-size:12px;color:#c7c7cd}dialog input,dialog textarea{width:100%;margin:0 0 18px;padding:12px;border:1px solid #4b4b52;border-radius:3px;background:#19191c;font-size:14px;line-height:1.55}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field-grid.thirds{grid-template-columns:repeat(3,1fr)}.criteria-editor{min-height:170px}.advanced-goal{margin:16px 0;padding:16px;border:1px solid var(--line)}.advanced-goal summary{font-weight:650;margin-bottom:12px}.import-preview,.goal-review{margin:14px 0;padding:16px;border:1px solid var(--line);border-radius:3px;background:#1e1e22}.validation-message{color:#ff9999;line-height:1.55}.goal-state{position:relative;overflow:hidden;margin-bottom:18px;padding:12px;border-radius:3px}.goal-state.draft{background:#493817;color:#f4c46b}.goal-state.frozen{background:var(--accent-soft);color:#91dc7c}.goal-state.frozen::after{content:"❄";position:absolute;right:12px;animation:freeze-pop .7s ease-out both}@keyframes freeze-pop{from{opacity:0;transform:scale(2.4) rotate(-25deg)}to{opacity:1;transform:scale(1) rotate(0)}}.muted{color:var(--muted)}