Skip to content

Release: the developer modes only in a build that asks for them - #127

Merged
dinooo13 merged 2 commits into
mainfrom
fan-out/124-release-no-dev-modes
Nov 25, 2026
Merged

dinooo13 merged 2 commits into
mainfrom
fan-out/124-release-no-dev-modes

Conversation

@dinooo13

Copy link
Copy Markdown
Owner

The problem

--overlay-demo and --screenshots (with --settings, --settings-scene, --menu, --managed and the rest) are compiled into every build today, the notarised DMG included. They run on stand-ins and a scratch settings file and are safe, but a shipped app should carry no demo mode.

The fix

The two modes are opt-in: OverlayDemo.swift, Screenshots.swift and the branch of PladderApp.init that reads them compile only with -Xswiftc -DPLADDER_DEV_MODES. swift build, swift run, swift test, Xcode, a plain scripts/bundle.sh and bundle.sh --release have neither mode and read no argument of their own. Only the two scripts that need the modes set the define: make-screenshots.sh through a new bundle.sh --dev-modes, and overlay-demo.sh in its own swift build. Both build in .build/dev-modes, because a changed define recompiles every module. --dev-modes refuses --release and --install.

Opt-in rather than opt-out, so a lost flag shows in the two scripts instead of in a shipped app. Not #if DEBUG, because make-screenshots.sh shoots the release-configuration bundle with its Info.plist, German strings and no Echo engine. CI's build-and-test action builds and tests as before, without the define, then rebuilds with it, checks its warnings and runs the new DeveloperModeTests, so the modes' code cannot rot unbuilt. CLAUDE.md gets a Decisions row and --dev-modes in Commands.

Nothing between recordingStopped and inserted changes, so no benchmark.

How it was proved

  • scripts/bundle.sh --release, Developer ID signed: nm finds 0 OverlayDemo/Screenshots symbols (3,208 other Pladder symbols). The bare binary, with a scratch PLADDER_SETTINGS_PATH and another chord, launched with --overlay-demo and with --screenshots <dir> --settings-scene --managed, ran as the normal app for over a minute and wrote nothing. Stopped with pkill -f "$PWD/dist/Pladder.app".
  • scripts/make-screenshots.sh wrote styles-light.png and styles-dark.png (looked at), and scripts/overlay-demo.sh wrote demo.log and six contact sheets (sheet-plain.png looked at). The dev-modes binary has 118 mode symbols.
  • swift build --build-tests with no source warnings and swift test pass without the define; with it, no source warnings and DeveloperModeTests 4/4. shellcheck, actionlint, check-doc-pointers.sh clean.
  • Build times: first release build in .build/dev-modes 115 s; a plain bundle.sh right after it 0.55 s of compiling, so the two builds never rebuild each other.

Review loop

Reviewer Round 1 Round 2
Claude Opus 5.5 (xhigh) CHANGES APPROVE
Kimi K3.1 Pro (max) APPROVE APPROVE

Round 1's finding: CI built only with the define, so a pull request never compiled the configuration that ships. Fixed with the separate step above; two nits fixed too.

Not in this PR

The seams only the modes use (SettingsLocation.scratch, SettingsView.requestedTab, AppModel.reviewShowsGetStarted, the readPolicy: parameter) stay unguarded; nothing reaches them without the entry point. The [--speed …] on overlay-demo.sh's Commands line is stale from before; #123 fixes it.

Closes #124

🤖 Generated with Claude Code

dinooo13 and others added 2 commits November 25, 2026 19:54
--overlay-demo and --screenshots, with their companion flags, now compile
only under PLADDER_DEV_MODES. scripts/make-screenshots.sh sets it through
bundle.sh --dev-modes, scripts/overlay-demo.sh directly, both in
.build/dev-modes; every other build, the release included, has neither.
CI builds and runs the tests with the define, and a new test covers the
flag parsing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinooo13
dinooo13 merged commit eb8b5de into main Nov 25, 2026
4 checks passed
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.

Keep --overlay-demo and --screenshots out of the release build

1 participant