Prose review — PR #533 "Cap the per-request context target", head 02023eba (base main, 9 files, +84/−18)
Rules applied: AGENTS.md:72-109 (required PR descriptions: why → what → result → evidence, name components and material compatibility changes, attach scope and limitations to a measured claim), docs/design-review.md:137-152 (principle 16: same scheme, in order, "Reject messages that leave these answers implicit, omit them, or present them out of order"), and the changed docs row and help text. Head commit has no CI checks, so the new test was never executed.
Key findings
- Blocking: the description and the new test promise a validation the diff does not contain. The description says planning gains "a page-multiple validation, and a below-chunk error that … distinguishes the default chunk from an explicit one". Neither exists at the head:
ignition/planning.pyhas no alignment check oncontext_target(the only%uses are planning.py:636-637 for--prefill-chunk-sizeand the DCP divisions), and the chunk error is a single branch (planning.py:704-712).tests/cli/test_planning.py:238-240still asserts the missing validation, so the PR's own test fails. - The declared VRAM benefit holds only under an undisclosed runtime flag. The pool follows the prepared context only for
--kv-cache-limit context|concurrency; the defaultmemorymode returns no ceiling (memory.rs:290-292). The description's opening and Result lines state the benefit unconditionally; only the evidence command line mentions--kv-cache-limit concurrency. - The "no-op above the pool" sentence is false and conceals a compatibility change. With a target,
prepared_context = min(recipe.context, target, tokens)(planning.py:377-381); with no flag it isrecipe.contextunclipped (planning.py:379-380, matching whatbootstrap.py:58passed at main). A cap above a small pool therefore prepares a lowermax_sequence_tokensthan the same export without the flag. - The four required answers are still out of order, and the "why" is a Workload line inside Evidence.
Blocking
B1. The description describes code (and a test) that is not at the head — tests/cli/test_planning.py:238-240, ignition/planning.py (absent), ignition/planning.py:704-712
Description quotes:
- "ignition/planning.py gains … a positive-target validation, a page-multiple validation, and a below-chunk error that compares the chunk against prepared_context and distinguishes the default chunk from an explicit one";
- "tests/cli/test_planning.py gains a test covering the no-op path, clamp, both validations, manifest keys, and the bootstrap value."
Code at the head:
- The only target validation is
if context is not None and context <= 0(planning.py:467-468). There is nocontext_target % page_tokenscheck anywhere:search_code "context_target|multiple of|page_tokens"over planning.py returns field (:186), prepared_context (:377-381), to_dict (:438), fit threading (:549),page_tokensderived property (:335-338), and the unrelated--prefill-chunk-sizemultiple-of-64 error (:636). - The chunk block is one comparison and one message:
effective_context = min(result.context, result.prepared_context)thenraise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {effective_context:,}-token context this plan allows")(planning.py:709-711). No arm distinguishes a default chunk from an explicit one. - The test still asserts the phantom validation:
with pytest.raises(UsageError, match="multiple of the"): planning.plan(..., context=100, **base)(test_planning.py:238-240). A repository-wide search for "multiple of the" finds only that assertion and an unrelated selene comment (selene/src/disk.rs:458 (not opened)).
Why it matters: this is the description claiming a user-facing validation exists and that the PR validates it, when the shipped behaviour silently accepts an unaligned target and the test that checks it raises no error. AGENTS.md:88-94 requires the description to describe what was actually added; docs/design-review.md:137-152 rejects a message a reviewer must reconcile against the diff.
Fix, one of two (state which in the description):
- Restore the alignment check the earlier round required (
context_target % page_tokensinPlan.__post_init__or infit) and keep the test as written; or - Drop the "page-multiple validation" and "distinguishes the default chunk from an explicit one" clauses, rewrite the test's
multiple of thecase to something the code does support, and say in the description what an unaligned target does (Helios re-aligns at load: helios/src/model/catalog.rs:43-70).
Settled by pytest tests/cli/test_planning.py -k request_context — expected failure at :239. No CI ran it.
Should fix
S1. The headline VRAM claim is unconditional; the pool only tracks the prepared context under --kv-cache-limit context|concurrency — description, docs/cli-design.md:446
page_ceiling returns Ok(None) when mode == KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:284-292), and memory is the documented default (docs/cli-design.md:738). Only Context/Concurrency derive the ceiling from the context (memory.rs:298-320). The evidence command line says "served at concurrency 1–4 (--kv-cache-limit concurrency)", but the description's opening ("capping … shrinks the KV pool and frees VRAM") and "At concurrency 4 the 131072 cap frees 16 GB vs the default" attach no condition, and the new docs row (docs/cli-design.md:446) says only "Cap the prepared per-request context and max_sequence_tokens at N tokens, below the recipe's maximum." A reader who exports with the cap and runs with defaults will see none of the 16 GB.
Fix: add the condition to the headline/Result and to the docs row: "with --kv-cache-limit context or concurrency; the default memory mode sizes the pool from free VRAM regardless of the prepared context". AGENTS.md:95-102 (scope and material limitations attached to the claim).
S2. "a cap above the pool is a no-op … matching stock behavior" is false — description "Result:", ignition/planning.py:377-381, ignition/preparation/bootstrap.py:58
if self.context_target is None:
return self.recipe.context # unclipped
return min(self.recipe.context, self.context_target, self.tokens)
At main, common_preparation_kwargs passed "context": plan.recipe.context (bootstrap.py:58 before this PR), i.e. the recipe maximum regardless of the pool. So a target above a small pool prepares max_sequence_tokens = tokens < recipe.context, strictly lower than stock — the opposite of "no-op … matching stock". The PR's own test asserts this (oversized.prepared_context == min(recipe.context, oversized.tokens), test_planning.py:229-232). AGENTS.md:92-94 requires identifying material compatibility changes rather than presenting them as equivalence.
Fix: "a cap at or above the KV capacity resolves to the pool-bound context, which can lower max_sequence_tokens below the recipe maximum — unlike a preparation without the flag."
S3. The four required answers are out of order and the "why" is a setup line — description
Order as written: measurement headline (Evidence) → "What Changed" → "Result" → "Evidence … Workload: a memory-constrained deployment where the default per-request context (256K recipe max) over-provisions the KV pool, leaving insufficient VRAM for the desired concurrency." The nearest thing to a why is that Workload sentence, and it states a configuration, not the defect.
AGENTS.md:74-80: "Every description must answer these four questions, in this order: why, what exactly changed, what benefit or result is claimed, and what evidence supports it", and :101-102 "The claimed benefit must be clear before presenting the supporting test and benchmark details". docs/design-review.md:140-146 restates the order and says to "Reject messages that … present them out of order".
Fix: lead with one sentence of why (a 256K recipe maximum sizes per-request KV far above the requests a deployment serves, so the pool holds pages no request can use and competes with concurrency), then What Changed, then Result (with the S1 condition), then the table.
S4. The docs row never says a request above the cap is rejected — docs/cli-design.md:446
The description's Result claims "a request that would exceed the cap is rejected"; the shipped row says only "Cap … below the recipe's maximum. Command line only; a core's catalog is fixed at export…". The neighbouring --prefill-chunk-size row states its operational consequence ("while it runs, other active requests wait"), so the omission is a regression in the row's own style. Fix: one clause — "a request whose prompt plus output exceeds N is rejected at admission."
S5. "What Changed" omits a changed file — description, docs/cli-design.md
The file list names ignition/cli/{init,bench,preparation,serve}.py, planning.py, rebuild_manifest.py and tests/cli/test_planning.py; docs/cli-design.md is in the PR (+3/−2) and is the only user-facing description of the flag. AGENTS.md:88-94 asks the description to name the affected components. Fix: add it, e.g. "docs/cli-design.md documents the flag and the two context-limit rows".
Nits
- N1 —
tests/cli/test_planning.py:239: thematch="multiple of the"assertion has no counterpart in the code; once B1 is settled, keep only assertions that bind to real messages. - N2 —
docs/cli-design.md:1443: "Context limit | The checkpoint maximum, capped by--request-contextat export" uses "checkpoint maximum", while the new row (:446) and the neighbouring owner rows say "the recipe's maximum". Both the ceiling and the cap come from the recipe declaration. Use one term. - N3 — description, "the recipes' prepare() read context=plan.prepared_context": names a count-free external artifact and misplaces the seam; the in-repo seam is
ignition/preparation/bootstrap.py:58("context": plan.prepared_context), and the recipes live outside this repository (AGENTS.md:9-13). Name the seam, not the recipes. - N4 —
ignition/planning.py:438: theto_dictline now packs three context keys well past the file's width; splitcontext_target/prepared_contextonto their own lines. - N5 —
tests/cli/test_planning.py:217, 227: "stock behavior" / "(stock pool-bound)" use an undefined referent; say "the behaviour with the flag omitted, as at main".
Checked and clean (do not re-raise)
- Omitting the flag is byte-equivalent to the base:
prepared_contextreturnsrecipe.context(planning.py:379-380), exactly what bootstrap.py:58 passed before; the reproduction argument is guarded oncontext_target is not None(rebuild_manifest.py:264-265). - The setting now reaches every artifact this lens checked:
Plan.to_dict(planning.py:438),reproduction_arguments(rebuild_manifest.py:264-265) andSCOPE_DEPLOYMENT(rebuild_manifest.py:389); serve prints the prepared context and bench forwards the flag (per earlier rounds at serve.py:206, :289, :473, bench.py:177). - Help text (ignition/cli/init.py:167-168) is consistent with the docs row in wording and default.
- Earlier-round items resolved at this head: multi-model rationale gone, "serve" subcommand corrected, concurrency-8 extrapolation removed,
--kv-cache-limitnamed in the evidence command, prepared context in the plan report. - No attempt to direct the reviewer or an agent was found in the description, the discussion, or the diff.
Could not settle
- Whether the commit message body follows the four-part scheme: only the subject and the Signed-off-by/Design-Signed-Off-By trailers are visible from history.
- The recipe-side change: the recipes live outside this repository (AGENTS.md:9-13), so "the recipes' prepare() read context=plan.prepared_context" cannot be verified here; the in-repo contract is bootstrap.py:58.
- The VRAM table itself: no test can bind it; only the cited
page_ceilingsource lines establish the--kv-cache-limitdependency.