Skip to content

v1.58.6.0 fix: fallback execution via bun run on Windows Smart App Control#2127

Open
salluexez wants to merge 3 commits into
garrytan:mainfrom
salluexez:windows-sac-sign
Open

v1.58.6.0 fix: fallback execution via bun run on Windows Smart App Control#2127
salluexez wants to merge 3 commits into
garrytan:mainfrom
salluexez:windows-sac-sign

Conversation

@salluexez

Copy link
Copy Markdown

Summary

This PR fixes a Windows 11 Smart App Control (SAC) compatibility issue where the bundled unsigned executables (browse.exe, design.exe, and pdf.exe) may be blocked from running.

The fix preserves the existing workflow while providing a safe fallback when Windows prevents execution:

  • Prioritize .exe binaries during Windows executable discovery.
  • Validate bundled binary executability at runtime.
  • Automatically fall back to the TypeScript implementation (bun run <tool>/src/cli.ts) when execution is blocked by Smart App Control.
  • Document the behavior and troubleshooting steps in README.md and CLAUDE.md.

This solution does not bypass Windows security features. Instead, it uses the code-signed Bun runtime to execute the TypeScript sources when bundled binaries cannot be launched.


Changes

Binary Discovery

  • Updated browse/bin/find-browse to prioritize .exe executables on Windows.
  • Updated generated resolver templates to resolve Windows executables before legacy binary names.

Runtime Fallback

Added runtime validation to the generated setup blocks for:

  • browse
  • design
  • make-pdf

If the bundled executable cannot be launched (for example, when blocked by Windows Smart App Control), the resolver automatically falls back to:

bun run <tool>/src/cli.ts

This ensures the tools remain functional without requiring users to disable Windows security features.

Documentation

Updated:

  • README.md
  • CLAUDE.md

with Smart App Control troubleshooting and fallback behavior.


Testing

Automated Verification

  • ✅ All existing tests pass (434/434)
  • ✅ Resolver generator tests pass
  • ✅ Skill documentation regenerated successfully
  • ✅ Generated SKILL.md files verified

Current Coverage

Covered

  • Binary discovery
  • Standard resolver path resolution
  • Resolver generation

Remaining Test Gaps

The following Windows-specific scenarios are not currently covered by automated tests:

  • .exe discovery on Windows
  • Smart App Control blocking bundled executables
  • Automatic Bun fallback after execution failure

These scenarios require Windows-specific behavior that is difficult to reproduce reliably in the existing cross-platform test environment.


Backward Compatibility

This change is fully backward compatible.

  • Existing behavior is unchanged on macOS and Linux.
  • Existing behavior is unchanged on Windows when bundled executables can be launched normally.
  • Windows systems affected by Smart App Control automatically use the Bun-based fallback.

Test Plan

  • All existing tests pass (434/434)
  • Resolver generator tests pass
  • Generated SKILL.md files verified
  • Documentation updated
  • Manual verification of generated resolver output

Copilot AI review requested due to automatic review settings June 28, 2026 11:20
@trunk-io

trunk-io Bot commented Jun 28, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Addresses Windows 11 Smart App Control (SAC) blocking Bun-produced unsigned tool executables by updating resolver discovery to prefer .exe on Windows and adding runtime validation with automatic fallback to running the TypeScript CLIs via bun run.

Changes:

  • Updated resolver generators (scripts/resolvers/*) to prefer .exe on Windows and to fall back to bun run <tool>/src/cli.ts when the compiled binary can’t execute.
  • Regenerated multiple SKILL.md files to include the new setup/validation logic.
  • Bumped version and updated user-facing documentation (README/CLAUDE/CHANGELOG) to describe SAC behavior and troubleshooting.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
VERSION Bumps repo version to 1.58.6.0.
package.json Bumps npm package version to 1.58.6.0.
CHANGELOG.md Adds 1.58.6.0 release notes describing SAC fallback behavior.
README.md Documents Windows SAC behavior and Bun fallback in the Windows note.
CLAUDE.md Adds SAC + Git Bash troubleshooting and explains fallback mechanism.
browse/bin/find-browse Updates Windows discovery to include .exe resolution (plus shim delegation).
scripts/resolvers/browse.ts Generates updated browse setup block (prefer .exe, validate, Bun fallback).
scripts/resolvers/design.ts Generates updated design + embedded browse setup blocks with fallback.
scripts/resolvers/make-pdf.ts Generates updated make-pdf setup block (prefer .exe, validate, Bun fallback).
browse/SKILL.md Regenerated setup block to prefer .exe and fall back to bun run when blocked.
make-pdf/SKILL.md Regenerated setup block to prefer .exe and fall back to bun run when blocked.
benchmark/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
canary/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
devex-review/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
design-consultation/SKILL.md Regenerated browse/design resolver setup blocks with .exe preference and Bun fallback.
design-html/SKILL.md Regenerated browse/design resolver setup blocks with .exe preference and Bun fallback.
design-review/SKILL.md Regenerated browse/design resolver setup blocks with .exe preference and Bun fallback.
design-shotgun/SKILL.md Regenerated browse/design resolver setup blocks with .exe preference and Bun fallback.
land-and-deploy/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
office-hours/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
open-gstack-browser/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
pair-agent/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
plan-design-review/SKILL.md Regenerated browse/design resolver setup blocks with .exe preference and Bun fallback.
qa/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
qa-only/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.
setup-browser-cookies/SKILL.md Regenerated browse resolver setup block with .exe preference and Bun fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +122 to +126
if command -v bun >/dev/null 2>&1 && [ -f "\$_ROOT/${ctx.paths.localSkillRoot}/browse/src/cli.ts" ]; then
B="bun run \$_ROOT/${ctx.paths.localSkillRoot}/browse/src/cli.ts"
B_OK=1
elif command -v bun >/dev/null 2>&1 && [ -f "\$HOME${ctx.paths.browseDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts" ]; then
B="bun run \$HOME${ctx.paths.browseDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts"
Comment on lines +808 to +812
if command -v bun >/dev/null 2>&1 && [ -f "\$_ROOT/${ctx.paths.localSkillRoot}/design/src/cli.ts" ]; then
D="bun run \$_ROOT/${ctx.paths.localSkillRoot}/design/src/cli.ts"
D_OK=1
elif command -v bun >/dev/null 2>&1 && [ -f "\$HOME${ctx.paths.designDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts" ]; then
D="bun run \$HOME${ctx.paths.designDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts"
Comment on lines +36 to +40
if command -v bun >/dev/null 2>&1 && [ -f "\$_ROOT/${ctx.paths.localSkillRoot}/make-pdf/src/cli.ts" ]; then
P="bun run \$_ROOT/${ctx.paths.localSkillRoot}/make-pdf/src/cli.ts"
P_OK=1
elif command -v bun >/dev/null 2>&1 && [ -f "\$HOME${ctx.paths.makePdfDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts" ]; then
P="bun run \$HOME${ctx.paths.makePdfDir.replace(/^~/, '').replace(/\/dist$/, '/src')}/cli.ts"
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.

2 participants