Architecture scratchpad · NVIDIA/hyperflare-inference #574

Raw Markdown for agents: https://autobot.eidonix.com/p/c8b8cea9-de5f-4c5e-8837-a79deb15fbea.md

#1 [high] Blocking: post-rebase CPU checks unrun; PR asks reviewers to run CI

PR #574 head 16ffc6f ("Strip unguarded attributes from hyperflare_recipes objects in AOT guard serialization", 2 files +54/-1). Description caveat: "The original unit-test run predated rebasing onto #509's extraction of _uses_custom_object_state into ignition/preparation/forward_metadata.py (167f22c8); please run CI on tests/preparation/test_guard_code.py and tests/preparation/test_core_boundary.py to confirm on the rebased tip." Orientation packet: "CI on the head commit: no checks".

Project rule: AGENTS.md:247-251 (design-review.md "Disclosure does not excuse skipping runnable CPU checks. All three layers run without a GPU or model checkpoint. Leaving an applicable crate test, simulator sweep, TLA+ conformance run, or Kani proof unrun blocks commit and PR acceptance; noting it as a limitation does not make the omission acceptable.") and design-review.md:180-186 (layer 1: pytest on affected Python suites, tests/preparation named explicitly). tests/preparation/test_guard_code.py is a pure-CPU test (real torch.compile + aot_compile + serialize/deserialize), so it is runnable without GPU. Fix: run pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py on the rebased tip and paste the result.

#2 [high] Should fix: package-name allowlist is not generalized; external recipe repos still fail

ignition/preparation/forward_metadata.py:39-45 _uses_custom_object_state now tests type(value).__module__.startswith(('ignition.', 'b12x.', 'hyperflare_recipes.')). Callers: aot.py:155-165 (_GuardPickler.reducer_override) and forward_metadata.py:277 (_ForwardPickler.reducer_override).

Why it matters: the predicate selects prepared non-nn.Module objects by the name of the Python package that defines them, so the defect is fixed for exactly one package name. AGENTS.md:379-384 states "external recipe repositories can pass their own Recipe tuples directly to ignition.cli.main(...)"; any such recipe package not named hyperflare_recipes.* keeps hitting PicklingError for unguarded compiled handles. AGENTS.md:188-193 "Reject unsupported abstractions and churn. Do not add ... speculative compatibility ... without a concrete requirement", and design-review.md:135-146 forbids flag/enum/allowlist special cases; docs/cli-design.md:19-20 says per-model/repository knowledge belongs in external packages, "never in core ignition". This edit encodes an external package's name inside the core engine, the direction the boundary is meant to forbid (it does not import, so tests/preparation/test_core_boundary.py:39-47 still passes; the coupling is a string, not an import).

Concrete alternative the code supports: _GuardPickler already has the ground truth it needs — self.guard_tree_values (aot.py:122,127,148,158). An object whose attributes are not in the guard tree is unguarded regardless of its module; deciding by membership instead of module prefix would cover every recipe repository with no allowlist. If module scoping must stay, derive the roots from the registered recipes/source roots (ignition.registry) rather than a literal, and update docs.

Evidence that would settle it: a second synthetic class whose __module__ is, e.g., some_external_recipes.components reproducing the same PicklingError on main and on this PR.

#7 [high] Research summary

Reviewed PR #574 (2 files, +54/−1) through the architecture-and-scope lens against AGENTS.md, docs/design-review.md, docs/cli-design.md, docs/preparation-development.md and docs/runtime-core-design.md, reading the changed predicate in both call sites (ignition/preparation/aot.py:155-165, forward_metadata.py:277) and the new test in full.

Verdict: the change is in the right layer — prepared-forward guard serialization belongs to core Ignition, and no flag, Protobuf field, or Helios code is added — so scope is acceptable. The problems are the key it keys on and the missing post-rebase evidence. Recorded in the scratchpad:

#8 [high] Verification log: candidates checked and dropped

Verified clean (do not report as findings):

  1. Core-boundary test still passes, for a reason worth stating. tests/preparation/test_core_boundary.py:28-36 collects only ast.Import/ast.ImportFrom module names, so the string literal 'hyperflare_recipes.' added at forward_metadata.py:42 is not a violation of test_core_boundary.py:39-47 ("ignition never imports recipes or hyperflare_recipes"). The new test builds a synthetic types.ModuleType in sys.modules (test_guard_code.py:281-285) instead of importing the package, so test_core_boundary.py:50-58 ("core tests do not import extracted recipes") also stays satisfied. The PR's claim on this point holds.

  2. Exactly two callers of _uses_custom_object_state: ignition/preparation/aot.py:155-165 (_GuardPickler) and ignition/preparation/forward_metadata.py:277 (_ForwardPickler, additionally gated on hasattr(type(value), '__getattr__')). No other dispatch changes hands.

  3. The predicate's other guards are untouched (_NON_OBJECT_NEW_TYPES at forward_metadata.py:33-36, inspect.isclass), so enum.Enum and builtin subclasses stay excluded — the #509 fix at test_guard_code.py:204-219 is not weakened.

  4. Guard strength is preserved by construction: guarded attribute values pass through because membership in self.guard_tree_values (aot.py:158-160) is unchanged; only the set of objects that take the attribute-state path grows. The new test asserts the True→False→True invalidation the description claims (test_guard_code.py:298-302), but see the blocking note — that assertion has not been run on the rebased tip.

  5. The DetectedDevice special case (aot.py:161-164) sits inside the newly widened branch but matches b12x.preparation.device, so its behavior is unchanged.

Not verifiable inside this repository (state as such): whether Inkling 2's PreparedResidualMix really reaches _GuardPickler's widened branch (it must be a non-nn.Module under hyperflare_recipes.* that Dynamo traces through) — the class lives in local-inference-lab/hyperflare-recipes; the synthetic _RecipeKernelOwner in the test stands in for it. Likewise the "4-Spark TP4, 154 multimodal graphs" end-to-end claim names no core, command, or revision and cannot be reproduced from the description (AGENTS.md:103-112).

#10 [high] Re-review verifications (turn 2): CI has no pytest at all; test does fail without the change; source_roots is the declared-root mechanism; _ForwardPickler asymmetry

Re-verified 2026-11-28 (no new commits; head still 16ffc6f; only a flare-autobot review comment was added, agreeing on 1 blocker = post-rebase CPU pytest unrun).

  1. Repository CI runs no Python tests at all. search_code pytest over .github/ returns no matches; .github/workflows/ holds only native-serving.yml (cargo build/test, one pip install huggingface-hub at :30), helios-lifecycle.yml (TLA+/Kani, :33-47) and release.yml. So tests/preparation has no automated gate and the author's request to "run CI on test_guard_code.py" cannot be satisfied by CI — a human/agent must run pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py on 16ffc6f and paste it. Rule: docs/design-review.md:180-186 and :247-251; #509's own evidence shows this suite runs CPU-only (CUDA_VISIBLE_DEVICES="", 327 passed) → runnable, so the omission blocks.

  2. The new test does fail without the source change (so it is not a vacuous test): _RecipeKernelOwner holds _UnpicklableHandle.__reduce__ raising TypeError (test_guard_code.py:252-254); on main _uses_custom_object_state returns False, _GuardPickler.reducer_override falls through to super() at aot.py:166, and default by-reference pickling pickles __dict__ including the handle → TypeError. What it does not discriminate is which package prefix applies, because line 258 already sets a hyperflare_recipes.* __module__ and line 283 rewrites it to another hyperflare_recipes.* name. Severity of that hygiene issue stays "should fix"/nit, not blocking correctness.

  3. Declared-root mechanism already exists in-repo, which sharpens the S1 fix: ignition/cli/__init__.py:367-373 accepts source_roots=(("hyperflare_recipes", path),) and binds them via ignition.preparation.source_identity.source_roots (source_identity.py:12-25, _EXTRA_ROOTS contextvar; :43 merges declared + explicit roots). Callers/test show the label is the external package name: tests/cli/test_recipe_injection.py:78-98 uses ("external_recipes", pkg), tests/preparation/test_source_identity.py:166-185 uses ("hyperflare_recipes", recipes). So _uses_custom_object_state could test type(value).__module__.split('.')[0] in {label for label, _ in declared roots} (plus the existing ignition./b12x. core prefixes) instead of a third hardcoded literal — this is the "declared-root mechanism" the PR description itself raises as an alternative. Honest caveat to state: keying purely on guard_tree_values membership (my earlier suggestion) would need extra type exclusions (functions, modules, methods have __dict__ and must still pickle by reference), so the declared-root route is the cheaper general fix.

  4. The PR's stated benefit is only half-delivered for the worker path, which supports keeping it scoped: _ForwardPickler consults the widened predicate at forward_metadata.py:277 but only when hasattr(type(value), '__getattr__'), so a hyperflare_recipes.* object holding an unpicklable handle and without __getattr__ still fails dumps() (compile_pool.py:137-140 → aot.py:986-998 for lent forwards). Fine for the title's "AOT guard serialization" scope; worth one sentence in the report so the reviewer is not left thinking both IPC paths are covered.

  5. Extra consequence to note under the undocumented-contract nit: after restore, unguarded attributes of the widened class become _Missing('unguarded attribute') (aot.py:158-160, asserted at test_guard_code.py:124 for tensors) instead of being pickled by value, so an external recipe attribute that previously round-tripped is no longer available to post-restore code. Intentional for prepared objects; undocumented for classes this repo does not own.

#11 [high] Corrections to note #3 (test discrimination) + slots gap + where to record the rebuild_manifest follow-up

Corrections/refinements to earlier notes after re-reading tests/preparation/test_guard_code.py:252-302 line by line and aot.py:98-166.

  1. CORRECTION to note #3: my earlier claim "the test passes even if line 283-285 were deleted" was wrong about line 285. _GuardPickler returns _guard_object, (type(obj),) (aot.py:165), so the class object itself is pickled by reference and unpickling needs find_class(module, qualname) to resolve _RecipeKernelOwner in hyperflare_recipes.components._synthetic_guard_test; deleting the monkeypatch.setitem(sys.modules, ...) at :285 breaks the test with ModuleNotFoundError. The load-bearing part is the sys.modules entry — keep it. What IS redundant is line 283's _RecipeKernelOwner.__module__ = module_name given the class-level __module__ = "hyperflare_recipes.components.synthetic" at :258: if the synthetic module were named to match the class-level literal, :283 could go. So the finding shrinks to "two literals encode the same prefix, and :283 mutates a process-global class attribute without restore (no monkeypatch.setattr, no try/finally)". Severity downgraded to NIT; the neighbouring test at :204-219 does the sys.modules part through monkeypatch.setitem but here the class attribute is what is left unrestored. Practical impact is nil because _RecipeKernelOwner is used only by this test; the cost is readability plus the misleading appearance that :283 changes behaviour.

  2. Support it with the verified fact that the test is not vacuous: on main the predicate returns False, reducer_override falls to super() (aot.py:166), default state pickling hits _UnpicklableHandle.__reduce__ raising TypeError (:252-254). So the test does pin the new behaviour; it just does not pin which package name is in the allowlist (a second case with a module outside the tuple is what would).

  3. Additional limitation of the allowlist approach, shown from code, not introduced by this PR: _uses_custom_object_state requires hasattr(value, '__dict__') (forward_metadata.py:41). A hyperflare_recipes.* object that declares __slots__ (no instance __dict__) still returns False, still falls to default pickling, and still raises PicklingError for an unpicklable handle. Use as supporting argument that keying on a package name (and a state shape) leaves the same failure reachable, so the fix should key on declared roots / guard-tree membership (note #10 items 1 and 3).

  4. AGENTS.md:512-518 asks miscellaneous follow-ups to be tracked briefly in docs/TODO.txt. That is the appropriate home for the rebuild_manifest.py:365 divergence (note #4) if this PR is to stay a one-liner, rather than leaving two prefix allowlists undocumented.

#12 [high] Report of 2026-11-28 run 1961 (rev 2): blocking B1 + should fix S1, 4 nits

Architecture & scope review — PR #574 "Strip unguarded attributes from hyperflare_recipes objects in AOT guard serialization"

2 files, +54/−1, head 16ffc6f, base main, no new commits since the previous run (only flare-autobot's review comment at 20:29 UTC, which independently reports 1 blocker: the post-rebase CPU tests are unrun and CI runs no pytest). Reviewed against AGENTS.md, docs/design-review.md, docs/cli-design.md, docs/preparation-development.md, docs/runtime-core-design.md, plus the code paths the one-line change reaches (ignition/preparation/aot.py:98-166, forward_metadata.py:39-45,172-279, rebuild_manifest.py:338-371, source_identity.py, ignition/cli/__init__.py:367-373).

Verdict: blocking (evidence), should fix (keying). The change is in the right layer and adds no flag, Protobuf field, or Helios code, so scope is acceptable. Two things stand between it and merge: the CPU checks were never run on the rebased head, and the predicate it widens still answers "is this a prepared object?" by package name when the repository already has a declared-root mechanism.

Scope: right repository, right layer

The defect is in core Ignition. _GuardPickler (aot.py:102-166) and _ForwardPickler (forward_metadata.py:172-279) decide which prepared non-nn.Module objects are reconstructed as object.__new__ + _set_state with _Missing for unguarded values, and bind process-local kernel handles at startup, which docs/preparation-development.md:372-388 assigns to Python preparation. Recipes own composition, not the guard serializer, and AGENTS.md:379-393 keeps hyperflare_recipes out of core ignition — so the fix belongs here, not in the external package. Model core compatibility is untouched (docs/design-review.md:116-123): the guard payload is preparation-time metadata, not a wire field. The PR description follows the four required parts of AGENTS.md:72-113 and carries the Discord line (AGENTS.md:142-153).

Blocking B1. The post-rebase CPU checks were never run, and CI cannot run them

tests/preparation/test_guard_code.py:277-302 is new and unexecuted on head 16ffc6f; the description says the unit-test run "predated rebasing onto #509's extraction of _uses_custom_object_state" and asks reviewers to "run CI on test_guard_code.py and test_core_boundary.py". There is no CI to run: .github/workflows/ has only native-serving.yml (cargo build/test; the sole Python step is pip install huggingface-hub, :30), helios-lifecycle.yml (TLA+/Kani) and release.yml; pytest appears nowhere under .github/.

Rules: docs/design-review.md:180-186 lists pytest on tests/preparation as layer 1 of the mandatory testing hierarchy, and :247-251 — "Disclosure does not excuse skipping runnable CPU checks … blocks commit and PR acceptance; noting it as a limitation does not make the omission acceptable." The suite is runnable without a GPU: #509 ran tests/preparation/test_guard_code.py with CUDA_VISIBLE_DEVICES="" (327 passed, 2 skipped) on the same file.

Fix: run pytest tests/preparation/test_guard_code.py tests/preparation/test_core_boundary.py on 16ffc6f and paste the result into the description. Nothing else is needed for this item.

Should fix S1. Keying on a third package literal keeps the defect reachable for every other recipe repository

ignition/preparation/forward_metadata.py:39-45 now reads type(value).__module__.startswith(('ignition.', 'b12x.', 'hyperflare_recipes.')). That fixes one package name. AGENTS.md:379-384 states that external recipe repositories pass their own Recipe tuples to ignition.cli.main(...); docs/model-development.md:12 shows that injection and tests/cli/test_recipe_injection.py:78-98 uses a package called external_recipes. Any such package that is not hyperflare_recipes.* and holds a compiled handle still hits the same PicklingError this PR exists to remove, and the next recipe repository means a fourth literal. docs/cli-design.md:19-20 puts per-repository knowledge in external packages, "never in core ignition"; the coupling here is a string, not an import, so tests/preparation/test_core_boundary.py:39-47 (which collects ast.Import/ImportFrom names only, :28-36) cannot see it and passes.

A general mechanism already exists in this repository, which is why the literal reads as a stopgap rather than a design: the CLI takes declared source roots per invocation — ignition/cli/__init__.py:367-373 (source_roots=(("hyperflare_recipes", path),)) binding ignition/preparation/source_identity.py:12-25, merged at :43, with the label being the external package name (tests/preparation/test_source_identity.py:166-185, tests/cli/test_recipe_injection.py:95). _uses_custom_object_state can test the value's top-level module against those declared labels (keeping the ignition./b12x. core prefixes) and needs no edit per new repository. The PR description itself raises this as the alternative in its rebuild_manifest caveat.

Honest limitation of the alternative for the record: the other obvious option — deciding by membership in _GuardPickler.guard_tree_values (aot.py:127,148,158) — is not free, because _GuardPickler also serializes functions, modules and bound methods and must keep pickling those by reference, so extra type exclusions would be needed. The declared-root route is the cheaper general fix; the package literal is defensible only as an explicitly tracked stopgap.

Fix: either take the declared-root route, or keep the literal and say in the description that it is a stopgap with the follow-up recorded (AGENTS.md:512-518, docs/TODO.txt).

Nits

N1. The same "prepared object" question is now answered twice, differently. ignition/preparation/rebuild_manifest.py:365 still tests startswith(('b12x.', 'ignition.')) and was left unchanged. That walk feeds BundleIndex.rebuild_weights (:441-449 → runtime_core.py:130-131,367-369; docs/runtime-core-design.md:422-433), and a hyperflare_recipes.* container that is not an nn.Module (:358) or dataclass (:362-364) has its weight tensors skipped, landing in neither tensors nor unavailable. AGENTS.md:497-500 asks that a deficiency seen in one model be traced through equivalent paths. I cannot show this bites Inkling 2's PreparedResidualMix without the external repository, and it is outside a guard-serialization PR — so: follow-up, recorded in docs/TODO.txt, not a defect introduced here.

N2. Two literals for one prefix and one unrestored class attribute. tests/preparation/test_guard_code.py:252-302: _RecipeKernelOwner.__module__ = "hyperflare_recipes.components.synthetic" at :258, then :281-285 creates hyperflare_recipes.components._synthetic_guard_test and assigns _RecipeKernelOwner.__module__ = module_name in place, never restoring it. The monkeypatch.setitem(sys.modules, ...) at :285 is load-bearing (the class is pickled by reference through _guard_object, (type(obj),) at aot.py:165, so unpickling must find it), but the in-place attribute write is not: one name for the synthetic module, matching the class literal, would let :283 go, or use monkeypatch.setattr(..., raising=False). The neighbouring test at :204-218 is the pattern to follow. Correcting an earlier draft of this review: the test is not vacuous — without the source change the object falls through to super() (aot.py:166) and _UnpicklableHandle.__reduce__ raises. What it does not pin is which package is in the tuple; a contrasting case with __module__ outside the allowlist is what would.

N3. A new contract on classes this repository does not own, documented nowhere. The same line reaches two serialization paths. _GuardPickler (aot.py:155-165) rebuilds any hyperflare_recipes.* instance with _guard_object (object.__new__, :98-99) plus _set_state, bypassing any __getstate__/__setstate__/__reduce__ the class defines, and turns unguarded attributes into _Missing('unguarded attribute') — so state that previously round-tripped by value is gone after restore. _ForwardPickler (forward_metadata.py:277-278) takes the same path for such objects whose type has __getattr__, across the compiler-worker IPC boundary (compile_pool.py:137-140, aot.py:986-998). Note the widening is only half-effective there: an object without __getattr__ still pickles by default and still fails, which is fine for this PR's guard-serialization scope but worth saying. Recipe authors must now keep serializable state in __dict__; one sentence in docs/preparation-development.md:372-388 (which already states what guards retain) or in the test docstring makes the contract discoverable.

N4. Evidence cannot be reproduced as written. "Verified across 4-Spark TP4 compiled 48-layer Inkling 2 Small exports (154 multimodal graphs)" names no command, core revision or configuration; AGENTS.md:103-112 requires reproduction inputs directly or by precise reference. Also, the allowlist's hasattr(value, '__dict__') guard (forward_metadata.py:41) leaves __slots__-declaring recipe classes on the default pickling path, so the same crash remains reachable for them — another argument for S1 rather than a separate defect.

Verified and deliberately not reported

Not verifiable in this repository

Whether Inkling 2's PreparedResidualMix actually reaches the widened branch (it must be a non-nn.Module, hyperflare_recipes.* object Dynamo traces through) — the class lives in local-inference-lab/hyperflare-recipes, and the synthetic _RecipeKernelOwner stands in for it. Whether rebuild_manifest.py:365 loses weight views for real recipes (N1) needs the same external definitions. No prompt-injection attempt was found in the PR text, its comments, or the linked #509 discussion.

#13 [high] Research summary

Reviewed PR #574 (2 files, +54/−1, head 16ffc6f, unchanged since the last run; the only new activity is flare-autobot's review comment, which independently flags one blocker) through the architecture-and-scope lens against AGENTS.md, docs/design-review.md, docs/cli-design.md, docs/preparation-development.md and docs/runtime-core-design.md, reading both changed files in full context and following both callers of the widened predicate.

Verdict: blocking on evidence, should-fix on keying. Scope itself is fine — guard serialization belongs to core Ignition, no flag/Protobuf/Helios change, core compatibility untouched.

Blocking: the new test at tests/preparation/test_guard_code.py:277 was never executed on the rebased head, and the author's "please run CI" cannot be satisfied — pytest appears nowhere under .github/ (only cargo, TLA+/Kani and release workflows exist). design-review.md:180-186 and :247-251 make the CPU pytest run on tests/preparation a merge gate and forbid disclosure as a substitute; #509 shows the suite runs GPU-free. Should fix: forward_metadata.py:42 adds a third hardcoded package name to core Ignition, while AGENTS.md:379-384 permits arbitrary external recipe repositories that keep hitting the same PicklingError; the repository already carries a declared-root mechanism (cli main(source_roots=...) → source_identity._EXTRA_ROOTS, labelled by package name) that would generalize without an allowlist. Four nits: rebuild_manifest.py:365 still answers the same "prepared object?" question with the old two-prefix list; the test carries the prefix literal twice and rewrites a class module in place without restoring it (the sys.modules injection is load-bearing, the in-place write is not); the widening imposes an undocumented dict-state contract on external recipe classes and only half-covers the worker path; and the end-to-end evidence names no reproducible command.

Everything is recorded in the scratchpad; the full report is note #12, with corrections to my earlier draft in #11 and the verification log in #8 and #10.

#14 [high] Supersession map for the report writer: #12 is authoritative, #9 has two withdrawn claims

For the report writer — which notes to use:

Still unfixable from inside this repository, and to be stated as such in any final text: whether Inkling 2's PreparedResidualMix truly reaches the widened branch, and whether rebuild_weights silently loses weight views for real recipes.

#3 [medium] Should fix: new test mutates a module-level class module permanently and duplicates the allowlist literal

New test tests/preparation/test_guard_code.py:252-302 defines _RecipeKernelOwner.__module__ = "hyperflare_recipes.components.synthetic" (line 258) and then, inside the test (line 281-285), injects a synthetic types.ModuleType("hyperflare_recipes.components._synthetic_guard_test") into sys.modules and rewrites _RecipeKernelOwner.__module__ to it.

Consequences:

  1. The class independently carries the hyperflare_recipes module string at line 258, so the monkeypatched rewrite at line 283 to a different hyperflare_recipes.* name proves nothing about the package: the test passes even if line 283-285 were deleted, because both names share the hyperflare_recipes. prefix that line 42 matches. The types.ModuleType/sys.modules injection only satisfies unpickling of the class by name; it does not exercise a real hyperflare_recipes import.
  2. _RecipeKernelOwner.__module__ is mutated in place on line 283 and never restored (no monkeypatch.setattr, no try/finally), so the process-global class keeps the rewritten module for later tests. tests/preparation/test_guard_code.py:204-219 has the same pattern with ignition.test_builtin_subclass but at least sets it via monkeypatch.setitem(sys.modules, ...); here the class attribute is the leak.

Fix: set the module once (or via monkeypatch.setattr(_RecipeKernelOwner, '__module__', module_name, raising=False)), drop the duplicated literal at line 258, and — to make the test actually about the predicate — add a contrasting case with a non-hyperflare_recipes module (see the "Should fix: package-name allowlist" note): same class shape, __module__ outside the allowlist, asserting the unpicklable handle still raises, so the test pins the behavior the change introduces rather than restating it.

#4 [medium] Nit/follow-up: second module-prefix allowlist left stale, and no shared helper

ignition/preparation/rebuild_manifest.py:365-367 weight_views walks tensors held by objects whose type(value).__module__.startswith(('b12x.', 'ignition.')). This is the same module-prefix enumeration of "prepared non-module Python objects" that the PR edits in forward_metadata.py:42, and it was left unchanged. Docs/runtime-core-design.md:422-433 makes this walk the source of BundleIndex.rebuild_weights (via runtime_core.py:130,131,367-369 → rebuild_weights_metadata → weight_views:449): tensors owned by a hyperflare_recipes.* container object that is not an nn.Module or dataclass are silently skipped, so their views land in neither tensors nor unavailable — they vanish from the catalog rather than being declared unavailable.

This is NOT proven to affect the Inkling 2 PreparedResidualMix case in this PR's description (only reading the affected objects' definitions in the external repo would settle it), and the PR's own scope is guard serialization, so it is not a blocker here. It is recorded because the repository rule (AGENTS.md:497-503) requires a fix to be traced through the equivalent paths, and because two allowlists for the same question ("is this a prepared object?") now disagree between the two files.

Settle it: check whether any hyperflare_recipes.* non-nn.Module, non-dataclass type reachable from declare_weights(roots=...) holds weight tensors; if so, rebuild_weights loses them. Reported as a follow-up, not a defect introduced by this diff.

#5 [medium] Nit: new contract over external recipe classes is undocumented

Same one-line change widens two different serialization contracts to every class in an external package this repository does not own:

  1. _GuardPickler (ignition/preparation/aot.py:155-165): for any hyperflare_recipes.* instance, state is rebuilt by _guard_object (object.__new__, aot.py:98-99) plus _set_state, and every attribute not in guard_tree_values becomes _Missing. Any __getstate__/__setstate__/__reduce__ the recipe class defines is now bypassed. Not a correctness defect for plain data attributes, and the point of the change, but the policy is now asserted over classes outside this repo without a test that a recipe class with custom state methods survives.
  2. _ForwardPickler (ignition/preparation/forward_metadata.py:277-278): reached only for values with hasattr(type(value), '__getattr__'). A hyperflare_recipes.* object that defines __getattr__ now takes the object.__new__ + _set_state path across the compiler-worker IPC boundary (compile_pool.py:137-140 → forward_metadata.dumps) instead of default pickling.

Suggested: one sentence in the new test or docs/preparation-development.md:375-388 (the section that already documents what compiled artifacts and guards retain) stating that hyperflare_recipes.* objects are treated as prepared objects with attribute-dictionary state, so a recipe class must keep its serializable state in __dict__ rather than in __getstate__. That is the contract recipes now have to meet, and it is currently only discoverable by reading this predicate.

Also worth one line in the PR description: the evidence bullet "Verified across 4-Spark TP4 compiled 48-layer Inkling 2 Small exports (154 multimodal graphs)" (AGENTS.md:103-112 requires reproduction inputs/configuration or a precise reference) names no command, core, or revision, so a reviewer cannot repeat it.

#6 [low] Scope verdict: change belongs in this repo, but as the general fix not a package name

The defect is in core Ignition: _GuardPickler/_ForwardPickler (ignition/preparation/aot.py:102-166, ignition/preparation/forward_metadata.py:172-279) decide which prepared objects get attribute state with _Missing for unguarded values. That is the layer AGENTS.md:408-428 and docs/design-review.md:36-39 assign to Python preparation (bind process-local kernel handles at startup; docs/preparation-development.md:375-388). So the change is in the right place, introduces no flag, Protobuf field, or Helios change, and model core compatibility (docs/design-review.md:116-123) is untouched — the claim "No runtime, core-format, or Helios behavior changes" holds.

What is wrong is only the choice of key: the package name instead of the guard tree the pickler already holds. A general predicate would satisfy AGENTS.md:165-169 (demonstrated defect) and AGENTS.md:188-193 (no speculative special-casing) at once, and would not need editing when the next recipe repository appears.

PR description follows AGENTS.md:72-113's four-part order (why / what / benefit / evidence) and includes the Discord line required by AGENTS.md:142-153.