Skip to content

Add the R8 operator lever: V2Primary defaults key routes the app at the migrated v2 store#142

Merged
MaxGhenis merged 1 commit into
mainfrom
r8-v2-primary-lever
Jul 18, 2026
Merged

Add the R8 operator lever: V2Primary defaults key routes the app at the migrated v2 store#142
MaxGhenis merged 1 commit into
mainfrom
r8-v2-primary-lever

Conversation

@MaxGhenis

Copy link
Copy Markdown
Owner

R8 flip lever

The wrapper's env map is fixed and Foundation Process replaces the child env wholesale — so v2-primary had no operator path on a real install. This adds one:

defaults write com.openmessage.app V2Primary -bool true   # flip
defaults delete com.openmessage.app V2Primary             # rollback (next launch)
  • Lever ON → exactly one added env var (OPENMESSAGES_V2_PRIMARY=1); backend refuses primary if <dataDir>/v2 is missing (fails loudly on unmigrated installs).
  • Lever OFF → environment byte-identical to the shipped contract, pinned by a full-map equality test.
  • swift test: 10 executed, 0 failures.

Part of the R8 cutover Max authorized; the live store is already migrated and gate-passed (passed: true, 62,501/62,501 msgs, 9,441/9,441 reactions).

🤖 Generated with Claude Code

…he migrated v2 store

The Swift wrapper constructs the backend's environment from a fixed map, so
there was no way to select v2-primary on a real install without editing code
(Foundation Process replaces the child environment wholesale, so a GUI-session
launchctl setenv never reaches the daemon).

`defaults write com.openmessage.app V2Primary -bool true` now adds
OPENMESSAGES_V2_PRIMARY=1 to the backend launch environment; deleting the key
rolls back to the legacy store on next launch. The backend refuses primary
mode when <dataDir>/v2 is missing, so setting the key on an unmigrated
install fails loudly rather than silently serving an empty store.

The lever off leaves the environment byte-identical to the shipped contract,
pinned by a test comparing the full map.
@MaxGhenis
MaxGhenis merged commit 512f297 into main Jul 18, 2026
9 of 10 checks passed
@MaxGhenis
MaxGhenis deleted the r8-v2-primary-lever branch July 18, 2026 20:07
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