From 2c269a95d2f64164daed301d1bdc861b7eca3114 Mon Sep 17 00:00:00 2001 From: softmaxe <94467584+softmaxe@users.noreply.github.com> Date: Thu, 19 Nov 2026 04:05:09 +0800 Subject: [PATCH 1/6] fix(raycast): execute the validated binary path --- raycast/ferry-to-space-1.sh | 4 ++-- raycast/ferry-to-space-2.sh | 4 ++-- raycast/ferry-to-space-3.sh | 4 ++-- raycast/ferry-to-space-4.sh | 4 ++-- raycast/ferry-to-space-5.sh | 4 ++-- tests/raycast.sh | 39 +++++++++++++++++++++++++++++++++++++ 6 files changed, 49 insertions(+), 10 deletions(-) create mode 100755 tests/raycast.sh diff --git a/raycast/ferry-to-space-1.sh b/raycast/ferry-to-space-1.sh index 3f5183b..fc03d54 100755 --- a/raycast/ferry-to-space-1.sh +++ b/raycast/ferry-to-space-1.sh @@ -16,9 +16,9 @@ space=1 path+=(/opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "${0:A:h:h}/build") binary_path="${FERRY_BINARY:-$(whence -p ferry || true)}" -if [[ ! -x "$binary_path" ]]; then +if [[ ! -f "$binary_path" || ! -x "$binary_path" ]]; then print -u2 "ferry binary not found. Install it with: brew install softmaxe/tap/ferry" exit 127 fi -exec "$binary_path" "$space" +exec "${binary_path:a}" "$space" diff --git a/raycast/ferry-to-space-2.sh b/raycast/ferry-to-space-2.sh index 7e6db18..1d2766f 100755 --- a/raycast/ferry-to-space-2.sh +++ b/raycast/ferry-to-space-2.sh @@ -16,9 +16,9 @@ space=2 path+=(/opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "${0:A:h:h}/build") binary_path="${FERRY_BINARY:-$(whence -p ferry || true)}" -if [[ ! -x "$binary_path" ]]; then +if [[ ! -f "$binary_path" || ! -x "$binary_path" ]]; then print -u2 "ferry binary not found. Install it with: brew install softmaxe/tap/ferry" exit 127 fi -exec "$binary_path" "$space" +exec "${binary_path:a}" "$space" diff --git a/raycast/ferry-to-space-3.sh b/raycast/ferry-to-space-3.sh index 7731635..6c2d526 100755 --- a/raycast/ferry-to-space-3.sh +++ b/raycast/ferry-to-space-3.sh @@ -16,9 +16,9 @@ space=3 path+=(/opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "${0:A:h:h}/build") binary_path="${FERRY_BINARY:-$(whence -p ferry || true)}" -if [[ ! -x "$binary_path" ]]; then +if [[ ! -f "$binary_path" || ! -x "$binary_path" ]]; then print -u2 "ferry binary not found. Install it with: brew install softmaxe/tap/ferry" exit 127 fi -exec "$binary_path" "$space" +exec "${binary_path:a}" "$space" diff --git a/raycast/ferry-to-space-4.sh b/raycast/ferry-to-space-4.sh index 92b3b3d..1fa161e 100755 --- a/raycast/ferry-to-space-4.sh +++ b/raycast/ferry-to-space-4.sh @@ -16,9 +16,9 @@ space=4 path+=(/opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "${0:A:h:h}/build") binary_path="${FERRY_BINARY:-$(whence -p ferry || true)}" -if [[ ! -x "$binary_path" ]]; then +if [[ ! -f "$binary_path" || ! -x "$binary_path" ]]; then print -u2 "ferry binary not found. Install it with: brew install softmaxe/tap/ferry" exit 127 fi -exec "$binary_path" "$space" +exec "${binary_path:a}" "$space" diff --git a/raycast/ferry-to-space-5.sh b/raycast/ferry-to-space-5.sh index efc7119..e865c43 100755 --- a/raycast/ferry-to-space-5.sh +++ b/raycast/ferry-to-space-5.sh @@ -16,9 +16,9 @@ space=5 path+=(/opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "${0:A:h:h}/build") binary_path="${FERRY_BINARY:-$(whence -p ferry || true)}" -if [[ ! -x "$binary_path" ]]; then +if [[ ! -f "$binary_path" || ! -x "$binary_path" ]]; then print -u2 "ferry binary not found. Install it with: brew install softmaxe/tap/ferry" exit 127 fi -exec "$binary_path" "$space" +exec "${binary_path:a}" "$space" diff --git a/tests/raycast.sh b/tests/raycast.sh new file mode 100755 index 0000000..e77e4db --- /dev/null +++ b/tests/raycast.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Exercise Script Command dispatch without launching a window manager. +set -euo pipefail + +scripts="$(cd "$(dirname "$0")/../raycast" && pwd)" +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +cd "$scratch" + +# echo makes every forwarded argument visible. The second executable has a +# space in its name and a different exit status to distinguish the override. +mkdir bin +ln -s /bin/echo bin/ferry +ln -s /usr/bin/false 'custom ferry' +export PATH="$scratch/bin:$PATH" +unset FERRY_BINARY + +for space in 1 2 3 4 5; do + script="$scripts/ferry-to-space-$space.sh" + if ! output="$("$script")" || [[ "$output" != "$space" ]]; then + echo "FAIL: $script must forward Space $space to ferry on PATH" >&2 + exit 1 + fi + + status=0 + FERRY_BINARY='custom ferry' "$script" || status=$? + if [[ "$status" != 1 ]]; then + echo "FAIL: $script did not return the override executable's status" >&2 + exit 1 + fi + + status=0 + FERRY_BINARY="$scratch" "$script" >out 2>err || status=$? + if [[ "$status" != 127 || -s out ]] || ! grep -Fq 'brew install softmaxe/tap/ferry' err; then + echo "FAIL: $script must reject a directory and print the installation hint to stderr" >&2 + exit 1 + fi +done +echo "ok: Raycast Space arguments, binary lookup, and error reporting" From 9431d4c3c9476dfafea156b49865f165686c4d56 Mon Sep 17 00:00:00 2001 From: softmaxe <94467584+softmaxe@users.noreply.github.com> Date: Thu, 19 Nov 2026 04:05:09 +0800 Subject: [PATCH 2/6] build: share artifact checks and streamline release packaging --- .github/workflows/ci.yml | 6 +-- .github/workflows/release.yml | 94 ++++++++++++----------------------- Makefile | 31 +++++++----- tests/binary.sh | 10 ++-- 4 files changed, 57 insertions(+), 84 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56941c1..ccbbe56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,4 @@ jobs: persist-credentials: false - name: Build and test - shell: bash - # Passed through the environment so the Makefile still appends its own flags. - env: - CFLAGS: -O2 -Werror - run: make all test + run: make CFLAGS="-O2 -Werror" test build/follow-test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee8f961..510284c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,9 @@ concurrency: group: release-${{ github.ref }} cancel-in-progress: false -env: - TARGET: aarch64-apple-darwin +defaults: + run: + shell: bash jobs: release: @@ -21,8 +22,8 @@ jobs: contents: write id-token: write attestations: write - outputs: - version: ${{ steps.version.outputs.version }} + env: + ARCHIVE: ferry-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz steps: - name: Check out source uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -31,21 +32,14 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Verify tag is on main - shell: bash + - name: Validate release tag run: | set -euo pipefail git merge-base --is-ancestor "$GITHUB_SHA" origin/main || { echo "Tag $GITHUB_REF_NAME points to $GITHUB_SHA, which is not on main" >&2 exit 1 } - - - name: Read version and validate release tag - id: version - shell: bash - run: | - set -euo pipefail - version="$(sed -n 's/^VERSION = \(.*\)$/\1/p' Makefile | head -n 1)" + version="$(make -s print-version)" if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Makefile version must match MAJOR.MINOR.PATCH: $version" >&2 exit 1 @@ -54,99 +48,79 @@ jobs: echo "Makefile version $version does not match tag $GITHUB_REF_NAME" >&2 exit 1 fi - echo "version=$version" >> "$GITHUB_OUTPUT" - name: Show toolchain - shell: bash run: | sw_vers clang --version xcrun --show-sdk-version - # make test also checks the version, architecture, and deployment target. - name: Build and test - run: make all test + run: make test - name: Package binary - shell: bash - env: - VERSION: ${{ steps.version.outputs.version }} run: | set -euo pipefail - package_dir="$RUNNER_TEMP/package-$TARGET" - dist_dir="$GITHUB_WORKSPACE/dist" - mkdir -p "$package_dir" "$dist_dir" + package_dir="$RUNNER_TEMP/package" + mkdir -p "$package_dir" dist install -m 0755 build/ferry "$package_dir/ferry" install -m 0644 LICENSE "$package_dir/LICENSE" - archive="ferry-v$VERSION-$TARGET.tar.gz" - COPYFILE_DISABLE=1 tar -czf "$dist_dir/$archive" -C "$package_dir" ferry LICENSE - ( - cd "$dist_dir" - shasum -a 256 "$archive" > "$archive.sha256" - ) + cd dist + COPYFILE_DISABLE=1 tar -czf "$ARCHIVE" -C "$package_dir" ferry LICENSE + shasum -a 256 "$ARCHIVE" > "$ARCHIVE.sha256" - name: Attest release archives - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 + env: + NODE_OPTIONS: --max-http-header-size=32768 with: subject-path: dist/*.tar.gz - name: Create draft and publish release - shell: bash env: GH_TOKEN: ${{ github.token }} - TAG: ${{ github.ref_name }} run: | set -euo pipefail - if is_draft="$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft 2>/dev/null)"; then + if is_draft="$(gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft 2>/dev/null)"; then test "$is_draft" = "true" || { - echo "Release $TAG is already published and will not be overwritten" >&2 + echo "Release $GITHUB_REF_NAME is already published and will not be overwritten" >&2 exit 1 } else - gh release create "$TAG" \ + gh release create "$GITHUB_REF_NAME" \ --repo "$GITHUB_REPOSITORY" \ --draft \ --generate-notes \ - --title "$TAG" + --title "$GITHUB_REF_NAME" fi - gh release upload "$TAG" dist/* \ + gh release upload "$GITHUB_REF_NAME" dist/* \ --repo "$GITHUB_REPOSITORY" \ --clobber - gh release edit "$TAG" \ + gh release edit "$GITHUB_REF_NAME" \ --repo "$GITHUB_REPOSITORY" \ --draft=false \ --latest - name: Generate Homebrew formula - shell: bash - env: - TAG: ${{ github.ref_name }} - VERSION: ${{ steps.version.outputs.version }} run: | set -euo pipefail - arm_archive="ferry-v$VERSION-$TARGET.tar.gz" - arm_sha="$(awk '{ print $1 }' "dist/$arm_archive.sha256")" + sha="$(awk '{ print $1 }' "dist/$ARCHIVE.sha256")" mkdir -p formula cat > formula/ferry.rb <&2 exit 1 fi - newest_version="$(printf '%s\n' "$current_version" "$VERSION" | sort -V | tail -n 1)" - if [[ "$current_version" != "$VERSION" && "$newest_version" = "$current_version" ]]; then - echo "Refusing to replace newer Formula $current_version with $VERSION" >&2 + newest_version="$(printf '%s\n' "$current_version" "$version" | sort -V | tail -n 1)" + if [[ "$current_version" != "$version" && "$newest_version" = "$current_version" ]]; then + echo "Refusing to replace newer Formula $current_version with $version" >&2 exit 1 fi fi @@ -246,5 +214,5 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git commit -m "chore: update ferry to $VERSION" + git commit -m "chore: update ferry to $version" git push origin HEAD:main diff --git a/Makefile b/Makefile index 2d31d17..1db4cdd 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ MACOS_MIN = 26.0 CC ?= clang CFLAGS ?= -O2 -CFLAGS += -Wall -Wextra -fno-objc-arc -arch $(ARCH) \ - -mmacosx-version-min=$(MACOS_MIN) -DFERRY_VERSION='"$(VERSION)"' +BUILD_FLAGS = -Wall -Wextra -fno-objc-arc -arch $(ARCH) -mmacosx-version-min=$(MACOS_MIN) # AppKit is linked although no AppKit API is called: the window server ignores # the bridged move operation from processes that have not loaded it. FRAMEWORKS = -framework AppKit -framework ApplicationServices \ @@ -15,29 +14,35 @@ FRAMEWORKS = -framework AppKit -framework ApplicationServices \ PREFIX ?= /usr/local BIN = build/ferry -.PHONY: all test test-follow install clean +.PHONY: all print-version test test-binary test-follow install clean all: $(BIN) +print-version: + @printf '%s\n' "$(VERSION)" + $(BIN): src/ferry.m Makefile - @mkdir -p $(dir $@) - $(CC) $(CFLAGS) $< -o $@ $(FRAMEWORKS) + @mkdir -p "$(@D)" + $(CC) $(CFLAGS) $(BUILD_FLAGS) -DFERRY_VERSION='"$(VERSION)"' "$<" -o "$@" $(FRAMEWORKS) + +test: test-binary + tests/cli.sh "$(BIN)" "$(VERSION)" + tests/raycast.sh -test: $(BIN) - tests/cli.sh $(BIN) $(VERSION) - tests/binary.sh $(BIN) $(ARCH) $(MACOS_MIN) +test-binary: $(BIN) + tests/binary.sh "$(BIN)" "$(ARCH)" "$(MACOS_MIN)" # Requires a live desktop and Accessibility; temporarily switches Spaces. test-follow: $(BIN) build/follow-test - build/follow-test $(abspath $(BIN)) + build/follow-test "$(abspath $(BIN))" build/follow-test: tests/follow.m Makefile - @mkdir -p $(dir $@) - $(CC) $(CFLAGS) $< -o $@ $(FRAMEWORKS) + @mkdir -p "$(@D)" + $(CC) $(CFLAGS) $(BUILD_FLAGS) "$<" -o "$@" $(FRAMEWORKS) install: $(BIN) - install -d $(DESTDIR)$(PREFIX)/bin - install -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin/ferry + install -d "$(DESTDIR)$(PREFIX)/bin" + install -m 0755 "$(BIN)" "$(DESTDIR)$(PREFIX)/bin/ferry" clean: rm -rf build diff --git a/tests/binary.sh b/tests/binary.sh index 0fdbfff..7b01144 100755 --- a/tests/binary.sh +++ b/tests/binary.sh @@ -20,9 +20,13 @@ check() { fi } -check "architecture" "$arch" "$(lipo -archs "$binary")" -check "minimum macOS" "$minimum_macos" "$(otool -l "$binary" | awk '$1 == "minos" { print $2; exit }')" -check "links AppKit" "yes" "$(otool -L "$binary" | grep -q '/AppKit.framework/' && echo yes || echo no)" +architecture="$(lipo -archs "$binary")" +deployment="$(vtool -show-build "$binary" | awk '$1 == "platform" { platform = $2 } $1 == "minos" { print platform, $2 }')" +appkit="$(otool -L "$binary" | awk 'NR > 1 && $1 ~ /\/AppKit\.framework\/(Versions\/[^\/]+\/)?AppKit$/ { found = 1 } END { print found ? "yes" : "no" }')" + +check "architecture" "$arch" "$architecture" +check "minimum macOS" "MACOS $minimum_macos" "$deployment" +check "links AppKit" "yes" "$appkit" if ((failures)); then echo "$failures test(s) failed" >&2 From 2c0e0bb9c0df15a2ac7b950d779473affa8f1263 Mon Sep 17 00:00:00 2001 From: softmaxe <94467584+softmaxe@users.noreply.github.com> Date: Thu, 19 Nov 2026 04:05:29 +0800 Subject: [PATCH 3/6] refactor: reuse the window list across Space moves and polling --- src/ferry.m | 34 ++++++++++--------------- tests/follow.m | 69 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 57 insertions(+), 46 deletions(-) diff --git a/src/ferry.m b/src/ferry.m index 4e4fbfb..079a0d5 100644 --- a/src/ferry.m +++ b/src/ferry.m @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -50,6 +49,10 @@ typedef int64_t (*bridged_operation_fn)(void *operation); +@interface SLSBridgedMoveWindowsToManagedSpaceOperation : NSObject +- (instancetype)initWithWindows:(NSArray *)windows spaceID:(uint64_t)sid; +@end + static void fail(int code, const char *fmt, ...) __attribute__((noreturn, format(printf, 2, 3))); static void fail(int code, const char *fmt, ...) { @@ -140,14 +143,6 @@ static pid_t process_pid(ProcessSerialNumber *psn) // Spaces and windows. // -static CFArrayRef window_id_array(uint32_t wid) -{ - CFNumberRef number = CFNumberCreate(NULL, kCFNumberSInt32Type, &wid); - CFArrayRef array = CFArrayCreate(NULL, (const void **) &number, 1, &kCFTypeArrayCallBacks); - CFRelease(number); - return array; -} - // Maps a 1-based Mission Control index to a space id, counting spaces across // all displays in order (yabai: space_manager_mission_control_space). static uint64_t space_for_index(int cid, int index) @@ -177,11 +172,9 @@ static uint64_t space_for_index(int cid, int index) return result; } -static bool window_is_on_space(int cid, uint32_t wid, uint64_t sid) +static bool window_is_on_space(int cid, NSArray *windows, uint64_t sid) { - CFArrayRef windows = window_id_array(wid); - CFArrayRef spaces = SLSCopySpacesForWindows(cid, 0x7, windows); - CFRelease(windows); + CFArrayRef spaces = SLSCopySpacesForWindows(cid, 0x7, (CFArrayRef) windows); if (!spaces) return false; bool result = false; @@ -261,17 +254,14 @@ static uint32_t window_list_front_window(pid_t pid) } // yabai: space_manager_move_window_to_space, macOS 26 branch. -static int64_t move_window_to_space(bridged_operation_fn perform, uint32_t wid, uint64_t sid) +static int64_t move_window_to_space(bridged_operation_fn perform, NSArray *windows, uint64_t sid) { Class cls = objc_getClass(BRIDGED_MOVE_CLASS); if (!cls) fail(1, "SkyLight class %s not found; unsupported macOS version", BRIDGED_MOVE_CLASS); - CFArrayRef windows = window_id_array(wid); - SEL sel = sel_registerName("initWithWindows:spaceID:"); - id operation = ((id (*)(id, SEL, id, uint64_t)) objc_msgSend)([cls alloc], sel, (id) windows, sid); + id operation = [[cls alloc] initWithWindows:windows spaceID:sid]; int64_t result = perform(operation); [operation release]; - CFRelease(windows); return result; } @@ -411,14 +401,16 @@ int main(int argc, char **argv) bool moved = false; double move_ms = 0; - if (!window_is_on_space(cid, wid, dst_sid)) { + // Match yabai's signed 32-bit representation for SkyLight window lists. + NSArray *windows = @[@((int32_t) wid)]; + if (!window_is_on_space(cid, windows, dst_sid)) { uint64_t move_start = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); - int64_t result = move_window_to_space(perform, wid, dst_sid); + int64_t result = move_window_to_space(perform, windows, dst_sid); SLSSpaceSetFrontPSN(cid, dst_sid, psn); // The operation is asynchronous; wait until the window server // reports the new space before focusing it. - while (!(moved = window_is_on_space(cid, wid, dst_sid)) && elapsed_ms(move_start) < MOVE_TIMEOUT_MS) { + while (!(moved = window_is_on_space(cid, windows, dst_sid)) && elapsed_ms(move_start) < MOVE_TIMEOUT_MS) { CFRunLoopRunInMode(kCFRunLoopDefaultMode, MOVE_POLL_S, true); } diff --git a/tests/follow.m b/tests/follow.m index 3202c19..9beff37 100644 --- a/tests/follow.m +++ b/tests/follow.m @@ -10,7 +10,7 @@ extern CFArrayRef SLSCopySpacesForWindows(int cid, int selector, CFArrayRef windows); extern int SLSSpaceGetType(int cid, uint64_t sid); -#define SPACE_TYPE_FULLSCREEN 4 +#define SPACE_TYPE_USER 0 static void pump(double seconds) { @@ -27,15 +27,15 @@ static bool wait_for_space(int cid, uint64_t sid) return SLSGetActiveSpace(cid) == sid; } -static bool window_on_space(int cid, uint32_t wid, uint64_t sid) +static bool window_only_on_space(int cid, uint32_t wid, uint64_t sid) { - CFArrayRef spaces = SLSCopySpacesForWindows(cid, 0x7, (CFArrayRef) @[@(wid)]); - bool result = spaces && [(NSArray *) spaces containsObject:@(sid)]; - if (spaces) CFRelease(spaces); + NSArray *spaces = (NSArray *) SLSCopySpacesForWindows(cid, 0x7, (CFArrayRef) @[@(wid)]); + bool result = [spaces isEqualToArray:@[@(sid)]]; + [spaces release]; return result; } -static int run_ferry(NSString *binary, uint32_t wid, int index, bool follow) +static bool run_ferry(NSString *binary, uint32_t wid, int index, bool follow, NSString *expected_action) { NSTask *task = [[[NSTask alloc] init] autorelease]; task.launchPath = binary; @@ -43,9 +43,19 @@ static int run_ferry(NSString *binary, uint32_t wid, int index, bool follow) [@(wid) stringValue], [@(index) stringValue], nil]; if (!follow) [args addObject:@"--no-follow"]; task.arguments = args; + NSPipe *pipe = [NSPipe pipe]; + task.standardOutput = pipe; [task launch]; + NSData *output = [pipe.fileHandleForReading readDataToEndOfFile]; + [[NSFileHandle fileHandleWithStandardOutput] writeData:output]; [task waitUntilExit]; - return task.terminationStatus; + NSString *verbose = [[[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding] autorelease]; + if (task.terminationStatus || ![verbose containsString:expected_action]) { + fprintf(stderr, "FAIL: ferry exit=%d, expected verbose output containing '%s'\n", + task.terminationStatus, expected_action.UTF8String); + return false; + } + return true; } static void run_fixture(void) @@ -105,20 +115,24 @@ int main(int argc, char **argv) ++index; uint64_t sid = [space[@"id64"] unsignedLongLongValue]; if (sid == src) src_index = index; - else if (current && !dst && SLSSpaceGetType(cid, sid) != SPACE_TYPE_FULLSCREEN) { + else if (current && !dst && SLSSpaceGetType(cid, sid) == SPACE_TYPE_USER) { dst = sid; dst_index = index; } } } if (displays) CFRelease(displays); - if (!src_index || !dst_index || SLSSpaceGetType(cid, src) == SPACE_TYPE_FULLSCREEN) { + if (!src_index || !dst_index || SLSSpaceGetType(cid, src) != SPACE_TYPE_USER) { fputs("SKIP: test-follow requires two normal Spaces on the active display\n", stderr); return 77; } NSString *binary = [[NSString stringWithUTF8String:argv[1]] stringByStandardizingPath]; NSRunningApplication *original = [[[NSWorkspace sharedWorkspace] frontmostApplication] retain]; + if (!original) { + fputs("SKIP: test-follow needs a frontmost application to restore\n", stderr); + return 77; + } AXUIElementRef original_app = AXUIElementCreateApplication(original.processIdentifier); AXUIElementRef original_window = NULL; AXUIElementCopyAttributeValue(original_app, kAXFocusedWindowAttribute, (CFTypeRef *) &original_window); @@ -138,36 +152,38 @@ int main(int argc, char **argv) pump(0.3); restore_app(original, original_window); pid_t front = [[[NSWorkspace sharedWorkspace] frontmostApplication] processIdentifier]; - if (!wid || !other || front == fixture.processIdentifier || front == getpid() || - !window_on_space(cid, wid, src) || !window_on_space(cid, other, src)) { - fprintf(stderr, "FAIL: fixture setup: target=%u other=%u front_pid=%d fixture_pid=%d source=%llu target_on_source=%d other_on_source=%d\n", - wid, other, front, fixture.processIdentifier, src, - window_on_space(cid, wid, src), window_on_space(cid, other, src)); + bool target_on_source = window_only_on_space(cid, wid, src); + bool other_on_source = window_only_on_space(cid, other, src); + if (!wid || !other || wid == other || front != original.processIdentifier || + SLSGetActiveSpace(cid) != src || !target_on_source || !other_on_source) { + fprintf(stderr, "FAIL: fixture setup: target=%u other=%u front_pid=%d expected_pid=%d source=%llu target_on_source=%d other_on_source=%d\n", + wid, other, front, original.processIdentifier, src, target_on_source, other_on_source); return 1; } // The selected window is not the app's key window. Matching only // the owning app or its focused window must not satisfy this test. - int status = run_ferry(binary, wid, dst_index, true); + if (!run_ferry(binary, wid, dst_index, true, @": moved in ")) return 1; bool followed = wait_for_space(cid, dst); - bool moved = window_on_space(cid, wid, dst); - if (status || !moved || !followed || !window_on_space(cid, other, src)) { - fprintf(stderr, "FAIL: background --window: exit=%d moved=%d followed=%d active=%llu expected=%llu\n", - status, moved, followed, SLSGetActiveSpace(cid), dst); + bool moved = window_only_on_space(cid, wid, dst); + if (!moved || !followed || !window_only_on_space(cid, other, src)) { + fprintf(stderr, "FAIL: background --window: moved=%d followed=%d active=%llu expected=%llu\n", + moved, followed, SLSGetActiveSpace(cid), dst); return 1; } puts("ok: background --window moves and follows the selected window"); - status = run_ferry(binary, wid, dst_index, true); - if (status || !window_on_space(cid, wid, dst) || SLSGetActiveSpace(cid) != dst) { + if (!run_ferry(binary, wid, dst_index, true, @": already there in ")) return 1; + if (!window_only_on_space(cid, wid, dst) || SLSGetActiveSpace(cid) != dst) { fputs("FAIL: --window already on the active destination Space\n", stderr); return 1; } puts("ok: --window already on the active destination Space"); - status = run_ferry(binary, wid, src_index, false); + if (!run_ferry(binary, wid, src_index, false, @": moved in ")) return 1; pump(0.3); - if (status || !window_on_space(cid, wid, src) || SLSGetActiveSpace(cid) != dst) { + if (!window_only_on_space(cid, wid, src) || !window_only_on_space(cid, other, src) || + SLSGetActiveSpace(cid) != dst) { fputs("FAIL: --no-follow must move without switching Spaces\n", stderr); return 1; } @@ -175,12 +191,15 @@ int main(int argc, char **argv) result = 0; } @finally { if (fixture.running) { - if (wid && !window_on_space(cid, wid, src)) run_ferry(binary, wid, src_index, false); [fixture terminate]; [fixture waitUntilExit]; } restore_app(original, original_window); - wait_for_space(cid, src); + if (!wait_for_space(cid, src) || + [NSWorkspace sharedWorkspace].frontmostApplication.processIdentifier != original.processIdentifier) { + fputs("FAIL: could not restore the original app and Space\n", stderr); + result = 1; + } if (original_window) CFRelease(original_window); [original release]; } From 623638d92e8a1a1eba7f72bbf9c9a210f19daed7 Mon Sep 17 00:00:00 2001 From: softmaxe <94467584+softmaxe@users.noreply.github.com> Date: Thu, 19 Nov 2026 04:05:29 +0800 Subject: [PATCH 4/6] test(cli): enforce help, version, and diagnostic output contracts --- src/ferry.m | 1 + tests/cli.sh | 71 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/src/ferry.m b/src/ferry.m index 079a0d5..45e0ab9 100644 --- a/src/ferry.m +++ b/src/ferry.m @@ -304,6 +304,7 @@ static void usage(FILE *stream) " --no-follow move the window without switching spaces\n" " --window act on this window id instead of the focused window\n" " --verbose print what was done and how long it took\n" + " -h, --help print this help and exit\n" " --version print the version and exit\n", stream); } diff --git a/tests/cli.sh b/tests/cli.sh index 2eeb1e0..c24758e 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -1,40 +1,53 @@ #!/bin/bash -# Command-line contract tests. They exit before any window server call, so -# they do not move windows and run on headless CI machines. - +# All invocations exit during argument parsing, before reaching WindowServer. set -euo pipefail binary="${1:?usage: tests/cli.sh }" version="${2:?usage: tests/cli.sh }" -failures=0 - -check() { - local name="$1" expected_status="$2" expected_output="$3" - shift 3 +streams="$(mktemp -d)" +trap 'rm -rf -- "$streams"' EXIT - local output status=0 - output="$("$binary" "$@" 2>&1)" || status=$? +run() { + local expected_status="$1" status=0 unexpected="$streams/stderr" + shift + "$binary" "$@" > "$streams/stdout" 2> "$streams/stderr" || status=$? + if ((expected_status != 0)); then unexpected="$streams/stdout"; fi + if ((status != expected_status)) || [[ -s "$unexpected" ]]; then + echo "FAIL: ferry $*: expected exit $expected_status and empty ${unexpected##*/}, got exit $status" >&2 + cat "$streams/stdout" "$streams/stderr" >&2 + exit 1 + fi +} - if [[ "$status" != "$expected_status" || "$output" != *"$expected_output"* ]]; then - echo "FAIL: $name: exit $status, output: $output" >&2 - failures=$((failures + 1)) - else - echo "ok: $name" +check_error() { + local name="$1" message="$2" + shift 2 + run 2 "$@" + if ! grep -Fq -- "$message" "$streams/stderr"; then + echo "FAIL: $name: expected '$message' in stderr" >&2 + cat "$streams/stderr" >&2 + exit 1 fi + echo "ok: $name" } -check "version" 0 "ferry $version" --version -check "help" 0 "usage: ferry" --help -check "no arguments" 2 "usage: ferry" -check "non-numeric index" 2 "invalid space index 'abc'" abc -check "zero index" 2 "invalid space index '0'" 0 -check "overflowing index" 2 "invalid space index" 99999999999 -check "invalid window id" 2 "invalid window id 'x'" --window x 1 -check "missing window id value" 2 "usage: ferry" --window -check "unknown option" 2 "usage: ferry" --bogus 1 -check "two indexes" 2 "usage: ferry" 1 2 +run 0 --version +printf 'ferry %s\n' "$version" | diff -u - "$streams/stdout" +echo 'ok: version' + +run 0 --help +grep -q '^usage: ferry ' "$streams/stdout" +mv "$streams/stdout" "$streams/help" +run 0 -h +diff -u "$streams/help" "$streams/stdout" +echo 'ok: help aliases' -if ((failures)); then - echo "$failures test(s) failed" >&2 - exit 1 -fi +check_error 'no arguments' 'usage: ferry' +check_error 'non-numeric index' "invalid space index 'abc'" abc +check_error 'zero index' "invalid space index '0'" 0 +check_error 'overflowing index' "invalid space index '2147483648'" 2147483648 +check_error 'invalid window id' "invalid window id 'x'" --window x 1 +check_error 'overflowing window id' "invalid window id '4294967296'" --window 4294967296 1 +check_error 'missing window id value' 'usage: ferry' --window +check_error 'unknown option' 'usage: ferry' --bogus 1 +check_error 'two indexes' 'usage: ferry' 1 2 From b83171ae7a5f6a91a4875f71894d173fe150e928 Mon Sep 17 00:00:00 2001 From: softmaxe <94467584+softmaxe@users.noreply.github.com> Date: Thu, 19 Nov 2026 04:05:29 +0800 Subject: [PATCH 5/6] fix(verification): bind evidence to the tested inputs and binary --- .agents/skills/verify-ferry/SKILL.md | 155 ++++++------------ .../skills/verify-ferry/features/README.md | 25 +-- .agents/skills/verify-ferry/features/cli.md | 7 +- .../verify-ferry/features/explicit-window.md | 3 +- .../skills/verify-ferry/features/raycast.md | 3 + .agents/skills/verify-ferry/scripts/verify.sh | 64 ++++---- 6 files changed, 102 insertions(+), 155 deletions(-) diff --git a/.agents/skills/verify-ferry/SKILL.md b/.agents/skills/verify-ferry/SKILL.md index 279546a..21dc59a 100644 --- a/.agents/skills/verify-ferry/SKILL.md +++ b/.agents/skills/verify-ferry/SKILL.md @@ -5,148 +5,91 @@ description: Build and verify ferry's macOS CLI, window movement and Space follo # Verify ferry -Read [the feature map](features/README.md), then the feature being exercised. -The primary surface is a one-shot CLI that moves macOS windows; Raycast scripts -are a second entry point. There is no daemon, port, auth, database, or seed data. -Never substitute an installed Homebrew binary for the checkout's binary. +Choose a journey from the [feature map](features/README.md). Build the checkout's +executable for each run. Use only disposable fixture windows for desktop checks. -## Launch +## Build and check readiness -Run from the repository root in a persistent shell: +Run from the repository root in one shell. ```sh FERRY_VERIFY="$PWD/.agents/skills/verify-ferry/scripts/verify.sh" FERRY_EVIDENCE="$("$FERRY_VERIFY" launch)" -export FERRY_VERIFY FERRY_EVIDENCE FERRY_BIN="$FERRY_EVIDENCE/scratch/ferry" -export FERRY_BIN +export FERRY_VERIFY FERRY_EVIDENCE FERRY_BIN printf 'Evidence: %s\n' "$FERRY_EVIDENCE" "$FERRY_VERIFY" doctor "$FERRY_EVIDENCE" ``` -Launch builds with the existing Makefile into a fresh scratch directory. It needs -Apple silicon, Xcode Command Line Tools or Xcode, and a macOS 26+ SDK. The default -build is arm64, minimum macOS 26.0, version from `Makefile`. Readiness is a matching -source/binary fingerprint, correct `--version`, and passing architecture, minimum -OS, and AppKit linkage checks. A CLI invocation runs once and exits; launch does -not start a service. A failed build retains its logs and removes its scratch. +Launch uses the Makefile, Apple silicon, and the Xcode Command Line Tools or +Xcode with a macOS 26+ SDK. A failed build prints the evidence path and removes +its scratch directory. The supported runtime is macOS 26. Report the actual OS +version for compatibility runs. -The supported runtime is macOS 26. CLI-only checks can run without Accessibility -or a desktop. Results on a newer OS are compatibility observations, not proof on -the supported OS. +Doctor checks the source and binary fingerprints, version, architecture, +deployment target, and AppKit linkage. It runs without Accessibility or a +desktop. Launch again after changing the build inputs, tests, Raycast scripts, +or verification helper. -No app data isolation is needed for CLI checks, but **the desktop is shared**. -Never run two movement journeys together or move an existing user window. -The `desktop` helper reserves a per-user lock, uses the existing harness's own -two windows, and restores the prior app. It cannot isolate Mission Control from -the user, yabai, hotkeys, or other tools. Do not drive while they are moving -windows. If a lock already exists, stop; do not remove someone else's lock. -For manual journeys, reserve the same lock and release only the lock you created. +## Run a journey -## Doctor - -```sh -"$FERRY_VERIFY" doctor "$FERRY_EVIDENCE" -``` - -This is read-only with respect to the app and desktop: it validates this run's -build and source without moving windows or requesting permissions. Run it first -when anything looks off. A source edit invalidates the run; launch a new one. -It does not assert desktop readiness. The live harness checks Accessibility -without prompting and requires two normal Spaces on the active display. A skip -returns `77` from `build/follow-test`; `make test-follow` typically returns `2` -instead, so read `desktop/stderr.txt` for `SKIP:` rather than treating it as pass. -Do not silently grant permissions, create Spaces, or alter Mission Control settings. - -## Drive - -CLI discovery and argument validation, in a separate real PTY: +For headless CLI verification, capture a terminal transcript. ```sh /usr/bin/script -q "$FERRY_EVIDENCE/cli.pty.txt" \ "$FERRY_VERIFY" cli "$FERRY_EVIDENCE" ``` -Require exit `0` and the `PASS:` line. The helper executes real `--help`, `-h`, -`--version`, and invalid input, verifies stream routing, and reuses `tests/cli.sh`. -All these paths return before WindowServer calls; inspect `main` in `src/ferry.m` -when changing the argument cases. There is **no dry-run flag**: a valid destination -can really move a window. Do not treat `--no-follow` as a dry run. +Require exit 0 and the final `PASS:` line. The helper preserves example +invocations and runs [the CLI contract](../../../tests/cli.sh) for help, +version, argument diagnostics, and stream routing. All cases exit during +argument parsing. A valid destination, including one passed with +`--no-follow`, can move a window. -Background explicit-window movement, already-there behavior, and no-follow: +For the live explicit-window regression, run the following command when the +desktop is available and idle. ```sh "$FERRY_VERIFY" desktop "$FERRY_EVIDENCE" ``` -This executes `make BIN="$FERRY_BIN" test-follow`, reusing `tests/follow.m`. -Require all three `ok:` messages, no `FAIL:` or `SKIP:`, and exit `0`. The test -checks actual WindowServer membership and active Space, including that the other -fixture window stays put. It does not cover focused-window selection or Raycast. -Those journeys require native desktop UI control and the matching feature recipe. -Missing UI control, permission, or suitable Spaces is an unmet precondition; -report it instead of weakening the journey. +The helper locks the shared desktop and runs `make test-follow` with the verified +binary. The harness creates two windows, checks the selected window's location +and the active Space, then closes its fixture and restores the prior app. Allow +it to finish. A passing run exits 0 and reports the background-follow, +already-there, and no-follow assertions. If it fails, inspect +`desktop/stderr.txt`. The harness returns 77 for missing Accessibility or two +normal Spaces on the active display. Make can surface this as exit 2. Report the +skip and keep the user's Spaces and permissions intact. -For a further command, preserve its action and streams with a fresh label: +The [feature map](features/README.md) describes lock ownership, fixture setup, +visual evidence, and restoration for manual focused-window and Raycast journeys. +Use the real launcher when verifying a Raycast action or hotkey. Record the +observed active Space and window membership for movement claims. -```sh -"$FERRY_VERIFY" capture "$FERRY_EVIDENCE" binary-contract \ - tests/binary.sh "$FERRY_BIN" arm64 26.0 -``` - -Each label is single-use. This prevents a retry from overwriting failed evidence. - -## Evidence +## Retain evidence -`launch` prints the absolute artifact directory, normally under `$TMPDIR` as -`ferry-verification.XXXXXX`. It contains platform, revision, source diff/hashes, -binary hash, and per-action `command.txt`, `stdout.txt`, `stderr.txt`, and -`exit-code.txt`. The PTY transcript records the CLI session. Preserve the directory -and report its absolute path. The binary itself is scratch, not retained evidence. +For additional commands, use a fresh label each time. -Exercise the real CLI or launcher, never replace ferry with a mock or use private -setters to manufacture the result. Capture the action and resulting state. -For movement, a successful exit or `focus requested` is insufficient: observe -the window's destination **and** the active Space independently. The existing -live harness supplies those assertions for its three covered paths. A visual -journey also needs before/after screenshots of the fixture and a short recording -of movement/follow timing using available native UI capture; save them in this -artifact directory. Record the selected window ID and source/destination indexes. -Do not infer animation latency from ferry's verbose internal timing. - -For manual CLI launches there should be no app data files, background service, -network activity, or git-ref changes; compare the relevant filesystem/process -state if the change could introduce them. No journey here mocks an external -boundary. Shell-running a Raycast script proves the script path only; the real -Raycast action/hotkey must be exercised separately for launcher claims. +```sh +"$FERRY_VERIFY" capture "$FERRY_EVIDENCE" version-check "$FERRY_BIN" --version +``` -## Cleanup +Each label records the command, stdout, stderr, and exit status. The run directory +also contains the OS version, Git revision, tracked input changes against HEAD, +and input and binary hashes. Report its absolute path. Keep any screenshots or +recordings there. Copy it to durable storage if needed before OS temp cleanup. -Run after successful **and failed** iterations: +After a successful launch, clean up even when a journey fails. ```sh "$FERRY_VERIFY" cleanup "$FERRY_EVIDENCE" test ! -e "$FERRY_EVIDENCE/scratch" -test -s "$FERRY_EVIDENCE/build/command.txt" -test -s "$FERRY_EVIDENCE/source.sha256" test -s "$FERRY_EVIDENCE/cleanup.txt" ``` -The live harness normally closes its own windows and restores the previous app -in `@finally`. Let it finish; do not force-kill it mid-switch. After an abnormal -termination, inspect the exact fixture PID/window IDs from that run and close -only those windows/processes; restore the recorded source Space. Never kill by -process name. `cleanup` removes only the run's scratch, not evidence or the shared -`build/` directory. `make test-follow` may leave its reusable `build/follow-test`. -Manual recipes must stop their recorded fixture PID and release their own lock -before scratch removal. Verify the evidence files for the chosen feature still -exist after cleanup; copy artifacts to durable storage if needed before OS temp -cleanup. Do not commit desktop captures or local evidence by default. - -## Helpers - -[scripts/verify.sh](scripts/verify.sh) is executable and provides `launch`, -`doctor`, `cli`, `desktop`, `capture`, and `cleanup` as invoked above. It requires -the system Bash and existing Makefile/test tools, no package installation. -Feature-specific manual setup is documented in the map, not hidden in the helper. -Keep the map current with `/maintain-verification-skill` as ferry changes. +Cleanup removes the run-owned scratch binary and retains evidence and the +checkout's reusable `build/follow-test`. Manual journeys must first terminate +their recorded fixture PID, restore the original app and Space, and release +their lock. After an interrupted desktop run, inspect the fixture from that +run before attempting restoration. diff --git a/.agents/skills/verify-ferry/features/README.md b/.agents/skills/verify-ferry/features/README.md index c1c45e2..cf0e8e9 100644 --- a/.agents/skills/verify-ferry/features/README.md +++ b/.agents/skills/verify-ferry/features/README.md @@ -20,12 +20,18 @@ before choosing a journey. One passing journey is not full application coverage. ## Driving conventions Use the executable helper for command/stream/exit evidence and native UI tools -for visible app focus and launcher actions. Manual desktop recipes share this -setup after `doctor`; the first command reserves the lock: +for visible app focus and launcher actions. After `doctor`, record the original +frontmost app and Space. Build the fixture and reserve the same desktop lock as +the automated journey. + +```sh +make build/follow-test && mkdir "${TMPDIR:-/tmp}/ferry-verification-desktop.lock" +``` + +Continue only after this command succeeds. If the lock exists, leave it in +place for its owner. Start the disposable fixture in the same shell. ```sh -mkdir "${TMPDIR:-/tmp}/ferry-verification-desktop.lock" -make build/follow-test build/follow-test --fixture > "$FERRY_EVIDENCE/fixture-ids.txt" \ 2> "$FERRY_EVIDENCE/fixture-stderr.txt" & FERRY_FIXTURE_PID=$! @@ -33,8 +39,7 @@ printf '%s\n' "$FERRY_FIXTURE_PID" > "$FERRY_EVIDENCE/fixture-pid.txt" ``` Wait for `fixture-ids.txt` to contain two nonzero decimal window IDs and for both -windows to appear on source Space 1. Record the original frontmost app and Space -with native UI control before starting. The titles are `Ferry follow test: target` +windows to appear on source Space 1. The titles are `Ferry follow test: target` and `Ferry follow test: other window`. Read IDs only after readiness: ```sh @@ -49,12 +54,12 @@ location and active Space. After each manual journey, close only this fixture: ```sh kill -TERM "$FERRY_FIXTURE_PID" wait "$FERRY_FIXTURE_PID" || true -rmdir "${TMPDIR:-/tmp}/ferry-verification-desktop.lock" ``` -Restore the original app and Space with native UI control, then run the skill's -cleanup. If fixture startup fails, still stop the PID you started and release -your lock. Do not launch a second fixture to hide a broken first attempt. +Restore the original app and Space with native UI control, then release your +lock with `rmdir "${TMPDIR:-/tmp}/ferry-verification-desktop.lock"` and run the +skill's cleanup. If fixture startup fails, still clean up the fixture and lock +from this run. ## Proof and skip reporting diff --git a/.agents/skills/verify-ferry/features/cli.md b/.agents/skills/verify-ferry/features/cli.md index d2ed067..ddeae15 100644 --- a/.agents/skills/verify-ferry/features/cli.md +++ b/.agents/skills/verify-ferry/features/cli.md @@ -24,9 +24,9 @@ Preconditions: launch and doctor passed; no live desktop or Accessibility needed "$FERRY_EVIDENCE/cli.pty.txt" "$FERRY_VERIFY" cli "$FERRY_EVIDENCE"`. Require exit 0 and the final `PASS:` line. - **Inspect proof.** `help`, `help-short`, `version`, and `invalid-index` action - folders contain separate streams and statuses. `contract/stdout.txt` contains - ten `ok:` messages from the existing CLI tests; the helper additionally checks - identical help aliases and stream routing. + folders contain example streams and statuses. `contract/stdout.txt` records + the passing cases from `tests/cli.sh`, which checks help alias equivalence, + the version, stream routing, and argument diagnostics. - **Confirm teardown.** Run the skill cleanup. The PTY transcript and all action folders remain while `scratch/ferry` is removed. @@ -34,5 +34,4 @@ Preconditions: launch and doctor passed; no live desktop or Accessibility needed - Valid destination arguments would enter real window-management code. The safe cases above exit during parsing, before WindowServer access; this is not a mock. -- `tests/cli.sh` merges streams internally, so its pass alone cannot prove routing. - A `make test` pass does not prove a move or a Space focus change. diff --git a/.agents/skills/verify-ferry/features/explicit-window.md b/.agents/skills/verify-ferry/features/explicit-window.md index 7342116..0e3d845 100644 --- a/.agents/skills/verify-ferry/features/explicit-window.md +++ b/.agents/skills/verify-ferry/features/explicit-window.md @@ -27,7 +27,8 @@ Spaces on its active display, and no other desktop journey running. - **Inspect action evidence.** `desktop/command.txt` identifies the checkout binary passed to `make`; `desktop/stdout.txt` includes real IDs, indexes, verbose results, and assertions. Require overall exit 0 and no `SKIP:`/`FAIL:`. -- **Stale ID.** In a separate manual fixture journey from the index, retain +- **Stale ID.** Use a disposable desktop session containing only test windows, + since macOS can reuse a closed window's ID. In a separate manual fixture journey, retain `FERRY_TARGET`, close that fixture through its recorded PID, and immediately run `"$FERRY_VERIFY" capture "$FERRY_EVIDENCE" stale-window "$FERRY_BIN" --window "$FERRY_TARGET" 2`. Require exit 1 and `window N not found` in stderr, with no diff --git a/.agents/skills/verify-ferry/features/raycast.md b/.agents/skills/verify-ferry/features/raycast.md index 6812de5..5cd55f9 100644 --- a/.agents/skills/verify-ferry/features/raycast.md +++ b/.agents/skills/verify-ferry/features/raycast.md @@ -23,6 +23,9 @@ Preconditions: native desktop control, manual fixture baseline from the index, Raycast installed and already configured for these scripts for action/hotkey coverage. Do not modify the user's extension directory or hotkeys implicitly. +`make test` exercises script dispatch on a headless machine. The live journeys +below exercise the real executable and observe window and Space changes. + - **Shell script route.** Focus `Ferry follow test: target` and run `"$FERRY_VERIFY" capture "$FERRY_EVIDENCE" raycast-shell env FERRY_BINARY="$FERRY_BIN" /bin/zsh raycast/ferry-to-space-2.sh`. Require exit 0, empty streams, target on diff --git a/.agents/skills/verify-ferry/scripts/verify.sh b/.agents/skills/verify-ferry/scripts/verify.sh index 4f8665f..816ca4a 100755 --- a/.agents/skills/verify-ferry/scripts/verify.sh +++ b/.agents/skills/verify-ferry/scripts/verify.sh @@ -3,14 +3,23 @@ set -euo pipefail root="$(cd "$(dirname "$0")/../../../.." && pwd -P)" -self="$root/.agents/skills/verify-ferry/scripts/verify.sh" mode="${1:-}" +if [[ "$mode" != launch ]]; then + run="${2:?usage: verify.sh launch | doctor/cli/desktop/cleanup | capture