#1 [high] Blocking: multi-host export silently ignores --request-context
ignition/cli/serve.py:193-206 (_export_hosts, the ignition export --ranks N path) builds its plan with an explicit planning.plan(...) call whose keyword list ends at row_shard_prefill=args.row_shard_prefill) — there is no context=args.request_context. The flag is registered on every preparation command (ignition/cli/init.py:167-170, via _preparation_arguments), so ignition export MODEL --ranks 2 --request-context 131072 accepts the value and then prepares a core at the recipe maximum, with no warning. Compare the three paths that do thread it: _prepare (serve.py:289), debug_serve (serve.py:472), bench.run (bench.py:177).
Why it matters: AGENTS.md "Be explicit and pin everything" / charter "Don't silently ignore API fields" and AGENTS.md:165-169 (explicit behavior). The whole claimed benefit is a smaller max_sequence_tokens; a multi-host deployment (a supported shape per AGENTS.md:157-163) gets a full-context core and no error, which the user only discovers when the VRAM payoff does not appear or the request ceiling is not enforced.
Fix: pass context=args.request_context in _export_hosts. Verified in code: diff touches only serve.py:286 and :469 (the _prepare and debug_serve call sites), not the _export_hosts call at :193.
#2 [high] Blocking: cap is absent from plan report and rebuild manifest
Three reporting surfaces omit the new setting, so neither the printed plan, the benchmark record, nor the rebuild manifest describes what was prepared:
Plan.to_dict(ignition/planning.py:389-442) still emits"context": self.contextand"checkpoint_context": self.recipe.context(:430) and no key forcontext_targetorprepared_context.self.contextstays stock by design (planning.py:363-366), so the plan JSON printed at serve.py:215/485, bench.py:182 reports a context the core does not serve. A core exported with--request-context 131072printscontext: 262144.rebuild_manifest.reproduction_arguments(ignition/preparation/rebuild_manifest.py:231-318) never adds--request-context, so the recorded reproduction command rebuilds a full-context core.rebuild_manifest.from_plan(rebuild_manifest.py:343-454) records no parameter for it, so nothing in the manifest distinguishes two cores that differ only in prepared context. bench.py:243-248 also selects a fixed key list fromplan.to_dict()that has no context key.
Why it matters: AGENTS.md Configuration ("A setting ... is carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared"), AGENTS.md 431-444 (model core compatibility, metadata describes the prepared capacities), and docs/runtime-core-design.md:389 (combine-scope parameters). A core's prepared context is now a deployment-visible capacity; today it is invisible in every artifact.
Fix: add context_target (and the resolved prepared_context) to Plan.to_dict, --request-context to reproduction_arguments when the target is set, and a parameter entry in from_plan.
#5 [high] Research summary
I reviewed all seven changed files in context (ignition/planning.py, ignition/cli/{init,bench,preparation,serve}.py, ignition/preparation/bootstrap.py, docs/cli-design.md) against the charter, AGENTS.md, and docs/cli-design.md, and followed the cap into Helios (prepared_sequence_tokens → fit_context → catalog validation) and into core export. Four findings are on the scratchpad.
Two are blocking. First, the multi-host export path (_export_hosts, ignition/cli/serve.py:193-206) never passes context=args.request_context although --request-context is registered for every preparation command, so a --ranks N export silently prepares at the recipe maximum — the exact "cap does not reach the core" failure of the earlier review, now confined to one path. Second, the new setting is invisible in every artifact the project requires to describe preparation: Plan.to_dict still reports context/checkpoint_context only, and neither reproduction_arguments nor from_plan records --request-context, so the printed plan, benchmark record, and rebuild manifest all describe a core that was not prepared.
Two should-fix items: the target is only validated as positive, never against the page size, yet prepared_context becomes max_sequence_tokens that Helios requires to be page-aligned (helios/src/model/catalog.rs:44-58) — a non-multiple target looks like it exports a core that fails to load, which only an export test can settle; and the change adds no tests for shared planning behavior, while its stated motivation (headroom for a co-run model) leans on multi-model hosting, which the charter lists as a non-goal requiring sign-off. The measured VRAM table does answer the earlier "hypothetical deployment" objection, and the --kv-cache-limit overlap the prior review raised is now reconciled by the description's measurement setup, though the description would be stronger if it said what --kv-cache-limit alone cannot do.
#6 [high] Verified clean: cap does reach the core, and omission is a no-op
Checked and found correct, so the report can say these were verified rather than assumed:
- The cap reaches the core. ignition/preparation/bootstrap.py:58 now passes
plan.prepared_contextintoBasePreparationConfig.context(bootstrap.py:33), and every recipe receives it throughcommon_preparation_kwargs. That value becomes the core'smax_sequence_tokenson load: helios/src/server/config.rs:131 reads it asprepared_sequence_tokens, :148 setslimits.max_sequence_tokens, and helios/src/model.rs:261-273 (fit_context) then min's it with physical pages. So the claim "a request that would exceed the cap is rejected" holds via server/request.rs:350 and scheduler.rs:2289/2358. This is the point the earlier review (#454, review comment 1) blocked on, and it is now fixed. - Omitting the flag is a no-op.
prepared_contextreturnsrecipe.contextwhencontext_target is None(planning.py:371-372), byte-identical to the oldplan.recipe.context;Plan.context(planning.py:363-366) is untouched.fit/plandefaults arecontext=None, so every existing caller (including_export_hosts) behaves exactly as before — which is also why finding 1 is a silent drop rather than a crash. - Pool sizing is unchanged by design.
fitstill gives the cache all free memory (planning.py:536-542); the cap reaches the pool only because the runtime sizes its pages from the core's now-smallermax_sequence_tokens(helios/src/runtime_core/memory.rs:631-635 viapage_ceiling), plus--kv-cache-limit concurrencyin the measurement. Nothing in the diff misstates this, though the description's per-slot explanation could say it explicitly. - Other consumers of the plan are unaffected: ignition/cli/serve.py:68 (
max_body_bytes) still usesrecipe.context, so the HTTP body allowance stays generous — correct, since rejection happens at admission. ignition/cli/serve.py:538-546 (diagnostic capacity clamp) and the--directpath (ignition/direct/scheduler.py:110 readsconfig["max_sequence_tokens"]) both inherit the capped value, so direct execution enforces the cap too.Plan.prepared_contextis read at exactly two sites: bootstrap.py:58 and the chunk check at planning.py:694. - Docs are consistent with the code where it is wired: docs/cli-design.md:446, :1443, :1493 correctly describe a context limit capped at export and the prepared-context-derived cache sizing; :738's "prepared context" wording still resolves correctly to the capped value.
- The positive-target validation (planning.py:459-460) is in
fit, so it fires on every planning path, not onlyplan.--request-context 0/negative yields the intended UsageError.--request-contextplacement in the "capacity and compression" argument group (cli/init.py:167-170) is the right home per AGENTS.md:452-456. - The below-chunk error (planning.py:694-700) uses
min(result.context, result.prepared_context)and its message names both remedies; with the recipe's default chunk and a low target,prefill_chunk is Noneselects the message that says to pass--prefill-chunk-sizeor a larger--request-context. Behaviour is right; only the absence of a test is a finding.
#8 [high] Blocking: the new page-multiple check validates the raw target, so the PR's own test case and the documented "cap above the recipe max is a no-op" path fail
ignition/planning.py:289-290 (new, in Plan.post_init):
if self.context_target is not None and self.context_target % self.page_tokens:
raise UsageError(f"--request-context {self.context_target:,} is not a multiple of the {self.page_tokens:,}-token page size")
It checks the raw requested target, not the resolved prepared_context (planning.py:370-375: min(recipe.context, target, tokens)).
Two consequences, both verifiable from the code:
-
A target above the recipe max — which the docs and the description present as a harmless clamp ("a cap above the pool resolves to the pool capacity, as stock"; docs/cli-design.md:446 default "The recipe's maximum context") — is rejected whenever it is not a page multiple, even though the core would serve the aligned recipe max.
-
The PR's own new test contradicts the check: tests/cli/test_planning.py:229-232 builds
oversized = planning.plan(recipe, recipe.checkpoints[0], gpus, context=500000, **base)and assertsprepared_context == min(recipe.context, oversized.tokens). The fixture recipe (tests/cli/test_planning.py:37-38) has context=262144, page_tokens=64, and its RankCosts declares no page_tokens (tests/cli/test_planning.py:43), so Plan.page_tokens == recipe.page_tokens == 64 (planning.py:328-332). 500000 mod 64 = 32, so the assertion never runs: planning.plan raises UsageError "not a multiple of the 64-token page size". The added test fails on the added validation.
Fix: validate the value the core will actually serve, not the request. Plan.__post_init__ cannot do that for the memory-dependent part because the first construction has pages=0, hence tokens=0, hence prepared_context==0 (planning.py:528-537 builds the Plan before replace(..., pages=...)). Correct place: end of fit (planning.py:538-544) or in plan after attempt(), checking min(recipe.context, context_target) % page_tokens (the memory-independent part), or check the final plan's prepared_context. Then either delete the test's 500000 case or keep it as the no-op proof.
Note the test also asserts capped.prepared_context == min(recipe.context, 131072, capped.tokens); 131072 is a page multiple, so that case is fine.
#9 [high] Verified fixed since last turn: multi-host path, plan report, manifest, docs, tests
Checks re-run at head de1b5b5 against the code:
- Multi-host export now forwards the flag: ignition/cli/serve.py:193-206 ends
row_shard_prefill=args.row_shard_prefill, context=args.request_context. All four planning sites carry it: serve.py:193-206 (_export_hosts), serve.py:274-289 (_prepare, via derive), serve.py:459-472 (debug_serve), bench.py:162-177 (bench, via derive).deriveforwards it (ignition/cli/preparation.py:56, 68 with keywordcontext=context). No remaining caller of planning.plan omits it. - The plan report now carries it: ignition/planning.py:432
"context": self.context, "context_target": self.context_target, "checkpoint_context": self.recipe.context. prepared_context is derivable from those three plustokens/page_tokens(which to_dict also emits, planning.py:440-441). - The manifest now carries it: ignition/preparation/rebuild_manifest.py:264-265 emits
--request-context <target>in reproduction_arguments, and :390 recordscontext_targetwith SCOPE_DEPLOYMENT (add() skips None at :350-355, so an untargeted export records nothing — byte-equivalent to stock). - Page-multiple validation exists (planning.py:289-290) — but validated on the wrong quantity; see the blocking note.
- Tests were added (tests/cli/test_planning.py:211-265) covering the no-op path, the clamp, both validations, to_dict, and the manifest keys — but one case fails; see the blocking note.
- Docs are consistent: docs/cli-design.md:446 now states the VRAM payoff only "With
--kv-cache-limit concurrency", which matches helios/src/runtime_core/memory.rs:284-331 (page_ceiling returns None in defaultmemorymode); :1443 and :1493 updated for the capped ceiling. - The charter non-goal nit from the last report no longer applies: the description and docs row now justify the cap by single-model memory pressure, not multi-model hosting.
Still correct from entry #6: bootstrap.py:58 "context": plan.prepared_context is the only consumer that reaches the core, Helios reads it as prepared_sequence_tokens (helios/src/server/config.rs:131) and clamps limits.max_sequence_tokens (helios/src/model.rs:261-273, validated page-aligned at helios/src/model/catalog.rs:43-57).
#10 [high] Should fix: prepared_context is clamped by export-host free memory, making the exported ceiling non-reproducible
ignition/planning.py:370-375:
def prepared_context(self) -> int:
if self.context_target is None:
return self.recipe.context
return min(self.recipe.context, self.context_target, self.tokens)
self.tokens is pages * page_tokens (planning.py:362-363), and pages is sized from the exporting host's free memory (planning.py:538-544). This value becomes the exported core's max_sequence_tokens via ignition/preparation/bootstrap.py:58.
Three consequences:
- The declared capacity of an exported core now depends on how much VRAM happened to be free on the export host — two exports of the same model with the same flags whose results are recorded in identical
reproduction_args(ignition/preparation/rebuild_manifest.py:231-320, :390) can declare differentmax_sequence_tokens. That conflicts with AGENTS.md:452-456 ("the plan, its printed report, and its recorded measurements describe what was prepared") and with "Be explicit and pin everything" (charter line 14). - A low target is silently lowered further without any message: on a host where
tokensis 20000,--request-context 131072prepares a 20000-token core and the printed plan reportscontext_target: 131072,context: 20000,tokens: 20000— no warning that the request was not honored. - The clamp duplicates Helios, which already narrows the advertised ceiling to the pool: helios/src/model.rs:260-273
fit_contextsetslimits.max_sequence_tokens = prepared_sequence_tokens.min(pages*page_tokens)and helios/src/model/catalog.rs:43-57 only requiresmax_sequence_tokens <= prepared_sequence_tokens. Somin(recipe.context, context_target)is sufficient for the core.
Fix: drop the self.tokens term, return min(self.recipe.context, self.context_target). Then the resolved value is a pure function of the requested target and the recipe, reproducible from the manifest, pool-bound behaviour stays Helios's job (as stock), and page alignment follows from validating the target alone — which also removes the case that made the 500000 clamp test meaningful (see entry 8). stock path returns recipe.context, which is what the previous plan.recipe.context did; keep that.
Note Plan.context (planning.py:365-368) is untouched by this PR, so the printed context key still describes stock pool-bound behaviour, not the core; the new context_target key plus tokens/page_tokens (planning.py:440-441) make the core value derivable.
#11 [high] Research summary
Verdict: one blocking issue, one should-fix, everything else from my previous report confirmed fixed.
The PR's structure is now right. All four planning entry points forward the flag (ignition/cli/serve.py:193-206, :274-289, :459-472, ignition/cli/bench.py:162-177 via derive), Plan.to_dict reports context_target (ignition/planning.py:432), the manifest both emits --request-context (ignition/preparation/rebuild_manifest.py:264-265) and records context_target at SCOPE_DEPLOYMENT (:390), a page-multiple validation exists, tests were added, and the docs row now scopes the VRAM payoff to --kv-cache-limit concurrency, matching helios/src/runtime_core/memory.rs:284-331. The previous three blockers and both should-fix items are closed, and the multi-model non-goal concern no longer applies.
Blocking. ignition/planning.py:289-290 validates the raw requested target, not the resolved value: any non-page-multiple --request-context is rejected even when it would be clamped away by min(recipe.context, target, tokens). This breaks the PR's own new test — tests/cli/test_planning.py:230-232 plans with context=500000 against the 64-token-page fixture and is now guaranteed to raise (500000 % 64 == 32), so the added test fails on the added validation, and the "a cap above the recipe max is a no-op" path the description and docs row promise is unreachable unless the oversized value happens to be aligned. Fix by validating the value the core serves, in fit/plan after attempt() rather than in __post_init__ (which runs with pages=0, hence tokens=0, hence prepared_context=0).
Should fix. prepared_context (planning.py:370-375) also clamps by self.tokens, which is sized from the export host's free memory. That makes an exported core's declared max_sequence_tokens depend on how much VRAM was free at export while reproduction_args stay identical (AGENTS.md:452-456, "Be explicit and pin everything"), and silently lowers a requested cap with no message. Helios already performs this clamp (helios/src/model.rs:260-273 fit_context, bounded by helios/src/model/catalog.rs:43-57), so min(recipe.context, context_target) is the reproducible, sufficient value — and dropping the tokens term also removes the only case where the oversized clamp mattered.
Full detail is in scratchpad entries #8, #9 and #10.
#12 [high] Report of 2026-11-26, run 1002 (supersedes #7): verdict, findings, and what I did not verify
Supersedes entry #7 (which described an earlier head c36a6a02 + the pre-change serve.py). Review target: PR #533 head de1b5b5.
Verdict
Blocking: 1 (new, introduced by the head commit). Should fix: 1. Everything in #7's blocker list is now genuinely fixed — do not re-raise it.
Blocking
ignition/planning.py:289-290 validates the requested target instead of the resolved prepared context:
if self.context_target is not None and self.context_target % self.page_tokens:
raise UsageError(...)
Two demonstrable consequences:
- The PR's own new test fails.
tests/cli/test_planning.py:229-232callsplanning.plan(..., context=500000)and assertsoversized.prepared_context == min(recipe.context, oversized.tokens). Fixture:context=262144,page_tokens=64(tests/cli/test_planning.py:37-38), RankCosts with no per-rankpage_tokens(:43), soPlan.page_tokens == 64(planning.py:328-332). 500000 % 64 = 32 → UsageError. The assertion cannot run. - An oversized, unaligned target is rejected although the resolved core value would be the aligned recipe max — the "a cap above the pool/recipe max resolves to the max, as stock" behaviour that the PR description and docs/cli-design.md:446 promise.
Fix: validate what the core serves — in
fit/planafterattempt()(multiple ofpage_tokensapplied tomin(recipe.context, context_target), or the finalprepared_context) — not__post_init__, which runs whilepages=0sotokens=0andprepared_context=0(planning.py:528-544). Honesty note: I did not run.venv/bin/python -m pytest tests/cli(no execution in this review); the failure is arithmetic from the fixture constants and is trivial to confirm by running that file.
Should fix
ignition/planning.py:370-375 — prepared_context also min's self.tokens (pages × page_tokens), and pages is sized from the exporting host's free memory (planning.py:538-544). That value becomes the core's max_sequence_tokens via ignition/preparation/bootstrap.py:58, so two exports with identical reproduction_args can declare different ceilings depending on export-host VRAM; it also silently lowers a requested cap with no message while to_dict still prints the requested context_target (planning.py:432). It contradicts AGENTS.md:452-456 and "Be explicit and pin everything". Helios already clamps the advertised ceiling to physical pages (helios/src/model.rs:260-273 fit_context; helios/src/model/catalog.rs:43-57 requires only max_sequence_tokens <= prepared_sequence_tokens), so min(recipe.context, context_target) is sufficient, reproducible, and makes page alignment a property of the target alone.
Confirmed fixed since #7 (cite these rather than the old blockers)
- Multi-host: ignition/cli/serve.py:206
context=args.request_context; all four sites covered (serve.py:193-206, :274-289, :459-472, bench.py:162-177); derive forwards it (ignition/cli/preparation.py:56, :68). - Plan report: ignition/planning.py:432 now emits
context_targetalongsidecontext/checkpoint_context; prepared_context is derivable withtokens/page_tokens(:440-441). - Manifest: ignition/preparation/rebuild_manifest.py:264-265 (
--request-context) and :390 (context_target, SCOPE_DEPLOYMENT);add()drops None (:350-355) so an untargeted export records nothing — byte-equivalent to stock. - Page-multiple validation exists (placement is the blocking item above).
- Tests added (tests/cli/test_planning.py:211-265): no-op path, clamp, positivity, page multiple, to_dict, manifest keys.
- Docs: docs/cli-design.md:446 scopes the payoff to
--kv-cache-limit concurrency, matching helios/src/runtime_core/memory.rs:284-331 (page_ceilingreturns None in defaultmemorymode); :1443, :1493 updated. - Charter non-goal nit from #7 no longer applies: the rationale is now single-model memory pressure.
Lens judgement (architecture and scope)
Belongs in the repository: it is a preparation capacity on the existing plan → PreparationConfig → core-catalog path, not a new mechanism, and it adds no per-model branch (charter "Keep the runtime small and model-agnostic"; AGENTS.md:338-345). It is one shared flag on the existing Plan, verified by measurement (RTX PRO 6000 Blackwell, table in the description) as the charter's "measured performance/memory issue" requires. The omission path is a true no-op (prepared_context returns recipe.context, matching the old plan.recipe.context), so compatibility (AGENTS.md:431-444) holds. No new CLI flag family or fallback layer, and no Helios change — Helios needed none.
Residual scope note (not a finding, worth one line): the flag is honoured by export, bench and debug-serve alike; bench's workload check moved to prepared_context (planning.py:248), which is correct and now consistent with the core.
Not verified this run
- Did not run the Python test suite or any export (no GPU, no execution).
- Did not re-check whether a non-page-aligned target would fail at core load vs at export: moot while the validation rejects it, but if the fix moves validation to the resolved value, an aligned target is guaranteed and the question disappears.
- Did not review the unrelated helios persistent_worker.rs commit c915b5f0 in the branch range; it is not part of this PR's diff (9 files, listed in the orientation packet) and lies outside this lens.
#14 [high] Blocking: derive() references an undefined name context, so export/debug-serve/bench crash
Head 02023eb, ignition/cli/preparation.py.
def derive(...) at preparation.py:45-56 has no context parameter. Its signature ends:
..., shard_hyperconnections: bool = False,
row_shard_prefill: bool = False, row_shard_attention: bool = False,
force_moe_decode_a16: bool | None = None) -> planning.Plan:
But the body at preparation.py:69 reads:
mla_compute_mode=mla_compute_mode, row_shard_prefill=row_shard_prefill,
row_shard_attention=row_shard_attention, context=context)
Evidence context is undefined there:
- Full-file search for
contextin preparation.py returns only lines 47, 62 (context_parallel / context_parallel_size), 69, and the unrelateddef context_parallelat :124-132. There is nocontextlocal, parameter, module global, or import. - Module header (preparation.py:7-15) imports os, dataclasses, ignition.planning, declaration.Speculation, errors, registry, .config — nothing named
context.
Consequence: context=context is evaluated on every call, so NameError: name 'context' is not defined fires for ALL invocation paths, with or without --request-context:
- serve.py:275
_prepare(used by export with --ranks 1, and by the normal prepare path) - serve.py:163/154
_export_hosts(multi-host export path) - serve.py:462
debug_serve - bench.py:162
run - tests/cli/test_commands.py:88
preparation.derive(...)(existing testtest_derive_forwards_row_shard_prefill) also breaks.
This is the single funnel all four entry points use, so the PR's whole feature is unreachable, and the CLI cannot run at all.
Why no test caught it: the new test in tests/cli/test_planning.py exercises planning.plan(...) directly, not derive(...); the existing derive test (test_commands.py:79-97) calls derive without the new keyword and would now fail too. The head has no CI checks.
Fix (one line): add context: int | None = None to derive's keyword-only parameters (next to row_shard_attention at preparation.py:55) so it forwards to planning.plan; and add a test that drives preparation.derive(..., context=N) and asserts plan.context_target == N, so the funnel is covered.
Severity: blocking — the branch cannot export, debug-serve, or bench anything.
#15 [high] Blocking: the claimed page-multiple validation does not exist; the PR's own test asserts it and fails; unaligned targets produce a core Helios rejects at load
Head 02023eb.
- The description claims a "page-multiple validation". No such check exists in the code:
pr_difffor ignition/planning.py (+19/-9) adds only context_target, prepared_context, thecontext <= 0check, threading through fit/plan, the to_dict keys, and effective_context.- Search across ignition/ for "multiple of the" / page-size alignment returns only ignition/cli/init.py:165 (prefill chunk help, "a multiple of 64"), planning.py:636 (prefill chunk), and unrelated messages. There is no request-context alignment check.
- Plan.post_init (planning.py:224-296) has no context_target validation at all.
- The PR's own test contradicts the code. tests/cli/test_planning.py:238-240:
Validation: non-page-multiple target rejected
with pytest.raises(UsageError, match="multiple of the"): planning.plan(recipe, recipe.checkpoints[0], gpus, context=100, **base) With the check absent, context=100 gives prepared_context = min(262144, 100, tokens) = 100 (fixture page_tokens=64 at test_planning.py:38), so planning.plan reaches planning.py:709-711 and raises UsageError("--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows") — a UsageError whose message does not match "multiple of the", so pytest.raises fails. (If the plan did not fit, CapacityError would be raised instead.) Either way the assertion fails.
- Why the missing validation matters beyond the test — it is a real load-time defect. ignition/preparation/bootstrap.py:58 passes plan.prepared_context into BasePreparationConfig.context (bootstrap.py:33), which becomes ServingContract.max_sequence_tokens / prepared_sequence_tokens (helios/src/server/config.rs:131,148). Helios validates at load, helios/src/model/catalog.rs:44-57:
|| !config.prepared_sequence_tokens.is_multiple_of(page_tokens.max(1))
|| !config.limits.max_sequence_tokens.is_multiple_of(page_tokens)
so an unaligned prepared context makes the exported core fail to load with "invalid prepared model configuration" — discovered only after a full export, and with no error text naming --request-context. Reachable example:
--request-context 100 --prefill-chunk-size 64passes planning.py:635 (64 <= recipe.context) and planning.py:709 (64 <= 100), exports, and the core will not load.
Fix: validate the value that is actually served, in plan()/Plan.post_init where page_tokens and recipe.context are available, e.g. reject (or page-floor) min(recipe.context, context_target) % plan.page_tokens. Then the existing context=100 case (100 % 64 = 36) is still rejected with a message containing "multiple of the" and the test passes as written. Keep the check next to the context <= 0 check so one flag has one validation home (see the nit on split homes).
Note on what now works: the previous run's burst blocker (context=500000 with 500000 % 64 == 32) is resolved by the check's removal — tests/cli/test_planning.py:229-232 now passes. This blocking finding is that the sibling case at :238-240 was left behind, and the real alignment requirement went unenforced.
Severity: blocking — the shipped test fails and an accepted flag value yields an unloadable core.
#16 [high] Should fix: prepared_context still clamped by export-host free memory, not by the requested target
Head 02023eb. Unchanged since my last run, so it persists.
ignition/planning.py:377-381: @property def prepared_context(self) -> int: if self.context_target is None: return self.recipe.context return min(self.recipe.context, self.context_target, self.tokens)
self.tokens = self.pages * self.page_tokens (planning.py:368-369), and pages is sized from available // costs.page_bytes where available derives from plan.supply_bytes = free_bytes - headroom - reserve (planning.py:360-361, 550-556) — i.e. the export host's free VRAM at export time.
So with a --request-context set, the exported core's max_sequence_tokens (bootstrap.py:58 -> server/config.rs:131,148) silently depends on how much memory was free on the export host, while reproduction_args (rebuild_manifest.py:264-265) and the context_target manifest parameter (rebuild_manifest.py:389) record only the requested target. Two exports of the same recipe with the same flags can produce different max_sequence_tokens.
Two things make this a genuine layering problem rather than a nit:
- Helios already performs exactly this clamp at serve time: helios/src/model.rs:268-272
fit_context()setslimits.max_sequence_tokens = prepared_sequence_tokens.min(pages - draft_pages * page_tokens). The pool is a serving-time fact (the runtime's --kv-cache-limit and actual page backing), not an export-time one. - The no-target path deliberately returns
recipe.contextunclamped, which is what makes the omitted flag a true no-op. Only the targeted path leaks host memory into the artifact — an inconsistency the same expression could avoid.
Fix: return min(self.recipe.context, self.context_target) and let Helios's existing fit_context apply the pool bound, as it already does for the untargeted path. That also makes the PR's own "cap above the pool is a no-op, matching stock" claim true by construction rather than incidentally, and keeps reproduction_args sufficient to reproduce the core (AGENTS.md:452-456).
Note the interplay with the missing alignment check (entry #15): if this clamp is removed, min(recipe.context, context_target) alignment becomes purely a function of the target, so validating min(recipe.context, context_target) % page_tokens is exactly right.
Severity: should fix (architecture/compatibility). Not blocking because the flag is opt-in and the clamp only lowers the ceiling.
#17 [high] Verified clean + nits + evidence scoping — do not re-raise the prior fixed items
Head 02023eb. Supporting detail for the final report.
Confirmed good — do not re-raise (all still true at this head):
- Multi-host export now forwards the flag: serve.py:163
_export_hosts-> :207context=args.request_context. (But see entry #14: it now dies on the undefined name.) - Plan report and manifest record it: planning.py:438 emits
context,context_target,prepared_context,checkpoint_context; rebuild_manifest.py:264-265 emits--request-context Nin reproduction_args; rebuild_manifest.py:389 addscontext_targetat SCOPE_DEPLOYMENT. - Bench record now includes it: bench.py:247-248 whitelists
context_target,prepared_context. - Serve plan line prints it: serve.py:319
· request context {prepared_context}(guarded on context_target is not None). - Bench selection compares against the served value: planning.py:260 uses prepared_context, so an over-large
--contextsfails at planning rather than after GPU prep. - Omission is a no-op: planning.py:379-380 returns
recipe.context, which is exactly what bootstrap.py:58 passed before this PR. - Docs rows exist: cli-design.md:446 (flag table), :1443 and :1493 (owner rows).
- Scope/shape is right: one optional frozen dataclass field defaulting to None (planning.py:186), one accessor, one keyword threaded through plan()/fit(), one consumer line (bootstrap.py:58). No new mechanism, no per-model branch, no env toggle, no Helios change. Fits AGENTS.md:452-456 (setting has a home) and the charter's "smallest footprint in shared code" (charter line 12 / How We Work).
Nits (low value, mention briefly):
- Two validation homes for one flag:
context <= 0now lives in fit() (planning.py:467-468), which plan() re-enters per candidate world size and per shortfall probe (planning.py:699-705), while every sibling flag check sits in plan() near the prefill-chunk block (planning.py:634-637) or Plan.post_init (planning.py:224-296). Put both request-context checks in one place. - serve.py:68-69 still sizes
max_body_bytesfromrecipe.contextand says "context is limited by the checkpoint and available cache capacity" — with a cap both overstate the served ceiling. - ignition/cli/help.py:38 advertises
--prefill-chunk-size: 64..{recipe.context}, a range above the effective prepared context once capped. - docs/cli-design.md:446 says "below the recipe's maximum" but the code silently accepts and clamps a target above it (planning.py:381); the test at test_planning.py:229-232 pins the clamp. State the clamp, don't leave the docs implying rejection.
- test comments use "stock" as an undefined referent (test_planning.py:217, 227) — say "the behaviour without the flag".
Evidence scoping (carried from last run, still applies): the VRAM table only holds under a non-default --kv-cache-limit; helios/src/runtime_core/memory.rs:290-291 page_ceiling returns Ok(None) for KvCacheLimit::Memory, the documented default (cli-design.md:738, :828); only Context/Concurrency size a ceiling from the prepared context (:298-320). The description's headline omits that condition; the shipped docs row (cli-design.md:446) also omits it. AGENTS.md:95-102 requires scope and material limitations attached to a measured result.
#18 [high] Report of 2026-11-26, run 1148 (supersedes entry #13)
Run 1148, head 02023eb, PR #533 "Cap the per-request context target", base main. 9 files, +84/-18.
VERDICT: blocking issues. The design is right; two mechanical defects stop the branch from working.
--- BLOCKING 1: undefined name in the shared funnel (entry #14) ---
ignition/cli/preparation.py:69 passes context=context to planning.plan, but derive()'s signature (:45-56) has no context parameter and the module has no global/import of that name (verified by full-file search: only :47/:62 context_parallel*, :69, :124 context_parallel function).
=> NameError on every derive() call, regardless of --request-context. Breaks export (--ranks 1 via _prepare, --ranks>1 via _export_hosts), debug-serve (serve.py:476), bench (bench.py:177), and the pre-existing test tests/cli/test_commands.py:88. Only the new test_planning.py test bypasses derive() by calling planning.plan directly, which is why it was not caught. No CI on head.
Fix: add context: int | None = None at preparation.py:55; add a test driving derive(..., context=N) and asserting plan.context_target == N.
--- BLOCKING 2: page-multiple validation does not exist (entry #15) ---
The description claims "a page-multiple validation". There is none: no alignment check anywhere in ignition (search for "multiple of the"/page alignment returns only prefill-chunk messages at planning.py:636 and cli/init.py:165). Plan.post_init (planning.py:224-296) never inspects context_target.
The PR's own test asserts it and therefore fails: tests/cli/test_planning.py:238-240 expects UsageError matching "multiple of the" for context=100; with the check gone, 100 becomes prepared_context (100 % 64 = 36 for the fixture's page_tokens=64 at :38) and plan() raises the chunk error at planning.py:709-711 instead ("--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows"), whose text does not match.
It is a real defect, not just a test mismatch: bootstrap.py:58 -> server/config.rs:131,148 makes prepared_context the core's max_sequence_tokens, and helios/src/model/catalog.rs:44-57 rejects a core whose max_sequence_tokens is not a multiple of page_tokens, at load. Reachable: --request-context 100 --prefill-chunk-size 64 passes planning.py:635 and :709, exports a full core, and the core will not load with "invalid prepared model configuration".
Fix: validate the served value — min(recipe.context, context_target) % page_tokens — in plan()/post_init beside the context <= 0 check. context=100 is still rejected, so the existing test passes unchanged.
Note: the blocker I raised last run (context=500000, 500000 % 64 == 32) is resolved by the check's removal — test_planning.py:229-232 passes now. Do not re-raise it.
--- SHOULD FIX (entry #16) ---
planning.py:377-381 prepared_context min's self.tokens, which is sized from export-host free VRAM (pages <- supply_bytes <- free_bytes, planning.py:360-361, 550-556). So with a target set, the exported artifact's max_sequence_tokens depends on the export host's free memory, while reproduction_args (rebuild_manifest.py:264-265) and the manifest (…:389) record only the requested target: the same flags can reproduce a different core (AGENTS.md:452-456). Helios already applies this exact clamp at serve time (helios/src/model.rs:268-272 fit_context). Fix: return min(recipe.context, context_target) and let fit_context apply the pool bound, matching the untargeted path. This also makes the PR's "cap above the pool is a no-op, matching stock" claim true by construction.
--- NITS (entry #17) ---
- One flag, two validation homes:
context <= 0in fit() (planning.py:467-468, re-entered per candidate and per shortfall probe) vs. all sibling flag checks in plan()/post_init. Unify. - serve.py:68-69 sizes max_body_bytes from recipe.context and its context_hint text still describes the uncapped ceiling.
- cli/help.py:38 advertises --prefill-chunk-size 64..recipe.context, now above the effective context when capped.
- cli-design.md:446 says "below the recipe's maximum" but the code silently clamps an oversize target (planning.py:381, pinned by test_planning.py:229-232). Document the clamp.
- "stock" is an undefined referent in test comments (test_planning.py:217, 227).
--- EVIDENCE SCOPING (AGENTS.md:95-102) --- The VRAM table holds only under a non-default --kv-cache-limit: helios/src/runtime_core/memory.rs:290-291 page_ceiling returns Ok(None) for KvCacheLimit::Memory, the default (cli-design.md:738, :828); only Context/Concurrency derive a ceiling from the prepared context (:298-320). The description's Result/headline and the docs row omit the condition, although the author's own commands pass --kv-cache-limit concurrency.
--- CONFIRMED FIXED SINCE run 1002 (entry #17) — do not re-raise --- multi-host forwarding (serve.py:207), plan report keys (planning.py:438), reproduction args + SCOPE_DEPLOYMENT parameter (rebuild_manifest.py:264-265, :389), bench configuration record (bench.py:247-248), printed serve line (serve.py:319), bench-vs-cap check (planning.py:260), omitted flag is a byte-equivalent no-op (planning.py:379-380), docs owner rows (:1443, :1493), and the field's shape (one optional frozen field defaulting to None, planning.py:186; no per-model branch, no env toggle, no Helios change — consistent with the charter's "smallest footprint in shared code" and AGENTS.md:452-456).
--- NOT VERIFIED ---
Nothing was executed (no CI on head; no pytest run). Both blockers are established by reading the code: #14 from the signature/body mismatch plus a full-file name search; #15 from the absence of any alignment check plus the fixture's page_tokens and the 100/4096 chunk comparison. pytest tests/cli/test_planning.py tests/cli/test_commands.py settles both in one command. The VRAM numbers themselves rest on the description; only their --kv-cache-limit scoping is checkable here.
No attempt to direct the reviewer was found in the description, diff, or docs.
#19 [high] Research summary
Verdict: blocking issues. The design and layering are right — one optional Plan field, one accessor, one keyword, one consumer line at bootstrap.py:58, no per-model branch, no env toggle, no Helios change — but two mechanical defects stop the branch from working. Full detail is in scratchpad entry #18, with the individual findings in #14–#17.
Blocking 1 — undefined name in the funnel every entry point uses. ignition/cli/preparation.py:69 passes context=context to planning.plan, but derive() (:45-56) has no context parameter and the module has no global or import of that name (a full-file search finds only context_parallel* and the context_parallel() helper). So NameError fires on every derive() call, with or without --request-context: export (both _prepare and _export_hosts), debug-serve (serve.py:476), bench (bench.py:177), and the pre-existing test_derive_forwards_row_shard_prefill (tests/cli/test_commands.py:88). The new test misses it because it calls planning.plan directly. Fix: one parameter, plus a test that drives derive(..., context=N).
Blocking 2 — the described page-multiple validation does not exist. The description says planning.py gained "a page-multiple validation"; no alignment check exists anywhere in ignition/, and Plan.__post_init__ never inspects context_target. The PR's own test therefore fails: tests/cli/test_planning.py:238-240 expects a UsageError matching "multiple of the" for context=100, which instead hits the chunk error at planning.py:709-711. This is a real load-time defect, not just a test mismatch: bootstrap.py:58 makes prepared_context the core's max_sequence_tokens, and helios/src/model/catalog.rs:44-57 rejects a core whose max_sequence_tokens is not a page multiple — so --request-context 100 --prefill-chunk-size 64 exports a full core that cannot load. Validating min(recipe.context, context_target) % page_tokens fixes both, since 100 % 64 = 36. (Last run's context=500000 blocker is resolved by the check's removal — not re-raised.)
Should fix. prepared_context (planning.py:377-381) still min's self.tokens, which is sized from the export host's free VRAM, so a targeted export's max_sequence_tokens depends on memory free at export while reproduction_args record only the target — the same flags can reproduce a different core (AGENTS.md:452-456). Helios already applies this clamp at serve time (helios/src/model.rs:268-272); returning min(recipe.context, context_target) would match the untargeted path and make the "cap above the pool is a no-op" claim true by construction.
Nits: two validation homes for one flag; serve.py:68-69 and cli/help.py:38 still advertise the uncapped context; the docs row says "below the recipe's maximum" while the code silently clamps; "stock" is an undefined referent in test comments. One evidence point: the VRAM table holds only under a non-default --kv-cache-limit (memory.rs:290-291 returns Ok(None) for the default), which the description omits.
Nothing was executed — the head has no CI checks — but both blockers follow from reading the code; pytest tests/cli/test_planning.py tests/cli/test_commands.py settles them.
#20 [high] Per-file coverage ledger: all 9 changed files read in context at head 02023eb
Completeness ledger for the final report (head 02023eb, PR #533, 9 files, +84/-18 per pr_files). Every file below was read in context, not only as a diff hunk.
- ignition/planning.py (+19/-9) — read 150-300, 300-400, 430-455, 455-600, 600-743.
- :186
context_target: int | None = None(frozen dataclass, default None — existing constructions unaffected). - :377-381
prepared_context(min recipe.context/context_target/tokens; early return on None = the no-op path). - :224-296
__post_init__: NO context_target validation (basis of blocking #15). - :467-468
context <= 0check in fit() (nit: separate home from sibling checks). - :260 bench selection compares
required_context > prepared_context. - :438 to_dict emits context/context_target/prepared_context/checkpoint_context.
- :635-637 prefill-chunk validation vs recipe.context; :709-711 effective_context chunk error.
- :550-556 pages <- available // page_bytes; :360-361 supply_bytes <- free_bytes (basis of should-fix #16).
- :186
- ignition/cli/preparation.py (+1/-1) — read 1-44, 40-95, 96-160, plus full-file "context" search.
- :45-56 derive signature has NO
contextparam; :69 passescontext=context(blocking #14). - :124-132
context_parallel()is the only other "context" name; module imports (:7-15) include nothing named context.
- :45-56 derive signature has NO
- ignition/cli/serve.py (+5/-4) — read 55-80, 130-175, 196-215, 258-300, 300-325, 462-482.
- :207
_export_hostsforwards the flag (multi-host gap closed); :291_prepare; :476 debug_serve. - :319 prints
· request context {prepared_context}guarded on context_target. - :68-69
_server_optionsstill sizes max_body_bytes from recipe.context and describes the uncapped ceiling (nit).
- :207
- ignition/cli/bench.py (+3/-1) — read 155-185, 236-262.
- :177
context=args.request_context; :247-248 configuration record whitelists context_target/prepared_context.
- :177
- ignition/cli/init.py (+2/-0) — read 150-185, plus _preparation_arguments registration search.
- :167-168 flag in the "capacity and compression" group beside --prefill-chunk-size (:163-166) — right scope per docs/cli-design.md:443-445.
- Registered via
_preparation_argumentsat :50 (exporting), :53 (benchmarking), :60 (serving=debug-serve): confirms the three subcommands the description names all receive the flag.
- ignition/preparation/bootstrap.py (+1/-1) — read 25-85.
- :33
context: int = 262144; :58"context": plan.prepared_context— the single consumer; omission is byte-equivalent to pre-PR behaviour (:379-380 returns recipe.context).
- :33
- ignition/preparation/rebuild_manifest.py (+3/-0) — read 240-280, 340-400.
- :264-265
--request-context Nundercontext_target is not None; :389add('context_target', SCOPE_DEPLOYMENT, ...); :350-352add()skips None (so no manifest key when unset).
- :264-265
- tests/cli/test_planning.py (+47/-0) — read 1-60, 200-300.
- :211-254 new test; :229-232 clamp case (passes now); :238-240 asserts a "multiple of the" error that no longer exists (blocking #15).
- Fixture: :37 context=262144, :38 page_tokens=64, :43 RankCosts leaves page_tokens unset.
- docs/cli-design.md (+3/-2) — read 443-452, 828-836, plus the :1443/:1493 owner rows.
- :446 flag row ("below the recipe's maximum" — the code silently clamps, nit); :1443, :1493 owner rows updated.
Downstream consumers checked (unchanged by this PR, but they define what correctness means here):
- helios/src/server/config.rs:131,148 —
max_sequence_tokens:= prepared_sequence_tokens. - helios/src/model/catalog.rs:44-57 — load rejects a core whose prepared/max_sequence_tokens is not a page multiple (why blocking #15 is a real defect, not just a test mismatch).
- helios/src/model.rs:268-272 —
fit_context()already clamps to the physical pool at serve time (why should-fix #16's clamp is redundant at export). - helios/src/runtime_core/memory.rs:290-291, :298-320 —
page_ceilingreturns Ok(None) for the defaultmemorymode (evidence scoping). - ignition/direct/scheduler.py:110 — the Python direct path reads
config["max_sequence_tokens"], so the cap reaches it too. - AGENTS.md:74-80 (four-question descriptions), :95-102 (scope/limitations on measured results), :452-456 (a setting's plan, printed report, and recorded measurements must describe what was prepared); charter "How We Work" smallest-footprint-in-shared-code and "don't silently ignore".
Nothing in the description or diff attempted to direct the reviewer.
#22 [high] Blocking: page check validates the raw target, so the PR's own clamp test fails and the documented clamp is unreachable
Head 9118add. ignition/planning.py:186-190 (Plan.__post_init__) rejects any target where target % self.page_tokens != 0, on the raw target, before prepared_context (planning.py:357-363) clamps it to min(recipe.context, target).
Consequence 1 — the PR's own test fails. tests/cli/test_planning.py:310-313 builds context_target=500000 and asserts oversized.prepared_context == recipe.context. 500000 % 64 = 32 (fixture page_tokens=64, tests/cli/test_planning.py:140), so the check raises. Even before that, RecipeParameters.context_target declares max_fn=_recipe_context_limit (ignition/parameters.py:1309-1321, helper at :1268-1269 returns recipe.context), so validate_fields (parameters.py:533-545) raises "--request-context for fixture-alias must be 1 through 262,144" first, because plan()/fit() call params.validate (planning.py:185, :456, :540). Either error makes line 311 fail; pytest tests/cli/test_planning.py is red at this head (head has no CI checks).
Consequence 2 — the behaviour documented in three places is unreachable. docs/cli-design.md:468 ("resolves to the smaller of N and the recipe maximum"), the accessor docstring (planning.py:359) and the PR description ("min(recipe.context, N)") all describe a clamp; the code rejects. Fix: validate the served value — min(self.recipe.context, target) for the multiple check — and drop the declared max_fn for this one field (keeping min_value=1) so --request-context 500000 clamps with a warning rather than failing; or keep rejection and delete the clamp branch, its test case and the "smaller of" wording everywhere.
#23 [high] Blocking: prefill-chunk vs context check still compares against Plan.context, so a cap can export a core Helios rejects at load
Head 9118add. ignition/planning.py:594-596:
if params.prefill_chunk > result.context:
raise UsageError(f"--prefill-chunk-size ... exceeds the {result.context:,}-token context this plan allows")
result.context is min(recipe.context, self.tokens) (planning.py:352-355) — the recipe/pool bound — not prepared_context. Nothing else compares the chunk to the cap: parameters.py:1457-1462 validates the chunk only against ctx.recipe.context, and bootstrap.py:45-46 forwards parameters.prefill_chunk unchanged as prefill_chunk_size while bootstrap.py:132 forwards prepared_context as the core context.
So on the fixture-shaped deployment (recipe context 262144, page tokens 64), --request-context 1024 --prefill-chunk-size 4096 passes every check, exports successfully with max_sequence_tokens=1024, prefill_chunk_size=4096, and Helios refuses to load it: helios/src/scheduler.rs:66-77 (validate_prefill) rejects prefill_chunk_size > max_sequence_tokens with "prefill_chunk_size must be divisible by 64 and within 64..=context", surfaced as an ExecutionError::Manifest through helios/src/model/catalog.rs:42. This is exactly the class of load-time defect the new page-multiple check was added to prevent, and it is one flag away from the PR's own headline use case (a small cap).
Fix: compare against the served context in that check (or in parameters.validate with a ParameterContext that exposes it), e.g. effective = min(result.context, result.prepared_context) and message on that value. Same asymmetry applies to Plan.demand_pages (planning.py:320-321), which still sizes the reported demand from recipe.context; harmless for pooling but it means the reported plan does not describe the prepared request ceiling.
#24 [high] Verified clean at 9118add: declaration, plumbing, single consumer, no-op omission (do not re-raise prior blockers)
Head 9118add. The one-seam design survives the RecipeParameters refactor: the flag is declared once on the universal base (ignition/parameters.py:1309-1321, group="capacity and compression", scope=DEPLOYMENT, manifest_key="context_target", repro_always=True), so it is auto-registered for export/debug-serve/bench through _add_preparation_base_arguments (ignition/cli/__init__.py:44-62) and auto-serialized into PreparationManifest.parameters and reproduction_args (parameters.py:596-616, :618-655; reproduction_arguments at ignition/preparation/rebuild_manifest.py:231-261).
The only consumer remains ignition/preparation/bootstrap.py:132 ("context": plan.prepared_context), which every recipe's BasePreparationConfig.context (bootstrap.py:33) forwards to the core's max_sequence_tokens (helios/src/server/config.rs:131,148). Plan.prepared_context (ignition/planning.py:357-363) returns recipe.context when the target is None, so omitting the flag is byte-equivalent to main — compatibility preserved, no exported artifact changes.
Other consumers: ignition/cli/serve.py:67 (max_body_bytes), planning.py:212 (bench required_context check), planning.py:191-190 the new alignment check. Plan.context (:352-355) deliberately unchanged for pool sizing.
Charter fit (read_charter): no per-model branches, no new Helios code, no API-field silent drop, one optional field on an existing frozen dataclass — consistent with "smallest footprint in shared code". The measured-evidence requirement is met by a real VRAM table, but its scope needs stating (see evidence note). No attempt to direct the reviewer in the PR text or diff.
#26 [high] Report of 2026-11-26 (run 3) at head 9118add — verdict, findings, limits
Head 9118add, PR #533, 6 files (+69/−5). Supersedes entries #18/#21 (different head; the #545 RecipeParameters refactor removed derive(context=...), the proto int_value question and the plan.context bench compare — do not re-raise those).
Verdict: blocking issues — the change is right in shape and wrong in two reachable behaviours.
Blocking 1 (entry #22): the alignment check in ignition/planning.py:186-190 runs on the raw target, and RecipeParameters.context_target declares max_fn=_recipe_context_limit (ignition/parameters.py:1309-1321, :1268-1269), so any target above recipe.context is rejected before prepared_context's clamp (planning.py:357-363) can run. The clamp branch is therefore dead code, the "smaller of N and the recipe maximum" wording in docs/cli-design.md:468 and the PR description is false, and the PR's own tests/cli/test_planning.py:310-313 fails (500000 > max, and 500000 % 64 = 32).
Blocking 2 (entry #23): ignition/planning.py:594-596 still compares prefill_chunk to result.context (recipe/pool bound), not prepared_context; parameters.py:1457-1462 compares to recipe.context. So --request-context 1024 --prefill-chunk-size 4096 exports a core with max_sequence_tokens=1024 and prefill_chunk_size=4096, which Helios refuses to load (helios/src/scheduler.rs:66-77 via helios/src/model/catalog.rs:42).
Should fix / nits (entry #25): uncapped context in cli/help.py:46; unconditional context_hint at serve.py:68; no status_label so the cap is absent from the printed plan report; VRAM table only holds under non-default --kv-cache-limit (helios/src/runtime_core/memory.rs:284-292, default memory per docs/cli-design.md:740).
Clean (entry #24): single declaration on the universal base, auto CLI + manifest + reproduction-arg plumbing, single consumer bootstrap.py:132, omission byte-equivalent to main, no Helios change, no per-model branch, charter "smallest footprint" satisfied; measured evidence present.
Not verified: nothing was executed; head has no CI checks. pytest tests/cli/test_planning.py tests/cli/test_commands.py settles both blockers. Whether Helios should also accept a chunk clamp (rather than Ignition rejecting) is a design choice; only the export-side check is reachable today.
#27 [high] Research summary
Reviewed PR #533 at head 9118add through the architecture/scope lens; all six changed files read in context, plus the downstream consumers in Helios. Full findings are in scratchpad entries #22–#26.
Verdict: blocking issues.
The design is right and should be kept: one optional field on RecipeParameters declared once on the universal base (ignition/parameters.py:1309-1321), which the dynamic CLI and manifest plumbing then generate for all three preparation subcommands without per-model code; one Plan.prepared_context accessor (ignition/planning.py:357-363); one consumer line at ignition/preparation/bootstrap.py:132; no Helios change, no env toggle, no per-model branch, and omission is byte-equivalent to main.
Two reachable behaviours are wrong, however:
-
The alignment check contradicts the documented clamp.
planning.py:186-190rejects a target that is not a page multiple on the raw value, andcontext_targetdeclaresmax_fn=_recipe_context_limit, so any target aboverecipe.contextis rejected beforeprepared_contextcan clamp it. The clamp branch is dead, the "smaller of N and the recipe maximum" wording indocs/cli-design.md:468and in the PR description is false, and the PR's own test case (tests/cli/test_planning.py:310-313, target 500000,500000 % 64 = 32) fails at this head. -
A cap can export a core Helios will not load.
planning.py:594-596still comparesprefill_chunkagainstresult.context(the recipe/pool bound), andparameters.py:1457-1462againstrecipe.context, never againstprepared_context— so--request-context 1024 --prefill-chunk-size 4096exports withmax_sequence_tokens=1024andprefill_chunk_size=4096, whichhelios/src/scheduler.rs:66-77rejects at load.
Should fix: cli/help.py:46 (not opened) and the --prefill-chunk-size bound still advertise the uncapped context; serve.py:68's context_hint names the cap even when unset; the cap has no status_label, so the printed plan report never says the core was exported with a reduced context; and the VRAM evidence holds only under the non-default --kv-cache-limit (helios/src/runtime_core/memory.rs:284-292), which the description should state on the headline.
Nothing was executed (the head has no CI checks); pytest tests/cli/test_planning.py settles the first blocker and the second follows from the two source comparisons.
#28 [high] Per-file coverage ledger at head 9118add: all 6 changed files read in context
Head 9118add, PR #533, 6 files (+69/−5) per pr_files. Supersedes the 9-file ledger in entry #20 (different head; the #545 refactor changed the file set).
ignition/parameters.py(+13/−0) — read 420-492 (resolve/_resolve_fields), 490-570 (validate_fields), 570-700 (manifest_parameters, reproduction_args, to_dict, status_parts), 1255-1350, 1350-1420, 1420-1530, 1530-1600.:1268-1269_recipe_context_limitreturnscontext.recipe.context.:1309-1321the newcontext_targetparam:flag="--request-context",group="capacity and compression",min_value=1,max_fn=_recipe_context_limit,manifest_key="context_target",scope=ParameterScope.DEPLOYMENT,repro_always=True, nomultiple_of, nostatus_label.:524-545validate_fieldsturns the declared max into a hard UsageError (basis of blocker 1);:596-616manifest emission;:618-655/:1469-1528reproduction args (therepro_alwayspath supplies--request-context N).:1294-1307+:1457-1462prefill-chunk bounded byrecipe.context, so the help/chunk ceiling is uncapped (should fix).:1540-1562RecipeParameters.status_parts— the printed plan line is built fromstatus_labels only (basis of the missing-report should fix).
ignition/planning.py(+14/−1) — read 120-420, 419-624.:186-190raw-target alignment check (blocker 1);:212benchrequired_context > prepared_context;:320-321demand_pagesstillrecipe.context;:352-355Plan.contextunchanged;:357-363prepared_contextclamp branch (dead);:379-416to_dict(the fields it emits — it does not emitprepared_contextexplicitly;:379-380buildsparam_dictfirst andto_dictspreads:392).:471-480fitsizes pages from available memory, not the cap;:594-596chunk vsresult.context(blocker 2).
ignition/cli/serve.py(+2/−2) — read 40-110, 160-230, 240-340.:67max_body_bytesfromplan.prepared_context(correct);:68unconditionalcontext_hint(should fix);:191-199planning.plan(..., parameters=parameters, explicit_flags=...)(multi-host path forwards the flag through the shared parameters object);:259-272_preparebuilds the plan line fromplan.parameters.status_parts.
ignition/preparation/bootstrap.py(+1/−1) — read 1-100, 100-138.:33context: int = 262144;:45-46prefill_chunk_size=parameters.prefill_chunk;:132"context": plan.prepared_context— the single seam every recipe consumes.
tests/cli/test_planning.py(+37/−0) — read 1-120, 117-200, 285-340; fixture:139-140context=262144, page_tokens=64.:295-329the new test::300-303no-target case (passes);:305-308131072 case (passes);:310-313500000 clamp case (fails — blocker 1);:315-317target 0;:319-321target 100 (100 % 64 = 36, matches the alignment message);:323-329manifest + repro args + DEPLOYMENT scope.
docs/cli-design.md(+2/−1) — read 452-490, plus:740--kv-cache-limitdefault and:830.:468the new flag row ("resolves to the smaller of N and the recipe maximum" — false while the clamp is rejected);:1436owner row "Context limit | The recipe maximum context, capped by--request-contextat export".
Downstream (unchanged) that define correctness here: helios/src/server/config.rs:131,148 (max_sequence_tokens := prepared extent); helios/src/scheduler.rs:66-77 (validate_prefill) with helios/src/model/catalog.rs:42,48-57 (load rejection — blocker 2); helios/src/model.rs:261-273 (fit_context already clamps to the pool at serve time); helios/src/runtime_core/memory.rs:284-292, 298-330 (page_ceiling Ok(None) for the default memory mode).
Charter read with read_charter: smallest-footprint-in-shared-code, no per-model flags, four-part PR descriptions, measured-evidence requirement.
#3 [medium] Should fix: context target is not validated against page alignment
Plan.prepared_context (ignition/planning.py:368-373) returns min(recipe.context, context_target, tokens) while Plan.context (:363-366) returns min(recipe.context, tokens). tokens is pages * page_tokens and pages is sized at fit time from free memory (:541-542). Two consequences:
a) Invariant risk. prepared_context can be strictly below context when the pool is smaller than the target. Helios requires max_sequence_tokens == prepared_sequence_tokens to be a multiple of page_tokens (helios/src/model/catalog.rs:44-58). tokens is a multiple of page_tokens, and recipe.context is whatever the recipe declares, so min() of the two plus a user target N keeps that property only if N is a multiple of page_tokens. context_target is not validated for page-token alignment anywhere (fit only rejects context <= 0, planning.py:459-460), yet prepared_context is what becomes max_sequence_tokens via ignition/preparation/bootstrap.py:58. A value such as --request-context 100000 on a 64-token page recipe exports a core whose declared context is not page aligned. Whether the core then fails to load, or Helios rounds/deviates, needs a test on an exported core; the code path (validate_inner returning "invalid prepared model configuration") suggests a load-time rejection of a core that took a long preparation to produce. Fix: reject or round a target that is not a multiple of the recipe's page size in fit.
b) The resolved value is memory-dependent. prepared_context = min(..., tokens) makes the core's advertised ceiling depend on the free VRAM measured during export: two exports of the same command on differently loaded GPUs produce cores with different max_sequence_tokens, and a cap above the pool silently becomes the pool size (the description states this as intended, "as stock"). That is defensible for the pool, but it means the flag's identity is not reproducible from the manifest, which strengthens finding 2.
Also note the value is clamped by tokens rather than by Plan.guaranteed_tokens (:376-378), so --request-context N above the per-request share still admits one long request while all slots are full only in aggregate: unchanged stock behavior, worth stating in the docs row.
#4 [medium] Should fix: need/scope argument and missing tests
- Scope/justification. The charter's "What gets merged" admits "a measured performance/memory issue"; the description now carries a VRAM table (Qwen3.8-27B, RTX PRO 6000, concurrency 1-4, 16 GB freed at c=4), which answers the earlier "hypothetical deployment" objection (#454 review point 4), and AGENTS.md:165-169 is satisfied on its face. But the memory problem is a multi-model co-run ("leave no room for a second model"). Multi-model hosting is an explicit Non-Goal requiring maintainer sign-off (charter Non-Goals; AGENTS.md:171-175 "Reject unapproved scope expansion ... multi-model hosting and routing"). The flag itself is a preparation capacity, not hosting, so this is not a violation — but the stated motivation leans on a workflow the project does not support, and the description should say which single-model workflow the headroom buys (e.g. leaving free VRAM for the compositor or a later process, which
--memory-limit -30G/[memory] reservealready express at serve time per docs/cli-design.md:1414-1418, 845-855). - Overlap with existing mechanisms.
--kv-cache-limit contextalready caps useful KV history at one prepared context andconcurrencyat one per active request (docs/cli-design.md:738, 828-843), and--memory-limit/[memory] reservealready bound the pool at serve time without re-export. The PR's contribution is that the cap also lowers the core'smax_sequence_tokensand that the prepared pool shrinks at export. The description should say what--kv-cache-limitcannot do, since the earlier review raised exactly this (#454 review point 2). Evidence check: the measured table uses--kv-cache-limit concurrency(one prepared context per active request = 4 × 256K at default), so the delta is genuinely the prepared-context times concurrency product — the measurement supports the claim, but only at concurrency >= 2 and only with that limit mode; nothing isolates how much of the win comes from the smaller pool versus the smaller advertised ceiling. - No tests. The diff adds none, for a change in shared planning code that alters exported cores. AGENTS.md:194-199 requires tests that exercise the affected behavior; tests/cli/test_planning.py (e.g. :71-120) is the natural home for
prepared_contextresolution, the<=0rejection, and the below-chunk message. Note the below-chunk branch (planning.py:694-700) is untested and picks its message onprefill_chunk is None, not on whether the user set--request-context; with the recipe's own chunk (omitted flag) it tells the user to pass--prefill-chunk-size ... or a larger --request-context, which is correct, but with an explicit--prefill-chunk-sizeabove a low target it reports only the chunk mismatch — fine. The branch is reachable only when a target is set below the chunk, sincecontext >= chunkalready holds at planning.py:621-623 for the stock path. - Docs framing. docs/cli-design.md:446 calls
--request-contexta way to buy "concurrency headroom in a memory-constrained multi-model deployment", which names an unsupported workflow; the same table's Context-limit rows (:1443, :1493) are consistent with the code.docs/cli-design.md:738still describes--kv-cache-limitas bounding history by "prepared context", which is now the capped one — consistent, no edit needed.
#25 [medium] Should fix + nits at 9118add: help bounds, context_hint, missing status_label, evidence scoping
Head 9118add, all should-fix/nit severity.
-
User-visible bounds still describe the uncapped world.
ignition/cli/help.py:46printsContext: {recipe.context:,} tokensinMODEL --help, andRecipeParameters.prefill_chunkvalidates againstctx.recipe.contextwithmax_fn=_recipe_context_limit(ignition/parameters.py:1294-1307,:1268-1269; help text at:1458-1462). After a cap, the help advertises a context and a chunk ceiling the plan rejects (see blocking entry on planning.py:594) or that the core cannot serve. Use the plan's prepared context where a plan exists; in help, print the recipe max plus the cap note. -
context_hintunconditionally names the cap.ignition/cli/serve.py:68says "context is limited by the checkpoint, cache capacity, and --request-context cap" even when no cap is set, so the hint names a flag the deployment does not use. Make it conditional onplan.prepared_context < recipe.context(the plan is in scope at_server_options). -
The cap never appears in the printed plan report.
context_targethas nostatus_label(ignition/parameters.py:1309-1321), and the pre-#545 explicit "· request context N" line in_preparewas folded intoplan.parameters.status_parts(...)(ignition/cli/serve.py:268-272;parameters.py:1540-1562). So theSelect GPUs.line a user reads does not say the core was exported with a reduced context, though other DEPLOYMENT flags do (parameters.py:1368,:1377). Addstatus_label=lambda v: f"request context {v:,} tokens" if v else None. This is the AGENTS.md:452-456 requirement that a setting's printed report describe what was prepared. -
Evidence scoping. The VRAM table holds only under a non-default
--kv-cache-limit:helios/src/runtime_core/memory.rs:284-292returnsOk(None)forKvCacheLimit::Memory, the default (docs/cli-design.md:740), and only Context/Concurrency derive a ceiling frommax_sequence_tokens(memory.rs:298-330). Export-side sizing does not set pages from the cap:fitsizes pages from available memory (ignition/planning.py:471-480) andPlan.demand_pagesstill usesrecipe.context(:320-321). Put the--kv-cache-limitcondition on the headline result rather than only in the command line. -
Nit:
docs/cli-design.md:468says the flag is "Command line only" but the description also calls itmanifest_key/reproduction-arg recorded — the row is accurate for the CLI; the fix needed is only the "resolves to the smaller of N" wording if the clamp stays rejected (see blocking entry). Nit: the accessor short-circuitsrecipe.contextfor the no-target case (planning.py:360-362) but could equally bemin(recipe.context, target or recipe.context).