Summary
refactron run uses RefactronPipeline.analyze (which saves a session) and sets current session. refactron analyze builds a separate PipelineSession inline, queues all issues, saves, and sets current — overlapping responsibilities with different code paths and risk of drift (fields, defaults, future flags).
Suggested direction
- Extract a single helper e.g.
create_session_from_analysis(result, target, ...) used by both CLI and RefactronPipeline.
- Ensure
issues_by_level, fix queue policy, and state transitions stay consistent.
Acceptance
- One code path for “analysis result → persisted session” for connected commands.
- Tests updated; behavior unchanged for users.
Code
refactron/core/pipeline.py
refactron/cli/analysis.py
refactron/cli/run.py
Summary
refactron runusesRefactronPipeline.analyze(which saves a session) and sets current session.refactron analyzebuilds a separatePipelineSessioninline, queues all issues, saves, and sets current — overlapping responsibilities with different code paths and risk of drift (fields, defaults, future flags).Suggested direction
create_session_from_analysis(result, target, ...)used by both CLI andRefactronPipeline.issues_by_level, fix queue policy, andstatetransitions stay consistent.Acceptance
Code
refactron/core/pipeline.pyrefactron/cli/analysis.pyrefactron/cli/run.py