Skip to content

[P1] Share auto-patch logic between verify --fix and generation loop #10

Closed

Description

@pro-utkarshM

Problem

Auto-patching exists only in verify --fix. The generation self-healing loop (#2) needs the same fix-application path. Avoid duplicate logic.

Tasks

  • Extract diagnosis→patch application into a reusable function/service (core, not CLI command).
  • Call it from both verify --fix and generator phase 3.
  • Unit test the shared patcher.

Acceptance

Single code path applies fixes; both entrypoints use it.

Activity

  1. added this to the v0.1 completion milestone on May 25, 2026
  2. pro-utkarshM commented on Oct 15, 2026

    @pro-utkarshM
    MemberAuthor

    Done on master. code2test verify --fix builds a TestGenerator and calls the same verify_and_fix that generation uses (code2test/cli/commands/verify.py), so one code path applies every repair. --fix only rewrites files Code2Test generated and that haven't been edited since.

    Covered by tests/test_cli.py: test_verify_fails_after_code_change_and_fix_repairs, test_verify_fix_does_not_overwrite_hand_edited_tests, test_unfixable_tests_are_not_written. Generation-side repair is covered in tests/test_pipeline.py.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Core feature / high priority

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions