@giamme/forge 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/SKILL.md +16 -3
- package/VERSION +1 -1
- package/docs/artifacts.md +8 -0
- package/docs/commands.md +70 -6
- package/docs/dataset.md +13 -0
- package/docs/decomposed-runs.md +8 -0
- package/docs/forge-ui.md +23 -2
- package/docs/memory.md +2 -0
- package/docs/reviews.md +15 -1
- package/docs/safety.md +8 -0
- package/forge +24 -1
- package/package.json +1 -1
- package/references/dataset.md +143 -5
- package/references/decision-models.md +15 -2
- package/references/decompose.md +180 -11
- package/references/planning.md +3 -2
- package/references/solo.md +2 -1
- package/references/ui.md +5 -2
- package/scripts/forge-artifact.sh +14 -0
- package/scripts/forge-brief.py +132 -0
- package/scripts/forge-compare.py +11 -1
- package/scripts/forge-config.py +176 -9
- package/scripts/forge-contract.py +98 -4
- package/scripts/forge-control.py +86 -13
- package/scripts/forge-dispatch.sh +14 -10
- package/scripts/forge-du.py +167 -0
- package/scripts/forge-issues.py +4 -3
- package/scripts/forge-ledger.py +3 -1
- package/scripts/forge-lib-adopt.sh +8 -1
- package/scripts/forge-lib-plans.sh +5 -2
- package/scripts/forge-lib-review.sh +29 -1
- package/scripts/forge-metrics.sh +29 -3
- package/scripts/forge-parallel-options.sh +4 -0
- package/scripts/forge-parallel.sh +506 -10
- package/scripts/forge-plan-check.py +25 -2
- package/scripts/forge-planner.py +20 -6
- package/scripts/forge-prompt.py +120 -0
- package/scripts/forge-retro.py +115 -0
- package/scripts/forge-runs-compact.py +443 -0
- package/scripts/forge-runs-rm.py +2 -0
- package/scripts/forge-runs.py +18 -3
- package/scripts/forge-schedule.py +279 -4
- package/scripts/forge-shadow.py +35 -10
- package/scripts/forge-solo.sh +2 -0
- package/scripts/forge-summarize.py +698 -0
- package/scripts/forge-sweep.py +25 -10
- package/scripts/forge-ui-options.sh +10 -0
- package/scripts/forge_brief/__init__.py +587 -0
- package/scripts/forge_brief/answers.py +459 -0
- package/scripts/forge_dataset/__init__.py +10 -0
- package/scripts/forge_dataset/cli.py +83 -0
- package/scripts/forge_dataset/export.py +18 -4
- package/scripts/forge_dataset/facts.py +280 -0
- package/scripts/forge_dataset/harvest.py +56 -9
- package/scripts/forge_dataset/history.py +5 -3
- package/scripts/forge_dataset/outcomes.py +206 -58
- package/scripts/forge_dataset/pairs.py +174 -0
- package/scripts/forge_dataset/risk.py +108 -0
- package/scripts/forge_dataset/tiers.py +427 -0
- package/scripts/forge_decide/__init__.py +11 -1
- package/scripts/forge_decide/cli.py +23 -2
- package/scripts/forge_decide/labels.py +30 -6
- package/scripts/forge_decide/replay.py +10 -4
- package/scripts/forge_locations.py +366 -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 +477 -0
- package/scripts/forge_storage.py +515 -0
- package/ui/README.md +68 -8
- package/ui/docs/api.md +217 -20
- package/ui/forge_ui/control.py +92 -11
- package/ui/forge_ui/export.py +31 -5
- package/ui/forge_ui/findings.py +4 -2
- package/ui/forge_ui/links.py +337 -0
- package/ui/forge_ui/models.py +57 -4
- package/ui/forge_ui/projects.py +4 -1
- package/ui/forge_ui/reader.py +732 -34
- package/ui/forge_ui/server.py +8 -0
- package/ui/forge_ui/static/app.js +92 -5
- package/ui/forge_ui/static/briefview.js +302 -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 +7 -3
- package/ui/forge_ui/static/index.html +3 -0
- package/ui/forge_ui/static/panel.js +311 -4
- package/ui/forge_ui/static/runmodel.js +13 -1
- package/ui/forge_ui/static/storageview.js +271 -0
- package/ui/forge_ui/static/style.css +100 -3
- package/ui/forge_ui/static/worktreesview.js +3 -3
- package/ui/forge_ui/storage.py +136 -0
- package/ui/forge_ui/transcripts.py +35 -10
- package/ui/forge_ui/worktrees.py +154 -13
package/ui/forge_ui/models.py
CHANGED
|
@@ -7,14 +7,16 @@ implementer is censored, never counted as a failure.
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
from collections import OrderedDict
|
|
10
|
+
import importlib.util
|
|
10
11
|
import json
|
|
11
12
|
import math
|
|
12
13
|
import os
|
|
13
14
|
from pathlib import Path
|
|
15
|
+
import sys
|
|
14
16
|
import threading
|
|
15
17
|
import time
|
|
16
18
|
|
|
17
|
-
from forge_ui import executions, reader
|
|
19
|
+
from forge_ui import executions, findings, reader
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
_MAX_ROWS = 50000
|
|
@@ -35,6 +37,57 @@ def _alias(spec):
|
|
|
35
37
|
return (spec.split(':', 1)[0] or None) if isinstance(spec, str) else None
|
|
36
38
|
|
|
37
39
|
|
|
40
|
+
_DATASET = Path(__file__).resolve().parents[2] / 'scripts' / 'forge_dataset' / '__init__.py'
|
|
41
|
+
_SIDE_LOCK = threading.Lock()
|
|
42
|
+
_SIDE_FN = {}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _is_side_role():
|
|
46
|
+
"""forge_dataset.is_side_role, loaded read-only the way reader loads forge_infra. None when it cannot be."""
|
|
47
|
+
with _SIDE_LOCK:
|
|
48
|
+
if 'fn' in _SIDE_FN:
|
|
49
|
+
return _SIDE_FN['fn']
|
|
50
|
+
fn = None
|
|
51
|
+
scripts = str(_DATASET.parents[1])
|
|
52
|
+
inserted = scripts not in sys.path
|
|
53
|
+
if inserted:
|
|
54
|
+
sys.path.insert(0, scripts)
|
|
55
|
+
try:
|
|
56
|
+
spec = importlib.util.spec_from_file_location(
|
|
57
|
+
'forge_dataset_for_ui', _DATASET,
|
|
58
|
+
loader=findings._ReadOnlyLoader('forge_dataset_for_ui', str(_DATASET)))
|
|
59
|
+
module = importlib.util.module_from_spec(spec)
|
|
60
|
+
spec.loader.exec_module(module)
|
|
61
|
+
candidate = getattr(module, 'is_side_role', None)
|
|
62
|
+
fn = candidate if callable(candidate) else None
|
|
63
|
+
except Exception:
|
|
64
|
+
fn = None
|
|
65
|
+
finally:
|
|
66
|
+
if inserted and scripts in sys.path:
|
|
67
|
+
sys.path.remove(scripts)
|
|
68
|
+
_SIDE_FN['fn'] = fn
|
|
69
|
+
return fn
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def side_role(role) -> bool:
|
|
73
|
+
"""A side dispatch: harvested `side_*`, or the on-disk role `side` (`is_side_role` rejects the bare name).
|
|
74
|
+
|
|
75
|
+
Not an attempt. A shadow review is a separate flag on the execution; this is only the role.
|
|
76
|
+
"""
|
|
77
|
+
if role == 'side':
|
|
78
|
+
return True
|
|
79
|
+
fn = _is_side_role()
|
|
80
|
+
if fn is not None:
|
|
81
|
+
return bool(fn(role))
|
|
82
|
+
return isinstance(role, str) and role.startswith('side_')
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _primary_qa(item) -> bool:
|
|
86
|
+
"""The review of record for an attempt. A shadow review and a side dispatch are not one."""
|
|
87
|
+
role = item['role']
|
|
88
|
+
return role == 'qa' and not item['shadow'] and role != 'qa_shadow' and not side_role(role)
|
|
89
|
+
|
|
90
|
+
|
|
38
91
|
def _builtin_profiles_path():
|
|
39
92
|
"""scripts/forge_decide/builtin_profiles.json, located from this package the way reader._forge_infra finds
|
|
40
93
|
scripts/forge_infra.py. Read as data: forge-ui never imports forge_decide."""
|
|
@@ -127,7 +180,7 @@ def _attempts(rows, execs, plan_spec):
|
|
|
127
180
|
result = []
|
|
128
181
|
for n, (status, logged) in rows.items():
|
|
129
182
|
dwarfs = [item for item in execs if item['role'] == 'dwarf' and item['attempt'] == n]
|
|
130
|
-
reviews = [item for item in execs if item
|
|
183
|
+
reviews = [item for item in execs if _primary_qa(item) and item['attempt'] == n]
|
|
131
184
|
outcome, reason = _outcome(status, dwarfs, reviews)
|
|
132
185
|
last = dwarfs[-1] if dwarfs else None
|
|
133
186
|
model = last['model'] if last is not None else None
|
|
@@ -166,7 +219,7 @@ def _route(rd, base):
|
|
|
166
219
|
def _reviews(key, ident, execs, shadows):
|
|
167
220
|
rows = []
|
|
168
221
|
for item in execs:
|
|
169
|
-
if item
|
|
222
|
+
if _primary_qa(item) and item['state'] == 'done':
|
|
170
223
|
model = item['model'] or {}
|
|
171
224
|
rows.append(dict(run=key, task=ident, n=item['attempt'], kind='primary', alias=model.get('alias'),
|
|
172
225
|
spec=model.get('spec'), verdict=item['verdict'], findings=item['findings'],
|
|
@@ -176,7 +229,7 @@ def _reviews(key, ident, execs, shadows):
|
|
|
176
229
|
continue
|
|
177
230
|
model = (items[-1]['model'] if items else None) or {}
|
|
178
231
|
spec = entry['spec'] if isinstance(entry['spec'], str) else model.get('spec')
|
|
179
|
-
primaries = [item for item in execs if item
|
|
232
|
+
primaries = [item for item in execs if _primary_qa(item)
|
|
180
233
|
and item['attempt'] == entry['attempt'] and item['model']]
|
|
181
234
|
rows.append(dict(run=key, task=ident, n=entry['attempt'], kind='shadow', alias=model.get('alias') or _alias(spec),
|
|
182
235
|
spec=spec, verdict=entry['verdict'], findings=entry['findings'],
|
package/ui/forge_ui/projects.py
CHANGED
|
@@ -30,7 +30,7 @@ from pathlib import Path
|
|
|
30
30
|
import threading
|
|
31
31
|
import time
|
|
32
32
|
|
|
33
|
-
from forge_ui import executions, findings as F, reader, repos
|
|
33
|
+
from forge_ui import executions, findings as F, models, reader, repos
|
|
34
34
|
|
|
35
35
|
ISSUES = Path(__file__).resolve().parents[2] / 'scripts' / 'forge-issues.py'
|
|
36
36
|
CACHE_S = 300
|
|
@@ -246,6 +246,9 @@ def _dataset_occurrences(hist, runs_here):
|
|
|
246
246
|
for (run, task), reviews in by_run.items():
|
|
247
247
|
reviews.sort(key=lambda r: r.get('ts') or 0)
|
|
248
248
|
for index, review in enumerate(reviews):
|
|
249
|
+
# A side dispatch is not a review of the task. qa_shadow stays a shadow row.
|
|
250
|
+
if models.side_role(review.get('role')):
|
|
251
|
+
continue
|
|
249
252
|
superseded = any(r.get('verdict') == 'PASS' and r.get('role') == 'qa' for r in reviews[index + 1:])
|
|
250
253
|
for item in review.get('findings') or []:
|
|
251
254
|
head = item['head']
|