@giamme/forge 0.17.0 → 0.19.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -0
  3. package/SKILL.md +32 -5
  4. package/VERSION +1 -1
  5. package/docs/artifacts.md +33 -1
  6. package/docs/commands.md +147 -16
  7. package/docs/dataset.md +5 -0
  8. package/docs/decomposed-runs.md +122 -1
  9. package/docs/development.md +2 -1
  10. package/docs/forge-ui.md +98 -8
  11. package/docs/memory.md +27 -4
  12. package/docs/models.md +8 -0
  13. package/docs/reviews.md +122 -0
  14. package/docs/safety.md +8 -0
  15. package/forge +44 -4
  16. package/package.json +2 -1
  17. package/references/dataset.md +39 -1
  18. package/references/decompose.md +737 -16
  19. package/references/harnesses.md +18 -3
  20. package/references/planning.md +43 -14
  21. package/references/solo.md +2 -1
  22. package/references/ui.md +56 -6
  23. package/registry.tsv +8 -3
  24. package/scripts/forge-artifact.sh +14 -0
  25. package/scripts/forge-brief.py +217 -0
  26. package/scripts/forge-compare.py +13 -2
  27. package/scripts/forge-config.py +176 -9
  28. package/scripts/forge-contract.py +246 -28
  29. package/scripts/forge-control.py +200 -15
  30. package/scripts/forge-dispatch.sh +48 -15
  31. package/scripts/forge-du.py +167 -0
  32. package/scripts/forge-group.py +496 -0
  33. package/scripts/forge-groups.py +89 -0
  34. package/scripts/forge-handoff.py +1128 -0
  35. package/scripts/forge-lib-adopt.sh +1 -0
  36. package/scripts/forge-lib-group.sh +641 -0
  37. package/scripts/forge-lib-plans.sh +343 -4
  38. package/scripts/forge-lib-review.sh +29 -1
  39. package/scripts/forge-lib-task.sh +197 -4
  40. package/scripts/forge-memory.sh +245 -3
  41. package/scripts/forge-metrics.sh +7 -3
  42. package/scripts/forge-parallel-options.sh +4 -0
  43. package/scripts/forge-parallel.sh +1216 -41
  44. package/scripts/forge-planner.py +104 -8
  45. package/scripts/forge-prompt.py +120 -0
  46. package/scripts/forge-retro.py +115 -0
  47. package/scripts/forge-route.py +190 -12
  48. package/scripts/forge-runs-compact.py +443 -0
  49. package/scripts/forge-runs-rm.py +2 -0
  50. package/scripts/forge-runs.py +27 -8
  51. package/scripts/forge-schedule.py +633 -49
  52. package/scripts/forge-shadow.py +7 -1
  53. package/scripts/forge-solo.sh +4 -0
  54. package/scripts/forge-summarize.py +698 -0
  55. package/scripts/forge-ui-options.sh +10 -0
  56. package/scripts/forge-worktrees.py +243 -0
  57. package/scripts/forge_brief/__init__.py +831 -0
  58. package/scripts/forge_brief/answers.py +506 -0
  59. package/scripts/forge_brief/proposals.py +1630 -0
  60. package/scripts/forge_dataset/__init__.py +10 -0
  61. package/scripts/forge_dataset/efforts.py +4 -3
  62. package/scripts/forge_dataset/export.py +36 -10
  63. package/scripts/forge_dataset/facts.py +8 -4
  64. package/scripts/forge_dataset/forecast.py +8 -18
  65. package/scripts/forge_dataset/harvest.py +241 -12
  66. package/scripts/forge_dataset/history.py +13 -6
  67. package/scripts/forge_dataset/importer.py +65 -1
  68. package/scripts/forge_dataset/names.py +66 -0
  69. package/scripts/forge_dataset/reviewers.py +5 -2
  70. package/scripts/forge_dataset/risk.py +6 -3
  71. package/scripts/forge_dataset/routing.py +6 -1
  72. package/scripts/forge_decide/__init__.py +11 -1
  73. package/scripts/forge_groups/__init__.py +308 -0
  74. package/scripts/forge_groups/attribute.py +289 -0
  75. package/scripts/forge_groups/review.py +286 -0
  76. package/scripts/forge_locations.py +366 -0
  77. package/scripts/forge_owner.py +152 -0
  78. package/scripts/forge_registry.py +19 -0
  79. package/scripts/forge_retro/__init__.py +417 -0
  80. package/scripts/forge_retro/issues.py +1193 -0
  81. package/scripts/forge_retro/report.py +671 -0
  82. package/scripts/forge_side/__init__.py +482 -0
  83. package/scripts/forge_storage.py +515 -0
  84. package/ui/README.md +68 -8
  85. package/ui/docs/api.md +375 -31
  86. package/ui/forge_ui/control.py +451 -11
  87. package/ui/forge_ui/executions.py +8 -1
  88. package/ui/forge_ui/export.py +53 -7
  89. package/ui/forge_ui/groups.py +264 -0
  90. package/ui/forge_ui/links.py +337 -0
  91. package/ui/forge_ui/models.py +125 -10
  92. package/ui/forge_ui/projects.py +4 -1
  93. package/ui/forge_ui/reader.py +919 -45
  94. package/ui/forge_ui/server.py +4 -0
  95. package/ui/forge_ui/static/app.js +173 -11
  96. package/ui/forge_ui/static/briefview.js +605 -0
  97. package/ui/forge_ui/static/checksview.js +6 -2
  98. package/ui/forge_ui/static/controls.js +5 -0
  99. package/ui/forge_ui/static/diffview.js +86 -1
  100. package/ui/forge_ui/static/groupsview.js +332 -0
  101. package/ui/forge_ui/static/index.html +4 -0
  102. package/ui/forge_ui/static/panel.js +394 -8
  103. package/ui/forge_ui/static/projectsview.js +189 -10
  104. package/ui/forge_ui/static/runmodel.js +27 -4
  105. package/ui/forge_ui/static/storageview.js +352 -0
  106. package/ui/forge_ui/static/style.css +176 -6
  107. package/ui/forge_ui/static/worktreesview.js +235 -14
  108. package/ui/forge_ui/storage.py +150 -0
  109. package/ui/forge_ui/transcripts.py +35 -10
  110. package/ui/forge_ui/worktrees.py +154 -13
package/forge CHANGED
@@ -23,10 +23,17 @@ usage() {
23
23
  ' jev the old decision-model commands, replaced by decide (kept for one release)' \
24
24
  ' dataset every run'"'"'s inputs and outcomes: status, dump, import, export, outcomes, ...' \
25
25
  ' issues file the review findings a run left open as GitHub issues (plain gh)' \
26
- ' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune' \
26
+ ' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune, forget' \
27
27
  ' pr a draft pull-request description for a finished run (--create opens it with gh)' \
28
28
  ' ui forge-ui, the run viewer: open [DIR], status, stop' \
29
- ' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs; rerun a plan with another model, compare' \
29
+ ' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs; compact, rm, rerun with another model, compare' \
30
+ ' du what forge takes on disk (run dirs, worktrees, data home) and the command that takes each part back' \
31
+ ' retro notes on what got in a run'"'"'s way, kept on this machine' \
32
+ ' summarize a task'"'"'s generated summary, rewritten only when its inputs change' \
33
+ ' brief each task'"'"'s open questions, asked before it starts: write, show' \
34
+ ' group a plan'"'"'s task groups: show, retry a review=group group, set a title or goal' \
35
+ ' handoff a run'"'"'s state for the next session, with the commands to carry on: show (the default)' \
36
+ ' worktrees the worktrees forge created: rm removes the safe ones by forge-ui'"'"'s rules' \
30
37
  ' watch follow runs live and get a desktop notification when one finishes or fails' \
31
38
  ' control a plan'"'"'s live controls: show, set (QA threshold, retries, timeouts), pin, unpin' \
32
39
  ' config every config source: show, and set/unset the per-repo .forge files and Jev on/off' \
@@ -103,9 +110,9 @@ case "${1:-}" in
103
110
  shift
104
111
  # only the commands its help lists: note and record are what a run writes into the ledger, not a person
105
112
  case "${1:-}" in
106
- show|learnings|prune|spend|inject|-h|--help|help) ;;
113
+ show|learnings|prune|spend|inject|forget|-h|--help|help) ;;
107
114
  '') /bin/bash "$ROOT/scripts/forge-memory.sh" --help >&2; exit 2 ;;
108
- *) printf 'forge memory: unknown command: %s (show, learnings, prune, spend or inject)\n' "$1" >&2; exit 2 ;;
115
+ *) printf 'forge memory: unknown command: %s (show, learnings, prune, spend, inject or forget)\n' "$1" >&2; exit 2 ;;
109
116
  esac
110
117
  exec /bin/bash "$ROOT/scripts/forge-memory.sh" "$@"
111
118
  ;;
@@ -122,6 +129,39 @@ case "${1:-}" in
122
129
  shift
123
130
  exec python3 "$ROOT/scripts/forge-runs.py" "$@"
124
131
  ;;
132
+ du)
133
+ shift
134
+ exec python3 "$ROOT/scripts/forge-du.py" "$@"
135
+ ;;
136
+ retro)
137
+ shift
138
+ help_if_bare $# python3 "$ROOT/scripts/forge-retro.py"
139
+ exec python3 "$ROOT/scripts/forge-retro.py" "$@"
140
+ ;;
141
+ summarize)
142
+ shift
143
+ help_if_bare $# python3 "$ROOT/scripts/forge-summarize.py"
144
+ exec python3 "$ROOT/scripts/forge-summarize.py" "$@"
145
+ ;;
146
+ brief)
147
+ shift
148
+ help_if_bare $# python3 "$ROOT/scripts/forge-brief.py"
149
+ exec python3 "$ROOT/scripts/forge-brief.py" "$@"
150
+ ;;
151
+ group)
152
+ shift
153
+ help_if_bare $# python3 "$ROOT/scripts/forge-group.py"
154
+ exec python3 "$ROOT/scripts/forge-group.py" "$@"
155
+ ;;
156
+ handoff)
157
+ shift
158
+ exec python3 "$ROOT/scripts/forge-handoff.py" "$@"
159
+ ;;
160
+ worktrees)
161
+ shift
162
+ help_if_bare $# python3 "$ROOT/scripts/forge-worktrees.py"
163
+ exec python3 "$ROOT/scripts/forge-worktrees.py" "$@"
164
+ ;;
125
165
  watch)
126
166
  shift
127
167
  exec python3 "$ROOT/scripts/forge-watch.py" "$@"
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Multi-model coding with a reviewer that reads the code: plan, build in parallel worktrees, review every real diff, merge only what passes.",
5
5
  "keywords": ["claude-code", "codex", "opencode", "agent-skill", "code-review", "multi-model"],
6
6
  "license": "MIT",
7
7
  "author": "Giamme",
8
8
  "repository": { "type": "git", "url": "git+https://github.com/Giamme/forge.git" },
9
+ "homepage": "https://giamme.github.io/forge/",
9
10
  "bin": { "forge": "forge" },
10
11
  "os": ["darwin", "linux"],
11
12
  "files": [
@@ -42,7 +42,14 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
42
42
  | `event` `control` | `forge control` change | a human's live change: `at`, `actor` (`cli`/`ui`), `action` (`set`, `pin`, `unpin`), `key`, `value`, `previous`; task events carry the task id. Also read back from `control.log` by `import` |
43
43
  | `event` `worktree_created` / `worktree_removed` | forge adds or removes a worktree | `path`, `branch` (`-` when detached), `kind` (`task`, `integration`, `candidate` for integrate's scratch worktree, `attribute` for the culprit search's), `repo_path`, and the task for a task worktree; `forge runs rm` adds `by`. Written at task and `_integration` creation, the merged-task cleanup at the end of `run`, integrate's candidate, every prefix of `attribute`, `combine` and `split` (a moved worktree is removed from the old run and created in the new one), and `forge runs rm --worktrees`. A worktree removed outside forge has no `worktree_removed`. forge-ui's Worktrees screen reads them through `forge dataset worktrees` |
44
44
  | `event` `run_delete_started` / `run_deleted` | `forge runs rm` | written strictly around a run's deletion: `path`, `run_id`, `archive`, and for `run_deleted` the bytes freed |
45
+ | `event` `run_compacted` | `forge runs compact` (by hand, or `auto` in the background at run start) | after the strict import and the removals, fail-open: `path`, `bytes_freed`, `snapshots_removed`, `snapshot_bytes`, `logs_compressed`, `log_bytes_freed`, `auto` |
45
46
  | `event` `shadow_review` | shadow review | how an opt-in second review ended (`done`, `invalid`, `overtime`, `orphaned`, ...), with the reviewed commit and both specs. Its dispatch is recorded with role `qa_shadow` |
47
+ | `event` `side_dispatch` | a brief or summary dispatch that `forge run`, `forge brief write`, `forge summarize` or the scheduler's summaries started, or could not start | `kind` (`brief` or `summary`), `task`, `spec`, `ok`, and `reason`: null on success, else `timeout`, `error`, `missing` or `cap`. Its dispatch is recorded with role `side_brief` or `side_summary` |
48
+ | `event` `group_review` | one QA round of a `review=group` group | `group`, `round`, `members`, `reviewer`, `verdict`, `gated`, `implicated`, `ambiguous`, `findings`, `diff_bytes`, `prompt_bytes`. The dispatch itself is a separate `dispatch` with `scope` `group` |
49
+ | `event` `group_merge` | a group merge, conflict, or invalidation | `group`, `status` (`MERGED`, `CONFLICT`, or `INVALIDATED`). `MERGED` also has `commit`, `members` and `integration`. `CONFLICT` has `commit` and `conflicts`. `INVALIDATED` has `reason`. Each member's own `merge` event also carries `group` |
50
+ | `event` `retro_note` | a retro note stored by `forge retro note`, or by `forge retro record` after a dispatch | the note's fields (`type`, `fixable_by`, `summary`, `blocking`, `tried`, `evidence`), forge's context (`role`, `spec`, `alias`, `harness`, `effort`, `tier`, `task`, `attempt`, `run_id`, `version`, `os`, `t`) and `check` (`verified` or `claimed`). Fail-open: the plan's `retro/notes.jsonl` is the record |
51
+ | `event` `brief_question` | a brief question stored by `forge brief write` | `task`, `qid`, `scope`, `must_answer` (kept only under `gated`), and `parked`: true for a `wave` or `plan` question, which is kept in `brief.parked.json` |
52
+ | `event` `brief_answer` | an answer given with `forge brief answer` | `task`, `qid`, `actor` (`cli`, or `ui` from forge-ui), and `late`: true once the task has started. The answer is also logged in `control.log` as an `answer` change |
46
53
  | `jev` | Jev request | site, answers, usage, latency, mode. Blob: the **full request** (state and questions). Its original sha is `jev.jsonl`'s `key`. A per-attempt gate's request state carries `run`, `task` and `attempt` (`dwarf-message`, `retry-addressed`), so its key differs per attempt and per run; `attribution` carries `run` only |
47
54
  | `fractal_step` / `fractal_node` | Fractal step, node state | decomposition decision, iteration, resolved model, cost, tokens, candidate diff |
48
55
  | `ledger` | ledger row | imported `.forge/ledger.tsv` rows |
@@ -73,8 +80,31 @@ the log does not say. `speed_reason` is why it was not fast (claude's
73
80
  `fast_mode_disabled_reason`, or codex's error message), or null. Each is null when absent,
74
81
  so a dispatch that predates the keys is otherwise unchanged.
75
82
 
83
+ A brief or summary is a side dispatch (`forge-dispatch.sh side`, read-only). Its dispatch is
84
+ recorded as role `side_brief` or `side_summary` (`forge_dataset.is_side_role`), and its files on
85
+ disk stay `side.*`. Review history, finding facts, review exports and forge-ui's model views
86
+ skip every `side_*` role, so a brief or summary is never counted as a review. A bare `side` is
87
+ the dispatch role itself, not one of these.
88
+
89
+ A group review is one QA dispatch for several tasks (`forge-dispatch.sh qa` with
90
+ `--run-dir <plan>/groups/<gid>`). It is recorded with `scope` `group`, an empty task,
91
+ `group` (the group id), `members` (the task ids from `groups.tsv`, in order) and `round`
92
+ (the number in `groups/<gid>/round` when the dispatch was captured live; an import reads
93
+ the dispatch's own `attempts/qa-*/group.round`, and for a run recorded before that file, the
94
+ round from `members.tsv`, matched to `qa.round-<n>.last` when that file exists). It is
95
+ not a task attempt. Reviewer leaderboards, `forge dataset` reviewers, pairs, routing, tiers
96
+ and efforts, review history, finding facts, the review rows of `forge dataset export`, and
97
+ forge-ui's model views skip `scope` `group` the way they skip a side dispatch. The dispatch
98
+ stays in the store, flagged `scope` `group`, so a later measurement of group review quality
99
+ and cost can use it. A member attempt the group judged is linked on import (`review_scope`
100
+ `group`, plus `group` and `round`) and does not keep a copy of that review's `qa.last` or
101
+ `qa.gate`. It has no task-level QA dispatch of its own. A plan with no group review imports
102
+ the same events as before.
103
+
76
104
  `plan --reviewer-session` writes `$PLAN/reviewer_session` (`on`). The plan event records
77
- it in `options`. The file joins the plan id only when it is present, so every plan already
105
+ it in `options`, and `--reviewer-session-rate` adds `reviewer_session_rate`; which tasks were
106
+ sampled is in `$PLAN/reviewer_session_tasks`, and the others' `review_sessions.tsv` rows say
107
+ `not-sampled`. The file joins the plan id only when it is present, so every plan already
78
108
  in a store keeps its id, and turning the experiment on stores a new plan event.
79
109
  `plan --implementer-session` (`$PLAN/implementer_session`, `on`) is recorded the same way, and
80
110
  `plan --pre-review-tests` joins the plan id the same way and is listed in `flags`. `plan-gates.json`
@@ -84,6 +114,14 @@ its id, and a re-plan that changes the file's content gets a new plan event. `pl
84
114
  `forge dataset status` counts continued and failed continues for reviewers and implementers
85
115
  apart.
86
116
 
117
+ The feature files `retro_mode`, `brief`, `brief_scope`, `brief_model`, `summaries` and
118
+ `summaries_model` join the plan id the same way, and the plan event's `options` records each
119
+ one under its file name. `brief_scope` and `brief_model` exist only when brief is on, and
120
+ `summaries_model` only when summaries is on. `retro_mode`, `brief` and `summaries` hold `off`
121
+ after an explicit off (`--no-retro`, `--brief off`, `--summaries off`); with no choice they
122
+ are absent. See [retro notes](decompose.md#retro-notes-opt-in), [brief mode](decompose.md#brief-mode-opt-in)
123
+ and [task summaries](decompose.md#task-summaries-opt-in).
124
+
87
125
  Each blob reference carries `sha` (the stored bytes), `original_sha`, `n` (the original
88
126
  size), `kept`, and `cut`. A cut keeps the head and the tail, because a QA prompt ends with
89
127
  the diff and a log ends with the failure. Caps: prompt 1 MiB, diff 2 MiB, message 256 KiB,