Skip to content

tray: rebuild and restart the dev app from the tray - #411

Merged
m4ttheweric merged 16 commits into
mainfrom
dev-app-restart
Sep 24, 2026
Merged

m4ttheweric merged 16 commits into
mainfrom
dev-app-restart

Conversation

@m4ttheweric

Copy link
Copy Markdown
Collaborator

Dev app: rebuild and restart from the tray

Iterating on mattstack-dev meant a terminal build and a hand swap into /Applications. Modeled on flock's "New build · Restart": build any repo-tools tree from the tray, then restart into it with one click.

What changed

Build and stage (scripts/build-dev-app.ts --local, lib/release/dev-app-stage.ts)

  • builds the working tree (uncommitted changes included) in a scratch copy and stages it at ~/.mattstack/rt/dev-app/staged/, only ever by whole-dir renames
  • build.sh dev writes MSBuildStamp (time, sha, +dirty, tree)

Tray (dev flavor only)

  • DevBuildWatcher watches the staging dir and compares stamps (read from disk)
  • menu: Rebuild (tree) and a grouped Rebuild from ▸ (main checkout, 5 recent, More ▸; list from the daemon's worktree:list, merged/closed/disposable trees skipped); a ready build replaces both with New build · Restart
  • menu bar: a filled dev pill plus building… / new build ready / build failed; the window tab bar mirrors it with a pill
  • restart hands off to a detached script: wait for exit, swap by rename with rollback, reopen, kickstart deck, then deck restart --managed

Also

  • the --ref rebuild path restarts deck's managed apps too; a swap left them running the deleted bundle's Helpers/bun, which lost its Documents grant (EPERM)

Tests

mattstack-checks 336/336 (handoff script run for real in temp dirs: swap, rollback, stale aside, unwritable log, waits for exit, single managed restart); release and script tests 254/254. Live: rebuilt and restarted the dev app from the tray several times; managed apps came back on the new bundle.

🤖 Generated with Claude Code

m4ttheweric and others added 14 commits September 24, 2026 11:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tart

build.sh dev writes MSBuildStamp (time, sha, +dirty, tree) when given one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev flavor watches ~/.mattstack/rt/dev-app for a staged build whose
stamp differs from its own; the tray menu and a pill in the window's tab
bar restart into it through the DevBuild handoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A swapped-out bundle leaves managed apps running a deleted Helpers/bun,
which loses its Documents grant (EPERM); the handoff and the --ref
rebuild now restart deck's managed apps after the deck helper.

Also: staging retires the old staged dir by rename; an unstamped running
app still offers a staged build; the aside copy is guarded against the
mv-into-dir trap; the handoff logs to dev-app-restart.log; Restart is
hidden while a rebuild runs; the menu re-checks on open; prod guards;
build errors keep stdout; Rebuild hides when its worktree is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etry loop

restart --managed fails when any one app fails, so retrying it re-killed
every healthy app; poll deck list until it answers, then restart once.
Also: an unwritable handoff log no longer kills the handoff, and a staged
dir that cannot be retired fails staging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list comes from the daemon's worktree:list (repo-tools trees only),
so the dev app never reads the checkouts itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e build log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le the daemon starts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…marked disposable

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y label

Orange text washed out on the translucent menu bar over light wallpapers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 83 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: dfd8f78e-12a4-4ec9-9b90-fdb9fc5e4a6b

📥 Commits

Reviewing files that changed from the base of the PR and between b0ab4c6 and 8a26751.

📒 Files selected for processing (18)
  • lib/release/__tests__/dev-app-stage.test.ts
  • lib/release/__tests__/update-machine.test.ts
  • lib/release/dev-app-stage.ts
  • lib/release/update-machine.ts
  • rt-tray/Sources-core/Services/DevBuild.swift
  • rt-tray/Sources-core/Services/RebuildSources.swift
  • rt-tray/Sources/AccessibilityIDs.swift
  • rt-tray/Sources/AppDelegate.swift
  • rt-tray/Sources/DaemonClient.swift
  • rt-tray/Sources/DevBuildWatcher.swift
  • rt-tray/Sources/TrayState.swift
  • rt-tray/Sources/Window/MattstackWindowView.swift
  • rt-tray/Tests/MattstackCoreChecks/AllChecks.swift
  • rt-tray/Tests/MattstackCoreChecks/DevBuildChecks.swift
  • rt-tray/Tests/MattstackCoreChecks/RebuildSourcesChecks.swift
  • rt-tray/build.sh
  • scripts/build-dev-app.ts
  • skills/rt-build-dev-app/SKILL.md

Comment @coderabbitai help to get the list of available commands.

m4ttheweric and others added 2 commits September 24, 2026 11:33
…ttons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… empty submenu, build timeout, skill trigger)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m4ttheweric
m4ttheweric merged commit 0f170a0 into main Sep 24, 2026
6 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.

1 participant