Key findings
Verdict: make it smaller first — but only modestly. PR #533 (head 448f70a, 8 files, +91/−28) is no longer a case for wholesale removal: issue/PR #454's review asked for exactly this capability ("A resubmission should … carry the cap into the core, so that serving rejects longer requests"), and ignition/preparation/bootstrap.py:132 + Helios admission satisfy AGENTS.md:165-166 ("must address an explicit maintainer request"). What remains is ~17 lines of redundancy, mostly in the new test and in three places that restate defaults the parameter system already derives.
- ~17 lines removable (7 test lines, 10 code lines; ~18 if the redundant plan-JSON key also goes) out of +91, plus ~20 duplicated words in
docs/cli-design.md:458. - Biggest items: the new test restates its own inputs and re-proves generic manifest plumbing (7 lines);
prepared_context's 4-line body collapses to onemin(3); the two-branchcontext_hintcollapses to one string (2);manifest_key/scoperestateParamSpecdefaults (2); the served extent is reported three times where one home suffices (2). - Credit: the change already subtracts — it deletes 14 lines from
docs/cli-design.mdand 5 fromdocs/preparation-development.md, replacing two hand-maintained flag inventories with a pointer toRecipeParameters, and retires the readerlesscheckpoint_contextplan key. - Nothing left behind:
checkpoint_contexthas no reader anywhere; nohelios/path becomes dead;--kv-cache-limitis untouched;tests/cli/test_commands.py:80guards--context, a different spelling that_flag_namestill refuses. - Scope observation, not a recommendation: the column of the description's VRAM table comes from
--kv-cache-limit concurrency(pool sizing inhelios/src/runtime_core/memory.rs:298-319;fit_contextinhelios/src/model.rs:261-273), which is an existing runtime flag; the export flag's own delta ismax_sequence_tokens. The description now says this itself, so it is not a finding against the code — just the right way to judge the payoff.
Counts (from pr_files, head 448f70a)
| File | +/− |
|---|---|
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 |
| Total | +91/−28 (code+docs +48/−28 across 7 files; tests +43/−0) |
Confirmed subtractions, ranked by lines saved
1. Should fix — 7 lines, tests/cli/test_planning.py (of +43)
Four assertions restate what the line above them or an untouched property already fixes, and the manifest block re-proves generic plumbing already covered at tests/cli/test_planning.py:185-196:
:304assert stock_plan.context == min(recipe.context, stock_plan.tokens)restatesPlan.context(ignition/planning.py:352-355), which this PR does not touch. −1:308assert capped.parameters.context_target == 131072restates thereplace(..., context_target=131072)at:306. −1:313assert oversized.parameters.context_target == 500000restates:311. −1:319assert kwargs["context"] != recipe.contextfollows from:318(== 131072) and the fixture's 262144 at:139. −1:332-335(four lines:ParseDict→FromString→dict→assert) re-provefrom_plan's key+scope plumbing; the manifest dict already carries{'key','scope','value'}with the enum's string value (ignition/preparation/rebuild_manifest.py:320-323,ignition/parameters.py:46). One line suffices, −3:
assert {p["key"]: p["scope"] for p in manifest["parameters"]}["context_target"] == "PREPARATION_PARAMETER_SCOPE_DEPLOYMENT"
KEEP: :301-303 (no-target is a no-op), :307/:309 (capping), :312/:314 (above-recipe clamp — the only case exercising the false branch of the target <= self.recipe.context gate at planning.py:187), :316-318 (the bootstrap seam), :321-327 (both UsageError cases), :329-331 (reproduction_args, the only coverage of the override at ignition/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; the None branch and the min are one expression:
@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 (ignition/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. Same behaviour, same None semantics.
Do not fold this into Plan.context (planning.py:352-355): Plan.context is min(recipe.context, self.tokens) and includes the pool; prepared_context deliberately does not, and the prefill-chunk check at :594-597 relies on the difference.
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 (not opened)); its neighbour capacity_hint (serve.py:71) is already a fixed string. Cost: the unset case mentions a flag that was not passed. serve.py:67 (max_body_bytes from prepared_context) MUST stay — the body limit has to follow the cap.
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) because RecipeParameters.manifest_prefix is None (:334), so the key stays "context_target", and DEPLOYMENT is the ParamSpec default (parameters.py:89). Caveat: the sibling prefill_chunk spells both out (:1303-1304), so the two neighbours become inconsistent; behaviour is identical either way, and the manifest-scope assertion in finding 1 catches a mistake.
5. Nit — 2 lines, one of two homes
The served extent is now reported three times: the plan JSON "prepared_context" key (planning.py:396), the startup status line request context N tokens (parameters.py:1560-1561 via serve.py:270-274), and context_hint (serve.py:68-70). Keep one prose home. Preferred: delete the JSON key at planning.py:396 (−1) — 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 (planning.py:368) 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 plan, its 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 single-line message needs no wrapper — 5 lines → 4:
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.
Total: ~17 lines clear-cut (~18 with finding 5), ~20 words of prose, out of +91/−28.
Already subtracted by this change (worth saying in review)
docs/cli-design.md−14 anddocs/preparation-development.md−5 replace two hand-maintained flag inventories with a pointer toRecipeParameters(cli-design.md:446-453,preparation-development.md:17-21).planning.py:396retires the readerlesscheckpoint_contextkey (search_codefinds no reader anywhere at this head).
Do not cut (verified load-bearing)
bootstrap.py:132 (the single seam all recipes consume — this is what carries the cap into the core); planning.py:186-190 page-multiple gate (Helios rejects a misaligned extent: helios/src/model/catalog.rs:50-57); :212 bench vs served extent (pool-aware: an uncapped plan with a small pool still rejects); :368 guaranteed_tokens; :394/396 region; :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 parameters.py:205-216 — min_value); :1483-1485 reproduction_args override (base-class loop skips base-class fields at :1491-1495); help.py:46; serve.py:67; both docs rows.
Left behind
None. checkpoint_context has no reader anywhere; prepared_context readers are serve.py:67/69, planning.py:212/368/396/594, bootstrap.py:132 and the test; no helios/ path becomes dead; --kv-cache-limit is untouched; tests/cli/test_commands.py:80 guards --context, a different spelling.
Open questions / limits
- Nothing was executed: no pytest, no export, no serve, and the head carries no CI checks. All savings are line counts of the cited ranges.
- The VRAM table is the author's measurement (one RTX PRO 6000 Blackwell), not reproduced; my only claim about it is that the command line names
--kv-cache-limit concurrency, whose pool sizing (memory.rs:298-319) produces the per-slot delta. - No prompt-injection attempt was found in the description, the diff, the docs, or the review on #454.
- Whether the JSON key or the status label should be the surviving home for the served extent (finding 5) is a maintainer preference; both are one-line edits.