@giamme/forge 0.12.1 → 0.13.1

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +1 -1
  3. package/SKILL.md +29 -12
  4. package/VERSION +1 -1
  5. package/docs/add-ons.md +11 -6
  6. package/docs/artifacts.md +12 -6
  7. package/docs/commands.md +179 -17
  8. package/docs/decomposed-runs.md +13 -5
  9. package/docs/forge-ui.md +14 -4
  10. package/docs/memory.md +2 -1
  11. package/docs/models.md +4 -2
  12. package/docs/reviews.md +49 -20
  13. package/docs/troubleshooting.md +3 -1
  14. package/forge +17 -1
  15. package/package.json +1 -1
  16. package/references/dataset.md +39 -13
  17. package/references/decision-models.md +763 -0
  18. package/references/decompose.md +166 -29
  19. package/references/harnesses.md +10 -3
  20. package/references/planning.md +8 -0
  21. package/references/solo.md +13 -3
  22. package/scripts/forge-artifact.sh +30 -4
  23. package/scripts/forge-config.py +238 -29
  24. package/scripts/forge-contract.py +95 -56
  25. package/scripts/forge-control.py +40 -9
  26. package/scripts/forge-decide.py +6 -0
  27. package/scripts/forge-dispatch.sh +38 -16
  28. package/scripts/forge-fail-first.py +2 -2
  29. package/scripts/forge-gate-addressed.sh +40 -0
  30. package/scripts/forge-gate-message.sh +64 -0
  31. package/scripts/forge-issues.py +321 -33
  32. package/scripts/forge-jev-options.sh +269 -42
  33. package/scripts/forge-lib-attribute.sh +447 -0
  34. package/scripts/forge-lib-gates.sh +32 -0
  35. package/scripts/forge-lib-plans.sh +22 -6
  36. package/scripts/forge-lib-review.sh +22 -17
  37. package/scripts/forge-lib-task.sh +217 -38
  38. package/scripts/forge-lib-verify.sh +45 -8
  39. package/scripts/forge-memory.sh +3 -3
  40. package/scripts/forge-parallel-options.sh +18 -5
  41. package/scripts/forge-parallel.sh +457 -303
  42. package/scripts/forge-plan-check.py +35 -1
  43. package/scripts/forge-pre-review.py +437 -0
  44. package/scripts/forge-prompt.py +25 -5
  45. package/scripts/forge-route.py +2 -2
  46. package/scripts/forge-runtime.py +10 -4
  47. package/scripts/forge-schedule.py +21 -5
  48. package/scripts/forge-shadow.py +2 -2
  49. package/scripts/forge-solo.sh +39 -9
  50. package/scripts/forge-submodules.py +389 -0
  51. package/scripts/forge-ui-options.sh +25 -0
  52. package/scripts/forge_dataset/cli.py +12 -6
  53. package/scripts/forge_dataset/export.py +140 -84
  54. package/scripts/forge_dataset/harvest.py +33 -5
  55. package/scripts/{forge_jev/outcome.py → forge_dataset/states.py} +21 -7
  56. package/scripts/forge_decide/__init__.py +141 -0
  57. package/scripts/forge_decide/budget.py +180 -0
  58. package/scripts/forge_decide/cache.py +66 -0
  59. package/scripts/forge_decide/cli.py +953 -0
  60. package/scripts/forge_decide/doctor.py +270 -0
  61. package/scripts/forge_decide/label_addressed.py +75 -0
  62. package/scripts/forge_decide/label_attribution.py +62 -0
  63. package/scripts/forge_decide/label_coverage.py +81 -0
  64. package/scripts/forge_decide/label_message.py +38 -0
  65. package/scripts/forge_decide/label_prompt.py +139 -0
  66. package/scripts/forge_decide/labels.py +328 -0
  67. package/scripts/forge_decide/metrics.py +125 -0
  68. package/scripts/forge_decide/migrate.py +226 -0
  69. package/scripts/forge_decide/providers.py +292 -0
  70. package/scripts/forge_decide/replay.py +350 -0
  71. package/scripts/forge_decide/report.py +382 -0
  72. package/scripts/forge_decide/resolve.py +397 -0
  73. package/scripts/forge_decide/sites.py +377 -0
  74. package/scripts/forge_jev/__init__.py +202 -104
  75. package/scripts/forge_jev/addressed.py +171 -0
  76. package/scripts/forge_jev/attribution.py +198 -0
  77. package/scripts/forge_jev/cli.py +460 -382
  78. package/scripts/forge_jev/client.py +155 -77
  79. package/scripts/forge_jev/coupling.py +19 -87
  80. package/scripts/forge_jev/coverage.py +303 -0
  81. package/scripts/forge_jev/findings.py +219 -0
  82. package/scripts/forge_jev/gates.py +225 -27
  83. package/scripts/forge_jev/memory.py +65 -4
  84. package/scripts/forge_jev/message.py +134 -0
  85. package/scripts/forge_jev/plan_gates.py +294 -0
  86. package/scripts/forge_jev/questions.py +173 -313
  87. package/scripts/forge_jev/verify.py +130 -104
  88. package/ui/README.md +2 -2
  89. package/ui/docs/api.md +92 -39
  90. package/ui/forge_ui/control.py +71 -14
  91. package/ui/forge_ui/export.py +2 -1
  92. package/ui/forge_ui/models.py +17 -16
  93. package/ui/forge_ui/reader.py +132 -21
  94. package/ui/forge_ui/repos.py +428 -0
  95. package/ui/forge_ui/static/app.js +24 -5
  96. package/ui/forge_ui/static/cloudmodel.js +8 -5
  97. package/ui/forge_ui/static/controls.js +20 -13
  98. package/ui/forge_ui/static/modelstats.js +12 -8
  99. package/ui/forge_ui/static/panel.js +63 -17
  100. package/ui/forge_ui/static/runmodel.js +48 -7
  101. package/ui/forge_ui/static/scene3d.js +2 -15
  102. package/ui/forge_ui/static/settings.js +481 -68
  103. package/ui/forge_ui/static/style.css +56 -9
  104. package/references/jev.md +0 -865
  105. package/scripts/forge_jev/backtest.py +0 -322
  106. package/scripts/forge_jev/corpus.py +0 -156
  107. package/scripts/forge_jev/features.py +0 -24
  108. package/scripts/forge_jev/predict.py +0 -204
  109. package/scripts/forge_jev/review.py +0 -73
  110. package/scripts/forge_jev/routing.py +0 -271
  111. package/scripts/forge_jev/subset.py +0 -123
@@ -106,7 +106,7 @@ window.ForgeApp = (() => {
106
106
  function link(text, key, sel) { const a = el('a', text); a.href = hashFor(key, sel); return a; }
107
107
 
108
108
  const statuses = new Set(['merged', 'pass', 'running', 'pending', 'fail', 'error', 'infra',
109
- 'timeout', 'unknown', 'invalidated', 'blocked', 'interrupted', 'nochanges', 'conflict', 'accepted', 'outdated']);
109
+ 'timeout', 'unknown', 'invalidated', 'blocked', 'interrupted', 'nochanges', 'conflict', 'accepted', 'outdated', 'needs_input']);
110
110
  function chip(value, cls) {
111
111
  const status = String(cls || value || 'unknown').toLowerCase();
112
112
  return el('span', value || '—', 'chip st-' + (statuses.has(status) ? status : 'unknown'));
@@ -207,9 +207,26 @@ window.ForgeApp = (() => {
207
207
  function filteredRuns() {
208
208
  const runs = state.runs.filter(run => RM.matchRun(run, state.mapFilter, wall())), byTime = (a, b) => (b.updated || 0) - (a.updated || 0);
209
209
  if (state.runSort === 'state') return runs.sort((a, b) => STATE_ORDER[RM.runState(a)] - STATE_ORDER[RM.runState(b)] || byTime(a, b));
210
- if (state.runSort === 'repo') return runs.sort((a, b) => RM.basename(a.repo).localeCompare(RM.basename(b.repo)) || byTime(a, b));
210
+ if (state.runSort === 'repo') return runs.sort((a, b) => RM.compareRepo(a, b) || byTime(a, b));
211
211
  return runs.sort(byTime);
212
212
  }
213
+ // The repository's name, and — when the run started in a worktree — that checkout as secondary text.
214
+ // The worktree is "leaf (branch)": the leaf truncates first, the branch keeps its place. The title is the full path
215
+ // and, on a second line, the full branch, since the branch can be truncated on screen.
216
+ // No worktree: the name span alone, as before.
217
+ function appendRepo(parent, run) {
218
+ const label = RM.repoLabel(run);
219
+ const name = el('span', label.name, 'repo');
220
+ if (!label.worktree) { parent.append(name); return; }
221
+ const line = el('span', undefined, 'repo-line');
222
+ const wt = el('span', undefined, 'muted repo-wt');
223
+ const branch = typeof run.repo_branch === 'string' ? run.repo_branch.trim() : '';
224
+ wt.title = run.repo_worktree + (branch ? `\nbranch ${branch}` : '');
225
+ const at = branch ? label.worktree.length - branch.length - 3 : label.worktree.length; // " (" and ")" around the branch
226
+ wt.append(el('span', label.worktree.slice(0, at), 'repo-leaf'), el('span', label.worktree.slice(at), 'repo-branch'));
227
+ line.append(name, document.createTextNode(' · '), wt);
228
+ parent.append(line);
229
+ }
213
230
  function renderList() {
214
231
  const runs = filteredRuns();
215
232
  $('run-count').textContent = `${runs.length}/${state.runs.length}`;
@@ -238,7 +255,8 @@ window.ForgeApp = (() => {
238
255
  const updated = el('span', relative(run.updated).replace(/^updated /, ''), 'updated');
239
256
  if (run.updated != null) { updated.dataset.epoch = run.updated; updated.dataset.short = ''; }
240
257
  updated.title = time(run.updated);
241
- sub.append(el('span', RM.basename(run.repo), 'repo'), el('span', run.run_id, 'mono'), updated);
258
+ appendRepo(sub, run);
259
+ sub.append(el('span', run.run_id, 'mono'), updated);
242
260
  item.append(lamp, goal, sub);
243
261
  if (solo) item.append(el('span', 'solo', 'tag'));
244
262
  const counts = el('div', undefined, 'chips');
@@ -593,7 +611,7 @@ window.ForgeApp = (() => {
593
611
  ['labels', 'Readouts', 'The status line on the front of each block'], ['beacons', 'Findings', 'A mark over the block per review finding, shaped by its severity'],
594
612
  ['finish', 'Finish line', 'Integration, verification and the final review'], ['districts', 'Districts', 'The wave and repository names on the plate'],
595
613
  ['halos', 'Halos', 'The glow under running and chosen blocks'], ['route', 'Route', 'A chosen task keeps its route lit: what it waits on and what waits on it (I)']], 'layer');
596
- bankOf('Marks', [['critical', 'Critical path', 'The chain of dependencies that bounded the wall time'], ['arcs', 'Review marks', 'Shadow disagreements and Clef rings'],
614
+ bankOf('Marks', [['critical', 'Critical path', 'The chain of dependencies that bounded the wall time'], ['arcs', 'Review marks', 'Shadow disagreements'],
597
615
  ['ghosts', 'Projected', 'Where the tasks that have not started would run, by forge-schedule\'s rules']], 'ov');
598
616
  ov.addEventListener('click', e => {
599
617
  const b = e.target.closest('.layer-key'); if (!b) return;
@@ -729,7 +747,8 @@ window.ForgeApp = (() => {
729
747
  const lamp = el('i', undefined, 'lamp st-' + LAMP[RM.runState(run)]);
730
748
  const title = el('h2', String(run.goal || 'Untitled run').split('\n')[0]); title.title = run.goal || '';
731
749
  const where = el('span', undefined, 'run-where'); where.title = `${run.repo || ''}\n${run.run_id || ''}`;
732
- where.append(el('span', RM.basename(run.repo), 'repo'), document.createTextNode(' '), el('span', run.run_id, 'mono'));
750
+ appendRepo(where, run);
751
+ where.append(el('span', run.run_id, 'mono'));
733
752
  if (solo) where.append(document.createTextNode(' · solo run'));
734
753
  // the describer: each state's count, the wall time so far, and how long since anything moved
735
754
  const desc = el('span', undefined, 'describer');
@@ -25,7 +25,7 @@
25
25
  };
26
26
  const DIFFS = ['low', 'medium', 'high'];
27
27
 
28
- // FNV-1a: a short stable id for a project (its repo path)
28
+ // FNV-1a: a short stable id for a project (its repository root)
29
29
  function hashId(s) {
30
30
  let h = 0x811c9dc5;
31
31
  for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 0x01000193) >>> 0; }
@@ -35,11 +35,13 @@
35
35
  const startOf = r => num(r.created) ?? num(r.updated) ?? 0;
36
36
 
37
37
  /* ---------- projects and per-run facts ---------- */
38
+ // a run's project is its repository root (RM.repoKey), so a run started from a worktree joins its repository's project
39
+ const projectId = r => hashId(RM.repoKey(r) || '?');
38
40
  function projects(runs) {
39
41
  const by = new Map();
40
42
  for (const r of list(runs)) {
41
- const repo = r.repo || '?', id = hashId(repo);
42
- if (!by.has(id)) by.set(id, { id, repo: r.repo || null, name: RM.basename(r.repo), keys: [], first: Infinity, last: -Infinity, count: 0 });
43
+ const id = projectId(r), key = RM.repoKey(r);
44
+ if (!by.has(id)) by.set(id, { id, repo: key, name: RM.basename(key), keys: [], first: Infinity, last: -Infinity, count: 0 });
43
45
  const p = by.get(id), t = startOf(r);
44
46
  p.keys.push(r.key); p.count++; p.first = Math.min(p.first, t); p.last = Math.max(p.last, num(r.updated) ?? t);
45
47
  }
@@ -61,7 +63,7 @@
61
63
  if (state === 'live' && num(now) !== null && num(run.updated) !== null && now - run.updated > 7200) state = 'stale';
62
64
  const n = Math.max(1, num(run.task_count) || tasks.length || 1);
63
65
  const aliases = specs => new Set(list(specs).map(RM.alias).filter(Boolean));
64
- return { key: run.key, run, project: hashId(run.repo || '?'), n, bucket: bucket(n), diff, dominant, state, t: startOf(run),
66
+ return { key: run.key, run, project: projectId(run), checkout: hashId(run.repo || '?'), n, bucket: bucket(n), diff, dominant, state, t: startOf(run),
65
67
  dwarf: aliases(run.dwarf_models || run.models), qa: aliases(run.qa_models || []), all: aliases(run.models),
66
68
  review: RM.runReviewStatus(run) || null, verification: run.verification_status || null, decompose: run.decompose_level || null, kind: run.kind };
67
69
  }
@@ -89,7 +91,8 @@
89
91
  const hay = [r.goal, r.repo, r.run_id, r.path, ...list(r.models), ...list(r.task_statuses).flatMap(t => [t.id, t.title])];
90
92
  if (!hay.some(v => String(v || '').toLowerCase().includes(text))) return false;
91
93
  }
92
- if (f.projects.length && !f.projects.includes(fact.project)) return false;
94
+ // a saved project may be the checkout a run started in (a worktree, before it joined its root): the run still matches it
95
+ if (f.projects.length && !f.projects.includes(fact.project) && !f.projects.includes(fact.checkout)) return false;
93
96
  if (f.states.length && !f.states.includes(fact.state)) return false;
94
97
  if (f.kinds.length && !f.kinds.includes(fact.kind)) return false;
95
98
  if (f.difficulty.levels.length) {
@@ -13,6 +13,7 @@
13
13
  'use strict';
14
14
 
15
15
  const LEVELS = ['P0', 'P1', 'P2', 'P3'];
16
+ const DEFAULT_LEVEL = 'P2'; // scripts/forge-contract.py DEFAULT_THRESHOLD
16
17
  const EFFORTS = ['default', 'low', 'medium', 'high', 'xhigh', 'max'];
17
18
  const MAX_FIELD = 256; // control.py: a body string is at most this long
18
19
  const LIVE_ONLY = 'only while a run is in progress';
@@ -31,7 +32,7 @@
31
32
  };
32
33
  const BACKOFF_FORMS = 'exp:<base>[,<cap>], linear:<start>,<step>[,<cap>] or list:<a>,<b>,… (seconds)';
33
34
  // A task status after which "Retry now" applies (or the policy stopped it).
34
- const RETRYABLE = ['FAIL', 'UNKNOWN', 'TIMEOUT', 'ERROR', 'INTERRUPTED', 'BLOCKED'];
35
+ const RETRYABLE = ['FAIL', 'UNKNOWN', 'TIMEOUT', 'ERROR', 'INTERRUPTED', 'BLOCKED', 'INVALIDATED']; // scripts/forge-schedule.py RETRYABLE; NEEDS_INPUT is in neither list
35
36
 
36
37
  const obj = v => v && typeof v === 'object' && !Array.isArray(v) ? v : {};
37
38
  const num = v => typeof v === 'number' && Number.isFinite(v) ? v : null;
@@ -83,7 +84,8 @@
83
84
  if (task && info.planOnly) return bad(`${info.label} applies to the whole run, not a task`);
84
85
  const text = String(input === undefined || input === null ? '' : input).trim();
85
86
  if (key === 'qa-threshold') {
86
- return LEVELS.includes(text) || text === 'none' || (task && text === 'inherit') ? { ok: true, value: text } : bad('P0, P1, P2, P3 or none');
87
+ return LEVELS.includes(text) || text === 'none' || (task ? text === 'inherit' : text === 'default') ? { ok: true, value: text }
88
+ : bad(task ? 'P0, P1, P2, P3, none or inherit' : 'P0, P1, P2, P3, none or default');
87
89
  }
88
90
  if (task && key === 'retry-budget' && text === 'inherit') return { ok: true, value: 'inherit' };
89
91
  if (key === 'max-parallel') {
@@ -115,7 +117,8 @@
115
117
  }
116
118
 
117
119
  const shown = (key, value, task) => key === 'timeout' ? `${minutesOf(Number(value))} min`
118
- : key === 'qa-threshold' && value === 'none' && task ? 'none (no threshold for this task)'
120
+ : key === 'qa-threshold' && value === 'none' ? (task ? 'P3 for this task' : 'P3 (nothing tolerated)')
121
+ : key === 'qa-threshold' && value === 'default' ? 'the default (P2)'
119
122
  : key === 'infra-backoff' && value === 'none' ? 'the default (exp:60)' : value;
120
123
  const inTask = task => task ? ` for task \`${task}\`` : '';
121
124
 
@@ -172,7 +175,9 @@
172
175
  function runValues(controls) {
173
176
  const c = obj(controls), run = obj(c.run);
174
177
  return { live: c.live === true, fractal: c.fractal === true,
175
- qa: LEVELS.includes(run.qa_threshold) ? run.qa_threshold : 'none',
178
+ qa: LEVELS.includes(run.qa_threshold) ? run.qa_threshold : run.qa_threshold === 'none' ? 'P3' : DEFAULT_LEVEL,
179
+ qaSource: run.qa_threshold_source === 'set' ? 'set' : 'default',
180
+ qaText: `${LEVELS.includes(run.qa_threshold) ? run.qa_threshold : run.qa_threshold === 'none' ? 'P3' : DEFAULT_LEVEL} (${run.qa_threshold_source === 'set' ? 'set' : 'default'})`,
176
181
  timeout: num(run.timeout), timeoutMin: minutesOf(run.timeout),
177
182
  escalateAfter: num(run.escalate_after), verifyRetries: num(run.verify_retries),
178
183
  retryBudget: num(run.retry_budget), infraBudget: num(run.infra_budget),
@@ -211,16 +216,17 @@
211
216
  }
212
217
  const requestText = st => st.state === 'refused' ? `refused${st.reason ? ': ' + st.reason : ''}` : st.state;
213
218
  // Whether "Retry now" shows for a task: live only, after it ended without passing or once the policy stopped it.
219
+ // Never for a task waiting for an answer: forge refuses a retry without one (retry --answer).
214
220
  const canRetry = (controls, id) => {
215
221
  const c = obj(controls), v = taskValues(c, id);
216
- return c.live === true && v.known && v.status !== 'MERGED' && (RETRYABLE.includes(v.status) || v.stop);
222
+ return c.live === true && v.known && v.status !== 'MERGED' && v.status !== 'NEEDS_INPUT' && (RETRYABLE.includes(v.status) || v.stop);
217
223
  };
218
224
  // A task's controls with the effective value of each: an override wins, else the run's value is inherited.
219
225
  function taskValues(controls, id) {
220
226
  const c = obj(controls), t = obj(obj(c.tasks)[id]), run = runValues(c);
221
227
  const level = t.qa_threshold;
222
228
  const threshold = LEVELS.includes(level) ? { mode: level, effective: level, from: 'task' }
223
- : level === 'none' ? { mode: 'none', effective: 'none', from: 'task' }
229
+ : level === 'none' ? { mode: 'none', effective: 'P3', from: 'task' }
224
230
  : { mode: 'inherit', effective: run.qa, from: 'run' };
225
231
  const own = num(t.retry_budget), eff = own !== null ? own : run.retryBudget;
226
232
  return { id, known: !!c.tasks && id in c.tasks, status: typeof t.status === 'string' ? t.status : 'PENDING',
@@ -505,7 +511,8 @@
505
511
 
506
512
  function levelRow(view, c, o) {
507
513
  const r = shell(view, o.key, o.label, false), perm = o.perm;
508
- const options = (o.inherit ? [{ value: 'inherit', label: 'Inherit', title: "Use the run's threshold" }] : [])
514
+ const options = (o.inherit ? [{ value: 'inherit', label: 'Inherit', title: "Use the run's threshold" }]
515
+ : [{ value: 'default', label: 'Default', title: 'Remove the setting: the default (P2) applies' }])
509
516
  .concat(LEVELS.map(l => ({ value: l, label: l })), [{ value: 'none', label: 'None', title: o.noneTitle }]);
510
517
  r.control.append(bank(r, options, o.current, perm.enabled, (value, button) => {
511
518
  if (value !== o.current) commit(view, r, { kind: 'set', key: 'qa-threshold', input: value, task: o.task }, [], button);
@@ -540,9 +547,9 @@
540
547
  body.append(runKeys(view, c));
541
548
  if (v.pauses.length) body.append(pauseBox(view, c));
542
549
  }
543
- body.append(levelRow(view, c, { key: 'qa-threshold', label: 'QA threshold', current: v.qa, perm: perm('qa-threshold'),
544
- help: v.qa === 'none' ? 'The least severe finding that still blocks: no threshold is set.'
545
- : `The least severe finding that still blocks: ${v.qa} (${LEVELS.slice(0, LEVELS.indexOf(v.qa) + 1).join(', ')} block).`, noneTitle: 'No threshold' }));
550
+ body.append(levelRow(view, c, { key: 'qa-threshold', label: 'QA threshold', current: v.qaSource === 'set' ? v.qa : 'default', perm: perm('qa-threshold'),
551
+ help: `The least severe finding that still blocks: ${v.qaText} (${LEVELS.slice(0, LEVELS.indexOf(v.qa) + 1).join(', ')} block).`,
552
+ noneTitle: 'P3: nothing is tolerated' }));
546
553
  body.append(countRow(view, c, { key: 'timeout', label: 'Timeout', unit: 'minutes', decimal: true, value: v.timeoutMin, placeholder: 'default', perm: perm('timeout'),
547
554
  help: v.timeoutMin === null ? "Not set: each model's own limit applies. 0 turns the limit off." : `Each model call stops after ${v.timeoutMin} min. 0 turns the limit off.` }));
548
555
  body.append(countRow(view, c, { key: 'escalate-after', label: 'Escalate after', unit: 'failures', value: v.escalateAfter, perm: perm('escalate-after'),
@@ -571,9 +578,9 @@
571
578
  if (v.status === 'MERGED') { body.append(u.el('p', 'Merged: there is nothing left to change for this task.', 'muted ctl-note')); return body; }
572
579
  const th = v.threshold, task = id;
573
580
  body.append(levelRow(view, c, { key: 'qa-threshold', label: 'Threshold override', inherit: true, task, current: th.mode, perm: canEdit(c, 'qa-threshold', id),
574
- noneTitle: 'No threshold for this task',
575
- help: th.mode === 'inherit' ? `Inherits ${v.run.qa === 'none' ? 'no threshold' : v.run.qa} from the run.`
576
- : th.mode === 'none' ? 'No threshold for this task, whatever the run sets.' : `${th.mode} for this task, whatever the run sets.` }));
581
+ noneTitle: 'P3 for this task: nothing is tolerated',
582
+ help: th.mode === 'inherit' ? `Inherits ${v.run.qa} from the run.`
583
+ : th.mode === 'none' ? 'P3 for this task, whatever the run sets.' : `${th.mode} for this task, whatever the run sets.` }));
577
584
  const rb = v.retry, used = rb.effective === null ? `used ${rb.used}` : `used ${rb.used} of ${rb.effective}`;
578
585
  body.append(countRow(view, c, { key: 'retry-budget', label: 'Retry budget', unit: 'retries', task, value: rb.own, placeholder: rb.effective === null ? 'inherit' : String(rb.effective),
579
586
  inherit: rb.mode === 'inherit' ? 'pressed' : 'ready', perm: canEdit(c, 'retry-budget', id),
@@ -59,15 +59,17 @@
59
59
  function inPeriod(created, f, now) {
60
60
  return !f.days || num(now) === null || (num(created) !== null && created >= now - f.days * DAY);
61
61
  }
62
- // a run's own facts (repo, kind, created): from its task rows, else from the run summaries
62
+ // a run's own facts (repo, repo_root, kind, created): from its task rows, else from the run summaries
63
63
  function runIndex(data, runs) {
64
64
  const by = new Map();
65
- for (const t of list(data.tasks)) if (obj(t) && t.run && !by.has(t.run)) by.set(t.run, { repo: t.repo || null, kind: t.kind || null, created: num(t.created) });
66
- for (const r of list(runs)) if (obj(r) && r.key && !by.has(r.key)) by.set(r.key, { repo: r.repo || null, kind: r.kind || null, created: num(r.created) });
65
+ for (const t of list(data.tasks)) if (obj(t) && t.run && !by.has(t.run)) by.set(t.run, { repo: t.repo || null, repo_root: t.repo_root || null, kind: t.kind || null, created: num(t.created) });
66
+ for (const r of list(runs)) if (obj(r) && r.key && !by.has(r.key)) by.set(r.key, { repo: r.repo || null, repo_root: r.repo_root || null, kind: r.kind || null, created: num(r.created) });
67
67
  return by;
68
68
  }
69
+ // a project is a repository root; a saved project that names the checkout a row started in still matches that row
70
+ const inProject = (row, project) => !project || RM.repoKey(row) === project || row.repo === project;
69
71
  function taskMatch(t, f, now) {
70
- if (f.project && t.repo !== f.project) return false;
72
+ if (!inProject(t, f.project)) return false;
71
73
  if (f.difficulty && diffOf(t) !== f.difficulty) return false;
72
74
  if (f.kind && t.kind !== f.kind) return false;
73
75
  if (!inPeriod(t.created, f, now)) return false;
@@ -81,8 +83,9 @@
81
83
  if (t) return taskMatch(t, f, now);
82
84
  }
83
85
  if (f.difficulty || f.exploratoryOnly) return false;
84
- const r = runs.get(v.run) || {};
85
- if (f.project && r.repo !== f.project) return false;
86
+ // no run summary loaded yet: the review row's own repo_root (reviews carry no repo) still names the project
87
+ const r = runs.get(v.run) || { repo_root: v.repo_root || null };
88
+ if (!inProject(r, f.project)) return false;
86
89
  if (f.kind && r.kind !== f.kind) return false;
87
90
  return inPeriod(r.created, f, now);
88
91
  }
@@ -101,7 +104,8 @@
101
104
  const repos = new Map(), diff = {}, kinds = {}, aliases = new Set();
102
105
  let first = null, last = null, explored = 0;
103
106
  for (const t of tasks) {
104
- if (t.repo) repos.set(t.repo, (repos.get(t.repo) || 0) + 1);
107
+ const key = RM.repoKey(t);
108
+ if (key) repos.set(key, (repos.get(key) || 0) + 1);
105
109
  const d = diffOf(t); diff[d] = (diff[d] || 0) + 1;
106
110
  if (t.kind) kinds[t.kind] = (kinds[t.kind] || 0) + 1;
107
111
  const c = num(t.created);
@@ -114,7 +118,7 @@
114
118
  for (const v of list(data.reviews)) {
115
119
  if (!obj(v)) continue;
116
120
  const x = aliasOf(v); if (x) aliases.add(x);
117
- const r = idx.get(v.run); if (r && r.repo && !repos.has(r.repo)) repos.set(r.repo, 0);
121
+ const key = RM.repoKey(idx.get(v.run) || v); if (key && !repos.has(key)) repos.set(key, 0);
118
122
  }
119
123
  return {
120
124
  projects: projectNames(repos),
@@ -10,7 +10,7 @@ window.ForgePanel = (() => {
10
10
  const num = v => typeof v === 'number' && Number.isFinite(v) ? v : null;
11
11
  const display = v => v === null || v === undefined || v === '' ? '—' : typeof v === 'object' ? JSON.stringify(v, null, 2) : String(v);
12
12
  const STATUSES = new Set(['merged', 'pass', 'running', 'pending', 'fail', 'error', 'infra', 'timeout', 'unknown', 'invalidated', 'blocked',
13
- 'interrupted', 'nochanges', 'conflict', 'accepted', 'none', 'outdated']);
13
+ 'interrupted', 'nochanges', 'conflict', 'accepted', 'none', 'outdated', 'needs_input', 'waiting']);
14
14
  const cache = new Map(); // path → {data, error, at}
15
15
  function el(tag, text, className) {
16
16
  const node = document.createElement(tag);
@@ -86,6 +86,31 @@ window.ForgePanel = (() => {
86
86
  const s = section(host, 'Controls');
87
87
  muted(s, 'Read-only: this page cannot change the run.');
88
88
  }
89
+ // A task that stopped NEEDS_INPUT: the question it asked, and the command that answers it. forge-ui shows the
90
+ // command and never runs it; only the user's answer, passed to retry, resumes the task.
91
+ const shellWord = s => /^[\w@%+=:,./-]+$/.test(s) ? s : "'" + String(s).replace(/'/g, "'\\''") + "'";
92
+ function waitingSection(host, ctx, task) {
93
+ const s = section(host, 'Waiting for you');
94
+ muted(s, 'This task stopped for an answer only you can give. Nothing retries it until you answer.');
95
+ s.append(el('pre', task.needs_input != null ? task.needs_input : `The question is not recorded: tasks/${task.id}/needs_input.md is missing.`));
96
+ if (ctx.run.kind === 'solo') return;
97
+ const plan = ctx.run.path ? shellWord(ctx.run.path) : '<plan>';
98
+ const text = `forge-parallel.sh retry ${plan} ${shellWord(task.id)} --answer "…"`;
99
+ const copy = el('button', 'Copy command'); copy.type = 'button';
100
+ copy.addEventListener('click', async () => {
101
+ try { await navigator.clipboard.writeText(text); copy.textContent = 'Copied'; }
102
+ catch (_) { copy.textContent = 'Copy failed: select the command instead'; }
103
+ });
104
+ const line = el('div', undefined, 'waiting-cmd');
105
+ line.append(el('pre', text, 'cmd'), copy);
106
+ s.append(line);
107
+ }
108
+ // An attempt's chip. A failed attempt is red whatever its words; a send-back says what forge did in its title.
109
+ function attemptChip(word) {
110
+ const c = chip(word, RM.attemptFailed(word) ? 'fail' : undefined), note = RM.attemptNote(word);
111
+ if (note) c.title = note;
112
+ return c;
113
+ }
89
114
  // a link into the diff viewer (ctx.diffHash is absent where there is no viewer)
90
115
  function diffLink(ctx, text, spec, cls = 'diff-link') { if (!ctx.diffHash) return null; const a = el('a', text, cls); a.href = ctx.diffHash(spec); return a; }
91
116
  // a lazy resource: returns cached data, or starts the fetch and re-renders when it lands
@@ -154,6 +179,32 @@ window.ForgePanel = (() => {
154
179
  box.append(ul);
155
180
  parent.append(box);
156
181
  }
182
+ // forge's own run of the tests the attempt affects, before its review (opt-in plan --pre-review-tests).
183
+ const PRE_REVIEW = { passed: ['passed', 'pass'], flaky: ['flaky: passed when rerun alone', 'unknown'],
184
+ 'pre-existing': ['failing already on the task base', 'unknown'], failed: ['failed: sent back without a review', 'fail'],
185
+ skipped: ['skipped', 'unknown'], error: ['could not run', 'unknown'] };
186
+ function preReview(parent, pr) {
187
+ if (!pr) return;
188
+ const box = el('div', undefined, 'review');
189
+ const h = el('div', undefined, 'attempt-head');
190
+ const [label, cls] = PRE_REVIEW[pr.status] || [pr.status, 'unknown'];
191
+ h.append(el('strong', 'forge pre-review tests'), chip(label, cls));
192
+ if (typeof pr.seconds === 'number') h.append(el('span', `${pr.seconds.toFixed(1)}s`, 'muted'));
193
+ box.append(h);
194
+ if (pr.reason) muted(box, pr.reason);
195
+ if (pr.command) box.append(el('p', pr.command, 'mono muted'));
196
+ const ul = el('ul', undefined, 'findings');
197
+ for (const path of list(pr.selected)) {
198
+ const li = el('li');
199
+ li.append(el('span', path, 'mono'));
200
+ if (list(pr.failing).includes(path)) li.append(document.createTextNode(' '), chip('fails', 'fail'));
201
+ else if (list(pr.preexisting).includes(path)) li.append(document.createTextNode(' '), chip('fails on the base too', 'unknown'));
202
+ ul.append(li);
203
+ }
204
+ if (ul.childNodes.length) box.append(ul);
205
+ if (pr.status === 'failed' && pr.tail) box.append(el('pre', pr.tail, 'mono'));
206
+ parent.append(box);
207
+ }
157
208
  function findingsList(parent, findings, key) {
158
209
  if (findings === null || findings === undefined) { muted(parent, 'Findings could not be parsed (forge-contract.py was not available to the server).'); return; }
159
210
  if (!findings.length) { muted(parent, 'The reviewer reported no findings in the expected `- [P1][CONFIRMED] file:line — …` form.'); return; }
@@ -170,9 +221,11 @@ window.ForgePanel = (() => {
170
221
  });
171
222
  parent.append(ul);
172
223
  }
224
+ const gateChip = decision => decision === 'accept' ? chip('accept', 'pass')
225
+ : decision === 'fail' ? chip('forge: FAIL (reviewer said PASS)', 'fail') : chip(decision || '—', 'unknown');
173
226
  function gateLine(parent, gate) {
174
227
  if (!gate) return;
175
- fields(parent, [['Blocking threshold', gate.threshold], ['Gate decision', gate.decision === 'accept' ? chip('accept', 'pass') : chip(gate.decision || '—', 'unknown')],
228
+ fields(parent, [['Blocking threshold', gate.threshold], ['Gate decision', gateChip(gate.decision)],
176
229
  ['Worst confirmed', gate.worst], ['Confirmed / unlabelled / tolerated', `${display(gate.n_confirmed)} / ${display(gate.n_unlabelled)} / ${display(gate.n_below)}`]]);
177
230
  }
178
231
 
@@ -207,7 +260,7 @@ window.ForgePanel = (() => {
207
260
  const s = section(host, 'Settings');
208
261
  fields(s, [['Repo', midPath(run.repo), true], ['Run ID', run.run_id, true], ['Path', midPath(run.path), true], ['Source', run.source],
209
262
  ['Decompose', run.decompose_level], ['Updated', time(run.updated)], ['Explore', run.settings && run.settings.explore], ['Shadow rate', run.settings && run.settings.shadow_rate],
210
- ['Shadow reviewers', run.settings && plates(list(run.settings.shadow_qa))], ['QA threshold', run.settings && run.settings.qa_threshold],
263
+ ['Shadow reviewers', run.settings && plates(list(run.settings.shadow_qa))], ['QA threshold', run.settings && run.settings.qa_threshold && run.settings.qa_threshold + (run.settings.qa_threshold_source === 'default' ? ' (default)' : '')],
211
264
  ['Max parallel', run.settings && run.settings.max_parallel], ['Final reviewer', run.settings && run.settings.final_qa ? plate(run.settings.final_qa) : undefined],
212
265
  ['Timeout (seconds)', run.settings && run.settings.timeout], ['Verification', chip((run.verification && run.verification.status) || run.verification_status)],
213
266
  ['Command', run.verification && run.verification.command, true]]);
@@ -252,6 +305,8 @@ window.ForgePanel = (() => {
252
305
  fields(f, [['Integration', link(`${F.integration.merged}/${F.integration.total} merged`, ctx.hash({ kind: 'integration' }), () => ctx.onSelect({ kind: 'integration' }))],
253
306
  ['Verification', link(F.verification.status, ctx.hash({ kind: 'verification' }), () => ctx.onSelect({ kind: 'verification' }))],
254
307
  ['Final review', finalValue]]);
308
+ const attribution = RM.attributionLine(run.attribution);
309
+ if (attribution) f.append(el('p', attribution, 'warn'));
255
310
  if (F.final.status === 'OUTDATED') muted(f, RM.reviewSinceLine(F.final));
256
311
  if (F.final.findings) findingCounts(f, F.final.findings);
257
312
  const sweep = RM.sweepLine(run.sweep);
@@ -308,6 +363,7 @@ window.ForgePanel = (() => {
308
363
  head.append(chips);
309
364
  const dl = diffLink(ctx, solo ? 'View the diff →' : 'View its diff, findings pinned to their lines →', { kind: 'task', task: task.id, source: 'current' }); if (dl) head.append(dl);
310
365
  host.append(head);
366
+ if (RM.isWaiting(task.status)) waitingSection(host, ctx, task);
311
367
  if (!solo) fields(host, [['Difficulty', task.difficulty], ['Depends on', depLinks(task.deps, ctx)], ['Files', list(task.files).join('\n') || '—', true], ['Branch', task.branch, true]]);
312
368
  if (C) C.nowSection(host, ctx, task);
313
369
  sweepSection(host, ctx, task);
@@ -340,7 +396,7 @@ window.ForgePanel = (() => {
340
396
  for (const z of tp.zones) {
341
397
  const box = el('div', undefined, 'attempt');
342
398
  const row = list(task.attempts).filter(a => a.attempt === z.attempt).pop();
343
- const h = el('div', undefined, 'attempt-head'); h.append(el('strong', z.name.toLowerCase())); if (row) h.append(chip(RM.attemptStatus(task, row.attempt, row.status)), el('span', time(row.at), 'muted'));
399
+ const h = el('div', undefined, 'attempt-head'); h.append(el('strong', z.name.toLowerCase())); if (row) h.append(attemptChip(RM.attemptStatus(task, row.attempt, row.status)), el('span', time(row.at), 'muted'));
344
400
  box.append(h);
345
401
  for (const pid of z.parts) {
346
402
  const p = tp.parts.find(x => x.id === pid); if (!p || p.planned) continue;
@@ -378,6 +434,7 @@ window.ForgePanel = (() => {
378
434
  gateLine(rs, task.gate);
379
435
  findingCounts(rs, task.findings);
380
436
  failFirst(rs, task.fail_first);
437
+ preReview(rs, task.pre_review);
381
438
  const detail = lazy(ctx, `/api/runs/${encodeURIComponent(run.key)}/tasks/${encodeURIComponent(task.id)}`, run.updated);
382
439
  if (!loading(rs, detail, 'the full findings')) {
383
440
  const reviews = list(detail.data.reviews);
@@ -392,19 +449,6 @@ window.ForgePanel = (() => {
392
449
  rs.append(box);
393
450
  });
394
451
  }
395
- // Clef: what was predicted, against what happened
396
- const clef = task.clef || {};
397
- const preds = [];
398
- if (clef.first_pass) preds.push(['First attempt', clef.first_pass]);
399
- for (const [a, p] of Object.entries(clef.retry_pass || {})) preds.push([`Retry · attempt ${a}`, p]);
400
- if (preds.length) {
401
- const cs = section(host, 'Clef predictions');
402
- for (const [label, p] of preds) {
403
- const n = Number(String(label).match(/\d+/) || 1), outcome = list(task.attempts).filter(a => a.attempt === n).pop();
404
- const happened = outcome ? RM.attemptStatus(task, outcome.attempt, outcome.status) : 'not finished';
405
- fields(cs, [[label, `p(pass) = ${display(p.p)} → ${happened}`], ['Assignment', p.assignment ? plates([p.assignment.dwarf, p.assignment.qa]) : '—']]);
406
- }
407
- }
408
452
  // the prompts and the final messages
409
453
  const ps = section(host, 'Prompts and output');
410
454
  if (!detail.data) details(ps, 'Requirements (prompt.md)', task.prompt, `task-${task.id}-prompt`);
@@ -600,6 +644,8 @@ window.ForgePanel = (() => {
600
644
  const head = el('div', undefined, 'insp-head');
601
645
  head.append(el('h2', 'Verification'), el('div', 'finish', 'insp-kind'), chip(v && v.status || 'pending'));
602
646
  host.append(head);
647
+ const attribution = RM.attributionLine(run.attribution);
648
+ if (attribution) host.append(el('p', attribution, 'warn'));
603
649
  if (!v) { muted(host, 'Verification has not run: it runs after every task is merged into the integration branch.'); return; }
604
650
  if (window.ForgeVerify) window.ForgeVerify.render(host, ctx); // live state, lanes and failing tests
605
651
  fields(host, [['Command', v.command, true], ['Commit', v.commit, true]]);
@@ -15,10 +15,29 @@
15
15
  const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
16
16
  const DONE = new Set(['MERGED', 'PASS', 'NOCHANGES']);
17
17
  const BAD = new Set(['FAIL', 'ERROR', 'CONFLICT', 'INFRA', 'TIMEOUT', 'INVALIDATED', 'INTERRUPTED', 'UNKNOWN', 'BLOCKED']);
18
+ // NEEDS_INPUT: stopped for an answer only the user can give. Neither DONE nor BAD, so never a failure.
19
+ const WAITING = new Set(['NEEDS_INPUT']);
20
+ const isWaiting = status => WAITING.has(status);
18
21
  const WEIGHT = { low: 1, medium: 2, high: 3 };
19
22
  const weight = t => WEIGHT[String(t && t.difficulty || '').toLowerCase()] || 2;
20
23
  const alias = spec => spec ? String(spec).split(':')[0] : null;
21
24
  const basename = p => p ? String(p).split(/[\\/]/).filter(Boolean).pop() || String(p) : '—';
25
+ // What a run (or a models row) is grouped under: its repository root, else the checkout it started in (an older server).
26
+ const repoKey = run => (run && (run.repo_root || run.repo)) || null;
27
+ // The run list's "by repo" order: the name of each run's repository root.
28
+ const compareRepo = (a, b) => basename(repoKey(a)).localeCompare(basename(repoKey(b)));
29
+ // What a run shows where its repository is named. `name` is the root's basename. `worktree` is the
30
+ // checkout it started in when that is not the root — "forge-c2 (fix/milestone-c2)", or the basename
31
+ // alone when the branch is unknown — and null for the main checkout. A summary that lacks
32
+ // repo_root, repo_worktree and repo_branch (an older server or export) keeps basename(repo).
33
+ const repoLabel = run => {
34
+ const name = basename(run && (run.repo_root || run.repo));
35
+ const path = run && typeof run.repo_worktree === 'string' ? run.repo_worktree : '';
36
+ if (!path) return { name, worktree: null };
37
+ const branch = typeof run.repo_branch === 'string' ? run.repo_branch.trim() : '';
38
+ const leaf = basename(path);
39
+ return { name, worktree: branch ? `${leaf} (${branch})` : leaf };
40
+ };
22
41
  function fmtDur(s) {
23
42
  s = num(s); if (s === null) return '—';
24
43
  s = Math.max(0, Math.round(s));
@@ -73,6 +92,7 @@
73
92
  }
74
93
 
75
94
  /* ---------- statuses ---------- */
95
+ // A waiting task is in neither set: a run with nothing else left is pending, not failed and not done.
76
96
  function runState(run) {
77
97
  const counts = run && run.counts || {};
78
98
  if (counts.RUNNING) return 'live';
@@ -108,7 +128,8 @@
108
128
  const text = String(f.text || '').trim().toLowerCase();
109
129
  if (text && ![run.goal, run.repo, run.run_id, run.path, ...list(run.models)].some(v => String(v || '').toLowerCase().includes(text))) return false;
110
130
  if (f.state && runState(run) !== f.state) return false;
111
- if (f.repo && run.repo !== f.repo) return false;
131
+ // a saved filter may name the checkout a run started in (a worktree) rather than its root: it still matches that run
132
+ if (f.repo && repoKey(run) !== f.repo && run.repo !== f.repo) return false;
112
133
  if (f.kind && run.kind !== f.kind) return false;
113
134
  if (f.model && !list(run.models).some(m => alias(m) === f.model)) return false;
114
135
  if (f.ageDays && num(now) !== null && !(num(run.updated) !== null && run.updated >= now - f.ageDays * 86400)) return false;
@@ -123,7 +144,8 @@
123
144
  function filterOptions(runs) {
124
145
  const repos = new Map(), models = new Set();
125
146
  for (const r of list(runs)) {
126
- if (r.repo && !repos.has(r.repo)) repos.set(r.repo, basename(r.repo));
147
+ const key = repoKey(r);
148
+ if (key && !repos.has(key)) repos.set(key, basename(key));
127
149
  for (const m of list(r.models)) if (alias(m)) models.add(alias(m));
128
150
  }
129
151
  return { repos: [...repos].map(([path, name]) => ({ path, name })), models: [...models].sort() };
@@ -141,11 +163,12 @@
141
163
  shown = (recent.length >= Math.min(floor, sorted.length) ? recent : sorted.slice(0, floor)).slice(0, limit);
142
164
  }
143
165
  const layers = [], seen = new Set();
166
+ const layerOf = r => 'repo:' + (repoKey(r) || '?');
144
167
  for (const r of shown) {
145
- const id = 'repo:' + (r.repo || '?');
146
- if (!seen.has(id)) { seen.add(id); layers.push({ id, name: basename(r.repo), repo: r.repo || null }); }
168
+ const id = layerOf(r), key = repoKey(r);
169
+ if (!seen.has(id)) { seen.add(id); layers.push({ id, name: basename(key), repo: key }); }
147
170
  }
148
- const modules = shown.map(r => ({ id: r.key, layer: 'repo:' + (r.repo || '?'), run: r, state: runState(r),
171
+ const modules = shown.map(r => ({ id: r.key, layer: layerOf(r), run: r, state: runState(r),
149
172
  tasks: list(r.task_statuses).length ? list(r.task_statuses) : Object.entries(r.counts || {}).flatMap(([s, n]) => Array.from({ length: Math.min(n, 60) }, (_, i) => ({ id: s + i, status: s }))),
150
173
  match: matchRun(r, f, now) }));
151
174
  const p = plate({ modules, layers }, atlasSize);
@@ -180,6 +203,8 @@
180
203
  if (statuses.some(s => s === 'RUNNING')) return 'RUNNING';
181
204
  if (statuses.every(s => s === 'MERGED')) return 'MERGED';
182
205
  if (statuses.some(s => s === 'PENDING' || s === 'PASS')) return 'PENDING';
206
+ // only answers are missing: the integration waits for the user, not for a fix
207
+ if (statuses.some(isWaiting) && statuses.every(s => s === 'MERGED' || isWaiting(s))) return 'WAITING';
183
208
  return 'BLOCKED';
184
209
  }
185
210
  // How one final review reads as a stage. OUTDATED only once it is done and the reader says the
@@ -226,6 +251,21 @@
226
251
  if (n !== null && want !== null && n === want) return 'ACCEPTED';
227
252
  return raw;
228
253
  }
254
+ // The send-backs forge writes into attempts.tsv without a reviewer's verdict. The task status stays FAIL, but each
255
+ // is a failed attempt with its own word, and a note says what forge did with it.
256
+ const SENT_BACK = new Map([['BOUNCED', 'sent back: the review left blocking findings unaddressed'],
257
+ ['INCOMPLETE', 'sent back: the dwarf said it did not finish']]);
258
+ const attemptNote = status => SENT_BACK.get(status) || null;
259
+ const attemptFailed = status => status === 'FAIL' || status === 'ERROR' || SENT_BACK.has(status);
260
+ // The run's attribution (attribution.json) as the line under its verification result, or null when it names nothing.
261
+ function attributionLine(a) {
262
+ if (!a || typeof a !== 'object') return null;
263
+ const n = num(a.verification_runs), runs = (word) => n === null ? '' : ` (${n} ${word}${n === 1 ? '' : 's'})`;
264
+ if (a.culprit) return `integration failure: merge ${a.culprit} breaks verification${runs('verification run')}`;
265
+ if (a.base_fails === true) return `the base already fails verification${runs('run')}`;
266
+ if (a.inconclusive) return `attribution inconclusive: ${a.inconclusive}${runs('run')}`;
267
+ return null;
268
+ }
229
269
  function shortTip(tip) {
230
270
  if (tip === null || tip === undefined || tip === '') return '—';
231
271
  return String(tip).slice(0, 7);
@@ -872,8 +912,9 @@
872
912
  return { pos, edges, cols, rows: next };
873
913
  }
874
914
 
875
- return { liveNow, runState, execStatus, matchRun, filterOptions, atlasModel, columns, planModel, finishState,
876
- finalStatus, runReviewStatus, reviewSinceLine, reviewAt, taskStatus, taskVerdict, attemptStatus, taskParts,
915
+ return { liveNow, runState, execStatus, matchRun, filterOptions, atlasModel, repoKey, repoLabel, compareRepo, columns, planModel, finishState,
916
+ finalStatus, runReviewStatus, reviewSinceLine, reviewAt, taskStatus, taskVerdict, attemptStatus, attemptNote, attemptFailed, isWaiting,
917
+ attributionLine, taskParts,
877
918
  taskTimes, metricValue, overlap, projectSchedule, execModel, verifyLeds, criticalPath, concurrency, stateAt, timeRange, events, lineage, structureKey, innerKey,
878
919
  fmtDur, alias, basename, weight, searchIndex, searchRank, statusEvents, fractalTree, sweepLine, sweepState };
879
920
  });
@@ -167,6 +167,7 @@ export async function createStage(host, cb = {}) {
167
167
  const parts = [r.kind === 'solo' ? (Object.keys(c)[0] || 'solo') : `${merged}/${total} done`];
168
168
  if (running) parts.push(`${running} running`);
169
169
  if (bad) parts.push(`${bad} failed`);
170
+ if (c.NEEDS_INPUT) parts.push(`${c.NEEDS_INPUT} waiting for you`); // not in the failed count: it waits for an answer
170
171
  const reviewStatus = RM.runReviewStatus(r);
171
172
  if (reviewStatus) parts.push(`review ${reviewStatus}`);
172
173
  else if (r.verification_status) parts.push(`verify ${r.verification_status}`);
@@ -271,18 +272,6 @@ export async function createStage(host, cb = {}) {
271
272
  el.ledCount = tries;
272
273
  setLeds(el, attemptLamps(t).slice(-el.ledCount));
273
274
  display(el, taskLine, { w: w - 24, x: x + 12, y: y + d, z: h - 8 });
274
- // the Clef ring: how likely the first try was to pass, in the colour of what happened
275
- const p0 = t.clef && t.clef.first_pass && num(t.clef.first_pass.p);
276
- if (p0 !== null) {
277
- const cx0 = x + w - 22, cy0 = y + 22, rIn = 8, rOut = 11.5;
278
- const bgM = new THREE.MeshBasicMaterial({ color: E.DETAIL.clone(), toneMapped: false, transparent: true, polygonOffset: true, polygonOffsetFactor: -4, polygonOffsetUnits: -12 });
279
- const fgM = new THREE.MeshBasicMaterial({ color: 0xffffff, toneMapped: false, transparent: true, polygonOffset: true, polygonOffsetFactor: -5, polygonOffsetUnits: -14 });
280
- for (const [m, len] of [[bgM, Math.PI * 2], [fgM, Math.max(.05, Math.min(1, p0)) * Math.PI * 2]]) {
281
- const ring = E.noRay(new THREE.Mesh(new THREE.RingGeometry(rIn * TS, rOut * TS, 40, 1, Math.PI / 2, len), m));
282
- ring.rotation.x = -Math.PI / 2; ring.position.copy(W(cx0, cy0, h + .2)); el.cover.add(ring); el.M.labs.push(m);
283
- }
284
- el.clef = { fgM, p: p0 };
285
- }
286
275
  halo(el);
287
276
  return el;
288
277
  }
@@ -975,7 +964,6 @@ export async function createStage(host, cb = {}) {
975
964
  if (c.tint > .001) el.M.body.color.lerp(TMP2.copy(col), c.tint * c.vis);
976
965
  if (el.tintMat) { el.tintMat.color.copy(col); el.tintMat.opacity = (c.tint * (E.theme === 'light' ? 1.45 : 1.1) + .08 * c.sel) * ob * gf * c.vis; }
977
966
  if (el.haloMat) el.haloMat.uniforms.opacity.value = (c.halo + (el.pulse ? .12 * pulseK : 0)) * gf * c.vis;
978
- if (el.clef) el.clef.fgM.color.copy(E.statusColor(['MERGED', 'PASS', 'ACCEPTED'].includes(el.status) ? 'pass' : ['FAIL', 'ERROR', 'CONFLICT'].includes(el.status) ? 'fail' : 'pending'));
979
967
  if (el.inner) {
980
968
  const p = pr ? pr.p : 0, vis = p > .002;
981
969
  if (!vis && el.inner.visible) { E.release(el.inner); }
@@ -1260,7 +1248,7 @@ export async function createStage(host, cb = {}) {
1260
1248
  const lamps = { title: 'Lamps', rows: [
1261
1249
  { sw: { lamp: 'st-merged' }, label: 'merged · passed · accepted' }, { sw: { lamp: 'st-running' }, label: 'running · interrupted' },
1262
1250
  { sw: { lamp: 'st-fail' }, label: 'failed · conflict · infra · timeout' }, { sw: { lamp: 'st-pending' }, label: 'pending, not started' },
1263
- { sw: { lamp: 'st-outdated' }, label: 'outdated review' },
1251
+ { sw: { lamp: 'st-outdated' }, label: 'outdated review' }, { sw: { lamp: 'st-needs_input' }, label: 'waiting for you' },
1264
1252
  { sw: { route: true }, label: st.view === 'atlas' ? 'chosen run' : 'chosen task' + (L.route ? ' and its route' : '') }] };
1265
1253
  if (st.view === 'atlas') {
1266
1254
  out.push({ title: 'Map', rows: [], note: 'Each block is a run, each district a repository. The lamps on a block are its tasks; the block stands taller the more tasks it has.' }, lamps);
@@ -1283,7 +1271,6 @@ export async function createStage(host, cb = {}) {
1283
1271
  if (fs.some(it => it.plausible)) rows.push({ sw: { sev: 'P2', pale: true }, label: 'plausible: smaller, paler' });
1284
1272
  out.push({ title: 'Findings', rows, note: 'A click opens the diff at the finding.' });
1285
1273
  }
1286
- if (o.arcs && list(st.run.tasks).some(t => t.clef && t.clef.first_pass)) out.push({ title: 'Review marks', rows: [{ sw: { ring: true }, label: 'Clef ring: the chance the first try passes' }] });
1287
1274
  if (o.height !== 'none') {
1288
1275
  const mx = st.metricMax && st.metricMax[o.height];
1289
1276
  out.push({ title: 'Height', rows: [{ sw: { height: true }, label: `${o.height}: up to ${fmtMetric(o.height, mx)}` }] });