Skip to content

fix(render): keep Aside recovery advice on macOS only (#3735) - #4122

Closed
szsunyuan wants to merge 2 commits into
garrytan:mainfrom
szsunyuan:fix/3735-platform-browser-help
Closed

szsunyuan wants to merge 2 commits into
garrytan:mainfrom
szsunyuan:fix/3735-platform-browser-help

Conversation

@szsunyuan

Copy link
Copy Markdown
Contributor

Why (in your own words)

When neither browser is available, Linux and Windows users are told to open the Aside app even though Aside is macOS-only. The same shared help reaches the renderer's missing-browser errors and make-pdf's setup/error flow. Keep the supported recovery advice on every host and offer Aside only on macOS.

Fixes #3735. #3734 already made the Aside probe skip non-macOS hosts; this fixes the help text it explicitly deferred, without changing that probe.

Validation is in progress. This PR is being opened before the full free suite and selected paid probe run. The focused results below are not full shipping acceptance; please hold merging until the remaining checks finish.

Why this shape

The issue asks to show only the setup advice off macOS. The condition belongs in the existing NO_BROWSER_HELP export, so both renderer error paths and the PDF consumers receive the correction. No new helper, production test seam or API is needed.

CONTRIBUTING's wave process prefers the smaller change when two PRs solve the same thing. This is five files against main at 6cf00aee9, with one shared production fix, targeted regressions and a changelog fragment. Fine to absorb into a wave.

What it does

  • Linux and Windows retain the ./setup and GSTACK_BROWSE_BIN remedies, without the instruction to open Aside.
  • macOS retains both recovery options, with the same message as before.
  • Isolated child-process tests cover Linux, Windows and macOS through the exported help, pickEngine's no-engine error and renderWithBrowse's no-binary error.
  • PDF tests check the shared help instead of requiring macOS-only advice on every host.

What it deliberately does not do

  • No changes to browser probing, engine selection, installation, rendering or fallback behavior.
  • No new exports, configuration flags, dependencies or generated files.
  • No VERSION, package-version, released CHANGELOG.md, README or ETHOS edits. The only release documentation is changelog.d/fix-3735-platform-browser-help.md.
  • No /ship workflow changes or manual version stamp; the repository's merge/release process assigns the version.

Live evidence

The native-Linux reproduction uses the real renderer functions with the existing no-binary seams. It does not launch a browser or write renderer output. Bun 1.4.0 on Linux. The Windows/macOS regression cases simulate process.platform in separate child processes; they are not native Windows/macOS runs.

Reproduce the base and branch messages:

BASE_DIR=$(mktemp -d /tmp/gstack-3735-before.XXXXXX)
git show 6cf00aee9c0fdedc722f35c1f0032c3db9404104:lib/aside-render.ts > "$BASE_DIR/aside-render.ts"
for SPEC in "BEFORE|$BASE_DIR/aside-render.ts" "AFTER|$PWD/lib/aside-render.ts"; do
  LABEL=${SPEC%%|*}
  MODULE=${SPEC#*|}
  printf '\n%s (native Linux, no browse binary)\n' "$LABEL"
  bun --no-env-file --no-load-bunfig -e '
    const M = await import(process.argv[1]);
    const choice = M.pickEngine(true, { probe: () => M.probeAside(), resolveBin: () => null });
    if (choice.engine !== null) throw new Error("expected no engine");
    console.log(choice.error);
    const fallback = await M.renderWithBrowse({ file: "/nonexistent/x.html", steps: [] }, null);
    console.log(fallback.error);
  ' "$MODULE" || exit
done

Actual output:

BEFORE (native Linux, no browse binary)
no browser available: open the Aside app (macOS 15+, aside.com), or run ./setup in the gstack repo to build gstack's own headless browser (or point GSTACK_BROWSE_BIN at a browse binary) (NEEDS_ASIDE: Aside is macOS-only (this is linux))
no browser available: open the Aside app (macOS 15+, aside.com), or run ./setup in the gstack repo to build gstack's own headless browser (or point GSTACK_BROWSE_BIN at a browse binary)

AFTER (native Linux, no browse binary)
no browser available: run ./setup in the gstack repo to build gstack's own headless browser (or point GSTACK_BROWSE_BIN at a browse binary) (NEEDS_ASIDE: Aside is macOS-only (this is linux))
no browser available: run ./setup in the gstack repo to build gstack's own headless browser (or point GSTACK_BROWSE_BIN at a browse binary)

The regression test also failed before changing the production code:

$ bun --no-env-file --no-load-bunfig test test/aside-render-help.test.ts
...
(fail) missing-browser advice offers only supported remedies on linux [79.22ms]
...
(fail) missing-browser advice offers only supported remedies on win32 [71.35ms]

 1 pass
 2 fail
 24 expect() calls
Ran 3 tests across 1 file. [301.00ms]

After the fix:

$ bun --no-env-file --no-load-bunfig test test/aside-render-help.test.ts

 3 pass
 0 fail
 36 expect() calls
Ran 3 tests across 1 file. [310.00ms]

Scope

  • Changed: five files, +48/-4: lib/aside-render.ts (+3/-1), test/aside-render-help.test.ts (+39), make-pdf/test/asideClient.test.ts (+1/-1), make-pdf/test/setup-smoke.test.ts (+2/-2), and the changelog fragment (+3). No VERSION, released CHANGELOG or generated-file changes.
  • Verified live by: the before/after production-function reproduction above; regression tests red before the fix and green afterward; the focused checks below; strict product typecheck; test-type ratchet (812 known diagnostics, none new); git diff --check; outgoing staged-diff redaction scan with zero findings.
  • Did NOT test: full free acceptance, the selected paid probe, native Windows/macOS execution, or a full /ship review/verification run. Four real-browser renderer cases and one macOS-only CLI case were skipped. The live fallback daemon did not start on this machine; those cases receive no pass credit.

Focused checks already run, each test file in its own process with umask 022 and bun --no-env-file --no-load-bunfig test <file>:

Test file Pass Skip Fail
test/aside-render-help.test.ts 3 0 0
test/aside-render.test.ts 70 4 0
test/gstack-render-cli.test.ts 26 0 0
make-pdf/test/setup-smoke.test.ts 9 0 0
make-pdf/test/asideClient.test.ts 15 0 0
make-pdf/test/cli-exit-codes.test.ts 13 1 0
test/spawnsync-timeout-tripwire.test.ts 3 0 0
Total 139 5 0

Liveness proof (required for external contributors)

image

Checklist

  • Liveness screenshot attached (GSTACK PR typed live into a real surface).
  • This is not a generated-file-only diff; the source is changed and no generated outputs apply.
  • No ETHOS.md edits, and no changes to voice / founder perspective / YC references.
  • New public command / external service / host adapter has an accepted issue linked: N/A.
  • Linked issue and reproduction: Deferred review finding: lib/aside-render.ts:659 — error-message #3735.

Test plan

  • Show Linux/Windows regression failures and the passing macOS control before the production fix.
  • Verify all three platform cases after the fix and preserve both renderer error paths.
  • Run the focused renderer, CLI and PDF checks: 139 pass, 5 skip, 0 fail.
  • Run product typecheck and the test-type debt ratchet.
  • Scan the outgoing diff for credentials and check whitespace.
  • Run bun run test on the final integrated code after opening this PR.
  • Complete the selected paid diagram-triplet probe through bun run eval:bg:pr, or record the maintainer-run fork-PR coverage.
  • Complete the remaining shipping reviews/verification before merging.

diagram-authoring-quality and safety-design-risk-stop were deferred by the PR selection profile to scheduled/release coverage; neither ran and neither receives PR-pass credit. Fork PRs do not receive upstream eval secrets, so skipped paid jobs are not passes and maintainer coverage is still required before merge.

Fixes #3735.

Linux and Windows cannot run Aside, but missing-browser errors still
asked users to open it. Keep the shared help export and headless-browser
remedies, adding the Aside suggestion only on macOS.

Cover Linux, Windows and macOS through both renderer error paths and
update the PDF consumer expectations.

Fixes: garrytan#3735

Co-Authored-By: Claude Code <[email protected]>
@trunk-io

trunk-io Bot commented Nov 7, 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

The test-layout ratchet cannot see the production import inside the
standalone test's child-process script. Move the three platform cases
into the existing renderer owner suite and reuse its subprocess driver.

Keep the same exported-help and renderer error-path assertions without
adding a baseline exception or weakening the guard.

Refs: garrytan#3735

Co-Authored-By: Claude Code <[email protected]>
@capy-ai

capy-ai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Thank you, this is a clean fix for #3735, and the before/after output makes it easy to check. I've put it on the crew's pick-up list. If it lands, the crew will rebuild it on current main with Co-authored-by credit to you, and we'll note it here.

capy-ai Bot added a commit that referenced this pull request Nov 7, 2026
…kills.md vision-model line (#3375) (#4131)

* fix(render): offer the Aside remedy only on macOS (#3735)

NO_BROWSER_HELP told Linux and Windows hosts to open the Aside app, which
ships only for macOS. noBrowserHelp(platform) now adds the Aside remedy on
darwin only and keeps the ./setup and GSTACK_BROWSE_BIN remedies everywhere.
Also corrects docs/skills.md's /design-html refinement loop, which still said
"Uses GPT-4o vision", to match the design-html template (#3375).

Rewritten on main from outside PR #4122.

Co-authored-by: szsunyuan <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore(changelog): name the #3735 fragment after the branch

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: szsunyuan <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai

capy-ai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Thanks, @szsunyuan. We rewrote this change on main and landed it in #4131 (9b491bb), with you credited as co-author. Closing this one in favor of that. It will ship in the next gstack release after 1.98.0.0.

@capy-ai capy-ai Bot closed this Nov 7, 2026
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.

Deferred review finding: lib/aside-render.ts:659 — error-message

1 participant