Repository navigation
Fix --codemod-owner-picks in synthesize-plan CLI and single-embedded constant_subtype_answer - #637
Merged
Merged
Conversation
…constant_subtype_answer
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
Two Toad-bench fixes discovered while driving NRA synthesis batches on
OpenHCSDev/toad:Honor
--codemod-owner-picksin--codemod-synthesize-planand--codemod-synthesize-class-plan(nominal_refactor_advisor/cli.py:3582):supply owner ... in --codemod-owner-picks, butCodemodSynthesizePlanCliCommandandCodemodSynthesizeClassPlanCliCommandpassed rawself.findingsand ignored--codemod-owner-pickscompletely.CodemodSynthesisExecutionCliCommand.picked_findings(self)shared by both commands so CLI synthesis plans applyOwnerPicks.read(self.args.codemod_owner_picks).Count only embedded consumers needing a pick in
ConstantSubtypeAnswerDetector(nominal_refactor_advisor/refactors/constant_subtype_answer.py:2687):pick is not None and len(metrics.consumer_locations) == 1, which ignored a suppliedOwnerPickwhenever a finding had one whole-function consumer (auto-named fromfunction.name) plus one embedded consumer (e.g. Toad'sSidebarModelState.shows_modelread byChannelTreeSidebar.syncandChannelTreeSidebar.present), while still printingsupply owner ... in --codemod-owner-picks.embedded_count == 1), applies the singleOwnerPickto that embedded consumer, and reportsNeededInput.SOURCE_CHANGEwhenembedded_count > 1instead of requesting a single pick that cannot name multiple methods.Verification
tests/test_toad_bench_synthesis_fixes.pycovering CLI--codemod-synthesize-plan --codemod-owner-picksand single-embedded + whole-functionconstant_subtype_answerpush with runtime parity.27 passed, 0 failed(test_toad_bench_synthesis_fixes.py,test_constant_subtype_answer.py,test_repository_architecture.py),REL_IMPORTS=0.