Adopt the user's development rule: one lane at a time, no test suites
CLAUDE.md gains a 'How this project is developed' section: strictly serial Dev (Opus 5) -> QA (Sonnet 5, code quality) -> lead inspection; commit along the way without requiring every commit to compile; the user is the tester. docs/loop.md, docs/topo.md and TODO.md are rewritten to a serial lane order with no test-writing items; the test targets are removed and tools/gates.sh is lint + layering grep + build. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
671b3dfa61
commit
87aeee6f93
15 files changed
+391
-617
No files matched your search
@@ -19,16 +19,16 @@ WinForms UI. Read-only.
|
||||
## Status
|
||||
|
||||
2026-09-15: bootstrap merged — the SwiftPM skeleton builds, the gates
|
||||
are green, `mwb --version` / `--check-permissions` run. Wave 1
|
||||
(`packet-codec` ‖ `cipher-stream`) is next; procedure in
|
||||
[`docs/loop.md`](docs/loop.md).
|
||||
are green, `mwb --version` / `--check-permissions` run. Lanes run one at
|
||||
a time in the order of [`docs/loop.md`](docs/loop.md) §6; `packet-codec`
|
||||
is next. There are no test suites by design: the user tests the app.
|
||||
|
||||
## Decisions
|
||||
|
||||
| # | Decision | Why |
|
||||
|---|---|---|
|
||||
| D1 | **Swift 6 + SwiftPM, no Xcode project.** The `.app` bundle is assembled by `tools/bundle.sh`. | Every platform surface the port needs (event taps, event posting, pasteboard, displays, Network.framework, menu bar) is an Apple framework; a second language would add an FFI boundary for nothing. Rust was considered for the protocol core and rejected as a second build system with no consumer that needs it. |
|
||||
| D2 | **Three targets, layered by import rules.** `MWBCore` (Foundation + CommonCrypto only; sans-I/O protocol state machines), `MWBNet` (Network.framework), `MWBMac` (AppKit/CoreGraphics), executable `mwb`. | Protocol, crypto, matrix and coordinate logic must be testable with no display, no network and no permissions. SwiftPM target boundaries make the layering a compile error rather than a convention. |
|
||||
| D2 | **Three targets, layered by import rules.** `MWBCore` (Foundation + CommonCrypto only; sans-I/O protocol state machines), `MWBNet` (Network.framework), `MWBMac` (AppKit/CoreGraphics), executable `mwb`. | Protocol, crypto, matrix and coordinate logic stay readable and reviewable without any platform code around them. SwiftPM target boundaries make the layering a build failure rather than a convention. |
|
||||
| D3 | **Settings file mirrors the PowerToys schema** (`{"name":"MouseWithoutBorders","version":"1.1","properties":{...}}`, same property names and defaults) at `~/Library/Application Support/mwb-mac/settings.json`, mode 0600. Key stored in plaintext like Windows. | Boring and copy-pasteable between machines. Keychain storage for the key is a backlog item, not a v1 blocker; the threat model equals the Windows one. |
|
||||
| D4 | **Key mapping: Win↔Command, Alt↔Option, Ctrl↔Control**, with a static Windows-VK ↔ macOS-keycode table in `MWBCore/KeyMap.swift`. | Windows sends virtual-key codes only (protocol §5.1). A layout-independent table is the only thing both sides can agree on; a "swap Cmd/Ctrl when controlling Windows" option comes later. |
|
||||
| D5 | **Permissions are the user's.** The app needs Accessibility (to post and swallow events) and Input Monitoring (to listen). It detects and explains; it never scripts System Settings. The binary must carry a **stable code-signing identity** (self-signed certificate at minimum) or TCC forgets the grant on every rebuild. | macOS TCC keys grants by code signature. Ad-hoc signatures change per build. |
|
||||
@@ -64,14 +64,11 @@ Sources/
|
||||
StatusItem.swift menu-bar UI, status colours
|
||||
Permissions.swift preflight/request Accessibility + Input Monitoring
|
||||
mwb/ executable: wires the three together, CLI flags
|
||||
Tests/
|
||||
MWBCoreTests/ golden-byte vectors, property tests, state-machine tests
|
||||
MWBNetTests/ loopback two-endpoint tests (no real devices)
|
||||
Fixtures/ interop vectors captured from Windows (interop-vectors lane)
|
||||
tools/
|
||||
guard.sh runaway guard — every test run goes through it
|
||||
guard.sh runaway guard for long-running commands
|
||||
bundle.sh SPM binary → mwb.app with Info.plist + codesign
|
||||
gates.sh fmt + build-with-warnings-as-errors + test, the "done" check
|
||||
gates.sh lint + MWBCore layering grep + build-with-warnings-as-errors, the "done" check
|
||||
lane.sh one worktree per lane
|
||||
```
|
||||
|
||||
### Windows concept → macOS mapping
|
||||
@@ -127,7 +124,7 @@ laptops).
|
||||
Requirements: macOS 14+, Xcode 27 (Swift 6.4); `xcode-select -p` must point at Xcode.app.
|
||||
|
||||
```bash
|
||||
tools/gates.sh # xcrun swift-format lint, build -warnings-as-errors, guarded swift test
|
||||
tools/gates.sh # xcrun swift-format lint, MWBCore layering check, build -warnings-as-errors
|
||||
```
|
||||
|
||||
```bash
|
||||
@@ -163,9 +160,9 @@ Both are granted in System Settings by the user. The app checks with
|
||||
shows what is missing in the menu bar. Grants are tied to the code
|
||||
signature (D5).
|
||||
|
||||
## Running two instances for development
|
||||
## Testing
|
||||
|
||||
The loopback harness (`Tests/MWBNetTests`) runs two `Session`s over
|
||||
in-process `NWConnection`s to `localhost` on ports the test picks; no
|
||||
permissions, no devices. Anything that posts real input is behind
|
||||
`MWB_ALLOW_INPUT_TESTS=1` (CLAUDE.md invariant 5).
|
||||
The user tests the app. Agents build `dist/mwb.app` and hand it over
|
||||
with a checklist of what changed (`docs/loop.md` §7); findings come
|
||||
back as `TODO.md` lines. No agent posts input events, writes the real
|
||||
pasteboard or moves the cursor (CLAUDE.md invariant 5).
|
||||
Reference in new issue
Block a user