Repository navigation
Commit e887319
feat(skills/bounding-heavy-commands): measure every heavy command of a project in one run before agents need them (#63)
* feat(skills/bounding-heavy-commands): measure every heavy command of a project in one run that the user starts
A project with no record got its measurements one command at a time, when an agent first needed each command. An agent asked to fix a bug and run the unit tests measured only the unit tests, at a --cpus that it picked, asked the user nothing, and left the other heavy commands without an entry. Each of those later first measurements holds the whole queue in the middle of someone's work, and the rows of the record come out at whichever --cpus each session picked.
When the record does not exist, discovery now covers every heavy command of the project. The agent writes one command line that measures each command at all, half, and a quarter of the machine's processors, and asks the user to run it when the machine is quiet, or to tell the agent to run it. It then reads the row lines into the record, and writes a row only from a run that did its full work. If the user declines, the agent measures the command that it needs, as before. A command that the project adds later is still measured when an agent first needs it.
The wrapper gets two options for this. --measure-rows N,N,... measures the command at each --cpus of the list, the largest first, and gives each smaller row the suggested budget of the row before it as its --memory, so that only the first row of a command holds the whole queue. --label names the command in a new fixed-form row line that each measurement prints, so that the agent reads the output without guessing.
Closes #56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): reject a --measure-rows value that is not ASCII digits
str.isdigit() accepts characters such as a superscript two, which int() cannot read, so such a value ended the wrapper with a traceback in place of its option error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): show --memory for --measure-rows, and measure the rows that step 1 chose
The skill said that the largest row of --measure-rows runs with no --memory, but the wrapper takes a --memory for it, as its usage text shows. The whole-project line also told each command to use all, half, and a quarter of the processors, while step 1 gives a command with self-bound none the row at half only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): keep the first failed exit code when a stop signal ends the rows
The usage text and the skill say that the exit code of --measure-rows is the first exit code of a row that is not 0. When a row failed and a later row was stopped by a signal, the wrapper returned the code of the stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): give each command of the line its own label, and ask for output from a terminal
Step 5 puts each row line into the entry of its label, so two commands with one label made their rows ambiguous. And when the user runs the line in a terminal, the agent cannot see its output, so it now asks the user for the row lines and the end of the output of each command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): reject a --measure-rows value with too many digits for int()
int() refuses a number with more digits than its limit and raises ValueError, which ended the wrapper with a traceback in place of its option error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(skills/bounding-heavy-commands): show the row line of the usage text as the wrapper prints it
The usage text wrote each size field as MIBM, which reads as a literal value. The wrapper prints a number followed by M, as the skill shows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): reject a --label that ends with a line break
The check used re.match with $, which also matches before a final line break, so a label such as "lint" with a line break passed and split the row line in two. It now uses re.fullmatch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(skills/bounding-heavy-commands): say that a --label starts with a letter or a digit
The wrapper rejects a label that starts with '.', '_' or '-', and the option table did not say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): limit each --measure-rows value to six digits
The last fix relied on int() refusing a number with too many digits, but Python 3.9 has no such limit, so the new test failed there. Each value now has at most six digits, which the parser checks itself on every version, and the option error names the range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): keep the first failed exit code when an interrupt ends the wait of a later row
A signal while a row runs comes back as that row's exit code, but a signal while a row waits in the queue raises KeyboardInterrupt. That went past the rows loop to main(), which returned 130 and lost the failure of an earlier row. The loop now catches it and returns the first failed code, or 130.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): measure a command that reuses its own output at one row only
--measure-rows runs a command once for each row, one after the other. A build, a generator, or an install reuses the output of the run before, so its smaller rows did less work and recorded a peak that was too small. Such a command now gets the row at half only, like a command with self-bound none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): keep the first failed exit code for each stop signal between the rows
The last fix covered SIGINT only. SIGTERM, SIGHUP, or SIGQUIT while a later row waited in the queue still ended the wrapper with the default action of the signal, and the failure of an earlier row was lost. --measure-rows now handles the three signals for the whole list and returns the first failed code, or 128 plus the signal. The handlers of the caller come back when the list ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(skills/bounding-heavy-commands): catch a stop signal anywhere in the list of rows
The handlers of --measure-rows raise at any point of the list, but the rows loop caught the signal only while a row waited, and main() caught SIGINT only. A SIGTERM, SIGHUP, or SIGQUIT between two rows, or after the list before the handlers were put back, ended the wrapper with a traceback. The loop now catches it for the whole list and keeps the first failed code, and main() catches it after the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent da90c20 commit e887319
3 files changed
Lines changed: 297 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| |||
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
81 | | - | |
| 92 | + | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
| |||
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
91 | | - | |
| 102 | + | |
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
| |||
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
112 | 143 | | |
113 | 144 | | |
114 | 145 | | |
| |||
176 | 207 | | |
177 | 208 | | |
178 | 209 | | |
| 210 | + | |
| 211 | + | |
179 | 212 | | |
180 | 213 | | |
181 | 214 | | |
0 commit comments