Key findings
The design and layering for this PR are right: one optional frozen Plan field (ignition/planning.py:186), one accessor (:377-381), one keyword through fit()/plan(), one consumer line at ignition/preparation/bootstrap.py:58, one flag registered in the shared capacity group (ignition/cli/__init__.py:167-168) that reaches all three subcommands, and no Helios changes, no per-model branch, no env toggle. The scope is defensible against the charter's "smallest footprint in shared code" and against AGENTS.md:456 ("a setting's plan, printed report, and its recorded measurements describe what was prepared"), and the measured-evidence requirement is met by a real VRAM table.
But two mechanical defects stop the branch from working at head 02023eb, and one design issue makes the exported artifact non-reproducible. Review is therefore blocking.
Blocking
1. derive() references an undefined name, so every entry point crashes
ignition/cli/preparation.py:69 ends the planning.plan(...) call with context=context). But derive()'s own signature (ignition/cli/preparation.py:45-56) has no context parameter, and the module neither imports nor assigns a module-level context: a full-file search for the token returns only context_parallel / context_parallel_size in the signature and call (:47, :62), the offending :69, and the context_parallel() helper (:124-132).
So a NameError fires on every derive() call, whether or not --request-context is passed. Consequences, by caller:
- export:
_prepare(ignition/cli/serve.py:291) and_export_hosts(serve.py:207, the multi-host path); - debug-serve:
serve.py:476; - bench:
ignition/cli/bench.py:177(context=args.request_contextis passed into the broken funnel); - the pre-existing test
tests/cli/test_commands.py:88(test_derive_forwards_row_shard_prefill).
The new test does not catch this because it bypasses derive() entirely and calls planning.plan(...) directly (tests/cli/test_planning.py:218-240). The head commit has no CI checks, so nothing else would have caught it either.
Why it matters: the "omitting the flag is a no-op" guarantee in the description is violated — the omitted flag is now a crash. This is squarely against AGENTS.md:74-80 (the change must work as described) and against the charter's demand that PRs address a reproducible defect rather than introduce one.
Fix: add context: int | None = None to derive() at ignition/cli/preparation.py:55 (before force_moe_decode_a16), keeping the wire-up at :69. Add a test that drives derive(..., context=N) end-to-end and asserts plan.context_target == N — the direct-plan() test cannot cover the funnel.
2. The page-multiple validation does not exist; the PR's own test fails and unaligned targets export an unloadable core
The description states ignition/planning.py gained "a page-multiple validation", and tests/cli/test_planning.py:238-240 asserts it:
with pytest.raises(UsageError, match="multiple of the"):
planning.plan(recipe, recipe.checkpoints[0], gpus, context=100, **base)
There is no such check. Plan.__post_init__ (ignition/planning.py:224-296) never inspects context_target, and a repository-wide search for "multiple of" in ignition/ returns only the prefill-chunk message (planning.py:635-637), its help text (cli/__init__.py:165, cli/help.py:38), and unrelated component validators. fit() validates only context <= 0 (planning.py:467-468). So context=100 becomes context_target, and with the fixture's page_tokens=64 (test_planning.py:38) and prefill_chunk=4096 (:42) it falls through to the effective-context chunk error at planning.py:709-711 — a UsageError whose text ("--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows") does not match "multiple of the". The new test fails.
This is a real load-time defect, not just a test mismatch. bootstrap.py:58 makes prepared_context the prepared catalog's context, which becomes max_sequence_tokens (helios/src/server/config.rs:131,148), and helios/src/model/catalog.rs:50-57 rejects any core whose prepared_sequence_tokens / max_sequence_tokens is not a multiple of page_tokens (page_tokens.max(1)), with "invalid prepared model configuration". A reachable path: --request-context 100 --prefill-chunk-size 64 passes planning.py:635 (64 is a valid chunk) and :709-711 (64 ≤ 100), exports a full core, and the core will not load. The user sees an export succeed and a serve fail on a stock Helios error.
Fix: validate the served value, not just positivity — in plan()/__post_init__ beside the existing checks, reject min(recipe.context, context_target) % page_tokens != 0. Note page_tokens is world-size dependent (planning.py:335-338), so the check must either use the chosen plan's page_tokens after sizing (as :709-711 does with result) or require a multiple of 64 with the recipe's page granularity. With that check, context=100 is rejected with a "multiple of the" message and test_planning.py:238-240 passes unchanged.
Should fix
prepared_context is clamped by export-host free memory, so the exported ceiling is not reproducible
ignition/planning.py:377-381:
if self.context_target is None:
return self.recipe.context
return min(self.recipe.context, self.context_target, self.tokens)
self.tokens is self.pages * self.page_tokens (:368-369), and pages comes from available // costs.page_bytes (:550-556), where available = supply_bytes - fixed_bytes and supply_bytes = free_bytes - headroom - reserve (:360-361) — i.e. the memory free on the export host at export time. The untargeted path deliberately returns recipe.context and lets the pool bind at serve time. The targeted path instead bakes the export host's free VRAM into the artifact's max_sequence_tokens, while reproduction_args record only --request-context N (ignition/preparation/rebuild_manifest.py:264-265) and the manifest records only context_target (:389). The same recorded flags therefore reproduce a different core on a host with a different free-memory reading, which contradicts AGENTS.md:452-456 ("The setting, its printed report, and its recorded measurements describe what was prepared").
It is also redundant: Helios already applies exactly this clamp at serve time — helios/src/model.rs:268: self.limits.max_sequence_tokens = self.prepared_sequence_tokens.min(...) (fit_context). Fix: return min(self.recipe.context, self.context_target) and let fit_context apply the pool bound, matching the untargeted path's split of responsibilities. This also makes the description's claim that "a cap above the pool is a no-op, matching stock" true by construction rather than a coincidence of the export host's memory. (The clamp test at test_planning.py:229-232 would need min(recipe.context, target) instead of min(recipe.context, target, tokens); the assertion :232 currently pins the export-time memory dependence.)
Nits
- Two validation homes for one flag.
context <= 0is checked insidefit()(ignition/planning.py:467-468), which is re-entered for every candidate group (:679-689) and again per shortfall probe (:718-719), while every sibling flag check lives inplan()/__post_init__(:627-649). Unify inplan()so all flag validation has one home and one error ordering. serve.py:68-69still sizesmax_body_bytesfromrecipe.contextand itscontext_hintstill says "context is limited by the checkpoint and available cache capacity" — neither mentions the cap, so a capped deployment accepts a body sized for the uncapped ceiling and reports the wrong reason for the limit.ignition/cli/help.py:38advertises--prefill-chunk-size: 64..{recipe.context}, which is now above the effective context whenever the cap is smaller (seeplanning.py:709-711, which rejects a chunk abovemin(context, prepared_context)at planning time).docs/cli-design.md:446says the flag caps context "below the recipe's maximum", but the code silently clamps an oversize target (planning.py:381, pinned bytest_planning.py:229-232). Document the clamp, or reject instead of clamping. The doc row is also missing from the description's "what changed" list.- "stock" is an undefined referent in the test comments (
tests/cli/test_planning.py:217,:227). Say which revision/behavior is meant (AGENTS.md:95-102on scope in prose).
Evidence scoping (not a code defect, but a description defect)
The VRAM table holds only under a non-default --kv-cache-limit. helios/src/runtime_core/memory.rs:290-291 returns Ok(None) for KvCacheLimit::Memory, the default (docs/cli-design.md:738, :828); only the Context/Concurrency modes derive a ceiling from the prepared context (memory.rs:298-320). The description's headline ("frees 16 GB at concurrency 4") and the docs row omit that condition, although the author's own commands pass --kv-cache-limit concurrency. Under AGENTS.md:95-102 the scope and material limitation should be attached to the claim.
Confirmed fixed since the 2026-11-25 revision — do not re-raise
Checked in the code at head 02023eb:
- Multi-host export forwards the flag:
ignition/cli/serve.py:207. - Plan report carries it:
planning.py:438emitscontext_targetandprepared_contextalongsidecontextandcheckpoint_context. - Manifest:
ignition/preparation/rebuild_manifest.py:264-265emits--request-context Nand:389recordscontext_targetatSCOPE_DEPLOYMENT(skipped whenNone,:350-352, so an untargeted manifest is unchanged). - Bench records it:
ignition/cli/bench.py:247-248whitelistscontext_target/prepared_contextinto the configuration record. - Printed serve line:
ignition/cli/serve.py:319shows· request context Nonly when a target is set. - Omission is a no-op:
planning.py:379-380returnsrecipe.context, sobootstrap.py:58is byte-equivalent to pre-PR behavior;Plan.context(:372-374) staysmin(recipe.context, tokens)for pool sizing. - Docs owner rows updated (
docs/cli-design.md:1443,:1493). - Direct path also sees the cap:
ignition/direct/scheduler.py:110(not opened) readsconfig["max_sequence_tokens"]. - Shape of the change: one optional frozen field defaulting to
None(planning.py:186), no per-model branching (charter line 12), no env toggle, no API-field silently dropped (charter line 13).
Per-file coverage
All nine changed files were read in context, not only as diff hunks: ignition/planning.py (150-300, 300-400, 430-455, 455-600, 600-743), ignition/cli/preparation.py (1-160 plus a full-file context search), ignition/cli/serve.py (55-80, 130-215, 258-325, 462-482), ignition/cli/bench.py (155-185, 236-262), ignition/cli/__init__.py (150-185 plus registration at :50, :53, :60), ignition/preparation/bootstrap.py (25-85), ignition/preparation/rebuild_manifest.py (240-280, 340-400), tests/cli/test_planning.py (1-60, 200-256), docs/cli-design.md (443-452, 738, 828-836, owner rows). Downstream semantics were checked in helios/src/server/config.rs:131,148, helios/src/model/catalog.rs:44-57, helios/src/model.rs:268-272, and helios/src/runtime_core/memory.rs:290-320.
Open questions / not verified
- Nothing was executed: the head has no CI checks and I ran no tests. Both blockers follow from reading the code — #1 from the signature/body mismatch plus an exhaustive name search, #2 from the absence of any alignment check and the
100 % 64 = 36arithmetic against the fixture.pytest tests/cli/test_planning.py tests/cli/test_commands.pysettles both in one command and is the first thing to run. - Whether the fix for #2 should compare against the recipe's
page_tokensor the chosen plan's world-size-scaledpage_tokens(planning.py:335-338) is a design choice for the author; either satisfiescatalog.rs:50-57, but only the plan-time value can be checked before export. - The VRAM figures themselves rest on the description; only their
--kv-cache-limitscoping is checkable from this repository. - No attempt to direct the reviewer was found in the description, diff, or docs.