@giamme/forge 0.12.1 → 0.13.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 +55 -0
- package/README.md +1 -1
- package/SKILL.md +29 -12
- package/VERSION +1 -1
- package/docs/add-ons.md +11 -6
- package/docs/artifacts.md +12 -6
- package/docs/commands.md +179 -17
- package/docs/decomposed-runs.md +13 -5
- package/docs/forge-ui.md +7 -3
- package/docs/memory.md +2 -1
- package/docs/models.md +4 -2
- package/docs/reviews.md +49 -20
- package/docs/troubleshooting.md +3 -1
- package/forge +17 -1
- package/package.json +1 -1
- package/references/dataset.md +39 -13
- package/references/decision-models.md +759 -0
- package/references/decompose.md +166 -29
- package/references/harnesses.md +10 -3
- package/references/planning.md +8 -0
- package/references/solo.md +13 -3
- package/scripts/forge-artifact.sh +30 -4
- package/scripts/forge-config.py +238 -29
- package/scripts/forge-contract.py +95 -56
- package/scripts/forge-control.py +40 -9
- package/scripts/forge-decide.py +6 -0
- package/scripts/forge-dispatch.sh +38 -16
- package/scripts/forge-fail-first.py +2 -2
- package/scripts/forge-gate-addressed.sh +40 -0
- package/scripts/forge-gate-message.sh +64 -0
- package/scripts/forge-issues.py +321 -33
- package/scripts/forge-jev-options.sh +269 -42
- package/scripts/forge-lib-attribute.sh +447 -0
- package/scripts/forge-lib-gates.sh +32 -0
- package/scripts/forge-lib-plans.sh +17 -6
- package/scripts/forge-lib-review.sh +22 -17
- package/scripts/forge-lib-task.sh +217 -38
- package/scripts/forge-lib-verify.sh +45 -8
- package/scripts/forge-memory.sh +3 -3
- package/scripts/forge-parallel-options.sh +18 -5
- package/scripts/forge-parallel.sh +455 -303
- package/scripts/forge-plan-check.py +35 -1
- package/scripts/forge-pre-review.py +437 -0
- package/scripts/forge-prompt.py +25 -5
- package/scripts/forge-route.py +2 -2
- package/scripts/forge-runtime.py +10 -4
- package/scripts/forge-schedule.py +21 -5
- package/scripts/forge-shadow.py +2 -2
- package/scripts/forge-solo.sh +38 -9
- package/scripts/forge-submodules.py +389 -0
- package/scripts/forge_dataset/cli.py +12 -6
- package/scripts/forge_dataset/export.py +55 -45
- package/scripts/forge_dataset/harvest.py +33 -5
- package/scripts/{forge_jev/outcome.py → forge_dataset/states.py} +21 -7
- package/scripts/forge_decide/__init__.py +141 -0
- package/scripts/forge_decide/budget.py +149 -0
- package/scripts/forge_decide/cache.py +66 -0
- package/scripts/forge_decide/cli.py +953 -0
- package/scripts/forge_decide/doctor.py +221 -0
- package/scripts/forge_decide/label_addressed.py +75 -0
- package/scripts/forge_decide/label_attribution.py +62 -0
- package/scripts/forge_decide/label_coverage.py +81 -0
- package/scripts/forge_decide/label_message.py +38 -0
- package/scripts/forge_decide/label_prompt.py +139 -0
- package/scripts/forge_decide/labels.py +328 -0
- package/scripts/forge_decide/metrics.py +125 -0
- package/scripts/forge_decide/migrate.py +226 -0
- package/scripts/forge_decide/providers.py +292 -0
- package/scripts/forge_decide/replay.py +350 -0
- package/scripts/forge_decide/report.py +382 -0
- package/scripts/forge_decide/resolve.py +397 -0
- package/scripts/forge_decide/sites.py +377 -0
- package/scripts/forge_jev/__init__.py +202 -104
- package/scripts/forge_jev/addressed.py +171 -0
- package/scripts/forge_jev/attribution.py +198 -0
- package/scripts/forge_jev/cli.py +460 -382
- package/scripts/forge_jev/client.py +155 -77
- package/scripts/forge_jev/coupling.py +19 -87
- package/scripts/forge_jev/coverage.py +303 -0
- package/scripts/forge_jev/findings.py +219 -0
- package/scripts/forge_jev/gates.py +225 -27
- package/scripts/forge_jev/memory.py +65 -4
- package/scripts/forge_jev/message.py +134 -0
- package/scripts/forge_jev/plan_gates.py +294 -0
- package/scripts/forge_jev/questions.py +173 -313
- package/scripts/forge_jev/verify.py +130 -104
- package/ui/README.md +2 -2
- package/ui/docs/api.md +60 -32
- package/ui/forge_ui/control.py +60 -11
- package/ui/forge_ui/export.py +2 -1
- package/ui/forge_ui/models.py +1 -0
- package/ui/forge_ui/reader.py +87 -14
- package/ui/forge_ui/static/app.js +2 -2
- package/ui/forge_ui/static/controls.js +20 -13
- package/ui/forge_ui/static/panel.js +63 -17
- package/ui/forge_ui/static/runmodel.js +23 -1
- package/ui/forge_ui/static/scene3d.js +2 -15
- package/ui/forge_ui/static/settings.js +336 -41
- package/ui/forge_ui/static/style.css +19 -7
- package/references/jev.md +0 -865
- package/scripts/forge_jev/backtest.py +0 -322
- package/scripts/forge_jev/corpus.py +0 -156
- package/scripts/forge_jev/features.py +0 -24
- package/scripts/forge_jev/predict.py +0 -204
- package/scripts/forge_jev/review.py +0 -73
- package/scripts/forge_jev/routing.py +0 -271
- package/scripts/forge_jev/subset.py +0 -123
package/ui/forge_ui/control.py
CHANGED
|
@@ -29,9 +29,21 @@ MAX_LABELS = 5
|
|
|
29
29
|
MAX_LABEL = 50
|
|
30
30
|
MAX_REASON = 500
|
|
31
31
|
MAX_CONFIG_VALUE = 4096
|
|
32
|
+
MAX_DECIDE_VALUE = 256
|
|
32
33
|
FP_RE = re.compile(r'[0-9a-f]{12}')
|
|
33
|
-
|
|
34
|
+
# Mirrored from forge_decide.GATES and MODES. The ui tests do not put scripts/ on the path, so this
|
|
35
|
+
# module does not import forge_decide; ConfigTests.test_decide_names_match_forge_decide keeps them equal.
|
|
36
|
+
DECIDE_GATES = ('drift', 'forward', 'prompt', 'memory-curate', 'memory-slice', 'memory-stale',
|
|
37
|
+
'verify-discover', 'coverage', 'retry-addressed', 'dwarf-message', 'attribution',
|
|
38
|
+
'findings')
|
|
39
|
+
DECIDE_MODES = ('off', 'shadow', 'on')
|
|
40
|
+
REPO_CONFIG_KEYS = ('repo.verify', 'repo.setup', 'repo.verify-subset')
|
|
41
|
+
CONFIG_KEYS = REPO_CONFIG_KEYS
|
|
42
|
+
_DECIDE_KEY = re.compile(r'^decide\.gate\.([A-Za-z0-9_-]+?)(?:\.(provider|model))?$')
|
|
34
43
|
DETAIL_MAX = 300
|
|
44
|
+
# A refusal (exit 3) is forge's own message, kept whole: what was refused and why, then what to run
|
|
45
|
+
# instead (`forge decide replay ...`, `--force`), with a provider and model of up to 256 characters each.
|
|
46
|
+
REFUSAL_MAX = 2000
|
|
35
47
|
TIMEOUT_DETAIL = 'the operation may have partly completed; reload to see the current state'
|
|
36
48
|
|
|
37
49
|
# forge control's exit codes (scripts/forge-control.py) and the HTTP status each one gets.
|
|
@@ -151,11 +163,19 @@ def _stdout_object(text):
|
|
|
151
163
|
return value if isinstance(value, dict) else None
|
|
152
164
|
|
|
153
165
|
|
|
166
|
+
def _lines(text):
|
|
167
|
+
return [line.strip() for line in text.splitlines() if line.strip()]
|
|
168
|
+
|
|
169
|
+
|
|
154
170
|
def _last_line(text):
|
|
155
|
-
lines =
|
|
171
|
+
lines = _lines(text)
|
|
156
172
|
return lines[-1][:DETAIL_MAX] if lines else ''
|
|
157
173
|
|
|
158
174
|
|
|
175
|
+
def _message(text):
|
|
176
|
+
return '\n'.join(_lines(text))[:REFUSAL_MAX]
|
|
177
|
+
|
|
178
|
+
|
|
159
179
|
def map_exit(result):
|
|
160
180
|
"""(status, body) for a finished CliResult."""
|
|
161
181
|
if result.timed_out:
|
|
@@ -168,7 +188,8 @@ def map_exit(result):
|
|
|
168
188
|
return 502, {'error': 'bad gateway', 'detail': 'the forge CLI printed no JSON object'}
|
|
169
189
|
return 200, obj
|
|
170
190
|
status, error = _EXITS.get(result.code, (502, 'bad gateway'))
|
|
171
|
-
|
|
191
|
+
detail = _message(result.stderr) if result.code == 3 else _last_line(result.stderr)
|
|
192
|
+
body = {'error': error, 'detail': detail or f'the forge CLI exited {result.code}'}
|
|
172
193
|
if obj is not None:
|
|
173
194
|
body['result'] = obj
|
|
174
195
|
return status, body
|
|
@@ -511,20 +532,49 @@ def _config_get(ctx):
|
|
|
511
532
|
return ctx.call('config', 'show', '--repo', repo, '--json')
|
|
512
533
|
|
|
513
534
|
|
|
514
|
-
def
|
|
535
|
+
def _classify_config_key(key):
|
|
536
|
+
"""('repo'|'mode'|'provider'|'model', gate or None). BadBody when the key is not one of those shapes."""
|
|
537
|
+
if key == 'jev.enabled':
|
|
538
|
+
raise BadBody('jev.enabled is gone; set a gate with decide.gate.<gate>')
|
|
539
|
+
if key in REPO_CONFIG_KEYS:
|
|
540
|
+
return 'repo', None
|
|
541
|
+
if isinstance(key, str) and key.startswith('decide.'):
|
|
542
|
+
match = _DECIDE_KEY.fullmatch(key)
|
|
543
|
+
if match and match.group(1) in DECIDE_GATES:
|
|
544
|
+
return match.group(2) or 'mode', match.group(1)
|
|
545
|
+
if match:
|
|
546
|
+
raise BadBody('unknown gate %r; gates: %s' % (match.group(1), ', '.join(DECIDE_GATES)))
|
|
547
|
+
raise BadBody('key must be decide.gate.<gate>, decide.gate.<gate>.provider or decide.gate.<gate>.model')
|
|
548
|
+
raise BadBody('key must be one of ' + ', '.join(REPO_CONFIG_KEYS)
|
|
549
|
+
+ ', decide.gate.<gate>, decide.gate.<gate>.provider, decide.gate.<gate>.model')
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
def _decide_text(value):
|
|
553
|
+
"""A provider or model: one short line, so it cannot become an option on the decide CLI's argv."""
|
|
554
|
+
if (not isinstance(value, str) or not value or value != value.strip()
|
|
555
|
+
or len(value) > MAX_DECIDE_VALUE or value.startswith('-') or not _no_control_chars(value)):
|
|
556
|
+
raise BadBody('value must be short single-line text, not starting with "-"')
|
|
557
|
+
return value
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
def _config_value(key, body, kind):
|
|
515
561
|
if 'unset' in body:
|
|
516
562
|
if body['unset'] is not True or 'value' in body:
|
|
517
563
|
raise BadBody('give value, or unset: true, not both')
|
|
518
|
-
if
|
|
519
|
-
raise BadBody('
|
|
564
|
+
if kind != 'repo':
|
|
565
|
+
raise BadBody('set the mode to off')
|
|
520
566
|
return 'unset', None
|
|
521
567
|
value = body.get('value')
|
|
568
|
+
if kind == 'mode':
|
|
569
|
+
if value not in DECIDE_MODES:
|
|
570
|
+
raise BadBody('mode must be off, shadow or on')
|
|
571
|
+
return 'set', value
|
|
572
|
+
if kind in ('provider', 'model'):
|
|
573
|
+
return 'set', _decide_text(value)
|
|
522
574
|
if not isinstance(value, str) or not value.strip():
|
|
523
575
|
raise BadBody('value must be a non-empty string')
|
|
524
576
|
if len(value) > MAX_CONFIG_VALUE or value.startswith('-') or not _no_control_chars(value.replace('\n', ' ').replace('\t', ' ')):
|
|
525
577
|
raise BadBody('value is not an acceptable text')
|
|
526
|
-
if key == 'jev.enabled' and value not in ('true', 'false'):
|
|
527
|
-
raise BadBody('jev.enabled takes true or false')
|
|
528
578
|
if key == 'repo.verify-subset' and '{files}' not in value:
|
|
529
579
|
raise BadBody('repo.verify-subset must contain {files}')
|
|
530
580
|
return 'set', value
|
|
@@ -537,9 +587,8 @@ def _config_set(ctx):
|
|
|
537
587
|
try:
|
|
538
588
|
_check_fields(body, ('run', 'key', 'value', 'unset'))
|
|
539
589
|
key = body.get('key')
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
verb, value = _config_value(key, body)
|
|
590
|
+
kind, _gate = _classify_config_key(key)
|
|
591
|
+
verb, value = _config_value(key, body, kind)
|
|
543
592
|
except BadBody as exc:
|
|
544
593
|
return _invalid(str(exc))
|
|
545
594
|
repo, error = _config_run(ctx, body.get('run'))
|
package/ui/forge_ui/export.py
CHANGED
|
@@ -37,7 +37,8 @@ _EXEC = re.compile(r'(?:task|dwarf|qa|solo|verification|parallel)-[0-9a-f]{32}')
|
|
|
37
37
|
# texts that can hold code, prompts or private notes: nulled unless texts=True
|
|
38
38
|
_TEXT_KEYS = frozenset(('prompt', 'last', 'request', 'log_tail', 'dwarf_tail', 'qa_tail', 'qa_last', 'qa_input',
|
|
39
39
|
'tasks_summary', 'known_issues', 'texts', 'text', 'planning_last', 'approach', 'retry_findings',
|
|
40
|
-
'dwarf_input', 'error', 'last_line', 'message', 'excerpt', 'tail', 'lines', 'call', 'split'
|
|
40
|
+
'dwarf_input', 'error', 'last_line', 'message', 'excerpt', 'tail', 'lines', 'call', 'split',
|
|
41
|
+
'needs_input'))
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def _enc(value):
|
package/ui/forge_ui/models.py
CHANGED
|
@@ -83,6 +83,7 @@ def _attempts(rows, execs, plan_spec):
|
|
|
83
83
|
verdict = reviews[-1]['verdict'] if reviews else None
|
|
84
84
|
result.append(dict(n=n, alias=model['alias'] if model else _alias(spec), spec=spec, source=source,
|
|
85
85
|
outcome=outcome, reason=reason, gate=outcome == 'pass' and verdict == 'FAIL',
|
|
86
|
+
gate_fail=outcome == 'fail' and verdict == 'PASS',
|
|
86
87
|
model_s=last['phases'].get('model') if last is not None else None,
|
|
87
88
|
duration_s=last['duration_s'] if last is not None else None,
|
|
88
89
|
tokens=dict(last['tokens']) if last is not None and last['tokens'] else None,
|
package/ui/forge_ui/reader.py
CHANGED
|
@@ -694,6 +694,8 @@ def _task_detail(reader, task, run_id, waves, branches):
|
|
|
694
694
|
reader, prefix + '/accepted.by', task['accepted_by'])
|
|
695
695
|
for field, filename in [('prompt', 'prompt.md'), ('approach', 'approach.md'), ('retry_findings', 'retry_findings.md')]:
|
|
696
696
|
task[field] = reader.cap(reader.text(prefix + '/' + filename), prefix + '/' + field)
|
|
697
|
+
# the implementer's question for the user, when the task stopped NEEDS_INPUT
|
|
698
|
+
task['needs_input'] = reader.cap(reader.text(prefix + '/needs_input.md'), prefix + '/needs_input')
|
|
697
699
|
task['route'] = []
|
|
698
700
|
for n, line in enumerate((reader.text(prefix + '/route.jsonl') or '').splitlines(), 1):
|
|
699
701
|
if line.strip():
|
|
@@ -702,16 +704,6 @@ def _task_detail(reader, task, run_id, waves, branches):
|
|
|
702
704
|
task['route'].append(obj)
|
|
703
705
|
task['explored'] = reader.exists(prefix + '/route.explored') or any(
|
|
704
706
|
item.get('explored') is True for item in task['route'])
|
|
705
|
-
task['clef'] = {'first_pass': reader.object(prefix + '/clef.first_pass'), 'retry_pass': {}}
|
|
706
|
-
for child in reader.children(prefix):
|
|
707
|
-
if child.name.startswith('clef.retry_pass.'):
|
|
708
|
-
suffix = child.name[len('clef.retry_pass.'):]
|
|
709
|
-
if not re.fullmatch(r'[0-9]+', suffix):
|
|
710
|
-
reader.warn(prefix + '/' + child.name, 'invalid attempt suffix')
|
|
711
|
-
continue
|
|
712
|
-
obj = reader.object(prefix + '/' + child.name)
|
|
713
|
-
if obj is not None:
|
|
714
|
-
task['clef']['retry_pass'][suffix] = obj
|
|
715
707
|
execs = _task_execs(reader, task)
|
|
716
708
|
task['executions'] = execs
|
|
717
709
|
task['now'] = _now(reader, prefix, execs) if task['status'] == 'RUNNING' else None
|
|
@@ -721,6 +713,7 @@ def _task_detail(reader, task, run_id, waves, branches):
|
|
|
721
713
|
task['gate'] = _gate(reader, prefix + '/qa.gate')
|
|
722
714
|
task['known_issues'] = _nonempty(reader, prefix + '/known_issues.md')
|
|
723
715
|
task['fail_first'] = _fail_first(reader, prefix + '/failfirst.json')
|
|
716
|
+
task['pre_review'] = _pre_review(reader, prefix + '/prereview.json')
|
|
724
717
|
task['sweep'] = _sweep_task(reader, prefix, task['status'])
|
|
725
718
|
task['swept'] = []
|
|
726
719
|
shadows = _shadows(reader, ident, execs)
|
|
@@ -812,6 +805,35 @@ _TASK_CONTROLS = ('qa_threshold', 'retry_budget', 'retries.used', 'escalation.pi
|
|
|
812
805
|
_FAIL_FIRST_RESULTS = ('proven', 'passes_without_change', 'inconclusive', 'error')
|
|
813
806
|
|
|
814
807
|
|
|
808
|
+
_PRE_REVIEW_STATUSES = ('passed', 'flaky', 'pre-existing', 'failed', 'skipped', 'error')
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
def _pre_review(reader, name):
|
|
812
|
+
"""prereview.json (forge-pre-review.py, opt-in #85): the tests the attempt affects, run before its review."""
|
|
813
|
+
obj = reader.object(name)
|
|
814
|
+
if obj is None:
|
|
815
|
+
return None
|
|
816
|
+
if obj.get('status') not in _PRE_REVIEW_STATUSES:
|
|
817
|
+
reader.warn(name, 'unknown pre-review status')
|
|
818
|
+
return None
|
|
819
|
+
|
|
820
|
+
def paths(key):
|
|
821
|
+
value = obj.get(key)
|
|
822
|
+
return [p for p in value if isinstance(p, str)] if isinstance(value, list) else []
|
|
823
|
+
|
|
824
|
+
tail = None
|
|
825
|
+
for run in reversed(obj.get('runs') if isinstance(obj.get('runs'), list) else []):
|
|
826
|
+
if isinstance(run, dict) and type(run.get('rc')) is int and run['rc'] != 0 and isinstance(run.get('tail'), str):
|
|
827
|
+
tail = run['tail'][-2000:]
|
|
828
|
+
break
|
|
829
|
+
seconds = obj.get('seconds')
|
|
830
|
+
return dict(status=obj['status'], reason=obj.get('reason') if isinstance(obj.get('reason'), str) else None,
|
|
831
|
+
command=obj.get('command') if isinstance(obj.get('command'), str) else None,
|
|
832
|
+
selected=paths('selected'), failing=paths('failing'), preexisting=paths('preexisting'),
|
|
833
|
+
flaky=paths('flaky'), seconds=seconds if isinstance(seconds, (int, float)) and not isinstance(seconds, bool) else None,
|
|
834
|
+
tail=tail)
|
|
835
|
+
|
|
836
|
+
|
|
815
837
|
def _fail_first(reader, name):
|
|
816
838
|
"""failfirst.json (forge-fail-first.py, opt-in): did each new test fail without the change?"""
|
|
817
839
|
obj = reader.object(name)
|
|
@@ -1233,6 +1255,21 @@ def _timeline(pool, runs, verifications):
|
|
|
1233
1255
|
runs=runs, verifications=verifications)
|
|
1234
1256
|
|
|
1235
1257
|
|
|
1258
|
+
# scripts/forge-contract.py DEFAULT_THRESHOLD: what a run with no qa_threshold file blocks on.
|
|
1259
|
+
_DEFAULT_THRESHOLD = 'P2'
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
def _threshold(reader):
|
|
1263
|
+
"""(effective level, 'set' | 'default') from the qa_threshold file; `none` in a file means P3.
|
|
1264
|
+
Anything else that is not P0..P3 is ignored, as the gate and forge-control.py ignore it."""
|
|
1265
|
+
value = (reader.line('qa_threshold') or '').replace(' ', '').upper()
|
|
1266
|
+
if value == 'NONE':
|
|
1267
|
+
return 'P3', 'set'
|
|
1268
|
+
if value in ('P0', 'P1', 'P2', 'P3'):
|
|
1269
|
+
return value, 'set'
|
|
1270
|
+
return _DEFAULT_THRESHOLD, 'default'
|
|
1271
|
+
|
|
1272
|
+
|
|
1236
1273
|
_SOLO_SETTINGS = ('explore', 'shadow_rate', 'shadow_qa', 'timeout', 'max_parallel', 'qa_threshold',
|
|
1237
1274
|
'escalate_after', 'verify_retries', 'final_qa')
|
|
1238
1275
|
|
|
@@ -1242,7 +1279,9 @@ def _solo_detail(reader, source):
|
|
|
1242
1279
|
status = next(iter(result['counts']))
|
|
1243
1280
|
result['request'] = reader.cap(reader.text('request.md'), 'request')
|
|
1244
1281
|
result['settings'] = dict.fromkeys(_SOLO_SETTINGS)
|
|
1282
|
+
result['settings']['qa_threshold'], result['settings']['qa_threshold_source'] = _threshold(reader)
|
|
1245
1283
|
result['verification'] = None
|
|
1284
|
+
result['attribution'] = _attribution(reader)
|
|
1246
1285
|
result['waves'] = [['solo']]
|
|
1247
1286
|
attempts = _history(reader, 'attempts.tsv')
|
|
1248
1287
|
qa = reader.text('qa.last')
|
|
@@ -1252,13 +1291,13 @@ def _solo_detail(reader, source):
|
|
|
1252
1291
|
branch=None, attempt=max((item['attempt'] for item in attempts), default=None),
|
|
1253
1292
|
attempts=attempts, escalations=[], verdict=_verdict(qa), accepted_by=None,
|
|
1254
1293
|
accepted=False, accepted_attempt=None, accepted_over=None,
|
|
1255
|
-
explored=False, route=[],
|
|
1294
|
+
explored=False, route=[], shadow=[],
|
|
1256
1295
|
prompt=reader.cap(reader.text('prompt.md'), 'tasks/solo/prompt'), approach=None,
|
|
1257
|
-
retry_findings=None, qa_tail=reader.cap(qa, 'tasks/solo/qa_tail', 4000, True),
|
|
1296
|
+
retry_findings=None, needs_input=None, qa_tail=reader.cap(qa, 'tasks/solo/qa_tail', 4000, True),
|
|
1258
1297
|
dwarf_tail=reader.cap(reader.text('dwarf.last'), 'tasks/solo/dwarf_tail', 4000, True),
|
|
1259
1298
|
executions=execs, merged_at=None, findings=executions.summary_of(qa),
|
|
1260
1299
|
gate=_gate(reader, 'qa.gate'), known_issues=_nonempty(reader, 'known_issues.md'),
|
|
1261
|
-
fail_first=_fail_first(reader, 'failfirst.json'),
|
|
1300
|
+
fail_first=_fail_first(reader, 'failfirst.json'), pre_review=None,
|
|
1262
1301
|
now=_now(reader, '', execs) if status == 'RUNNING' else None, waiting=None, sweep=None, swept=[])
|
|
1263
1302
|
result.update(timeline=_timeline(execs, [], []), integration=None, final_review=None, final_reviews=[],
|
|
1264
1303
|
deferrals=[], findings_available=findings.available(), fractal=fractal.summary(reader),
|
|
@@ -1282,15 +1321,48 @@ def _waves(reader):
|
|
|
1282
1321
|
return waves, wave_map
|
|
1283
1322
|
|
|
1284
1323
|
|
|
1324
|
+
# --- attribution: the result of `forge-parallel.sh attribute` ------------------------------------
|
|
1325
|
+
|
|
1326
|
+
_ATTRIBUTION_KEYS = ('culprit', 'base_fails', 'inconclusive', 'verification_runs', 'gate')
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
def _is_text_or_null(value):
|
|
1330
|
+
return value is None or isinstance(value, str)
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
def _attribution(reader):
|
|
1334
|
+
"""RunDetail.attribution from attribution.json, or null when there is none or any field is missing or of the
|
|
1335
|
+
wrong type (warned): a half-valid file is not evidence for a culprit."""
|
|
1336
|
+
name = 'attribution.json'
|
|
1337
|
+
obj = reader.object(name)
|
|
1338
|
+
if obj is None:
|
|
1339
|
+
return None
|
|
1340
|
+
gate = obj.get('gate')
|
|
1341
|
+
outcome = gate.get('outcome') if isinstance(gate, dict) else None
|
|
1342
|
+
runs = obj.get('verification_runs')
|
|
1343
|
+
if not (all(key in obj for key in _ATTRIBUTION_KEYS)
|
|
1344
|
+
and _is_text_or_null(obj['culprit']) and _is_text_or_null(obj['inconclusive'])
|
|
1345
|
+
and isinstance(obj['base_fails'], bool)
|
|
1346
|
+
and isinstance(runs, int) and not isinstance(runs, bool)
|
|
1347
|
+
and (gate is None or isinstance(gate, dict)) and _is_text_or_null(outcome)):
|
|
1348
|
+
reader.warn(name, 'not an attribution')
|
|
1349
|
+
return None
|
|
1350
|
+
return dict(culprit=_text_or_none(obj['culprit'], 200), base_fails=obj['base_fails'],
|
|
1351
|
+
inconclusive=_text_or_none(obj['inconclusive'], 400), verification_runs=runs,
|
|
1352
|
+
gate_outcome=_text_or_none(outcome, 40))
|
|
1353
|
+
|
|
1354
|
+
|
|
1285
1355
|
def detail(path, source='plan') -> dict:
|
|
1286
1356
|
reader = _Read(path)
|
|
1287
1357
|
if _kind(reader.path) == 'solo':
|
|
1288
1358
|
return _solo_detail(reader, source)
|
|
1289
1359
|
result, tasks = _summary(reader, source)
|
|
1290
1360
|
result['request'] = reader.cap(reader.text('request.md'), 'request')
|
|
1361
|
+
threshold = _threshold(reader)
|
|
1291
1362
|
result['settings'] = dict(explore=reader.number('explore'), shadow_rate=reader.number('shadow_rate'),
|
|
1292
1363
|
shadow_qa=_list(reader.text('shadow_qa') or ''), timeout=reader.number('timeout', int),
|
|
1293
|
-
max_parallel=reader.number('max_parallel', int),
|
|
1364
|
+
max_parallel=reader.number('max_parallel', int),
|
|
1365
|
+
qa_threshold=threshold[0], qa_threshold_source=threshold[1],
|
|
1294
1366
|
escalate_after=reader.number('escalate_after', int),
|
|
1295
1367
|
verify_retries=reader.number('verify_retries', int), final_qa=reader.line('final_qa'))
|
|
1296
1368
|
waves, wave_map = _waves(reader)
|
|
@@ -1307,6 +1379,7 @@ def detail(path, source='plan') -> dict:
|
|
|
1307
1379
|
run_execs = _run_execs(reader)
|
|
1308
1380
|
result['verification'] = _verification(reader, result['verification_status'],
|
|
1309
1381
|
[item for item in run_execs if item['role'] == 'verification'])
|
|
1382
|
+
result['attribution'] = _attribution(reader)
|
|
1310
1383
|
items, integrations = executions.review_dirs(reader)
|
|
1311
1384
|
published = _published(reader)
|
|
1312
1385
|
reviews = []
|
|
@@ -106,7 +106,7 @@ window.ForgeApp = (() => {
|
|
|
106
106
|
function link(text, key, sel) { const a = el('a', text); a.href = hashFor(key, sel); return a; }
|
|
107
107
|
|
|
108
108
|
const statuses = new Set(['merged', 'pass', 'running', 'pending', 'fail', 'error', 'infra',
|
|
109
|
-
'timeout', 'unknown', 'invalidated', 'blocked', 'interrupted', 'nochanges', 'conflict', 'accepted', 'outdated']);
|
|
109
|
+
'timeout', 'unknown', 'invalidated', 'blocked', 'interrupted', 'nochanges', 'conflict', 'accepted', 'outdated', 'needs_input']);
|
|
110
110
|
function chip(value, cls) {
|
|
111
111
|
const status = String(cls || value || 'unknown').toLowerCase();
|
|
112
112
|
return el('span', value || '—', 'chip st-' + (statuses.has(status) ? status : 'unknown'));
|
|
@@ -593,7 +593,7 @@ window.ForgeApp = (() => {
|
|
|
593
593
|
['labels', 'Readouts', 'The status line on the front of each block'], ['beacons', 'Findings', 'A mark over the block per review finding, shaped by its severity'],
|
|
594
594
|
['finish', 'Finish line', 'Integration, verification and the final review'], ['districts', 'Districts', 'The wave and repository names on the plate'],
|
|
595
595
|
['halos', 'Halos', 'The glow under running and chosen blocks'], ['route', 'Route', 'A chosen task keeps its route lit: what it waits on and what waits on it (I)']], 'layer');
|
|
596
|
-
bankOf('Marks', [['critical', 'Critical path', 'The chain of dependencies that bounded the wall time'], ['arcs', 'Review marks', 'Shadow disagreements
|
|
596
|
+
bankOf('Marks', [['critical', 'Critical path', 'The chain of dependencies that bounded the wall time'], ['arcs', 'Review marks', 'Shadow disagreements'],
|
|
597
597
|
['ghosts', 'Projected', 'Where the tasks that have not started would run, by forge-schedule\'s rules']], 'ov');
|
|
598
598
|
ov.addEventListener('click', e => {
|
|
599
599
|
const b = e.target.closest('.layer-key'); if (!b) return;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
15
|
const LEVELS = ['P0', 'P1', 'P2', 'P3'];
|
|
16
|
+
const DEFAULT_LEVEL = 'P2'; // scripts/forge-contract.py DEFAULT_THRESHOLD
|
|
16
17
|
const EFFORTS = ['default', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
17
18
|
const MAX_FIELD = 256; // control.py: a body string is at most this long
|
|
18
19
|
const LIVE_ONLY = 'only while a run is in progress';
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
};
|
|
32
33
|
const BACKOFF_FORMS = 'exp:<base>[,<cap>], linear:<start>,<step>[,<cap>] or list:<a>,<b>,… (seconds)';
|
|
33
34
|
// A task status after which "Retry now" applies (or the policy stopped it).
|
|
34
|
-
const RETRYABLE = ['FAIL', 'UNKNOWN', 'TIMEOUT', 'ERROR', 'INTERRUPTED', 'BLOCKED'];
|
|
35
|
+
const RETRYABLE = ['FAIL', 'UNKNOWN', 'TIMEOUT', 'ERROR', 'INTERRUPTED', 'BLOCKED', 'INVALIDATED']; // scripts/forge-schedule.py RETRYABLE; NEEDS_INPUT is in neither list
|
|
35
36
|
|
|
36
37
|
const obj = v => v && typeof v === 'object' && !Array.isArray(v) ? v : {};
|
|
37
38
|
const num = v => typeof v === 'number' && Number.isFinite(v) ? v : null;
|
|
@@ -83,7 +84,8 @@
|
|
|
83
84
|
if (task && info.planOnly) return bad(`${info.label} applies to the whole run, not a task`);
|
|
84
85
|
const text = String(input === undefined || input === null ? '' : input).trim();
|
|
85
86
|
if (key === 'qa-threshold') {
|
|
86
|
-
return LEVELS.includes(text) || text === 'none' || (task
|
|
87
|
+
return LEVELS.includes(text) || text === 'none' || (task ? text === 'inherit' : text === 'default') ? { ok: true, value: text }
|
|
88
|
+
: bad(task ? 'P0, P1, P2, P3, none or inherit' : 'P0, P1, P2, P3, none or default');
|
|
87
89
|
}
|
|
88
90
|
if (task && key === 'retry-budget' && text === 'inherit') return { ok: true, value: 'inherit' };
|
|
89
91
|
if (key === 'max-parallel') {
|
|
@@ -115,7 +117,8 @@
|
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
const shown = (key, value, task) => key === 'timeout' ? `${minutesOf(Number(value))} min`
|
|
118
|
-
: key === 'qa-threshold' && value === 'none'
|
|
120
|
+
: key === 'qa-threshold' && value === 'none' ? (task ? 'P3 for this task' : 'P3 (nothing tolerated)')
|
|
121
|
+
: key === 'qa-threshold' && value === 'default' ? 'the default (P2)'
|
|
119
122
|
: key === 'infra-backoff' && value === 'none' ? 'the default (exp:60)' : value;
|
|
120
123
|
const inTask = task => task ? ` for task \`${task}\`` : '';
|
|
121
124
|
|
|
@@ -172,7 +175,9 @@
|
|
|
172
175
|
function runValues(controls) {
|
|
173
176
|
const c = obj(controls), run = obj(c.run);
|
|
174
177
|
return { live: c.live === true, fractal: c.fractal === true,
|
|
175
|
-
qa: LEVELS.includes(run.qa_threshold) ? run.qa_threshold : 'none',
|
|
178
|
+
qa: LEVELS.includes(run.qa_threshold) ? run.qa_threshold : run.qa_threshold === 'none' ? 'P3' : DEFAULT_LEVEL,
|
|
179
|
+
qaSource: run.qa_threshold_source === 'set' ? 'set' : 'default',
|
|
180
|
+
qaText: `${LEVELS.includes(run.qa_threshold) ? run.qa_threshold : run.qa_threshold === 'none' ? 'P3' : DEFAULT_LEVEL} (${run.qa_threshold_source === 'set' ? 'set' : 'default'})`,
|
|
176
181
|
timeout: num(run.timeout), timeoutMin: minutesOf(run.timeout),
|
|
177
182
|
escalateAfter: num(run.escalate_after), verifyRetries: num(run.verify_retries),
|
|
178
183
|
retryBudget: num(run.retry_budget), infraBudget: num(run.infra_budget),
|
|
@@ -211,16 +216,17 @@
|
|
|
211
216
|
}
|
|
212
217
|
const requestText = st => st.state === 'refused' ? `refused${st.reason ? ': ' + st.reason : ''}` : st.state;
|
|
213
218
|
// Whether "Retry now" shows for a task: live only, after it ended without passing or once the policy stopped it.
|
|
219
|
+
// Never for a task waiting for an answer: forge refuses a retry without one (retry --answer).
|
|
214
220
|
const canRetry = (controls, id) => {
|
|
215
221
|
const c = obj(controls), v = taskValues(c, id);
|
|
216
|
-
return c.live === true && v.known && v.status !== 'MERGED' && (RETRYABLE.includes(v.status) || v.stop);
|
|
222
|
+
return c.live === true && v.known && v.status !== 'MERGED' && v.status !== 'NEEDS_INPUT' && (RETRYABLE.includes(v.status) || v.stop);
|
|
217
223
|
};
|
|
218
224
|
// A task's controls with the effective value of each: an override wins, else the run's value is inherited.
|
|
219
225
|
function taskValues(controls, id) {
|
|
220
226
|
const c = obj(controls), t = obj(obj(c.tasks)[id]), run = runValues(c);
|
|
221
227
|
const level = t.qa_threshold;
|
|
222
228
|
const threshold = LEVELS.includes(level) ? { mode: level, effective: level, from: 'task' }
|
|
223
|
-
: level === 'none' ? { mode: 'none', effective: '
|
|
229
|
+
: level === 'none' ? { mode: 'none', effective: 'P3', from: 'task' }
|
|
224
230
|
: { mode: 'inherit', effective: run.qa, from: 'run' };
|
|
225
231
|
const own = num(t.retry_budget), eff = own !== null ? own : run.retryBudget;
|
|
226
232
|
return { id, known: !!c.tasks && id in c.tasks, status: typeof t.status === 'string' ? t.status : 'PENDING',
|
|
@@ -505,7 +511,8 @@
|
|
|
505
511
|
|
|
506
512
|
function levelRow(view, c, o) {
|
|
507
513
|
const r = shell(view, o.key, o.label, false), perm = o.perm;
|
|
508
|
-
const options = (o.inherit ? [{ value: 'inherit', label: 'Inherit', title: "Use the run's threshold" }]
|
|
514
|
+
const options = (o.inherit ? [{ value: 'inherit', label: 'Inherit', title: "Use the run's threshold" }]
|
|
515
|
+
: [{ value: 'default', label: 'Default', title: 'Remove the setting: the default (P2) applies' }])
|
|
509
516
|
.concat(LEVELS.map(l => ({ value: l, label: l })), [{ value: 'none', label: 'None', title: o.noneTitle }]);
|
|
510
517
|
r.control.append(bank(r, options, o.current, perm.enabled, (value, button) => {
|
|
511
518
|
if (value !== o.current) commit(view, r, { kind: 'set', key: 'qa-threshold', input: value, task: o.task }, [], button);
|
|
@@ -540,9 +547,9 @@
|
|
|
540
547
|
body.append(runKeys(view, c));
|
|
541
548
|
if (v.pauses.length) body.append(pauseBox(view, c));
|
|
542
549
|
}
|
|
543
|
-
body.append(levelRow(view, c, { key: 'qa-threshold', label: 'QA threshold', current: v.qa, perm: perm('qa-threshold'),
|
|
544
|
-
help:
|
|
545
|
-
|
|
550
|
+
body.append(levelRow(view, c, { key: 'qa-threshold', label: 'QA threshold', current: v.qaSource === 'set' ? v.qa : 'default', perm: perm('qa-threshold'),
|
|
551
|
+
help: `The least severe finding that still blocks: ${v.qaText} (${LEVELS.slice(0, LEVELS.indexOf(v.qa) + 1).join(', ')} block).`,
|
|
552
|
+
noneTitle: 'P3: nothing is tolerated' }));
|
|
546
553
|
body.append(countRow(view, c, { key: 'timeout', label: 'Timeout', unit: 'minutes', decimal: true, value: v.timeoutMin, placeholder: 'default', perm: perm('timeout'),
|
|
547
554
|
help: v.timeoutMin === null ? "Not set: each model's own limit applies. 0 turns the limit off." : `Each model call stops after ${v.timeoutMin} min. 0 turns the limit off.` }));
|
|
548
555
|
body.append(countRow(view, c, { key: 'escalate-after', label: 'Escalate after', unit: 'failures', value: v.escalateAfter, perm: perm('escalate-after'),
|
|
@@ -571,9 +578,9 @@
|
|
|
571
578
|
if (v.status === 'MERGED') { body.append(u.el('p', 'Merged: there is nothing left to change for this task.', 'muted ctl-note')); return body; }
|
|
572
579
|
const th = v.threshold, task = id;
|
|
573
580
|
body.append(levelRow(view, c, { key: 'qa-threshold', label: 'Threshold override', inherit: true, task, current: th.mode, perm: canEdit(c, 'qa-threshold', id),
|
|
574
|
-
noneTitle: '
|
|
575
|
-
help: th.mode === 'inherit' ? `Inherits ${v.run.qa
|
|
576
|
-
: th.mode === 'none' ? '
|
|
581
|
+
noneTitle: 'P3 for this task: nothing is tolerated',
|
|
582
|
+
help: th.mode === 'inherit' ? `Inherits ${v.run.qa} from the run.`
|
|
583
|
+
: th.mode === 'none' ? 'P3 for this task, whatever the run sets.' : `${th.mode} for this task, whatever the run sets.` }));
|
|
577
584
|
const rb = v.retry, used = rb.effective === null ? `used ${rb.used}` : `used ${rb.used} of ${rb.effective}`;
|
|
578
585
|
body.append(countRow(view, c, { key: 'retry-budget', label: 'Retry budget', unit: 'retries', task, value: rb.own, placeholder: rb.effective === null ? 'inherit' : String(rb.effective),
|
|
579
586
|
inherit: rb.mode === 'inherit' ? 'pressed' : 'ready', perm: canEdit(c, 'retry-budget', id),
|
|
@@ -10,7 +10,7 @@ window.ForgePanel = (() => {
|
|
|
10
10
|
const num = v => typeof v === 'number' && Number.isFinite(v) ? v : null;
|
|
11
11
|
const display = v => v === null || v === undefined || v === '' ? '—' : typeof v === 'object' ? JSON.stringify(v, null, 2) : String(v);
|
|
12
12
|
const STATUSES = new Set(['merged', 'pass', 'running', 'pending', 'fail', 'error', 'infra', 'timeout', 'unknown', 'invalidated', 'blocked',
|
|
13
|
-
'interrupted', 'nochanges', 'conflict', 'accepted', 'none', 'outdated']);
|
|
13
|
+
'interrupted', 'nochanges', 'conflict', 'accepted', 'none', 'outdated', 'needs_input', 'waiting']);
|
|
14
14
|
const cache = new Map(); // path → {data, error, at}
|
|
15
15
|
function el(tag, text, className) {
|
|
16
16
|
const node = document.createElement(tag);
|
|
@@ -86,6 +86,31 @@ window.ForgePanel = (() => {
|
|
|
86
86
|
const s = section(host, 'Controls');
|
|
87
87
|
muted(s, 'Read-only: this page cannot change the run.');
|
|
88
88
|
}
|
|
89
|
+
// A task that stopped NEEDS_INPUT: the question it asked, and the command that answers it. forge-ui shows the
|
|
90
|
+
// command and never runs it; only the user's answer, passed to retry, resumes the task.
|
|
91
|
+
const shellWord = s => /^[\w@%+=:,./-]+$/.test(s) ? s : "'" + String(s).replace(/'/g, "'\\''") + "'";
|
|
92
|
+
function waitingSection(host, ctx, task) {
|
|
93
|
+
const s = section(host, 'Waiting for you');
|
|
94
|
+
muted(s, 'This task stopped for an answer only you can give. Nothing retries it until you answer.');
|
|
95
|
+
s.append(el('pre', task.needs_input != null ? task.needs_input : `The question is not recorded: tasks/${task.id}/needs_input.md is missing.`));
|
|
96
|
+
if (ctx.run.kind === 'solo') return;
|
|
97
|
+
const plan = ctx.run.path ? shellWord(ctx.run.path) : '<plan>';
|
|
98
|
+
const text = `forge-parallel.sh retry ${plan} ${shellWord(task.id)} --answer "…"`;
|
|
99
|
+
const copy = el('button', 'Copy command'); copy.type = 'button';
|
|
100
|
+
copy.addEventListener('click', async () => {
|
|
101
|
+
try { await navigator.clipboard.writeText(text); copy.textContent = 'Copied'; }
|
|
102
|
+
catch (_) { copy.textContent = 'Copy failed: select the command instead'; }
|
|
103
|
+
});
|
|
104
|
+
const line = el('div', undefined, 'waiting-cmd');
|
|
105
|
+
line.append(el('pre', text, 'cmd'), copy);
|
|
106
|
+
s.append(line);
|
|
107
|
+
}
|
|
108
|
+
// An attempt's chip. A failed attempt is red whatever its words; a send-back says what forge did in its title.
|
|
109
|
+
function attemptChip(word) {
|
|
110
|
+
const c = chip(word, RM.attemptFailed(word) ? 'fail' : undefined), note = RM.attemptNote(word);
|
|
111
|
+
if (note) c.title = note;
|
|
112
|
+
return c;
|
|
113
|
+
}
|
|
89
114
|
// a link into the diff viewer (ctx.diffHash is absent where there is no viewer)
|
|
90
115
|
function diffLink(ctx, text, spec, cls = 'diff-link') { if (!ctx.diffHash) return null; const a = el('a', text, cls); a.href = ctx.diffHash(spec); return a; }
|
|
91
116
|
// a lazy resource: returns cached data, or starts the fetch and re-renders when it lands
|
|
@@ -154,6 +179,32 @@ window.ForgePanel = (() => {
|
|
|
154
179
|
box.append(ul);
|
|
155
180
|
parent.append(box);
|
|
156
181
|
}
|
|
182
|
+
// forge's own run of the tests the attempt affects, before its review (opt-in plan --pre-review-tests).
|
|
183
|
+
const PRE_REVIEW = { passed: ['passed', 'pass'], flaky: ['flaky: passed when rerun alone', 'unknown'],
|
|
184
|
+
'pre-existing': ['failing already on the task base', 'unknown'], failed: ['failed: sent back without a review', 'fail'],
|
|
185
|
+
skipped: ['skipped', 'unknown'], error: ['could not run', 'unknown'] };
|
|
186
|
+
function preReview(parent, pr) {
|
|
187
|
+
if (!pr) return;
|
|
188
|
+
const box = el('div', undefined, 'review');
|
|
189
|
+
const h = el('div', undefined, 'attempt-head');
|
|
190
|
+
const [label, cls] = PRE_REVIEW[pr.status] || [pr.status, 'unknown'];
|
|
191
|
+
h.append(el('strong', 'forge pre-review tests'), chip(label, cls));
|
|
192
|
+
if (typeof pr.seconds === 'number') h.append(el('span', `${pr.seconds.toFixed(1)}s`, 'muted'));
|
|
193
|
+
box.append(h);
|
|
194
|
+
if (pr.reason) muted(box, pr.reason);
|
|
195
|
+
if (pr.command) box.append(el('p', pr.command, 'mono muted'));
|
|
196
|
+
const ul = el('ul', undefined, 'findings');
|
|
197
|
+
for (const path of list(pr.selected)) {
|
|
198
|
+
const li = el('li');
|
|
199
|
+
li.append(el('span', path, 'mono'));
|
|
200
|
+
if (list(pr.failing).includes(path)) li.append(document.createTextNode(' '), chip('fails', 'fail'));
|
|
201
|
+
else if (list(pr.preexisting).includes(path)) li.append(document.createTextNode(' '), chip('fails on the base too', 'unknown'));
|
|
202
|
+
ul.append(li);
|
|
203
|
+
}
|
|
204
|
+
if (ul.childNodes.length) box.append(ul);
|
|
205
|
+
if (pr.status === 'failed' && pr.tail) box.append(el('pre', pr.tail, 'mono'));
|
|
206
|
+
parent.append(box);
|
|
207
|
+
}
|
|
157
208
|
function findingsList(parent, findings, key) {
|
|
158
209
|
if (findings === null || findings === undefined) { muted(parent, 'Findings could not be parsed (forge-contract.py was not available to the server).'); return; }
|
|
159
210
|
if (!findings.length) { muted(parent, 'The reviewer reported no findings in the expected `- [P1][CONFIRMED] file:line — …` form.'); return; }
|
|
@@ -170,9 +221,11 @@ window.ForgePanel = (() => {
|
|
|
170
221
|
});
|
|
171
222
|
parent.append(ul);
|
|
172
223
|
}
|
|
224
|
+
const gateChip = decision => decision === 'accept' ? chip('accept', 'pass')
|
|
225
|
+
: decision === 'fail' ? chip('forge: FAIL (reviewer said PASS)', 'fail') : chip(decision || '—', 'unknown');
|
|
173
226
|
function gateLine(parent, gate) {
|
|
174
227
|
if (!gate) return;
|
|
175
|
-
fields(parent, [['Blocking threshold', gate.threshold], ['Gate decision',
|
|
228
|
+
fields(parent, [['Blocking threshold', gate.threshold], ['Gate decision', gateChip(gate.decision)],
|
|
176
229
|
['Worst confirmed', gate.worst], ['Confirmed / unlabelled / tolerated', `${display(gate.n_confirmed)} / ${display(gate.n_unlabelled)} / ${display(gate.n_below)}`]]);
|
|
177
230
|
}
|
|
178
231
|
|
|
@@ -207,7 +260,7 @@ window.ForgePanel = (() => {
|
|
|
207
260
|
const s = section(host, 'Settings');
|
|
208
261
|
fields(s, [['Repo', midPath(run.repo), true], ['Run ID', run.run_id, true], ['Path', midPath(run.path), true], ['Source', run.source],
|
|
209
262
|
['Decompose', run.decompose_level], ['Updated', time(run.updated)], ['Explore', run.settings && run.settings.explore], ['Shadow rate', run.settings && run.settings.shadow_rate],
|
|
210
|
-
['Shadow reviewers', run.settings && plates(list(run.settings.shadow_qa))], ['QA threshold', run.settings && run.settings.qa_threshold],
|
|
263
|
+
['Shadow reviewers', run.settings && plates(list(run.settings.shadow_qa))], ['QA threshold', run.settings && run.settings.qa_threshold && run.settings.qa_threshold + (run.settings.qa_threshold_source === 'default' ? ' (default)' : '')],
|
|
211
264
|
['Max parallel', run.settings && run.settings.max_parallel], ['Final reviewer', run.settings && run.settings.final_qa ? plate(run.settings.final_qa) : undefined],
|
|
212
265
|
['Timeout (seconds)', run.settings && run.settings.timeout], ['Verification', chip((run.verification && run.verification.status) || run.verification_status)],
|
|
213
266
|
['Command', run.verification && run.verification.command, true]]);
|
|
@@ -252,6 +305,8 @@ window.ForgePanel = (() => {
|
|
|
252
305
|
fields(f, [['Integration', link(`${F.integration.merged}/${F.integration.total} merged`, ctx.hash({ kind: 'integration' }), () => ctx.onSelect({ kind: 'integration' }))],
|
|
253
306
|
['Verification', link(F.verification.status, ctx.hash({ kind: 'verification' }), () => ctx.onSelect({ kind: 'verification' }))],
|
|
254
307
|
['Final review', finalValue]]);
|
|
308
|
+
const attribution = RM.attributionLine(run.attribution);
|
|
309
|
+
if (attribution) f.append(el('p', attribution, 'warn'));
|
|
255
310
|
if (F.final.status === 'OUTDATED') muted(f, RM.reviewSinceLine(F.final));
|
|
256
311
|
if (F.final.findings) findingCounts(f, F.final.findings);
|
|
257
312
|
const sweep = RM.sweepLine(run.sweep);
|
|
@@ -308,6 +363,7 @@ window.ForgePanel = (() => {
|
|
|
308
363
|
head.append(chips);
|
|
309
364
|
const dl = diffLink(ctx, solo ? 'View the diff →' : 'View its diff, findings pinned to their lines →', { kind: 'task', task: task.id, source: 'current' }); if (dl) head.append(dl);
|
|
310
365
|
host.append(head);
|
|
366
|
+
if (RM.isWaiting(task.status)) waitingSection(host, ctx, task);
|
|
311
367
|
if (!solo) fields(host, [['Difficulty', task.difficulty], ['Depends on', depLinks(task.deps, ctx)], ['Files', list(task.files).join('\n') || '—', true], ['Branch', task.branch, true]]);
|
|
312
368
|
if (C) C.nowSection(host, ctx, task);
|
|
313
369
|
sweepSection(host, ctx, task);
|
|
@@ -340,7 +396,7 @@ window.ForgePanel = (() => {
|
|
|
340
396
|
for (const z of tp.zones) {
|
|
341
397
|
const box = el('div', undefined, 'attempt');
|
|
342
398
|
const row = list(task.attempts).filter(a => a.attempt === z.attempt).pop();
|
|
343
|
-
const h = el('div', undefined, 'attempt-head'); h.append(el('strong', z.name.toLowerCase())); if (row) h.append(
|
|
399
|
+
const h = el('div', undefined, 'attempt-head'); h.append(el('strong', z.name.toLowerCase())); if (row) h.append(attemptChip(RM.attemptStatus(task, row.attempt, row.status)), el('span', time(row.at), 'muted'));
|
|
344
400
|
box.append(h);
|
|
345
401
|
for (const pid of z.parts) {
|
|
346
402
|
const p = tp.parts.find(x => x.id === pid); if (!p || p.planned) continue;
|
|
@@ -378,6 +434,7 @@ window.ForgePanel = (() => {
|
|
|
378
434
|
gateLine(rs, task.gate);
|
|
379
435
|
findingCounts(rs, task.findings);
|
|
380
436
|
failFirst(rs, task.fail_first);
|
|
437
|
+
preReview(rs, task.pre_review);
|
|
381
438
|
const detail = lazy(ctx, `/api/runs/${encodeURIComponent(run.key)}/tasks/${encodeURIComponent(task.id)}`, run.updated);
|
|
382
439
|
if (!loading(rs, detail, 'the full findings')) {
|
|
383
440
|
const reviews = list(detail.data.reviews);
|
|
@@ -392,19 +449,6 @@ window.ForgePanel = (() => {
|
|
|
392
449
|
rs.append(box);
|
|
393
450
|
});
|
|
394
451
|
}
|
|
395
|
-
// Clef: what was predicted, against what happened
|
|
396
|
-
const clef = task.clef || {};
|
|
397
|
-
const preds = [];
|
|
398
|
-
if (clef.first_pass) preds.push(['First attempt', clef.first_pass]);
|
|
399
|
-
for (const [a, p] of Object.entries(clef.retry_pass || {})) preds.push([`Retry · attempt ${a}`, p]);
|
|
400
|
-
if (preds.length) {
|
|
401
|
-
const cs = section(host, 'Clef predictions');
|
|
402
|
-
for (const [label, p] of preds) {
|
|
403
|
-
const n = Number(String(label).match(/\d+/) || 1), outcome = list(task.attempts).filter(a => a.attempt === n).pop();
|
|
404
|
-
const happened = outcome ? RM.attemptStatus(task, outcome.attempt, outcome.status) : 'not finished';
|
|
405
|
-
fields(cs, [[label, `p(pass) = ${display(p.p)} → ${happened}`], ['Assignment', p.assignment ? plates([p.assignment.dwarf, p.assignment.qa]) : '—']]);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
452
|
// the prompts and the final messages
|
|
409
453
|
const ps = section(host, 'Prompts and output');
|
|
410
454
|
if (!detail.data) details(ps, 'Requirements (prompt.md)', task.prompt, `task-${task.id}-prompt`);
|
|
@@ -600,6 +644,8 @@ window.ForgePanel = (() => {
|
|
|
600
644
|
const head = el('div', undefined, 'insp-head');
|
|
601
645
|
head.append(el('h2', 'Verification'), el('div', 'finish', 'insp-kind'), chip(v && v.status || 'pending'));
|
|
602
646
|
host.append(head);
|
|
647
|
+
const attribution = RM.attributionLine(run.attribution);
|
|
648
|
+
if (attribution) host.append(el('p', attribution, 'warn'));
|
|
603
649
|
if (!v) { muted(host, 'Verification has not run: it runs after every task is merged into the integration branch.'); return; }
|
|
604
650
|
if (window.ForgeVerify) window.ForgeVerify.render(host, ctx); // live state, lanes and failing tests
|
|
605
651
|
fields(host, [['Command', v.command, true], ['Commit', v.commit, true]]);
|