diff options
| author | Morgan Lunt <morganl@anthropic.com> | 2026-09-23 19:52:43 -0700 |
|---|---|---|
| committer | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 17:50:21 -0700 |
| commit | d13ff0324cf9a8744be6c75251689816485e68cf (patch) | |
| tree | 58a48e211c22e1078ba9e76d9beacfdf59d4fe7a /plugins/code-modernization/commands | |
| parent | 6f020b9f66a1340efeab2fd4ca7a17f348e3fea9 (diff) | |
code-modernization: extract-rules asks before a large run, with an estimate
The command told the model to state the shard count and an estimate
before launching, but in live runs on a small system it launched
without saying anything: a reply that only mentions the estimate is
easy to skip and is not a gate.
With more than 12 shards the command now requires an AskUserQuestion
that carries the shard count, the line count and the estimate (agents,
tokens, minutes) and offers to run all shards, run only a slice, or
cancel. With 12 shards or fewer it launches straight away and says
what it launched.
The estimate is now a working formula (10 to 15 agents per shard, about
16k tokens per agent, about 8 agents finishing per minute) with the two
runs it comes from: 4 shards used 58 agents in under 10 minutes, and a
44-program, 30,000-line estate used 466 to 647 agents.
Diffstat (limited to 'plugins/code-modernization/commands')
| -rw-r--r-- | plugins/code-modernization/commands/modernize-extract-rules.md | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/code-modernization/commands/modernize-extract-rules.md b/plugins/code-modernization/commands/modernize-extract-rules.md index 6efcdf40..2b355d4f 100644 --- a/plugins/code-modernization/commands/modernize-extract-rules.md +++ b/plugins/code-modernization/commands/modernize-extract-rules.md @@ -107,13 +107,22 @@ ask whether to run it first or proceed now. If proceeding: ### 2. Estimate, ask if the run is large, then launch -Before launching, tell the user the shard count and what it implies: roughly -**one extractor agent per shard, then one citation referee per candidate -rule** (usually the dominant term — a few per shard), two judges per P0 rule, -and one data-object cataloger, queued against the runtime's concurrency cap. -A 60-shard estate that yields 300 candidate rules with 40 P0s is on the order -of 450 agents; a tiny system in lens mode is 15–40. Observed on a 44-program, -30,000-line system: 466 to 647 agents, about 8.8M tokens, 50 to 80 minutes. +**Estimate** the run before launching: 10 to 15 agents per shard, about 16k +tokens per agent, about 8 agents finishing per minute. For calibration, 4 +shards (five programs, about 1,600 lines) used 58 agents in under 10 +minutes; a 44-program, 30,000-line estate used 466 to 647 agents, about 8.8M +tokens and 50 to 80 minutes; a tiny system in lens mode is 15 to 40 agents. + +**With more than 12 shards, ask before launching, with the AskUserQuestion +tool** (a reply that only mentions the estimate is easy to miss and is not a +gate). Put the shard count, the line count and the estimate (agents, tokens, +minutes) in the question, and offer "Run all N shards", "Only a slice (say +which, as a module pattern)" and "Cancel". Launch only after the answer: on +"Run all N shards", launch; on a slice, rebuild the shard list with that +pattern (step 1; module mode ignores `modulePattern`) and launch that; on +"Cancel", stop. With 12 shards or fewer, launch straight away, and say in +your reply how many shards you launched and the rough estimate. + One workflow run is capped at 1000 agents by the runtime; the script stops scheduling shards before it gets there (they come back in `stats.skippedModules`), so for a list beyond about 70 shards (10 to 15 agents |
