fix: reconstruct nested dataclass lists in MC _dict_to_config (#12)#13
Merged
abhicris merged 1 commit intoJun 19, 2026
Merged
Conversation
…hain#12) _dataclass_to_dict flattens nested lists (RevenueStream, VestBucket) to dicts but _dict_to_config did a flat setattr, destroying structure. Fix: detect list fields whose originals are dataclass lists and recursively reconstruct via _dict_to_dataclass helper. Closes kcolbchain/token-simulator kcolbchain#12
|
Welcome to kcolbchain, @gtx20060124-bot — glad you're here. 🌱 Here's what happens from this PR:
While you wait:
What happens after your first merge
Thanks for writing the code. We're building this to last. |
|
🤖 Audit verdict: Code adds legitimate nested dataclass reconstruction logic with no malicious intent, credential leakage, or security vulnerabilities. Audited by the kcolbchain PR pipeline. See pipeline docs. |
|
Merged — thank you, @gtx20060124-bot. Your first kcolbchain contribution is in. 🎉 A few things that unlocked with this merge:
If you want to stay in the loop on what we're shipping: https://kcolbchain.com/ROADMAP.md |
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.
Summary
Fixes 4/18 Monte Carlo tests that fail with:
Root cause
mc_runround-trips SimConfig through_dataclass_to_dictand back through_dict_to_config. The reconstruct step did a flatsetattr, destroying nestedList[RevenueStream]andList[VestBucket]— they became flat dicts instead of dataclass objects.Fix
_dict_to_dataclasshelperCloses kcolbchain/token-simulator #12