fix: let informational xcodebuild commands bypass xcsift - #82
Merged
Conversation
The pre-tool hooks rewrote every command that starts with `xcodebuild`, so
`xcodebuild -version`, `-list -json`, `-showBuildSettings -json` and
`-showTestPlans -json` went through the build parser. The parser found no build
markers and reported `status: incomplete` with an empty summary, which discarded
the answer. `xcodebuild -showsdks` and `swift build --show-bin-path` failed the
same way.
The hook is the correct place for the fix: the hook reads the command, but
xcsift reads only the output.
Changes to the hook condition, applied to all three copies:
- Informational commands pass through untouched.
- The command matcher accepts a leading shell separator, so
`cd App && xcodebuild build` is now piped through xcsift.
- The rewrite groups the command as `{ ... ; } 2>&1 | xcsift -f toon`. The
previous code appended `2>&1 |` to the string, which sent only the last part
of `xcodebuild build; swift test` to xcsift.
- Commands with their own pipe or file redirection pass through, because
`xcodebuild build > log.txt` left xcsift with empty input.
- `xcodebuild-foo build` no longer matches.
Also synchronize the plugin version across marketplace.json, plugin.json and
SKILL.md, which drifted apart in #60, and raise it to 1.0.4 so installed plugins
load the new script.
`PluginFilesTests` runs one command table against all three hook copies and
compares the three version manifests, so a partial edit fails the tests.
Closes #80
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.
Closes #80.
The problem
The pre-tool hooks rewrote every command that starts with
xcodebuild, so informational commands went through the build parser, which discarded the answer:The issue lists four commands.
xcodebuild -showsdks,-showdestinationsandswift build --show-bin-pathfailed the same way.The fix belongs in the hook: the hook reads the command, but xcsift reads only the output. A passthrough mode inside xcsift would have to hold the raw input, which contradicts the bounded-memory streaming design from #79 and #81.
Changes
The hook condition is duplicated in three files that must agree —
CursorTemplates.hookScript(written byinstall-cursor),plugins/cursor/hooks/pre-xcsift.sh, andplugins/claude-code/scripts/pre-xcsift.sh(installed byinstall-claude-code). All three get the same edit:-version,-usage,-help,-list,-showsdks,-showdestinations,-showTestPlans,-showBuildSettings(ForIndex),-find-executable,-find-library,-checkFirstLaunchStatus,-create-xcframework,--show-bin-path,--list-tests.cd App && xcodebuild buildnow matches. The old pattern was anchored to the start of the line, so those build logs reached the agent raw.{ ... ; } 2>&1 | xcsift -f toon. The old code appended2>&1 |to the end of the string, soxcodebuild build; swift testsent only the second half to xcsift.xcodebuild build > log.txtpreviously left xcsift with empty input, which exits 64.xcodebuild-foo buildno longer matches. The old\bmatched betweendand-.The Codex skill has no hook support, so
SharedTemplates.skillMarkdownand both checked-inSKILL.mdcopies gain a "When Not to Use" section.PluginInstallation.mddocuments which commands the hooks rewrite.The plugin version was
1.0.2inmarketplace.json,1.0.3inplugin.jsonand1.0.3inSKILL.md— #60 bumped two of the three. All three now read1.0.4, so installed plugins load the new script.Tests
PluginFilesTestsruns one table of 17 commands against all three hook copies and parses their real JSON replies, and compares the three version manifests. Running one table across every copy is what keeps them from drifting apart again.Verified by mutation: removing the informational-command guard from one script fails the test on seven commands and names the file; reverting makes it pass. Reverting
marketplace.jsonto1.0.2fails the version test.swift test: 431 passed, 0 failures.swift formatapplied.Result