#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:
flare run --kv-cache-limit concurrency|context|memorybounds the shared KV pool to one prepared context per active request / one context, applied at core load, "without another export" (docs/cli-design.md:738, :828-833; docs/model-preparation.md:396-402). Implementation:page_ceilingin helios/src/runtime_core/memory.rs:284-331.- The PR's own evidence table is produced at serve time with
--kv-cache-limit concurrency(description: "served at concurrency 1–4 (--kv-cache-limit concurrency)"). So the measured "pool = concurrency × prepared-context" VRAM scaling is the documented behaviour of the pre-existing runtime flag. No re-export is needed for it. - The maintainer's earlier review of the same change (#454, yatesdr, 2026-11-21) asked exactly for this: "start from a concrete workload that --max-concurrency and --kv-cache-limit cannot serve". The resubmission keeps the same shape and the same memory argument.
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):
- ignition/cli/init.py:167-170 (4 lines: flag + 3-line help)
- ignition/cli/preparation.py:56, 68, 65 (derive signature + forward, 2 lines)
- ignition/cli/bench.py:176-177 (2)
- ignition/cli/serve.py:289 and :472 (2)
- ignition/planning.py:453, :535, :591, :674 (fit/plan palette + forward, 4), :459-460 (2, validation), :176 (1, field), :369-373 (5, property)
- ignition/preparation/bootstrap.py:58 (1, the only load-bearing line)
- docs/cli-design.md:446 (1 long table row) + :1443, :1493 (2 edits)
Smallest shape that keeps the one datum: one
Planfield, oneplan()/fit()keyword, one line in bootstrap.py, one docs row — and the error-message branch and the second property dropped (see other notes). ~15 lines of the 35 could go.
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:
-
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 exportedmax_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. -
Should fix (~6 lines). ignition/planning.py:692-701 turns the stock 3-line
--prefill-chunk-sizecheck 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. -
Should fix (~4 lines).
Plan.prepared_context(planning.py:368-373) duplicatesPlan.context:min(recipe.context, N, tokens)is exactlymin(self.context, N), so the five-line body collapses to two, and the extramin(...)at planning.py:694 disappears. -
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.
-
Nit (~2 lines).
derive()'s newcontextparameter (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:
-
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 tomin(self.context, self.context_target)there is no separate branch, so one case suffices. ~4 lines. -
context=0andcontext=-1hit one branch. planning.py:461-462 validatescontext <= 0in a single check; twopytest.raisesblocks (:235-238) exercise the same line. ~2 lines. -
d["context"] == capped.context(:247) restates :227. ~1 line. -
The "no context_target when unset" block (:259-265, 7 lines) re-proves
from_plan's generic skip. rebuild_manifest.py:350-352add()returns early onvalue is Nonefor every parameter; the generic behaviour is already covered by the sibling tests' decode loop (tests/cli/test_planning.py:92-106). Alsoreproduction_argumentsgating is the sameis not Nonepattern used by every other flag (:266-319). ~6 lines. -
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 setsuint_valueandint64_valuereads 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):
- Blocking (~28 lines) — the flag re-implements runtime
--kv-cache-limit. Drop--request-context,Plan.context_target, thecontext=keyword onplan()/fit()/derive(), the<= 0check,prepared_contextand 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) - 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 onint64_valuethat cannot pass. (entry #9) - Should fix (~6 lines) — planning.py:692-701 turns the stock 3-line chunk check into a 9-line two-message branch. (entry #3)
- Should fix (~4 lines) —
prepared_contextduplicatesPlan.context:min(recipe.context, N, tokens)==min(self.context, N), and the extraminat :696 goes. (entry #2) - 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)
- Nit (~2 lines) —
derive()'scontextparameter is a pure pass-through;to_dict()recordscontext_targetbut not the effectiveprepared_contextthe 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):
- 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_ceilingin 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. - 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,0and-1hit one<= 0branch, and the seven-line "no context_target when unset" block re-provesfrom_plan's genericadd()-skips-Nonerule. Also,:257assertsvalue.int64_valuewhile_preparation_value(rebuild_manifest.py:332-333) emitsuint_valuefor a non-negative int — that assertion cannot pass. - 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.
- Should fix, ~4 lines —
prepared_context(planning.py:370-375) duplicatesPlan.context:min(recipe.context, N, tokens)ismin(self.context, N), which also makes the extraminat :696 dead. - 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.
- Nit, ~2 lines —
derive()'scontextkeyword is a pure pass-through, andto_dict()recordscontext_targetbut not the effectiveprepared_contextthe 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):
-
"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 assertsint64_valuewhere_preparation_value(rebuild_manifest.py:332-333) emitsuint_value, so that line cannot pass. -
"+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.
-
Unchanged and still true:
ignition export M --ranks 2 --request-context Ndoes 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-57requirement);to_dict()/reproduction_arguments/from_planall 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):
-
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-contextfrom all four entry points, drop Plan.context_target and prepared_context; optionally oneBasePreparationConfig.contextinteger 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. -
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")forcontext=100: there is NO page-multiple validation at this head.grep "multiple of" ignition/planning.pyfinds only the pre-existing prefill-chunk check at :636-637, whichcontext=100does 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:254by_key["context_target"].value.int64_value == 131072: _preparation_value (rebuild_manifest.py:330-333) emitsuint_valuefor 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. -
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 thedtemp is one line); theint64_valueline 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. -
SHOULD FIX (~6 lines) — the
<= 0validation sits infit(planning.py:467-468), whichplan()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 outsidePlan.__post_init__. SincePlanalready validates every other flag there (:266-296), and the test drives everything throughplanning.plan(...), it can move or go with finding 1. -
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)equalsreturn self.recipe.context if self.context_target is None else min(self.context, self.context_target). NOTE: thecontext_target is Noneearly 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. Themin(result.context, result.prepared_context)at :709 is also load-bearing for the no-target case. -
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):
- ignition/cli/serve.py:68
max_body_bytesstill sized fromrecipe.context, :69context_hintstill says "context is limited by the checkpoint and available cache capacity" — both misdescribe a capped core. - ignition/cli/help.py:38
--prefill-chunk-size: 64..{recipe.context}advertises a range above the effective prepared context. - ignition/bench/runner.py:388 validates
case.context_tokens + required > layout.context(pool-bound), not the new cap.
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):
- 9 files, +84 / −18. Code+docs +37 / −18; tests +47 / −0.
- Per file added/removed: docs/cli-design.md +3/−2; ignition/cli/init.py +2/−0; ignition/cli/bench.py +3/−1; ignition/cli/preparation.py +1/−1; ignition/cli/serve.py +5/−4; ignition/planning.py +19/−9; ignition/preparation/bootstrap.py +1/−1; ignition/preparation/rebuild_manifest.py +3/−0; tests/cli/test_planning.py +47/−0.
Savings tally, ranked (each verified in the code at pr/533, details in entry #15):
- 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). - Remove the two unfounded test assertions (test_planning.py:238-241 page-multiple block, :254 int64_value) → ~5 lines.
- 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.
- Move/merge the
<= 0check out of fit (planning.py:467-468) into post_init beside :266-296, or delete with finding 1 → ~2 lines. - Collapse prepared_context body (planning.py:377-381) → ~1-2 lines; keep the None early return and keep the min at :709.
- 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):
- :301
assert stock_plan.parameters.context_target is None— restates the field default. - :303
assert stock_plan.context == min(recipe.context, stock_plan.tokens)— restates the pre-existingPlan.context(planning.py:353-355), which this PR does not change. - :307
assert capped.parameters.context_target == 131072— restates the input at :305. - :326-329 (4 lines: ParseDict/FromString/by_key/scope assert) — re-proves
from_plan's generic value+scope plumbing already covered at tests/cli/test_planning.py:185-196 and :392-395; andParameterScope.DEPLOYMENTisParamSpec's default (parameters.py:91). Keep :324-325, which is the new datum (flag + value inreproduction_args). Keep: :302 (no-op claim), :308 (property), :315-317 (0 → "must be a positive integer", matches "--request-context"), :319-321 (100 → page check), :324-325.
#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:
manifest_key="context_target"(:1317) —manifest_parametersfalls back todc_field.name(:607-612), andRecipeParameters.manifest_prefixis unset (onlySpeculationParameterssets one, :734), so the emitted key is alreadycontext_target.scope=ParameterScope.DEPLOYMENT(:1318) —ParamSpec.scopedefault isParameterScope.DEPLOYMENT(:91).repro_always=True(:1319) —reproduction_argsemits a non-boolean value whenevervalue != default_value(:651), and the default isNone(andfrom_planpassesdefaults=plan.recipe.parameters), so 131072 is emitted without it. Caveat: the siblingprefill_chunk/max_concurrencyspecs also spell these out, so this is style-consistent; ~2-3 lines. Load-bearing here:min_value=1(0 would otherwise pass0 % 64 == 0),max_fn,value_type=int(default is None),metavar,group,help.
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:
ignition/parameters.py:1316max_fn=_recipe_context_limitmakesvalidate_fields(parameters.py:533-545) reject any--request-contextabovecontext.recipe.contextwith "must be 1 through 262,144".ignition/planning.py:360-363still computesmin(self.recipe.context, target), which that bound makes unreachable.
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:
- keep
max_fn→docs/cli-design.md:468grows an upper bound andplanning.py:363becomesreturn self.recipe.context if target is None else target; - or drop
max_fn→ theminat :363 becomes live and the docs row is already correct (help then loses the "…through 262,144" suffix from_format_help, :250-260).
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:
ignition/cli/help.py:46printsContext: {recipe.context:,} tokensforMODEL --help; harmless (it describes the recipe), but it is where a capped user looks first — no line change needed.- Nothing else reads
recipe.contextfor a user-visible bound:ignition/cli/serve.py:67-68both moved toplan.prepared_context, and the prefill-chunk bound (parameters.py:1458) is validated against the recipe max whileplanning.pyindependently rejects a chunk above the pool — the cap does not enter either.--request-context 8192with the default chunk 4096 is fine; a chunk between the cap and the recipe max still exports (helio'svalidate_prefillat helios/src/scheduler.rs:66-77 checks chunk ≤ max_sequence_tokens only at load). So the cap is not checked against--prefill-chunk-sizeat export:ignition plan --request-context 4096(min_value 1) with default chunk 4096 is OK, but--request-context 2048 --prefill-chunk-size 4096exports a core Helios rejects. Reporting as a nit, not proposing a new check.
#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:
- 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 exportedmax_sequence_tokens, i.e. serving rejecting a request longer than N — the datum #454 asked to see justified. - Tests: 11 of the 37 (4 of them cannot pass — entry #19).
- parameters.py spec: ~3 lines that restate ParamSpec defaults (entry #20).
- planning.py:363: 1 line once the max_fn/min duplication is settled (entry #21).
- 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:
- ~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 exportedmax_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. - 11 of 37 test lines (entry #19): 4 cannot pass (
context_target=500000trips themax_fnbound atparameters.py:1316/:533-545before the asserts attest_planning.py:311-313); 7 more restate the input,Plan.context, orfrom_plan's generic plumbing already covered attest_planning.py:185-196/:392-395. - 3 lines of
ParamSpecrestated as defaults (entry #20):manifest_key,scope=ParameterScope.DEPLOYMENT,repro_always=Trueatparameters.py:1317-1319. - 1 line: the clamp is implemented twice —
max_fnrejects target > recipe max, soplanning.py:363'smin()is unreachable, anddocs/cli-design.md:468documents the dead one ("resolves to the smaller of N and the recipe maximum"). Settlement: keep the rejection and makeplanning.py:363return self.recipe.context if target is None else target, and state the upper bound in the docs row. - 0 lines: the docs row's trailing re-export clause duplicates
--mixed-prefill's atdocs/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:
- The
context_target=500000case (tests/cli/test_planning.py:310-313) fails becausevalidate_fields(ignition/parameters.py:533-545) compares againstmax_fn=_recipe_context_limit(:1316,:1268-1269) and the fixture recipe declarescontext=262144(tests/cli/test_planning.py:139-140).planning.plan()validates atignition/planning.py:540before sizing, so the UsageError precedes the asserts. Onepytest tests/cli/test_planning.pysettles it. manifest_key/scope/repro_alwaysredundancy (#20) rests onParamSpecdefaults atignition/parameters.py:89-92,manifest_parameters' fallback at:607-612, andreproduction_args'value != default_valueat:651.- The unreachable clamp (#21) rests on the same
max_fnbound versusignition/planning.py:360-363.
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):
- max_fn is GONE from the spec (ignition/parameters.py:1309-1320 has only min_value=1), so the oversized-target test at tests/cli/test_planning.py:310-313 now PASSES, and planning.py:363's min() is live, not unreachable.
- repro_always is GONE.
--request-contextnow reaches reproduction_args (parameters.py:1484-1485), so the earlier "not reproducible" blocker is fixed. - The alignment check is gated
target <= self.recipe.context(planning.py:187), which is load-bearing: it keeps an above-recipe target a no-op as the docs promise (docs/cli-design.md:468) while still rejecting a stray mid-range value. Do not propose deleting the gate or the 5-line check: Helios rejects a non-page-multiple prepared extent at load (helios/src/model/catalog.rs:50-57), and rounding silently would break the charter's no-silent-drop rule.
FINDINGS, RANKED BY LINES SAVED
- ~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 contextcannot 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. - 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 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, sooris safe). Keep the docstring. - 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.
- 2 lines — ignition/parameters.py:1316
manifest_key="context_target"and :1317scope=ParameterScope.DEPLOYMENTrestate 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. - 1 line — ignition/planning.py:396
"checkpoint_context": self.recipe.contexthas 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. - 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-prefillrow 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 toRecipeParameterswould 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)
- ignition/parameters.py +14/−0: spec block :1309-1320 (12 lines) + reproduction_args :1484-1485 (2).
- ignition/planning.py +15/−2: post_init check :186-190 (5); benchmark line :212 (1 changed); prepared_context :357-363 (7, incl. blank + decorator/docstring); plan() :594-597 (3 added, 2 removed).
- ignition/cli/serve.py +3/−2 (max_body_bytes and the two-branch context_hint).
- ignition/cli/help.py +1/−1; ignition/preparation/bootstrap.py +1/−1.
- docs/cli-design.md +3/−2 (universal-field list :448, table row :468, ownership table :1436); docs/preparation-development.md +2/−1.
- tests/cli/test_planning.py +37/−0 (one new test function, :295-329 plus blank lines). Totals: 8 files, +79/−10. Code+docs +42/−10 across 7 files; tests +37/−0.
SMALLER VERSIONS (literal)
- 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.
- 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).
- 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.
- 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.
- 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)
-
Should fix, 9 of +43 test lines (tests/cli/test_planning.py):
- :304
assert stock_plan.context == min(recipe.context, stock_plan.tokens)restates untouchedPlan.context(planning.py:353-355). - :308 / :313 restate the input passed one line above (:306 / :311).
- :319
assert kwargs["context"] != recipe.contextis implied by :318's== 131072. capped_params(:306) andoversized_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 forsharded_prefillat :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), bothUsageErrorcases, and :330-331 (reproduction_args, the only coverage of the override at parameters.py:1483-1485).
- :304
-
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) andPlan.__post_init__callsself.parameters.validate(context)(planning.py:185) before any read, so a resolved target is never 0. -
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 neighbourcapacity_hint(:71) is a fixed string;context_hintis 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_bytesfromprepared_context) must stay. -
Nit, 2 lines — parameters.py:1316-1317:
manifest_key="context_target"andscope=ParameterScope.DEPLOYMENTrestate derived defaults (manifest_parameters falls back todc_field.name, parameters.py:607-612, withmanifest_prefixNone at :334; DEPLOYMENT is the ParamSpec default at :89). Caveat: siblingprefill_chunkspells both out (:1303-1304). -
Nit, 2 lines — parameters.py:1560-1561: the bespoke
status_partsbranch now duplicates whatPlan.to_dict()already reports —context_target(auto, parameters.py:675-684 withdict_sectionNone) andprepared_context(planning.py:396). The siblingprefill_chunkhas no status label either. Trade-off: keep it if the "Select GPUs." line (serve.py:270-274) must name the cap in prose. -
Nit, 1 line — planning.py:186-190: drop
!= 0from the modulo test and unwrap theraise, 5 lines → 4. -
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-prefillrow at :459; and "the prepared per-request context andmax_sequence_tokens" names one thing twice.
Already subtracted by the change (credit)
- docs/cli-design.md −14 and docs/preparation-development.md −5 replace two hand-maintained flag inventories with a pointer to
RecipeParameters. Good. - planning.py:396 replaces the readerless
checkpoint_contextkey withprepared_context;search_codefinds no reader for either, so no consumer breaks.
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
- planning.py:185 validates parameters before :186/:212 and before any
prepared_contextread; parameters.py:512 skips None, :541 turns min_value=1 into "must be a positive integer" →orform safe. - parameters.py:205-216
_value_typereturns str for a None default, sovalue_type=intis load-bearing.metavar="N",group,min_value,flag,helplikewise. - parameters.py:607-612 manifest key fallback + :334
manifest_prefix = None(only SpeculationParameters sets one, :734) →manifest_key="context_target"derivable; :89 scope default DEPLOYMENT. - parameters.py:675-684
to_dictemitscontext_target(the None skip needsdict_sectionnon-None, which RecipeParameters lacks) → the printed plan JSON already names the setting. - serve.py:206/:435 print
plan.to_dict(); serve.py:270-274 is the status_parts startup line; helios/src/server/http.rs:59 appendscontext_hintto context admission errors. - reply on #454 (read_item 454): yatesdr's "A resubmission should … carry the cap into the core, so that serving rejects longer requests" — the maintainer request that closes the necessity argument.
- helios/src/runtime_core/memory.rs:284-320
page_ceiling(Concurrency → concurrency × context pages); helios/src/model.rs:261-273fit_context(clamp to pages × page_tokens); helios/src/model/catalog.rs:50-57 (prepared extent must be a page multiple); helios/src/server/request.rs:350 (admission). search_codeforcheckpoint_context→ no matches anywhere at this head;prepared_contextreaders are serve.py:67/69, planning.py:212/368/396/594, bootstrap.py:132 and the test.- No linter config (pyproject/setup.cfg/ruff.toml absent; no line-length rule found), so the suggested folds were checked against existing ~110-120 col lines rather than a stated limit.
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:
- :304
assert stock_plan.context == min(recipe.context, stock_plan.tokens)— 1 - :308
assert capped.parameters.context_target == 131072— 1 (restates :306'sreplace(..., context_target=131072)) - :313
assert oversized.parameters.context_target == 500000— 1 (restates :311) - :319
assert kwargs["context"] != recipe.context— 1 (follows from :318== 131072and the fixture's 262144 at :139) - :332-335 (encoded/decoded/by_key/assert, 4 lines) → 1 line: saves 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 scope as the enum's string value, parameters.py:46) NOT a saving: inliningcapped_params/oversized_params(2 lines → 2 lines; the inlined call exceeds the file's line width). My earlier note claimed 2 lines there — wrong, drop that. Judgement calls, +2 at most: :302 (context_target is None, the field default) and :304 above.
CODE savings = 10:
- planning.py:357-363 body 4→1 — 3
- serve.py:68-70 two-message hint → one string — 2
- parameters.py:1316-1317
manifest_key/scope— 2 - parameters.py:1560-1561 bespoke status_parts branch — 2
- planning.py:186-190 modulo
!= 0+ unwrapped raise — 1
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
- The description's evidence commands use
--kv-cache-limit concurrency; that flag's pool sizing (memory.rs:298-319) is what produces the per-slot VRAM delta. The description now states this itself (the "Note:" paragraph). No deception, but the report should say the measured saving is the runtime flag's and the export flag's delta ismax_sequence_tokens. - No prompt-injection attempt found in the description, the diff, the docs, or the review comment on #454.
- Precedent check for adding a status label:
prefill_chunk(parameters.py:1294-1308) has nostatus_label; few fields do (:1366, :1375). So the new status_parts branch is off-pattern but justified by AGENTS.md:456 (see entry #34). - Tests/cli/test_commands.py:80 (from #454's review) concerns
--context, not--request-context; the new flag does not resurrect the rejected spelling (_flag_name, parameters.py:186-193, usesspec.flag). No leftover.
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:
- 7 test lines (
tests/cli/test_planning.py): :304 restates untouchedPlan.context; :308 and :313 restate the value passed one line above; :319 is implied by :318; :332-335 re-provefrom_plan's generic key/scope plumbing already covered at :185-196 and collapse to one dict-comprehension assert. - 3 lines:
prepared_context's four-line body →return min(self.recipe.context, self.parameters.context_target or self.recipe.context), safe becausemin_value=1andvalidateruns first (planning.py:185). - 2 lines: the two-message
context_hint(serve.py:68-70) → one string; its neighbourcapacity_hintis a fixed string. - 2 lines:
manifest_key="context_target"andscope=DEPLOYMENT(parameters.py:1316-1317) are derived defaults (:607-612, :89). - 2 lines: the bespoke
status_partsbranch (parameters.py:1560-1561) — or, better, the redundantprepared_contextkey in the plan JSON (planning.py:396); the served extent is now reported three times and one home is enough. - 1 line: planning.py:186-190 folds (
% self.page_tokensalready rejects 0) and itsraiseneed not wrap. - Prose:
docs/cli-design.md:458repeats the re-export clause verbatim from the--mixed-prefillrow.
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
-
Should fix — 7 lines, tests/cli/test_planning.py
- :304
assert stock_plan.context == min(recipe.context, stock_plan.tokens)restatesPlan.context(planning.py:353-355), which this PR does not touch. −1 - :308
assert capped.parameters.context_target == 131072restates thereplace(..., context_target=131072)at :306. −1 - :313
assert oversized.parameters.context_target == 500000restates :311. −1 - :319
assert kwargs["context"] != recipe.contextfollows 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 forsharded_prefillat :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 thetarget <= recipe.contextgate'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: inliningcapped_params/oversized_params— the inlined call exceeds the file's line width.
- :304
-
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) andPlan.__post_init__callsself.parameters.validate(context)at planning.py:185 before any read, so a resolved target is never 0. Same behaviour, same None semantics. -
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_hintis appended to context admission errors (helios/src/server/http.rs:59); its neighbourcapacity_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_bytesfromprepared_context) MUST stay. -
Nit — 2 lines, ignition/parameters.py:1316-1317 — delete
manifest_key="context_target"andscope=ParameterScope.DEPLOYMENT:manifest_parametersfalls back todc_field.name(parameters.py:607-612) sinceRecipeParameters.manifest_prefixis None (:334), and DEPLOYMENT is the ParamSpec default (:89). Caveat: the siblingprefill_chunkspells 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. -
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), andcontext_hint. Keep one prose home and drop the redundancy: preferred delete the JSON key at planning.py:396 (−1), becauseto_dictalready emitscontext_targetautomatically (parameters.py:675-684;dict_sectionis None so the None-skip at :681 does not apply) andguaranteed_tokens(:411) carries the effect; alternative delete the bespokestatus_partsbranch (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. -
Nit — 1 line, ignition/planning.py:186-190 —
target % self.page_tokensalready rejects 0 (andmin_value=1forbids 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") -
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-prefillrow immediately below, :459); and "the prepared per-request context andmax_sequence_tokens" names one thing twice.:1426(owner table) and:448-451are not duplicates — keep.
Already subtracted by this change (say so in the report)
- docs/cli-design.md −14 and docs/preparation-development.md −5 replace two hand-maintained flag inventories with a pointer to
RecipeParameters. - planning.py:396 retires the readerless
checkpoint_contextkey.
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
- #1 (drop the whole flag as duplicating --kv-cache-limit): closed by the #454 maintainer request; keep only as a scope observation, not a recommendation.
- #2 (
prepared_contextduplicatesPlan.context): false —Plan.contextincludes the pool (min(recipe.context, tokens)),prepared_contextdeliberately does not, and #594 relies on the difference. - #3 (prefill-chunk two-message branch): gone; the branch is now a single message.
- #5's "no test covers the behaviour" and #8/#27/#30's line totals for older heads.
- #31's own tally and its inlining item (superseded by this note).
#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:
- "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.
- "since the per-request cache allocation is sized from the prepared context" — already true for every core and documented at :828-833.
- "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
-
Plan.to_dict()(ignition/planning.py:389-442) does not includeprepared_contextorcontext_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 changesmax_sequence_tokensyet the printed plan and the benchdetails["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. -
Dead/one-sided flag surface:
--request-contextis added to_preparation_arguments(ignition/cli/init.py:136-170), which serves export, bench and debug-serve — but NOTflare 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 usesrecipe.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--contextscheck 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. -
ignition/cli/preparation.py:56addscontext: int | None = Nonetoderive()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 passargs.request_contextor nothing). If the flag goes, this parameter goes entirely (2 lines). -
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--contextusage-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:
- ignition/preparation/bootstrap.py:58 (+1/−1) —
"context": plan.prepared_contextinstead ofplan.recipe.context. The only load-bearing line in the PR; it is what lowersBasePreparationConfig.context(bootstrap.py:33, default 262144) and therefore the core'smax_sequence_tokens. Nothing to subtract. - ignition/cli/init.py:167-170 (+4) — flag + 3-line help on
_preparation_arguments, so it lands on export, bench and debug-serve at once. Nothing to cut within it; it exists only to feed the line above. - ignition/cli/preparation.py:56 and :68 (+2/−1) —
derive()keyword and forward. Pure pass-through (entry 5). - ignition/cli/bench.py:176-177 (+2/−1) — same forward from
run(). Tracing further:_measure→plan.to_dict()fordetails["configuration"](bench.py:237);ignition/bench/runner.py:388checkscase.context_tokens + required > layout.contextagainst the recipe max, unchanged. So bench gains the flag but no visible consequence beyond preparation. Nothing else to cut in the file. - ignition/cli/serve.py:289 and :472 (+2/−2) — forwards from
_prepare(export path) anddebug_serve._server_options(serve.py:60-72) still sizesmax_body_bytesfromrecipe.contextand states "context is limited by the checkpoint and available cache capacity"; that inconsistency is a defect note, not a subtraction. - ignition/planning.py (+21/−7) — field :176 (+1), property :368-373 (+5, entry 2), positive check :459-460 (+2),
context_targetforward :535 (+1),fit/plankeywords :453/:591 (+2), thecontext=contextforward :674 (+1), the chunk branch :692-701 (+7/−3, entry 3). Every one of these is scaffolding for bootstrap.py:58 except the chunk branch and the property, both of which have smaller equivalents. - docs/cli-design.md (+3/−2) — :446 row and the two table-row rewords :1443/:1493 (entry 4).
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:
- ignition/preparation/bootstrap.py:58 —
"context": plan.prepared_context→BasePreparationConfig.context(bootstrap.py:33, default 262144) → Heliosprepared_sequence_tokens(helios/src/server/config.rs:131) →limits.max_sequence_tokens(:148), admission-enforced (helios/src/model/admission.rs:150-158) and re-fit to pool capacity byModelConfig::fit_context(helios/src/model.rs:261-273). Load-bearing. - ignition/planning.py:248 — benchmark
required_contextcheck. - ignition/planning.py:696 — prefill-chunk check.
- ignition/planning.py:432 (to_dict), rebuild_manifest.py:264-265, :390 — reporting/reproduction only.
- The forward chain: cli/init.py:167-170 (flag) → cli/serve.py:206 (multi-host), :289 (export), :472 (debug-serve), cli/bench.py:177 → preparation.py:56/68 → planning.plan():591 → fit():455/537 → Plan.context_target (planning.py:176).
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:
Plan.to_dict()JSON,"prepared_context"(planning.py:396), pluscontext_targetfor free (parameters.py:675-684;RecipeParameters.dict_sectionis None so the None-skip at :681 does not apply). Printed to stderr at serve.py:206 and :435 and bench.py:194.status_parts, "request context N tokens" (parameters.py:1560-1561), on the "Select GPUs." startup line (serve.py:270-274).context_hint(serve.py:68-70), appended by Helios to context admission errors (helios/src/server/http.rs:59).
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.