ChannelConfig and BulkConfig carry MacCipherScheme; a change to it reopens
every connection the way a key change does. PeerConnection reads the
scheme's preamble length (16 legacy, 48 modern) instead of a hard-coded 48.
The diagnostic: the peer's opening bytes are kept until one packet has
framed. If the first packet fails framing under the configured scheme and
the same raw bytes frame under the other one, the connection closes with
.invalidKey(.cipherSchemeMismatch) and reports status
.cipherSchemeMismatch, so the menu names the setting to change rather than
blaming the security key. Costs one AES setup on a connection that was
going to fail anyway, and nothing at all on success.
The bulk channel needs no diagnostic: a transfer only starts with a peer
whose control connection already framed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- MWBMac/Awake.swift: DisplayAwake renews an IOPMAssertion
(PreventUserIdleDisplaySleep, 90 s timeout) on every Awake (21), the
macOS answer to Common.HumanBeingDetected/PokeMyself
(Receiver.cs:244-249, Common.cs:561-591) without posting input.
- MWBMac/Fullscreen.swift: the frontmost app's excluded-apps test and a
covers-a-whole-display window check, cached 250 ms; gated in the
Engine by IsEasyMouseSwitchAllowed's two early outs
(Common.cs:1638-1650), so it is asked only on the edge path.
- MWBMac/FakeCursor.swift: CursorOverlay draws NSCursor.arrow at the
last injected position (Receiver.cs:186-188) and hides on park, local
input and shutdown (Common.cs:1495, InputHook.cs:256-264); FakeCursor
coalesces the main-thread hops.
- Settings.drawMouseCursor accessor + the Behaviour-pane toggle,
answering app-ui's open request.
- UIBridge.TransferNotices wires ClipboardAction.note to the Notifier,
answering clipboard's open request (Clipboard.cs:610-618, 869-881, 916).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Clipboard.cs:111-114 nulls LastClipboardData and LastDragDropFile before it
looks at the new clipboard, so a branch that decides not to share leaves
nothing for a peer to pull. FormHelper.cs:204-210 and :287 refuse text over
20 MB and images over 50 MB at the reader.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A 1 MB payload is 21 846 packets. Handing them to ControlChannel.forward in
one loop overruns the 512-packet outbox (contracts C3), which closes the
connection, and puts a second of clipboard traffic ahead of the next mouse
packet. Windows paces naturally because SendClipboardDataUsingTCP writes
each packet down a blocking socket from its own thread (Clipboard.cs:260-305).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
ClipboardBridge ports CheckClipboardEx (Clipboard.cs:85-251), the in-band
chunking and reassembly (253-373), GetRemoteClipboard (377-449) and the
clipboard cases of Receiver.cs (273-380) and Event.cs (219-231). It is held
by the Engine actor and returns [ClipboardAction] the way Switcher returns
[SwitchAction]; ClipboardRelay is the Sendable sink the bulk channel and the
pasteboard watcher call.
Engine.swift: the bridge property and the authorised dispatch cases. Four
further lines (Engine.start/stop, EngineActions.applyConfiguration and the
.remoteClipboardWanted case) are beyond the letter of the brief and are
flagged in the feature README's Handshakes for the lead to rule on.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- Resources/Info.plist: NSSupportsSuddenTermination = false, so nothing
can skip applicationWillTerminate (invariant 3, contracts C2). That is
the only bundle change notifications and login items turned out to
need; the work log says what else was checked.
- docs/features/app-ui/README.md: Assumptions brought in line with what
shipped, Handshakes replaced with the real API (five deviations, all
reasoned), one open request to app-engine for a DrawMouseCursor
accessor, Status/TODO ticked, work log.
- TODO.md §7: three lines ticked; CP1 left for the lead.
- UIBridge: dropped an unused openSettings entry point.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- UIBridge remembered only the lowercased key of a peer, so a "Lost X"
notification for a row that vanished printed the name in lower case;
and the spelling map was built with Dictionary(uniqueKeysWithValues:),
which traps when a peer pair has two connections carrying one name.
- SettingsWindowController.show() refreshed the drafts unconditionally,
so opening the Advanced pane from the menu threw away a half-typed
security key. It now refreshes only when the window was not visible.
- StatusItem: dropped the unused StatusModel.hasProblem and the dead
fill/size argument in the icon drawing.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The real user interface, replacing app-engine's placeholder status item.
- MWBMac/StatusItem.swift: NSStatusItem with a code-drawn icon, the
documented status colours (doc/devdocs/modules/mousewithoutborders.md)
and the menu the Windows tray menu offers (frmScreen.Designer.cs:91-180).
- MWBMac/SettingsWindow/*: one NSWindow hosting a SwiftUI TabView with six
panes; every property in README §Settings is reachable. Labels and help
text taken from MouseWithoutBordersPage.xaml + Resources.resw, cited per
file.
- MWBMac/Notifications.swift, LaunchAgent.swift: UNUserNotificationCenter
and SMAppService.mainApp, both guarded on a bundle identifier.
- mwb/UIBridge.swift: EngineSnapshot -> StatusModel, clicks -> Engine, and
the connected/lost/invalid-key notification diff.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cross-lane edit, authorised by the lead. The struct declared two public
lets and no init, so the memberwise one was internal and no other target
could build a value — `EngineSnapshot.permissions` had to default to
`Permissions.preflight()`, i.e. a TCC query, just to have a value to
hold. The default is now `PermissionState(listen: false, post: false)`,
which is also the honest value before `start()` has read anything.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
QA finding 3. contracts C2's last row promises the sockets send `ByeBye`
however the process ends, and the signal path only released the keys and
the pointer. `ControlChannel` is `Sendable` and each of its methods hops
to its own serial queue, so the handler can hold the channel and queue
the goodbye itself without waking the Engine actor — which the header
comment on `EmergencyRelease` forbids, and rightly. The 150 ms wait
afterwards is the same grace `Engine.stop()` gives the packet
(`InitAndCleanup.cs:192-215`); it is best effort, and it runs after the
keys are already back.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
QA finding 2. `Helper.HelperThread` releases once `NewDesMachineID ==
MachineID` (`Helper.cs:120-123`) and its event is set by both
`SwitchToMachine` (`MachineStuff.cs:1024`) and `PrepareToSwitchToMachine`
(`Event.cs:203`), so Windows releases on the `ByeBye`, edge-crossing and
`NextMachine` paths too — we only did on the hotkey, the broadcast
toggle and `recoverLocal`. The tail of `perform(_ actions:)` now covers
all of them, gated on the destination actually moving so that a switch
which leaves control local (a matrix edit while a peer drives this Mac)
cannot drop that peer's held modifiers.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The 5 s health check already had to notice Input Monitoring being
revoked (contracts C2). Noticing it being granted and retrying
EventTap.start() means a first run does not have to be restarted after
the user ticks the box in System Settings.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
§10.6 records six things the Windows source says that §1-§9 did not:
that a switch moves the pointer only when the target is the local
machine (Helper.cs:75-127), that a Mouse packet addressed to us takes
control back by assignment rather than by switching (Receiver.cs:122-125),
that relative mode puts the edge detection on the controlled machine
(Receiver.cs:147-172), that the reconnect countdown is 30 s and gated on
"no socket established" (frmScreen.cs:425-449), the exact JSON shapes of
the settings file, and why Heartbeat has to be a 64-byte packet.
The README's Handshakes section now documents the API as shipped, six
deliberate deviations, the answers to all eleven open requests from
lanes 3-5, and four new requests: PacketSequencer is used from two
queues and is not thread-safe (session-matrix), PermissionState has no
public initialiser and Cursor publishes no pointer position
(input-capture), and there is no way to send a Heartbeat on demand
(control-channel).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Engine.swift is the actor contracts C3 names: it owns the Switcher, the
sequencer, the replay filter, the channel, the tap, the routing state,
the capture ring, the injector, the cursor and the screens, and it is
the only thing that stamps an Id (contracts C1). Every callback — the
channel's sink, the tap's wake-up, the timers, the workspace and
settings observers — funnels through one AsyncStream so four queues are
serialised once instead of racing as free Tasks. `dispatch` is the port
of Receiver.ProcessPackage (Receiver.cs:86-390), long on purpose.
EngineActions.swift performs [SwitchAction] (MachineStuff.cs:1008-1050,
Helper.cs:73-127), the hotkeys (InputHook.cs:516-655) and the mapping
from Settings onto every lane's config struct (contracts C4).
Recovery.swift is contracts C2 end to end: escape hotkey, controlled
peer lost, tap lost, capture overflow, revoked permission, quit — each
ending in route-local, releaseAll and a pointer that is coupled again —
plus the reopen countdown (frmScreen.cs:427-450).
AppLifecycle.swift is the process: flock single instance, the
LSUIElement NSApplication with a placeholder status item, the
DispatchSourceSignal + atexit emergency release, and hostname
validation (README D7).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Four targets (MWBCore, MWBNet, MWBMac, mwb) with a layering test that
keeps MWBCore free of AppKit/CoreGraphics/Network; tools/gates.sh as the
definition of done; tools/bundle.sh producing a signed dist/mwb.app;
tools/lane.sh for lane worktrees; smoke binary with --version and
--check-permissions. docs/loop.md records the Dev -> QA -> lead loop with
the literal dispatch prompts, the wave schedule and escalations.
Co-Authored-By: Claude Fable 5.1 <[email protected]>