Skip to content

Preserve EOF whitespace in apply_patch updates#63

Open
ctkm-aelf wants to merge 17 commits into
consensus-rnd/issuesfrom
refactor/iter48-issue-48
Open

Preserve EOF whitespace in apply_patch updates#63
ctkm-aelf wants to merge 17 commits into
consensus-rnd/issuesfrom
refactor/iter48-issue-48

Conversation

@ctkm-aelf

Copy link
Copy Markdown
Collaborator

Changed files

Implemented EOF whitespace preservation for codex-apply-patch update hunks by keeping the original split-line representation through replacement application instead of stripping the terminal empty element and re-adding a newline unconditionally.

Updated focused CLI and scenario coverage for files without a final newline and for files with multiple trailing blank lines. The scenario fixture input was extended into scope because the regression requires a no-final-newline source fixture.

Fixes local managed issue #48.

Upstream reference: openai#21121.

Test results

Passed:

  • just fmt
  • bash -lc 'set -a; if test -f /Users/chronoai/Desktop/codex/.refactor-loop/host.env; then source /Users/chronoai/Desktop/codex/.refactor-loop/host.env; fi; set +a; bash "$CONSENSUS_RND_RUST_GUARD" build'
  • bash -lc 'set -a; if test -f /Users/chronoai/Desktop/codex/.refactor-loop/host.env; then source /Users/chronoai/Desktop/codex/.refactor-loop/host.env; fi; set +a; bash "$CONSENSUS_RND_RUST_GUARD" test'
  • just test -p codex-apply-patch
  • just test -p codex-core apply_patch_cli_update_preserves
  • just fix -p codex-apply-patch
  • git diff --check

CI_GUARDS was empty in host configuration, so no architecture guard command was configured to run.

Deviations

HOST_REFACTOR_COMMENT_POLICY was empty and normalized to none, so no refactor self-documentation comments were added.

The fixture input path codex-rs/apply-patch/tests/fixtures/scenarios/014_update_file_appends_trailing_newline/input/no_newline.txt was modified after emitting a scope-extension record because the scenario regression depends on preserving a no-final-newline input file.

No commit was created; changes are staged in the worktree for controller-owned PR publication.

⟦AI:AUTO-LOOP⟧

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants