@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-metrics.sh
CHANGED
|
@@ -5,8 +5,9 @@ forge_metric_begin() {
|
|
|
5
5
|
FORGE_METRIC="$(python3 "$SKILL_DIR/scripts/forge-runtime.py" begin "$1" "$2")" || return 3
|
|
6
6
|
# Dispatches started from here name this execution as their parent in the run dataset.
|
|
7
7
|
export FORGE_DATASET_PARENT="${FORGE_METRIC##*/}"
|
|
8
|
-
# The hook, when the caller defines it, records status before finish and Fractal's _outcome.
|
|
9
|
-
|
|
8
|
+
# The hook, when the caller defines it, records status before finish and Fractal's _outcome. A review
|
|
9
|
+
# snapshot the runner names in FORGE_REVIEW_SNAPSHOT is removed on every way out (#139).
|
|
10
|
+
trap 'metric_rc=$?; [ -z "${FORGE_REVIEW_SNAPSHOT:-}" ] || ! declare -F forge_drop_snapshot >/dev/null || forge_drop_snapshot "$FORGE_REVIEW_SNAPSHOT"; ! declare -F forge_metric_on_exit >/dev/null || forge_metric_on_exit "$metric_rc"; python3 "$SKILL_DIR/scripts/forge-runtime.py" finish "$FORGE_METRIC" "$FORGE_METRIC_ROOT" "$FORGE_METRIC_ROLE" pipeline "$metric_rc"; if [ -n "${FORGE_FRACTAL_RUN:-}" ]; then python3 "$SKILL_DIR/scripts/forge-fractal.py" _outcome "$FORGE_METRIC_ROOT" "$metric_rc"; fi; exit "$metric_rc"' EXIT
|
|
10
11
|
}
|
|
11
12
|
forge_metric_phase() {
|
|
12
13
|
python3 "$SKILL_DIR/scripts/forge-runtime.py" phase "$FORGE_METRIC" "$1"
|
|
@@ -25,11 +26,36 @@ forge_dataset_event() { # forge_dataset_event <name> --dir <dir> [--task id] [--
|
|
|
25
26
|
}
|
|
26
27
|
# A worktree forge added or removed (#125): forge-ui's Worktrees screen lists every one, removed ones too.
|
|
27
28
|
# <kind> is task, integration, candidate or attribute (scripts/forge_worktrees.py); <branch> is - when detached.
|
|
28
|
-
#
|
|
29
|
+
# Always into forge's location list (forge_locations.py, off only with FORGE_RUN_REGISTRY=off), so forge knows
|
|
30
|
+
# where its worktrees are whatever the dataset says; the dataset event is off with FORGE_DATASET=off.
|
|
29
31
|
forge_worktree_event() { # forge_worktree_event created|removed <run dir> <repo> <path> <branch|-> <kind> [task]
|
|
32
|
+
python3 -I "$SKILL_DIR/scripts/forge_locations.py" worktree "$1" "$2" "$3" "$4" "$5" "$6" ${7:+"$7"} \
|
|
33
|
+
</dev/null >/dev/null 2>&1 || true
|
|
30
34
|
forge_dataset_event "worktree_$1" --dir "$2" ${7:+--task "$7"} --set repo_path="$3" --set path="$4" \
|
|
31
35
|
--set branch="$5" --set kind="$6"
|
|
32
36
|
}
|
|
37
|
+
# The outcomes that came due for a run's repository (#120): what older integrations' lines became,
|
|
38
|
+
# read from git alone. At the end of `run` and `integrate`; bounded (FORGE_OUTCOMES_TIMEOUT seconds,
|
|
39
|
+
# default 20, plus a kill 10 s later), never changes the caller's exit code, logs its errors to the
|
|
40
|
+
# dataset's errors.log, and is off with FORGE_OUTCOMES=off or with the dataset.
|
|
41
|
+
forge_outcomes_harvest() { # forge_outcomes_harvest <plan dir>
|
|
42
|
+
forge_dataset_off && return 0
|
|
43
|
+
case "${FORGE_OUTCOMES:-on}" in off|OFF|Off|0|no|false) return 0 ;; esac
|
|
44
|
+
local repo limit pid watcher
|
|
45
|
+
repo="$(cat "$1/repo" 2>/dev/null)"
|
|
46
|
+
[ -n "$repo" ] && [ -d "$repo" ] || return 0
|
|
47
|
+
limit="${FORGE_OUTCOMES_TIMEOUT:-20}"
|
|
48
|
+
case "$limit" in ''|*[!0-9]*) limit=20 ;; esac
|
|
49
|
+
[ "$limit" -gt 0 ] || return 0
|
|
50
|
+
python3 "$SKILL_DIR/scripts/forge-dataset.py" outcomes --repo "$repo" --deadline "$limit" --quiet \
|
|
51
|
+
</dev/null >/dev/null 2>&1 &
|
|
52
|
+
pid=$!
|
|
53
|
+
( sleep $(( limit + 10 )); kill -KILL "$pid" 2>/dev/null ) >/dev/null 2>&1 &
|
|
54
|
+
watcher=$!
|
|
55
|
+
wait "$pid" 2>/dev/null
|
|
56
|
+
pkill -P "$watcher" 2>/dev/null; kill "$watcher" 2>/dev/null; wait "$watcher" 2>/dev/null
|
|
57
|
+
return 0
|
|
58
|
+
}
|
|
33
59
|
forge_dataset_invocation() { # forge_dataset_invocation <command> <rc> <started> [argv...]
|
|
34
60
|
forge_dataset_off && return 0
|
|
35
61
|
local command="$1" rc="$2" started="$3"; shift 3
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
# --infra-retries when `run` or `retry` is not given them; a flag wins. On `retry` they are
|
|
16
16
|
# the further attempts after this one (while its review fails) and the waits out of an infrastructure stop.
|
|
17
17
|
#
|
|
18
|
+
# `plan` also writes retro, brief, brief_scope, brief_model, summaries and summaries_model
|
|
19
|
+
# (--retro, --brief, --brief-scope, --brief-model, --summaries, --summaries-model; #132, #133,
|
|
20
|
+
# #135). They are plan-only flags, parsed in do_plan, not here; see forge_features_resolve.
|
|
21
|
+
#
|
|
18
22
|
# Persisted options become files in the plan dir, like --verify and --setup, so a later
|
|
19
23
|
# `retry` or the scheduler's task processes see them. Cost-bearing options that change
|
|
20
24
|
# what a run is allowed to spend (--retry-failed, --infra-retries) are deliberately NOT
|