@giamme/forge 0.17.0 → 0.19.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.
- package/CHANGELOG.md +57 -0
- package/README.md +1 -0
- package/SKILL.md +32 -5
- package/VERSION +1 -1
- package/docs/artifacts.md +33 -1
- package/docs/commands.md +147 -16
- package/docs/dataset.md +5 -0
- package/docs/decomposed-runs.md +122 -1
- package/docs/development.md +2 -1
- package/docs/forge-ui.md +98 -8
- package/docs/memory.md +27 -4
- package/docs/models.md +8 -0
- package/docs/reviews.md +122 -0
- package/docs/safety.md +8 -0
- package/forge +44 -4
- package/package.json +2 -1
- package/references/dataset.md +39 -1
- package/references/decompose.md +737 -16
- package/references/harnesses.md +18 -3
- package/references/planning.md +43 -14
- package/references/solo.md +2 -1
- package/references/ui.md +56 -6
- package/registry.tsv +8 -3
- package/scripts/forge-artifact.sh +14 -0
- package/scripts/forge-brief.py +217 -0
- package/scripts/forge-compare.py +13 -2
- package/scripts/forge-config.py +176 -9
- package/scripts/forge-contract.py +246 -28
- package/scripts/forge-control.py +200 -15
- package/scripts/forge-dispatch.sh +48 -15
- package/scripts/forge-du.py +167 -0
- package/scripts/forge-group.py +496 -0
- package/scripts/forge-groups.py +89 -0
- package/scripts/forge-handoff.py +1128 -0
- package/scripts/forge-lib-adopt.sh +1 -0
- package/scripts/forge-lib-group.sh +641 -0
- package/scripts/forge-lib-plans.sh +343 -4
- package/scripts/forge-lib-review.sh +29 -1
- package/scripts/forge-lib-task.sh +197 -4
- package/scripts/forge-memory.sh +245 -3
- package/scripts/forge-metrics.sh +7 -3
- package/scripts/forge-parallel-options.sh +4 -0
- package/scripts/forge-parallel.sh +1216 -41
- package/scripts/forge-planner.py +104 -8
- package/scripts/forge-prompt.py +120 -0
- package/scripts/forge-retro.py +115 -0
- package/scripts/forge-route.py +190 -12
- package/scripts/forge-runs-compact.py +443 -0
- package/scripts/forge-runs-rm.py +2 -0
- package/scripts/forge-runs.py +27 -8
- package/scripts/forge-schedule.py +633 -49
- package/scripts/forge-shadow.py +7 -1
- package/scripts/forge-solo.sh +4 -0
- package/scripts/forge-summarize.py +698 -0
- package/scripts/forge-ui-options.sh +10 -0
- package/scripts/forge-worktrees.py +243 -0
- package/scripts/forge_brief/__init__.py +831 -0
- package/scripts/forge_brief/answers.py +506 -0
- package/scripts/forge_brief/proposals.py +1630 -0
- package/scripts/forge_dataset/__init__.py +10 -0
- package/scripts/forge_dataset/efforts.py +4 -3
- package/scripts/forge_dataset/export.py +36 -10
- package/scripts/forge_dataset/facts.py +8 -4
- package/scripts/forge_dataset/forecast.py +8 -18
- package/scripts/forge_dataset/harvest.py +241 -12
- package/scripts/forge_dataset/history.py +13 -6
- package/scripts/forge_dataset/importer.py +65 -1
- package/scripts/forge_dataset/names.py +66 -0
- package/scripts/forge_dataset/reviewers.py +5 -2
- package/scripts/forge_dataset/risk.py +6 -3
- package/scripts/forge_dataset/routing.py +6 -1
- package/scripts/forge_decide/__init__.py +11 -1
- package/scripts/forge_groups/__init__.py +308 -0
- package/scripts/forge_groups/attribute.py +289 -0
- package/scripts/forge_groups/review.py +286 -0
- package/scripts/forge_locations.py +366 -0
- package/scripts/forge_owner.py +152 -0
- package/scripts/forge_registry.py +19 -0
- package/scripts/forge_retro/__init__.py +417 -0
- package/scripts/forge_retro/issues.py +1193 -0
- package/scripts/forge_retro/report.py +671 -0
- package/scripts/forge_side/__init__.py +482 -0
- package/scripts/forge_storage.py +515 -0
- package/ui/README.md +68 -8
- package/ui/docs/api.md +375 -31
- package/ui/forge_ui/control.py +451 -11
- package/ui/forge_ui/executions.py +8 -1
- package/ui/forge_ui/export.py +53 -7
- package/ui/forge_ui/groups.py +264 -0
- package/ui/forge_ui/links.py +337 -0
- package/ui/forge_ui/models.py +125 -10
- package/ui/forge_ui/projects.py +4 -1
- package/ui/forge_ui/reader.py +919 -45
- package/ui/forge_ui/server.py +4 -0
- package/ui/forge_ui/static/app.js +173 -11
- package/ui/forge_ui/static/briefview.js +605 -0
- package/ui/forge_ui/static/checksview.js +6 -2
- package/ui/forge_ui/static/controls.js +5 -0
- package/ui/forge_ui/static/diffview.js +86 -1
- package/ui/forge_ui/static/groupsview.js +332 -0
- package/ui/forge_ui/static/index.html +4 -0
- package/ui/forge_ui/static/panel.js +394 -8
- package/ui/forge_ui/static/projectsview.js +189 -10
- package/ui/forge_ui/static/runmodel.js +27 -4
- package/ui/forge_ui/static/storageview.js +352 -0
- package/ui/forge_ui/static/style.css +176 -6
- package/ui/forge_ui/static/worktreesview.js +235 -14
- package/ui/forge_ui/storage.py +150 -0
- package/ui/forge_ui/transcripts.py +35 -10
- package/ui/forge_ui/worktrees.py +154 -13
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/* forge-ui Disk screen (#139): what forge takes on disk in every repository it has runs for (run dirs, worktrees,
|
|
2
|
+
its data home) and the command that takes each part back (window.ForgeStorage, and a CommonJS module under
|
|
3
|
+
node:test). Route #/disk. The same report as `forge du --all`, from the same rules (scripts/forge_storage.py).
|
|
4
|
+
The commands come from the server. Under --read-only they are only ever copied. When controls are on, a
|
|
5
|
+
reclaimable run (and every reclaimable run at once) can be compacted from here, after a dry run and a
|
|
6
|
+
confirmation. Measuring visits every file, so it runs once in the background when the screen opens and
|
|
7
|
+
again on "Measure again"; the page polls only while a measurement runs.
|
|
8
|
+
The pure helpers are tested in ui/tests/js/storageview.test.js.
|
|
9
|
+
ctx = { runHref(key) -> href (a run row's key is null when the run list does not show it), tablePrefs?(id), saveTablePrefs?(id, prefs) }. */
|
|
10
|
+
(function (root, factory) {
|
|
11
|
+
'use strict';
|
|
12
|
+
const api = factory(root);
|
|
13
|
+
if (typeof module === 'object' && module.exports) module.exports = api;
|
|
14
|
+
else root.ForgeStorage = api;
|
|
15
|
+
})(typeof self !== 'undefined' ? self : this, function (root) {
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
const list = v => Array.isArray(v) ? v : [];
|
|
19
|
+
const POLL_MS = 2000;
|
|
20
|
+
|
|
21
|
+
/* ---------- pure ---------- */
|
|
22
|
+
function humanBytes(n) {
|
|
23
|
+
if (!Number.isFinite(n) || n < 0) return '—';
|
|
24
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
25
|
+
let i = 0, v = n;
|
|
26
|
+
while (v >= 1024 && i < units.length - 1) { v /= 1024; i += 1; }
|
|
27
|
+
return (i === 0 ? String(v) : v.toFixed(v < 10 ? 1 : 0)) + ' ' + units[i];
|
|
28
|
+
}
|
|
29
|
+
// A copied command is a compact only when it is `forge runs compact`. `--all` is the whole disk; anything
|
|
30
|
+
// else names one run. `forge du --all` and `forge runs rm` are not compacts.
|
|
31
|
+
function compactKind(command) {
|
|
32
|
+
if (typeof command !== 'string' || !command.includes('forge runs compact')) return null;
|
|
33
|
+
return /(?:^|\s)--all(?:\s|$)/.test(command) ? 'all' : 'run';
|
|
34
|
+
}
|
|
35
|
+
// The compact POST body, without dry_run (the caller adds it). `all` compacts every reclaimable run;
|
|
36
|
+
// a string or {run}|{key} compacts that run.
|
|
37
|
+
function compactBody(target) {
|
|
38
|
+
if (target === 'all' || (target && typeof target === 'object' && target.all === true)) return { all: true };
|
|
39
|
+
if (typeof target === 'string') return { run: target };
|
|
40
|
+
const raw = target && typeof target === 'object' ? (target.run != null ? target.run : target.key) : null;
|
|
41
|
+
return { run: raw == null ? '' : String(raw) };
|
|
42
|
+
}
|
|
43
|
+
function compactPayload(answer) {
|
|
44
|
+
const data = answer && answer.data;
|
|
45
|
+
if (data && typeof data === 'object' && !Array.isArray(data)
|
|
46
|
+
&& ('bytes_freed' in data || 'runs' in data || 'dry_run' in data)) return data;
|
|
47
|
+
return answer && typeof answer === 'object' ? answer : {};
|
|
48
|
+
}
|
|
49
|
+
// What the confirm and the result say: the bytes `forge runs compact --json` would free, and how many runs.
|
|
50
|
+
function compactSummary(answer) {
|
|
51
|
+
const body = compactPayload(answer);
|
|
52
|
+
const bytes = typeof body.bytes_freed === 'number' && Number.isFinite(body.bytes_freed) ? body.bytes_freed : 0;
|
|
53
|
+
const n = Array.isArray(body.runs) ? body.runs.length : 0;
|
|
54
|
+
const runs = n === 1 ? '1 run' : n + ' runs';
|
|
55
|
+
return (body.dry_run ? 'Would free ' : 'Freed ') + humanBytes(bytes) + ' across ' + runs;
|
|
56
|
+
}
|
|
57
|
+
const ACTIVE_RUN = 'this run is active: compact it after it ends';
|
|
58
|
+
// One line on the whole: what forge takes and what can go without losing a run.
|
|
59
|
+
function summary(data) {
|
|
60
|
+
const t = (data && data.totals) || {};
|
|
61
|
+
const parts = [`${humanBytes(t.runs || 0)} in ${list(data && data.runs).length} run dirs`,
|
|
62
|
+
`${humanBytes(t.worktrees || 0)} in ${list(data && data.worktrees).length} worktree folders`];
|
|
63
|
+
if (data && data.data_home) parts.push(`${humanBytes(t.data_home || 0)} in the data home`);
|
|
64
|
+
return { total: (t.runs || 0) + (t.worktrees || 0) + (t.data_home || 0), text: parts.join(' · '), reclaimable: t.reclaimable || 0 };
|
|
65
|
+
}
|
|
66
|
+
// The data home's parts, largest first, with what each is for.
|
|
67
|
+
const HOME_LABEL = { dataset: 'dataset (kept: what forge learns from)', blobs: 'dataset blobs (kept)', archive: 'archives of deleted runs (forge runs rm)',
|
|
68
|
+
exports: 'exports (forge dataset export writes them again)', legacy: 'legacy files from older releases', storage: 'storage records', other: 'other' };
|
|
69
|
+
function homeParts(home) {
|
|
70
|
+
const p = (home && home.parts) || {};
|
|
71
|
+
return Object.keys(HOME_LABEL).filter(k => p[k] > 0).map(k => ({ key: k, label: HOME_LABEL[k], bytes: p[k] })).sort((a, b) => b.bytes - a.bytes);
|
|
72
|
+
}
|
|
73
|
+
const repoName = p => typeof p === 'string' && p ? p.replace(/\/+$/, '').split('/').pop() : '—';
|
|
74
|
+
// The chart's parts, in a fixed order that fixes their colours (--disk-1 … --disk-6): a part keeps its colour
|
|
75
|
+
// whatever else is on screen.
|
|
76
|
+
const PARTS = [
|
|
77
|
+
{ key: 'snapshots', label: 'review snapshots', note: 'can go: nothing reads them', color: 'var(--disk-1)' },
|
|
78
|
+
{ key: 'logs', label: 'logs', note: 'gzipping the log copies takes most of it back', color: 'var(--disk-2)' },
|
|
79
|
+
{ key: 'other', label: 'other run files', note: 'prompts, diffs, verdicts: what forge-ui shows', color: 'var(--disk-3)' },
|
|
80
|
+
{ key: 'strays', label: "not forge's", note: 'found inside run dirs; forge never removes them', color: 'var(--disk-4)' },
|
|
81
|
+
{ key: 'worktrees', label: 'worktrees', note: 'see the Worktrees screen', color: 'var(--disk-5)' },
|
|
82
|
+
{ key: 'home', label: 'data home', note: 'the dataset (kept), archives, exports', color: 'var(--disk-6)' },
|
|
83
|
+
];
|
|
84
|
+
// [{key, label, note, color, bytes, share}] of everything forge takes, in PARTS order; empty parts stay (0 bytes).
|
|
85
|
+
function breakdown(data) {
|
|
86
|
+
const t = (data && data.totals) || {}, runs = list(data && data.runs);
|
|
87
|
+
const sum = f => runs.reduce((n, r) => n + (Number(f(r)) || 0), 0);
|
|
88
|
+
const bytes = { snapshots: sum(r => r.snapshots), logs: sum(r => (r.logs || 0) + (r.gz || 0)), other: sum(r => (r.other || 0) + (r.fractal || 0)),
|
|
89
|
+
strays: sum(r => r.strays), worktrees: t.worktrees || 0, home: (data && data.data_home && data.data_home.bytes) || 0 };
|
|
90
|
+
const total = Object.values(bytes).reduce((a, b) => a + b, 0);
|
|
91
|
+
return PARTS.map(p => ({ ...p, bytes: bytes[p.key], share: total ? bytes[p.key] / total : 0 }));
|
|
92
|
+
}
|
|
93
|
+
// [{repo, name, total, parts: {key: bytes}}] largest first: each repository's run dirs and worktree folders.
|
|
94
|
+
function byRepo(data) {
|
|
95
|
+
const out = new Map();
|
|
96
|
+
const at = repo => {
|
|
97
|
+
const k = repo || '';
|
|
98
|
+
if (!out.has(k)) out.set(k, { repo: repo || null, name: repo ? repoName(repo) : 'unknown repository', total: 0,
|
|
99
|
+
parts: { snapshots: 0, logs: 0, other: 0, strays: 0, worktrees: 0 } });
|
|
100
|
+
return out.get(k);
|
|
101
|
+
};
|
|
102
|
+
const add = (g, key, n) => { n = Number(n) || 0; g.parts[key] += n; g.total += n; };
|
|
103
|
+
for (const r of list(data && data.runs)) {
|
|
104
|
+
const g = at(r.repo);
|
|
105
|
+
add(g, 'snapshots', r.snapshots); add(g, 'logs', (r.logs || 0) + (r.gz || 0)); add(g, 'other', (r.other || 0) + (r.fractal || 0)); add(g, 'strays', r.strays);
|
|
106
|
+
}
|
|
107
|
+
for (const w of list(data && data.worktrees)) add(at(w.repo), 'worktrees', w.bytes);
|
|
108
|
+
return Array.from(out.values()).filter(g => g.total > 0).sort((a, b) => b.total - a.total);
|
|
109
|
+
}
|
|
110
|
+
const pct = x => x >= 0.995 ? '100%' : x >= 0.1 ? Math.round(x * 100) + '%' : x > 0 ? (x * 100 < 1 ? '<1%' : (x * 100).toFixed(0) + '%') : '0%';
|
|
111
|
+
|
|
112
|
+
/* ---------- DOM ---------- */
|
|
113
|
+
function render(host, ctx) {
|
|
114
|
+
const UI = root.ForgeUI;
|
|
115
|
+
const el = (tag, text, cls) => UI.el(tag, text, cls);
|
|
116
|
+
const s = { answer: null, error: null, timer: null, seq: 0, writes: false, compacting: false };
|
|
117
|
+
|
|
118
|
+
const head = el('div', undefined, 'wt-head');
|
|
119
|
+
const again = el('button', 'Measure again'); again.type = 'button';
|
|
120
|
+
again.title = 'Visit every file again now; it takes a while on large run dirs';
|
|
121
|
+
again.addEventListener('click', () => load(true));
|
|
122
|
+
const stamp = el('span', '', 'muted wt-stamp');
|
|
123
|
+
head.append(el('h1', 'Disk', 'module-title'), again, stamp);
|
|
124
|
+
const LEDE_OFF = 'What forge takes on disk in every repository it has runs for, and the command that takes each part back. Review snapshots and log copies can go without losing a run: every run stays viewable here and in the dataset. Commands are only copied: this page runs nothing.';
|
|
125
|
+
const LEDE_ON = 'What forge takes on disk in every repository it has runs for, and the command that takes each part back. Review snapshots and log copies can go without losing a run: every run stays viewable here and in the dataset. Copy a command, or compact from here after a dry run and a confirmation.';
|
|
126
|
+
const lede = el('p', LEDE_OFF, 'muted wt-lede');
|
|
127
|
+
const status = el('p', undefined, 'wt-totals'); status.setAttribute('role', 'status');
|
|
128
|
+
const cmds = el('div', undefined, 'disk-commands');
|
|
129
|
+
const action = el('div');
|
|
130
|
+
const chart = el('section', undefined, 'disk-chart');
|
|
131
|
+
chart.setAttribute('aria-label', 'Where the space goes');
|
|
132
|
+
const tip = el('div', undefined, 'disk-tip'); tip.hidden = true; tip.setAttribute('role', 'tooltip');
|
|
133
|
+
const tableHost = el('div', undefined, 'wt-table');
|
|
134
|
+
const extra = el('section', undefined, 'disk-extra');
|
|
135
|
+
host.replaceChildren(head, lede, status, chart, cmds, action, tableHost, extra, tip);
|
|
136
|
+
|
|
137
|
+
// one tooltip for every segment: what it is, its size and its share, beside the pointer or the focused segment
|
|
138
|
+
function showTip(seg, x, y) {
|
|
139
|
+
const p = seg._part;
|
|
140
|
+
tip.replaceChildren(el('strong', p.label), el('span', ` ${humanBytes(p.bytes)} · ${pct(p.share)}${seg._of ? ' of ' + seg._of : ''}`), el('span', p.note, 'muted'));
|
|
141
|
+
tip.hidden = false;
|
|
142
|
+
const box = host.getBoundingClientRect(), w = tip.offsetWidth;
|
|
143
|
+
tip.style.left = Math.max(0, Math.min(x - box.left + 12, box.width - w)) + 'px';
|
|
144
|
+
tip.style.top = (y - box.top + 16) + 'px';
|
|
145
|
+
}
|
|
146
|
+
function segment(part, width, of) {
|
|
147
|
+
const seg = el('span', undefined, 'disk-seg');
|
|
148
|
+
seg._part = part; seg._of = of;
|
|
149
|
+
seg.style.flexGrow = String(width); seg.style.background = part.color;
|
|
150
|
+
seg.tabIndex = 0;
|
|
151
|
+
seg.setAttribute('aria-label', `${part.label}: ${humanBytes(part.bytes)}, ${pct(part.share)}${of ? ' of ' + of : ''}`);
|
|
152
|
+
seg.addEventListener('pointermove', e => showTip(seg, e.clientX, e.clientY));
|
|
153
|
+
seg.addEventListener('pointerleave', () => { tip.hidden = true; });
|
|
154
|
+
seg.addEventListener('focus', () => { const r = seg.getBoundingClientRect(); showTip(seg, r.left + r.width / 2, r.bottom - 8); });
|
|
155
|
+
seg.addEventListener('blur', () => { tip.hidden = true; });
|
|
156
|
+
return seg;
|
|
157
|
+
}
|
|
158
|
+
function drawChart(d) {
|
|
159
|
+
const parts = breakdown(d), total = parts.reduce((n, p) => n + p.bytes, 0);
|
|
160
|
+
if (!total) { chart.replaceChildren(); return; }
|
|
161
|
+
const whole = el('div', undefined, 'disk-bar disk-bar-whole');
|
|
162
|
+
for (const p of parts) if (p.bytes > 0) whole.append(segment(p, p.bytes));
|
|
163
|
+
const legend = el('ul', undefined, 'disk-legend');
|
|
164
|
+
for (const p of parts) {
|
|
165
|
+
if (!p.bytes) continue;
|
|
166
|
+
const li = el('li'); const sw = el('i', undefined, 'disk-swatch'); sw.style.background = p.color;
|
|
167
|
+
li.append(sw, el('span', p.label), el('strong', humanBytes(p.bytes)), el('span', pct(p.share), 'muted'));
|
|
168
|
+
li.title = p.note; legend.append(li);
|
|
169
|
+
}
|
|
170
|
+
const repos = byRepo(d).slice(0, 10), top = repos.length ? repos[0].total : 0;
|
|
171
|
+
const rows = el('div', undefined, 'disk-repos');
|
|
172
|
+
for (const g of repos) {
|
|
173
|
+
const row = el('div', undefined, 'disk-repo');
|
|
174
|
+
const name = el('span', g.name, 'disk-repo-name'); if (g.repo) name.title = g.repo;
|
|
175
|
+
const track = el('div', undefined, 'disk-track');
|
|
176
|
+
const bar = el('div', undefined, 'disk-bar'); bar.style.width = (100 * g.total / top) + '%';
|
|
177
|
+
for (const p of parts) {
|
|
178
|
+
const n = g.parts[p.key] || 0;
|
|
179
|
+
if (n > 0) bar.append(segment({ ...p, bytes: n, share: n / g.total }, n, g.name));
|
|
180
|
+
}
|
|
181
|
+
track.append(bar);
|
|
182
|
+
row.append(name, track, el('span', humanBytes(g.total), 'disk-repo-size'));
|
|
183
|
+
rows.append(row);
|
|
184
|
+
}
|
|
185
|
+
const parts2 = [el('h2', 'Where the space goes', 'plate'), whole, legend];
|
|
186
|
+
if (repos.length) parts2.push(el('h2', 'By repository' + (byRepo(d).length > repos.length ? ' (the 10 largest)' : ''), 'plate disk-sub'), rows);
|
|
187
|
+
chart.replaceChildren(...parts2);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function copyButton(command) {
|
|
191
|
+
const b = el('button', 'Copy', 'wt-copy'); b.type = 'button';
|
|
192
|
+
b.setAttribute('aria-label', 'Copy: ' + command);
|
|
193
|
+
b.addEventListener('click', async () => {
|
|
194
|
+
try { await navigator.clipboard.writeText(command); b.textContent = 'Copied'; }
|
|
195
|
+
catch (_) { b.textContent = 'Copy failed: select it'; }
|
|
196
|
+
setTimeout(() => { b.textContent = 'Copy'; }, 2500);
|
|
197
|
+
});
|
|
198
|
+
return b;
|
|
199
|
+
}
|
|
200
|
+
function commandBox(c, key) {
|
|
201
|
+
const box = el('div', undefined, 'wt-cmd');
|
|
202
|
+
const code = el('code', c.command, 'mono'); code.tabIndex = 0; code.title = c.label;
|
|
203
|
+
box.append(code, copyButton(c.command));
|
|
204
|
+
const kind = compactKind(c && c.command);
|
|
205
|
+
if (s.writes && kind === 'all') box.append(compactButton('Compact all', { all: true }));
|
|
206
|
+
else if (s.writes && kind === 'run' && key) box.append(compactButton('Compact', { run: key }));
|
|
207
|
+
return box;
|
|
208
|
+
}
|
|
209
|
+
function compactButton(text, target) {
|
|
210
|
+
const b = el('button', text, 'wt-copy ui-danger'); b.type = 'button';
|
|
211
|
+
b.addEventListener('click', () => { runCompact(target); });
|
|
212
|
+
return b;
|
|
213
|
+
}
|
|
214
|
+
function refusedActive(res) { return !!(res && res.status === 409 && res.error !== 'busy'); }
|
|
215
|
+
async function runCompact(target) {
|
|
216
|
+
if (s.compacting) return;
|
|
217
|
+
s.compacting = true;
|
|
218
|
+
for (const child of [...action.children]) child.remove();
|
|
219
|
+
const path = '/api/storage/compact';
|
|
220
|
+
const base = compactBody(target);
|
|
221
|
+
try {
|
|
222
|
+
const preview = await UI.post(path, { ...base, dry_run: true });
|
|
223
|
+
if (!action.isConnected) return;
|
|
224
|
+
if (refusedActive(preview)) {
|
|
225
|
+
UI.outcome(action, { ok: false, status: 409, error: preview.error || 'refused', detail: ACTIVE_RUN });
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (!preview || !preview.ok || (preview.data && preview.data.ok === false)) {
|
|
229
|
+
UI.outcome(action, preview && preview.ok ? { ok: false, status: preview.status || 500, error: 'failed', detail: 'Could not preview what compact would free' } : preview);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const yes = await UI.confirmInline(action, compactSummary(preview), { danger: true });
|
|
233
|
+
if (!action.isConnected || !yes) return;
|
|
234
|
+
const res = await UI.post(path, { ...base, dry_run: false });
|
|
235
|
+
if (!action.isConnected) return;
|
|
236
|
+
if (refusedActive(res)) {
|
|
237
|
+
UI.outcome(action, { ok: false, status: 409, error: res.error || 'refused', detail: ACTIVE_RUN });
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (!res || !res.ok) { UI.outcome(action, res); return; }
|
|
241
|
+
UI.outcome(action, res, compactSummary(res));
|
|
242
|
+
await load(true);
|
|
243
|
+
} finally {
|
|
244
|
+
s.compacting = false;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const when = t => Number.isFinite(t) ? new Date(t * 1000).toLocaleString() : '—';
|
|
248
|
+
const bytesCell = n => Number.isFinite(n) && n > 0 ? humanBytes(n) : '—';
|
|
249
|
+
const columns = [
|
|
250
|
+
{ id: 'run', label: 'Run', value: r => r.run_id, cell: r => {
|
|
251
|
+
const href = r.key && ctx.runHref ? ctx.runHref(r.key) : null;
|
|
252
|
+
const n = el(href ? 'a' : 'span', r.run_id, 'mono'); if (href) n.href = href; n.title = r.path; return n; } },
|
|
253
|
+
{ id: 'repo', label: 'Repository', value: r => repoName(r.repo), cell: r => { const n = el('span', repoName(r.repo)); if (r.repo) n.title = r.repo; return n; } },
|
|
254
|
+
{ id: 'total', label: 'Total', value: r => r.total, cell: r => humanBytes(r.total) },
|
|
255
|
+
{ id: 'snapshots', label: 'Snapshots', title: 'review snapshots: nothing reads one once its review ended', value: r => r.snapshots, cell: r => bytesCell(r.snapshots) },
|
|
256
|
+
{ id: 'logs', label: 'Logs', value: r => r.logs + r.gz, cell: r => bytesCell(r.logs + r.gz) },
|
|
257
|
+
{ id: 'strays', label: "Not forge's", title: 'a dependency install or a .git found inside the run dir: forge never removes these', value: r => r.strays, cell: r => bytesCell(r.strays) },
|
|
258
|
+
{ id: 'reclaimable', label: 'Can go', title: 'what forge runs compact --logs would take back (logs estimated)', value: r => r.reclaimable, cell: r => bytesCell(r.reclaimable) },
|
|
259
|
+
{ id: 'command', label: 'Command', sortable: false, cls: 'wt-command-col', cell: r => { const box = el('div', undefined, 'wt-cmds'); for (const c of list(r.commands)) box.append(commandBox(c, r.key)); return box; } },
|
|
260
|
+
{ id: 'updated', label: 'Changed', value: r => r.updated, cell: r => when(r.updated) },
|
|
261
|
+
{ id: 'path', label: 'Path', value: r => r.path, cell: r => el('span', r.path, 'mono'), hidden: true },
|
|
262
|
+
];
|
|
263
|
+
function drawExtra(d) {
|
|
264
|
+
const out = [];
|
|
265
|
+
if (list(d.strays).length) {
|
|
266
|
+
const box = el('div', undefined, 'disk-block');
|
|
267
|
+
box.append(el('h2', "Not forge's, found inside run dirs", 'plate'), el('p', 'forge never removes these. Delete them by hand if nothing needs them.', 'muted'));
|
|
268
|
+
const ul = el('ul', undefined, 'disk-list');
|
|
269
|
+
for (const x of list(d.strays)) { const li = el('li'); li.append(el('strong', humanBytes(x.bytes)), el('span', ' '), el('span', x.path, 'mono')); ul.append(li); }
|
|
270
|
+
box.append(ul); out.push(box);
|
|
271
|
+
}
|
|
272
|
+
const wt = el('div', undefined, 'disk-block');
|
|
273
|
+
wt.append(el('h2', 'Worktrees', 'plate'));
|
|
274
|
+
const line = el('p');
|
|
275
|
+
line.append(el('span', `${humanBytes((d.totals || {}).worktrees || 0)} in ${list(d.worktrees).length} worktree folders. `));
|
|
276
|
+
const a = el('a', 'Open the Worktrees screen'); a.href = '#/worktrees';
|
|
277
|
+
line.append(a, el('span', ' for the state of each one and the command that removes it safely.'));
|
|
278
|
+
wt.append(line);
|
|
279
|
+
if (list(d.worktrees).length) {
|
|
280
|
+
const ul = el('ul', undefined, 'disk-list');
|
|
281
|
+
for (const w of list(d.worktrees).slice(0, 8)) { const li = el('li'); li.append(el('strong', humanBytes(w.bytes)), el('span', ' '), el('span', w.path, 'mono')); ul.append(li); }
|
|
282
|
+
wt.append(ul);
|
|
283
|
+
}
|
|
284
|
+
out.push(wt);
|
|
285
|
+
if (d.data_home) {
|
|
286
|
+
const box = el('div', undefined, 'disk-block');
|
|
287
|
+
box.append(el('h2', 'Data home', 'plate'));
|
|
288
|
+
const p = el('p'); p.append(el('span', humanBytes(d.data_home.bytes) + ' in '), el('span', d.data_home.path, 'mono')); box.append(p);
|
|
289
|
+
const ul = el('ul', undefined, 'disk-list');
|
|
290
|
+
for (const x of homeParts(d.data_home)) { const li = el('li'); li.append(el('strong', humanBytes(x.bytes)), el('span', ' ' + x.label)); ul.append(li); }
|
|
291
|
+
box.append(ul); out.push(box);
|
|
292
|
+
}
|
|
293
|
+
extra.replaceChildren(...out);
|
|
294
|
+
}
|
|
295
|
+
function drawNow() {
|
|
296
|
+
lede.textContent = s.writes ? LEDE_ON : LEDE_OFF;
|
|
297
|
+
const a = s.answer, d = a && a.data;
|
|
298
|
+
if (s.error) status.replaceChildren(el('span', `Could not read the disk report (${s.error}).`, 'warn'));
|
|
299
|
+
else if (!a) status.replaceChildren(el('span', 'Asking…', 'muted'));
|
|
300
|
+
else if (a.state === 'unavailable' || (a.state === 'error' && !d)) status.replaceChildren(el('span', `Could not measure: ${a.error || 'unknown error'}.`, 'warn'));
|
|
301
|
+
else if (a.state === 'measuring' && !d) {
|
|
302
|
+
const p = a.progress;
|
|
303
|
+
status.replaceChildren(el('span', p && p.of ? `Measuring run dir ${p.done + 1} of ${p.of}… every file is visited, so a large one takes a while.` : 'Measuring… every file is visited, so this takes a while.', 'muted'));
|
|
304
|
+
} else if (d) {
|
|
305
|
+
const sum = summary(d);
|
|
306
|
+
const parts = [el('strong', humanBytes(sum.total)), el('span', ' · ' + sum.text)];
|
|
307
|
+
if (sum.reclaimable) parts.push(el('span', ` · about ${humanBytes(sum.reclaimable)} can go without losing a run`));
|
|
308
|
+
if (a.state === 'measuring') parts.push(el('span', ' · measuring again…', 'muted'));
|
|
309
|
+
if (!d.complete) parts.push(el('span', ' · measuring stopped at its time limit: some sizes are lower bounds', 'muted'));
|
|
310
|
+
status.replaceChildren(...parts);
|
|
311
|
+
}
|
|
312
|
+
if (!d) { chart.replaceChildren(); cmds.replaceChildren(); tableHost.replaceChildren(); extra.replaceChildren(); return; }
|
|
313
|
+
drawChart(d);
|
|
314
|
+
stamp.textContent = 'measured ' + when(d.computed);
|
|
315
|
+
cmds.replaceChildren(...list(d.commands).map(commandBox));
|
|
316
|
+
if (!list(d.runs).length) tableHost.replaceChildren(el('p', 'forge has no registered runs.', 'muted'));
|
|
317
|
+
else {
|
|
318
|
+
tableHost.replaceChildren();
|
|
319
|
+
root.ForgeTable.render(tableHost, { id: 'disk', label: 'Run dirs', columns, rows: list(d.runs), className: 'wt-grid',
|
|
320
|
+
onRow: (_row, tr) => { for (const td of tr.children) if (!td.classList.contains('wt-command-col') && !td.title) td.title = td.textContent; },
|
|
321
|
+
prefs: ctx.tablePrefs ? ctx.tablePrefs('disk') : null, savePrefs: p => ctx.saveTablePrefs && ctx.saveTablePrefs('disk', p) });
|
|
322
|
+
}
|
|
323
|
+
drawExtra(d);
|
|
324
|
+
}
|
|
325
|
+
// A redraw never pulls a command out from under someone selecting or copying it (#115).
|
|
326
|
+
const draw = () => { if (UI.guard) UI.guard(host, drawNow); else drawNow(); };
|
|
327
|
+
UI.controlsEnabled().then(on => {
|
|
328
|
+
const next = !!on;
|
|
329
|
+
if (s.writes === next) return;
|
|
330
|
+
s.writes = next;
|
|
331
|
+
draw();
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
async function load(refresh) {
|
|
335
|
+
const mine = ++s.seq;
|
|
336
|
+
again.disabled = true;
|
|
337
|
+
const res = await UI.get('/api/storage' + (refresh ? '?refresh=1' : ''));
|
|
338
|
+
if (mine !== s.seq) return;
|
|
339
|
+
if (res.ok) { s.answer = res.data; s.error = null; } else s.error = res.detail || res.error || 'no answer';
|
|
340
|
+
again.disabled = !!(s.answer && s.answer.state === 'measuring');
|
|
341
|
+
draw();
|
|
342
|
+
clearTimeout(s.timer);
|
|
343
|
+
if (host.isConnected && s.answer && s.answer.state === 'measuring')
|
|
344
|
+
s.timer = setTimeout(() => { if (host.isConnected) load(false); }, POLL_MS);
|
|
345
|
+
}
|
|
346
|
+
drawNow();
|
|
347
|
+
load(false);
|
|
348
|
+
return { reload: () => load(true) };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return { render, humanBytes, summary, homeParts, repoName, HOME_LABEL, PARTS, breakdown, byRepo, pct, compactBody, compactSummary };
|
|
352
|
+
});
|
|
@@ -61,6 +61,13 @@
|
|
|
61
61
|
--sev-p1: light-dark(#783ebd, #c18dff);
|
|
62
62
|
--sev-p2: light-dark(#335dbd, #88a9ff);
|
|
63
63
|
--sev-p3: light-dark(#56635b, #a7b2ab);
|
|
64
|
+
/* the Disk screen's parts, a fixed categorical order checked for colour-blind separation on --module, both themes */
|
|
65
|
+
--disk-1: light-dark(#2a78d6, #3987e5);
|
|
66
|
+
--disk-2: light-dark(#eb6834, #d95926);
|
|
67
|
+
--disk-3: light-dark(#1baf7a, #199e70);
|
|
68
|
+
--disk-4: light-dark(#eda100, #c98500);
|
|
69
|
+
--disk-5: light-dark(#e87ba4, #d55181);
|
|
70
|
+
--disk-6: light-dark(#6250d6, #9085e9);
|
|
64
71
|
/* the 3D stage: body, hairlines and the accent of what is live */
|
|
65
72
|
--stage-accent: var(--lamp-amber);
|
|
66
73
|
--stage-body: light-dark(#f3f5f0, #161c19);
|
|
@@ -94,15 +101,16 @@
|
|
|
94
101
|
|
|
95
102
|
/* status: the lamp behind each forge state. One meaning each (--st; --st-lit on the 3D plate): four lamps, and the
|
|
96
103
|
waiting lamp for a task that waits for the user (NEEDS_INPUT, NEEDS_DECISION, and an integration that only waits for the user).
|
|
104
|
+
IMPLEMENTED waits for its group's review and uses that same waiting lamp.
|
|
97
105
|
A hollow lamp is that lamp's family but not its plain case: passed without a merge, stopped, failed outside the code,
|
|
98
106
|
an outdated review, waiting for you */
|
|
99
107
|
.st-merged, .st-pass, .st-accepted, .st-nochanges { --st: var(--lamp-green); --st-lit: var(--lit-green); }
|
|
100
108
|
.st-running, .st-interrupted { --st: var(--lamp-amber); --st-lit: var(--lit-amber); }
|
|
101
109
|
.st-pending, .st-none, .st-unknown, .st-invalidated, .st-outdated { --st: var(--lamp-off); --st-lit: var(--lamp-off); }
|
|
102
110
|
.st-fail, .st-error, .st-conflict, .st-infra, .st-timeout, .st-blocked, .st-bounced, .st-incomplete { --st: var(--lamp-red); --st-lit: var(--lit-red); }
|
|
103
|
-
.st-needs_input, .st-needs_decision, .st-waiting { --st: var(--lamp-wait); --st-lit: var(--lit-wait); }
|
|
111
|
+
.st-needs_input, .st-needs_decision, .st-waiting, .st-implemented { --st: var(--lamp-wait); --st-lit: var(--lit-wait); }
|
|
104
112
|
[class^="st-"], [class*=" st-"] { --st-fill: var(--st); --st-ring: var(--lamp-edge); }
|
|
105
|
-
.st-accepted, .st-nochanges, .st-interrupted, .st-infra, .st-timeout, .st-blocked, .st-outdated, .st-needs_input, .st-needs_decision, .st-waiting { --st-fill: transparent; --st-ring: var(--st); }
|
|
113
|
+
.st-accepted, .st-nochanges, .st-interrupted, .st-infra, .st-timeout, .st-blocked, .st-outdated, .st-needs_input, .st-needs_decision, .st-waiting, .st-implemented { --st-fill: transparent; --st-ring: var(--st); }
|
|
106
114
|
/* verification lanes: flaky passed on a rerun (amber, hollow), known passed with only baseline failures (green, hollow) */
|
|
107
115
|
.st-flaky { --st: var(--lamp-amber); --st-lit: var(--lit-amber); --st-fill: transparent; --st-ring: var(--st); }
|
|
108
116
|
.st-known { --st: var(--lamp-green); --st-lit: var(--lit-green); --st-fill: transparent; --st-ring: var(--st); }
|
|
@@ -165,6 +173,11 @@ a.chip, a.chip:hover { color: inherit; text-decoration: none; }
|
|
|
165
173
|
.sev-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--t-xs); white-space: nowrap; }
|
|
166
174
|
.sev-chip::before { content: ''; width: 9px; height: 9px; clip-path: var(--sev-shape, circle(30%)); background: var(--sev, var(--muted)); flex: none; }
|
|
167
175
|
.chip.sev-chip { font-family: var(--mono); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: var(--t-xs); }
|
|
176
|
+
/* IMPLEMENTED's label is a phrase, so it keeps the waiting lamp and drops the status-word capitals */
|
|
177
|
+
.chip.st-implemented { text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-weight: 650; font-size: var(--t-xs); }
|
|
178
|
+
a.group-chip { display: inline-flex; align-items: center; padding: 0 6px; border: 1px solid var(--rule); border-radius: var(--r-small); background: var(--key); color: var(--ink);
|
|
179
|
+
font-family: var(--mono); font-weight: 600; font-size: var(--t-xs); letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap; }
|
|
180
|
+
a.group-chip:hover { text-decoration: underline; text-underline-offset: 2px; }
|
|
168
181
|
/* a model's name plate: the alias engraved, its effort beside it; the one way a model is shown */
|
|
169
182
|
.model-plate { display: inline-flex; align-items: stretch; vertical-align: middle; border: 1px solid var(--rule-2); border-radius: var(--r-small); overflow: hidden; white-space: nowrap; line-height: 1.55; }
|
|
170
183
|
.model-plate .mp-name { padding: 0 6px; background: var(--module-2); color: var(--ink); font-family: var(--font-plate); font-weight: 700; font-size: .857rem; letter-spacing: .06em; text-transform: uppercase; transition: background-color var(--relay); }
|
|
@@ -337,16 +350,25 @@ body.no-tasks .tasks-module { display: none; }
|
|
|
337
350
|
body[data-shell=workbench].no-tasks .run-view { grid-template-rows: auto minmax(0, 1fr) auto 0; }
|
|
338
351
|
body[data-shell=immersive] .sidebar { position: absolute; z-index: 4; left: var(--gap); top: var(--gap); bottom: var(--gap); width: var(--runs-w); box-shadow: var(--ply-1); }
|
|
339
352
|
body[data-shell=immersive][data-runs=closed] .sidebar { display: none; }
|
|
340
|
-
body[data-shell=immersive]:is([data-view=models], [data-view=findings], [data-view=settings], [data-view=worktrees], [data-view=projects], [data-view=waiting], [data-view=loading], [data-view=first-run]) #main { left: calc(var(--L) - var(--gap)); }
|
|
353
|
+
body[data-shell=immersive]:is([data-view=models], [data-view=findings], [data-view=settings], [data-view=worktrees], [data-view=disk], [data-view=projects], [data-view=waiting], [data-view=loading], [data-view=first-run], [data-view=group]) #main { left: calc(var(--L) - var(--gap)); }
|
|
341
354
|
body[data-shell=immersive] .stage-row, body[data-shell=immersive] .stage-col { position: absolute; inset: 0; }
|
|
342
355
|
body[data-shell=immersive] .stage-col .stage-slot { position: absolute; inset: 0; }
|
|
343
356
|
body[data-shell=immersive] .insp-module { position: absolute; z-index: 3; right: var(--gap); top: var(--gap); bottom: var(--gap); width: var(--insp-w); box-shadow: var(--ply-1); }
|
|
344
357
|
body[data-shell=immersive][data-insp=closed] .insp-module { display: none; }
|
|
345
358
|
body[data-shell=immersive] .run-header { position: absolute; z-index: 3; left: var(--L); top: var(--gap); width: min(1040px, calc(100% - var(--L) - var(--R))); box-shadow: var(--ply-1); }
|
|
346
359
|
body[data-shell=immersive] .tasks-module { position: absolute; z-index: 3; left: var(--L); right: var(--R); bottom: var(--gap); height: var(--tasks-h); box-shadow: var(--ply-1); }
|
|
360
|
+
body[data-shell=immersive] .groups-module:not([hidden]) { position: absolute; z-index: 3; left: var(--L); right: var(--R); bottom: var(--B); max-height: min(32vh, 240px); box-shadow: var(--ply-1); }
|
|
347
361
|
body[data-shell=immersive][data-tasks=closed] .tasks-module { height: auto; }
|
|
348
362
|
body[data-shell=immersive] .strip-wrap { position: absolute; z-index: 2; left: var(--L); right: var(--R); bottom: var(--B); }
|
|
349
363
|
body[data-shell=immersive] .stage-col .graph, body[data-shell=immersive] .stage-col .files-view { position: absolute; inset: 0; overflow: auto; padding: calc(var(--head-h, 132px) + 2 * var(--gap)) var(--R) calc(var(--B) + var(--gap)) var(--L); }
|
|
364
|
+
/* --groups-h is the groups block's used height, published from its border box. The strip, the stage
|
|
365
|
+
note and the 2D stage padding sit one gap above that block. Below 761px the modules stack in flow. */
|
|
366
|
+
@media (min-width: 761px) {
|
|
367
|
+
body[data-shell=immersive] .run-view.has-groups .strip-wrap { bottom: calc(var(--B) + var(--groups-h, 0px) + var(--gap)); }
|
|
368
|
+
body[data-shell=immersive] .run-view.has-groups .stage-col .graph,
|
|
369
|
+
body[data-shell=immersive] .run-view.has-groups .stage-col .files-view { padding-bottom: calc(var(--B) + var(--groups-h, 0px) + 2 * var(--gap)); }
|
|
370
|
+
body[data-shell=immersive] .run-view.has-groups .stage-note { bottom: calc(var(--B) + var(--groups-h, 0px) + var(--gap) + 60px); }
|
|
371
|
+
}
|
|
350
372
|
body[data-shell=immersive] .diff-view { position: absolute; z-index: 3; left: var(--L); right: var(--gap); top: var(--gap); bottom: var(--B); overflow: auto; padding: var(--s-4); box-shadow: var(--ply-1); }
|
|
351
373
|
body[data-shell=immersive] .run-view.diff-open .run-header { display: none; }
|
|
352
374
|
body[data-shell=immersive] .map-head-module { position: absolute; z-index: 3; left: var(--L); top: var(--gap); width: max-content; max-width: calc(100% - var(--L) - var(--gap)); box-shadow: var(--ply-1); }
|
|
@@ -381,6 +403,12 @@ body[data-shell=workbench] .insp-module .splitter.v { left: -5px; }
|
|
|
381
403
|
body[data-shell=workbench] .run-header { grid-area: head; border-radius: 0; border-width: 0 0 1px; }
|
|
382
404
|
body[data-shell=workbench] .strip-wrap { grid-area: strip; padding: var(--s-2) var(--s-3) 0; }
|
|
383
405
|
body[data-shell=workbench] .tasks-module { grid-area: tasks; position: relative; border-radius: 0; border-width: 1px 0 0; }
|
|
406
|
+
body[data-shell=workbench] .run-view.has-groups { grid-template-rows: auto minmax(0, 1fr) auto auto var(--tasks-h);
|
|
407
|
+
grid-template-areas: "head insp" "stage insp" "strip insp" "groups insp" "tasks insp"; }
|
|
408
|
+
body[data-shell=workbench][data-tasks=closed] .run-view.has-groups { grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
|
|
409
|
+
body[data-shell=workbench] .groups-module { grid-area: groups; position: relative; border-radius: 0; border-width: 1px 0 0; max-height: min(32vh, 240px); }
|
|
410
|
+
body[data-shell=workbench] .run-view.diff-open.has-groups .diff-view { grid-area: 2 / 1 / 6 / 3; }
|
|
411
|
+
body[data-shell] .run-view.diff-open .groups-module { display: none; }
|
|
384
412
|
body[data-shell=workbench] .tasks-module .splitter.h { top: -5px; }
|
|
385
413
|
body[data-shell=workbench] .run-view.diff-open .diff-view { grid-area: 2 / 1 / 5 / 3; overflow: auto; padding: var(--s-4); border-radius: 0; border-width: 0; }
|
|
386
414
|
body[data-shell=workbench] .map-view { display: grid; grid-template-rows: auto minmax(0, 1fr); }
|
|
@@ -392,7 +420,7 @@ body[data-shell=workbench] .map-cards-host { overflow: auto; }
|
|
|
392
420
|
body[data-shell=workbench] .map-cards { padding: var(--s-4); }
|
|
393
421
|
|
|
394
422
|
/* content views: the leaderboard and the waiting pages */
|
|
395
|
-
body:is([data-view=models], [data-view=findings], [data-view=settings], [data-view=worktrees], [data-view=projects], [data-view=waiting], [data-view=loading], [data-view=first-run]) #main { padding: var(--s-6) var(--s-6) var(--s-8); }
|
|
423
|
+
body:is([data-view=models], [data-view=findings], [data-view=settings], [data-view=worktrees], [data-view=disk], [data-view=projects], [data-view=waiting], [data-view=loading], [data-view=first-run], [data-view=group]) #main { padding: var(--s-6) var(--s-6) var(--s-8); }
|
|
396
424
|
|
|
397
425
|
/* ---------- the stage: the panel the run is inlaid on ---------- */
|
|
398
426
|
.stage-slot { position: relative; background: var(--stage-bg); }
|
|
@@ -545,7 +573,13 @@ dialog.keys-sheet::backdrop { background: light-dark(rgb(17 22 19 / .35), rgb(0
|
|
|
545
573
|
.strip-wrap[hidden], .graph[hidden] { display: none; }
|
|
546
574
|
.tasks-module { overflow: hidden; }
|
|
547
575
|
.tasks-module .run-tasks { flex: 1; min-height: 0; overflow: auto; }
|
|
548
|
-
|
|
576
|
+
/* the run's summaries switch, above the table (#133 B): a row of its own, its model beside the bank */
|
|
577
|
+
.tasks-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
|
|
578
|
+
.tasks-switch[hidden] { display: none; }
|
|
579
|
+
.tasks-switch .sum-msgs { flex-basis: 100%; }
|
|
580
|
+
.tasks-switch .sum-model { display: inline-flex; }
|
|
581
|
+
.tasks-switch .sum-state { font-weight: 600; }
|
|
582
|
+
body[data-tasks=closed] .tasks-module :is(.run-tasks, .splitter, .dt-tools, .tasks-switch, .run-questions) { display: none; }
|
|
549
583
|
body[data-tasks=closed] .tasks-module .module-head { border-bottom: 0; }
|
|
550
584
|
.run-tasks .dt, .run-tasks .dt-frame, .run-tasks .table-scroll { height: 100%; }
|
|
551
585
|
.run-tasks .table-scroll { border: 0; border-radius: 0; }
|
|
@@ -556,6 +590,20 @@ body[data-tasks=closed] .tasks-module .module-head { border-bottom: 0; }
|
|
|
556
590
|
.insp-head h2 { font-size: var(--t-md); line-height: 1.3; margin: 0 0 2px; }
|
|
557
591
|
.insp-kind { color: var(--muted); font-size: var(--t-sm); }
|
|
558
592
|
.insp-head .chip { margin-top: 4px; }
|
|
593
|
+
/* a task opens here: title, goal and links, then the text buttons, then one line per attempt */
|
|
594
|
+
.task-header { display: grid; gap: 6px; margin: 0 0 var(--s-3); min-width: 0; }
|
|
595
|
+
.task-header-top { display: grid; gap: 4px; padding-right: 72px; min-width: 0; } /* clear the Close key */
|
|
596
|
+
.task-header h2 { font-size: var(--t-md); font-weight: 650; line-height: 1.3; margin: 0; }
|
|
597
|
+
.task-header .task-goal { margin: 0; color: var(--ink); text-wrap: pretty; }
|
|
598
|
+
.task-links { margin: 0; }
|
|
599
|
+
.task-links a.chip::before { content: none; } /* a link is not a status: no lamp */
|
|
600
|
+
.task-link-text { color: var(--ink-2); font-family: var(--mono); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
|
|
601
|
+
.task-texts { flex-wrap: wrap; max-width: 100%; }
|
|
602
|
+
.inspector .task-reveal { margin: 0; }
|
|
603
|
+
.attempt-trail { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: grid; gap: 2px; min-width: 0; }
|
|
604
|
+
.trail-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; font-size: var(--t-xs); }
|
|
605
|
+
.trail-summary { font-family: var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
606
|
+
.trail-nav { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
|
|
559
607
|
.inspector > .insp-close { position: absolute; right: var(--s-3); top: var(--s-3); min-height: 28px; padding: 0 9px; }
|
|
560
608
|
.insp-section { margin: var(--s-5) 0 0; }
|
|
561
609
|
.inspector > .insp-section:first-child { margin-top: var(--s-1); }
|
|
@@ -765,9 +813,69 @@ p.ctl-request-refused { color: var(--warn-ink); font-weight: 600; }
|
|
|
765
813
|
.ctl-changes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
|
|
766
814
|
.ctl-what { color: var(--ink); font-weight: 600; }
|
|
767
815
|
.ctl[aria-busy=true] .ctl-row { opacity: .7; }
|
|
816
|
+
|
|
817
|
+
/* a task's summary (#133 B): its text, where it came from, and the task's own switch (a row like a control's) */
|
|
818
|
+
.sum-section .sum-text { margin: 0 0 var(--s-1); white-space: pre-line; overflow-wrap: anywhere; }
|
|
819
|
+
.sum-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 var(--s-2); font-size: var(--t-xs); }
|
|
820
|
+
.sum-error { margin: 0 0 var(--s-2); }
|
|
821
|
+
.sum-sources { list-style: none; margin: 0 0 var(--s-2); padding: 0; display: grid; gap: 2px; font-size: var(--t-xs); }
|
|
822
|
+
.sum-sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; overflow-wrap: anywhere; }
|
|
823
|
+
.sum-switch { display: grid; gap: 6px; padding: var(--s-2) 10px; border: 1px solid var(--rule); border-radius: var(--r-key); background: var(--module-2); }
|
|
824
|
+
.sum-label { margin: 0; font-family: var(--font-plate); font-weight: 700; font-size: .786rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
|
|
825
|
+
.sum-bank { justify-self: start; flex-wrap: wrap; max-width: 100%; }
|
|
826
|
+
p.sum-note { margin: 0; font-size: var(--t-xs); }
|
|
827
|
+
.sum-msgs:empty { display: none; }
|
|
828
|
+
/* the one-sentence column: one line, cut off at the cell's edge */
|
|
829
|
+
.sum-col { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
768
830
|
/* who decided an escalation, on the line that reports it */
|
|
769
831
|
.src-plate { font-size: .714rem; padding: 0 5px; vertical-align: 1px; }
|
|
770
832
|
|
|
833
|
+
/* brief questions (#135): the run's open questions above the task table, and each question in the inspector.
|
|
834
|
+
The tasks module is 208px tall, so the list is a short strip and scrolls; the table keeps the rest. */
|
|
835
|
+
.run-questions { display: flex; flex-direction: column; flex: 0 1 auto; max-height: 5.5rem; min-height: 0; overflow: hidden; border-bottom: 1px solid var(--rule); }
|
|
836
|
+
.run-questions[hidden] { display: none; }
|
|
837
|
+
.brief-list-head { display: flex; align-items: center; gap: var(--s-2); margin: 0; padding: 6px 10px; flex: none; }
|
|
838
|
+
.brief-list { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1 1 auto; }
|
|
839
|
+
a.brief-open { display: grid; gap: 2px; min-width: 0; padding: 6px 10px; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; }
|
|
840
|
+
a.brief-open:hover { text-decoration: none; background: var(--module-2); }
|
|
841
|
+
.brief-open-top { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; }
|
|
842
|
+
.brief-open-task { color: var(--muted); }
|
|
843
|
+
.brief-open-text, .brief-text, .brief-got { overflow-wrap: anywhere; }
|
|
844
|
+
.brief-when { color: var(--muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
|
|
845
|
+
.brief-section .brief-questions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
|
|
846
|
+
.brief-q { display: grid; gap: 4px; padding: var(--s-2) 10px; border: 1px solid var(--rule); border-radius: var(--r-key); background: var(--module-2); }
|
|
847
|
+
.brief-q p { margin: 0; }
|
|
848
|
+
.brief-text { white-space: pre-line; }
|
|
849
|
+
.brief-why, .brief-options, .brief-default, .brief-scope { font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
|
|
850
|
+
.brief-flags { display: flex; flex-wrap: wrap; gap: var(--s-1); }
|
|
851
|
+
.brief-box { display: grid; gap: 6px; margin-top: 2px; }
|
|
852
|
+
.brief-box textarea { width: 100%; min-height: 4.5rem; padding: 6px 10px; resize: vertical; }
|
|
853
|
+
.brief-box .brief-send { justify-self: start; }
|
|
854
|
+
.brief-msgs:empty { display: none; }
|
|
855
|
+
.brief-q .brief-notice { margin: 0; }
|
|
856
|
+
.brief-parked { margin-top: var(--s-2); }
|
|
857
|
+
.brief-parked > .brief-questions { margin-top: var(--s-2); }
|
|
858
|
+
/* Grouped questions, proposals and affected badges (#136). The questions strip stays short until a
|
|
859
|
+
proposal is open; then it shares the tasks module with the table, which keeps a minimum of its own. */
|
|
860
|
+
.brief-group { display: grid; gap: 2px; margin: var(--s-2) 10px 0; }
|
|
861
|
+
.brief-group-title { margin: 0; font-size: var(--t-sm); }
|
|
862
|
+
.brief-goal { margin: 0; color: var(--muted); font-size: var(--t-xs); overflow-wrap: anywhere; }
|
|
863
|
+
.brief-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
|
|
864
|
+
.brief-actions input { flex: 1 1 12rem; min-width: 8rem; min-height: 28px; padding: 4px 8px; }
|
|
865
|
+
.brief-proposals { display: grid; gap: var(--s-2); align-content: start; padding: 6px 10px 10px; overflow: auto; min-height: 0; flex: 1 1 auto; }
|
|
866
|
+
.brief-proposal { display: grid; gap: 4px; padding: var(--s-2) 10px; border: 1px solid var(--rule); border-radius: var(--r-key); background: var(--module-2); }
|
|
867
|
+
.brief-proposal-top { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
|
|
868
|
+
.brief-summary, .brief-reason { margin: 0; overflow-wrap: anywhere; }
|
|
869
|
+
.brief-reason { color: var(--warn-ink); }
|
|
870
|
+
.brief-hash { font-size: var(--t-xs); overflow-wrap: anywhere; }
|
|
871
|
+
.brief-proposal .brief-notice { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
872
|
+
.brief-patch .diff-scroll, pre.brief-diff { max-height: 8rem; overflow: auto; }
|
|
873
|
+
pre.brief-diff { margin: 0; white-space: pre; }
|
|
874
|
+
.brief-proposal[aria-busy=true] { opacity: .7; }
|
|
875
|
+
.brief-affected-row { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
|
|
876
|
+
.run-questions[data-proposals] { flex: 1 1 auto; max-height: none; }
|
|
877
|
+
.tasks-module:has(.run-questions[data-proposals]:not([hidden])) .run-tasks { min-height: 5.5rem; }
|
|
878
|
+
|
|
771
879
|
/* ---------- tables ---------- */
|
|
772
880
|
.table-scroll { overflow: auto; max-width: 100%; border: 1px solid var(--rule); border-radius: var(--r-key); background: var(--module); }
|
|
773
881
|
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-variant-numeric: tabular-nums; }
|
|
@@ -1234,7 +1342,12 @@ dialog.export-dialog h2 { margin-bottom: var(--s-2); }
|
|
|
1234
1342
|
body[data-shell] .stage-col .stage-slot, body[data-shell] .map-view .stage-slot { position: relative; inset: auto; height: clamp(300px, 105vw, 62vh); border-radius: var(--r-module); overflow: hidden; }
|
|
1235
1343
|
body[data-shell] .run-view .stage-col .stage-slot { height: clamp(240px, 72vw, 62vh); } /* a run's plate is wide: no empty bands above and below it */
|
|
1236
1344
|
body[data-shell] .stage-col .graph, body[data-shell] .stage-col .files-view, body[data-shell] .map-cards { position: static; padding: 0; overflow: auto; }
|
|
1237
|
-
body[data-shell] :is(.run-header, .insp-module, .tasks-module, .diff-view, .map-head-module, .strip-wrap) { position: static; width: auto; max-width: none; height: auto; margin: 0; box-shadow: none; border-radius: var(--r-module); border-width: 1px; }
|
|
1345
|
+
body[data-shell] :is(.run-header, .insp-module, .tasks-module, .groups-module, .diff-view, .map-head-module, .strip-wrap) { position: static; width: auto; max-width: none; height: auto; margin: 0; box-shadow: none; border-radius: var(--r-module); border-width: 1px; }
|
|
1346
|
+
body[data-shell=immersive] .groups-module:not([hidden]),
|
|
1347
|
+
body[data-shell=workbench] .groups-module:not([hidden]) { position: static; inset: auto; left: auto; right: auto; bottom: auto; width: auto; max-width: none; height: auto; max-height: 60vh; margin: 0; box-shadow: none; border-radius: var(--r-module); border-width: 1px; }
|
|
1348
|
+
/* the desktop groups row is more specific than the stacked run view; drop it so a phone stays one column */
|
|
1349
|
+
body[data-shell=workbench] .run-view.has-groups,
|
|
1350
|
+
body[data-shell=workbench][data-tasks=closed] .run-view.has-groups { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: none; }
|
|
1238
1351
|
body[data-shell] .tasks-module .run-tasks { max-height: 60vh; }
|
|
1239
1352
|
body[data-shell] .stage-note { position: static; }
|
|
1240
1353
|
.stage-ctl { top: auto; bottom: var(--gap); right: var(--gap); translate: none; grid-auto-flow: column; }
|
|
@@ -1326,6 +1439,35 @@ table.wt-grid { width: max-content; min-width: 100%; }
|
|
|
1326
1439
|
.wt-group { display: grid; grid-template-columns: minmax(8em, max-content) 1fr; align-items: center; gap: var(--s-3); margin: var(--s-2) 0; }
|
|
1327
1440
|
.wt-copy:focus-visible, .wt-cmd code:focus-visible, .wt-groups summary:focus-visible { outline: 2px solid var(--route); outline-offset: 2px; }
|
|
1328
1441
|
|
|
1442
|
+
/* ---------- disk (#/disk), on the worktrees screen's parts ---------- */
|
|
1443
|
+
.disk-commands { display: grid; gap: 4px; max-width: 48em; }
|
|
1444
|
+
.disk-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(22em, 1fr)); gap: var(--s-4); }
|
|
1445
|
+
.disk-block h2 { margin: 0 0 var(--s-2); }
|
|
1446
|
+
.disk-block p { margin: 0 0 var(--s-2); }
|
|
1447
|
+
.disk-list { margin: 0; padding-left: 1.2em; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
|
|
1448
|
+
.disk-list li { overflow-wrap: anywhere; }
|
|
1449
|
+
.disk-view { position: relative; }
|
|
1450
|
+
.disk-chart { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-module); background: var(--module); box-shadow: var(--ply-1); }
|
|
1451
|
+
.disk-chart h2 { margin: 0; justify-self: start; }
|
|
1452
|
+
.disk-chart .disk-sub { margin-top: var(--s-3); }
|
|
1453
|
+
.disk-bar { display: flex; gap: 2px; height: 14px; min-width: 2px; }
|
|
1454
|
+
.disk-bar-whole { height: 22px; }
|
|
1455
|
+
.disk-seg { flex-basis: 0; min-width: 2px; height: 100%; cursor: default; }
|
|
1456
|
+
.disk-seg:first-child { border-radius: 4px 0 0 4px; }
|
|
1457
|
+
.disk-seg:last-child { border-radius: 0 4px 4px 0; }
|
|
1458
|
+
.disk-seg:only-child { border-radius: 4px; }
|
|
1459
|
+
.disk-seg:hover, .disk-seg:focus-visible { outline: 2px solid var(--route); outline-offset: 1px; position: relative; z-index: 1; }
|
|
1460
|
+
.disk-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
|
|
1461
|
+
.disk-legend li { display: inline-flex; align-items: center; gap: 6px; }
|
|
1462
|
+
.disk-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
|
|
1463
|
+
.disk-repos { display: grid; gap: 6px; }
|
|
1464
|
+
.disk-repo { display: grid; grid-template-columns: minmax(8em, 16em) minmax(0, 1fr) 6em; align-items: center; gap: var(--s-3); font-size: var(--t-sm); }
|
|
1465
|
+
.disk-repo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1466
|
+
.disk-repo-size { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
|
|
1467
|
+
.disk-track { min-width: 0; }
|
|
1468
|
+
.disk-tip { position: absolute; z-index: 5; display: grid; gap: 2px; max-width: 22em; padding: 6px 10px; border-radius: var(--r-key); background: var(--key); color: var(--ink); box-shadow: var(--ply-2); font-size: var(--t-sm); pointer-events: none; font-variant-numeric: tabular-nums; }
|
|
1469
|
+
@media (max-width: 640px) { .disk-repo { grid-template-columns: minmax(0, 1fr) 5em; } .disk-track { grid-column: 1 / -1; grid-row: 2; } }
|
|
1470
|
+
|
|
1329
1471
|
/* ---------- projects (#/projects) ---------- */
|
|
1330
1472
|
.projects-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); max-width: 1600px; }
|
|
1331
1473
|
.prj-head { display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; }
|
|
@@ -1531,3 +1673,31 @@ dialog.set-guide::backdrop { background: light-dark(rgb(17 22 19 / .35), rgb(0 0
|
|
|
1531
1673
|
/* A held redraw that has lasted (#115) */
|
|
1532
1674
|
.live-held { position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 30; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--rule); border-radius: var(--r-key); background: var(--module); color: var(--ink); box-shadow: var(--ply-2); font-size: var(--t-sm); }
|
|
1533
1675
|
.live-held[hidden] { display: none; }
|
|
1676
|
+
|
|
1677
|
+
/* ---------- groups: the run's groups block, and #/runs/<key>/group/<gid> ---------- */
|
|
1678
|
+
.groups-module { overflow: auto; }
|
|
1679
|
+
.groups-module[hidden] { display: none; }
|
|
1680
|
+
.groups-block { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
|
|
1681
|
+
.group-rows { min-height: 0; }
|
|
1682
|
+
.group-row { display: grid; gap: 2px 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
|
|
1683
|
+
.group-row:last-child { border-bottom: 0; }
|
|
1684
|
+
.group-title { font-weight: 650; overflow-wrap: anywhere; }
|
|
1685
|
+
a.group-title { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
|
|
1686
|
+
.group-goal { margin: 0; color: var(--muted); font-size: var(--t-sm); }
|
|
1687
|
+
.group-meta, .group-members, .group-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-sm); }
|
|
1688
|
+
.group-state { margin: 0; }
|
|
1689
|
+
.group-round, .group-round-members { font-family: var(--mono); font-size: var(--t-xs); }
|
|
1690
|
+
.group-view { max-width: 1100px; }
|
|
1691
|
+
.group-page { display: grid; gap: var(--s-5); }
|
|
1692
|
+
.group-head { display: grid; gap: var(--s-2); }
|
|
1693
|
+
.group-head h1, .group-section h2, .group-round-row h3 { margin: 0; }
|
|
1694
|
+
.group-section { display: grid; gap: var(--s-2); }
|
|
1695
|
+
.group-findings { width: 100%; border-collapse: collapse; }
|
|
1696
|
+
.group-findings th, .group-findings td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--rule); vertical-align: baseline; font-size: var(--t-sm); overflow-wrap: anywhere; }
|
|
1697
|
+
.group-findings th { font-family: var(--font-plate); font-size: .786rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
|
|
1698
|
+
.group-ambiguous { background: var(--warn-wash); }
|
|
1699
|
+
.group-blocking { color: var(--lamp-red); font-weight: 700; }
|
|
1700
|
+
.group-cmd { margin: 0; }
|
|
1701
|
+
.group-round-row { display: grid; gap: 2px; padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule); }
|
|
1702
|
+
.group-round-row:last-child { border-bottom: 0; padding-bottom: 0; }
|
|
1703
|
+
.group-members .chip { text-decoration: none; }
|