Skip to content

Preserve authored nested dataclass types in clean generated source - #2

Merged
trissim merged 1 commit into
mainfrom
fix/preserve-default-nominal-subtypes
Oct 4, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/preserve-default-nominal-subtypes

Conversation

@trissim

@trissim trissim commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Clean mode silently dropped an authored nested dataclass subtype when all of the subtype's own fields matched its defaults. The parent's default constructor then recreated a different nominal type. An OpenHCS configuration containing VolumeSourceSpatialDomain() consequently rendered as GlobalPipelineConfig() and reopened as an XY declaration.

The existing generic formatter only omits an empty nested constructor when its nominal owner matches the field's default owner. Ordinary unchanged defaults still disappear from clean source. No application-specific formatter or subtype roster is added.

Validation: the complete existing suite plus three focused controls passed (12 tests). Two controls reproduced the loss before the fix, covering both extra subtype fields and a semantic subtype with no additional fields. Actual public OpenHCS ConfigDocument roundtrips retain both default-valued and explicit-depth volume declarations. An actual original 31-step 3D PipelineDocument source roundtrip also preserves the intrinsic type and all three image source bindings, jointly checked through ObjectState's independent runtime-owner fix.

Joint production qualification: the full original 31-step 3D pipeline passes public source decoding, orchestrator initialization using its actual 180-reference source index, and compilation to CompiledExecutionBundle on OpenHCS 2b9bb5649. No pipeline execution or performance result is claimed.

Closes #1

Copilot AI balanced review requested due to automatic review settings October 4, 2026 00:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trissim
trissim merged commit 108a8ed into main Oct 4, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean mode drops authored nested dataclass subtypes with default fields

2 participants