Subtractive scratchpad · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/0d4c2f0e-3eb8-4a2d-b32c-db1c84bb01c5.md

#1 [high] Blocking: the flag re-implements runtime --kv-cache-limit, and the stated memory payoff comes from the runtime flag

PR 533 adds --request-context N on export/debug-serve/bench, threaded derive()→plan()→fit()→Plan.context_target, plus Plan.prepared_context, used only by ignition/preparation/bootstrap.py:58.

What already exists:

Only delta the flag adds over --kv-cache-limit: it lowers the exported max_sequence_tokens so a single request longer than N is rejected. That is one datum (ignition/preparation/bootstrap.py:58 "context": plan.prepared_context → BasePreparationConfig.context, bootstrap.py:33) and is the entire payload of the PR.

Cost of the present shape (diff +35/−15):

Charter/AGENTS hooks: AGENTS.md:165-169 "Every contribution must address ... a demonstrated defect, a measured performance or memory problem"; charter "Look for the smallest footprint in shared code, or a way to solve it without new code at all."

#2 [high] Should fix: prepared_context duplicates Plan.context; smaller version is one line

ignition/planning.py:368-373 (new):

@property
def prepared_context(self) -> int:
    """The context the prepared core serves per request; the recipe max when no target is set."""
    if self.context_target is None:
        return self.recipe.context
    return min(self.recipe.context, self.context_target, self.tokens)

Plan.context (planning.py:363-366) is min(self.recipe.context, self.tokens). So min(recipe.context, N, tokens) == min(self.context, N) exactly. Smaller version (2 lines saved):

@property
def prepared_context(self) -> int:
    """The context the prepared core serves per request."""
    return self.context if self.context_target is None else min(self.context, self.context_target)

And the call site at planning.py:694 effective_context = min(result.context, result.prepared_context) is then redundant: with no target it is result.context, with a target it is already ≤ result.context. It can read effective_context = result.prepared_context if result.context_target is not None else result.context (same length, so no direct saving) — but with the shortened property the whole second property could be dropped and the two users (bootstrap.py:58 and planning.py:694) could read min(result.context, result.context_target or result.context); net ~4 lines.

#6 [high] Research summary

Reviewed PR #533 ("Cap the per-request context target", +35/−15 across 7 files) through the subtraction lens, against AGENTS.md, docs/design-review.md, the charter, and the maintainer's earlier review of the same change in closed PR #454.

Findings, ranked by lines saved:

  1. Blocking (~15 of the 35 added lines, plus the doc prose). The flag is a re-implementation of a runtime setting the PR's own evidence is measured with. flare run --kv-cache-limit concurrency|context|memory (docs/cli-design.md:738, :828-833; docs/model-preparation.md:396-402; page_ceiling, helios/src/runtime_core/memory.rs:284-331) already bounds the shared KV pool to one prepared context per active request, at core load, without re-export. The description's table is explicitly produced with --kv-cache-limit concurrency, so the measured pool = concurrency × prepared-context VRAM scaling is the pre-existing flag's documented behaviour. The one genuine delta is a lower exported max_sequence_tokens, i.e. one datum reaching one consumer (ignition/preparation/bootstrap.py:58). Maintainer yatesdr asked in #454 for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve"; this resubmission keeps the same shape and the same memory argument.

  2. Should fix (~6 lines). ignition/planning.py:692-701 turns the stock 3-line --prefill-chunk-size check into a 9-line branch with two messages; the generic message already names both numbers, so one message carrying the effective context replaces it. No test asserts either new string.

  3. Should fix (~4 lines). Plan.prepared_context (planning.py:368-373) duplicates Plan.context: min(recipe.context, N, tokens) is exactly min(self.context, N), so the five-line body collapses to two, and the extra min(...) at planning.py:694 disappears.

  4. Should fix (~2 doc lines + half of one row). docs/cli-design.md:446 repeats what the PR's own other two doc edits (:1443, :1493) already state, and repeats the runtime KV-limit semantics; it also advertises a "memory-constrained multi-model deployment", which AGENTS.md:171-175 lists as unapproved scope.

  5. Nit (~2 lines). derive()'s new context parameter (ignition/cli/preparation.py:56, :68) is a pure pass-through — all three callers pass the flag or nothing. Separately, Plan.to_dict() never records the new setting, so the printed plan and bench configuration cannot show what was prepared (AGENTS.md:452-456), and no test covers any of the new behaviour.

Smallest version: a single Plan field, one plan()/fit() keyword, one line in bootstrap.py and one docs row — roughly 15 of the 35 added lines removable, and the VM point that the flag's memory argument is already served by --kv-cache-limit.

#9 [high] Should fix: the new test block repeats its own assertions and the manifest helper's generic behaviour (~13 of +57 lines)

tests/cli/test_planning.py:211-265 is the new test (57 added lines, the largest single hunk in the PR: pr_files shows tests/cli/test_planning.py +57/-0). Candidates that prove nothing new:

  1. Clamp case duplicates the valid case. :224-227 asserts capped.prepared_context == min(recipe.context, 131072, capped.tokens); :230-232 asserts the same expression for 500000. With the property collapsed to min(self.context, self.context_target) there is no separate branch, so one case suffices. ~4 lines.

  2. context=0 and context=-1 hit one branch. planning.py:461-462 validates context <= 0 in a single check; two pytest.raises blocks (:235-238) exercise the same line. ~2 lines.

  3. d["context"] == capped.context (:247) restates :227. ~1 line.

  4. The "no context_target when unset" block (:259-265, 7 lines) re-proves from_plan's generic skip. rebuild_manifest.py:350-352 add() returns early on value is None for every parameter; the generic behaviour is already covered by the sibling tests' decode loop (tests/cli/test_planning.py:92-106). Also reproduction_arguments gating is the same is not None pattern used by every other flag (:266-319). ~6 lines.

  5. Wrong field asserted. :257 asserts by_key["context_target"].value.int64_value == 131072, but _preparation_value (rebuild_manifest.py:332-333) emits {'uint_value': value} for any non-negative int, so the oneof sets uint_value and int64_value reads 0. As written the assertion fails; the sibling pattern to copy is tests/preparation/test_native_publication.py:78 (uint_value=1). One line, wrong direction (a fix, not a deletion) — but it shows this block was not run.

Net: ~13 of the 57 added test lines carry no distinct behaviour. The test's own header comment (:212) and section comments (:217, :223, :229, :234, :240, :244, :249, :259) restate the assertions below them — another ~8 lines if the blocks are merged.

#11 [high] Report (updated, run at head de1b5b5) — verdict: make it smaller first; ~45 of 98 added lines removable

PR 533, head de1b5b5, base main: 9 files, +98/−18 (pr_files). That splits as +41/−18 in code and docs and +57/−0 in tests — superseding the "+35/−15 across 7 files" figure of entry #8.

Ranked findings (all previously recorded, plus the new test finding #9):

  1. Blocking (~28 lines) — the flag re-implements runtime --kv-cache-limit. Drop --request-context, Plan.context_target, the context= keyword on plan()/fit()/derive(), the <= 0 check, prepared_context and the chunk-branch rewrite; only ignition/preparation/bootstrap.py:58 survives as a no-op change. Evidence: the PR's own table is measured with --kv-cache-limit concurrency (docs/cli-design.md:738, :828-833; page_ceiling helios/src/runtime_core/memory.rs:284-331), and #454's maintainer asked for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve". (entry #1, wiring inventory in #10)
  2. Should fix (~13 lines) — tests/cli/test_planning.py:211-265 (+57) repeats itself: duplicate clamp case, duplicate 0/-1 rejections, a re-proved generic add()-skips-None path, plus one assertion on int64_value that cannot pass. (entry #9)
  3. Should fix (~6 lines) — planning.py:692-701 turns the stock 3-line chunk check into a 9-line two-message branch. (entry #3)
  4. Should fix (~4 lines) — prepared_context duplicates Plan.context: min(recipe.context, N, tokens) == min(self.context, N), and the extra min at :696 goes. (entry #2)
  5. Should fix (~3 doc lines) — docs/cli-design.md:446 repeats :1443 and :1493 (this PR's own other edits) and the KV-limit section; the removed prose also cites the multi-model hosting scope AGENTS.md:171-174 rejects. (entry #4)
  6. Nit (~2 lines) — derive()'s context parameter is a pure pass-through; to_dict() records context_target but not the effective prepared_context the boot config actually uses (planning.py:432 vs bootstrap.py:58). (entry #5)

Total removable: ~30 code lines of the 41, ~13 of the 57 test lines, ~2-3 of the 5 doc lines — roughly 45 of the 98 added lines, 70 of them if the flag goes entirely with the runtime argument.

Left behind: ignition/cli/serve.py:68-69 (max_body_bytes from recipe.context, context_hint still "limited by the checkpoint"), ignition/cli/help.py:38 (--prefill-chunk-size: 64..{recipe.context}), ignition/bench/runner.py:388 (validates against layout.context, i.e. the pool-bound value, while the new bench path caps preparation).

File-by-file: entry #7 (unchanged; bootstrap.py:58 is the sole load-bearing hunk).

#12 [high] Research summary

Reviewed PR #533 at head de1b5b5 through the subtraction lens, against AGENTS.md, docs/design-review.md (not opened), the charter, and the maintainer's earlier review of the same change in closed PR #454.

The head moved since my last pass, so counts are corrected: 9 files, +98/−18 — +41/−18 in code and docs, +57/−0 in tests (not the "+35/−15 across 7 files" I reported before).

Findings, ranked by lines saved (all in the scratchpad, entries #1-#5, #9-#11):

  1. Blocking, ~28 lines — the flag re-implements runtime --kv-cache-limit. The PR's own VRAM table is measured with --kv-cache-limit concurrency (an existing runtime flag applied at core load, docs/cli-design.md:738, :828-833; page_ceiling in helios/src/runtime_core/memory.rs:284-331), and #454's maintainer asked for a workload that flag cannot serve. The only genuine delta is one integer reaching ignition/preparation/bootstrap.py:58.
  2. Should fix, ~13 of the 57 test lines (new this pass) — tests/cli/test_planning.py:211-265 repeats itself: the clamp case re-asserts the same min() as the valid case, 0 and -1 hit one <= 0 branch, and the seven-line "no context_target when unset" block re-proves from_plan's generic add()-skips-None rule. Also, :257 asserts value.int64_value while _preparation_value (rebuild_manifest.py:332-333) emits uint_value for a non-negative int — that assertion cannot pass.
  3. Should fix, ~6 lines — planning.py:692-701 turns the stock three-line prefill-chunk error into a nine-line two-message branch; one message naming the effective context suffices.
  4. Should fix, ~4 lines — prepared_context (planning.py:370-375) duplicates Plan.context: min(recipe.context, N, tokens) is min(self.context, N), which also makes the extra min at :696 dead.
  5. Should fix, ~3 doc lines — docs/cli-design.md:446 states what the PR's own other two edits (:1443, :1493) already state, and its prose advertises the multi-model hosting scope AGENTS.md:171-174 rejects.
  6. Nit, ~2 lines — derive()'s context keyword is a pure pass-through, and to_dict() records context_target but not the effective prepared_context the boot config actually uses.

Total removable: roughly 45 of the 98 added lines (about 30 of the 41 code lines, 13 of the 57 test lines, 2-3 of the 5 doc lines) — about 70 if the flag is dropped altogether and the runtime --kv-cache-limit carries the argument. Left behind: ignition/cli/serve.py:68-69 (max_body_bytes and context_hint still sized/worded from the recipe max), ignition/cli/help.py:38, and ignition/bench/runner.py:388.

#13 [high] Correction: earlier notes #5/#8 said "no test covers the new behaviour" — false at head de1b5b5

Stale claims that the final report must not repeat (the head moved from the commit I reviewed to de1b5b5):

  1. "No test asserts any of the new behaviour" (entry #5, item 4; entry #6; entry #8 "Open questions"). False at de1b5b5: tests/cli/test_planning.py:211-265 adds test_request_context_target_prepared_context_and_manifest (+57 lines) covering the no-op path, the clamp, both validations, to_dict() and the manifest keys. grep -n "prepared_context\|context_target\|request_context" tests/ now returns tests/cli/test_planning.py:211-265 only. The test's own problem is the opposite one — it repeats itself (entry #9) — and :257 asserts int64_value where _preparation_value (rebuild_manifest.py:332-333) emits uint_value, so that line cannot pass.

  2. "+35/−15 across 7 files" (entries #1, #6, #7, #8). Actual at de1b5b5 (pr_files): 9 files, +98/−18 — docs/cli-design.md +3/−2, ignition/cli/init.py +4/−0, ignition/cli/bench.py +2/−1, ignition/cli/preparation.py +2/−2, ignition/cli/serve.py +3/−3, ignition/planning.py +23/−9, ignition/preparation/bootstrap.py +1/−1, ignition/preparation/rebuild_manifest.py +3/−0, tests/cli/test_planning.py +57/−0. Code+docs = +41/−18; tests = +57/−0.

  3. Unchanged and still true: ignition export M --ranks 2 --request-context N does now forward the flag (cli/serve.py:206), so the autobot blocker "multi-host never passes context" is fixed at this head; Plan.__post_init__ does now validate the page multiple (planning.py:289-290, reflecting Helios' catalog.rs:50-57 requirement); to_dict()/reproduction_arguments/from_plan all record the setting (planning.py:432, rebuild_manifest.py:264-265, :390). So the "left behind" list shrinks to serve.py:68-69, cli/help.py:38 and bench/runner.py:388.

#15 [high] Report of 2026-11-26, run at head 02023eba — verdict: make it smaller first; ~36 of 84 added lines removable

PR #533 "Cap the per-request context target", head 02023eba, base main. pr_files: 9 files, +84/−18 — docs/cli-design.md +3/−2, ignition/cli/init.py +2, bench.py +3/−1, preparation.py +1/−1, serve.py +5/−4, ignition/planning.py +19/−9, preparation/bootstrap.py +1/−1, rebuild_manifest.py +3, tests/cli/test_planning.py +47. Code+docs = +37/−18; tests = +47.

VERDICT: make it smaller first. ~36 of 84 added lines removable without losing behaviour; ~75 if the flag is dropped and the runtime --kv-cache-limit carries the argument.

RANKED FINDINGS (all verified by reading the code at pr/533):

  1. BLOCKING (~20 code + 47 test + 3 doc lines) — the whole --request-context surface re-implements the existing runtime flag. Surface: cli/init.py:167-168 (flag + help), cli/preparation.py:55 (keyword), :69 (forward), cli/bench.py:177, cli/serve.py:207/291/476, cli/serve.py:319 (plan line), planning.py:186 (field), :260 (bench check), :377-381 (property), :438 (to_dict), :467-468 (<=0 check), :461/:549/:602/:689 (keywords+forward), :709-711 (chunk check), bootstrap.py:58, rebuild_manifest.py:264-265, :389, docs/cli-design.md:446/1443/1493. The PR's own evidence table is measured with --kv-cache-limit concurrency (existing runtime flag: docs/cli-design.md:738 default memory, :828-833 semantics; page_ceiling helios/src/runtime_core/memory.rs:284-331). The only datum this PR adds is a lower exported max_sequence_tokens, which flows through exactly one load-bearing line: bootstrap.py:58 "context": plan.prepared_context -> BasePreparationConfig.context (bootstrap.py:33) -> helios/src/server/config.rs:131 -> limits.max_sequence_tokens (:148), narrowed to the pool at helios/src/model.rs:268-272 and validated at helios/src/model/catalog.rs:48-57. Smaller version: drop --request-context from all four entry points, drop Plan.context_target and prepared_context; optionally one BasePreparationConfig.context integer if a cap is wanted. Nothing the runtime flag does is lost; the only lost datum is a lower request ceiling. Cite: AGENTS.md:165-169 (need must be a demonstrated defect or measured problem), :188-193 (no configuration switches without concrete requirement), charter "smallest footprint in shared code, or a way to solve it without new code at all"; #454 maintainer review asked for "a concrete workload that --max-concurrency and --kv-cache-limit cannot serve" and the resubmission does not answer it.

  2. BLOCKING-ish (~2 test lines, and a description claim with no code) — two assertions in the new test cannot pass because the code they test is not in the diff. tests/cli/test_planning.py:238-240 pytest.raises(UsageError, match="multiple of the") for context=100: there is NO page-multiple validation at this head. grep "multiple of" ignition/planning.py finds only the pre-existing prefill-chunk check at :636-637, which context=100 does not trip (default chunk 4096 is a multiple of 64 and ≤ recipe.context). So planning.plan(...) returns normally and the assertion fails. tests/cli/test_planning.py:254 by_key["context_target"].value.int64_value == 131072: _preparation_value (rebuild_manifest.py:330-333) emits uint_value for a non-negative int, so int64_value reads 0. The description's "a page-multiple validation" and "distinguishes the default chunk from an explicit one" are therefore accurate about a different (earlier) head, not this one; the chunk branch at planning.py:709-711 is already the single stock-style message. Fix: delete :238-241 and either delete :254 or assert uint_value. ~4 lines.

  3. SHOULD FIX (~13 of the +47 test lines) — the new test block repeats itself and re-proves generic helper behaviour. tests/cli/test_planning.py:229-232 clamp case duplicates :223-227 with a larger N (~4); :242-244 to_dict() restates the field already asserted at :225 (~1 could stay, but the d temp is one line); the int64_value line above (~1); the manifest round-trip at :247-253 duplicates the sibling manifest test at :92-106 which already asserts scope+value through from_plan (~4). Keep: the no-op case, one capped case, one rejection, one manifest key check.

  4. SHOULD FIX (~6 lines) — the <= 0 validation sits in fit (planning.py:467-468), which plan() re-enters once per candidate world size and per shortfall probe (:689, :693-705); it costs a re-check on every attempt and is the only validation of a flag outside Plan.__post_init__. Since Plan already validates every other flag there (:266-296), and the test drives everything through planning.plan(...), it can move or go with finding 1.

  5. NIT (~1-2 lines) — prepared_context's three-line body. planning.py:377-381 if self.context_target is None: return self.recipe.context / return min(self.recipe.context, self.context_target, self.tokens) equals return self.recipe.context if self.context_target is None else min(self.context, self.context_target). NOTE: the context_target is None early return is LOAD-BEARING (it must return recipe.context, which can exceed the pool-bound self.context, or the no-op claim breaks) — do not fold it away. The min(result.context, result.prepared_context) at :709 is also load-bearing for the no-target case.

  6. NIT (~2 doc lines) — docs/cli-design.md:446 states the cap three times across the PR's own rows: :446 (flag table), :1443 ("capped by --request-context at export"), :1493 ("capped by --request-context"). Keep the flag row; the two owner-table rewords restate it. Also the row's "Command line only; a core's catalog is fixed at export, so changing it requires re-export" repeats the identical clause --mixed-prefill carries at :447.

LEFTOVER (code this change supersedes but does not update; small, and moot if finding 1 is taken):

VERIFIED CLEAN (do not re-raise): the seam is right — bootstrap.py:58 is the whole mechanism; omitting the flag is byte-equivalent to main; all four entry points forward the flag (serve.py:207/291/476, bench.py:177); reproduction args and the manifest record it (rebuild_manifest.py:264-265, :389); bench's required_context check now uses prepared_context (planning.py:260); Plan is frozen with a defaulted field so existing constructions work.

NOT VERIFIED HERE: nothing was executed (no CI checks on the head). Claims 2's failures are arithmetic + schema reads. docs/design-review.md was not opened.

#16 [high] Research summary

Reviewed PR #533 at head 02023eba (+84/−18 across 9 files: +37/−18 code+docs, +47 tests) through the subtraction lens, against the charter, AGENTS.md:72-112/:165-199 and the maintainer's earlier review of closed #454. Findings are in scratchpad entry #15, ranked by lines saved.

Verdict: make it smaller first — about 36 of the 84 added lines can go without losing behaviour, ~75 if the flag is dropped.

Biggest items: (1) the whole --request-context surface (planning.py field/property/checks/forwards, four CLI entry points, manifest entries, docs rows, the test) re-implements the existing runtime --kv-cache-limit, and the PR's own VRAM table is measured with that runtime flag; the sole load-bearing line is bootstrap.py:58 passing plan.prepared_context into BasePreparationConfig.context, which reaches Helios max_sequence_tokens via helios/src/server/config.rs:131 (not opened),148. (2) Two assertions in the new test cannot pass at this head: context=100 is rejected by no code (planning.py has no page-multiple check — only the pre-existing prefill-chunk one at :636), and :254 asserts int64_value where _preparation_value emits uint_value. (3) The test block repeats its own cases and re-proves generic add()-skips-None behaviour already covered by the sibling manifest test. (4) fit's <= 0 check runs on every candidate re-entry instead of in __post_init__ beside the other flag validations. Left behind: serve.py:68-69, cli/help.py:38, bench/runner.py:388 still describe the recipe maximum as the served context. I also confirmed what is load-bearing and must not be cut: the context_target is None early return and the min(result.context, result.prepared_context) at :709.

Nothing was executed (no CI checks on the head); the failing-assertion claims are arithmetic and schema reads.

#17 [high] Line-savings tally and count provenance for the final report (head 02023eba)

Counts (provenance: pr_files at head 02023eba):

Savings tally, ranked (each verified in the code at pr/533, details in entry #15):

  1. Drop the whole --request-context surface: ~20 code lines (cli/init.py:167-168; cli/preparation.py:55,69; cli/bench.py:177; cli/serve.py:207,291,319,476; planning.py:186,260,377-381,438,467-468 plus the context= keywords at :461,:549,:602,:689 and the :709-711 rewrite; rebuild_manifest.py:264-265,389) + all +47 test lines + 3 doc lines (cli-design.md:446,1443,1493). Total ≈70 of 84. This is the ceiling if the argument holds; entry #15 states the one surviving line if a cap is still wanted (bootstrap.py:58 with one BasePreparationConfig.context integer ≈ 12-15 lines total).
  2. Remove the two unfounded test assertions (test_planning.py:238-241 page-multiple block, :254 int64_value) → ~5 lines.
  3. Trim the repeated test cases (test_planning.py:229-232 clamp duplicate, :242-244 to_dict restatement, :247-253 manifest round-trip duplicating tests at :92-106) → ~9-10 lines.
  4. Move/merge the <= 0 check out of fit (planning.py:467-468) into post_init beside :266-296, or delete with finding 1 → ~2 lines.
  5. Collapse prepared_context body (planning.py:377-381) → ~1-2 lines; keep the None early return and keep the min at :709.
  6. Trim docs duplication (cli-design.md:446 vs the PR's own :1443 and :1493, plus the re-export clause copied from :447) → ~2-3 lines.

Sum without dropping the flag ≈ 36 of 84; with the flag dropped ≈ 70-75.

Do-not-cut list (verified, previously mis-claimed as dead in earlier rounds): planning.py:377-380 context_target is None -> recipe.context; planning.py:709 effective_context = min(result.context, result.prepared_context); the context= keyword on derive()/plan()/fit() as the single funnel for the four entry points.

Not executed: no CI checks on this head; every behavioural claim in the report is arithmetic or schema reading. docs/design-review.md was not opened.

#19 [high] Should fix: the new test's clamp case cannot pass — the max bound rejects targets above the recipe max — and the oversized block plus three restatements are ~11 of +37 test lines

Head 9118add, diff +69/−5 across 6 files (code+docs +32/−5, tests +37/−0).

The flag declares max_fn=_recipe_context_limit (ignition/parameters.py:1316; _recipe_context_limit at :1268 returns context.recipe.context). RecipeParameters.validate (:1440) ends in super().validate(ctx) → validate_fields (:505) which, with min_value=1 and that max, raises --request-context for <alias> must be 1 through 262,144 for any target above the recipe max (:533-545). plan() validates before sizing (ignition/planning.py:540) and fit() validates again (:456).

Consequence: tests/cli/test_planning.py:310-313

oversized_params = replace(base_params, context_target=500000)
oversized = planning.plan(..., parameters=oversized_params)
assert oversized.parameters.context_target == 500000
assert oversized.prepared_context == recipe.context

raises UsageError before the asserts (fixture: context=262144, page_tokens=64, tests/cli/test_planning.py:139-140). 4 lines dead, and they encode a clamp the code does not have.

Other removable test lines (11 total, of the +37):

#20 [high] Nit: three of the 13 added ParamSpec lines restate defaults, and prepared_context's clamp is unreachable — ~4 code lines

ignition/parameters.py:1309-1321 (+13) declares the field. Three lines restate ParamSpec defaults declared at ignition/parameters.py:86-91:

ignition/planning.py:357-363 (+4):

target = self.parameters.context_target
if target is None:
    return self.recipe.context
return min(self.recipe.context, target)

Because max_fn already rejects target > recipe.context (see the test note), the min can never clamp. Smaller, 3 lines:

target = self.parameters.context_target
return self.recipe.context if target is None else target

(1 line saved; the None branch stays — it is what makes the omitted flag a no-op.)

#21 [high] Should fix: the recipe-max clamp is implemented twice (parameters.py max_fn and planning.py min) and the docs describe the dead one

Head 9118add. The clamp exists twice and only one copy is live:

So docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum") and the PR description's "min(recipe.context, N)" describe behaviour the code rejects. Pick one and delete the other:

Either way one of the two statements goes; 1 line.

Doc duplication: the flag row's trailing "a core's catalog is fixed at export, so changing it requires re-export" repeats the identical clause in the --mixed-prefill row immediately below (docs/cli-design.md:469). Drop it from the new row; 0 lines saved but it shortens the row.

docs/cli-design.md:1436 (the owner-table "Context limit" row) is the one owner row the flag now changes — it is not a duplicate of :468 (the flag table lists flags; the owner table says which surface decides). Keep.

Left behind / not updated in the same change:

#22 [high] Report of 2026-11-26 (head 9118add) — verdict: near-minimal; ~16 of 69 added lines removable with the flag, ~68 without

Head 9118add, pr_files: 6 files, +69 / −5. Per file: docs/cli-design.md +2/−1; ignition/cli/serve.py +2/−2; ignition/parameters.py +13/−0; ignition/planning.py +14/−1; ignition/preparation/bootstrap.py +1/−1; tests/cli/test_planning.py +37/−0. Code+docs = +32/−5; tests = +37/−0.

(The orientation packet says 6 files +69/−5; an earlier note in my scratchpad quoted +84/−18 from a superseded head — use +69/−5.)

Removable, ranked:

  1. Drop the flag's whole surface if the maintainer holds that the memory argument is the runtime --kv-cache-limit's: ≈68 of 69 lines (parameters.py:1309-1321 = 13, planning.py:186-190 + 357-363 + 212 = ~14, serve.py:67-68 = 2, bootstrap.py:132 = 1 with the −1 restored, docs 2, tests 37). The one thing lost is a lower exported max_sequence_tokens, i.e. serving rejecting a request longer than N — the datum #454 asked to see justified.
  2. Tests: 11 of the 37 (4 of them cannot pass — entry #19).
  3. parameters.py spec: ~3 lines that restate ParamSpec defaults (entry #20).
  4. planning.py:363: 1 line once the max_fn/min duplication is settled (entry #21).
  5. docs: 1 clause + the row's re-export sentence (entry #21).

Total with the flag kept: about 16 of 69. With the flag dropped: about 68 of 69. Verified load-bearing (do not propose cutting): bootstrap.py:132 ("context": plan.prepared_context) is the entire mechanism; planning.py:364-362's target is None → recipe.context branch is what makes the omitted flag a no-op; planning.py:212 (bench compares prepared_context); the page-multiple check at planning.py:186-190 (Helios rejects a misaligned max_sequence_tokens at load, helios/src/model/catalog.rs:48-57, and ignition has no other page-alignment guard on this value); serve.py:67-68 (the two user-visible bounds — this closes the previous round's "left behind" finding).

#23 [high] Report of 2026-11-26, run at head 9118add — the change is near-minimal; 16 of 69 lines removable

Head 9118add. PR 533, +69/−5 across 6 files (code+docs +32/−5, tests +37/−0). Verdict: near-minimal; the shape is right (one optional param field, one accessor, one seam line, one serve-side bound pair) and I would not ask for rework — the remaining cuts are ~16 of 69 lines, or ~68 if a maintainer holds that the memory argument belongs to the runtime --kv-cache-limit.

Findings, ranked by lines saved:

  1. ~68 of 69 (blocking-if-the-argument-fails, otherwise out of my lens to decide): the flag's whole surface. The PR's own VRAM table is measured under --kv-cache-limit concurrency (docs/cli-design.md:740, flare-cli/src/cli.rs:890-903), a runtime flag that already bounds the pool without a re-export; the only genuinely new datum is a lower exported max_sequence_tokens (bootstrap.py:132 → helios/src/server/config.rs:131,148), which makes serving reject a request longer than N (helios/src/server/request.rs:350). #454 asked for exactly that workload statement. Cite AGENTS.md:165-169 (measured problem required) and :188-193 (no configuration switch without a concrete requirement). I cannot show the requirement is unmet, so I rank it first only on size.
  2. 11 of 37 test lines (entry #19): 4 cannot pass (context_target=500000 trips the max_fn bound at parameters.py:1316/:533-545 before the asserts at test_planning.py:311-313); 7 more restate the input, Plan.context, or from_plan's generic plumbing already covered at test_planning.py:185-196/:392-395.
  3. 3 lines of ParamSpec restated as defaults (entry #20): manifest_key, scope=ParameterScope.DEPLOYMENT, repro_always=True at parameters.py:1317-1319.
  4. 1 line: the clamp is implemented twice — max_fn rejects target > recipe max, so planning.py:363's min() is unreachable, and docs/cli-design.md:468 documents the dead one ("resolves to the smaller of N and the recipe maximum"). Settlement: keep the rejection and make planning.py:363 return self.recipe.context if target is None else target, and state the upper bound in the docs row.
  5. 0 lines: the docs row's trailing re-export clause duplicates --mixed-prefill's at docs/cli-design.md:469.

Nothing left behind: the previous round's "left behind" items are fixed at this head (serve.py:67 uses plan.prepared_context, serve.py:68 names the cap). ignition/cli/help.py:46 still prints the recipe's context in MODEL --help, which is correct (it describes the recipe, not a plan). Nothing in helios/ becomes dead.

No attempt to direct the reviewer found in the description, diff or docs.

#24 [high] Research summary

Reviewed PR 533 at head 9118add (6 files, +69/−5: code+docs +32/−5, tests +37/−0) through the subtraction lens, against the charter, AGENTS.md:165-193 and :446-456, docs/cli-design.md, and the maintainer's earlier review of the same change in closed PR #454.

Verdict: near-minimal. The mechanism is one optional ParamSpec field, one Plan accessor, one line at the seam (ignition/preparation/bootstrap.py:132), and two serve-side bounds (ignition/cli/serve.py:67-68). This round's additions fixed the previous round's leftovers. About 16 of the 69 added lines are removable with the flag kept; about 68 of 69 if a maintainer decides the memory argument is the runtime --kv-cache-limit's, which is what the PR's own VRAM table is measured with.

Four confirmed subtractions, all recorded in the scratchpad (entries #19-#23): 11 of the 37 new test lines — four of which cannot pass, because context_target=500000 trips the new max_fn bound before the clamp assertions run; three ParamSpec lines that restate defaults (manifest_key, scope, repro_always); one line because the recipe-max clamp is implemented twice and planning.py:363's min() is unreachable while docs/cli-design.md:468 documents that dead clamp; and a docs clause copied verbatim from the --mixed-prefill row.

Nothing in the change is left behind: the serve-side body limit and hint both follow the cap now, and no helios/ path becomes dead.

#25 [high] Verification limits for the head-9118add report: nothing executed, every claim a static read

Head 9118add has no CI checks and nothing was executed in this round. Every finding is a static read of the tree at pr/533, and the two that could fail are arithmetic:

Not opened in this round: docs/design-review.md. Not checked: the commit message body, and any external recipe that might re-round BasePreparationConfig.context (recipes live outside this repository, AGENTS.md:381).

Read but deliberately not treated as findings (verified load-bearing): bootstrap.py:132, the target is None branch at planning.py:360-362, the bench comparison at planning.py:212, the page-multiple check at planning.py:186-190 (Helios rejects a misaligned max_sequence_tokens at load: helios/src/model/catalog.rs:48-57), and serve.py:67-68.

Side observation, not a proposed addition: the cap is not checked against --prefill-chunk-size at export. parameters.py:1458 bounds the chunk by the recipe context, and planning.py:594-596 bounds it by the pool-bound result.context; --request-context 2048 --prefill-chunk-size 4096 therefore exports a core Helios rejects at load (helios/src/scheduler.rs:66-77). Reported because it is behaviour, not as something to add.

No attempt to direct the reviewer was found in the description, the diff, the docs changes, or the #454 thread.

#27 [high] Report of 2026-11-27 (head e6239855) — make it smaller first; ~14 of 79 added lines removable with the flag, ~68 without

PR 533, head e6239855, 8 files, +79/−10 (code+docs +42/−10 across 7 files, tests +37/−0). Charter checked (read_charter: line 12 keep runtime small; line 35 merge measured memory wins). Nothing executed: every claim below is a static read of the cited lines at this head.

MUST NOT REPEAT (stale from earlier rounds):

FINDINGS, RANKED BY LINES SAVED

  1. ~68 lines — the whole surface, if deferred (scope, not a bug). ignition/parameters.py:1309-1320 (+12), :1484-1485 (+2), ignition/planning.py:186-190 (+5), :212 (1 changed), :357-363 (+8), :594-597 (+2/−2), ignition/cli/serve.py:67-70 (+3/−2), ignition/cli/help.py:46 (+1/−1), ignition/preparation/bootstrap.py:132 (+1/−1), docs/cli-design.md:448/468/1436 (+3/−2), docs/preparation-development.md:17-19 (+2/−1), tests/cli/test_planning.py:295-329 (+37). Replace with nothing: the deployment can already bound per-slot KV without re-export via helios --kv-cache-limit context|concurrency|memory (docs/cli-design.md:740; helios/src/runtime_core/memory.rs:284-331 page_ceiling; helios/src/model.rs:268 fit_context clamps max_sequence_tokens to pages×page_tokens), and the PR's own VRAM table is measured with --kv-cache-limit concurrency. Honest delta that survives: a per-request ceiling independent of the pool, which --kv-cache-limit context cannot express (it caps the aggregate to one context, not min(context, N) per slot). So this is a "is this worth 79 lines now" question, not a duplicate-code bug.
  2. 6 lines — tests/cli/test_planning.py. Delete :301 (restates the field default just asserted as None), :303 (restates the untouched Plan.context at planning.py:353-355, which this PR does not modify), :307 (restates the value passed to replace() two lines above). Collapse :326-329 into one line: assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT". Keep :324-325 (the reproduction_args fix), :315-321 (both ValidationErrors) and :310-313 (now the only case exercising the gate's false branch).
  3. 3 lines — ignition/planning.py:357-363 four body lines to one: return min(self.recipe.context, self.parameters.context_target or self.recipe.context) (min_value=1 at parameters.py:1315 makes 0 unrepresentable, so or is safe). Keep the docstring.
  4. 2 lines — ignition/cli/serve.py:68-70: two-message conditional → one string naming checkpoint, cache capacity and the prepared cap. Cost: the unset case mentions a cap that isn't set. judgement call.
  5. 2 lines — ignition/parameters.py:1316 manifest_key="context_target" and :1317 scope=ParameterScope.DEPLOYMENT restate what the machinery already derives: manifest_parameters falls back to dc_field.name (parameters.py:607-612, and RecipeParameters.manifest_prefix is None at :334), and DEPLOYMENT is the ParamSpec default (:89). Caveat: sibling prefill_chunk at :1303-1304 spells both out.
  6. 1 line — ignition/planning.py:396 "checkpoint_context": self.recipe.context has no reader in the tree (search_code finds only this line); the PR is adding a second context key beside it, so drop the dead one rather than carrying both.
  7. prose only (0 lines) — docs/cli-design.md:468 repeats the "Command line only; a core's catalog is fixed at export, so changing it requires re-export" clause copied verbatim from the --mixed-prefill row at :469; and cli-design.md:448-451 plus preparation-development.md:17-19 are two hand-maintained enumerations of the same universal field list that will drift — a pointer to RecipeParameters would be smaller.

DO NOT CUT: bootstrap.py:132 (the only seam that reaches the export), the min at planning.py:594 (prepared_context deliberately ignores the pool; bootstrap must stay pool-independent so a core stays portable), the page-multiple check, status_label (plan report requirement), min_value=1. Leftovers checked: cli/help.py:46 and serve.py:68 now follow the cap; no helios path becomes dead; kvcache_limit machinery untouched. Verdict: make it smaller first — the change is otherwise near-minimal (one field, one accessor, one seam).

#28 [high] Research summary

Reviewed PR #533 at head e6239855 (8 files, +79/−10: code+docs +42/−10, tests +37/−0) through the subtraction lens, re-verifying every earlier finding against the new diff, since this head dropped max_fn and repro_always, added --request-context to reproduction_args, and gated the alignment check. Three of my earlier blockers are now stale and I discarded them: the oversized-target test passes, the clamp at planning.py:363 is live, and the cap is reproducible. Nothing was executed; all claims are static reads.

Verdict: make it smaller first, but the change is otherwise near-minimal — one field, one accessor, one seam. Confirmed subtractions: ~14 lines if the flag stays (six test lines that restate the input or an unmodified property, the two-to-one collapse of the test's manifest-scope block, a one-line prepared_context body, a two-line spec cleanup where manifest_key/scope restate what the machinery derives, and the dead checkpoint_context key at planning.py:396), plus ~68 lines if the whole surface is deferred, since per-slot KV is already bounded at load by Helios --kv-cache-limit — the flag the PR's own VRAM table uses. The honest surviving delta is a per-request ceiling independent of the pool, which is a scope question for the maintainers, not duplicate code.

Full detail, ranked with exact line ranges and the do-not-cut list, is in scratchpad entry #27.

#29 [high] Count provenance, smaller-version snippets and verification limits for the head-e6239855 report

Companion to entry #27 (the report). Read together.

COUNT PROVENANCE (pr_diff at head e6239855)

SMALLER VERSIONS (literal)

  1. planning.py:357-363 → @property def prepared_context(self) -> int: """The context the prepared core serves per request; the recipe max when no target is set.""" return min(self.recipe.context, self.parameters.context_target or self.recipe.context) Saves 3 lines. Safe because parameters.py:1315 sets min_value=1, so a resolved target is never 0.
  2. test_planning.py:326-329 (4 lines) → assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT" Saves 3. Same with deleting :301, :303, :307 entirely (3 more).
  3. serve.py:68-70 (3 lines) → one string: "context_hint": "context is limited by the checkpoint, cache capacity, and --request-context cap", Saves 2; loses only the claim that the unset case omits the cap.
  4. parameters.py:1316-1317 → delete both lines. manifest_parameters falls back to dc_field.name (parameters.py:607-612) and RecipeParameters.manifest_prefix is None, so the key stays "context_target"; DEPLOYMENT is the ParamSpec default (parameters.py:89). Saves 2.
  5. planning.py:396 → delete "checkpoint_context": self.recipe.context,; search_code finds no reader anywhere in the repo. Saves 1.

NOT EXECUTED (state in the report): no pytest run, no export, no serve. Head has no CI checks. Arithmetic: the +79/−10 totals are read off the diff; the savings above are line counts of the cited ranges, not measurements. The VRAM table in the PR description is the author's measurement and I did not reproduce it; my only claim about it is that the command line names --kv-cache-limit concurrency. FILE-BY-FILE COMPLETENESS: docs/preparation-development.md and docs/cli-design.md have only the prose simplifications in #27 item 7; ignition/cli/help.py:46 and bootstrap.py:132 are single-line changes with nothing to subtract; ignition/cli/serve.py:67 (max_body_bytes) must follow the cap or the body limit contradicts the exported context, so it stays.

#31 [high] Report of 2026-11-27 (head 448f70a) — verdict: make it smaller; ~21 of +91 lines removable, and the "drop the flag" case is now closed

Verdict: make it smaller first (modest), and no longer "drop the whole surface".

The change at head 448f70a: 8 files, +91/−28. Code+docs +48/−28 across 7 files (parameters.py +15/−0, planning.py +19/−5, serve.py +4/−2, help.py +1/−1, bootstrap.py +1/−1, cli-design.md +5/−14, preparation-development.md +3/−5); tests/cli/test_planning.py +43/−0. Carries no CI checks.

What is new since e6239855 (re-verified against the diff): the status_parts emission (parameters.py:1560-1561), the oversized-target case (:311-314), and the page-multiple check are all present; max_fn and repro_always are still absent; --request-context is in reproduction_args.

The whole-surface removal is no longer the recommendation

#454's review by yatesdr asked for exactly this capability: "A resubmission should … carry the cap into the core, so that serving rejects longer requests". That is an explicit maintainer request, which satisfies AGENTS.md:165-166 ("must address an explicit maintainer request"). bootstrap.py:132 does the carrying; helios/src/server/request.rs:350 rejects the over-long request. So the memory story in the description is still the runtime flag's (helios/src/runtime_core/memory.rs:298-319, page_ceiling with KvCacheLimit::Concurrency; helios/src/model.rs:261-273 fit_context clamps to the pool), and the description now says so itself — but the code is a requested capability, not a hypothetical one. Do not ask for the 68-line deletion this round.

Ranked findings (~21 lines)

  1. Should fix, 9 of +43 test lines (tests/cli/test_planning.py):

    • :304 assert stock_plan.context == min(recipe.context, stock_plan.tokens) restates untouched Plan.context (planning.py:353-355).
    • :308 / :313 restate the input passed one line above (:306 / :311).
    • :319 assert kwargs["context"] != recipe.context is implied by :318's == 131072.
    • capped_params (:306) and oversized_params (:311) are each used once: inline into the call and save 2 lines: capped = planning.plan(recipe, recipe.checkpoints[0], gpus, selected=(0, 1), parameters=replace(base_params, context_target=131072)) assert capped.prepared_context == 131072
    • :332-335 (4 lines) re-prove from_plan's generic key/scope plumbing already covered for sharded_prefill at :185-196; one line suffices: assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT" Keep :302 (the no-op default), :309/:314 (capping and above-recipe clamp), :318 (the seam), both UsageError cases, and :330-331 (reproduction_args, the only coverage of the override at parameters.py:1483-1485).
  2. Should fix, 3 lines — planning.py:357-363 body 4→1: return min(self.recipe.context, self.parameters.context_target or self.recipe.context) Safe: min_value=1 (parameters.py:1315) and Plan.__post_init__ calls self.parameters.validate(context) (planning.py:185) before any read, so a resolved target is never 0.

  3. Should fix, 2 lines — serve.py:68-70 two-message context_hint → one string: "context is limited by the checkpoint, cache capacity, and --request-context cap". The neighbour capacity_hint (:71) is a fixed string; context_hint is appended to admission rejections (helios/src/server/http.rs:59), so naming a flag that was not passed is noise. serve.py:67 (max_body_bytes from prepared_context) must stay.

  4. Nit, 2 lines — parameters.py:1316-1317: manifest_key="context_target" and scope=ParameterScope.DEPLOYMENT restate derived defaults (manifest_parameters falls back to dc_field.name, parameters.py:607-612, with manifest_prefix None at :334; DEPLOYMENT is the ParamSpec default at :89). Caveat: sibling prefill_chunk spells both out (:1303-1304).

  5. Nit, 2 lines — parameters.py:1560-1561: the bespoke status_parts branch now duplicates what Plan.to_dict() already reports — context_target (auto, parameters.py:675-684 with dict_section None) and prepared_context (planning.py:396). The sibling prefill_chunk has no status label either. Trade-off: keep it if the "Select GPUs." line (serve.py:270-274) must name the cap in prose.

  6. Nit, 1 line — planning.py:186-190: drop != 0 from the modulo test and unwrap the raise, 5 lines → 4.

  7. Docs, 0 lines, ~20 words — cli-design.md:458: drop the "Command line only; a core's catalog is fixed at export …" clause, verbatim repeated in the --mixed-prefill row at :459; and "the prepared per-request context and max_sequence_tokens" names one thing twice.

Already subtracted by the change (credit)

Do not cut (verified)

bootstrap.py:132 (the only seam), planning.py:186-190 (page-multiple gate; Helios rejects a misaligned extent at helios/src/model/catalog.rs:50-57), :212 (bench vs served extent), :368 (guaranteed_tokens), :396, :594 (prefill chunk vs served extent), parameters.py:1309-1319 core (flag, group, metavar, value_type=int — needed because a None default resolves to str at :205-216 — min_value), :1483-1485 (reproduction_args), help.py:46, serve.py:67, both docs rows.

Left behind

Nothing. checkpoint_context is gone; no helios/ path becomes dead; --kv-cache-limit untouched; tests/cli/test_commands.py:80 concerns --context, a different flag.

#32 [high] Verification notes and count provenance for the head-448f70a report

COUNTS (pr_files at head 448f70a): docs/cli-design.md +5/−14; docs/preparation-development.md +3/−5; ignition/cli/help.py +1/−1; ignition/cli/serve.py +4/−2; ignition/parameters.py +15/−0; ignition/planning.py +19/−5; ignition/preparation/bootstrap.py +1/−1; tests/cli/test_planning.py +43/−0 → +91/−28 total, +48/−28 code+docs, tests +43.

VERIFIED IN CODE

NOT EXECUTED: no pytest, no export, no serve; the head has no CI checks. All savings are line counts of cited ranges. The VRAM table in the description is the author's measurement, not reproduced.

#33 [high] Correction: tallied savings for head 448f70a are ~17 lines (7 test + 10 code), not 21

CORRECTION to entry #31's tally (recounted line by line; the "9 test lines / ~21 total" figure there over-counts).

TEST savings (tests/cli/test_planning.py), clear-cut = 7:

CODE savings = 10:

TOTAL: ~17 lines clear-cut (7 test + 10 code), ~19 with the two judgement calls, plus ~20 words of duplicated prose in docs/cli-design.md:458. Out of +91/−28.

#35 [high] Examination coverage and limits for the head-448f70a review

Scope of the 448f70a examination, for the final report's honesty section.

FILES EXAMINED (all 8, plus the code they touch): ignition/parameters.py (spec :1309-1319, reproduction_args :1483-1485, status_parts :1560-1561, and the machinery they use: ParamSpec :61-102, _value_type :205-216, validate_fields :505-545, manifest_parameters :596-616, reproduction_args base :618-655, to_dict :667-692, status_parts base :694-707); ignition/planning.py (post_init :179-217, prepared_context :357-363, guaranteed_tokens :366-368, to_dict :379-416, fit :435-480, plan() :589-598); ignition/cli/serve.py (:59-73 _server_options, :206 and :435 plan JSON, :270-274 status line); ignition/cli/help.py:43-47; ignition/preparation/bootstrap.py:123-137; ignition/preparation/rebuild_manifest.py:236-335 (reproduction_arguments, from_plan); docs/cli-design.md:446-475, :1415-1445; docs/preparation-development.md:11-42; tests/cli/test_planning.py:117-145 (fixture), 185-196, 222-292 (existing manifest test it parallels), 295-336; tests/cli/test_parameters.py:295-351 (the round-trip golden test that already covers reproduction_args generically).

READ ON THE RUNTIME SIDE (to test the "does something already do this" question): helios/src/model.rs:260-273, helios/src/model/catalog.rs:35-65, helios/src/runtime_core/memory.rs:284-320, helios/src/server/request.rs:350-362, helios/src/server/http.rs:59, helios/src/server/config.rs:131-148, docs/cli-design.md:730, :1476, :1482.

NOTES FOR THE REPORT

NOT DONE: no code executed (no pytest/export/serve); head has no CI; VRAM table not reproduced; external recipe packages (recipes live outside this repo) not inspected.

#36 [high] Research summary

Verdict: make it smaller first — but only modestly, and the "drop the whole surface" case from my earlier rounds is now closed.

The change at head 448f70a: 8 files, +91/−28 — code+docs +48/−28 across 7 files, tests +43/−0 in tests/cli/test_planning.py. No CI checks on this head.

Why the big removal is off the table: #454's review (yatesdr) explicitly asked that a resubmission "carry the cap into the core, so that serving rejects longer requests." ignition/preparation/bootstrap.py:132 does the carrying and helios/src/server/request.rs:350 (not opened) does the rejecting, so AGENTS.md:165-166 (explicit maintainer request) is satisfied. The description also now says out loud that the measured VRAM payoff is --kv-cache-limit concurrency's (helios/src/runtime_core/memory.rs:298-319; helios/src/model.rs:261-273) and that the export flag's own delta is max_sequence_tokens.

Could remove: ~17 lines clear-cut (7 test, 10 code), ~19 with two judgement calls, plus ~20 duplicated words of prose. Ranked by size:

Credit where due: the change already subtracts — it deletes 14 lines from docs/cli-design.md and 5 from docs/preparation-development.md, replacing two hand-maintained flag inventories with a pointer to RecipeParameters, and it retires the readerless checkpoint_context plan key.

Left behind: nothing. checkpoint_context has no reader anywhere; no helios/ path becomes dead; --kv-cache-limit is untouched; tests/cli/test_commands.py:80 guards --context, a different spelling that _flag_name still refuses.

Limits: nothing was executed — no pytest, export, or serve; savings are line counts of cited ranges, and the VRAM table is the author's measurement, not reproduced. Full ranked detail, snippets and do-not-cut list are in scratchpad entries #31-#35.

#37 [high] FINAL consolidated findings for head 448f70a (supersedes #31's tally): ~17 lines, ranked

USE THIS NOTE FOR THE RANKED FINDINGS. Entry #31's tally (9 test lines, ~21 total, and the "inline capped_params/oversized_params" item) is superseded by #33/#34 and by this list.

Verdict: make it smaller first, modestly. Change at head 448f70a: 8 files, +91/−28 (code+docs +48/−28 across 7 files; tests +43/−0). No CI checks.

Confirmed subtractions, ranked by lines saved

  1. Should fix — 7 lines, tests/cli/test_planning.py

    • :304 assert stock_plan.context == min(recipe.context, stock_plan.tokens) restates Plan.context (planning.py:353-355), which this PR does not touch. −1
    • :308 assert capped.parameters.context_target == 131072 restates the replace(..., context_target=131072) at :306. −1
    • :313 assert oversized.parameters.context_target == 500000 restates :311. −1
    • :319 assert kwargs["context"] != recipe.context follows from :318 (== 131072) and the fixture's 262144 (:139). −1
    • :332-335 (encoded/decoded/by_key/assert) re-prove from_plan's generic key+scope plumbing already covered for sharded_prefill at :185-196; one line suffices, −3: assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT" (valid: rebuild_manifest.py:320-323 emits {'key','scope','value'} with the enum's string value, parameters.py:46) KEEP: :301-303 (no-target is a no-op), :307/:309 (capping), :312/:314 (above-recipe clamp — the only case exercising the target <= recipe.context gate's false branch), :316-318 (the bootstrap seam), :321-327 (both UsageErrors), :329-331 (reproduction_args, the only coverage of the override at parameters.py:1483-1485). NOT a saving: inlining capped_params/oversized_params — the inlined call exceeds the file's line width.
  2. Should fix — 3 lines, ignition/planning.py:357-363 — body 4 lines → 1: @property def prepared_context(self) -> int: """The context the prepared core serves per request; the recipe max when no target is set.""" return min(self.recipe.context, self.parameters.context_target or self.recipe.context) Safe: min_value=1 (parameters.py:1315) and Plan.__post_init__ calls self.parameters.validate(context) at planning.py:185 before any read, so a resolved target is never 0. Same behaviour, same None semantics.

  3. Should fix — 2 lines, ignition/cli/serve.py:68-70 — two-message conditional → one string: "context_hint": "context is limited by the checkpoint, cache capacity, and --request-context cap", context_hint is appended to context admission errors (helios/src/server/http.rs:59); its neighbour capacity_hint (:71) is already a fixed string; naming a flag that was not passed is noise. Cost: the unset case mentions the flag. serve.py:67 (max_body_bytes from prepared_context) MUST stay.

  4. Nit — 2 lines, ignition/parameters.py:1316-1317 — delete manifest_key="context_target" and scope=ParameterScope.DEPLOYMENT: manifest_parameters falls back to dc_field.name (parameters.py:607-612) since RecipeParameters.manifest_prefix is None (:334), and DEPLOYMENT is the ParamSpec default (:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304), so the two neighbours become inconsistent; behaviour-identical either way, and the manifest-scope assert in finding 1 would catch a mistake.

  5. Nit — 2 lines, one of two homes — the served extent is now reported three times: plan JSON (planning.py:396 "prepared_context"), the startup status line (parameters.py:1560-1561 via serve.py:270-274), and context_hint. Keep one prose home and drop the redundancy: preferred delete the JSON key at planning.py:396 (−1), because to_dict already emits context_target automatically (parameters.py:675-684; dict_section is None so the None-skip at :681 does not apply) and guaranteed_tokens (:411) carries the effect; alternative delete the bespoke status_parts branch (parameters.py:1560-1561, −2). Do not cut both — AGENTS.md:454-456 requires the printed report and recorded measurements to describe what was prepared, which is what status_parts satisfies.

  6. Nit — 1 line, ignition/planning.py:186-190 — target % self.page_tokens already rejects 0 (and min_value=1 forbids it), so drop != 0, and the one-line message needs no wrapper: if target is not None and target <= self.recipe.context and target % self.page_tokens: raise UsageError(f"--request-context {target:,} is not a multiple of the {self.page_tokens:,}-token page size")

  7. Docs — 0 lines, ~20 words, docs/cli-design.md:458 — drop "Command line only; a core's catalog is fixed at export, so changing it requires re-export" (verbatim from the --mixed-prefill row immediately below, :459); and "the prepared per-request context and max_sequence_tokens" names one thing twice. :1426 (owner table) and :448-451 are not duplicates — keep.

Already subtracted by this change (say so in the report)

Do not cut (verified load-bearing)

bootstrap.py:132 (the only seam the export consumes), planning.py:186-190 gate (Helios rejects a misaligned extent: helios/src/model/catalog.rs:50-57), :212 (bench vs served extent), :368 (guaranteed_tokens), :394/396 area, :594 (prefill chunk vs served extent, min with Plan.context), parameters.py:1309-1319 core (flag/group/metavar/value_type=int — needed because a None default resolves to str at :205-216 — and min_value), :1483-1485 (reproduction_args), help.py:46, serve.py:67, both docs rows.

Left behind

None. checkpoint_context has no reader anywhere (search_code); prepared_context readers are serve.py:67/69, planning.py:212/368/396/594, bootstrap.py:132; no helios/ path becomes dead; --kv-cache-limit untouched; tests/cli/test_commands.py:80 guards --context, a different spelling _flag_name still refuses.

STALE — do not repeat

#3 [medium] Should fix: the two-message prefill-chunk branch adds 6 lines to say what the existing 3-line error says

ignition/planning.py:692-701 (PR adds the branch):

result = attempt()
if result is not None:
    effective_context = min(result.context, result.prepared_context)
    if chunk > effective_context:
        if prefill_chunk is None:
            raise UsageError(f"the {effective_context:,}-token request context is below the {chunk:,}-token "
                             f"default prefill chunk; pass --prefill-chunk-size (a multiple of 64) below "
                             f"{effective_context:,} or a larger --request-context")
        raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {effective_context:,}-token context this plan allows")

Stock (single message, 3 lines): if chunk > result.context: raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {result.context:,}-token context this plan allows")

The PR turns 3 lines into 9 and adds a two-message branch to say the same thing: the chunk is larger than the context this plan allows. The special case exists only because a recipe default chunk (4096) can now exceed a small --request-context, and the generic message already names both numbers, which is all a user needs to pick either remedy. The branch costs 6 lines plus a second error string that no test asserts (grep for "request-context"/"positive token count" in tests/ → no matches).

Smaller: keep one message, replace result.context with the prepared context: if chunk > min(result.context, result.prepared_context): raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {min(result.context, result.prepared_context):,}-token context this plan allows") or bind it once in a local. Saves 6 lines of the 7 the hunk adds.

Note the sibling validation at planning.py:459-460 (if context is not None and context <= 0: raise UsageError(... --request-context ...)): it is a caller-guaranteed check. fit() also validates mla_compute_mode, speculation, etc., so per-argument validation is the house style, and it costs 2 lines; it is not worth a separate finding except as part of the total. However it is the only place --request-context 0 is caught, so it must stay if the flag stays.

#4 [medium] Should fix: the docs say the same thing three times, and advertise out-of-scope multi-model hosting

docs/cli-design.md:446 row, trimmed. Present row is 1 very long line that repeats three things the document already says:

  1. "a request that would exceed N is rejected by the engine's standard context ceiling" — already specified at docs/cli-design.md:1443 ("Context limit | The checkpoint maximum, capped by --request-context at export") and :1493 ("Context limit | The smaller of the prepared context ceiling, capped by --request-context, ..."). Those two table rows are the PR's other two doc edits (:1443, :1493) and say the same thing a third time.
  2. "since the per-request cache allocation is sized from the prepared context" — already true for every core and documented at :828-833.
  3. "Command line only; a core's catalog is fixed at export, so changing it requires re-export" — the same trailing sentence is already carried by --mixed-prefill (:447) and by --kv-cache-limit's note that the runtime flags need no re-export (:874-876).

Smaller, one row:

| --request-context N | Cap the prepared per-request context and max_sequence_tokens at N tokens; shorter contexts need less KV per active request. Command line only; changing it requires re-export. | The recipe's maximum context |

and drop the :1443 and :1493 edits (the flag then appears once, in the flag table). ~2 doc lines + roughly half the 446 row's prose. Note the prose also contradicts the change's own rationale: it advertises "a memory-constrained multi-model deployment", which AGENTS.md:171-175 lists as unapproved scope ("multi-model hosting and routing ... require an explicit maintainer decision").

#5 [medium] Nit: the new setting is invisible in the plan report, and derive()'s new parameter is a pure pass-through

  1. Plan.to_dict() (ignition/planning.py:389-442) does not include prepared_context or context_target, although every other plan setting is recorded there (context, checkpoint_context, prefill_chunk, mixed_prefill, ...). AGENTS.md:452-456 requires the plan, its printed report, and recorded measurements to describe what was prepared; the flag changes max_sequence_tokens yet the printed plan and the bench details["configuration"] = plan.to_dict() (ignition/cli/bench.py:237) cannot show it. Fixing this is an addition, so as a subtraction: if the flag is kept, drop the field and derive the value at the single consumer.

  2. Dead/one-sided flag surface: --request-context is added to _preparation_arguments (ignition/cli/init.py:136-170), which serves export, bench and debug-serve — but NOT flare run (docstring of _server_options at ignition/cli/serve.py:60-72 comments "Derive native server settings independently of preparation's physical KV backing", max_body_bytes still uses recipe.context, not the prepared context). So the docs' claim that a request beyond N "is rejected by the engine's standard context ceiling" holds only because the value reaches BasePreparationConfig.context; nothing in ignition's own debug-serve path re-reads it, and the benchmark's --contexts check at planning.py:248 (selection.required_context > self.context) still compares against the recipe max, not the prepared context. That is a behavioural gap, but for the subtraction lens: the flag is worth nothing without the reject path, so the smaller shape is one value on the plan plus the two consumers, not a new flag family threaded through bench.

  3. ignition/cli/preparation.py:56 adds context: int | None = None to derive() and forwards it at :68 — a pure pass-through parameter of the kind the file otherwise avoids only when one command differs (it does not here: all three callers pass args.request_context or nothing). If the flag goes, this parameter goes entirely (2 lines).

  4. No test asserts any of the new behaviour: grep of tests/ for request_context/prepared_context/context_target/--context → no matches (tests/cli/test_commands.py:80's old --context usage-error assertion the maintainer flagged in #454 is gone from main too). The historical #454 review asked for tests that fail without the change; the diff adds none, so as a subtraction there is nothing to trim here, but it means none of the new branches (the positive check, the two-message chunk branch) is protected.

#7 [medium] Per-file examination record: what each changed file contributes and where nothing can be cut

Diff is +35/−15 over 7 files (pr_files). Hunk inventory:

Net: 34 of 35 added lines exist to carry one integer to one consumer; ~15 can go without losing the behaviour the PR claims.

#10 [medium] Blast-radius note: prepared_context is read by only four places, so a field+two-line property is the whole mechanism

Verified consumer set for the PR's one datum (context_target / prepared_context), from a grep of prepared_context|context_target|request_context at the head commit:

So 4 of the 9 changed files (bench.py, preparation.py, serve.py, rebuild_manifest.py — 10 added lines) plus the two planning.py forwards exist only to carry one integer to bootstrap.py:58; the property that does the min() is a two-line replacement for the five-line body.

Also unchanged since the earlier pass: helios is untouched by this PR, so no runtime code becomes dead; docs/cli-design.md:69 (context_hint) and ignition/cli/serve.py:68-69 (max_body_bytes from recipe.context, hint text "limited by the checkpoint") still describe the pre-cap world, and ignition/cli/help.py:38 still advertises --prefill-chunk-size: 64..{recipe.context}.

#34 [medium] Refinement: the cap is reported three times (plan JSON, status line, context_hint); drop one, not the status label

Refinement of finding 5 in entry #31, after checking AGENTS.md:454-456 ("A setting that only experiments need is an advanced flag carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared."):

The cap is reported in three places:

So the subtraction is "pick one home for the served extent", not "delete status_parts": status_parts is what satisfies AGENTS.md:456's printed report. Smallest version: keep status_parts (human report, and the sibling prefill_chunk's absence of a label is a precedent for adding one, not for removing one) and drop the redundant JSON key at planning.py:396 (1 line) — the JSON already carries context_target and context. Alternatively keep the JSON and drop parameters.py:1560-1561 (2 lines). Either way the ADC stays; do not cut both.

Revised totals: ~17 lines clear-cut stands (the one status/JSON line was not counted in it), 18 if the JSON key goes.