You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(skills/bounding-heavy-commands): record a measured row per --cpus for each self-bounded command - #62
Agents measured heavy commands without bounding them first, so the record held budgets for commands that nothing limited: the same test suite got a budget of 10752M from a plain run where the bounded run needed 6656M. Discovery now makes the command bound its own parallelism before it is measured, and each record entry holds a required self-bound field and a table with one measured row per --cpus value. A measurement at a new --cpus adds a row instead of replacing the entry, and a row at a smaller --cpus becomes the correct way to make a run start sooner.
Changes
Discovery: bounding the command is a gate before any measurement. The first measurement is at half the machine's processors.
The record entry has a required self-bound field (none: <why> when the tool has no setting) and a table of rows (--cpus, budget, peak, date, default). An entry without self-bound is incomplete and gets discovery again. An entry of the older shape is complete only when its command line passes --cpus and reads BOUNDED_RUN_CPUS; it is then rewritten into the new shape.
One row per --cpus. A new --cpus adds a row, and the same --cpus replaces its row. Two entries whose command lines differ only in --memory and --cpus merge into one entry with the rows of both, and a new default row does not make the rows of an entry invalid.
To start sooner, use a row at a smaller --cpus: that is a smaller measured command, not a lower budget. This applies only to a command whose self-bound reads BOUNDED_RUN_CPUS, and the smaller row starts sooner only when its budget needs fewer slots. With no smaller row, the run stays queued, and the smaller row is measured for next time with its own --cpus and the --memory of the smallest row, so the measurement does not take the whole queue.
Dispatch prompts carry the chosen row's --cpus and budget. Three new red-flag rows cover measuring the plain command, replacing a row of another --cpus, and treating a smaller row as a lower budget.
A RED and GREEN check with fresh agents that read only the skill. In the baseline, an agent picked --cpus 16 by itself and, when merging with another session's entry at --cpus 8, kept one entry and dropped the other. A second agent, asked to make a run start sooner, refused to use a smaller --cpus and threw away a finished measurement at --cpus 4. With the change, the first agent bounded the command, measured at half the processors, and merged the entries into one table with both rows. The second kept the run queued, measured the smaller row with --memory of the existing row, and added it without changing the default row. The skill text was also checked for hard wraps and for product names.
Review round on a1840b8 (review 5360217072). No suppressed findings.
Use row-independent fields for merge identity (and line 79): applied in 66cfd45.
Pass the computed CPU quota to follow-up measurements: applied in 66cfd45.
Require self-bound completeness before migration: applied in 66cfd45 as a narrower exception (BOUNDED_RUN_CPUS required). See the thread.
Comment gate (comment_growth.py): the recorded review base left the history in the rebase after the #58 fix, so the gate compared with the parent branch. The self-evaluated fallback applies: this session could not dispatch an agent. This round added, changed, or removed no code comment, so there is no flag of this round. The only flag on #64 is the module usage text, which the PR grew before the review to document --check. That is text that users read, and it stays as it is.
Review round on 6f2211e (review 5360589840). No suppressed findings.
Scope ignored options to wrapper arguments before --: applied in ccb9cbf.
Reserve the full queue for unmeasured CPU rows: partly applied in ccb9cbf. The false guarantee is gone, and the whole-queue measurement is declined. See the thread.
Comment gate: no code comment changed on this layer.
Synchronize command with merged default measurement
skills/bounding-heavy-commands/SKILL.md:71
When the other entry has a newer measurement at the kept entry's default --cpus, keep the newer one changes that row's budget but leaves the kept command field with its old --memory. The merged entry then immediately fails the completeness rule on line 73. After merging, synchronize the command line with the resulting default row.
Review round on ccb9cbf (review 5360615074). The review has no inline findings.
Previously missed, on SKILL.md:71, "Synchronize command with merged default measurement" (no thread): applied in 1f84f8a. After the merge, the rule now says: "Then write the --cpus and the budget of the default row into the command line."
Comment gate: no code comment changed on this layer.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
The legacy migration can mistake a payload --cpus argument for the wrapper’s CPU setting.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Restrict migration exception to wrapper --cpus option
skills/bounding-heavy-commands/SKILL.md:73
Scope the migration exception to the wrapper option before the -- delimiter. Payload options are allowed after the delimiter (scripts/tests/test_bounded_run.py:1241-1245), so an old line can currently contain a payload --cpus and read BOUNDED_RUN_CPUS while the wrapper itself has no CPU value; in that case the variable falls back to the machine CPU count and there is no recorded --cpus for the default row. Require --cpus <n> in the wrapper options explicitly.
Review round on 1f84f8a (review 5360649839). The review has no inline findings.
Previously missed, on SKILL.md:73, "Restrict migration exception to wrapper --cpus option" (no thread): applied in 7892ccf. The rule now reads "its command line passes --cpus to the wrapper, before the --, and reads BOUNDED_RUN_CPUS".
Comment gate: no code comment changed on this layer.
… measured, and keep a row per --cpus
Agents skipped the step that makes a recorded command bound its own parallelism. It was one of six discovery steps, nothing blocked a measurement until it was done, and an entry without a self-bound looked complete. So a session could measure the plain command, record the peak of a command that nothing limits, and later runs waited for twice the slots they needed. Baseline runs also showed that an agent picked the first --cpus by itself, kept only one of two entries measured at different --cpus, and refused a smaller --cpus as if it were a lowered budget, which threw away a finished measurement.
Discovery now bounds the command first, as a gate, and measures the bounded line at --cpus of half the machine's processors. Each record entry has a required self-bound field and a table with one row per --cpus: a new --cpus adds a row, the same --cpus replaces its row, and one row is the default. A row at a smaller --cpus is the way to start sooner. When none exists, the run stays queued and the smaller row is measured under the budget of the smallest row for next time.
Closes#53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…out the row values, and pass --cpus to a smaller row
The command line of an entry carries the --memory and --cpus of its default row. So two entries of one command with different default rows did not merge, and a change of the default row read as a new command whose rows must be deleted. Both rules now ignore those two values. The measurement of a smaller row now names its --cpus and --memory in place of the values of the command line; before, it named only --memory, and the run used the --cpus of the default row. An entry of the older shape is complete only when its command line reads BOUNDED_RUN_CPUS, because a memory setting alone can be one that covers a single process, which discovery does not accept as a bound.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntry keeps
Two entries of one command can each have a default row, and the merge rule kept the rows of both without saying which default stays. The merged entry now keeps the default row of the entry that the agent keeps, at its --cpus, and marks no other row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oner only when the command reads it
A smaller --cpus makes a smaller command only when the self-bound of the entry reads BOUNDED_RUN_CPUS. For a command with self-bound none, or with a memory setting only, the smaller row measured the same command and did not start sooner. The skill now keeps such a run in the queue and measures no smaller row for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oner only when it needs fewer slots
The queue counts a budget in whole slots, so a smaller row whose budget needs as many slots as the default row waits as long. The skill said that a smaller row always gets a slot sooner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ches the command line in a complete entry
A complete entry needed only a self-bound and a row, but case 2 runs the default row of the entry. An entry with no default row, or with two, had no row to run, and one whose default row did not match its command line had two values for one run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the wrapper, and do not promise a bound for a smaller row
The merge rule and the change rule ignored every --memory and --cpus of the command line, also those of the command after the '--', which can be real options of the tool. They now name the wrapper's two values only. The skill also said that a smaller row never needs more than the budget of the smallest row. A command can keep more state when it does its work in sequence, so the text now says "seldom" and points to the rule for a measurement that the hard cap stops.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ommand line after a merge
A merge keeps the newer row at each --cpus, so the default row can get the budget of the other entry while the command line keeps the old --memory. The entry was then incomplete by its own rule. The merge now ends by writing the values of the default row into the command line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from the wrapper options only
An old command line can hold a --cpus of the tool after the '--'. The migration rule counted it, but the wrapper then had no --cpus, BOUNDED_RUN_CPUS was the processor count of the machine, and the default row had no --cpus to record. The rule now needs --cpus in the wrapper options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #53
Agents measured heavy commands without bounding them first, so the record held budgets for commands that nothing limited: the same test suite got a budget of 10752M from a plain run where the bounded run needed 6656M. Discovery now makes the command bound its own parallelism before it is measured, and each record entry holds a required
self-boundfield and a table with one measured row per--cpusvalue. A measurement at a new--cpusadds a row instead of replacing the entry, and a row at a smaller--cpusbecomes the correct way to make a run start sooner.Changes
self-boundfield (none: <why>when the tool has no setting) and a table of rows (--cpus, budget, peak, date, default). An entry withoutself-boundis incomplete and gets discovery again. An entry of the older shape is complete only when its command line passes--cpusand readsBOUNDED_RUN_CPUS; it is then rewritten into the new shape.--cpus. A new--cpusadds a row, and the same--cpusreplaces its row. Two entries whose command lines differ only in--memoryand--cpusmerge into one entry with the rows of both, and a new default row does not make the rows of an entry invalid.--cpus: that is a smaller measured command, not a lower budget. This applies only to a command whose self-bound readsBOUNDED_RUN_CPUS, and the smaller row starts sooner only when its budget needs fewer slots. With no smaller row, the run stays queued, and the smaller row is measured for next time with its own--cpusand the--memoryof the smallest row, so the measurement does not take the whole queue.--cpusand budget. Three new red-flag rows cover measuring the plain command, replacing a row of another--cpus, and treating a smaller row as a lower budget.Related
--cpusvalues. feat(skills/bounding-heavy-commands): let agents see the queue to choose a row and name what holds it #64 (Let an agent see the queue before it chooses which measured row of a command to run #57): chooses a row from the state of the queue.Testing
A RED and GREEN check with fresh agents that read only the skill. In the baseline, an agent picked
--cpus 16by itself and, when merging with another session's entry at--cpus 8, kept one entry and dropped the other. A second agent, asked to make a run start sooner, refused to use a smaller--cpusand threw away a finished measurement at--cpus 4. With the change, the first agent bounded the command, measured at half the processors, and merged the entries into one table with both rows. The second kept the run queued, measured the smaller row with--memoryof the existing row, and added it without changing the default row. The skill text was also checked for hard wraps and for product names.🤖 Generated with Claude Code