@giamme/forge 0.16.0 → 0.18.0

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 (95) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/SKILL.md +16 -3
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +8 -0
  5. package/docs/commands.md +70 -6
  6. package/docs/dataset.md +13 -0
  7. package/docs/decomposed-runs.md +8 -0
  8. package/docs/forge-ui.md +23 -2
  9. package/docs/memory.md +2 -0
  10. package/docs/reviews.md +15 -1
  11. package/docs/safety.md +8 -0
  12. package/forge +24 -1
  13. package/package.json +1 -1
  14. package/references/dataset.md +143 -5
  15. package/references/decision-models.md +15 -2
  16. package/references/decompose.md +180 -11
  17. package/references/planning.md +3 -2
  18. package/references/solo.md +2 -1
  19. package/references/ui.md +5 -2
  20. package/scripts/forge-artifact.sh +14 -0
  21. package/scripts/forge-brief.py +132 -0
  22. package/scripts/forge-compare.py +11 -1
  23. package/scripts/forge-config.py +176 -9
  24. package/scripts/forge-contract.py +98 -4
  25. package/scripts/forge-control.py +86 -13
  26. package/scripts/forge-dispatch.sh +14 -10
  27. package/scripts/forge-du.py +167 -0
  28. package/scripts/forge-issues.py +4 -3
  29. package/scripts/forge-ledger.py +3 -1
  30. package/scripts/forge-lib-adopt.sh +8 -1
  31. package/scripts/forge-lib-plans.sh +5 -2
  32. package/scripts/forge-lib-review.sh +29 -1
  33. package/scripts/forge-metrics.sh +29 -3
  34. package/scripts/forge-parallel-options.sh +4 -0
  35. package/scripts/forge-parallel.sh +506 -10
  36. package/scripts/forge-plan-check.py +25 -2
  37. package/scripts/forge-planner.py +20 -6
  38. package/scripts/forge-prompt.py +120 -0
  39. package/scripts/forge-retro.py +115 -0
  40. package/scripts/forge-runs-compact.py +443 -0
  41. package/scripts/forge-runs-rm.py +2 -0
  42. package/scripts/forge-runs.py +18 -3
  43. package/scripts/forge-schedule.py +279 -4
  44. package/scripts/forge-shadow.py +35 -10
  45. package/scripts/forge-solo.sh +2 -0
  46. package/scripts/forge-summarize.py +698 -0
  47. package/scripts/forge-sweep.py +25 -10
  48. package/scripts/forge-ui-options.sh +10 -0
  49. package/scripts/forge_brief/__init__.py +587 -0
  50. package/scripts/forge_brief/answers.py +459 -0
  51. package/scripts/forge_dataset/__init__.py +10 -0
  52. package/scripts/forge_dataset/cli.py +83 -0
  53. package/scripts/forge_dataset/export.py +18 -4
  54. package/scripts/forge_dataset/facts.py +280 -0
  55. package/scripts/forge_dataset/harvest.py +56 -9
  56. package/scripts/forge_dataset/history.py +5 -3
  57. package/scripts/forge_dataset/outcomes.py +206 -58
  58. package/scripts/forge_dataset/pairs.py +174 -0
  59. package/scripts/forge_dataset/risk.py +108 -0
  60. package/scripts/forge_dataset/tiers.py +427 -0
  61. package/scripts/forge_decide/__init__.py +11 -1
  62. package/scripts/forge_decide/cli.py +23 -2
  63. package/scripts/forge_decide/labels.py +30 -6
  64. package/scripts/forge_decide/replay.py +10 -4
  65. package/scripts/forge_locations.py +366 -0
  66. package/scripts/forge_registry.py +19 -0
  67. package/scripts/forge_retro/__init__.py +417 -0
  68. package/scripts/forge_retro/issues.py +1193 -0
  69. package/scripts/forge_retro/report.py +671 -0
  70. package/scripts/forge_side/__init__.py +477 -0
  71. package/scripts/forge_storage.py +515 -0
  72. package/ui/README.md +68 -8
  73. package/ui/docs/api.md +217 -20
  74. package/ui/forge_ui/control.py +92 -11
  75. package/ui/forge_ui/export.py +31 -5
  76. package/ui/forge_ui/findings.py +4 -2
  77. package/ui/forge_ui/links.py +337 -0
  78. package/ui/forge_ui/models.py +57 -4
  79. package/ui/forge_ui/projects.py +4 -1
  80. package/ui/forge_ui/reader.py +732 -34
  81. package/ui/forge_ui/server.py +8 -0
  82. package/ui/forge_ui/static/app.js +92 -5
  83. package/ui/forge_ui/static/briefview.js +302 -0
  84. package/ui/forge_ui/static/checksview.js +6 -2
  85. package/ui/forge_ui/static/controls.js +5 -0
  86. package/ui/forge_ui/static/diffview.js +7 -3
  87. package/ui/forge_ui/static/index.html +3 -0
  88. package/ui/forge_ui/static/panel.js +311 -4
  89. package/ui/forge_ui/static/runmodel.js +13 -1
  90. package/ui/forge_ui/static/storageview.js +271 -0
  91. package/ui/forge_ui/static/style.css +100 -3
  92. package/ui/forge_ui/static/worktreesview.js +3 -3
  93. package/ui/forge_ui/storage.py +136 -0
  94. package/ui/forge_ui/transcripts.py +35 -10
  95. package/ui/forge_ui/worktrees.py +154 -13
@@ -45,6 +45,8 @@ _EXEC_CHECKS_PATH = re.compile(_EXEC_PATH.pattern + '/checks')
45
45
  _TASK_CHECKS_PATH = re.compile(_TASK_PATH.pattern + '/checks')
46
46
  _ENVIRONMENT_PATH = re.compile(r'/api/runs/([0-9a-f]{12})/environment')
47
47
  _REVIEW_DIFF_PATH = re.compile(_REVIEW_PATH.pattern + '/diff')
48
+ _ADOPTION_PATH = re.compile(r'/api/runs/([0-9a-f]{12})/adoptions/(adopt-[0-9]+-[0-9]+)')
49
+ _ADOPTION_DIFF_PATH = re.compile(_ADOPTION_PATH.pattern + '/diff')
48
50
  _FILES_PATH = re.compile(r'/api/runs/([0-9a-f]{12})/files')
49
51
  _FINDINGS_PATH = re.compile(r'/api/runs/([0-9a-f]{12})/findings')
50
52
  _EXPORT_PATH = re.compile(r'/api/runs/([0-9a-f]{12})/export')
@@ -144,6 +146,12 @@ def api_get(catalog, path):
144
146
  match = _REVIEW_DIFF_PATH.fullmatch(path)
145
147
  if match:
146
148
  return catalog.final_review_diff(*match.groups())
149
+ match = _ADOPTION_PATH.fullmatch(path)
150
+ if match:
151
+ return catalog.adoption(*match.groups())
152
+ match = _ADOPTION_DIFF_PATH.fullmatch(path)
153
+ if match:
154
+ return catalog.adoption_diff(*match.groups())
147
155
  match = _TRANSCRIPT_PATH.fullmatch(path)
148
156
  if match:
149
157
  return catalog.transcript(*match.groups())
@@ -51,16 +51,19 @@ window.ForgeApp = (() => {
51
51
  if (sel.kind === 'task') return `${base}/tasks/${e(sel.id)}`;
52
52
  if (sel.kind === 'execution') return sel.task ? `${base}/tasks/${e(sel.task)}/executions/${e(sel.exec)}` : `${base}/executions/${e(sel.exec)}`;
53
53
  if (sel.kind === 'final') return `${base}/final-review${sel.name ? '/' + e(sel.name) : ''}`;
54
+ if (sel.kind === 'adoption') return `${base}/adoptions/${e(sel.name)}`;
54
55
  if (sel.kind === 'verification') return `${base}/verification`;
55
56
  if (sel.kind === 'integration') return `${base}/integration`;
56
57
  if (sel.kind === 'fractal') return `${base}/tasks/${e(sel.task)}/fractal/${e(sel.node)}`;
57
58
  return base;
58
59
  }
59
- // a diff: {kind: 'task', task, source, file} | {kind: 'final', name, file} | {kind: 'fractal', task, node, file},
60
+ // a diff: {kind: 'task', task, source, file} | {kind: 'final', name, file} | {kind: 'adoption', name, file}
61
+ // | {kind: 'fractal', task, node, file},
60
62
  // opened at a file, or at one finding (its id from /findings)
61
63
  function diffHash(key, spec) {
62
64
  const e = encodeURIComponent, base = '#/runs/' + e(key), file = spec.finding ? '/finding/' + e(spec.finding) : spec.file ? '/file/' + e(spec.file) : '';
63
65
  if (spec.kind === 'final') return `${base}/final-review/${e(spec.name)}/diff${file}`;
66
+ if (spec.kind === 'adoption') return `${base}/adoptions/${e(spec.name)}/diff${file}`;
64
67
  if (spec.kind === 'fractal') return `${base}/tasks/${e(spec.task)}/fractal/${e(spec.node)}/diff${file}`;
65
68
  return `${base}/tasks/${e(spec.task)}/diff${spec.source && spec.source !== 'current' ? '/' + e(spec.source) : ''}${file}`;
66
69
  }
@@ -77,6 +80,7 @@ window.ForgeApp = (() => {
77
80
  if (/^#\/settings\/?$/.test(hash)) return { key: null, sel: null, settings: true };
78
81
  const pj = hash.match(/^#\/projects(?:\/([0-9a-f]{8})(?:\/(runs|findings|memories))?)?\/?$/);
79
82
  if (pj) return { key: null, sel: null, projects: { id: pj[1] || null, tab: pj[2] || 'runs' } };
83
+ if (/^#\/disk\/?$/.test(hash)) return { key: null, sel: null, disk: true };
80
84
  const w = hash.match(/^#\/worktrees(?:\/(repo|runs)\/([^/]+))?\/?$/);
81
85
  if (w) return { key: null, sel: null, worktrees: { repo: w[1] === 'repo' ? decodeURIComponent(w[2]) : '', run: w[1] === 'runs' ? decodeURIComponent(w[2]) : '' } };
82
86
  const m = hash.match(/^#\/runs\/([^/]+)(\/.*)?$/);
@@ -87,6 +91,7 @@ window.ForgeApp = (() => {
87
91
  if ((r = rest.match(/^\/tasks\/([^/]+)\/diff(?:\/(?!file\/|finding\/)([^/]+))?(?:\/finding\/([^/]+))?(?:\/file\/(.+?))?\/?$/))) return { key: d(m[1]), sel: { kind: 'task', id: d(r[1]) }, diff: { kind: 'task', task: d(r[1]), source: r[2] ? d(r[2]) : 'current', finding: r[3] ? d(r[3]) : null, file: r[4] ? d(r[4]) : null } };
88
92
  if ((r = rest.match(/^\/tasks\/([^/]+)\/fractal\/([^/]+)\/diff(?:\/file\/(.+?))?\/?$/))) return { key: d(m[1]), sel: { kind: 'task', id: d(r[1]) }, diff: { kind: 'fractal', task: d(r[1]), node: d(r[2]), file: r[3] ? d(r[3]) : null } };
89
93
  if ((r = rest.match(/^\/final-review\/([^/]+)\/diff(?:\/finding\/([^/]+))?(?:\/file\/(.+?))?\/?$/))) return { key: d(m[1]), sel: { kind: 'final', name: d(r[1]) }, diff: { kind: 'final', name: d(r[1]), finding: r[2] ? d(r[2]) : null, file: r[3] ? d(r[3]) : null } };
94
+ if ((r = rest.match(/^\/adoptions\/([^/]+)\/diff(?:\/finding\/([^/]+))?(?:\/file\/(.+?))?\/?$/))) return { key: d(m[1]), sel: { kind: 'adoption', name: d(r[1]) }, diff: { kind: 'adoption', name: d(r[1]), finding: r[2] ? d(r[2]) : null, file: r[3] ? d(r[3]) : null } };
90
95
  if ((r = rest.match(/^\/(?:tasks\/([^/]+)\/)?executions\/([^/]+)\/conversation(?:\/event\/(\d{1,7}))?\/?$/))) {
91
96
  const s = r[1] ? { kind: 'execution', task: d(r[1]), id: d(r[1]), exec: d(r[2]) } : { kind: 'execution', task: null, exec: d(r[2]) };
92
97
  const run = s.task && state.cache.get(d(m[1]))?.data, t = run && list(run.tasks).find(x => x.id === s.task);
@@ -101,6 +106,7 @@ window.ForgeApp = (() => {
101
106
  else if ((r = rest.match(/^\/tasks\/([^/]+)\/?$/))) sel = { kind: 'task', id: d(r[1]) };
102
107
  else if ((r = rest.match(/^\/executions\/([^/]+)\/?$/))) sel = { kind: 'execution', task: null, exec: d(r[1]) };
103
108
  else if ((r = rest.match(/^\/final-review(?:\/([^/]+))?\/?$/))) sel = { kind: 'final', name: r[1] ? d(r[1]) : null };
109
+ else if ((r = rest.match(/^\/adoptions\/([^/]+)\/?$/))) sel = { kind: 'adoption', name: d(r[1]) };
104
110
  else if (/^\/verification\/?$/.test(rest)) sel = { kind: 'verification' };
105
111
  else if (/^\/integration\/?$/.test(rest)) sel = { kind: 'integration' };
106
112
  else if ((r = rest.match(/^\/tasks\/([^/]+)\/fractal\/([^/]+)\/?$/))) sel = { kind: 'fractal', task: d(r[1]), node: d(r[2]) };
@@ -565,6 +571,20 @@ window.ForgeApp = (() => {
565
571
  });
566
572
  }
567
573
 
574
+ /* ---------- what forge takes on disk (#/disk) ---------- */
575
+ // It reads /api/storage itself, when opened and while a measurement runs: never on the page's poll.
576
+ function renderDisk() {
577
+ const main = $('main');
578
+ if (main.dataset.view === 'disk' && state.diskView) return;
579
+ setView(main, 'disk'); delete main.dataset.run;
580
+ main.replaceChildren();
581
+ const v = el('section', undefined, 'worktrees-view disk-view'); v.id = 'disk-view'; main.append(v);
582
+ state.diskView = window.ForgeStorage.render(v, {
583
+ runHref: path => { const r = list(state.runs).find(x => x.path === path); return r ? '#/runs/' + encodeURIComponent(r.key) : null; },
584
+ tablePrefs: id => state.tablePrefs[id], saveTablePrefs: (id, p) => { state.tablePrefs = { ...state.tablePrefs, [id]: p }; store.set('tables', state.tablePrefs); },
585
+ });
586
+ }
587
+
568
588
  /* ---------- each repository's runs, findings and memories (#/projects) ---------- */
569
589
  function renderProjects() {
570
590
  const main = $('main'), p = state.projects;
@@ -830,6 +850,9 @@ window.ForgeApp = (() => {
830
850
  return [
831
851
  { id: 'id', label: 'ID', mono: true, value: t => t.id, cell: t => link(t.id, run.key, { kind: 'task', id: t.id }) },
832
852
  { id: 'title', label: 'Title', value: t => t.title },
853
+ // the one-sentence summary, only while the run's summaries are on (#133 B): the column is not there otherwise
854
+ ...(summariesOn(run) ? [{ id: 'summary', label: 'Summary', title: 'The one-sentence summary of each task (summaries are on for this run)', cls: 'sum-col',
855
+ value: t => t.summary && t.summary.sentence || null, cell: t => t.summary && t.summary.sentence || '—' }] : []),
833
856
  { id: 'difficulty', label: 'Difficulty', value: t => DIFF_RANK[t.difficulty] ?? null, cell: t => display(t.difficulty) },
834
857
  { id: 'wave', label: 'Wave', value: t => Number.isFinite(Number(t.wave)) && t.wave !== null && t.wave !== '' ? Number(t.wave) : null, cell: t => display(t.wave) },
835
858
  { id: 'status', label: 'Status', value: t => RM.taskStatus(t), cell: t => chip(RM.statusText(t), RM.taskStatus(t)) },
@@ -873,6 +896,43 @@ window.ForgeApp = (() => {
873
896
  scoped(host, run.key + ':');
874
897
  }));
875
898
  }
899
+ // The run's summary switch above its tasks (#133 B): `forge control set summaries on|off`, asked in controls.js's words
900
+ // and sent through the page's write path, with the model shown when on. A page that cannot write shows the state alone.
901
+ // Built once per run and per writability, then updated in place, so a poll never takes the keyboard off its keys.
902
+ const summariesOn = run => !!run.summaries && run.summaries.mode === 'on';
903
+ let summaryWritable = false;
904
+ function askWritable() {
905
+ if (SNAP || !window.ForgeUI || !window.ForgeUI.controlsEnabled) return;
906
+ window.ForgeUI.controlsEnabled().then(on => {
907
+ if (!!on === summaryWritable) return;
908
+ summaryWritable = !!on;
909
+ const cur = state.cache.get(state.key)?.data;
910
+ if (cur) renderSummarySwitch(cur);
911
+ });
912
+ }
913
+ function renderSummarySwitch(run) {
914
+ const host = $('run-summaries'); if (!host) return;
915
+ host.hidden = run.kind === 'solo' || !window.ForgePanel; // a solo run has one task and no switch
916
+ if (host.hidden) return;
917
+ askWritable();
918
+ const mode = summariesOn(run) ? 'on' : 'off', key = run.key;
919
+ const shape = `${key}|${summaryWritable ? 'write' : 'read'}`;
920
+ if (host.dataset.shape !== shape) {
921
+ host.dataset.shape = shape;
922
+ const kids = [el('span', 'Summaries:', 'plate')];
923
+ if (summaryWritable) {
924
+ kids.push(window.ForgePanel.summaryBank([['off', 'Off'], ['on', 'On']], mode,
925
+ value => window.ForgePanel.changeSummaries(host.querySelector('.sum-msgs'), null, key, { input: value }, () => loadRun(key)),
926
+ 'Summaries for this run'));
927
+ } else kids.push(el('span', undefined, 'sum-state'));
928
+ kids.push(el('span', undefined, 'sum-model'), el('div', undefined, 'sum-msgs'));
929
+ host.replaceChildren(...kids);
930
+ }
931
+ for (const b of host.querySelectorAll('.sum-bank button')) b.setAttribute('aria-pressed', String(b.dataset.value === mode));
932
+ const word = host.querySelector('.sum-state');
933
+ if (word) word.textContent = mode;
934
+ host.querySelector('.sum-model').replaceChildren(...(mode === 'on' && run.summaries.model ? [window.ForgeIcons.modelPlate(run.summaries.model)] : []));
935
+ }
876
936
  function renderInspector(run) {
877
937
  const host = $('inspector'); if (!host || !window.ForgePanel) return;
878
938
  const sel = state.sel || (run.kind === 'solo' ? { kind: 'task', id: list(run.tasks)[0]?.id } : null);
@@ -881,6 +941,7 @@ window.ForgeApp = (() => {
881
941
  run, sel, now: now(),
882
942
  fetchJSON: path => fetchJSON(path).then(r => r.data),
883
943
  rerender: () => { const r = state.cache.get(state.key)?.data; if (r) renderInspector(r); },
944
+ refresh: () => loadRun(run.key), // a change made here shows at once, not at the next poll
884
945
  hash: s => hashFor(run.key, s), onSelect: s => select(s), diffHash: spec => diffHash(run.key, spec),
885
946
  convoHash: (s, event) => convoHash(run.key, s, event),
886
947
  onFractal: (id, data) => { if (state.stage && state.stage.setFractal) state.stage.setFractal(id, data); },
@@ -1000,17 +1061,39 @@ window.ForgeApp = (() => {
1000
1061
  const strip = el('div', undefined, 'strip-wrap'); strip.id = 'strip'; view.append(strip);
1001
1062
  const diff = el('section', undefined, 'diff-view'); diff.id = 'diff-view'; diff.hidden = true; diff.tabIndex = -1; view.append(diff);
1002
1063
  const box = el('section', undefined, 'module tasks-module'); box.setAttribute('aria-label', 'Tasks'); box.dataset.overlay = '';
1064
+ const questions = el('div', undefined, 'run-questions'); questions.id = 'run-questions'; questions.hidden = true; // open brief questions (#135)
1065
+ questions.setAttribute('aria-label', 'Open questions');
1066
+ const switchRow = el('div', undefined, 'tasks-switch'); switchRow.id = 'run-summaries'; switchRow.hidden = true; // the summaries switch (#133 B)
1003
1067
  const tasks = el('div', undefined, 'run-tasks'); tasks.id = 'run-tasks';
1004
- box.append(Shell.head('tasks', 'Tasks', ''), tasks, Shell.splitter('tasks'));
1068
+ box.append(Shell.head('tasks', 'Tasks', ''), questions, switchRow, tasks, Shell.splitter('tasks'));
1005
1069
  view.append(box);
1006
1070
  }
1007
1071
  document.body.classList.toggle('no-tasks', run.kind === 'solo');
1008
1072
  ensureStage();
1009
1073
  renderHeader(run);
1010
1074
  renderRunBody(run);
1075
+ renderSummarySwitch(run);
1076
+ renderQuestions(run);
1011
1077
  renderTable(run);
1012
1078
  announce(run);
1013
1079
  }
1080
+ // Open brief questions (#135), flagged first and then by the schedule projection. Hidden with the tasks module
1081
+ // when that panel is folded, and hidden entirely when brief is off or nothing is still open.
1082
+ function renderQuestions(run) {
1083
+ const host = $('run-questions');
1084
+ if (!host) return;
1085
+ const show = run.kind !== 'solo' && run.brief && window.ForgeBrief;
1086
+ if (!show) { host.hidden = true; host.replaceChildren(); return; }
1087
+ const open = window.ForgeBrief.openQuestions(run);
1088
+ if (!open.length) { host.hidden = true; host.replaceChildren(); return; }
1089
+ host.hidden = false;
1090
+ const clock = now();
1091
+ const projections = RM.projectSchedule(run, { now: clock });
1092
+ preserve(host, () => window.ForgeBrief.renderList(host, {
1093
+ run, projections, now: clock,
1094
+ href: id => hashFor(run.key, { kind: 'task', id }),
1095
+ }));
1096
+ }
1014
1097
  function renderMain() {
1015
1098
  document.body.classList.toggle('cloud-mode', !!state.cloud);
1016
1099
  if (!state.key) document.body.classList.remove('no-tasks');
@@ -1018,6 +1101,7 @@ window.ForgeApp = (() => {
1018
1101
  if (state.models) { renderModels(); return; }
1019
1102
  if (state.settings) { renderSettings(); return; }
1020
1103
  if (state.worktrees) { renderWorktrees(); return; }
1104
+ if (state.disk) { renderDisk(); return; }
1021
1105
  if (state.projects) { renderProjects(); return; }
1022
1106
  if (state.key && state.findingsPage) { renderFindings(); return; }
1023
1107
  if (!state.key) { renderMap(); return; }
@@ -1076,7 +1160,7 @@ window.ForgeApp = (() => {
1076
1160
  if (state.cloud) renderCloud();
1077
1161
  else if (state.settings) state.settingsView?.poll(); // the picker follows the run list; the page stays
1078
1162
  else if (state.projects) state.projectsView?.poll();
1079
- else if (!state.key && !state.models && !state.worktrees) renderMap({ rebuildBar: $('map-filters') ? !$('map-filters').contains(document.activeElement) : true });
1163
+ else if (!state.key && !state.models && !state.worktrees && !state.disk) renderMap({ rebuildBar: $('map-filters') ? !$('map-filters').contains(document.activeElement) : true });
1080
1164
  }, 'Could not refresh runs');
1081
1165
  }
1082
1166
  function loadRun(key) {
@@ -1113,6 +1197,7 @@ window.ForgeApp = (() => {
1113
1197
  state.models = !!parsed.models;
1114
1198
  state.settings = !!parsed.settings && !!window.ForgeSettings && !SNAP;
1115
1199
  state.worktrees = parsed.worktrees && window.ForgeWorktrees && !SNAP ? parsed.worktrees : null;
1200
+ state.disk = !!parsed.disk && !!window.ForgeStorage && !SNAP;
1116
1201
  state.projects = parsed.projects && window.ForgeProjects && !SNAP ? parsed.projects : null;
1117
1202
  if (parsed.key) state.lastKey = parsed.key;
1118
1203
  state.findingsPage = !!parsed.findings && !!window.ForgeFindings;
@@ -1123,7 +1208,7 @@ window.ForgeApp = (() => {
1123
1208
  document.body.classList.toggle('cloud-mode', !!state.cloud);
1124
1209
  if (!state.key) document.body.classList.remove('no-tasks');
1125
1210
  for (const a of document.querySelectorAll('.topbar .top-link')) {
1126
- const here = a.getAttribute('href') === (state.cloud ? '#/cloud' : state.models ? '#/models' : state.settings ? '#/settings' : state.worktrees ? '#/worktrees' : state.projects ? '#/projects' : !state.key ? '#/' : null);
1211
+ const here = a.getAttribute('href') === (state.cloud ? '#/cloud' : state.models ? '#/models' : state.settings ? '#/settings' : state.worktrees ? '#/worktrees' : state.disk ? '#/disk' : state.projects ? '#/projects' : !state.key ? '#/' : null);
1127
1212
  if (here) a.setAttribute('aria-current', 'page'); else a.removeAttribute('aria-current');
1128
1213
  }
1129
1214
  renderErrors();
@@ -1132,6 +1217,7 @@ window.ForgeApp = (() => {
1132
1217
  if (state.models) { renderModels(); loadModels(); return; }
1133
1218
  if (state.settings) { renderSettings(); return; }
1134
1219
  if (state.worktrees) { renderWorktrees(); return; }
1220
+ if (state.disk) { renderDisk(); return; }
1135
1221
  if (state.projects) { renderProjects(); return; }
1136
1222
  if (state.key && state.findingsPage) { renderFindings(); return; }
1137
1223
  if (!state.key) { renderMap(); return; }
@@ -1181,7 +1267,8 @@ window.ForgeApp = (() => {
1181
1267
  { id: 'cmd:map', label: 'Open the map of all runs', sub: 'the front page', ids: ['map', 'home'], href: '#/' },
1182
1268
  { id: 'cmd:models', label: 'Open the model leaderboard', sub: 'pass rates, retries, time and tokens per model', ids: ['models', 'leaderboard'], href: '#/models' },
1183
1269
  ...(window.ForgeProjects ? [{ id: 'cmd:projects', label: 'Open the projects', sub: 'each repository\'s runs, findings and memories', ids: ['projects', 'repos', 'memory', 'findings'], href: '#/projects' }] : []),
1184
- ...(window.ForgeWorktrees ? [{ id: 'cmd:worktrees', label: 'Open the worktrees', sub: 'every worktree forge created, its state and the command that removes it', ids: ['worktrees', 'cleanup', 'disk'], href: '#/worktrees' }] : []),
1270
+ ...(window.ForgeWorktrees ? [{ id: 'cmd:worktrees', label: 'Open the worktrees', sub: 'every worktree forge created, its state and the command that removes it', ids: ['worktrees', 'cleanup'], href: '#/worktrees' }] : []),
1271
+ ...(window.ForgeStorage ? [{ id: 'cmd:disk', label: 'Open the disk report', sub: 'what forge takes on disk and the command that takes each part back', ids: ['disk', 'space', 'du', 'compact', 'cleanup'], href: '#/disk' }] : []),
1185
1272
  ...(window.ForgeSettings ? [{ id: 'cmd:settings', label: 'Open the settings', sub: 'model registry, Jev, and the .forge files of a repository', ids: ['settings', 'config', 'verify', 'jev'], href: '#/settings' }] : []),
1186
1273
  { id: 'cmd:notify', label: 'Notifications', sub: 'what finished or failed, and browser notifications', ids: ['alerts', 'bell'], action: () => window.ForgeNotify && window.ForgeNotify.open() },
1187
1274
  { id: 'cmd:dim', label: state.dim === '3d' ? 'Switch to 2D' : 'Switch to 3D', sub: state.dim === '3d' ? 'graphs and charts, no WebGL' : 'loads three.js from cdn.jsdelivr.net', ids: ['2d', '3d'],
@@ -0,0 +1,302 @@
1
+ /* forge-ui brief questions (#135): a task's questions in the inspector, and the run's open questions.
2
+ window.ForgeBrief, and a CommonJS module under node:test. The pure helpers (openQuestions, orderQuestions,
3
+ startLine) are tested in ui/tests/js/briefview.test.js. Question text, answers and the late-answer notice
4
+ are untrusted: they only ever enter the page as text.
5
+ Ordering is flagged (must answer) first, then by the projected start from projectSchedule. A task with no
6
+ finite start is last. Wave numbers are a preview and are never a sort key. */
7
+ (function (root, factory) {
8
+ 'use strict';
9
+ const api = factory(root);
10
+ if (typeof module === 'object' && module.exports) module.exports = api;
11
+ else root.ForgeBrief = api;
12
+ })(typeof self !== 'undefined' ? self : this, function (root) {
13
+ 'use strict';
14
+
15
+ const list = v => Array.isArray(v) ? v : [];
16
+ const num = v => typeof v === 'number' && Number.isFinite(v) ? v : null;
17
+ const notices = new Map(); // run\ntask\nqid → the late answer's stdout
18
+
19
+ function el(tag, text, className) {
20
+ const node = root.document.createElement(tag);
21
+ if (text !== undefined) node.textContent = text === null || text === undefined ? '' : String(text);
22
+ if (className) node.className = className;
23
+ return node;
24
+ }
25
+
26
+ function noticeKey(run, task, question) {
27
+ return String(run && run.key) + '\n' + String(task && task.id) + '\n' + String(question && question.id);
28
+ }
29
+
30
+ // Open task questions, in task order. Parked questions are wider than the task and are not listed here.
31
+ function openQuestions(run) {
32
+ const items = [];
33
+ for (const task of list(run && run.tasks)) {
34
+ const brief = task && task.brief;
35
+ if (!brief || typeof brief !== 'object') continue;
36
+ for (const question of list(brief.questions)) {
37
+ if (!question || typeof question !== 'object' || question.state !== 'open') continue;
38
+ items.push({ task, question });
39
+ }
40
+ }
41
+ return items;
42
+ }
43
+
44
+ function projectionStart(projections, task) {
45
+ if (!projections || !task) return null;
46
+ const row = projections[task.id];
47
+ if (!row || typeof row !== 'object') return null;
48
+ return num(row.start);
49
+ }
50
+
51
+ // Flagged first, then the earliest finite projected start. No start (missing, or not a finite number) sorts
52
+ // last inside its group. The original index breaks ties, so equal starts keep the order they were given.
53
+ function orderQuestions(items, projections) {
54
+ const rows = list(items).map((item, index) => ({ item, index }));
55
+ rows.sort((a, b) => {
56
+ const fa = a.item && a.item.question && a.item.question.must_answer === true ? 0 : 1;
57
+ const fb = b.item && b.item.question && b.item.question.must_answer === true ? 0 : 1;
58
+ if (fa !== fb) return fa - fb;
59
+ const sa = projectionStart(projections, a.item && a.item.task);
60
+ const sb = projectionStart(projections, b.item && b.item.task);
61
+ if (sa === null && sb !== null) return 1;
62
+ if (sa !== null && sb === null) return -1;
63
+ if (sa !== null && sb !== null && sa !== sb) return sa - sb;
64
+ return a.index - b.index;
65
+ });
66
+ return rows.map(row => row.item);
67
+ }
68
+
69
+ // A wait, rounded to a phrase. Under 45s is "about now"; otherwise the nearest minute, then hours.
70
+ function aboutText(seconds) {
71
+ const s = Math.max(0, num(seconds) === null ? 0 : seconds);
72
+ if (s < 45) return 'about now';
73
+ const minutes = Math.round(s / 60);
74
+ if (minutes <= 1) return 'about 1 min';
75
+ if (minutes < 60) return 'about ' + minutes + ' min';
76
+ const hours = Math.floor(minutes / 60), rest = minutes % 60;
77
+ return rest ? 'about ' + hours + ' h ' + rest + ' min' : 'about ' + hours + ' h';
78
+ }
79
+
80
+ function namesPhrase(deps) {
81
+ const names = list(deps).map(id => String(id));
82
+ if (names.length <= 1) return names[0] || '';
83
+ if (names.length === 2) return names[0] + ' and ' + names[1];
84
+ return names.slice(0, -1).join(', ') + ' and ' + names[names.length - 1];
85
+ }
86
+
87
+ // "starts after A and B merge, about 40 min". No finite start → null. No clock → the wait is about now.
88
+ // A task that has started (any status but PENDING or BLOCKED) says so instead: its projected start is in
89
+ // the past, and an answer now is a late one.
90
+ function startLine(spec) {
91
+ spec = spec || {};
92
+ const status = typeof spec.status === 'string' ? spec.status : '';
93
+ if (status === 'RUNNING') return 'running now';
94
+ if (status && status !== 'PENDING' && status !== 'BLOCKED') return 'already started';
95
+ const start = num(spec.start);
96
+ if (start === null) return null;
97
+ const clock = num(spec.now);
98
+ const about = aboutText(clock === null ? 0 : start - clock);
99
+ const deps = list(spec.deps);
100
+ if (!deps.length) return about === 'about now' ? 'starts about now' : 'starts in ' + about;
101
+ const verb = deps.length === 1 ? 'merges' : 'merge';
102
+ return 'starts after ' + namesPhrase(deps) + ' ' + verb + ', ' + about;
103
+ }
104
+
105
+ // Deps that have not merged yet, including an id the run does not know. PASS is still ahead of the merge.
106
+ function waitingDeps(task, tasks) {
107
+ const byId = new Map(list(tasks).map(item => [item && item.id, item]));
108
+ return list(task && task.deps).filter(id => {
109
+ const dep = byId.get(id);
110
+ return !dep || dep.status !== 'MERGED';
111
+ });
112
+ }
113
+
114
+ function flags(question) {
115
+ const row = el('div', undefined, 'brief-flags');
116
+ if (question && question.must_answer === true) row.append(el('span', 'must answer', 'tag'));
117
+ if (question && question.possibly_stale === true) row.append(el('span', 'possibly stale', 'tag'));
118
+ return row.childElementCount ? row : null;
119
+ }
120
+
121
+ function noticeNode(text) {
122
+ const pre = el('pre', text, 'brief-notice');
123
+ pre.setAttribute('role', 'status');
124
+ return pre;
125
+ }
126
+
127
+ function paintNotice(box, text) {
128
+ const card = box && box.parentElement;
129
+ if (!card) return;
130
+ const node = noticeNode(text);
131
+ const old = card.querySelector(':scope > .brief-notice');
132
+ if (old) old.replaceWith(node);
133
+ else card.insertBefore(node, box);
134
+ }
135
+
136
+ function clearNotice(box) {
137
+ const old = box && box.parentElement && box.parentElement.querySelector(':scope > .brief-notice');
138
+ if (old) old.remove();
139
+ }
140
+
141
+ function answerBox(ctx, task, question) {
142
+ const run = ctx.run || {};
143
+ const box = el('div', undefined, 'brief-box');
144
+ box.dataset.hold = 'brief:' + run.key + ':' + task.id + ':' + question.id;
145
+ const field = el('textarea');
146
+ field.setAttribute('aria-label', 'Answer');
147
+ field.maxLength = 4096;
148
+ field.rows = 3;
149
+ field.autocomplete = 'off';
150
+ const send = el('button', 'Send', 'brief-send');
151
+ send.type = 'button';
152
+ const msgs = el('div', undefined, 'brief-msgs');
153
+ const mark = () => { box.dataset.editing = '1'; };
154
+ field.addEventListener('focus', mark);
155
+ field.addEventListener('input', mark);
156
+ field.addEventListener('blur', () => {
157
+ if (box.dataset.busy) return;
158
+ if (!field.value.trim()) delete box.dataset.editing;
159
+ });
160
+ send.addEventListener('click', () => sendAnswer(box, field, send, msgs, ctx, task, question));
161
+ box.append(field, send, msgs);
162
+ return box;
163
+ }
164
+
165
+ async function sendAnswer(box, field, send, msgs, ctx, task, question) {
166
+ if (box.dataset.busy) return;
167
+ const answer = field.value.trim();
168
+ const ui = root.ForgeUI;
169
+ if (!answer) {
170
+ if (ui) ui.outcome(msgs, { ok: false, status: 400, error: 'invalid', detail: 'the answer is empty' });
171
+ return;
172
+ }
173
+ box.dataset.editing = '1';
174
+ box.dataset.busy = '1';
175
+ box.setAttribute('aria-busy', 'true');
176
+ send.disabled = true;
177
+ const run = ctx.run || {};
178
+ const path = '/api/runs/' + encodeURIComponent(run.key) + '/tasks/' + encodeURIComponent(task.id) + '/brief/' + encodeURIComponent(question.id);
179
+ let res = { ok: false, error: 'unavailable', detail: 'this page cannot send' };
180
+ try {
181
+ if (ui && ui.post) res = await ui.post(path, { answer });
182
+ } catch (_) {
183
+ res = { ok: false, error: 'failed', detail: 'could not send the answer' };
184
+ }
185
+ if (!box.isConnected) return;
186
+ delete box.dataset.busy;
187
+ box.removeAttribute('aria-busy');
188
+ send.disabled = false;
189
+ const data = res && res.data;
190
+ const output = data && typeof data.output === 'string' ? data.output : '';
191
+ if (res && res.ok && data && data.exit === 0) {
192
+ const key = noticeKey(run, task, question);
193
+ if (output.includes('forge control add')) {
194
+ notices.set(key, output);
195
+ paintNotice(box, output);
196
+ } else {
197
+ notices.delete(key);
198
+ clearNotice(box);
199
+ }
200
+ delete box.dataset.editing; // the redraw shows the recorded answer, not this draft
201
+ if (ctx.refresh) ctx.refresh();
202
+ return;
203
+ }
204
+ if (ui && ui.outcome) ui.outcome(msgs, res);
205
+ }
206
+
207
+ function questionCard(question, ctx, task, parked) {
208
+ const li = el('li', undefined, 'brief-q');
209
+ if (question.id) li.dataset.qid = String(question.id);
210
+ li.append(el('p', typeof question.text === 'string' && question.text ? question.text : '—', 'brief-text'));
211
+ if (typeof question.why === 'string' && question.why) li.append(el('p', question.why, 'brief-why muted'));
212
+ const options = list(question.options).filter(item => typeof item === 'string' && item);
213
+ if (options.length) li.append(el('p', options.join(' · '), 'brief-options'));
214
+ if (typeof question.default === 'string' && question.default) li.append(el('p', 'if unanswered: ' + question.default, 'brief-default muted'));
215
+ const marks = flags(question);
216
+ if (marks) li.append(marks);
217
+ if (!parked && typeof question.answer === 'string' && question.answer) li.append(el('p', 'Answer: ' + question.answer, 'brief-got'));
218
+ if (parked && typeof question.scope === 'string' && question.scope) li.append(el('p', 'scope: ' + question.scope, 'brief-scope muted'));
219
+ if (!parked) {
220
+ const note = notices.get(noticeKey(ctx && ctx.run, task, question));
221
+ const box = answerBox(ctx, task, question);
222
+ if (note) li.append(noticeNode(note));
223
+ li.append(box);
224
+ }
225
+ return li;
226
+ }
227
+
228
+ // Drop the answer boxes once the page knows it cannot write. The promise is cached, so a redraw settles at once.
229
+ function settleControls(section) {
230
+ const ui = root.ForgeUI;
231
+ const drop = () => {
232
+ if (!section.isConnected) return;
233
+ for (const box of section.querySelectorAll('.brief-box')) box.remove();
234
+ section.dataset.controls = 'off';
235
+ };
236
+ if (!ui || !ui.controlsEnabled) { drop(); return; }
237
+ ui.controlsEnabled().then(on => {
238
+ if (!section.isConnected) return;
239
+ if (!on) drop();
240
+ else section.dataset.controls = 'on';
241
+ });
242
+ }
243
+
244
+ // The inspector section. Nothing when this task has no brief. Parked questions stay collapsed, with no answer box.
245
+ function taskSection(host, ctx, task) {
246
+ const brief = task && task.brief;
247
+ if (!host || !brief || typeof brief !== 'object') return null;
248
+ const section = el('section', undefined, 'insp-section brief-section');
249
+ section.append(el('h3', 'Questions'));
250
+ const questions = list(brief.questions).filter(item => item && typeof item === 'object');
251
+ const parked = list(brief.parked).filter(item => item && typeof item === 'object');
252
+ if (!questions.length && !parked.length) section.append(el('p', 'No questions.', 'muted'));
253
+ if (questions.length) {
254
+ const ul = el('ul', undefined, 'brief-questions');
255
+ for (const question of questions) ul.append(questionCard(question, ctx, task, false));
256
+ section.append(ul);
257
+ }
258
+ if (parked.length) {
259
+ const details = el('details', undefined, 'brief-parked');
260
+ details.dataset.keep = 'brief-parked:' + task.id;
261
+ const ul = el('ul', undefined, 'brief-questions');
262
+ for (const question of parked) ul.append(questionCard(question, ctx, task, true));
263
+ details.append(el('summary', 'Parked (wider scope)'), ul);
264
+ section.append(details);
265
+ }
266
+ host.append(section);
267
+ settleControls(section);
268
+ return section;
269
+ }
270
+
271
+ // The run's open questions. `href(taskId)` is the link that opens that task's inspector.
272
+ function renderList(host, spec) {
273
+ spec = spec || {};
274
+ if (!host) return;
275
+ host.replaceChildren();
276
+ const run = spec.run;
277
+ const open = orderQuestions(openQuestions(run), spec.projections);
278
+ if (!open.length) return;
279
+ const head = el('p', undefined, 'brief-list-head');
280
+ head.append(el('span', 'Questions', 'plate'), el('span', String(open.length), 'module-count'));
281
+ const ul = el('ul', undefined, 'brief-list');
282
+ ul.dataset.scroll = 'brief-list';
283
+ for (const item of open) {
284
+ const task = item.task, question = item.question;
285
+ const li = el('li');
286
+ const link = el('a', undefined, 'brief-open');
287
+ link.href = typeof spec.href === 'function' ? spec.href(task.id) : '#';
288
+ const top = el('span', undefined, 'brief-open-top');
289
+ top.append(el('span', task.id, 'mono brief-open-task'), el('span', typeof question.text === 'string' && question.text ? question.text : '—', 'brief-open-text'));
290
+ link.append(top);
291
+ const marks = flags(question);
292
+ if (marks) link.append(marks);
293
+ const when = startLine({ deps: waitingDeps(task, run && run.tasks), start: projectionStart(spec.projections, task), now: spec.now, status: task.status });
294
+ if (when) link.append(el('span', when, 'brief-when'));
295
+ li.append(link);
296
+ ul.append(li);
297
+ }
298
+ host.append(head, ul);
299
+ }
300
+
301
+ return { openQuestions, orderQuestions, startLine, renderList, taskSection };
302
+ });
@@ -83,6 +83,10 @@
83
83
  if (w.kind === 'slot') return { ...out, text: `no free slot: ${num(w.running) ?? '?'} of ${num(w.max_parallel) ?? '?'} running` };
84
84
  if (w.kind === 'drained') return { ...out, text: 'drained: nothing new starts until the run resumes' };
85
85
  if (w.kind === 'stopping') return { ...out, text: w.mode === 'now' ? 'the run is stopping now' : 'the run stops once its running tasks end' };
86
+ if (w.kind === 'brief') {
87
+ const asked = ids(w.questions);
88
+ return { ...out, text: asked.length ? `waits for your answer to ${asked.join(', ')}` : 'waits for its brief questions to be written' };
89
+ }
86
90
  if (w.kind === 'next') return { ...out, text: "starts at the scheduler's next turn" };
87
91
  if (w.kind === 'infra') {
88
92
  const cause = RM.causeLabel(w.class);
@@ -98,7 +102,7 @@
98
102
  return null;
99
103
  }
100
104
  // The Now column's order: running, then what starts soonest, then what waits on others, then what is held
101
- const RANK = { running: 0, next: 1, slot: 2, overlap: 2, deps: 3, infra: 4, drained: 5, stopping: 5, escalation: 6 };
105
+ const RANK = { running: 0, next: 1, slot: 2, overlap: 2, brief: 2, deps: 3, infra: 4, drained: 5, stopping: 5, escalation: 6 };
102
106
  function nowRank(task) {
103
107
  if (task && task.now) return RANK.running;
104
108
  const w = task && task.waiting;
@@ -142,7 +146,7 @@
142
146
  if (!s || s.live !== true) return null;
143
147
  const tasks = list(run.tasks), count = kind => tasks.filter(t => t.waiting && t.waiting.kind === kind).length;
144
148
  const state = s.stopping ? (s.stopping === 'now' ? 'stopping now' : 'stopping once its running tasks end') : s.drained ? 'drained: nothing new starts' : 'dispatching';
145
- const waiting = [['deps', 'on dependencies'], ['overlap', 'on shared files'], ['slot', 'for a free slot'], ['infra', 'paused'],
149
+ const waiting = [['deps', 'on dependencies'], ['overlap', 'on shared files'], ['slot', 'for a free slot'], ['brief', 'for your answer'], ['infra', 'paused'],
146
150
  ['next', 'next'], ['escalation', 'stopped by the retry policy']]
147
151
  .map(([kind, label]) => [count(kind), label]).filter(([n]) => n).map(([n, label]) => `${n} ${label}`);
148
152
  const rows = [['Scheduler', state], ['Running', String(tasks.filter(t => t.status === 'RUNNING').length) + (num(s.max_parallel) !== null ? ` of ${s.max_parallel} slots` : '')]];
@@ -29,6 +29,7 @@
29
29
  'max-parallel': { label: 'Max parallel', run: 'at the next dispatch', planOnly: true, live: true },
30
30
  'infra-backoff': { label: 'Infra backoff', run: 'at the next infrastructure wait', planOnly: true },
31
31
  'escalate-effort': { label: 'Effort step', run: 'at the next retry decision', planOnly: true },
32
+ 'summaries': { label: 'Summaries', run: "at each task's next change", task: 'at its next change' },
32
33
  };
33
34
  const BACKOFF_FORMS = 'exp:<base>[,<cap>], linear:<start>,<step>[,<cap>] or list:<a>,<b>,… (seconds)';
34
35
  // A task status after which "Retry now" applies (or the policy stopped it).
@@ -94,6 +95,10 @@
94
95
  if (key === 'max-parallel') {
95
96
  return /^[0-9]{1,2}$/.test(text) && Number(text) >= 1 && Number(text) <= 64 ? { ok: true, value: String(Number(text)) } : bad('a whole number, 1 to 64');
96
97
  }
98
+ if (key === 'summaries') {
99
+ return text === 'on' || text === 'off' || (task && text === 'inherit') ? { ok: true, value: text }
100
+ : bad(task ? 'on, off or inherit' : 'on or off');
101
+ }
97
102
  if (key === 'escalate-effort') return text === 'on' || text === 'off' ? { ok: true, value: text } : bad('on or off');
98
103
  if (key === 'infra-backoff') {
99
104
  // The shape itself is the CLI's to check; here only what can never be one. "default" drops the setting.
@@ -1,7 +1,7 @@
1
1
  /* forge-ui diff viewer: a task's diff (current, previous, committed, or exactly what one reviewer read), a final
2
- review's combined diff or a Fractal node's candidate, with each review finding shown under the line it points
2
+ review's combined diff, an adopted range or a Fractal node's candidate, with each review finding shown under the line it points
3
3
  at. Defines window.ForgeDiff.render(host, ctx). All API values enter the DOM as text.
4
- ctx = { run, spec: {kind: 'task'|'final'|'fractal', task, source, file, name, node, finding}, fetchJSON(path),
4
+ ctx = { run, spec: {kind: 'task'|'final'|'adoption'|'fractal', task, source, file, name, node, finding}, fetchJSON(path),
5
5
  rerender(), href(spec) → hash, closeHref }. */
6
6
  window.ForgeDiff = (() => {
7
7
  'use strict';
@@ -23,6 +23,7 @@ window.ForgeDiff = (() => {
23
23
  function urlFor(run, spec) {
24
24
  const base = `/api/runs/${enc(run.key)}`;
25
25
  if (spec.kind === 'final') return `${base}/final-reviews/${enc(spec.name)}/diff`;
26
+ if (spec.kind === 'adoption') return `${base}/adoptions/${enc(spec.name)}/diff`;
26
27
  if (spec.kind === 'fractal') return `${base}/tasks/${enc(spec.task)}/fractal/nodes/${enc(spec.node)}/diff`;
27
28
  const src = spec.source || 'current';
28
29
  if (TASK_FILES.has(src)) return `${base}/tasks/${enc(spec.task)}/diff${src === 'current' ? '' : '/' + src}`;
@@ -54,6 +55,9 @@ window.ForgeDiff = (() => {
54
55
  const r = f.review || {};
55
56
  head.append(el('span', `${r.kind || 'review'}${r.attempt != null ? ' · attempt ' + r.attempt : ''}${r.spec ? ' · ' + r.spec : ''}`, 'muted'));
56
57
  if (where) head.append(el('span', where, 'mono muted'));
58
+ // #119: the reviewer's own reach, origin and evidence, recorded in shadow (they decide nothing)
59
+ const facts = Object.entries(f.facts || {}).filter(([, v]) => v).map(([k, v]) => `${k} ${v}`);
60
+ if (facts.length) { const t = el('span', facts.join(' · '), 'muted diff-finding-facts'); t.title = "The reviewer's own facts about this finding; they do not change what blocks"; head.append(t); }
57
61
  box.append(head, el('p', said(f)));
58
62
  const more = String(f.text || '').trim();
59
63
  if (more && more !== String(f.summary || '').trim()) { const d = el('details'); d.dataset.keep = `finding-${f.id ?? where ?? said(f)}`; d.append(el('summary', 'Details'), el('pre', more)); box.append(d); }
@@ -128,7 +132,7 @@ window.ForgeDiff = (() => {
128
132
  host.replaceChildren();
129
133
  const D = entry.data;
130
134
  const top = el('div', undefined, 'diff-top');
131
- const what = spec.kind === 'final' ? 'Final review' : spec.kind === 'fractal' ? `${spec.task} · Fractal node ${spec.node}` : spec.task === 'solo' && run.kind === 'solo' ? 'Solo run' : `Task ${spec.task}`;
135
+ const what = spec.kind === 'final' ? 'Final review' : spec.kind === 'adoption' ? `Adopted range · ${spec.name}` : spec.kind === 'fractal' ? `${spec.task} · Fractal node ${spec.node}` : spec.task === 'solo' && run.kind === 'solo' ? 'Solo run' : `Task ${spec.task}`;
132
136
  const title = el('h2'); title.append(el('span', 'Diff · ', 'muted'), document.createTextNode(what)); top.append(title);
133
137
  const close = el('a', undefined, 'diff-close button'); close.href = ctx.closeHref;
134
138
  if (window.ForgeIcons) close.append(window.ForgeIcons.icon('close'));