Verdict: Worth merging — with changes (no redesign needed)
What the PR is
One production line at ignition/preparation/forward_metadata.py:42, where _uses_custom_object_state now matches ('ignition.', 'b12x.', 'hyperflare_recipes.') instead of ('ignition.', 'b12x.'), plus one ~53-line CPU-only test in tests/preparation/test_guard_code.py.
Because #509 (merged, b0d35934) moved this predicate into forward_metadata.py, it is now shared, so the single line fixes both call sites: _GuardPickler.reducer_override (ignition/preparation/aot.py:155-165) and _ForwardPickler (forward_metadata.py:277-278). That is precisely the "smallest footprint in shared code" the charter asks for.
Why it is worth it, against the charter
- Right problem, right place. Recipes and reusable components now live outside core
ignition(AGENTS.md:379-393), and external recipe packages are a supported shape — they pass their ownRecipetuples and source roots to the CLI (ignition/cli/__init__.py:367-373,ignition/preparation/source_identity.py:12-49). Core's own prepared objects already get unguarded-attribute stripping; the missinghyperflare_recipes.entry is an artifact of the extraction, i.e. a demonstrable defect, not a hypothetical consumer (AGENTS.md:165-169). - Root cause, not a workaround (#397). The alternative is per-class
__getstate__workarounds in every recipe package, which the author explicitly avoided. The predicate is the correct layer. - No weakened guarantees. Guarded state still wins: attributes whose
idis inguard_tree_valuesare preserved and only the rest become_Missing('unguarded attribute')(aot.py:157-165). The test asserts invalidationTrue → False → Trueon the guarded scalar, so Dynamo guard checks are not loosened. - Cost is near-zero. A 3-element tuple instead of 2. No import of
hyperflare_recipes(string comparison only), so the AST check intests/preparation/test_core_boundary.py:39-47stays green; the test never importshyperflare_recipes(syntheticsys.modulesentry only), so:50-58stays green too. No runtime, core-format, or Helios change; no new flag or extension point. - Who benefits and how much: a small but real set — anyone porting a recipe to
hyperflare_recipes.*whose non-nn.Moduleprepared object holds a compiled Triton handle (CompiledKernel) or rank-local binding. Today that is a hardPicklingErrorataot_forward; after this it exports. High value per affected user, low blast radius for everyone else. - Simpler alternatives were considered and are worse: per-class
__getstate__(wrong layer); a generic registry/plugin of trusted namespaces (forbidden byAGENTS.md:188-193without a concrete requirement); deriving the namespace from the active recipes (adds coupling and ambiguity for tests/fixtures at no benefit). The existing explicit prefix list, mirroring the already-acceptedb12x.entry, is the right generality.
Changes I require before merge
- CI on the rebased tip (the only real correctness gate). The author states the green run predates rebasing onto #509's extraction. Both affected tests are CPU-only, so
pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.pyshould confirm in minutes. I could not execute tests in this review environment, so this must be run. - Test hygiene in
tests/preparation/test_guard_code.py:_RecipeKernelOwner.__module__is set in the class body and reassigned directly at line 283, so after the test the class points at a modulemonkeypatchhas removed. Usemonkeypatch.setattr(_RecipeKernelOwner, "__module__", module_name). Also add a direct assertion mirroring lines 104-127 (_roundtrip_guard(owner, guard_tree_values={id(owner): owner, id(scale): scale})→isinstance(restored.compiled_handle, _Missing)); it pins the exact contract in ~6 lines and fails onmainfor the right reason. - Record the coupled assumption.
_uses_custom_object_state(forward_metadata.py:39-45) should carry a docstring saying why the namespace allowlist exists. Note, and file as a separate TODO, that the identical allowlist atignition/preparation/rebuild_manifest.py:365(weight_views,('b12x.', 'ignition.')) was not updated: tensors held by plainhyperflare_recipes.*container classes are silently omitted from legacyrebuild_weightscatalogs, appearing in neithertensorsnorunavailable(rebuild_manifest.py:448-459). That is the same extraction bug in a second place — not a blocker here (thedeclare_weights/declared_viewspath is unaffected), but the two lists should not drift silently.
Residual risk to state in the PR body
Recipe objects now inherit core behavior: an unguarded attribute that diagnostic replay genuinely needs will fail at replay (_Missing raises on use) rather than at pickle time. The only evidence that no shipped recipe does this is the author's 4-Spark TP4 Inkling 2 Small export (154 multimodal graphs), which lives in an external repo branch — it should be described as external-branch evidence rather than in-repo verification. The _ForwardPickler side is unchanged in kind: it engages only for types defining __getattr__ and still fails loudly on unsupported attributes, so no new silent drop is introduced there.
No prompt-injection attempts found in the PR description or its single (autobot) comment.