@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/scripts/forge-sweep.py
CHANGED
|
@@ -25,8 +25,12 @@ least as severe as --severity, from a task that is not itself a sweep task (one
|
|
|
25
25
|
review finds goes to `forge issues`), not dismissed (`forge issues --dismiss`), located in a file the
|
|
26
26
|
integration branch still has, and still there: when a later merge changed the file and the line the
|
|
27
27
|
reviewer saw is gone from it, the finding is left for `forge issues` rather than "fixed" twice. A
|
|
28
|
-
person's acceptance of a reviewer's FAIL (`accept`) is theirs to triage, so accepted
|
|
29
|
-
swept. Every finding left out is listed in the plan with its reason.
|
|
28
|
+
person's acceptance of a reviewer's FAIL (`accept`, or `adopt --approved`) is theirs to triage, so accepted
|
|
29
|
+
findings are never swept. Every finding left out is listed in the plan with its reason.
|
|
30
|
+
|
|
31
|
+
A range `adopt` brought in has no task row, and what its review tolerated is swept like a task's (#131):
|
|
32
|
+
its fix task's reviewer is the adoption's reviewer, and its implementer the plan's low tier, else the
|
|
33
|
+
implementer of the run's first task.
|
|
30
34
|
|
|
31
35
|
Each fix task gets at most GROUP_CAP findings; --max (default DEFAULT_MAX) caps the tasks, worst
|
|
32
36
|
severity first. Its implementer is the plan's low tier (the first spec of --dwarf-low, else of
|
|
@@ -67,6 +71,7 @@ REASONS = {
|
|
|
67
71
|
'group-cap': 'over the %d findings one fix task takes' % GROUP_CAP,
|
|
68
72
|
'over-max': 'over --sweep-max fix tasks',
|
|
69
73
|
'no-model': 'no implementer or reviewer to give its fix task',
|
|
74
|
+
'accepted': 'a person kept it over the review (accept, or adopt --approved): theirs to triage',
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
_ISSUES = None
|
|
@@ -218,13 +223,19 @@ def triage(ctx: Context, found: list, severity: str, plausible: bool) -> tuple:
|
|
|
218
223
|
kept, dropped, seen = [], [], {}
|
|
219
224
|
tip_text = {}
|
|
220
225
|
for f in sorted(found, key=lambda f: SEVERITIES.index(f['severity'])):
|
|
221
|
-
if
|
|
226
|
+
if not f.get('task') or is_sweep_task(ctx.plan, f['task']):
|
|
227
|
+
continue
|
|
228
|
+
if f['origin'] not in origins and f['origin'] != 'accepted':
|
|
222
229
|
continue
|
|
223
230
|
f = dict(f, key=mod.finding_key(f))
|
|
224
231
|
|
|
225
232
|
def drop(reason, **detail):
|
|
226
233
|
dropped.append(dict(f, reason=reason, detail=detail))
|
|
227
234
|
|
|
235
|
+
if f['origin'] == 'accepted':
|
|
236
|
+
drop('accepted')
|
|
237
|
+
continue
|
|
238
|
+
|
|
228
239
|
if SEVERITIES.index(f['severity']) > cut:
|
|
229
240
|
drop('below-severity')
|
|
230
241
|
continue
|
|
@@ -279,18 +290,22 @@ def pools(plan: Path) -> dict:
|
|
|
279
290
|
return data if isinstance(data, dict) else {}
|
|
280
291
|
|
|
281
292
|
|
|
282
|
-
def models(plan: Path, source: 'list | None') -> tuple:
|
|
283
|
-
"""(dwarf, qa) for a fix task whose worst finding came from the task with row `source
|
|
284
|
-
|
|
293
|
+
def models(plan: Path, source: 'list | None', finding: 'dict | None' = None, table: list = ()) -> tuple:
|
|
294
|
+
"""(dwarf, qa) for a fix task whose worst finding came from the task with row `source`; an empty string
|
|
295
|
+
where there is no spec to use. Without a row (an adopted range, #131) the reviewer is the finding's own
|
|
296
|
+
(the adoption's spec) and the implementer, below the low tier, the run's first task's."""
|
|
285
297
|
def usable(spec):
|
|
286
298
|
return spec if isinstance(spec, str) and spec not in ('', '-', 'UNASSIGNED') else ''
|
|
287
|
-
qa = usable(source[5]) if source else ''
|
|
299
|
+
qa = usable(source[5]) if source else usable((finding or {}).get('reviewer'))
|
|
288
300
|
routing = pools(plan)
|
|
289
301
|
for tier in ('low', 'any'):
|
|
290
302
|
specs = routing.get(tier)
|
|
291
303
|
if isinstance(specs, list) and specs and usable(specs[0]):
|
|
292
304
|
return specs[0], qa
|
|
293
|
-
|
|
305
|
+
if source:
|
|
306
|
+
return usable(source[4]), qa
|
|
307
|
+
first = next((row for row in table if len(row) > 4 and not is_sweep_task(plan, row[0])), None)
|
|
308
|
+
return (usable(first[4]) if first else ''), qa
|
|
294
309
|
|
|
295
310
|
|
|
296
311
|
def free_ids(taken: set, count: int) -> list:
|
|
@@ -368,7 +383,7 @@ def cmd_plan(args) -> int:
|
|
|
368
383
|
run_id = read(plan / 'run_id') or plan.name
|
|
369
384
|
tasks, new_rows = [], []
|
|
370
385
|
for path, items in list(chosen):
|
|
371
|
-
if not all(models(plan, by_id.get(items[0]['task']))):
|
|
386
|
+
if not all(models(plan, by_id.get(items[0]['task']), items[0], table)):
|
|
372
387
|
chosen.remove((path, items))
|
|
373
388
|
dropped += [dict(f, reason='no-model', detail={}) for f in items]
|
|
374
389
|
for ident, (path, items) in zip(ids, chosen):
|
|
@@ -376,7 +391,7 @@ def cmd_plan(args) -> int:
|
|
|
376
391
|
origin=f['origin'], task=f['task'], file=f['file'], line=f.get('line'), path=path,
|
|
377
392
|
location=location(f, path), text=f['text'], raw=f['raw'])
|
|
378
393
|
for n, f in enumerate(items, 1)]
|
|
379
|
-
dwarf, qa = models(plan, by_id.get(items[0]['task']))
|
|
394
|
+
dwarf, qa = models(plan, by_id.get(items[0]['task']), items[0], table)
|
|
380
395
|
title = 'Fix %d review finding%s in %s' % (len(entries), '' if len(entries) == 1 else 's', path)
|
|
381
396
|
root = plan / 'tasks' / ident
|
|
382
397
|
root.mkdir(parents=True, exist_ok=True)
|
|
@@ -41,6 +41,16 @@ forge_ui_register() {
|
|
|
41
41
|
return 0
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
# forge_storage_check RUN_DIR REPO — at run start (#139): warn on stderr when this repository's forge
|
|
45
|
+
# files (run dirs and worktrees) passed storage.warn-gb when they were last measured, and start the
|
|
46
|
+
# background compaction of its idle runs (storage.compact auto), never RUN_DIR itself. Never blocks
|
|
47
|
+
# or fails the run; callers skip it in a --dry-run. FORGE_STORAGE_COMPACT=off and
|
|
48
|
+
# FORGE_STORAGE_WARN_GB=off turn either part off.
|
|
49
|
+
forge_storage_check() {
|
|
50
|
+
python3 -I "$SKILL_DIR/scripts/forge-runs-compact.py" --start-check --repo "$2" --exclude "$1" </dev/null >/dev/null || true
|
|
51
|
+
return 0
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
# forge_repo_identity CHECKOUT DIR — write DIR/repo.identity, the repository CHECKOUT belongs to:
|
|
45
55
|
# {"root", "worktree", "branch"}. root is the main working tree, the same for the main checkout
|
|
46
56
|
# and every linked worktree; worktree is CHECKOUT's physical path when it differs from root, else
|