@giamme/forge 0.14.1 → 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.
- package/CHANGELOG.md +46 -0
- package/SKILL.md +47 -14
- package/VERSION +1 -1
- package/docs/artifacts.md +1 -1
- package/docs/commands.md +302 -9
- package/docs/forge-ui.md +14 -0
- package/docs/memory.md +22 -0
- package/docs/models.md +53 -0
- package/docs/reviews.md +7 -0
- package/forge +11 -0
- package/package.json +1 -1
- package/references/dataset.md +16 -4
- package/references/decompose.md +154 -9
- package/references/harnesses.md +21 -1
- package/references/planning.md +59 -0
- package/references/solo.md +5 -1
- package/references/ui.md +48 -1
- package/scripts/forge-artifact.sh +53 -0
- package/scripts/forge-compare.py +6 -3
- package/scripts/forge-config.py +531 -4
- package/scripts/forge-contract.py +55 -8
- package/scripts/forge-control.py +0 -2
- package/scripts/forge-dispatch.sh +84 -14
- package/scripts/forge-fail-first.py +3 -1
- package/scripts/forge-guard.py +247 -8
- package/scripts/forge-issues.py +12 -0
- package/scripts/forge-lib-adopt.sh +260 -0
- package/scripts/forge-lib-attribute.sh +10 -2
- package/scripts/forge-lib-plans.sh +35 -6
- package/scripts/forge-lib-review.sh +13 -5
- package/scripts/forge-lib-task.sh +138 -5
- package/scripts/forge-memory.sh +41 -4
- package/scripts/forge-metrics.sh +7 -0
- package/scripts/forge-parallel-options.sh +12 -6
- package/scripts/forge-parallel.sh +659 -32
- package/scripts/forge-plan-check.py +591 -8
- package/scripts/forge-planner.py +480 -0
- package/scripts/forge-route.py +16 -2
- package/scripts/forge-runs-rm.py +23 -7
- package/scripts/forge-runtime.py +111 -2
- package/scripts/forge-schedule.py +5 -2
- package/scripts/forge-shadow.py +53 -7
- package/scripts/forge-solo.sh +87 -7
- package/scripts/forge_dataset/cli.py +26 -0
- package/scripts/forge_dataset/efforts.py +215 -0
- package/scripts/forge_dataset/export.py +1 -0
- package/scripts/forge_dataset/harvest.py +55 -0
- package/scripts/forge_dataset/history.py +126 -0
- package/scripts/forge_dataset/worktrees.py +95 -0
- package/scripts/forge_decide/__init__.py +19 -1
- package/scripts/forge_decide/builtin_profiles.json +25 -0
- package/scripts/forge_decide/cli.py +12 -0
- package/scripts/forge_decide/profiles.py +866 -0
- package/scripts/forge_decide/resolve.py +38 -6
- package/scripts/forge_memory_list.py +153 -0
- package/scripts/forge_worktrees.py +88 -0
- package/ui/README.md +31 -0
- package/ui/docs/api.md +168 -12
- package/ui/forge_ui/__init__.py +14 -1
- package/ui/forge_ui/__main__.py +1 -1
- package/ui/forge_ui/control.py +250 -12
- package/ui/forge_ui/executions.py +28 -8
- package/ui/forge_ui/findings.py +7 -0
- package/ui/forge_ui/models.py +60 -1
- package/ui/forge_ui/projects.py +571 -0
- package/ui/forge_ui/reader.py +48 -8
- package/ui/forge_ui/static/app.js +99 -21
- package/ui/forge_ui/static/cloudui.js +6 -2
- package/ui/forge_ui/static/convo.js +1 -1
- package/ui/forge_ui/static/diffview.js +2 -2
- package/ui/forge_ui/static/files.js +1 -1
- package/ui/forge_ui/static/index.html +5 -1
- package/ui/forge_ui/static/leaderboard.js +5 -1
- package/ui/forge_ui/static/modelstats.js +25 -1
- package/ui/forge_ui/static/panel.js +47 -4
- package/ui/forge_ui/static/projectsview.js +372 -0
- package/ui/forge_ui/static/settings.js +924 -29
- package/ui/forge_ui/static/style.css +116 -3
- package/ui/forge_ui/static/uikit.js +94 -1
- package/ui/forge_ui/static/worktreesview.js +250 -0
- package/ui/forge_ui/worktrees.py +570 -0
|
@@ -11,9 +11,12 @@ Levels, lowest to highest; each sets a gate's fields only where it names them:
|
|
|
11
11
|
forge_jev.enabled(capability) from jev.json and the FORGE_JEV* variables, and
|
|
12
12
|
turns a gate `on` when its capability is enabled. It never sets `off`, and a
|
|
13
13
|
gate with no capability (None) is never turned on there.
|
|
14
|
-
4. profile --
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
4. profile -- FORGE_DECIDE_PROFILE_JSON when set: the {"name", "gates", "budget"} copy frozen
|
|
15
|
+
when the run was planned, applied as `frozen profile NAME` whatever the live
|
|
16
|
+
files say (set but invalid, empty included, or not of that shape: an error, nothing applied). Else `profile`, else
|
|
17
|
+
FORGE_DECIDE_PROFILE; looked up in the user file's `profiles` first, then the
|
|
18
|
+
repo file's, then the built-in profiles (which set no gate and no budget). Sets
|
|
19
|
+
`gates` and `budget` (`budget.daily_*` only from a user-file profile).
|
|
17
20
|
5. env -- FORGE_DECIDE_GATE_<NAME>=off|shadow|on (NAME upper-cased, `-` -> `_`). Once a
|
|
18
21
|
user decide.json exists, the legacy FORGE_JEV_<CAP> variables can only restrict:
|
|
19
22
|
`off` turns that capability's gates off, and any `on` turns off the gates of
|
|
@@ -258,6 +261,28 @@ def _shadowed(repo_gates: dict, repo_budget: dict, user_gates: dict, user_budget
|
|
|
258
261
|
return out
|
|
259
262
|
|
|
260
263
|
|
|
264
|
+
def _frozen_profile(result: dict, text: str, errors: list) -> None:
|
|
265
|
+
"""Step 4 from FORGE_DECIDE_PROFILE_JSON, {"name", "gates", "budget"}: nothing applied when
|
|
266
|
+
it is not valid JSON of that shape."""
|
|
267
|
+
try:
|
|
268
|
+
data = json.loads(text)
|
|
269
|
+
except (TypeError, ValueError, RecursionError) as exc:
|
|
270
|
+
errors.append(f'FORGE_DECIDE_PROFILE_JSON: not valid JSON ({exc}); ignored')
|
|
271
|
+
return
|
|
272
|
+
name = data.get('name') if isinstance(data, dict) else None
|
|
273
|
+
if not isinstance(name, str) or not name:
|
|
274
|
+
errors.append('FORGE_DECIDE_PROFILE_JSON: not an object with a name; ignored')
|
|
275
|
+
return
|
|
276
|
+
for key in ('gates', 'budget'):
|
|
277
|
+
if data.get(key) is not None and not isinstance(data[key], dict):
|
|
278
|
+
errors.append(f'FORGE_DECIDE_PROFILE_JSON: {key} is not an object; ignored')
|
|
279
|
+
return
|
|
280
|
+
label = f'frozen profile {name}'
|
|
281
|
+
result['profile'] = name
|
|
282
|
+
_apply(result, _parse_gates(data.get('gates'), label, errors),
|
|
283
|
+
_parse_budget(data.get('budget'), label, errors, RUN_BUDGET + DAILY_BUDGET), 'profile')
|
|
284
|
+
|
|
285
|
+
|
|
261
286
|
def _resolve(repo, profile, env, flags, errors: list, user_data=None, repo_data=None) -> dict:
|
|
262
287
|
result = _result(errors)
|
|
263
288
|
|
|
@@ -301,9 +326,12 @@ def _resolve(repo, profile, env, flags, errors: list, user_data=None, repo_data=
|
|
|
301
326
|
_legacy(result, env, errors)
|
|
302
327
|
result['shadowed'] = _shadowed(repo_gates, repo_budget, user_gates, user_budget)
|
|
303
328
|
|
|
304
|
-
# 4. profile
|
|
329
|
+
# 4. profile: the copy frozen when the run was planned, else looked up by name
|
|
330
|
+
# (set but empty or invalid still counts as set: an error, and the live profile is not used)
|
|
305
331
|
name = profile if profile is not None else (env.get('FORGE_DECIDE_PROFILE') or None)
|
|
306
|
-
if
|
|
332
|
+
if 'FORGE_DECIDE_PROFILE_JSON' in env:
|
|
333
|
+
_frozen_profile(result, env['FORGE_DECIDE_PROFILE_JSON'], errors)
|
|
334
|
+
elif name is not None:
|
|
307
335
|
found = None
|
|
308
336
|
for data, label, in_user in ((user_data, user_label, True), (repo_data, repo_label, False)):
|
|
309
337
|
profiles = data.get('profiles')
|
|
@@ -311,7 +339,11 @@ def _resolve(repo, profile, env, flags, errors: list, user_data=None, repo_data=
|
|
|
311
339
|
found = (profiles[name], f'{label}: profile {name!r}', in_user)
|
|
312
340
|
break
|
|
313
341
|
if found is None:
|
|
314
|
-
|
|
342
|
+
from . import profiles as profile_store
|
|
343
|
+
if name in profile_store.builtin_names():
|
|
344
|
+
result['profile'] = name # a built-in profile sets no gate and no budget
|
|
345
|
+
else:
|
|
346
|
+
errors.append(f'profile {name!r} not found; ignored')
|
|
315
347
|
elif not isinstance(found[0], dict):
|
|
316
348
|
errors.append(f'{found[1]} is not an object; ignored')
|
|
317
349
|
else:
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""`forge-memory.sh learnings <repo> --json`: every learning in a repo's ledger and its state (#126).
|
|
3
|
+
|
|
4
|
+
forge-memory.sh runs its own `rebuild` into a scratch dir first, with MEMORY_DROPS recording what it dropped
|
|
5
|
+
and why; this reads the ledger, that rebuilt memory and the drops, and says per learning what the rebuild did,
|
|
6
|
+
so the state shown is the one forge's bash decided, never a second implementation of it:
|
|
7
|
+
|
|
8
|
+
in_memory the rebuilt memory.md has it
|
|
9
|
+
waiting a finding seen in one run only: it needs a second run to be promoted
|
|
10
|
+
stale its [anchor] path no longer exists in the repo
|
|
11
|
+
capped trimmed by the memory cap (FORGE_MEMORY_MAX_LINES / MAX_BYTES)
|
|
12
|
+
muted every row of it was marked not injectable (Jev's curation)
|
|
13
|
+
|
|
14
|
+
A learning is a (category, key) group, as rebuild groups the ledger: `count` is the number of distinct runs
|
|
15
|
+
it appeared in, `text` the latest wording. `memory` is the repo's current .forge/memory.md by section, with
|
|
16
|
+
the roles each section reaches; `rebuilt_differs` says the current file is not what a rebuild makes now (an
|
|
17
|
+
older forge wrote it, or a `prune` asked Jev to drop facts). Stdlib only.
|
|
18
|
+
"""
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
import argparse
|
|
22
|
+
import json
|
|
23
|
+
import re
|
|
24
|
+
import sys
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
SECTIONS = (('verify', 'Verify', ('planner', 'dwarf')),
|
|
28
|
+
('trap', 'Known traps', ('planner', 'dwarf', 'qa')),
|
|
29
|
+
('finding', 'Recurring QA findings', ('planner', 'dwarf', 'qa')))
|
|
30
|
+
_TITLE = {'## ' + title: (cat, roles) for cat, title, roles in SECTIONS}
|
|
31
|
+
_FACT = re.compile(r'^- (?:([0-9]+)x: )?(.*)$')
|
|
32
|
+
_MAX_READ = 32 << 20
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _read(path):
|
|
36
|
+
try:
|
|
37
|
+
p = Path(path)
|
|
38
|
+
if not p.is_file() or p.stat().st_size > _MAX_READ:
|
|
39
|
+
return None
|
|
40
|
+
return p.read_text(encoding='utf-8', errors='replace')
|
|
41
|
+
except OSError:
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def parse_memory(text):
|
|
46
|
+
"""[{category, title, roles, lines: [{text, count}]}] of a memory.md, in file order."""
|
|
47
|
+
out, current = [], None
|
|
48
|
+
for line in (text or '').splitlines():
|
|
49
|
+
if line.startswith('## '):
|
|
50
|
+
found = _TITLE.get(line.strip())
|
|
51
|
+
current = None
|
|
52
|
+
if found:
|
|
53
|
+
current = dict(category=found[0], title=line[3:].strip(), roles=list(found[1]), lines=[])
|
|
54
|
+
out.append(current)
|
|
55
|
+
continue
|
|
56
|
+
fact = _FACT.match(line)
|
|
57
|
+
if fact and current is not None:
|
|
58
|
+
current['lines'].append(dict(text=fact.group(2), count=int(fact.group(1)) if fact.group(1) else None))
|
|
59
|
+
return out
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def ledger_groups(text):
|
|
63
|
+
"""{(category, key): group} as rebuild groups the ledger, plus every learning row."""
|
|
64
|
+
groups = {}
|
|
65
|
+
for line in (text or '').splitlines():
|
|
66
|
+
if not line or line.startswith('#'):
|
|
67
|
+
continue
|
|
68
|
+
cols = line.split('\t')
|
|
69
|
+
if len(cols) < 9:
|
|
70
|
+
continue
|
|
71
|
+
ts, run, task, role, model, verdict, cat, key, txt = cols[:9]
|
|
72
|
+
if cat == '-' or key == '-':
|
|
73
|
+
continue # a dispatch that emitted no learning
|
|
74
|
+
injectable = not (len(cols) >= 11 and cols[10] == '0')
|
|
75
|
+
g = groups.setdefault((cat, key), dict(category=cat, key=key, rows=[], runs=set(), last_ts=None, text=None,
|
|
76
|
+
any_injectable=False))
|
|
77
|
+
g['rows'].append(dict(ts=ts, run_id=run, task=task, role=role, model=model, verdict=verdict, text=txt,
|
|
78
|
+
injectable=injectable))
|
|
79
|
+
if injectable:
|
|
80
|
+
g['any_injectable'] = True
|
|
81
|
+
g['runs'].add(run)
|
|
82
|
+
# awk's `ts >= lastts[k]` on strings: the later row of two with the same time wins
|
|
83
|
+
if g['last_ts'] is None or ts >= g['last_ts']:
|
|
84
|
+
g['last_ts'], g['text'] = ts, txt
|
|
85
|
+
return groups
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def drops_of(text):
|
|
89
|
+
"""{(reason, category or '-', text)} of rebuild's MEMORY_DROPS rows; cap rows hold the whole '- ...' line."""
|
|
90
|
+
out = set()
|
|
91
|
+
for line in (text or '').splitlines():
|
|
92
|
+
reason, _, rest = line.partition('\t')
|
|
93
|
+
cat, _, fact = rest.partition('\t')
|
|
94
|
+
if reason == 'cap':
|
|
95
|
+
m = _FACT.match(fact)
|
|
96
|
+
fact = m.group(2) if m else fact
|
|
97
|
+
out.add((reason, cat, fact))
|
|
98
|
+
return out
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def classify(groups, rebuilt, drops):
|
|
102
|
+
kept = {(s['category'], line['text']) for s in rebuilt for line in s['lines']}
|
|
103
|
+
capped = {fact for reason, _cat, fact in drops if reason == 'cap'}
|
|
104
|
+
stale = {(cat, fact) for reason, cat, fact in drops if reason in ('anchor_missing', 'jev_stale')}
|
|
105
|
+
out = []
|
|
106
|
+
for (cat, key), g in groups.items():
|
|
107
|
+
if not g['any_injectable']:
|
|
108
|
+
state, text, count = 'muted', g['rows'][-1]['text'], 0
|
|
109
|
+
else:
|
|
110
|
+
text, count = g['text'], len(g['runs'])
|
|
111
|
+
if (cat, text) in kept:
|
|
112
|
+
state = 'in_memory'
|
|
113
|
+
elif (cat, text) in stale:
|
|
114
|
+
state = 'stale'
|
|
115
|
+
elif text in capped:
|
|
116
|
+
state = 'capped'
|
|
117
|
+
elif cat == 'finding' and count < 2:
|
|
118
|
+
state = 'waiting'
|
|
119
|
+
else:
|
|
120
|
+
state = 'dropped' # not reached by today's rebuild; kept honest if it changes
|
|
121
|
+
rows = g['rows']
|
|
122
|
+
out.append(dict(category=cat, key=key, text=text, count=count, state=state,
|
|
123
|
+
first=min(r['ts'] for r in rows), last=max(r['ts'] for r in rows), rows=rows))
|
|
124
|
+
out.sort(key=lambda r: (r['last'], r['category'], r['key']), reverse=True)
|
|
125
|
+
return out
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def build(repo, ledger, memory, rebuilt, drops, max_lines, max_bytes, memory_off):
|
|
129
|
+
ledger_text, current, made = _read(ledger), _read(memory), _read(rebuilt)
|
|
130
|
+
groups = ledger_groups(ledger_text)
|
|
131
|
+
rebuilt_sections = parse_memory(made)
|
|
132
|
+
return dict(repo=repo, ledger=ledger_text is not None, memory_off=memory_off, max_lines=max_lines,
|
|
133
|
+
max_bytes=max_bytes, memory=parse_memory(current) if current is not None else None,
|
|
134
|
+
rebuilt_differs=(current or '') != (made or ''),
|
|
135
|
+
learnings=classify(groups, rebuilt_sections, drops_of(_read(drops))))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def main(argv=None):
|
|
139
|
+
p = argparse.ArgumentParser(prog='forge-memory.sh learnings')
|
|
140
|
+
for name in ('repo', 'ledger', 'memory', 'rebuilt', 'drops'):
|
|
141
|
+
p.add_argument('--' + name, required=True)
|
|
142
|
+
p.add_argument('--max-lines', type=int, required=True)
|
|
143
|
+
p.add_argument('--max-bytes', type=int, required=True)
|
|
144
|
+
p.add_argument('--memory-off', choices=('0', '1'), default='0')
|
|
145
|
+
a = p.parse_args(argv)
|
|
146
|
+
json.dump(build(a.repo, a.ledger, a.memory, a.rebuilt, a.drops, a.max_lines, a.max_bytes, a.memory_off == '1'),
|
|
147
|
+
sys.stdout, sort_keys=True)
|
|
148
|
+
sys.stdout.write('\n')
|
|
149
|
+
return 0
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if __name__ == '__main__':
|
|
153
|
+
sys.exit(main())
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""Which worktrees under `.forge-worktrees` are forge's, and what kind each is.
|
|
2
|
+
|
|
3
|
+
One rule for `forge runs rm` (what it may remove) and forge-ui's Worktrees screen (what it offers to
|
|
4
|
+
remove), so the two cannot disagree (#125).
|
|
5
|
+
|
|
6
|
+
forge-parallel.sh puts a run's worktrees in `<checkout>/../.forge-worktrees/<run id>/`, derived with a
|
|
7
|
+
logical `cd`, never read from the run's `wt_root` file. A worktree there is the run's when:
|
|
8
|
+
|
|
9
|
+
task it has the branch forge/<run id>/<task> checked out, for a task of the run
|
|
10
|
+
integration it has the branch forge/<run id>-integration checked out
|
|
11
|
+
candidate it is detached, directly in the run's folder, and named `_candidate-<n>` (integrate's
|
|
12
|
+
scratch worktree, left behind when integrate stopped)
|
|
13
|
+
attribute it is detached, directly in the run's folder, and named `_attribute` or
|
|
14
|
+
`_attribute-<n>` (the culprit search's scratch worktree), and no task has that name
|
|
15
|
+
|
|
16
|
+
Anything else there, and any worktree of the run's branches outside that folder, is not forge's.
|
|
17
|
+
"""
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import os
|
|
21
|
+
import re
|
|
22
|
+
|
|
23
|
+
RUN_ID = re.compile(r'[A-Za-z0-9][A-Za-z0-9._-]{0,127}')
|
|
24
|
+
_SCRATCH = (('candidate', re.compile(r'_candidate-[0-9]+')), ('attribute', re.compile(r'_attribute(?:-[0-9]+)?')))
|
|
25
|
+
KINDS = ('task', 'integration', 'candidate', 'attribute')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def contains(parent, child):
|
|
29
|
+
"""True when `child` is `parent` or inside it (both real paths)."""
|
|
30
|
+
parent = parent.rstrip(os.sep) or os.sep
|
|
31
|
+
return child == parent or child.startswith(parent + os.sep)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def wt_root(repo, run_id):
|
|
35
|
+
"""The run's worktree folder, as forge-parallel.sh derives it: `$(cd "$REPO/.." && pwd)/.forge-worktrees/<run id>`."""
|
|
36
|
+
return os.path.realpath(os.path.join(os.path.normpath(os.path.join(repo, '..')), '.forge-worktrees', run_id))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def owner(path, branch, run_id, tasks, root):
|
|
40
|
+
"""The kind of forge worktree at `path` (one of KINDS), or None when it is not the run's.
|
|
41
|
+
|
|
42
|
+
`branch` is the full ref git lists (refs/heads/...), or None for a detached worktree; `tasks` the run's
|
|
43
|
+
task ids; `root` the run's worktree folder (`wt_root`).
|
|
44
|
+
"""
|
|
45
|
+
real = os.path.realpath(path)
|
|
46
|
+
if real == root or not contains(root, real):
|
|
47
|
+
return None
|
|
48
|
+
if branch == 'refs/heads/forge/%s-integration' % run_id:
|
|
49
|
+
return 'integration'
|
|
50
|
+
prefix = 'refs/heads/forge/%s/' % run_id
|
|
51
|
+
if isinstance(branch, str) and branch.startswith(prefix) and branch[len(prefix):] in set(tasks):
|
|
52
|
+
return 'task'
|
|
53
|
+
name = os.path.basename(real)
|
|
54
|
+
if branch is None and os.path.dirname(real) == root and name not in set(tasks):
|
|
55
|
+
for kind, pattern in _SCRATCH:
|
|
56
|
+
if pattern.fullmatch(name):
|
|
57
|
+
return kind
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def parse_porcelain(out, z=True):
|
|
62
|
+
"""`git worktree list --porcelain [-z]` output (text) as a list of dicts:
|
|
63
|
+
{path, head, branch (full ref or None), detached, bare, locked (reason or None), prunable (reason or None)}.
|
|
64
|
+
|
|
65
|
+
`locked` and `prunable` are '' when git gave no reason. With `z` a path may hold a newline; without it
|
|
66
|
+
such a path is split and its record is malformed, so that output is only for a git too old for -z.
|
|
67
|
+
"""
|
|
68
|
+
found, current = [], None
|
|
69
|
+
fields = out.split('\0') if z else out.split('\n')
|
|
70
|
+
for field in fields:
|
|
71
|
+
if not field:
|
|
72
|
+
current = None
|
|
73
|
+
continue
|
|
74
|
+
key, _, value = field.partition(' ')
|
|
75
|
+
if key == 'worktree':
|
|
76
|
+
current = dict(path=value, head=None, branch=None, detached=False, bare=False, locked=None, prunable=None)
|
|
77
|
+
found.append(current)
|
|
78
|
+
elif current is None:
|
|
79
|
+
continue
|
|
80
|
+
elif key == 'HEAD':
|
|
81
|
+
current['head'] = value
|
|
82
|
+
elif key == 'branch':
|
|
83
|
+
current['branch'] = value
|
|
84
|
+
elif key in ('detached', 'bare'):
|
|
85
|
+
current[key] = True
|
|
86
|
+
elif key in ('locked', 'prunable'):
|
|
87
|
+
current[key] = value
|
|
88
|
+
return found
|
package/ui/README.md
CHANGED
|
@@ -239,6 +239,37 @@ keep one meaning everywhere (amber running, green merged or passed, red failed,
|
|
|
239
239
|
run cloud filtered to its runs.
|
|
240
240
|
|
|
241
241
|
<img src="docs/media/models.png" width="760" alt="The implementers table: tasks, first-attempt pass rate with its 95% interval, retries, escalations, timeouts, accepts, median model time and tokens per model.">
|
|
242
|
+
- **Projects (`#/projects`, `#/projects/<id>[/runs|/findings|/memories]`):** one row per repository
|
|
243
|
+
(its root, as the run cloud groups runs, with the same id): runs, runs live now, last activity, open
|
|
244
|
+
findings and memory lines, sorted by latest activity; a repository whose folder is gone stays listed,
|
|
245
|
+
and runs tied to it only by their path are marked. A project's page has three tabs. *Runs*: its runs,
|
|
246
|
+
with the checkout and branch as a column to filter on. *Findings*: every finding of every review of
|
|
247
|
+
every run (each attempt and round, final reviews, shadow reviews behind a toggle), with severity,
|
|
248
|
+
confidence, location, run, task, attempt, reviewer, date and status: `open`, `filed`, `fixed`, `swept`,
|
|
249
|
+
`dismissed` (from `forge issues`, offline) or `superseded` (a later review of the same task passed,
|
|
250
|
+
which does not say the finding was fixed). A finding repeated across rounds is one row with a count,
|
|
251
|
+
by `forge issues`' fingerprint. A row opens the diff at that finding; filing and dismissing stay on the
|
|
252
|
+
run's Open findings page. *Memories*: what `memory.md` gives models, by section and role, and every
|
|
253
|
+
learning in the ledger with its state from `forge memory learnings` (in memory, waiting for a second
|
|
254
|
+
run, stale, trimmed by the cap, curated out), from the root and each checkout that still exists, and
|
|
255
|
+
from the dataset for checkouts that are gone; when checkouts' files differ the tab says so and lets you
|
|
256
|
+
pick one. Each tab reads its endpoint when it opens, never on the poll; *Read again* reads everything
|
|
257
|
+
again. A run's header (its repository name) and each map district's heading link to the project.
|
|
258
|
+
- **Worktrees (`#/worktrees`, `#/worktrees/repo/<root>`, `#/worktrees/runs/<key>`):** every worktree forge
|
|
259
|
+
created, in any repository forge-ui knows (the runs it lists and the repositories in the dataset),
|
|
260
|
+
with its run, task, branch, whether that branch is merged, its last commit, when forge created and
|
|
261
|
+
removed it, and its size. Each row has a status: *in use* (its run is active), *uncommitted
|
|
262
|
+
changes*, *locked*, *needed by the run* (the `_integration` of a run not yet integrated), *failed
|
|
263
|
+
task*, *finished*, *missing on disk*, *not forge's* (it fails the ownership rule `forge runs rm`
|
|
264
|
+
uses), *unknown to git* (a folder no repository lists) and *removed*. Rows with a safe next step
|
|
265
|
+
show the command to copy: `git -C <path> status`, `git -C <repo> worktree remove <path>` (plus
|
|
266
|
+
`git branch -d` for a merged branch), or `git worktree prune`; never `--force`, and the page runs
|
|
267
|
+
nothing, so it works with `--read-only`. *Whole runs* gives each finished run's
|
|
268
|
+
`forge runs rm <run-dir> --worktrees --branches --dry-run`, which also deletes the run directory
|
|
269
|
+
after archiving it. Removed worktrees are complete from the release that records them (dataset
|
|
270
|
+
events `worktree_created` and `worktree_removed`); older ones are derived from run dirs and the
|
|
271
|
+
dataset, without dates. The screen reads `/api/worktrees` when it opens and every minute, never on
|
|
272
|
+
the page's poll; sizes fill in as they are measured. A run's header links to its worktrees.
|
|
242
273
|
- **Diffs (`…/tasks/<id>/diff[/<source>][/file/<path> | /finding/<id>]`, `…/final-review/<name>/diff[/finding/<id>]`):** a task's
|
|
243
274
|
`changes.diff`, its previous or committed diff, or exactly the diff one reviewer read (the last
|
|
244
275
|
diff in that review's prompt), picked from a row of sources with each review's verdict; a final
|