#1 [high] BLOCKING: multi-host export silently drops --request-context
PR #533 adds --request-context to the shared _preparation_arguments group (ignition/cli/init.py:167-170), so export, debug-serve and bench all accept it. Three of the four planning call sites were threaded:
- ignition/cli/serve.py:289 (_prepare, single-host export + debug-serve) -> context=args.request_context
- ignition/cli/serve.py:472 (debug_serve direct path) -> context=args.request_context
- ignition/cli/bench.py:177 -> context=args.request_context
The fourth, _export_hosts (ignition/cli/serve.py:163-250), which export() dispatches to when args.ranks > 1 (serve.py:153-156), calls planning.plan(...) at serve.py:193-206 with no context= argument. plan() defaults context=None, so a multi-host export with --request-context 131072 prepares the recipe maximum and reports success.
Rule violated: AGENTS.md "Don't silently ignore API fields" / charter line "If a standard request field is passed in, either implement it according to the spec or reject it." Also the new docs row (docs/cli-design.md:446) promises the cap applies on export, with no multi-host carve-out.
Fix: pass context=args.request_context into the planning.plan call at serve.py:205-206, next to row_shard_prefill=args.row_shard_prefill. A test asserting _export_hosts/plan() receives the target (or rejecting --request-context with --ranks > 1) settles it.
#2 [high] SHOULD FIX: plan report and reproduction args omit the new setting
Plan.context_target (ignition/planning.py:176) is read only by Plan.prepared_context (planning.py:369-373) and set by fit (planning.py:535). Two plan-introspection paths that every other setting in the plan goes through were not updated:
-
Plan.to_dict()(planning.py:389-442) still publishes only"context": self.context(line 430) and"checkpoint_context": self.recipe.context. Neither the requested target norprepared_contextappears. This dict is the JSON plan printed by export/debug-serve/bench (serve.py:215, serve.py:485, bench.py:182) and saved as the benchmark'spreparationrecord (bench.py:237-248, which hand-picks keys). After--request-context 131072the printed plan therefore showscontext=min(recipe.context, tokens)— the stock number — and nothing that says the core was prepared for 131072. -
rebuild_manifest.reproduction_arguments()(ignition/preparation/rebuild_manifest.py:231-318) emits--max-concurrency,--prefill-chunk-size,--row-shard-prefill,--autotune-effort, etc., but not--request-context(grep: no occurrence outside planning.py/cli). Soflare inspect'sreproduction_args, and thepreparation.parameterslist built byfrom_plan(rebuild_manifest.py:343-454), cannot reproduce the exported core: replaying them silently yields the recipe maximum.
Rule: AGENTS.md Configuration section — "A setting that only experiments need is an advanced flag carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared."
Fix: add "prepared_context": self.prepared_context (and the target, or just the prepared value) to to_dict, and add to reproduction_arguments:
if plan.context_target is not None:
args.extend(['--request-context', str(plan.context_target)])
plus a SCOPE_DEPLOYMENT entry in from_plan if the parameter list is meant to be complete.
#3 [high] Lens D consolidated: tests absent, validation misplaced, prose bloat
Lens D (simplicity) findings, all verified in code (three earlier scratchpad_write calls failed at turn end; this consolidates them):
a) NO TESTS. Nothing in tests/ references --request-context, context_target or prepared_context (search_code over tests/ returns no matches). The PR adds a CLI flag, a dataclass field, a property, a validation and a rewritten error with no test. AGENTS.md "Require focused, meaningful validation" ("Tests must exercise the affected behavior or contract"); charter "Bring real evidence". #454 (same author, same feature) was rejected partly for exactly this and it is unchanged. Smallest proving test, using the fixture recipe in tests/cli/test_planning.py (context=262144, prefill_chunk=4096, page_tokens=64): (i) planning.fit(..., context=65536).prepared_context == 65536; (ii) omitting context gives prepared_context == recipe.context and is == the stock plan — this is the PR's loudest claim ("omitting the flag is a no-op, byte-equivalent to stock") and is currently only asserted by prose; (iii) common_preparation_kwargs(plan, ...)["context"] == 65536 (ignition/preparation/bootstrap.py:58), which is the one line that makes the cap reach the core; (iv) planning.plan(..., context=2048) raises the new default-chunk error, and with an explicit --prefill-chunk-size above the cap raises the other arm.
b) THE POSITIVE-TARGET CHECK IS IN THE WRONG PLACE, and can be deleted from fit. fit validates at ignition/planning.py:459-460, but fit runs inside plan.fitted() which is called once per candidate world size (planning.py:684-690) and again for every option probe (planning.py:707-724), so a value that cannot change is re-checked many times per command. Smaller version: drop the if context is not None and context <= 0: raise ... branch from fit (planning.py:459-460) and validate once — either in the flag (type= helper on capacity.add_argument at cli/init.py:167) or with a single guard at the top of plan() beside the other flag validation (planning.py:601-619), which already carries the --max-concurrency and --image-concurrency range checks. Same message, one site, outside the candidate loop.
c) DEAD EXPRESSION. At planning.py:694, effective_context = min(result.context, result.prepared_context). prepared_context is min(recipe.context, ...), so prepared_context <= recipe.context and context == min(recipe.context, tokens): the min can never select result.context unless it equals prepared_context. Write if chunk > result.prepared_context: and use result.prepared_context in both message arms; delete the local.
d) FAT ERROR TEXT (nit). planning.py:696-700, the default arm says "pass --prefill-chunk-size (a multiple of 64) below 131,072 or a larger --request-context", restating syntax the help already gives (cli/init.py:163-166 states "a multiple of 64"). The two arms can stay (the maintainer asked for the distinction in #454) but both can be one line each.
e) HELP TEXT AND DOCS ROW ARE LONGER THAN THE SETTING (nit). cli/init.py:167-170: "…Omitted flag uses the recipe's max context (the pool fills the free VRAM)" — the parenthetical explains sizing nobody asked about and duplicates the docs. Sibling --prefill-chunk-size uses one clause plus a default. Suggested: help="cap the prepared per-request context and max_sequence_tokens at N tokens; longer requests are rejected (default: the recipe's maximum context)". docs/cli-design.md:446 likewise carries a rationale clause ("Shortening the per-request context buys concurrency headroom in a memory-constrained multi-model deployment, since the per-request cache allocation is sized from the prepared context") that duplicates the Configuration-table row at :1443 and the KV section at :829-841; keep the convention used by neighbours ("Command line only; a core's catalog is fixed at export, so changing it requires re-export"), drop the rationale to the PR description.
f) NOT A FINDING: the flag's placement in the capacity and compression argument group (cli/init.py:156) is right; Plan.context_target as an optional field is the minimal change and needs no enum or config key; prepared_context returning the recipe max when unset (planning.py:371-372) is a deliberate no-op that keeps the existing recipes unchanged, so it should stay rather than be folded into context.
#5 [high] Report of 2026-11-26 (head de1b5b5) — lens D]
Review of PR #533 "Cap the per-request context target" — lens D (simplicity), head de1b5b5
Diff re-read at de1b5b5 (9 files, +98/−18).
Resolved since my 2026-11-25 report (entry #4)
ignition/cli/serve.py:206:_export_hostsnow passescontext=args.request_context; multi-host export honours the cap. (was blocker)ignition/planning.py:289-290: page-multiple validation ofcontext_targetinPlan.__post_init__.ignition/planning.py:432:to_dictpublishescontext_target;ignition/preparation/rebuild_manifest.py:264-265emits--request-context;:390addscontext_targetas SCOPE_DEPLOYMENT.tests/cli/test_planning.py:211-265: one test covers no-op, clamp, both validations, to_dict key, manifest reproduction arg + parameter.- Correction to my earlier nit:
effective_context = min(result.context, result.prepared_context)(planning.py:696) is NOT dead — with no targetprepared_context == recipe.context(:374) can exceed the pool-boundcontext(:368), so theminpreserves stock behaviour. The simplification is instead to fold the clamp into the accessor.
Findings
1. Should fix — prepared_context can be collapsed so the duplicate clamp disappears
ignition/planning.py:371-375 returns the recipe max when unset and min(recipe.context, target, tokens) otherwise; callers then re-clamp at :696. Smaller version:
@property
def prepared_context(self) -> int:
"""The context the prepared core serves per request."""
return self.context if self.context_target is None else min(self.context, self.context_target)
(self.context already is min(recipe.context, self.tokens), :368.) Then planning.py:696-700 uses result.prepared_context directly and the local effective_context goes away. Behaviour identical, 6 lines → 3, and no reader has to prove prepared_context <= context.
2. Should fix — the test proves the property's own arithmetic, not the behaviour that matters
tests/cli/test_planning.py:220-232,247 asserts e.g. capped.prepared_context == min(recipe.context, 131072, capped.tokens) and capped.context == min(recipe.context, capped.tokens) — restatements of planning.py:368,375. The one seam the PR actually depends on, ignition/preparation/bootstrap.py:58 ("context": plan.prepared_context), is never asserted, so nothing pins "the cap reaches max_sequence_tokens". The established pattern is tests/cli/test_commands.py:88-91. Add two lines:
kwargs = common_preparation_kwargs(capped, compile_forwards=True, kernel_cache=None, retain_graphs=False)
assert BasePreparationConfig(**kwargs).context == 131072
assert BasePreparationConfig(**common_preparation_kwargs(stock_plan, compile_forwards=True,
kernel_cache=None, retain_graphs=False)).context == recipe.context # no-op path
and drop the mirrored min(...) assertions that only restate the property.
3. Should fix — recorded measurements still omit the prepared context
ignition/cli/bench.py:243-248 hand-picks the preparation record's keys and contains no context key at all, so a benchmark result records neither context_target nor the prepared context; Plan.to_dict (planning.py:432) publishes the stock "context" beside "context_target" but not the prepared value. AGENTS.md:454-456 requires the plan's recorded measurements to describe what was prepared. Fix: add "prepared_context": self.prepared_context next to "context_target" and add "context_target", "prepared_context" to the bench key tuple.
4. Nit — the positive-target check lives in fit, which runs per candidate and per probe
ignition/planning.py:461-462 runs once per candidate world size and once per shortfall option probe (planning.py:664-692, :707-724); every other CLI range check sits once in plan() (:623-625). Move the identical guard beside the chunk check.
5. Nit — the new default-chunk error is one long line that restates the fix twice
ignition/planning.py:699 is ~170 characters and spells both the constraint and the remedy; both arms say the same thing and differ only in naming the default. One arm suffices, e.g.
raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {result.prepared_context:,}-token prepared context")
plus, only when prefill_chunk is None, a ; the default chunk is {chunk:,} clause. The (a multiple of 64) hint belongs to --prefill-chunk-size's own help (cli/__init__.py:163-166).
6. Nit — help text and docs row are longer than the setting
ignition/cli/__init__.py:167-170 spends three lines ("cap the prepared context and max_sequence_tokens at N; a request that would exceed N is rejected. Omitted flag uses the recipe's max context") where the neighbour's pattern is one clause plus a default: "cap the prepared per-request context at N tokens; longer requests are rejected (default: the recipe's maximum)". docs/cli-design.md:446 carries a rationale sentence ("With --kv-cache-limit concurrency, shortening … frees VRAM") that repeats the KV-limit section (docs/cli-design.md:828-833) and the two owner rows this PR edits (:1443, :1493); keep the tabular behaviour and the existing "Command line only" clause, move the rationale to the PR description (repo-prose skill: documentation is a present-state spec, not an argument; AGENTS.md:43-50).
Checked and deliberately not reported
- One optional field, one accessor, one threaded keyword through
derive()/fit()/plan(), one line inbootstrap.pyis the minimal shape; no new enum, config key or parallel path. derive()'s pass-throughcontextkeyword (ignition/cli/preparation.py:56,68) is needed bybench.py:177only, but is 2 lines and matches the existing keyword style.- Keeping
Plan.contextstock and addingprepared_contextis right: folding the cap intocontextwould change what every existing caller ofcontextmeans. - Chunk-vs-cap interaction: the new first arm of the chunk error is reachable only through an explicit target below the default 4096-token chunk (the pool floor is 8192 tokens,
planning.py:336), so it is needed, not a dead branch.
#6 [high] Research summary
Reviewed PR #533 at head de1b5b5 through lens D (simplicity). The three findings from my previous pass are gone: multi-host export now forwards context= (serve.py:206), the page-multiple validation sits in Plan.__post_init__ (planning.py:289), and to_dict/reproduction_arguments/from_plan all record the setting, with one test in tests/cli/test_planning.py:211-265. I also corrected my own earlier nit: the min(result.context, result.prepared_context) at planning.py:696 is not dead, because with no target prepared_context is the recipe max, which can exceed the pool-bound context — the real simplification is to fold the clamp into the accessor.
Remaining, minor: (1) collapse prepared_context to self.context if self.context_target is None else min(self.context, self.context_target) and drop the local effective_context, which keeps stock semantics with three lines; (2) the new test asserts restatements of the property's own min(...) expressions and never asserts common_preparation_kwargs(...)["context"], the one seam that makes the cap reach max_sequence_tokens — two lines in the existing test_commands.py:88 pattern would pin it; (3) bench's hand-picked preparation record (bench.py:243-248) and to_dict still never state the prepared context, so the recorded measurement does not describe what was prepared (AGENTS.md:454-456) — add prepared_context to both; (4) the positive-target check belongs beside the other CLI range checks in plan() rather than in fit, which runs per candidate and per shortfall probe; (5) nits: the ~170-character two-arm default-chunk error and the three-line help entry plus the rationale clause in the docs row (docs/cli-design.md:446), both longer than the setting they describe.
Full detail, with the smaller version of each change, is in scratchpad entry #5.
#7 [high] Lens-D verdict and exact citations for the final report
Verdict and citation sheet (head de1b5b5, 2026-11-26)
Verdict for lens D: no blocking issues. The feature is already minimal; what remains is three small simplifications/fixes and three nits. Detail and smaller versions are in entry #5; this note adds the citations the report must carry.
Resolved since my 2026-11-25 report (entry #4) — verified in the code
- Multi-host export forwards the target:
ignition/cli/serve.py:206(row_shard_prefill=args.row_shard_prefill, context=args.request_context). Single-host export/debug-serve:serve.py:289,serve.py:472; bench:ignition/cli/bench.py:177. - Page-multiple validation:
ignition/planning.py:289-290inPlan.__post_init__; positive-target validation:planning.py:461-462infit. - Reporting:
planning.py:432("context_target"into_dict),ignition/preparation/rebuild_manifest.py:264-265(--request-contextinreproduction_arguments),:390(add('context_target', SCOPE_DEPLOYMENT, ...)infrom_plan). - Test:
tests/cli/test_planning.py:211-265. - Correction of my earlier nit:
planning.py:696effective_context = min(result.context, result.prepared_context)is NOT dead; whencontext_target is None,prepared_contextreturnsself.recipe.context(planning.py:374) which can exceed the pool-boundcontext(min(recipe.context, tokens),planning.py:368). Keep the clamp; simplify by folding it into the accessor instead.
Citations per finding
- Should fix — collapse the duplicate clamp.
ignition/planning.py:371-375(accessor) and:696-700(caller). Smaller version:return self.context if self.context_target is None else min(self.context, self.context_target); then the caller usesresult.prepared_contextand the localeffective_contextgoes away. - Should fix — test proves arithmetic, not the seam.
tests/cli/test_planning.py:220-232and:247restateplanning.py:368,375(min(recipe.context, 131072, capped.tokens),min(recipe.context, capped.tokens)).ignition/preparation/bootstrap.py:58("context": plan.prepared_context) is unasserted. Pattern to copy:tests/cli/test_commands.py:88-91(common_preparation_kwargs→BasePreparationConfig). Rule: AGENTS.md:194-199 ("Require focused, meaningful validation … Tests must exercise the affected behavior or contract"). - Should fix — recorded measurement omits the prepared context.
ignition/cli/bench.py:243-248hand-picks thepreparationkeys and has no context key at all;ignition/planning.py:432publishes stock"context"beside"context_target"but notprepared_context. Rule: AGENTS.md:454-456 ("the plan, its printed report, and its recorded measurements describe what was prepared"). Fix:"prepared_context": self.prepared_contextinto_dict, and add"context_target", "prepared_context"to the bench tuple. - Nit — validation placement.
ignition/planning.py:461-462insidefit, re-entered per candidate and per shortfall probe viafitted/candidates/attempt(planning.py:664-692,:707-724); every other CLI range check is once inplan()—--prefill-chunk-sizeatplanning.py:623-625. - Nit — two-arm chunk error too long.
ignition/planning.py:697-700; the first arm is reachable only via an explicit target below the default 4096-token chunk (pool floor is 8192 tokens:MINIMUM_REQUEST_TOKENSatplanning.py:32,minimum_pagesat:336), so keep one arm plus an optional "; the default chunk is N" clause.(a multiple of 64)already lives in--prefill-chunk-sizehelp (ignition/cli/__init__.py:163-166). - Nit — help and docs prose longer than the setting. Help:
ignition/cli/__init__.py:167-170(three lines) against neighbour style at:163-166. Docs row:docs/cli-design.md:446; its rationale duplicates the KV-limit sectiondocs/cli-design.md:828-841and the two owner rows this PR edits (:1443,:1493). Rules: AGENTS.md:43-50 (required prose review) and the prose skill's "documentation is a present-state specification, not a changelog" (.agents/skills/repo-prose/SKILL.md:26-29).
Checked and not reported
- One optional field (
planning.py:176), one accessor, one keyword threaded throughderive()/fit()/plan(), one line inbootstrap.py:58: minimal shape, no new enum, config key, or parallel path. derive()'s pass-through keyword (ignition/cli/preparation.py:56,68) is used bybench.py:177; 2 lines, matches existing style.- Keeping
Plan.contextstock and addingprepared_contextis right; folding the cap intocontextwould change every existing caller's meaning. - Prior blocker about VRAM benefit being conditional on
--kv-cache-limit context|concurrency(docs/cli-design.md:738, :828-841) is now stated in the docs row (docs/cli-design.md:446) and in the description's workload line.
#9 [high] Report of 2026-11-26, run 1310 — lens D, head 02023eba
Review of PR #533 "Cap the per-request context target" — lens D (simplicity)
Head 02023eba (single new commit on f377dc85), 9 files, +84/−18 per the packet (pr_files: docs/cli-design.md +3/−2, cli/init.py +2, cli/bench.py +3/−1, cli/preparation.py +1/−1, cli/serve.py +5/−4, planning.py +19/−9, preparation/bootstrap.py +1/−1, preparation/rebuild_manifest.py +3, tests/cli/test_planning.py +47).
Verdict
Blocking: 1. Should fix: 2. Nits: 5.
Blocking
A. tests/cli/test_planning.py:238-240 asserts a validation the head no longer has; the test cannot pass
- The head has no page-multiple validation at all: full read of
Plan.__post_init__(planning.py:224-296) andfit(planning.py:453-556) shows only the positive-target check at planning.py:467-468.grepfor "multiple" in planning.py yields only the--prefill-chunk-sizerule at :635-637. Earlier heads had it at ~:289-290; it is gone. - The test still does:
with pytest.raises(UsageError, match="multiple of the"): planning.plan(..., context=100, **base). - What actually happens for
context=100on the fixture (context=262144, page_tokens=64, prefill_chunk=4096, tests/cli/test_planning.py:37-42): nothing rejects 100 duringfit;plan()then computeseffective_context = min(result.context, result.prepared_context)= 100 (planning.py:709) and raises the chunk error at :710-711: "--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows".match="multiple of the"does not match → Failed: DID NOT MATCH. - Consequence of dropping the check (why it is not just a stale test): Helios rejects a core whose
max_sequence_tokensis not a multiple ofpage_tokens(helios/src/model/catalog.rs:49-57, "invalid prepared model configuration"), so--request-context 1000(1000 % 64 = 40) now exports a core that fails to load atflare run, long after export. The PR description's What Changed still lists "a page-multiple validation". - Fix: restore one check on the value the core is told to serve —
if self.context_target is not None and min(self.recipe.context, self.context_target, self.tokens) % self.page_tokens: raise UsageError(f"--request-context {self.context_target:,}: the {self.page_tokens:,}-token page size requires a multiple")(100 % 64 = 36 still rejected, 500000 → min(262144, 500000, tokens) = 262144 aligned, so the clamp case at :229-232 still passes). Alternative: delete the :238-240 case, drop the "a page-multiple validation" clause from the description, and state the alignment rule in docs/cli-design.md:446. - Description also claims the chunk error "distinguishes the default chunk from an explicit one"; the head has a single message (planning.py:710-711). Same stale-clause bullet.
Should fix
B. planning.py:376-381 + :709 — the clamp exists twice; fold it into the accessor and delete the local
Current:
@property
def prepared_context(self) -> int:
"""The context the prepared core serves per request; the recipe max when no target is set."""
if self.context_target is None:
return self.recipe.context
return min(self.recipe.context, self.context_target, self.tokens)
...
effective_context = min(result.context, result.prepared_context)
if chunk > effective_context:
raise UsageError(f"--prefill-chunk-size {chunk:,} exceeds the {effective_context:,}-token context this plan allows")
self.context is exactly min(self.recipe.context, self.tokens) (planning.py:371-374), so the smaller version is behaviour-identical:
@property
def prepared_context(self) -> int:
"""The context the prepared core serves per request; the recipe max when no target is set."""
return self.context if self.context_target is None else min(self.context, self.context_target)
...
if chunk > result.prepared_context:
Deletes the local effective_context, one line, and makes "prepared_context never exceeds the pool capacity" true by construction instead of by a second clamp each caller must re-derive. Six lines → three. (The early return must stay — with no target it returns recipe.context, which can exceed the pool-bound context; checked, not dead.)
C. tests/cli/test_planning.py:219-232, :244 — the test restates the accessor's arithmetic and never asserts the seam it is about
assert stock_plan.prepared_context == recipe.context, assert capped.prepared_context == min(recipe.context, 131072, capped.tokens), assert capped.context == min(recipe.context, capped.tokens), assert stock_plan.context == min(recipe.context, stock_plan.tokens) are all restatements of planning.py:374,381 — they pass even if ignition/preparation/bootstrap.py:58 stopped reading plan.prepared_context, which is the only line that carries the cap into max_sequence_tokens. AGENTS.md:194-199 ("Tests must exercise the affected behavior or contract"); the description claims the test covers "the bootstrap value" — it does not.
Fix (pattern already in the repo, tests/cli/test_commands.py:94-97):
kwargs = common_preparation_kwargs(capped, compile_forwards=True, kernel_cache=None, retain_graphs=False)
assert BasePreparationConfig(**kwargs).context == 131072
assert BasePreparationConfig(**common_preparation_kwargs(
stock_plan, compile_forwards=True, kernel_cache=None, retain_graphs=False)).context == recipe.context
Two assertions replace four mirrored min(...) lines and pin both the cap and the no-op path.
Nits
- planning.py:467-468 — the positive check lives in
fit, re-entered per candidate world size and per shortfall probe (planning.py:677-705, 714-731); every sibling CLI range check is once inplan()(e.g. :634-637). With A's alignment check restored, put both in one place. - serve.py:319 —
f"{' · request context ' + format(plan.prepared_context, ',') if plan.context_target is not None else ''}"; neighbours all use f-string formatting (· concurrency {plan.concurrency}). Usef"{f' · request context {plan.prepared_context:,}' if plan.context_target is not None else ''}"(the onlyformat(..., ',')call in ignition/). - tests/cli/test_planning.py:255-257 — three blank lines before
def test_row_shard_attention_...; two (or one, in a 357-line file that otherwise separates by two). context=keyword naming — the same value is--request-contextin the CLI,contextinfit/plan(planning.py:461,605) andcontext_targetin the plan/to_dict(planning.py:186,438). Naming the parametercontext_targetdeletes the translation at planning.py:549 (language_model_only=..., context_target=context) and the reader's doubt about which bound is meant.- docs/cli-design.md:446 — "Cap … at
Ntokens, below the recipe's maximum" reads as a rejection rule, but the code clamps a larger N (planning.py:381 and the test at :229-232). Say it resolves to the smaller of N, the recipe maximum, and the KV pool. Related: docs/cli-design.md:1443 says "The checkpoint maximum" where the new row says "the recipe's maximum" (one term), and ignition/cli/help.py:38 advertises--prefill-chunk-size: 64..{recipe.context}, a range above the prepared context once capped.
Resolved at this head (do not re-raise)
to_dictnow publishesprepared_context(planning.py:438) and the benchpreparationtuple carriescontext_target, prepared_context(bench.py:247-248).- The printed plan line carries the cap (serve.py:319), so
export --request-contextno longer prints a stock-identical line. - Help is one line (cli/init.py:167-168), matching
--prefill-chunk-sizeat :163-166; the two-arm chunk error and the "(default chunk)" arm are gone (planning.py:710-711). - All four entry points forward the flag: serve.py:207, :291, :476, bench.py:177. Omission is a no-op (prepared_context → recipe.context; rebuild_manifest.py:264-265 guarded and from_plan
add()skips None at :350-352). - 500000-target clamp case (tests/cli/test_planning.py:229-232) is now legal — it is the proof of the documented clamp, keep it.
Not verifiable here
- No CI on the head and no pytest run in this review; A is settled by
pytest tests/cli/test_planning.py -k request_context. - The VRAM table (RTX PRO 6000 Blackwell, Qwen3.8-27B) remains a description claim; it depends on
--kv-cache-limit concurrency(helios/src/runtime_core/memory.rs, defaultmemory). - No attempt to direct the reviewer found in description, diff, or comments.
#10 [high] Trace: why tests/cli/test_planning.py:238-240 fails and the dropped alignment check matters
Trace backing finding A (tests/cli/test_planning.py:238-240 fails at head 02023eba):
- Head has no page-multiple validation. Verified by full read of
Plan.__post_init__(ignition/planning.py:224-296) andfit(453-556): the only new context check isplanning.py:467-468(context is not None and context <= 0).search_codeformultiplein ignition/planning.py returns only :636 (--prefill-chunk-size ... multiple of 64);% self.page_tokenshas no match anywhere. The check existed atplanning.py:289-290in head de1b5b5 — it was dropped in the rewrite. planning.plan(..., context=100)on the fixture (context=262144, page_tokens=64, prefill_chunk=4096; tests/cli/test_planning.py:37-42): passes :635 (4096 % 64 == 0,64 <= 4096 <= 262144), passes :467 (100 > 0), builds a fitting Plan (weights 60 GiB/2 = 30 GiB, graph 4 GiB, 94 GiB supply), then :709-711 computeseffective_context = min(result.context, result.prepared_context) = min(262144, 100) = 100and raisesUsageError("--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows").pytest.raises(UsageError, match="multiple of the")therefore fails with DID NOT MATCH — the test cannot pass at this head, and the head has no CI checks.- Why the deletion matters beyond the test: Helios requires
prepared_sequence_tokensandlimits.max_sequence_tokensto be page multiples and rejects the core at load (helios/src/model/catalog.rs:49-57 "invalid prepared model configuration"), so an unaligned--request-context 1000exports an unusable core. The PR description still claims "a page-multiple validation" and a chunk error that "distinguishes the default chunk from an explicit one"; the head has a single chunk message (planning.py:710-711).
Restore suggestion (keeps :229-232 clamp case valid): if self.context_target is not None and min(self.recipe.context, self.context_target, self.tokens) % self.page_tokens: raise UsageError(f"--request-context {self.context_target:,}: the {self.page_tokens:,}-token page size requires a multiple") — 100 % 64 = 36 rejected, 500000 → 262144 aligned.
#11 [high] Lens-D subtraction inventory and exact smaller versions (head 02023eba)
Lens-D subtraction inventory at head 02023eba (what to delete / shrink), each checked in code:
ignition/planning.py:709-711— localeffective_context = min(result.context, result.prepared_context)duplicates the accessor's own pool bound (self.context == min(recipe.context, tokens)at :371-374). Fold into the accessor:return self.context if self.context_target is None else min(self.context, self.context_target)(:376-381) and testchunk > result.prepared_context. Behaviour-identical, one local gone (~1 line + 1 name).tests/cli/test_planning.py:220-227, 243-244— four assertions restate planning.py:374/381 (min(recipe.context, 131072, capped.tokens)etc.) and two are trivial echoes (d["context_target"] == 131072;stock_plan.context_target is None). None would fail ifignition/preparation/bootstrap.py:58stopped readingplan.prepared_context. Replace with the seam check patterned on tests/cli/test_commands.py:94-97 (common_preparation_kwargs→BasePreparationConfig(**kwargs).context), which pins both the cap and the no-op path in two lines. AGENTS.md:194-199 is the rule.ignition/cli/serve.py:319— the onlyformat(x, ',')call inignition/; neighbours are f-strings.f"{f' · request context {plan.prepared_context:,}' if plan.context_target is not None else ''}".ignition/planning.py:461,605,549— parameter calledcontextat both entry points, stored ascontext_target, sofitends withcontext_target=context. Renaming the parametercontext_targetdeletes the translation line's ambiguity (2 signatures + 1 call site).ignition/planning.py:467-468— the positive check sits infit, whichplan()re-enters per candidate size and per shortfall probe (:677-705, :714-731); sibling CLI checks are once inplan()(:634-637).tests/cli/test_planning.py:255-257— three consecutive blank lines before the next test (file otherwise uses two).docs/cli-design.md:446— "below the recipe's maximum" reads as a rejection rule but the code clamps (planning.py:381 + the test at :229-232). Also :1443 says "The checkpoint maximum" vs the new row's "the recipe's maximum", and ignition/cli/help.py:38 advertises--prefill-chunk-size: 64..{recipe.context}, a range above the prepared context once capped.
Verified load-bearing, do not cut: the context_target is None early return (:379-380; returns recipe.context, which can exceed the pool-bound context), derive(context=...) (cli/preparation.py:56,68 — funnel for all four entry points), prepared_context in Plan.__post_init__ benchmark check (:260), and the guarded manifest entries (rebuild_manifest.py:264-265, :389).
Already fixed at this head (earlier findings, do not re-raise): to_dict publishes prepared_context (:438); bench tuple has context_target, prepared_context (cli/bench.py:247-248); serve line prints the cap (serve.py:319); help is one line (cli/init.py:167-168); two-arm chunk error gone.
#12 [high] Research summary
Reviewed PR #533 at head 02023eba through lens D (simplicity). Notes are entries #9 (full report), #10 (trace backing the blocker) and #11 (subtraction inventory with the smaller version for each item).
Verdict: one blocking issue, two should-fixes, five nits.
Blocking — the new test cannot pass, and the validation it tests was dropped in the rewrite (tests/cli/test_planning.py:238-240 vs ignition/planning.py). A full read of Plan.__post_init__ (planning.py:224-296) and fit (453-556) shows the head has no page-multiple check — only the positive-target guard at :467-468; grep for "multiple" in planning.py finds only the --prefill-chunk-size rule at :635-637. So planning.plan(..., context=100) raises the chunk error at :710-711 ("4,096 exceeds the 100-token context"), and match="multiple of the" fails. Fixing it matters beyond the test: Helios rejects a core whose max_sequence_tokens is not a page multiple (helios/src/model/catalog.rs:49-57), so --request-context 1000 would export an unloadable core. Restoring the check on the served value (min(recipe.context, target, tokens) % page_tokens) keeps the clamp case at :229-232 valid. The description still claims "a page-multiple validation" and a two-arm chunk error; both are stale.
Should fix: (B) the pool clamp exists twice — effective_context = min(result.context, result.prepared_context) at planning.py:709 duplicates the accessor's own bound; folding it into prepared_context (self.context if self.context_target is None else min(self.context, self.context_target)) is behaviour-identical and deletes the local. (C) the new test restates the accessor's arithmetic and never asserts common_preparation_kwargs(...)["context"], the bootstrap seam (bootstrap.py:58) that carries the cap into max_sequence_tokens; two lines in the tests/cli/test_commands.py:94-97 pattern pin it.
Nits: positive check in per-candidate fit rather than once in plan(); format(x, ',') in serve.py:319 where every neighbour is an f-string; three blank lines at tests/cli/test_planning.py:255-257; context= parameters translated to context_target at planning.py:549; docs/cli-design.md:446 says "below the recipe's maximum" while the code clamps, plus the "checkpoint"/"recipe" maximum term split at :1443 and help.py:38 (not opened) advertising a chunk range above the cap.
Verified clean and not re-raised: to_dict/bench/printed-plan-line reporting, all four entry points forwarding the flag, and the manifest guard.
#13 [high] Final report skeleton — verdict, ordering, and what is already resolved
Skeleton for the final report — PR #533, lens D (simplicity), head 02023eba, base main. Details live in #9 (full report), #10 (blocker trace), #11 (subtraction inventory + smaller versions).
Verdict line: "One blocking issue, two should-fix findings, five nits." (Lens D contributes the simplifications; the blocker is a correctness/test defect the rewrite introduced and must be stated first.)
Ordering and one-line summaries:
- BLOCKING —
tests/cli/test_planning.py:238-240cannot pass, and the page-multiple validation it exercises is gone from the head. No such check exists inPlan.__post_init__(ignition/planning.py:224-296) orfit(453-556); only the positive guard at :467-468.context=100instead hits the chunk error at planning.py:710-711, somatch="multiple of the"fails. Real consequence: Helios rejects a non-page-multiplemax_sequence_tokensat load (helios/src/model/catalog.rs:49-57), so an unaligned--request-contextexports an unusable core. Fix: restore one check onmin(recipe.context, target, tokens) % page_tokens; the 500000 clamp case at :229-232 stays valid. Description still claims the validation and a two-arm default-chunk error — both stale. - SHOULD FIX — duplicate clamp: planning.py:709
effective_context = min(result.context, result.prepared_context)vs accessor :376-381. Smaller version:return self.context if self.context_target is None else min(self.context, self.context_target)andif chunk > result.prepared_context:. - SHOULD FIX — test proves arithmetic, not the seam: tests/cli/test_planning.py:220-227, :243-244; unasserted
ignition/preparation/bootstrap.py:58. Fix pattern: tests/cli/test_commands.py:94-97 (common_preparation_kwargs→BasePreparationConfig), two assertions covering cap and no-op path. Rule: AGENTS.md:194-199. - NITS (5): positive check inside per-candidate
fit(planning.py:467-468) instead of once inplan()(:634-637 neighbourhood); the onlyformat(x, ',')in ignition/ at serve.py:319 where neighbours are f-strings; three blank lines at tests/cli/test_planning.py:255-257;context=CLI keyword translated tocontext_targetat planning.py:549; docs/cli-design.md:446 "below the recipe's maximum" contradicts the clamp, plus :1443 "checkpoint maximum" vs "recipe's maximum" and ignition/cli/help.py:38 chunk range above the cap.
Say plainly resolved at this head (so the author is not asked to redo them): to_dict publishes prepared_context (planning.py:438); bench tuple carries context_target, prepared_context (cli/bench.py:247-248); printed plan line shows the cap (serve.py:319); help is one line (cli/init.py:167-168); all four entry points forward the flag (serve.py:207, :291, :476, bench.py:177); omission is a no-op (rebuild_manifest.py:264-265 guarded, add() skips None at :350-352).
Also state: no CI on the head and no pytest run in this review — the blocker is settled by pytest tests/cli/test_planning.py -k request_context; the VRAM table stays a description claim dependent on --kv-cache-limit concurrency; no attempt to direct the reviewer was found.