Skip to content

cobol-refractor rewrites NEXT SENTENCE in the target repository's source files in place #3206

Closed

Description

@squid-protocol

Found while running the #3120 differential end to end. process_payload (gitgalaxy/cobol_refractor_controller.py) calls patch_lexical_traps(filepath) on the original source file in the target repository. cobol_lexical_patcher.py does filepath.write_text(patched_content) and rewrites NEXT SENTENCE in place.

Everything else the refractor produces goes to a separate <repo>_gitgalaxy_clean_<ts>/ "clean room". The one write that lands in the customer's source tree is unannounced apart from a console line, and not reversible from the tool.

Consequences:

Suggested fix: write the patched copy into the clean room (e.g. 00_patched_source/) and point the rest of process_payload at that copy, leaving the target untouched. The same should hold for the standalone cobol_lexical_patcher CLI unless given an explicit --in-place.

Activity

  1. added
    bug
    legacy-modernization
    on Sep 19, 2026
  2. added 2 commits that reference this issue on Sep 19, 2026
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

    buglegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions