IB-WP-0016-T03: scale-aware planning

Replace generate plan's full-prompt dump with a compact summary that
reports selected-chunk counts, selected chapter numbers, per-workflow
call counts, prompt-word and token estimates, and a rough USD cost when
--cost-per-1k is supplied. Selection filters --chapter (label or number,
repeatable), --from-chapter / --to-chapter (numeric range), and --chunk
(repeatable id) shape the estimate. Budget caps --max-calls and
--cost-cap are reported as exceeds_* booleans so callers can fail fast
before run.

The old full per-workflow plan with prompts remains available behind
--full so deep inspection is opt-in instead of the default.

Whole-Lefevre estimate at default max_words=800: 146 chunks, 730 calls,
~518k prompt tokens, ~$155 at $0.30/1k. Chapters 3-5 only: 19 chunks,
95 calls, ~64k tokens. 87 tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 18:18:09 +02:00
parent f8289699e7
commit 13f9c1895c
6 changed files with 434 additions and 9 deletions

View File

@@ -48,6 +48,34 @@ infospace-bench generate status ./infospaces/book-space
shows chunk counts, generated artifact counts, evaluations, metrics, history,
and stale source/profile inputs.
### Scale-aware plan
`generate plan` returns a compact estimate by default — counts of selected
chunks, calls per workflow, prompt-word and token estimates, and a rough
USD cost when `--cost-per-1k` is supplied. Long corpora no longer dump
hundreds of full prompts unless `--full` is set.
```bash
infospace-bench generate plan ./infospaces/book-space \
--from-chapter 1 --to-chapter 3 \
--cost-per-1k 0.30 \
--max-calls 50 \
--cost-cap 2.00
```
Selection filters:
- `--chapter LABEL` (repeatable) — match a chapter by roman/arabic label
or numeric value (e.g. `--chapter I` or `--chapter 2`)
- `--from-chapter N` / `--to-chapter N` — numeric chapter range
- `--chunk ID` (repeatable) — exact source chunk id (e.g.
`chapter-01-part-002`)
Budget flags `--max-calls` and `--cost-cap` are reported as
`exceeds_max_calls` / `exceeds_cost_cap` booleans in the summary, so a
caller can fail fast before invoking `run`. Use `--full` to opt back into
the full per-workflow plan with prompts for deep inspection.
## OpenRouter
Live model calls are explicit: