ACTCLI-28: Refactor run_sync_with_probe: break up 555-line god function into phases#742
Draft
poiley wants to merge 1 commit into
Draft
ACTCLI-28: Refactor run_sync_with_probe: break up 555-line god function into phases#742poiley wants to merge 1 commit into
poiley wants to merge 1 commit into
Conversation
76bef3b to
f7d8a43
Compare
f7d8a43 to
970bd40
Compare
… phase functions Extract the 626-line god function into focused phases: - run_environment_phase: git detection, config display, runner probe - run_analysis_phase: analysis, filtering, auto-select, confirmation - run_fetch_phase: config reload, API fetch, rejection filtering - run_tailor_phase: cache, ADR partitioning, tailoring, V2 governance - run_write_phase: thin wrapper around confirm_and_write - run_telemetry: fire-and-forget metrics (cfg feature) Add EnvironmentPhaseResult, FetchPhaseResult, TailorPhaseResult structs. run_sync_with_probe reduced to ~15-line coordinator. Add 7 unit tests covering each extracted phase function. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
970bd40 to
1bf3721
Compare
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
Resolves ACTCLI-28.
run_sync_with_probegod function into 6 independently-testable phase functions:run_environment_phase,run_analysis_phase,run_fetch_phase,run_tailor_phase,run_write_phase,run_telemetryEnvironmentPhaseResult,FetchPhaseResult, andTailorPhaseResultstructs with clear input/output contracts for each phaserun_sync_with_probeto a ~15-line coordinator that calls the phases in sequence#[allow(clippy::too_many_arguments)]from all extracted functions (each has ≤7 params); kept it only onrun_sync_with_probewhich retains its 8-param public APITest plan
cargo fmt --checkpassescargo clippy -- -D warningspassescargo build --releasesucceeds🤖 Generated with Claude Code