Repository navigation
Conversation
… no longer says Updated The block was passed to awk as -v blk="$block". BSD awk (macOS, 20200816) refuses a newline in a -v value, so every re-run left the files untouched while still printing "Updated: ... rewritten in place" and counting the surface. The block now goes through the environment (ENVIRON["BLK"]), and a failed rewrite or append prints FAILED, leaves the file unchanged and is not counted. Proof: tests/wave2/test-company-brain.sh T2c, a stub awk enforcing BSD's -v rule. Fixed: PASS 50 FAIL 0. Same fixture with 2ba8158's script: PASS 46 FAIL 4, reproducing the reported "awk: newline in string" followed by "Updated: ...". Field: reported in #598 on macOS 26 / BSD awk (three surfaces of a field-run project copy). Fixes #598 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LeNWZV2sVH62vkgfYh5u5
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 #598
Direct lane
What changed and why:
bin/wire-company-brain.shpassed the multi-line pointer block to awk as-v blk="$block". BSD awk on macOS (20200816) refuses a newline in a-vvalue. As a result, every re-run (a moved brain, a changed block) left all surfaces untouched, yet still printedUpdated: … rewritten in placeand counted the surface.What this PR changes:
ENVIRON["BLK"]), which is POSIX.Updatedonly whenawk && mvsucceeded.FAILED: …, leaves the file unchanged, and does not count the surface.Impact
FAILEDinstead of a falseUpdated. The exit code is unchanged.bin/wire-company-brain.shand its fixture. No shared files, no new tools.ENVIRONworks in BSD awk, gawk and mawk.Field evidence: reported in #598 from a scratch copy of a field-run project (three surfaces) on macOS 26 / BSD awk 20200816. The issue reproduces it on a clean master with an empty fixture. The issue's suggested
ENVIRONchange was tested there on BSD awk. This PR has not been run on macOS from here: the build container only has mawk.Proof: the new section
tests/wave2/test-company-brain.shT2c uses a stubawkthat enforces BSD's no-newline-in--vrule and otherwise runs the real awk. It also uses a stub that always fails, to check the reporting.Master output under the stub matches the issue's report line for line. Only this fixture covers the script (
grep -rl wire-company-brain tests/).bin/check-portability.shis clean (335 files). The full suites were not run, per CLAUDE.md.CHANGELOG.mdline appended, crediting [bug] wire-company-brain.sh: re-run fails on macOS awk and still reports Updated #598Review: pending independent review
Generated by Claude Code