Repository navigation
fix: restrict missing component attributes to declared I/O fields - #301
toby-coleman wants to merge 4 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Benchmark comparison for |
|
Benchmark comparison for |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| raises `AttributeError` with the component and field names, and `hasattr` returns | ||
| `False`. Assigning `None` explicitly stores it as the field's value; an unset field | ||
| has no entry in the instance dictionary. | ||
|
|
There was a problem hiding this comment.
Remove this comment - this area of documentation should be kept simple for new users.
|
Benchmark comparison for |
|
Benchmark comparison for |
Reading an unknown public component attribute currently returns None, so misspelled fields also appear to exist through hasattr. Restrict that fallback to declared public inputs and outputs on the instance's current IOController. Unknown attributes now raise AttributeError with the component class, instance name, and field name.
Declared-but-unset ports continue returning None without assigning a value or making inputs ready. Explicitly assigning None retains an instance attribute. Runtime declarations from FileReader and FileWriter follow the same rules as static and inherited ports. Document this contract and add regression coverage for attribute lookup, dynamic instance isolation, initialization, export/reconstruction, and deepcopy.
Preserve the helpful ValidationError for components that omit super().init(). The missing name is now detected when the component ID is accessed during process construction, rather than later during process initialization.