fix: ExportMixin captures only outermost __init__ args for correct export/rebuild round-trips - #273
Draft
toby-coleman with Copilot wants to merge 4 commits into
Draft
fix: ExportMixin captures only outermost __init__ args for correct export/rebuild round-trips#273toby-coleman with Copilot wants to merge 4 commits into
__init__ args for correct export/rebuild round-trips#273toby-coleman with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix export() argument capture in ExportMixin
fix: ExportMixin captures only outermost Aug 13, 2026
__init__ args for correct export/rebuild round-trips
Contributor
|
@copilot Can you add a minimal test for this |
|
Benchmark comparison for |
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Contributor
Author
Added two unit tests in
|
|
Benchmark comparison for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ExportMixinwrapped__init__at every level of the class hierarchy and merged all args into one dict, so subclasses that derive a parent's constructor argument would export both their own arg and the parent's computed arg — breaking reconstruction.Changes
plugboard/utils/export_mixin.py—_save_args_wrappernow sets a re-entrancy flag on the instance before calling__init__. Nestedsuper().__init__()wrappers detect the flag and skip saving. The flag is deleted in afinallyblock so no stale attributes persist on instances.export()captures__init__arguments from every class in the chain, so subclasses cannot be rebuilt from a dumped config #272