auto-optimize 1.0.0__py3-none-any.whl

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 (67) hide show
  1. auto_optimize/__init__.py +3 -0
  2. auto_optimize/__main__.py +5 -0
  3. auto_optimize/cli.py +651 -0
  4. auto_optimize/skills/auto-optimize-code/LICENSE +21 -0
  5. auto_optimize/skills/auto-optimize-code/SKILL.md +251 -0
  6. auto_optimize/skills/auto-optimize-code/VERSION +1 -0
  7. auto_optimize/skills/auto-optimize-code/references/algorithm.md +182 -0
  8. auto_optimize/skills/auto-optimize-code/references/changes.md +146 -0
  9. auto_optimize/skills/auto-optimize-code/references/cli.md +206 -0
  10. auto_optimize/skills/auto-optimize-code/references/dashboard.md +203 -0
  11. auto_optimize/skills/auto-optimize-code/references/documents.md +55 -0
  12. auto_optimize/skills/auto-optimize-code/references/extending.md +87 -0
  13. auto_optimize/skills/auto-optimize-code/references/external-validation.md +98 -0
  14. auto_optimize/skills/auto-optimize-code/references/glossary.md +134 -0
  15. auto_optimize/skills/auto-optimize-code/references/idea-miner.md +108 -0
  16. auto_optimize/skills/auto-optimize-code/references/issue-bugs.md +182 -0
  17. auto_optimize/skills/auto-optimize-code/references/layout.md +300 -0
  18. auto_optimize/skills/auto-optimize-code/references/main-session.md +45 -0
  19. auto_optimize/skills/auto-optimize-code/references/measuring.md +208 -0
  20. auto_optimize/skills/auto-optimize-code/references/pr-optimization.md +127 -0
  21. auto_optimize/skills/auto-optimize-code/references/pr-tests.md +254 -0
  22. auto_optimize/skills/auto-optimize-code/references/promotion.md +133 -0
  23. auto_optimize/skills/auto-optimize-code/references/reading-a-search.md +65 -0
  24. auto_optimize/skills/auto-optimize-code/references/repo-mode.md +224 -0
  25. auto_optimize/skills/auto-optimize-code/references/resume.md +81 -0
  26. auto_optimize/skills/auto-optimize-code/references/shared-knowledge.md +114 -0
  27. auto_optimize/skills/auto-optimize-code/references/step0-interview.md +298 -0
  28. auto_optimize/skills/auto-optimize-code/references/step1-unit-tests.md +136 -0
  29. auto_optimize/skills/auto-optimize-code/references/step2-baseline.md +708 -0
  30. auto_optimize/skills/auto-optimize-code/references/step3-rounds.md +350 -0
  31. auto_optimize/skills/auto-optimize-code/references/step4-final.md +121 -0
  32. auto_optimize/skills/auto-optimize-code/references/step5-ship.md +220 -0
  33. auto_optimize/skills/auto-optimize-code/references/step6-finish.md +67 -0
  34. auto_optimize/skills/auto-optimize-code/references/subagent.md +467 -0
  35. auto_optimize/skills/auto-optimize-code/references/symptoms.md +67 -0
  36. auto_optimize/skills/auto-optimize-code/references/writing-briefs.md +117 -0
  37. auto_optimize/skills/auto-optimize-code/scripts/attribution.py +156 -0
  38. auto_optimize/skills/auto-optimize-code/scripts/autoopt.py +12863 -0
  39. auto_optimize/skills/auto-optimize-code/scripts/check_seeding.py +334 -0
  40. auto_optimize/skills/auto-optimize-code/scripts/cold.py +90 -0
  41. auto_optimize/skills/auto-optimize-code/scripts/dashboard/README.md +165 -0
  42. auto_optimize/skills/auto-optimize-code/scripts/dashboard/autoopt_monitor.py +850 -0
  43. auto_optimize/skills/auto-optimize-code/scripts/dashboard/gpu_scan.py +954 -0
  44. auto_optimize/skills/auto-optimize-code/scripts/dashboard/monitor_writer.py +684 -0
  45. auto_optimize/skills/auto-optimize-code/scripts/dashboard/scan.py +1030 -0
  46. auto_optimize/skills/auto-optimize-code/scripts/dashboard/static/dashboard.css +775 -0
  47. auto_optimize/skills/auto-optimize-code/scripts/dashboard/static/dashboard.js +3652 -0
  48. auto_optimize/skills/auto-optimize-code/scripts/dashboard/static/index.html +191 -0
  49. auto_optimize/skills/auto-optimize-code/scripts/issue_body.py +2118 -0
  50. auto_optimize/skills/auto-optimize-code/scripts/lint_text.py +448 -0
  51. auto_optimize/skills/auto-optimize-code/scripts/opt_pr_body.py +894 -0
  52. auto_optimize/skills/auto-optimize-code/scripts/opt_pr_tables.py +367 -0
  53. auto_optimize/skills/auto-optimize-code/scripts/paired.py +188 -0
  54. auto_optimize/skills/auto-optimize-code/scripts/preflight.py +280 -0
  55. auto_optimize/skills/auto-optimize-code/scripts/probe_run.py +72 -0
  56. auto_optimize/skills/auto-optimize-code/scripts/publish.py +385 -0
  57. auto_optimize/skills/auto-optimize-code/scripts/run_iteration.py +1382 -0
  58. auto_optimize/skills/auto-optimize-code/scripts/ship.py +1193 -0
  59. auto_optimize/skills/auto-optimize-code/scripts/stages.py +651 -0
  60. auto_optimize/skills/auto-optimize-code/scripts/tests_pr_body.py +1267 -0
  61. auto_optimize/skills/auto-optimize-code/scripts/tests_pr_push.py +426 -0
  62. auto_optimize/skills/auto-optimize-code/scripts/tests_pr_tables.py +779 -0
  63. auto_optimize-1.0.0.dist-info/METADATA +610 -0
  64. auto_optimize-1.0.0.dist-info/RECORD +67 -0
  65. auto_optimize-1.0.0.dist-info/WHEEL +4 -0
  66. auto_optimize-1.0.0.dist-info/entry_points.txt +2 -0
  67. auto_optimize-1.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,220 @@
1
+ # Step 5 — shipping: the change back where it came from
2
+
3
+ The search is over once `end` has run (`references/step4-final.md`). Nothing
4
+ of the winner has reached the user's code yet: the original was never written
5
+ to. Shipping is a step of its own, and it starts with a question to the user.
6
+ Step 6 (`references/step6-finish.md`) follows whatever they choose.
7
+
8
+ ## Ask how to ship
9
+
10
+ ```bash
11
+ python3 $AO/ship.py plan $WORK
12
+ ```
13
+
14
+ prints what this search can ship (plain or repository mode, the GitHub
15
+ repository and whether `gh` can push there, whether step 1 wrote a unit-test
16
+ suite, the bugs step 1 recorded) and the questions to ask (`--json` prints
17
+ the same for a program). Ask them in one
18
+ AskUserQuestion call: how to ship, then, for a repository search, the
19
+ documents and the branch names, whose answers apply only to the route that
20
+ uses them:
21
+
22
+ | Mode | "How do you want to ship?" |
23
+ |---|---|
24
+ | plain (`init --copy`) | *Apply the change to the original file(s)* (Recommended); *Not now* |
25
+ | repository, on GitHub | *Open GitHub documents* (Recommended); *A branch in your local repository*; *Not now* |
26
+ | repository, elsewhere | *A branch in your local repository*; *Not now* |
27
+
28
+ "Which documents?" (multiSelect), on *Open GitHub documents*: *The
29
+ optimization PR*; *The unit-test PR*, only when step 1 wrote a suite; *The
30
+ bug report*, only when step 1 recorded bugs.
31
+
32
+ "Start the branch names with `auto-optimize/`?", for a branch or a PR: *No*
33
+ or *Yes*, each option showing the names it gives (`ship.py plan` prints
34
+ them). It names every branch shipping makes or pushes:
35
+
36
+ | Branch | No | Yes |
37
+ |---|---|---|
38
+ | the optimization PR's | from its title (`vectorize-column-scoring`) | `auto-optimize/vectorize-column-scoring` |
39
+ | the unit-test PR's | `unit-tests-<date>` | step 1's own name, `auto-optimize/<date>-unit-tests` |
40
+ | a local branch | `optimized-<date>` | `auto-optimize/optimized-<date>` |
41
+
42
+ Record the answers in the user's words, then follow the matching section:
43
+
44
+ ```bash
45
+ python3 $AO/autoopt.py config $WORK --set after.ship=<apply|branch|github|none> --reason "<their words>"
46
+ python3 $AO/autoopt.py config $WORK --set after.ship_documents=optimization,tests,bugs --reason "<their words>" # GitHub only, what they checked
47
+ python3 $AO/autoopt.py config $WORK --set after.branch_prefix=<no|yes> --reason "<their words>" # a branch or GitHub
48
+ ```
49
+
50
+ `ship.py branch` and `ship.py rehearse` refuse until `after.branch_prefix`
51
+ is answered. An answer this search cannot ship (a route its mode does not
52
+ have, a document with nothing behind it) counts as no answer: `stages.py next`
53
+ asks again.
54
+
55
+ *Not now* (`none`) goes straight to step 6; the user can ask later, and
56
+ `ship.py plan` asks again. `stages.py next` names the move at every point of
57
+ this step.
58
+
59
+ ## Apply the change (plain mode)
60
+
61
+ ```bash
62
+ python3 $AO/ship.py apply $WORK # preview: the files, the diffstat; writes nothing
63
+ python3 $AO/ship.py apply $WORK --yes # on the user's yes
64
+ ```
65
+
66
+ Each file the winner changed is written with its measured content where it
67
+ came from (`init` records each `--copy` source in `config.json` as
68
+ `copied`); a file the change adds goes beside them. Files the search wrote
69
+ itself, such as the benchmark, are left out and named. It refuses, writing
70
+ nothing, when a file changed since the search copied it (the change was
71
+ measured on the copy), a file it would add exists, or one it would change is
72
+ missing. A file that already holds the change is reported as applied, and
73
+ `--yes` records it so (applied by hand, say). After an iteration made with
74
+ `--after-end` becomes the winner, `apply` runs again over the files the
75
+ first apply wrote, and puts back the ones the new winner leaves alone. A
76
+ search made before `init` kept the record needs `--to DIR`, the folder the
77
+ copied files are in. `ship/applied.json` records what was written and what
78
+ held the change already, and `ship/applied.patch` is the whole change the
79
+ original files now hold; applying the same winner again keeps that record. `apply` and `branch` ship the winner; `--id` names another
80
+ iteration, which the user must have asked for.
81
+
82
+ ## A branch in the local repository
83
+
84
+ ```bash
85
+ python3 $AO/ship.py branch $WORK [--name N] # preview: the commits, the diffstat
86
+ python3 $AO/ship.py branch $WORK [--name N] --yes # on the user's yes
87
+ ```
88
+
89
+ One commit per kept change, each with the `## Commit message` its notes
90
+ hold (its title when it has none), made in the search's `repo.git` and
91
+ fetched into the original as a new branch (`optimized-<date>` by default,
92
+ `auto-optimize/optimized-<date>` with the prefix). It
93
+ refuses a name that exists and never checks the branch out. With a suite from
94
+ step 1, the commits sit on the original's commit and leave the suite out
95
+ (*Separate from the unit tests*, below). `--repo PATH` names the original
96
+ when the search does not record it. `ship/branch.json` records it.
97
+
98
+ ## GitHub documents
99
+
100
+ | Document | Reference | Folder |
101
+ |---|---|---|
102
+ | the optimization PR | `references/pr-optimization.md` | `$WORK/ship/pr-optimization` |
103
+ | the unit-test PR | `references/pr-tests.md` | `$WORK/ship/pr-tests` |
104
+ | the bug report | `references/issue-bugs.md` | `$WORK/ship/issue-bugs` |
105
+
106
+ What every document carries, and what none may say:
107
+ `references/documents.md`.
108
+
109
+ The route has two parts, in this order: the document writer drafts every
110
+ chosen document, then the user reviews them all and they are posted
111
+ together; none is posted on its own.
112
+
113
+ ### The document writer
114
+
115
+ Spawn one subagent, the document writer, with the prompt `python3
116
+ $AO/ship.py brief $WORK` prints. It writes the inputs of every chosen
117
+ document (tables, prose, commit messages; for a bug report, bugs.tsv and each
118
+ reproduction rerun by `issue_body.py verify`), renders each with a title, and
119
+ ends when `ship.py rehearse` exits 0. Its report gives each title and the
120
+ rehearsal's digest. When it is gone before it reported (a closed session), spawn
121
+ a new one from the same prompt: the prompt has it keep and complete the inputs
122
+ already written in each document's folder.
123
+
124
+ ### Review, then post all
125
+
126
+ ```bash
127
+ python3 $AO/ship.py rehearse $WORK # renders each, runs each one's preview, prints the digest
128
+ python3 $AO/ship.py status $WORK # where each stands, and the last rehearsal's digest
129
+ python3 $AO/ship.py render $WORK [--only DOCUMENT] # render again without the previews
130
+ ```
131
+
132
+ Show the user every body (`ship/<folder>/body.md`) and preview
133
+ (`ship/rehearsal/<document>.txt`) together: titles, the repository and
134
+ branch each opens on, the commits. A change they ask for goes to the
135
+ document writer (SendMessage while it lives); rehearse again and show the new
136
+ batch, saying what changed. Only once they ask for posting:
137
+
138
+ ```bash
139
+ python3 $AO/ship.py post $WORK all --approved --digest <digest> [--branch DOC=NAME …] [--other-owner]
140
+ ```
141
+
142
+ The digest covers the winner, every document's inputs and the answers that
143
+ name what is pushed (`after.branch_prefix`, `after.pr_remote`, `after.pr_head_owner`, and
144
+ `--branch optimization=NAME` or `tests=NAME`, a PR branch named by hand,
145
+ given to `rehearse` and then to `post` the same). It
146
+ refuses a digest other than the last rehearsal's, a rehearsal with problems,
147
+ and inputs changed since. It posts in a fixed order, the bug report, the
148
+ unit-test PR, then the optimization PR, rendering each again first so it
149
+ holds the numbers of the ones before it. `--other-owner` is given only once
150
+ the user has confirmed a repository another account owns (an upstream
151
+ project; the bug report always opens there). When a post stops, fix the
152
+ cause and run the same command: what was posted is skipped.
153
+
154
+ ### What holds the search closed
155
+
156
+ Each posted document holds the search's `end --reopen` (a hold in
157
+ `reopen-lock.json`), and so do `apply --yes` and `branch --yes`. A change to a
158
+ shipped winner is an iteration made with `--after-end`
159
+ (`references/step4-final.md`, *An iteration made after the end*); once it is
160
+ the winner, the ship stage reads `running` again until it is applied or
161
+ branched too.
162
+
163
+ ### From a fork
164
+
165
+ When `ship.py plan` says `gh` cannot push to the repository, the PRs come
166
+ from the user's fork. Ask for it (create it with `gh repo fork OWNER/REPO
167
+ --clone=false` on their yes), then record it once:
168
+
169
+ ```bash
170
+ python3 $AO/autoopt.py config $WORK --set after.pr_remote=<remote name or URL> --set after.pr_head_owner=<their account> --reason "<their words>"
171
+ ```
172
+
173
+ Record the fork's URL rather than a remote name: `gh repo fork
174
+ --clone=false` adds no remote, and a name added to one clone is unknown to
175
+ the others. Branches are pushed to the fork and the PRs open on the original
176
+ with head `OWNER:BRANCH`. The bug report opens on the original either way.
177
+
178
+ ### Separate from the unit tests
179
+
180
+ With a suite from step 1, the search's code is the original plus the suite.
181
+ The optimization PR (and a local branch) holds only the optimization: each
182
+ kept change is applied to the original's commit, a kept change that touches
183
+ a file the suite adds is refused, and the commits' change must equal the
184
+ measured change outside the suite's files. Both PRs open on the original's
185
+ branch and merge in either order; the optimization PR says it was measured
186
+ with the tests in place.
187
+
188
+ ### When the branch moved
189
+
190
+ The commits sit on the commit the search copied. When the target branch has
191
+ moved since, the preview says how far; GitHub reports any conflict. Do not
192
+ rebase before posting: the rebased code was never measured. Tell the user,
193
+ who may rebase the open PR themselves and run the repository's tests and
194
+ benchmark on the result.
195
+
196
+ ## Refusals
197
+
198
+ | Refusal | Do |
199
+ |---|---|
200
+ | `has not ended` | step 4 first |
201
+ | `is gate-failed …`, `something was committed after the measurement`, `uncommitted changes that were never measured` | ship the winner (`--id best`); a change made after the measurement is measured as an iteration made with `--after-end` |
202
+ | `changed since the search copied it` (apply) | ask the user: their edit stays, and the change is applied by hand (`git -C $WORK/autooptimize/repo.git diff autoopt/0 autoopt/<id>` prints it). Once they say each file holds it, `apply --by-hand` previews the files as applied by hand and `apply --by-hand --yes` records them, writing nothing |
203
+ | `exists already, and the change adds it` (apply) | show the user the file; the change is applied by hand as above |
204
+ | `is missing; the search copied it from there` (apply) | show the user where the file was; they restore it, or apply the change elsewhere and pass `--to DIR` |
205
+ | `is new, and the copied files came from more than one folder` (apply) | ask the user which folder the new file belongs in: `--to DIR` |
206
+ | `the change touches none of the copied files` (apply) | the winner changed only files the search wrote itself (the benchmark); tell the user there is nothing to ship |
207
+ | `after.ship is …: the original files are written only on the user's choice` (apply), `… a branch is made in the original repository only on the user's choice` (branch) | ask with `ship.py plan` and record the route (`config --set after.ship=…`) |
208
+ | `this is a repository search`, `this search was made with init --copy` | the route does not fit the mode: ask again with `ship.py plan` |
209
+ | `the user has not said whether the branch names start with auto-optimize/` | ask the third question of `ship.py plan` and record `after.branch_prefix`; a branch name the user gave (`--name`) needs no answer |
210
+ | `holds the tables of …, not of …` (optimization PR) | the winner changed since the tables were written (an iteration made with `--after-end`): run `opt_pr_tables.py` again and have the writer render the body again |
211
+ | `after.ship is …: the GitHub documents are for a user who chose them`, `after.ship_documents names no document`, `after.ship_documents names …, which this search does not offer` | ask with `ship.py plan` and record the answers |
212
+ | `is not on <owner/repo>/<branch>, so the PR would carry commits nobody measured. Push … first` | the user pushes their branch; the search never writes to it |
213
+ | `is not <login>'s own account` | show the user the repository, then `--other-owner` |
214
+ | `already has a branch <name>: pass --name` (local branch) | `--name` with a name that is not taken |
215
+ | `branch … already exists on <owner/repo>; nothing was pushed` (a PR) | another name: `rehearse --branch optimization=NAME` (or `tests=NAME`), show the user, then `post` with the same flag. A branch that already holds this PR's commits is opened, not refused, so a post that stopped after its push runs again cleanly |
216
+ | `--branch takes optimization=NAME or tests=NAME`; `--branch … is not what the rehearsal the user reviewed pushed` | give `post` the `--branch` flags the rehearsal had, or rehearse again with the new ones |
217
+ | `no rehearsal`, `is not the last rehearsal's`, `the last rehearsal had problems` | `ship.py rehearse`, then show the user the batch it rendered and use its digest |
218
+ | `the documents' inputs changed since the rehearsal the user reviewed` (their files, or the branch and fork answers), `the chosen documents changed since the rehearsal` | rehearse again and show the user the new batch |
219
+ | `was not posted; fix the cause and run the same command` | fix what the line above it names, then the same `post`: what was posted is skipped |
220
+ | a document's own refusal | its reference: `references/pr-optimization.md`, *When it refuses*; for the others, the renderer's list of problems on stderr |
@@ -0,0 +1,67 @@
1
+ # Step 6 — finishing a search
2
+
3
+ Step 6 follows shipping (`references/step5-ship.md`), whatever the user chose
4
+ there, "not now" included. Section 3 waits while another tool still works in
5
+ the search directory.
6
+
7
+ ## 1. Copy the winner out
8
+
9
+ The winner is what `--id best` names: `ended.json`'s, which an iteration made
10
+ with `--after-end` and promoted replaces. It is the code on its branch. Copy
11
+ the change and the code to `$WORK/finish/archive/` (or outside `$WORK`, when
12
+ the user wants it there), because section 3 deletes most of what is in
13
+ `autooptimize/`. This is the copy kept with the search, whether or not step 5
14
+ shipped the change:
15
+
16
+ ```bash
17
+ python3 $AO/autoopt.py archive $WORK # --id <it> for another iteration; --dest DIR outside $WORK; --force to write over an archive, and over the report, filled prose included
18
+ ```
19
+
20
+ It writes `idea.patch`, `code/`, the README and `result.json`, and the report's skeleton (section 2) with *What was optimized*, *The path* and *Where things are* filled in, the two medians in *Result*, and `<<FILL: …>>` marks left. Run it after step 5, so *Where things are* lists what step 5 did; run before, it leaves a mark there.
21
+
22
+ Quote the iteration's median, never the single run in `best_run`.
23
+
24
+ ## 2. Write the final report
25
+
26
+ `$WORK/finish/final-report.md`, outside `autooptimize/`, self-contained.
27
+ `archive` wrote the skeleton: headings *What was optimized*, *Result*, *The path*, *What produced the gains*, *What was tried and failed*, *Compute*, *Where things are*, in that order.
28
+
29
+ | Heading | Holds |
30
+ |---|---|
31
+ | *What was optimized* | written by `archive` |
32
+ | *Result* | `archive` writes the two medians; add the baseline's and the winner's median with the spread across seeds on both, and the change in the objective's units; `final.json`'s verdict beside them, labeled "paired", when the search has a timing probe |
33
+ | *The path* | written by `archive` from `path --markdown` |
34
+ | *What produced the gains* | the gain by category, and one line per iteration on the path; the category breakdown goes in `$WORK/finish/speedup-breakdown/` |
35
+ | *What was tried and failed* | the closed ideas worth knowing, from `ideas.md` and the ledger's `[closed]` entries |
36
+ | *Compute* | iterations, runs, wall clock, and GPU or CPU hours; the dashboard's sidebar has throughput and per-category numbers |
37
+ | *Where things are* | written by `archive`: the copied code and patch, the search directory, and what step 5 did, from its records: the files it wrote (`ship/applied.json`), the branch it made (`ship/branch.json`), the URL of each document it posted |
38
+
39
+ Fill every `<<FILL: …>>` mark: `stages.py` reads the finish stage as
40
+ `running` while one is left. `rounds/*.md` and the READMEs of the winning iterations (`autoopt.py path
41
+ $WORK --id best`) are the material.
42
+
43
+ ## 3. Reclaim the disk
44
+
45
+ `autoopt.py end` already did the automatic clean-up, and `references/step4-final.md`, *The clean-up*, lists what goes and what stays. What is left is what `--all` prunes once the winner is copied out:
46
+
47
+ ```bash
48
+ python3 $AO/autoopt.py prune $WORK --all --worktrees # report only
49
+ ```
50
+
51
+ Show the user the report (what goes, the disk it frees, how many checkouts go). Run it again with `--apply` only after they agree; there is no undo. The report and the apply MUST carry the same flags: without `--worktrees` the report omits the checkouts the apply removes.
52
+
53
+ Without `--all`, the frontier path, every root, anything running and the 20 most recent (`--keep-recent N`) are protected; with it only a running iteration is spared. Each run keeps `metrics.json`, `log.txt` and `commit`; its artifacts, the iteration's `cache/` and the trees under `check/` go. `--worktrees` also removes the checkouts and carries the record (`meta.json`, `result.json`, `README.md`, `notes.md`, kept run files) out and back, so `status` and the dashboard still show every iteration; `restore --id A7` brings a checkout back. The branch still holds a pruned iteration's code. `prune` touches only `autooptimize/`.
54
+
55
+ **Saved output arrays are deleted from every settled iteration, protected ones included**: the files ending in `--outputs-ext` (default `.npy,.npz`; add `.h5` or `.parquet` for a benchmark that saves those), except:
56
+
57
+ | Kept | Why |
58
+ |---|---|
59
+ | a file git tracks in a plain-mode iteration, and anything in a repository-mode `src/` | code or test data |
60
+ | a running iteration's files | a subagent is writing them |
61
+ | `autooptimize/reference/` | the gates compare every run against it |
62
+
63
+ `--keep-outputs` keeps them all.
64
+
65
+ Stop the dashboard publisher last, naming the search: `python3 $AO/dashboard/autoopt_monitor.py $WORK/autooptimize --stop`. `$WORK/scratch/` holds anything disposable: remove it, with the user's yes, once the winner is copied out.
66
+
67
+ `repo.git/` plus the records reproduce any iteration (`restore --id N`, then `run_iteration.py`); the saved outputs and checkouts that are gone regenerate from them.