@giamme/forge 0.15.0 → 0.16.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 (63) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/VERSION +1 -1
  3. package/docs/artifacts.md +1 -1
  4. package/docs/commands.md +14 -3
  5. package/docs/forge-ui.md +14 -0
  6. package/docs/memory.md +22 -0
  7. package/docs/reviews.md +7 -0
  8. package/forge +11 -0
  9. package/package.json +1 -1
  10. package/references/dataset.md +5 -2
  11. package/references/decompose.md +51 -5
  12. package/references/harnesses.md +4 -1
  13. package/references/solo.md +5 -1
  14. package/references/ui.md +10 -1
  15. package/scripts/forge-artifact.sh +53 -0
  16. package/scripts/forge-contract.py +55 -8
  17. package/scripts/forge-control.py +0 -2
  18. package/scripts/forge-dispatch.sh +28 -12
  19. package/scripts/forge-fail-first.py +3 -1
  20. package/scripts/forge-guard.py +247 -8
  21. package/scripts/forge-issues.py +12 -0
  22. package/scripts/forge-lib-adopt.sh +260 -0
  23. package/scripts/forge-lib-attribute.sh +10 -2
  24. package/scripts/forge-lib-plans.sh +16 -4
  25. package/scripts/forge-lib-review.sh +8 -2
  26. package/scripts/forge-lib-task.sh +19 -5
  27. package/scripts/forge-memory.sh +41 -4
  28. package/scripts/forge-metrics.sh +7 -0
  29. package/scripts/forge-parallel.sh +96 -13
  30. package/scripts/forge-route.py +16 -2
  31. package/scripts/forge-runs-rm.py +23 -7
  32. package/scripts/forge-runtime.py +25 -2
  33. package/scripts/forge-schedule.py +5 -2
  34. package/scripts/forge-shadow.py +2 -0
  35. package/scripts/forge-solo.sh +6 -0
  36. package/scripts/forge_dataset/cli.py +16 -0
  37. package/scripts/forge_dataset/export.py +1 -0
  38. package/scripts/forge_dataset/harvest.py +11 -0
  39. package/scripts/forge_dataset/history.py +126 -0
  40. package/scripts/forge_dataset/worktrees.py +95 -0
  41. package/scripts/forge_memory_list.py +153 -0
  42. package/scripts/forge_worktrees.py +88 -0
  43. package/ui/README.md +31 -0
  44. package/ui/docs/api.md +81 -4
  45. package/ui/forge_ui/__init__.py +14 -1
  46. package/ui/forge_ui/__main__.py +1 -1
  47. package/ui/forge_ui/control.py +77 -0
  48. package/ui/forge_ui/findings.py +7 -0
  49. package/ui/forge_ui/projects.py +571 -0
  50. package/ui/forge_ui/reader.py +27 -7
  51. package/ui/forge_ui/static/app.js +99 -21
  52. package/ui/forge_ui/static/cloudui.js +6 -2
  53. package/ui/forge_ui/static/convo.js +1 -1
  54. package/ui/forge_ui/static/diffview.js +2 -2
  55. package/ui/forge_ui/static/files.js +1 -1
  56. package/ui/forge_ui/static/index.html +5 -1
  57. package/ui/forge_ui/static/panel.js +28 -2
  58. package/ui/forge_ui/static/projectsview.js +372 -0
  59. package/ui/forge_ui/static/settings.js +136 -4
  60. package/ui/forge_ui/static/style.css +93 -3
  61. package/ui/forge_ui/static/uikit.js +94 -1
  62. package/ui/forge_ui/static/worktreesview.js +250 -0
  63. package/ui/forge_ui/worktrees.py +570 -0
@@ -0,0 +1,372 @@
1
+ /* forge-ui Projects screen (#126): one page per repository with its runs, every finding forge wrote about it and
2
+ every memory forge wrote for it (window.ForgeProjects, and a CommonJS module under node:test).
3
+ Routes: #/projects (the list) and #/projects/<id>[/runs|/findings|/memories]. The id is the run cloud's.
4
+ Each tab reads its own endpoint when it opens, never on the page's poll; "Read again" asks the server to read
5
+ everything again. A redraw keeps filters, scroll and a selection (#115). Finding and memory texts are untrusted
6
+ and only ever enter the page as text. The pure helpers are tested in ui/tests/js/projectsview.test.js.
7
+ ctx = { id?, tab?, runs() (the page's run list), runHref(key), tablePrefs?(id), saveTablePrefs?(id, prefs) }. */
8
+ (function (root, factory) {
9
+ 'use strict';
10
+ const api = factory(root);
11
+ if (typeof module === 'object' && module.exports) module.exports = api;
12
+ else root.ForgeProjects = api;
13
+ })(typeof self !== 'undefined' ? self : this, function (root) {
14
+ 'use strict';
15
+
16
+ const list = v => Array.isArray(v) ? v : [];
17
+ const SEVERITIES = ['P0', 'P1', 'P2', 'P3'];
18
+ const STATUSES = ['open', 'filed', 'fixed', 'swept', 'dismissed', 'superseded'];
19
+ const STATES = { in_memory: 'in memory', waiting: 'waiting for a second run', stale: 'dropped: stale', capped: 'dropped: trimmed by the cap',
20
+ muted: 'not injected (curated out)', dropped: 'dropped', gone: 'from a checkout that is gone' };
21
+ const TABS = ['runs', 'findings', 'memories'];
22
+ const ROLES_NOTE = 'planner and dwarf get Verify, Known traps and Recurring QA findings; QA gets the last two';
23
+
24
+ /* ---------- pure ---------- */
25
+ // filter = { severity: 'all' | P0..P3, status: 'all' | 'open' (default) | STATUSES, run: '' | run id, reviewer: '', path: '' (substring),
26
+ // since: 0 (days, 0 = any), shadow: false }
27
+ function filterFindings(rows, filter, now) {
28
+ const f = filter || {}, sev = f.severity || 'all', status = f.status || 'open', path = String(f.path || '').toLowerCase();
29
+ const since = Number(f.since) > 0 ? (now || Date.now() / 1000) - Number(f.since) * 86400 : null;
30
+ return list(rows).filter(r => (f.shadow || r.kind !== 'shadow')
31
+ && (sev === 'all' || r.severity === sev) && (status === 'all' || r.status === status)
32
+ && (!f.run || r.run_id === f.run) && (!f.reviewer || r.reviewer === f.reviewer)
33
+ && (!path || String(r.location || '').toLowerCase().includes(path))
34
+ && (since === null || (Number.isFinite(r.at) && r.at >= since)));
35
+ }
36
+ // A learning's state as the picked checkout's forge-memory.sh decides it: its own ledger's state, else the first
37
+ // other checkout's (with that checkout named), else `gone` for one only the dataset still has.
38
+ function stateFor(learning, source) {
39
+ const states = learning && learning.states || {};
40
+ if (source && states[source]) return { state: states[source], from: null };
41
+ const other = Object.keys(states)[0];
42
+ if (other) return { state: states[other], from: other };
43
+ return { state: 'gone', from: 'dataset' };
44
+ }
45
+ function filterLearnings(rows, filter, source) {
46
+ const f = filter || {}, cat = f.category || 'all', st = f.state || 'all', text = String(f.text || '').toLowerCase();
47
+ return list(rows).filter(r => (cat === 'all' || r.category === cat) && (st === 'all' || stateFor(r, source).state === st)
48
+ && (!text || String(r.text || '').toLowerCase().includes(text)));
49
+ }
50
+ // what the Memories tab says when there is nothing to show
51
+ function memoryEmpty(data) {
52
+ if (!data) return null;
53
+ if (data.runs > 0 && data.memory_off_runs === data.runs) return 'Every run of this repository ran with memory turned off (--no-memory), so forge recorded no learnings.';
54
+ if (!list(data.learnings).length && !list(data.sources).some(s => s.memory)) return 'No memories yet: forge has recorded no learning for this repository.';
55
+ return null;
56
+ }
57
+ // A summary without what its own columns show: the bullet, the [P1][CONFIRMED] tags and a leading location.
58
+ function cleanSummary(text, location) {
59
+ let s = String(text || '').replace(/^\s*(?:[-*+•]|\d+[.)])\s*/, '').replace(/\*\*/g, '');
60
+ s = s.replace(/^(?:\s*(?:\[[^\]\n]*\]|\((?:P[0-3]|CONFIRMED|PLAUSIBLE|UNSTATED)\)|P[0-3]:?|CONFIRMED|PLAUSIBLE))+\s*/, '');
61
+ if (location) {
62
+ const at = s.indexOf(location);
63
+ if (at >= 0 && at < 4) s = s.slice(at + location.length).replace(/^[`'"*]*\s*(?:\([^)]*\))?\s*(?:[—–:-]+\s*)?/, '');
64
+ }
65
+ return s.trim() || String(text || '').trim();
66
+ }
67
+ const basename = p => typeof p === 'string' && p ? p.replace(/\/+$/, '').split('/').pop() : '—';
68
+ const routeOf = (id, tab) => '#/projects/' + encodeURIComponent(id) + (tab && tab !== 'runs' ? '/' + tab : '');
69
+
70
+ /* ---------- DOM ---------- */
71
+ function render(host, ctx) {
72
+ const UI = root.ForgeUI, el = (tag, text, cls) => UI.el(tag, text, cls);
73
+ const when = t => Number.isFinite(t) ? new Date(t * 1000).toLocaleString() : '—';
74
+ const guard = (region, draw) => { if (UI.guard) UI.guard(region, draw); else draw(); };
75
+ const s = { id: ctx.id || null, tab: TABS.includes(ctx.tab) ? ctx.tab : 'runs', list: null, detail: null, findings: null, memories: null,
76
+ ffilter: { severity: 'all', status: 'open', run: '', reviewer: '', path: '', since: 0, shadow: false },
77
+ mfilter: { category: 'all', state: 'all', text: '' }, source: null, checkout: '', error: null, seq: 0, timer: null };
78
+ const tablePrefs = id => ctx.tablePrefs ? ctx.tablePrefs(id) : null, savePrefs = id => p => ctx.saveTablePrefs && ctx.saveTablePrefs(id, p);
79
+
80
+ function table(parent, id, label, columns, rows, extra) {
81
+ parent.replaceChildren();
82
+ root.ForgeTable.render(parent, Object.assign({ id, label, columns, rows, prefs: tablePrefs(id), savePrefs: savePrefs(id) }, extra || {}));
83
+ }
84
+ function readAgain(onClick) {
85
+ const b = el('button', 'Read again'); b.type = 'button'; b.title = 'Read the run dirs, forge issues, the ledgers and the dataset again now';
86
+ b.addEventListener('click', onClick); return b;
87
+ }
88
+ const notes = n => el('div', undefined, 'prj-notes muted');
89
+ function fill(node, items) { node.replaceChildren(...list(items).map(t => el('p', String(t)))); }
90
+
91
+ /* the list */
92
+ function drawList() {
93
+ const head = el('div', undefined, 'prj-head'), body = el('div', undefined, 'prj-body');
94
+ head.append(el('h1', 'Projects', 'module-title'));
95
+ host.replaceChildren(head, el('p', 'Each repository forge has run in: its runs, every finding its reviews wrote and every memory forge keeps for it, whichever checkout a run started in.', 'muted prj-lede'), body);
96
+ const draw = () => guard(body, () => {
97
+ if (!s.list) { body.replaceChildren(el('p', s.error ? `Could not read the projects (${s.error}).` : 'Reading the projects…', s.error ? 'warn' : 'muted')); return; }
98
+ const rows = list(s.list.projects);
99
+ if (!rows.length) { body.replaceChildren(el('p', 'No projects yet: forge-ui lists no run.', 'muted')); return; }
100
+ table(body, 'projects', 'Projects', [
101
+ { id: 'name', label: 'Project', value: p => p.name, cell: p => {
102
+ const box = el('span', undefined, 'prj-name'), a = el('a', p.name); a.href = routeOf(p.id); box.append(a);
103
+ if (!p.exists) box.append(el('span', 'folder gone', 'chip st-unknown'));
104
+ if (p.path_only) { const c = el('span', 'tied by path', 'chip st-pending'); c.title = `${p.path_only} run(s) were tied to this repository only by their path: it may not be a separate repository`; box.append(c); }
105
+ return box; } },
106
+ { id: 'root', label: 'Root', value: p => p.root, mono: true, cls: 'prj-cut', cell: p => { const n = el('span', p.root); n.title = p.root; return n; } },
107
+ { id: 'runs', label: 'Runs', value: p => p.runs, cell: p => String(p.runs) },
108
+ { id: 'live', label: 'Live now', value: p => p.live, cell: p => p.live ? String(p.live) : '—' },
109
+ { id: 'last', label: 'Last activity', value: p => p.last, cell: p => when(p.last) },
110
+ { id: 'open', label: 'Findings open', title: 'findings no later passing review superseded; dismissals and filed issues show on the Findings tab', value: p => p.open_findings, cell: p => p.open_findings == null ? '—' : String(p.open_findings) },
111
+ { id: 'memory', label: 'Memory lines', value: p => p.memory_lines, cell: p => p.memory_lines == null ? '—' : String(p.memory_lines) },
112
+ { id: 'checkouts', label: 'Checkouts', value: p => p.checkouts, cell: p => String(p.checkouts), hidden: true },
113
+ ], rows);
114
+ });
115
+ return draw;
116
+ }
117
+
118
+ /* one project */
119
+ function drawProject() {
120
+ const head = el('div', undefined, 'prj-head'), tabs = el('nav', undefined, 'seg prj-tabs'), body = el('div', undefined, 'prj-body');
121
+ tabs.setAttribute('aria-label', 'Project tabs');
122
+ for (const t of TABS) { const a = el('a', t[0].toUpperCase() + t.slice(1)); a.href = routeOf(s.id, t); a.dataset.tab = t; if (t === s.tab) a.setAttribute('aria-current', 'page'); tabs.append(a); }
123
+ const title = el('h1', '…', 'module-title'), where = el('p', '', 'muted mono prj-root');
124
+ const links = el('div', undefined, 'prj-links');
125
+ const back = el('a', 'All projects'); back.href = '#/projects';
126
+ const cloud = el('a', 'In the run cloud'); cloud.href = '#/cloud/projects/' + encodeURIComponent(s.id);
127
+ const wts = el('a', 'Worktrees'); wts.href = '#/worktrees';
128
+ links.append(back, cloud, wts);
129
+ head.append(title, links);
130
+ const note = notes();
131
+ host.replaceChildren(head, where, tabs, note, body);
132
+ const syncHead = () => {
133
+ const d = s.detail;
134
+ title.textContent = d ? d.name : s.error ? 'Unknown project' : '…';
135
+ where.textContent = d ? d.root + (d.exists ? '' : ' (this folder is gone)') : '';
136
+ if (d) wts.href = '#/worktrees/repo/' + encodeURIComponent(d.root);
137
+ };
138
+ const draw = () => { syncHead(); guard(body, () => drawTab(body, note)); };
139
+ return draw;
140
+ }
141
+ function drawTab(body, note) {
142
+ if (!s.detail) { body.replaceChildren(el('p', s.error ? `Could not read this project (${s.error}).` : 'Reading the project…', s.error ? 'warn' : 'muted')); return; }
143
+ if (s.tab === 'runs') return drawRuns(body, note);
144
+ if (s.tab === 'findings') return drawFindings(body, note);
145
+ return drawMemories(body, note);
146
+ }
147
+
148
+ /* Runs */
149
+ function drawRuns(body, note) {
150
+ fill(note, []);
151
+ const runs = list(s.detail.runs), checkouts = list(s.detail.checkouts);
152
+ const bar = el('div', undefined, 'prj-filters');
153
+ if (checkouts.length > 1) {
154
+ const l = el('label', undefined, 'fnd-field'), sel = el('select'); sel.dataset.filter = 'checkout';
155
+ for (const [v, t] of [['', 'all']].concat(checkouts.map(c => [c.path, basename(c.path) + (c.branch ? ` (${c.branch})` : '') + (c.exists ? '' : ' · gone')]))) { const o = el('option', t); o.value = v; sel.append(o); }
156
+ sel.value = s.checkout; sel.addEventListener('change', () => { s.checkout = sel.value; drawRuns(body, note); });
157
+ l.append(el('span', 'Checkout', 'plate'), sel); bar.append(l);
158
+ }
159
+ const shown = runs.filter(r => !s.checkout || (r.repo_worktree || s.detail.root) === s.checkout);
160
+ const tableHost = el('div', undefined, 'prj-table');
161
+ body.replaceChildren(bar, tableHost);
162
+ if (!shown.length) { tableHost.append(el('p', 'No runs.', 'muted')); return; }
163
+ const RM = root.ForgeRunModel;
164
+ table(tableHost, 'project-runs', 'Runs', [
165
+ { id: 'state', label: 'State', value: r => RM ? RM.runState(r) : null, cell: r => { const b = el('span', undefined, 'fnd-status'); const st = RM ? RM.runState(r) : 'pending'; b.append(el('i', undefined, 'lamp st-' + ({ live: 'running', failed: 'fail', done: 'merged', pending: 'pending' })[st]), el('span', st)); return b; } },
166
+ { id: 'goal', label: 'Goal', value: r => r.goal, cell: r => { const a = el('a', String(r.goal || 'Untitled run').split('\n')[0]); a.href = ctx.runHref(r.key); return a; } },
167
+ { id: 'run', label: 'Run', value: r => r.run_id, mono: true, cell: r => r.run_id || '—' },
168
+ { id: 'checkout', label: 'Checkout', value: r => r.repo_worktree || '', cell: r => r.repo_worktree ? basename(r.repo_worktree) + (r.repo_branch ? ` (${r.repo_branch})` : '') : 'root' },
169
+ { id: 'tasks', label: 'Tasks', value: r => r.task_count, cell: r => Object.entries(r.counts || {}).map(([k, n]) => `${k} ${n}`).join(' · ') || '—' },
170
+ { id: 'verification', label: 'Verification', value: r => r.verification_status, cell: r => r.verification_status || '—' },
171
+ { id: 'review', label: 'Final review', value: r => r.final_review, cell: r => r.final_review ? r.final_review + (r.final_review_outdated ? ' (outdated)' : '') : '—' },
172
+ { id: 'updated', label: 'Updated', value: r => r.updated, cell: r => when(r.updated) },
173
+ ], shown);
174
+ }
175
+
176
+ /* Findings */
177
+ function drawFindings(body, note) {
178
+ const d = s.findings;
179
+ if (!d) { fill(note, []); body.replaceChildren(el('p', s.ferror ? `Could not read the findings (${s.ferror}).` : 'Reading every review of every run… the first read parses each reply, so it can take a few seconds.', s.ferror ? 'warn' : 'muted')); return; }
180
+ fill(note, list(d.notes).concat(d.dataset_runs ? [`${d.dataset_runs} run(s) whose directory is gone are read from the dataset: their findings link to no run page or diff.`] : []));
181
+ const rows = list(d.rows);
182
+ const bar = el('div', undefined, 'prj-filters');
183
+ const select = (name, text, options) => {
184
+ const l = el('label', undefined, 'fnd-field'), sel = el('select'); sel.dataset.filter = name;
185
+ for (const [v, t] of options) { const o = el('option', t); o.value = String(v); sel.append(o); }
186
+ sel.value = String(s.ffilter[name]);
187
+ sel.addEventListener('change', () => { s.ffilter[name] = name === 'since' ? Number(sel.value) : sel.value; drawTable(); });
188
+ l.append(el('span', text, 'plate'), sel); bar.append(l);
189
+ };
190
+ const counts = {}; for (const r of rows) counts[r.status] = (counts[r.status] || 0) + 1;
191
+ select('status', 'Status', [['all', 'all']].concat(STATUSES.map(x => [x, `${x} (${counts[x] || 0})`])));
192
+ select('severity', 'Severity', [['all', 'all']].concat(SEVERITIES.map(x => [x, x])));
193
+ select('run', 'Run', [['', 'all']].concat(Array.from(new Set(rows.map(r => r.run_id).filter(Boolean))).sort().map(x => [x, x])));
194
+ select('reviewer', 'Reviewer', [['', 'all']].concat(Array.from(new Set(rows.map(r => r.reviewer).filter(Boolean))).sort().map(x => [x, x])));
195
+ select('since', 'Date', [[0, 'any time'], [1, 'last day'], [7, 'last week'], [30, 'last month']]);
196
+ const pl = el('label', undefined, 'fnd-field'), path = el('input'); path.type = 'search'; path.placeholder = 'path contains…'; path.value = s.ffilter.path; path.dataset.filter = 'path';
197
+ path.addEventListener('input', () => { s.ffilter.path = path.value; drawTable(); });
198
+ pl.append(el('span', 'Path', 'plate'), path); bar.append(pl);
199
+ const sh = el('label', undefined, 'fnd-toggle'), box = el('input'); box.type = 'checkbox'; box.checked = s.ffilter.shadow; box.dataset.filter = 'shadow';
200
+ box.addEventListener('change', () => { s.ffilter.shadow = box.checked; drawTable(); });
201
+ sh.append(box, el('span', 'Shadow reviews')); bar.append(sh);
202
+ const again = readAgain(() => loadTab(true));
203
+ bar.append(again);
204
+ const count = el('p', '', 'muted prj-count'), tableHost = el('div', undefined, 'prj-table');
205
+ body.replaceChildren(bar, count, tableHost);
206
+ const summaryCell = r => {
207
+ const wrap = el('div', undefined, 'fnd-summary'), line = el('div', undefined, 'fnd-summary-line');
208
+ const more = el('button', undefined, 'fnd-more'); more.type = 'button'; more.setAttribute('aria-expanded', 'false'); more.setAttribute('aria-label', 'Show the full text');
209
+ more.append(el('span', '▸', 'fnd-caret'));
210
+ const detail = el('div', undefined, 'fnd-detail'); detail.hidden = true;
211
+ detail.append(el('pre', r.text || r.summary || '', 'fnd-text'));
212
+ if (list(r.occurrences).length > 1) {
213
+ const ul = el('ul', undefined, 'prj-occ');
214
+ for (const o of r.occurrences) { const li = el('li'); const t = `${o.run_id || '—'} · ${o.task || 'final review'} · attempt ${o.attempt == null ? '—' : o.attempt} · ${o.reviewer || '—'} · ${when(o.at)}`; if (o.href) { const a = el('a', t); a.href = o.href; li.append(a); } else li.append(el('span', t)); ul.append(li); }
215
+ detail.append(el('p', `Seen ${r.count} times, the newest first in the row:`, 'muted'), ul);
216
+ }
217
+ more.addEventListener('click', () => { const open = detail.hidden; detail.hidden = !open; more.setAttribute('aria-expanded', String(open)); more.firstChild.textContent = open ? '▾' : '▸'; });
218
+ line.append(more, el('span', cleanSummary(r.summary, r.location) || '—', 'prj-summary'));
219
+ if (r.count > 1) line.append(el('span', `×${r.count}`, 'chip prj-count-chip'));
220
+ wrap.append(line, detail); return wrap;
221
+ };
222
+ const statusCell = r => {
223
+ const b = el('span', undefined, 'fnd-status fnd-' + r.status);
224
+ b.append(el('i', undefined, 'lamp ' + (r.status === 'open' ? 'lamp-off' : r.status === 'filed' ? 'fnd-amber' : r.status === 'superseded' ? 'st-outdated' : r.status === 'dismissed' ? 'lamp-off' : 'st-pass')), el('span', r.status));
225
+ if (r.status === 'superseded') b.title = 'a later review of the same task passed; that does not say this finding was fixed';
226
+ return b;
227
+ };
228
+ const whereCell = r => {
229
+ if (r.source === 'dataset') { const x = el('span', 'from the dataset', 'chip st-unknown'); x.title = 'its run directory is gone: no run page or diff to open'; return x; }
230
+ const box = el('span', undefined, 'prj-where');
231
+ if (r.href) { const a = el('a', 'diff'); a.href = r.href; a.title = 'open the diff at this finding'; box.append(a); }
232
+ if (r.fileable && s.writes) { const f = el('a', 'file or dismiss'); f.href = '#/runs/' + encodeURIComponent(r.run) + '/findings'; f.title = 'on the run\'s Open findings page, through forge issues'; box.append(document.createTextNode(' · '), f); }
233
+ return box;
234
+ };
235
+ const runCell = r => { if (!r.run) return r.run_id || '—'; const a = el('a', r.run_id || r.run, 'mono'); a.href = ctx.runHref(r.run); return a; };
236
+ const columns = [
237
+ { id: 'severity', label: 'Severity', value: r => SEVERITIES.indexOf(r.severity), cell: r => el('span', r.severity || '—', 'chip sev-chip sev-' + (SEVERITIES.includes(r.severity) ? r.severity : 'none')) },
238
+ { id: 'confidence', label: 'Confidence', value: r => r.confidence, cell: r => r.confidence || '—' },
239
+ { id: 'summary', label: 'Summary', value: r => r.summary, cls: 'prj-wide', cell: summaryCell },
240
+ { id: 'location', label: 'Location', value: r => r.location, mono: true, cls: 'prj-cut', cell: r => { const n = el('span', r.location || '—'); if (r.location) n.title = r.location; return n; } },
241
+ { id: 'run', label: 'Run', value: r => r.run_id, cell: runCell },
242
+ { id: 'task', label: 'Task', value: r => r.task, mono: true, cell: r => r.task || (r.final_review ? 'final review' : '—') },
243
+ { id: 'attempt', label: 'Attempt', value: r => r.attempt, cell: r => r.attempt == null ? '—' : String(r.attempt) },
244
+ { id: 'reviewer', label: 'Reviewer', value: r => r.reviewer, cell: r => (r.reviewer || '—') + (r.kind === 'shadow' ? ' (shadow)' : '') },
245
+ { id: 'date', label: 'Date', value: r => r.at, cls: 'prj-nowrap', cell: r => { const n = el('span', Number.isFinite(r.at) ? new Date(r.at * 1000).toLocaleDateString() : '—'); n.title = when(r.at); return n; } },
246
+ { id: 'status', label: 'Status', value: r => STATUSES.indexOf(r.status), cell: statusCell },
247
+ { id: 'open', label: 'Open', sortable: false, cell: whereCell },
248
+ ];
249
+ function drawTable() {
250
+ const shown = filterFindings(rows, s.ffilter);
251
+ count.textContent = `${shown.length} of ${rows.length} findings`;
252
+ if (!shown.length) { tableHost.replaceChildren(el('p', rows.length ? 'No findings match these filters.' : 'No review of this repository wrote a finding.', 'muted')); return; }
253
+ table(tableHost, 'project-findings', 'Findings', columns, shown, { className: 'fnd-grid prj-findings' });
254
+ }
255
+ drawTable();
256
+ }
257
+
258
+ /* Memories */
259
+ function drawMemories(body, note) {
260
+ const d = s.memories;
261
+ if (!d) { fill(note, []); body.replaceChildren(el('p', s.merror ? `Could not read the memories (${s.merror}).` : 'Reading each checkout\'s ledger…', s.merror ? 'warn' : 'muted')); return; }
262
+ fill(note, d.notes);
263
+ const sources = list(d.sources);
264
+ if (!s.source || !sources.some(x => x.path === s.source)) s.source = (sources.find(x => x.root) || sources[0] || {}).path || null;
265
+ const bar = el('div', undefined, 'prj-filters');
266
+ if (sources.length > 1) {
267
+ const l = el('label', undefined, 'fnd-field'), sel = el('select'); sel.dataset.filter = 'source';
268
+ for (const x of sources) { const o = el('option', basename(x.path) + (x.root ? ' (root)' : x.branch ? ` (${x.branch})` : '')); o.value = x.path; sel.append(o); }
269
+ sel.value = s.source || ''; sel.addEventListener('change', () => { s.source = sel.value; drawMemories(body, note); });
270
+ l.append(el('span', 'Checkout', 'plate'), sel); bar.append(l);
271
+ }
272
+ bar.append(readAgain(() => loadTab(true)));
273
+ const parts = [bar];
274
+ const empty = memoryEmpty(d);
275
+ if (empty) { parts.push(el('p', empty, 'muted prj-empty')); body.replaceChildren(...parts); return; }
276
+ if (d.differs) parts.push(el('p', 'The checkouts\' memory.md files differ: pick a checkout to see what its runs are told.', 'warn prj-differs'));
277
+ const src = sources.find(x => x.path === s.source);
278
+ const given = el('section', undefined, 'prj-given');
279
+ given.append(el('h2', 'Given to models'), el('p', ROLES_NOTE + '. At most ' + ((src && src.max_lines) || 40) + ' lines.', 'muted'));
280
+ if (src && src.rebuilt_differs) given.append(el('p', 'This memory.md is not what forge would rebuild now: an older forge wrote it, or a prune asked Jev to drop facts. The states below are what the next rebuild does.', 'muted'));
281
+ if (!src || !src.memory || !list(src.memory).length) given.append(el('p', 'This checkout has no memory.md yet.', 'muted'));
282
+ for (const sec of list(src && src.memory)) {
283
+ const block = el('div', undefined, 'prj-section');
284
+ const h = el('h3', sec.title); const roles = el('span', ' · ' + list(sec.roles).join(', '), 'muted'); h.append(roles);
285
+ const ul = el('ul', undefined, 'prj-lines');
286
+ for (const line of list(sec.lines)) ul.append(el('li', (line.count ? line.count + 'x: ' : '') + line.text));
287
+ block.append(h, ul); given.append(block);
288
+ }
289
+ parts.push(given);
290
+ const all = el('section', undefined, 'prj-learnings');
291
+ all.append(el('h2', 'All learnings'));
292
+ const lbar = el('div', undefined, 'prj-filters');
293
+ const lsel = (name, text, options) => { const l = el('label', undefined, 'fnd-field'), sel = el('select'); sel.dataset.filter = 'm-' + name; for (const [v, t] of options) { const o = el('option', t); o.value = v; sel.append(o); } sel.value = s.mfilter[name]; sel.addEventListener('change', () => { s.mfilter[name] = sel.value; drawLearnings(); }); l.append(el('span', text, 'plate'), sel); lbar.append(l); };
294
+ lsel('category', 'Category', [['all', 'all'], ['verify', 'verify'], ['trap', 'trap'], ['finding', 'finding']]);
295
+ lsel('state', 'State', [['all', 'all']].concat(Object.entries(STATES).map(([k, v]) => [k, v])));
296
+ const tl = el('label', undefined, 'fnd-field'), tx = el('input'); tx.type = 'search'; tx.placeholder = 'text contains…'; tx.value = s.mfilter.text; tx.dataset.filter = 'm-text';
297
+ tx.addEventListener('input', () => { s.mfilter.text = tx.value; drawLearnings(); }); tl.append(el('span', 'Text', 'plate'), tx); lbar.append(tl);
298
+ const lcount = el('p', '', 'muted prj-count'), lhost = el('div', undefined, 'prj-table');
299
+ all.append(lbar, lcount, lhost); parts.push(all);
300
+ body.replaceChildren(...parts);
301
+ const learnings = list(d.learnings);
302
+ function drawLearnings() {
303
+ const shown = filterLearnings(learnings, s.mfilter, s.source);
304
+ lcount.textContent = `${shown.length} of ${learnings.length} learnings`;
305
+ if (!shown.length) { lhost.replaceChildren(el('p', 'No learnings match these filters.', 'muted')); return; }
306
+ table(lhost, 'project-learnings', 'Learnings', [
307
+ { id: 'category', label: 'Category', value: r => r.category, cell: r => r.category },
308
+ { id: 'text', label: 'Learning', value: r => r.text, cell: r => el('span', r.text, 'prj-learning') },
309
+ { id: 'state', label: 'State', value: r => stateFor(r, s.source).state, cell: r => { const st = stateFor(r, s.source), b = el('span', STATES[st.state] || st.state); if (st.from && st.from !== 'dataset') b.title = 'from ' + st.from + ', not this checkout\'s ledger'; return b; } },
310
+ { id: 'count', label: 'Runs', title: 'distinct runs that emitted it', value: r => r.count, cell: r => String(r.count || '—') },
311
+ { id: 'run', label: 'Last run', value: r => (list(r.rows).slice(-1)[0] || {}).run_id, mono: true, cell: r => (list(r.rows).slice(-1)[0] || {}).run_id || '—' },
312
+ { id: 'task', label: 'Task', value: r => (list(r.rows).slice(-1)[0] || {}).task, mono: true, cell: r => (list(r.rows).slice(-1)[0] || {}).task || '—' },
313
+ { id: 'role', label: 'Role', value: r => (list(r.rows).slice(-1)[0] || {}).role, cell: r => (list(r.rows).slice(-1)[0] || {}).role || '—' },
314
+ { id: 'model', label: 'Model', value: r => (list(r.rows).slice(-1)[0] || {}).model, cell: r => (list(r.rows).slice(-1)[0] || {}).model || '—' },
315
+ { id: 'from', label: 'From', value: r => r.dataset_only ? 'dataset' : '', cell: r => r.dataset_only ? 'dataset' : Array.from(new Set(list(r.rows).flatMap(x => list(x.from)))).map(basename).join(', ') },
316
+ { id: 'last', label: 'Last seen', value: r => r.last, cell: r => r.last || '—' },
317
+ ], shown);
318
+ }
319
+ drawLearnings();
320
+ }
321
+
322
+ /* loading */
323
+ async function loadList() {
324
+ const res = await UI.get('/api/projects');
325
+ if (res.ok) { s.list = res.data; s.error = null; } else s.error = res.detail || res.error || 'no answer';
326
+ redraw();
327
+ }
328
+ async function loadDetail() {
329
+ const res = await UI.get('/api/projects/' + encodeURIComponent(s.id));
330
+ if (res.ok) { s.detail = res.data; s.error = null; } else s.error = res.status === 404 ? 'no project has this id' : res.detail || res.error || 'no answer';
331
+ redraw();
332
+ }
333
+ async function loadTab(refresh) {
334
+ const tab = s.tab, mine = ++s.seq;
335
+ if (tab === 'runs') { await loadDetail(); return; }
336
+ const q = refresh ? '?refresh=1' : '';
337
+ const res = await UI.get(`/api/projects/${encodeURIComponent(s.id)}/${tab}${q}`);
338
+ if (mine !== s.seq) return;
339
+ if (tab === 'findings') { if (res.ok) { s.findings = res.data; s.ferror = null; } else s.ferror = res.detail || res.error || 'no answer'; }
340
+ else { if (res.ok) { s.memories = res.data; s.merror = null; } else s.merror = res.detail || res.error || 'no answer'; }
341
+ redraw();
342
+ }
343
+ let redraw = () => {};
344
+ function open() {
345
+ clearTimeout(s.timer);
346
+ if (s.id) { redraw = drawProject(); redraw(); loadDetail().then(() => { if (s.tab !== 'runs') loadTab(false); }); }
347
+ else { redraw = drawList(); redraw(); loadList(); }
348
+ }
349
+ UI.controlsEnabled().then(on => { s.writes = !!on; if (s.tab === 'findings' && s.findings) redraw(); });
350
+ open();
351
+ return {
352
+ go(id, tab) {
353
+ const t = TABS.includes(tab) ? tab : 'runs';
354
+ if (id === s.id && t === s.tab) return; // the page's own refresh: nothing changed here
355
+ const same = id === s.id;
356
+ s.id = id || null; s.tab = t;
357
+ if (!same) { s.detail = s.findings = s.memories = null; s.source = null; s.checkout = ''; }
358
+ if (same && s.id) { redraw = drawProject(); redraw(); if (t === 'runs') loadDetail(); else if (!(t === 'findings' ? s.findings : s.memories)) loadTab(false); }
359
+ else open();
360
+ },
361
+ // the list and the runs follow the page at most every 30 s; findings and memories wait for Read again
362
+ poll() {
363
+ const now = Date.now();
364
+ if (s.polled && now - s.polled < 30000) return;
365
+ s.polled = now;
366
+ if (!s.id) loadList(); else if (s.tab === 'runs') loadDetail();
367
+ },
368
+ };
369
+ }
370
+
371
+ return { render, cleanSummary, filterFindings, filterLearnings, stateFor, memoryEmpty, routeOf, STATUSES, STATES };
372
+ });
@@ -26,6 +26,74 @@
26
26
  'coverage', 'retry-addressed', 'dwarf-message', 'attribution', 'findings'];
27
27
  const MODES = ['off', 'shadow', 'on'];
28
28
  const ADD_COMMAND = 'forge decide provider add …';
29
+ // What turning a gate on means, per gate: references/decision-models.md in words a first-time reader can act on. `sends`
30
+ // follows the state the site builds in scripts/forge_jev/; a change there changes what a user agreed to send.
31
+ const GATE_HELP = {
32
+ drift: { summary: 'Predicts files a task will edit but did not declare, so two tasks that touch one file do not run at once.',
33
+ when: 'At plan, once per task.', sends: "The goal, and the task's title, declared files, prompt and approach.",
34
+ on: "Adds each predicted file to the task's files before the waves are computed." },
35
+ forward: { summary: 'Spots an earlier task written against something a later task builds.',
36
+ when: 'At plan, once.', sends: 'The title, files and prompt of the tasks in each pair it checks.',
37
+ on: 'Makes the earlier task wait for the later one, unless that forms a cycle.' },
38
+ prompt: { summary: "Checks that a reviewer could judge a task from the task's own text.",
39
+ when: 'At plan, once per task.', sends: "The goal, the task and its prompt and approach, the plan's other tasks, excerpts of its files, and project memory.",
40
+ on: 'Sends a task whose prompt falls short back to the planner, once.' },
41
+ 'memory-curate': { summary: 'Keeps project memory clean as reviewers and implementers record facts.',
42
+ when: 'Each time a fact is recorded.', sends: 'The new fact and the existing memory entries.',
43
+ on: 'Refiles the fact, merges it with an existing one, or withholds it. The ledger keeps everything.' },
44
+ 'memory-slice': { summary: 'Leaves out memory lines that do not concern the task about to run.',
45
+ when: 'Each time memory is added to a prompt.', sends: 'The task and the memory facts.',
46
+ on: 'Removes lines from what the model is given. It never adds or reorders any.' },
47
+ 'memory-stale': { summary: 'Finds memory facts that are no longer true.',
48
+ when: 'Only during a deep memory prune.', sends: 'The fact and the path of the file it is about.',
49
+ on: 'Drops a fact that went false.' },
50
+ 'verify-discover': { summary: 'Picks a verification command for a repository that has none configured.',
51
+ when: 'When neither --verify nor .forge/verify exists.', sends: "The repository's file list, the candidate commands, and memory's lines about verifying.",
52
+ on: "Runs the chosen command. That command's own result decides verification." },
53
+ coverage: { summary: 'Finds parts of your request that no task covers.',
54
+ when: 'At plan, once.', sends: "Your request, its requirements, and each task's acceptance criteria.",
55
+ on: 'Sends each uncovered requirement back to the planner, once.' },
56
+ 'retry-addressed': { summary: 'Checks that a retry actually touched what its review asked to fix.',
57
+ when: 'On a retry after a review, before the next review.', sends: "The review's blocking findings and the retry's diff.",
58
+ on: 'Sends the retry back to its implementer without paying for a review.' },
59
+ 'dwarf-message': { summary: "Reads an implementer's final message for unfinished work or a question for you.",
60
+ when: "On each implementer's final message, before any review.", sends: "The task's title and the end of the message.",
61
+ on: 'Skips the review of an attempt that says it did not finish, or stops the task to ask you.' },
62
+ attribution: { summary: 'Guesses which merged task broke the combined verification, to shorten the search.',
63
+ when: 'After a combined verification fails.', sends: "The end of the failing log, and each merged task's title, files and diff.",
64
+ on: "Checks the likeliest task first. Nothing is merged, reverted or accepted." },
65
+ findings: { summary: 'Finds review findings that repeat an open issue, and the ones concrete enough to file.',
66
+ when: 'When you run forge issues.', sends: "The findings, and open issues' titles and bodies.",
67
+ on: 'Turns a duplicate into a comment on that issue (posted by forge issues --apply), and pre-selects concrete findings.' },
68
+ };
69
+ // The setup guide, as data. A key never passes through this page: each command runs in the reader's own terminal.
70
+ const SETUP_GUIDE = {
71
+ intro: 'A decision model is a small hosted model that answers narrow questions about your run, in about a second. It is optional and off until you turn a gate on. It never changes a review verdict or makes work pass, and if it fails, the run goes on as if it were off.',
72
+ steps: [
73
+ { title: 'Add a provider', text: 'Run one of these in a terminal. A key is read from stdin or the environment and is stored outside your repositories.',
74
+ commands: [
75
+ ['TypeSafe (Jev)', 'printf \'%s\\n\' "$TYPESAFE_API_KEY" | forge decide provider add jev --name typesafe --key-stdin'],
76
+ ['Cloudflare (Clef)', 'forge decide provider add clef --name cloudflare --account-id <id> --key-env CLOUDFLARE_API_TOKEN'],
77
+ ['A local server, no key', 'forge decide provider add jev --name local --url http://127.0.0.1:8080 --local'],
78
+ ] },
79
+ { title: 'Check that it answers', text: 'This sends one fixed test request with no data from your repositories.',
80
+ commands: [['', 'forge decide doctor --live']] },
81
+ { title: 'Start one gate in shadow', text: 'In shadow a gate asks and records the answer, and the run goes on exactly as if it were off. It does send data: open a gate below to see what. Use the gate\'s mode and provider below, or run:',
82
+ commands: [['', 'forge decide gate memory-curate shadow --provider typesafe']] },
83
+ { title: 'Run forge as usual, then look', text: 'Each answer is kept with the run. These show the gates in effect and how they did.',
84
+ commands: [['', 'forge decide status'], ['', 'forge decide report']] },
85
+ { title: 'Turn a gate on when it has earned it', text: 'A gate goes on only after a replay of its recorded requests passes, which takes about 15 runs of shadow data. Without --send a replay only counts what it would send.',
86
+ commands: [
87
+ ['', 'forge decide replay --site jev-drift --provider typesafe --model jev-latest'],
88
+ ['', 'forge decide replay --site jev-drift --provider typesafe --model jev-latest --send'],
89
+ ['', 'forge decide gate drift on --provider typesafe'],
90
+ ] },
91
+ ],
92
+ stop: [
93
+ ['Keep one repository out', 'forge decide privacy never-send --repo DIR'],
94
+ ['Send nothing while this is set', 'export FORGE_JEV=off'],
95
+ ],
96
+ };
29
97
  const POLL_MS = 20000; // the config rarely changes, and each read starts a CLI process
30
98
  // The same order as forge_decide.profiles. A tier or key the body carries and this list does not still shows, after these.
31
99
  const TIERS = ['any', 'low', 'medium', 'high'];
@@ -717,7 +785,9 @@
717
785
  return () => { if (gen !== s.gen) return; s.hold--; if (!s.hold && s.redraw) { s.redraw = false; drawBody(); } };
718
786
  }
719
787
 
720
- function drawBody() {
788
+ // A held draw runs later, when a confirm may have opened: it then waits for that hold, as load() does.
789
+ function drawBody() { UI.guard(body, drawBodyNow, () => { if (s.hold > 0) s.redraw = true; else drawBodyNow(); }); }
790
+ function drawBodyNow() {
721
791
  const focus = document.activeElement && body.contains(document.activeElement) ? document.activeElement : null;
722
792
  const at = focus && focus.dataset.editor ? { kind: 'editor', name: focus.dataset.editor, a: focus.selectionStart, b: focus.selectionEnd }
723
793
  : focus && focus.dataset.model ? { kind: 'model', name: focus.dataset.model, a: focus.selectionStart, b: focus.selectionEnd }
@@ -776,7 +846,11 @@
776
846
 
777
847
  function decideSection() {
778
848
  const view = describeDecide(s.data.decide);
779
- const sec = section('decide', 'Decision models', 'Each gate is off, shadow or on, with a provider and a model. A change writes your forge config (the user level), so it applies to every repository. The mode shown is the one in effect for this repository, and where it came from.');
849
+ const sec = section('decide', 'Decision models', 'Each gate is off, shadow or on, with a provider and a model. Off asks nothing. Shadow asks and records, and changes nothing. On lets the gate act. A change writes your forge config (the user level), so it applies to every repository. The mode shown is the one in effect for this repository, and where it came from.');
850
+ const guide = el('button', 'How to set this up', 'set-guide-open');
851
+ guide.type = 'button'; guide.id = 'set-decide-guide';
852
+ guide.addEventListener('click', openGuide);
853
+ sec.append(guide);
780
854
  const where = text(object(s.data.decide).user_path);
781
855
  if (where) sec.append(pathLine('config', where));
782
856
  if (view.privacyFloor) {
@@ -799,6 +873,64 @@
799
873
  return sec;
800
874
  }
801
875
 
876
+ // The guide lives on document.body, so a refresh of the page's body never closes it.
877
+ function openGuide() {
878
+ let dlg = document.getElementById('set-guide');
879
+ if (!dlg) {
880
+ dlg = el('dialog', undefined, 'set-guide');
881
+ dlg.id = 'set-guide'; dlg.setAttribute('aria-labelledby', 'set-guide-h');
882
+ const title = el('h2', 'Set up a decision model'); title.id = 'set-guide-h';
883
+ const close = el('button', 'Close', 'set-guide-close'); close.type = 'button';
884
+ close.addEventListener('click', () => dlg.close());
885
+ const head = el('div', undefined, 'set-guide-head');
886
+ head.append(title, close);
887
+ dlg.append(head, el('p', SETUP_GUIDE.intro));
888
+ const steps = el('ol', undefined, 'set-guide-steps');
889
+ for (const step of SETUP_GUIDE.steps) {
890
+ const li = el('li');
891
+ li.append(el('strong', step.title), el('p', step.text, 'muted'));
892
+ for (const [label, command] of step.commands) li.append(commandLine(label, command));
893
+ steps.append(li);
894
+ }
895
+ dlg.append(steps, el('h3', 'To stop sending'));
896
+ for (const [label, command] of SETUP_GUIDE.stop) dlg.append(commandLine(label, command));
897
+ dlg.addEventListener('click', e => { if (e.target === dlg) dlg.close(); }); // a click on the backdrop
898
+ document.body.append(dlg);
899
+ }
900
+ if (!dlg.open) dlg.showModal();
901
+ }
902
+
903
+ function commandLine(label, command) {
904
+ const line = el('div', undefined, 'set-guide-command');
905
+ if (label) line.append(el('span', label, 'muted'));
906
+ const row = el('div', undefined, 'set-guide-row');
907
+ const copy = el('button', 'Copy', 'set-guide-copy'); copy.type = 'button';
908
+ copy.addEventListener('click', async () => {
909
+ try { await navigator.clipboard.writeText(command); copy.textContent = 'Copied'; }
910
+ catch { copy.textContent = 'Copy failed'; }
911
+ });
912
+ const code = el('code', command, 'mono');
913
+ code.tabIndex = 0; // one line, scrolled: a wrap inside `--local` misleads anyone retyping it
914
+ row.append(code, copy);
915
+ line.append(row);
916
+ return line;
917
+ }
918
+
919
+ // What a gate does. Its open state outlives a refresh, which rebuilds the row.
920
+ function gateHelp(gate) {
921
+ const help = GATE_HELP[gate.name];
922
+ if (!help) return [];
923
+ const more = el('details', undefined, 'set-gate-more');
924
+ more.id = 'set-gate-' + gate.name + '-help';
925
+ more.open = !!s.gateHelpOpen?.[gate.name];
926
+ more.addEventListener('toggle', () => { (s.gateHelpOpen ||= {})[gate.name] = more.open; });
927
+ more.append(el('summary', 'What it sends and what on does'));
928
+ const dl = el('dl');
929
+ for (const [term, value] of [['When', help.when], ['Sends', help.sends], ['When on', help.on]]) dl.append(el('dt', term), el('dd', value));
930
+ more.append(dl);
931
+ return [el('p', help.summary, 'set-gate-summary'), more];
932
+ }
933
+
802
934
  const providerLabel = p => [p.name, p.type, p.local ? 'local' : ''].filter(Boolean).join(' · ');
803
935
 
804
936
  function gateRow(gate, providers) {
@@ -818,7 +950,7 @@
818
950
  if (gate.skip) status.append(el('span', 'skip: ' + gate.skip, 'set-gate-skip'));
819
951
  const top = el('div', undefined, 'set-file-head');
820
952
  top.append(h, status);
821
- art.append(top);
953
+ art.append(top, ...gateHelp(gate));
822
954
  if (!s.writes) {
823
955
  const bits = ['mode ' + gate.mode, gate.provider ? 'provider ' + gate.provider : 'no provider', gate.model ? 'model ' + gate.model : 'no model'];
824
956
  art.append(el('p', bits.join(', '), 'muted'));
@@ -1603,7 +1735,7 @@
1603
1735
  return { poll, pick };
1604
1736
  }
1605
1737
 
1606
- return { render, configBody, repoKey, gateKey, targetPath, subsetOk, valueProblem, decideTextProblem, describeDecide, gateTags, replayDate,
1738
+ return { render, configBody, repoKey, gateKey, targetPath, subsetOk, valueProblem, decideTextProblem, describeDecide, gateTags, replayDate, GATES, GATE_HELP, SETUP_GUIDE,
1607
1739
  pickDefault, groupRuns, optionLabel, typeAhead, editorOf, isDirty, dirtyState, edited, typed, shown, readFailure,
1608
1740
  unsavedLabels, departedRun,
1609
1741
  describeProfile, profileRequest, profileCopySpec, clearDefaultLevel, profileOffers, profileRowText, shadowLabel, refusalReasons, profileText, profileJsonProblem, profileNameProblem,