Skip to content

fix: preserve literal dollar sequences in replace-all edits - #165

Merged
hetaoBackend merged 1 commit into
mainfrom
codex/fix-literal-replace-all
Sep 18, 2026
Merged

hetaoBackend merged 1 commit into
mainfrom
codex/fix-literal-replace-all

Conversation

@hetaoBackend

@hetaoBackend hetaoBackend commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Change

Fixes #155. Bulk edits now insert replacement text literally: $$, $&, dollar-backtick, and dollar-apostrophe remain unchanged instead of collapsing dollars, reinserting the match, or duplicating surrounding file content.

Use a replacement callback in the shared replace-all helper. Add 12 regression cases covering helper output and occurrence counts, actual LocalEditTool file writes with multiple matches, and single-edit controls. Register the test in the capability suite and regenerate the public source inventory.

Validation

  • Before the fix: all eight bulk-edit assertions failed; all four single-edit controls passed.
  • After the fix: all 12 focused regression cases passed.
  • git diff --check: passed. pnpm verify on clean commit 9a35236fdc2ca1944c8e3b6eddbd7a50fee8ac22: all 14 full-profile gates passed on macOS arm64, Node.js 26.4.0 (including source export, typecheck, build, capability regressions, smoke, offline BYOK, policy and sandbox).
  • NOT RUN: live-model or published-package acceptance; local verification does not establish Linux/Windows acceptance.

Publication and contribution checks

  • Changes are contributed under the existing applicable licenses; existing notices are preserved. No third-party code is imported.
  • No credentials, account data, real user content, internal source history or private review material is included. Tests use synthetic temporary files.
  • The added test was reviewed before regenerating release/public-source.json and is declared in test/vitest-suites.json.
  • No documentation or capability changes are required; this restores the existing literal edit contract. Offline results are not described as live-service acceptance.

Maintainer handoff

No publication scope or license changes. Shared-source port: pending.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@hetaoBackend
hetaoBackend merged commit f3160cd into main Sep 18, 2026
8 checks passed
@hetaoBackend
hetaoBackend deleted the codex/fix-literal-replace-all branch September 18, 2026 23:26
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.

[Bug]: edit with replace_all corrupts literal dollar sequences in replacement text

1 participant