Repository navigation
fix(sync): item-3 rewrite works on BSD awk and no longer reports a rewrite that failed - #427
Merged
Merged
Conversation
…write that failed Fixes #426 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The failure line was a plain echo, so WARNINGS stayed unchanged and sync could still close with 'up to date' and pass --strict. Also return 2 when the replacement file cannot be written. The test syncs the same fixture with a working awk for a baseline and requires the six failures to add to the warning count (2 -> 8); on the previous head it stays 2 -> 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 16, 2026
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #426
What changed and why:
_ea_rewrite_item3passed the multi-line item-3 replacement throughawk -v. Stock macOS awk rejects that ("newline in string", exit 2), so the file stayed unchanged while sync printed "Rewrote" and counted a change, on every run. The replacement is now streamed from a temp file (same pattern as the Q9 repair). The helper returns 2 when awk fails, and the caller prints aWARN:instead of "Rewrote". Otherawk -vsites were checked: all pass single-line values, nothing else to fix.Before / after (
bash tests/wave2/test-exec-approval.sh, macOS awk 20200816, also withPATH=/usr/bin:/bin):New assertions use an awk shim that fails the replacement call: no "Rewrote", a WARN is printed, file unchanged.
Impact
bin/sync-project.sh,tests/wave2/test-exec-approval.sh,CHANGELOG.md. No new artifact reads. Usesmktempandawk getline, already used by the Q9 repair.Field evidence: observed on macOS (awk 20200816) with synthetic fixtures only. No project data.
test-exec-approval.shon macOS BSD awk🤖 Generated with Claude Code