Skip to content

fix: thread real project_root into VerificationEngine from pipeline/autofix #187

@omsherikar

Description

@omsherikar

Problem

RefactronPipeline carries a correct project_root, but AutoFixEngine.fix_file() always constructs VerificationEngine(project_root=file_path.parent) (refactron/autofix/engine.py). That breaks monorepos and any layout where tests or config live above the edited file.

Impact

  • TestSuiteGate._find_relevant_tests searches from the wrong root when callers do not pass an explicit root.
  • Behavior diverges from refactron verify --project-root, which already accepts a root.

Suggested direction

  • Add an optional project_root: Optional[Path] to fix_file() (default: derive from file, or walk to VCS root).
  • Have RefactronPipeline.apply() pass self.project_root into fix_file.
  • Add/adjust tests so verification uses the pipeline root, not only file_path.parent.

References

  • refactron/autofix/engine.py (verification block)
  • refactron/core/pipeline.py (applyfix_file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions