Draft
Conversation
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rewrite babble as a clean Ruby application
Rewrite babble as modular Ruby application
Feb 12, 2026
8 tasks
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.
Replaces ksh implementation with clean Ruby architecture that orchestrates Homebrew, Mac App Store, and macOS system upgrades. Eliminates config duplication and fixes validation bugs from prototype.
Architecture
Entry flow: Bash wrapper (
bin/babble) loads brew.env files, sources Homebrew'sutils/ruby.shfor portable Ruby, execs orchestrator.Module structure:
Swift GUI: Auto-compiled on first use, cached to
~/.cache/babble/quit_alert. Supports dark/light mode via embedded base64 SVG icons.Config Example
Fixes
existing_value/new_valuereferenced wrong block/[a-z0-9_.-]+(?:\.[a-z0-9_.-]+)+/i(nested quantifiers) with non-backtracking patterncontinuation_messageparameter to eliminate duplicate "Continuing..." outputStandards
All Ruby modules use
typed: strictandfrozen_string_literal: true. Zero commented-out code. Shared constants extracted (CACHE_DIR).Original prompt
Overview
Rewrite babble as a clean, modular Ruby application that orchestrates upgrades for Homebrew (formulae + casks), Mac App Store apps, and macOS system updates. This replaces the current ksh implementation on
mainwith a new Ruby-based architecture.The existing prototype on the
refactor/modularbranch should be used as reference for understanding intent, but the implementation should be clean — no commented-out code, no debug prints, no duplicated modules.Key Design Decisions
Architecture
bin/babble): Loadsbrew.envfiles, sources Homebrew'sutils/ruby.shto findHOMEBREW_RUBY_PATH, thenexecs the Ruby orchestrator. This pattern is essential and must be preserved faithfully from the prototype'srefactor/bin/babble_claude_main.lib/babble/with clear separation of concerns.xcrun swiftcand cached locally. No pre-built binaries shipped — macOS will refuse to run unsigned/unnotarized distributed binaries.Module Structure
lib/babble/config_manager.rbBrewUpgradeandMasUpgrademodules.lib/babble/brew_upgrade.rbbrew outdated --json=v2), quit-before-upgrade,brew upgrade, reopen-after-upgrade. Delegates config toConfigManager, app lifecycle toAppManager.lib/babble/mas_upgrade.rbmas outdated, quit-before-upgrade,mas upgrade, reopen. Same delegation pattern.lib/babble/macos_update.rbsoftwareupdatewrapper.lib/babble/app_manager.rblsappinfo), quit (via JXA/osascript), invoke Swift GUI forunsafe_to_quitapps, reopen (viaBundleLauncher).lib/babble/bundle_launcher.rbNSWorkspace.openApplication→launchctl asuserfallback →lsregisterre-registration. Based on prototype'sMacUtils::BundleLauncher.lib/babble/quarantine_purger.rbQuarantinePurger.lib/babble/waiter.rblib/babble/orchestrator.rbEntry Points
bin/babblelib/babble/cli.rbConfiguration
The unified YAML config file (
config/apps.yml) defines apps with their bundle IDs, unsafe_to_quit flags, and quit_messages. Structure from prototype:Swift Quit Alert GUI
swift/src/quit_alert.swift— NSAlert with dark/light mode SVG icons (base64 encoded), localized Cancel/Continue buttonsxcrun swiftcon first use, cached to~/.cache/babble/quit_alert(or$XDG_CACHE_HOME/babble/)Waiter Improvements
The
Waiter.waitermethod must accept a custom continuation message parameter:This eliminates duplicate/misleading messages. Callers pass context-appropriate strings:
Waiter.waiter("run_command", continuation_message: "Upgrading outdated packages...")Waiter.waiter("run_command", continuation_message: "Checking for outdated packages...")Waiter.waiter("next_section", continuation_message: "Proceeding to Mac App Store upgrades...")Message Flow Fix
The prototype shows duplicate messages. The correct flow:
Preparing to upgrade all outdated packages...→ Run command: Press Space bar to continue, or Ctrl-C to exit.This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.