@giamme/forge 0.12.0 → 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 +77 -0
- package/README.md +1 -1
- package/SKILL.md +31 -12
- package/VERSION +1 -1
- package/docs/add-ons.md +11 -6
- package/docs/artifacts.md +18 -6
- package/docs/commands.md +189 -17
- package/docs/decomposed-runs.md +13 -5
- package/docs/forge-ui.md +34 -4
- package/docs/memory.md +2 -1
- package/docs/models.md +4 -2
- package/docs/reviews.md +81 -19
- package/docs/troubleshooting.md +3 -1
- package/forge +17 -1
- package/package.json +1 -1
- package/references/dataset.md +40 -14
- package/references/decision-models.md +759 -0
- package/references/decompose.md +197 -28
- package/references/harnesses.md +10 -3
- package/references/planning.md +8 -0
- package/references/solo.md +13 -3
- package/references/ui.md +11 -0
- package/scripts/forge-artifact.sh +30 -4
- package/scripts/forge-config.py +238 -29
- package/scripts/forge-contract.py +127 -58
- package/scripts/forge-control.py +40 -9
- package/scripts/forge-decide.py +6 -0
- package/scripts/forge-dispatch.sh +47 -15
- 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 +368 -36
- 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 +24 -19
- package/scripts/forge-lib-task.sh +219 -39
- package/scripts/forge-lib-verify.sh +45 -8
- package/scripts/forge-memory.sh +3 -3
- package/scripts/forge-parallel-options.sh +44 -5
- package/scripts/forge-parallel.sh +503 -304
- 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 +55 -1
- package/scripts/forge-schedule.py +70 -9
- package/scripts/forge-shadow.py +2 -2
- package/scripts/forge-solo.sh +41 -10
- package/scripts/forge-submodules.py +389 -0
- package/scripts/forge-sweep.py +542 -0
- package/scripts/forge_dataset/cli.py +12 -6
- package/scripts/forge_dataset/export.py +55 -45
- package/scripts/forge_dataset/forecast.py +4 -1
- 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 +41 -10
- package/ui/docs/api.md +212 -44
- package/ui/forge_ui/checks.py +331 -0
- package/ui/forge_ui/control.py +60 -11
- package/ui/forge_ui/export.py +8 -3
- package/ui/forge_ui/models.py +1 -0
- package/ui/forge_ui/reader.py +436 -26
- package/ui/forge_ui/server.py +13 -0
- package/ui/forge_ui/static/app.js +15 -8
- package/ui/forge_ui/static/checksview.js +449 -0
- package/ui/forge_ui/static/controls.js +20 -13
- package/ui/forge_ui/static/convo.js +11 -2
- package/ui/forge_ui/static/findingsview.js +6 -4
- package/ui/forge_ui/static/index.html +1 -0
- package/ui/forge_ui/static/panel.js +105 -17
- package/ui/forge_ui/static/runmodel.js +40 -2
- 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 +72 -7
- package/ui/forge_ui/transcripts.py +225 -54
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The retry-addressed gate (#43): a retry whose diff leaves a blocking finding untouched goes
|
|
3
|
+
# back to the implementer without a review. Sourced by forge-lib-gates.sh; forge_pre_qa_gates
|
|
4
|
+
# calls it right after reviewed.commit is written, before QA is dispatched.
|
|
5
|
+
#
|
|
6
|
+
# It can only send work back: it never accepts anything, and it fails open (no key, no answer, a
|
|
7
|
+
# shadow gate, any error all return 0). The attempt after a bounce has retry_findings.source
|
|
8
|
+
# `bounce`, so this never runs twice in a row and QA always comes next.
|
|
9
|
+
|
|
10
|
+
forge_gate_addressed() { # forge_gate_addressed <plan> <id> <tdir> <wt> <attempt> <reviewed>
|
|
11
|
+
local plan="$1" id="$2" tdir="$3" wt="$4" attempt="$5" reviewed="$6"
|
|
12
|
+
declare -F forge_decide_active >/dev/null || return 0
|
|
13
|
+
forge_decide_active retry-addressed || return 0
|
|
14
|
+
[ "$attempt" -gt 1 ] 2>/dev/null || return 0
|
|
15
|
+
[ "$(cat "$tdir/retry_findings.source" 2>/dev/null)" = review ] || return 0
|
|
16
|
+
|
|
17
|
+
attempt_delta "$tdir" "$wt" "$reviewed"
|
|
18
|
+
[ -s "$tdir/changes.since.diff" ] || return 0
|
|
19
|
+
|
|
20
|
+
local rows rc=0 count row_id row_p row_finding
|
|
21
|
+
rows="$(python3 "$SKILL_DIR/scripts/forge-jev.py" retry-addressed \
|
|
22
|
+
--plan "$plan" --task "$id" --attempt "$attempt" --repo "$REPO" 2>/dev/null)" || rc=$?
|
|
23
|
+
[ "$rc" -eq 0 ] && [ -n "$rows" ] || return 0
|
|
24
|
+
|
|
25
|
+
count="$(printf '%s\n' "$rows" | grep -c .)"
|
|
26
|
+
{
|
|
27
|
+
echo "forge: these blocking findings look unaddressed by your change:"
|
|
28
|
+
echo
|
|
29
|
+
while IFS=$'\t' read -r row_id row_p row_finding; do
|
|
30
|
+
printf -- '- %s\n' "$row_finding"
|
|
31
|
+
done <<< "$rows"
|
|
32
|
+
echo
|
|
33
|
+
cat "$tdir/retry_findings.md"
|
|
34
|
+
} > "$tdir/.bounce.md.tmp" && mv "$tdir/.bounce.md.tmp" "$tdir/bounce.md" || return 0
|
|
35
|
+
: > "$tdir/bounced"
|
|
36
|
+
rm -f "$tdir/qa.last"
|
|
37
|
+
echo FAIL > "$tdir/status"
|
|
38
|
+
note "$id: the retry leaves $count blocking finding(s) untouched — sent back without a review (see $tdir/bounce.md)"
|
|
39
|
+
return 1
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The dwarf-message gate (#44): the implementer's final message is read before a review is paid
|
|
3
|
+
# for. Sourced by forge-lib-gates.sh; forge_post_dwarf_gates calls it right after the dwarf's
|
|
4
|
+
# reply is in, before the diff snapshot and its empty-diff exits.
|
|
5
|
+
#
|
|
6
|
+
# `question` stops the task as NEEDS_INPUT for the user's answer; `blocked` and `unfinished`
|
|
7
|
+
# send the attempt back as FAIL, with the implementer's own words as the retry's findings, and no
|
|
8
|
+
# review. Neither writes qa.gate or dispatches QA. It fails open (a gate that is off or in
|
|
9
|
+
# shadow, no key, no answer, any error all return 0), and it is the only way an attempt that
|
|
10
|
+
# changed nothing can fail on what its dwarf said.
|
|
11
|
+
|
|
12
|
+
forge_gate_message() { # forge_gate_message <plan> <id> <tdir> <wt> <attempt>
|
|
13
|
+
local plan="$1" id="$2" tdir="$3" wt="$4" attempt="$5"
|
|
14
|
+
declare -F forge_decide_active >/dev/null || return 0
|
|
15
|
+
forge_decide_active dwarf-message || return 0
|
|
16
|
+
|
|
17
|
+
local row rc=0 which p said
|
|
18
|
+
row="$(python3 "$SKILL_DIR/scripts/forge-jev.py" dwarf-message \
|
|
19
|
+
--plan "$plan" --task "$id" --attempt "$attempt" --repo "$REPO" 2>/dev/null)" || rc=$?
|
|
20
|
+
[ "$rc" -eq 0 ] && [ -n "$row" ] || return 0
|
|
21
|
+
IFS=$'\t' read -r which p <<< "$row"
|
|
22
|
+
# the last 3000 characters, not bytes: a byte cut can split a UTF-8 character, and sed then
|
|
23
|
+
# fails on the illegal byte sequence (invalid input bytes become U+FFFD)
|
|
24
|
+
said="$(python3 -c '
|
|
25
|
+
import sys
|
|
26
|
+
text = open(sys.argv[1], "rb").read().decode("utf-8", "replace")[-3000:]
|
|
27
|
+
sys.stdout.buffer.write(text.encode("utf-8"))' "$tdir/dwarf.last" 2>/dev/null)"
|
|
28
|
+
|
|
29
|
+
case "$which" in
|
|
30
|
+
question)
|
|
31
|
+
{
|
|
32
|
+
echo "The implementer asked:"
|
|
33
|
+
echo
|
|
34
|
+
printf '%s\n' "$said"
|
|
35
|
+
} > "$tdir/.needs_input.md.tmp" && mv "$tdir/.needs_input.md.tmp" "$tdir/needs_input.md" || return 0
|
|
36
|
+
rm -f "$tdir/qa.last" # an earlier review describes other code
|
|
37
|
+
: > "$tdir/noretry"
|
|
38
|
+
echo NEEDS_INPUT > "$tdir/status"
|
|
39
|
+
note "$id: the implementer asked a question only you can answer — stopped (see $tdir/needs_input.md)"
|
|
40
|
+
return 1
|
|
41
|
+
;;
|
|
42
|
+
blocked|unfinished)
|
|
43
|
+
{
|
|
44
|
+
echo "forge: the implementer's final message says it did not finish ($which, $p); its own words:"
|
|
45
|
+
echo
|
|
46
|
+
printf '%s\n' "$said" | sed 's/^/> /'
|
|
47
|
+
# The findings this attempt was sent replace nothing: they go on with the retry, as
|
|
48
|
+
# a bounce keeps them (forge-gate-addressed.sh).
|
|
49
|
+
if [ -s "$tdir/retry_findings.md" ]; then
|
|
50
|
+
echo
|
|
51
|
+
echo "The findings this attempt was sent, still to fix:"
|
|
52
|
+
echo
|
|
53
|
+
cat "$tdir/retry_findings.md"
|
|
54
|
+
fi
|
|
55
|
+
} > "$tdir/.message.md.tmp" && mv "$tdir/.message.md.tmp" "$tdir/message.md" || return 0
|
|
56
|
+
: > "$tdir/message.failed"
|
|
57
|
+
rm -f "$tdir/qa.last"
|
|
58
|
+
echo FAIL > "$tdir/status"
|
|
59
|
+
note "$id: the implementer says it did not finish ($which) — sent back without a review (see $tdir/message.md)"
|
|
60
|
+
return 1
|
|
61
|
+
;;
|
|
62
|
+
esac
|
|
63
|
+
return 0
|
|
64
|
+
}
|