#1 [high] Simplicity review of PR #683: four subtraction findings
PR #683 head 70e84eba. Lens: subtraction/simplicity/conventions.
F1 (frontend.py:40-67 + 209-243) Two parallel mechanisms on the same two mappings:
ImageProcessorSpec.extract: Callable[[Mapping, Mapping], dict](frontend.py:57) is called with(image, model)at frontend.py:242.- The 9 declarative fields (processor_fields, image_processor_key, image_processor_fields, image_processor_exact_keys, image_processor_optional_fields, size_fields, model_fields, model_types, vision_fields) +
_qualified(138-139) + theneeds_imageblock (212-241) check the same two mappings. Every deleted-table check is expressible in extract: model_type check =if model.get("model_type") not in (...). ~45 lines deletable; branches per profile-specific knob (exact_keys used by 1 profile, size_fields by 1 profile) are the classic table-shaped config.
F2 (frontend.py:26-37, 154-202) _validate_image_payload re-hardcodes exactly the recipe knowledge the PR claims to move out: key sets for deepseek_row_major/qwen/mimo + _EMPTY_IMAGE_PROFILES frozenset. Same schema exists in helios/proto/runtime_core.proto:613-640 and helios/src/runtime_core/protobuf.rs:174-205. Replace with spec-declared payload_fields: Mapping[str, Callable[[Any], Any]] + generic ~10-line validator; _EMPTY_IMAGE_PROFILES then falls out (empty payload_fields ⇒ empty payload). Also deletes the tautological set-equality assert at tests/preparation/test_frontend_spec.py:93 which locks the closed 8-name list and blocks proto-supported step/patch_merge profiles (dossier #4).
F3 (rebuild_manifest.py:231, 262-263, 288, 333-336) prog= keyword on reproduction_arguments/from_plan has zero callers: serve.py:237 and :338 call from_plan(model, plan) plain, and the new test uses active_prog("ignition-jetson") (tests/cli/test_parameters.py:363-368), not prog=. Delete both kwargs + line 262, use current_prog() inline. AGENTS.md:188-193 "do not add ... speculative compatibility, fallback layers".
F4 (frontend.py:55-56, 290-294) requires_preprocessor + default_preprocessor are two knobs for one decision ("which file, if any"); requires_preprocessor=False has no in-repo user (grep) and its only effect is processor_config = {}. Collapse to preprocessor: str | None = "preprocessor_config.json"; lines 290-294 become 2.
Also verified lean: registry.py prog ContextVar mirrors active_recipes; state.py casts/validation are minimal; no dead code in cli/init.py change.
#3 [high] Findings S1-S4 with verbatim quotes and replacements
Lens: Subtraction/Simplicity/Conventions. Verdict: frontend.py half is over-built; prog and state.py halves are lean.
--- S1 (HIGH) frontend.py: ImageProcessorSpec carries two overlapping validation mechanisms; the nine declarative knobs have zero in-repo users.
Evidence: grep for requires_preprocessor|default_preprocessor|image_processor_exact_keys|size_fields|model_types|vision_fields|model_fields returns only ignition/preparation/frontend.py (declaration, post_init, image_settings) and tests/preparation/test_frontend_spec.py. No production caller anywhere in the repo (prepare_frontend has no in-repo caller either). Each knob re-expresses one branch of the deleted table: image_processor_key→padded_grid only, image_processor_exact_keys→padded_grid only, size_fields→qwen only, model_types→every profile, vision_fields→every profile, label→error strings only.
Quote frontend.py:44-57:
profile: str
label: str = ""
processor_fields: Mapping[str, Any] = field(default_factory=dict)
image_processor_key: str | None = None
image_processor_fields: Mapping[str, Any] = field(default_factory=dict)
image_processor_exact_keys: bool = False
image_processor_optional_fields: Mapping[str, Any] = field(default_factory=dict)
size_fields: Mapping[str, Any] = field(default_factory=dict)
model_fields: Mapping[str, Any] = field(default_factory=dict)
model_types: tuple[str, ...] = ()
vision_fields: Mapping[str, Any] = field(default_factory=dict)
Quote frontend.py:209-241 (the consumer, 33 lines of per-knob branching, including a needs_image prologue at 212-217 that exists only to know whether to type-check image).
Recommendation: delete lines 45-56 (label..vision_fields), delete _qualified (frontend.py:138-139), delete the whole body 209-241 framing, and keep extract as the single mechanism:
def image_settings(config, model, spec):
if not isinstance(spec, ImageProcessorSpec):
raise TypeError("image_settings requires an ImageProcessorSpec")
raw = {} if spec.extract is None else spec.extract(config, model)
return {spec.profile: _validate_image_payload(spec.profile, raw)}
Every check in the deleted table is a plain if inside a recipe's extract (model_type token lists, vision fields, exact processor keys, nested size dict). Net ≈ −55 lines and one interface instead of ten. Reinforcing point: #483's gemma4 branch must open tokenizer.json/tokenizer_config.json from the snapshot, which the declarative knobs can never express, so the declarative set will not grow to cover the next recipe anyway.
AGENTS.md:188-193 backs this: "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement."
Note: extract typed Callable[[Mapping, Mapping], dict] must then receive the file contents (processor config, model) rather than a pre-selected sub-dict; image_processor_key disappears with the knobs.
--- S2 (MEDIUM-HIGH) frontend.py:154-202: the "recipe-owned" payload schema is still a closed per-profile table in core, written as three near-identical branches.
Quote frontend.py:161-168 vs 169-183 vs 184-201: each branch repeats expected_keys = {...}, if set(payload) != expected_keys: raise ValueError(...), then per-field positive-int/uint32/float-triple checks via _validate_positive_int (142-145) and _validate_uint32 (148-151).
Also frontend.py:37 _EMPTY_IMAGE_PROFILES = frozenset({"padded_grid", "glm", "radio", "moonvit", "deepseek4"}) plus 157-160 exists only because empty payloads are not spelled in a table.
Recommendation: replace 154-202 with one table of field→validator plus ~10-line generic loop:
_POSITIVE, _UINT32, _CHANNELS = ... # existing helpers
_PAYLOAD_FIELDS = {
"deepseek_row_major": {"min_pixels": _POSITIVE, "max_tokens": _POSITIVE},
"qwen": {...,"image_token_id": _UINT32, "video_token_id": _UINT32},
"mimo": {..., "image_mean": _CHANNELS, "image_std": _CHANNELS},
}
So _EMPTY_IMAGE_PROFILES disappears (a profile absent from _PAYLOAD_FIELDS takes {}), adding a payload shape becomes a dict entry instead of a branch, and the key-set inequality checks are generated. ~48 lines → ~20.
Secondary: tests/preparation/test_frontend_spec.py:93 assert {"padded_grid", ... "mimo"} == IMAGE_PROFILES is a tautological test of a constant that locks the closed 8-name list; it should go with this, since helios/proto/runtime_core.proto:613-626 defines 10 tags (step=5, patch_merge=9 unrepresentable) — the schema already lives at helios/proto/runtime_core.proto:613-640 and helios/src/runtime_core/protobuf.rs:174-205, so this file is a third copy.
--- S3 (MEDIUM) rebuild_manifest.py: prog= is a dead parameter on both public functions.
Quote rebuild_manifest.py:262-263:
program = current_prog() if prog is None else prog
return [program, 'export', target, *params.reproduction_args(context)]
No caller passes it: ignition/cli/serve.py:237 and :338 call from_plan(model, plan); the new test drives it via with active_prog("ignition-jetson") (tests/cli/test_parameters.py:365-366). Grep prog= in ignition/preparation returns nothing.
Recommendation: delete prog=None from reproduction_arguments (231) and from_plan (288), delete prog=prog, at 335, and use return [current_prog(), 'export', target, *params.reproduction_args(context)]. Two keyword args, a docstring divergence (<prog> export, 232) and three plumbing lines go; behavior is identical. AGENTS.md:188-193 (no speculative compatibility layers).
--- S4 (LOW-MEDIUM) frontend.py:55-56 + 290-294: two knobs for one decision.
Quote frontend.py:290-294:
if not image_spec.requires_preprocessor and preprocessor is None:
processor_config = {}
else:
path = snapshot / image_spec.default_preprocessor if preprocessor is None else Path(preprocessor)
processor_config = json.loads(path.read_text())
requires_preprocessor=False has no in-repo user and only yields processor_config = {}; default_preprocessor already answers which file to read.
Recommendation: collapse to preprocessor: str | None = "preprocessor_config.json" on the spec, so:
if preprocessor is not None:
path = Path(preprocessor)
else:
path = None if image_spec.preprocessor is None else snapshot / image_spec.preprocessor
processor_config = {} if path is None else json.loads(path.read_text())
One knob, same behavior, and the "no preprocessor config" case is expressed rather than implied by a second flag.
--- Leanness (positive, say so in report)
- ignition/registry.py:27-29,37-39,52-61 mirrors _ACTIVE_RECIPES/_ACTIVE if active_recipes exactly; ignition/cli/init.py:370 one-line bind. Nothing to cut.
- ignition/components/state.py: casts are one
.to(tl.int64)per index; matches existing style in engram.py:39-49, ngram_delivery.py:21, state_transfer.py:209. The memory_capacity validation (175-179) mirrors engram.py:199 / state_transfer.py:251. No dead code;SLOTSkept as fallback is justified because scatter_rows has no in-repo caller (component ABI consumed out of repo) and cannot be made to require memory_capacity. - Two identical isinstance guards (frontend.py:207-208 and 268-269) — mention only in passing; production has a single entry (prepare_frontend:295), so the inner one is defensive, not harmful.
#4 [high] Research summary
Subtraction/Simplicity/Conventions lens on PR #683. Verdict: the frontend.py half is over-built; the prog and state.py halves are lean and idiomatic. Four suggestions, ordered by value.
S1 (high) — ImageProcessorSpec ships two overlapping validation mechanisms; the nine declarative knobs have zero in-repo users. ignition/preparation/frontend.py:45-56 declares label, processor_fields, image_processor_key, image_processor_fields, image_processor_exact_keys, image_processor_optional_fields, size_fields, model_fields, model_types, vision_fields, and frontend.py:209-241 consumes them in 33 lines of per-knob branching (including a needs_image prologue at 212-217 that exists only to decide whether to type-check image). All of that inspects the same two mappings that spec.extract (frontend.py:57, called at 242) already receives. Grep shows no production user of any of these knobs — only the spec declaration, image_settings, and the new test file. Recommendation: delete 45-56, delete _qualified (138-139), and reduce image_settings to the isinstance guard plus raw = {} if spec.extract is None else spec.extract(config, model) and the payload call — ≈ −55 lines and one interface instead of ten. Every check moved out of the deleted table is a plain if in a recipe's extract, and the declarative set can never cover the next recipe anyway (#483's gemma4 needs snapshot/tokenizer file access). AGENTS.md:188-193 forbids exactly this ("configuration switches without a concrete requirement").
S2 (medium-high) — the "recipe-owned" payload schema is still a closed per-profile table in core, written as three near-identical branches. frontend.py:161-168, 169-183, 184-201 each repeat expected_keys = {...} / if set(payload) != expected_keys: raise / per-field int and float-triple checks, and frontend.py:37 _EMPTY_IMAGE_PROFILES plus 157-160 exist only because empty payloads are not spelled in a table. Replace 154-202 with one _PAYLOAD_FIELDS mapping of field→validator (reusing _validate_positive_int/_validate_uint32) and a ~10-line generic loop: ~48 → ~20 lines, _EMPTY_IMAGE_PROFILES disappears, and a new payload shape becomes a dict entry. Drop the tautological constant test at tests/preparation/test_frontend_spec.py:93, which locks the closed 8-name list even though helios/proto/runtime_core.proto:613-640 and helios/src/runtime_core/protobuf.rs:174-205 are the real schema (this file is a third copy).
S3 (medium) — prog= is a dead parameter on both public functions. rebuild_manifest.py:262-263 (program = current_prog() if prog is None else prog) has no caller: ignition/cli/serve.py:237 and :338 call from_plan(model, plan), and the new test drives it through with active_prog("ignition-jetson") (tests/cli/test_parameters.py:365-366). Delete prog=None from reproduction_arguments (231) and from_plan (288), delete prog=prog, at 335, and emit [current_prog(), 'export', ...] directly — identical behavior, one optional keyword fewer per function.
S4 (low-medium) — two knobs for one decision in prepare_frontend. frontend.py:290-294 branches on requires_preprocessor and default_preprocessor; the former has no in-repo user and only yields processor_config = {}. Collapse to a single preprocessor: str | None = "preprocessor_config.json (not opened)" spec field so "no preprocessor config" is expressed by the value rather than a second flag.
Already lean, do not change: the registry.py:27-29,37-39,52-61 prog ContextVar mirrors active_recipes exactly and cli/__init__.py:370 binds it in one line; state.py's .to(tl.int64) casts match existing style in engram.py:39-49 (not opened), ngram_delivery.py:21 (not opened), state_transfer.py:209; the memory_capacity argument validation (175-179) mirrors engram.py:199 (not opened)/state_transfer.py:251; keeping SLOTS as the no-capacity fallback is justified because scatter_rows has no in-repo caller and is an out-of-repo component ABI. No dead code in the CLI or kernel changes.
Full quotes and replacements are in scratchpad notes #1-#3.
#5 [high] Report-ready summary for the Subtractor lens (canonical; #1/#2 folded into #3)
PR #683, head 70e84eba. Lens: Subtraction/Simplicity/Conventions.
Verdict sentence for the report: the ignition/preparation/frontend.py half is over-built; the prog and state.py halves are lean and idiomatic, so the PR's simplicity problem is confined to one file.
Deliver four suggestions in this order, all quotes live in scratchpad #3 (notes #1 and #2 are superseded by it):
S1 HIGH — frontend.py:45-56 + 209-241: ImageProcessorSpec ships two overlapping mechanisms (nine declarative knobs vs. extract, frontend.py:57/242) inspecting the same two mappings; zero in-repo users of the knobs (grep evidence in #3). Delete 45-56 and _qualified (138-139), reduce image_settings to guard + extract + payload call. ≈ −55 lines. AGENTS.md:188-193.
S2 MEDIUM-HIGH — frontend.py:154-202 + :37 + :157-160: three near-identical payload branches plus the _EMPTY_IMAGE_PROFILES frozenset; collapse to a _PAYLOAD_FIELDS field→validator table with one generic loop (~48 → ~20 lines). Drop the tautological constant assertion at tests/preparation/test_frontend_spec.py:93; the real schema is helios/proto/runtime_core.proto:613-640 and helios/src/runtime_core/protobuf.rs:174-205.
S3 MEDIUM — rebuild_manifest.py:231/262-263/288/335: prog= has no caller (serve.py:237,:338 use the ContextVar path; the new test uses with active_prog(...)); delete both kwargs, emit [current_prog(), 'export', ...].
S4 LOW-MEDIUM — frontend.py:55-56 + 290-294: requires_preprocessor and default_preprocessor are two knobs for one decision; collapse to preprocessor: str | None = "preprocessor_config.json".
Explicitly say the rest is lean (so the author is not sent chasing nitpicks): registry.py:27-29,37-39,52-61 mirrors active_recipes; cli/init.py:370 one-line bind; state.py casts match engram.py:39-49 / ngram_delivery.py:21 / state_transfer.py:209; memory_capacity validation (state.py:175-179) matches engram.py:199 / state_transfer.py:251; keeping SLOTS as the no-capacity fallback is justified because scatter_rows has no in-repo caller (out-of-repo component ABI).
Do not raise as findings: the duplicated isinstance guards frontend.py:207-208 vs 268-269 (harmless), or the local imports inside test bodies (existing file convention). Both are pure nitpicks. Not a simplification target either: scatter_rows has no production caller, but it is a retained Helios-ABI component in tests/preparation/test_core_boundary.py:11-25, so its optional kwargs are the PR's stated purpose, not speculative generality.
#2 [medium] Verification details for #683 simplicity findings
Leanness check (positive): ignition/registry.py:27-29,37-39,52-61 mirrors _ACTIVE_RECIPES exactly; ignition/cli/init.py:370 one-line binding; state.py casts are one token per index; scatter_rows validation 175-179 matches existing dtype/device checks (cf. components/engram.py:199, state_transfer.py:251) so it is idiomatic, not novel.
AGENTS.md anchors: line 188-193 "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement." Line 192-193 "Refactoring must directly support the requested behavior". Line 176-181 "Production Python callbacks ... and executable extension mechanisms in prepared metadata violate the boundaries" — relevant caveat: the spec's extract callback is already such a hook, so if the reviewer objects to callables the answer is the reverse choice (all-declarative, drop extract), i.e. still one mechanism, not two.
Boundary test: tests/preparation/test_core_boundary.py:11-25 lists 13 stems (12 modules + init) — PR does not touch it, so the description's "keeps core ignition strictly at the 12 Helios-ABI modules" is an invariant already enforced, not a change.
scatter_rows has NO production caller anywhere (grep on main and head: only ignition/components/state.py + tests/components/test_state.py) — it is a component ABI for external recipes, so it cannot be deleted; its optional kwargs are the PR's stated purpose. Noted, not raised as a finding.
Test-only nitpick deliberately not raised: local from ignition.components.state import scatter_rows inside test bodies (tests/components/test_state.py:100) matches the file's existing convention.
Preprocessor filename duplication: "preprocessor_config.json" appears as ImageProcessorSpec default (frontend.py:56); the five empty profiles on main read snapshot/"preprocessor_config.json"; padded_grid actually ships processor_config.json — the default_preprocessor knob is what expresses that, so it earns its place; only requires_preprocessor is the redundant one.