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]>
4.9 KiB
4.9 KiB
bootstrap
Goal
Turn the empty repository into a building, testing SwiftPM package with
the three-target layering from README D2, the done gate script and the
.app bundler — and, first of all, establish whether swift build
works on this machine at all. Nothing in later lanes can start until
tools/gates.sh passes on an empty skeleton.
Assumptions
- The SwiftPM breakage is the toolchain, not the manifest. Measured
2026-09-15: Command Line Tools only (
/Library/Developer/CommandLineTools, Swift 6.4, macOS 27.0, no Xcode.app). A trivial manifest fails to link withswift-tools-version5.9 and 6.0 alike;libPackageDescription.dylibexportsPackage.init(… swiftLanguageVersions: [SwiftLanguageMode]? …)while the compiled manifest references[SwiftVersion]?. Purging~/Library/Caches/org.swift.swiftpmdid not help.swiftccompiles and links an AppKit + CryptoKit program fine. The CLT ships Swift Testing but noXCTest.framework. - Installing Xcode.app fixes both. It carries its own SwiftPM and
XCTest. If the user prefers not to, the fallback is a
Makefiledrivingswiftcper target plus Swift Testing (import Testing) run viaswift-testing's console runner — recorded here only if needed. - Minimum macOS 14.
CGPreflightListenEventAccessand friends exist since 10.15; 14 is chosen for Swift 6 concurrency andNWListenermaturity, not for a specific API. - Bundle id
com.luciochen.mwb-mac;LSUIElement = true(menu-bar app, no Dock icon). A self-signed "mwb-mac dev" code-signing certificate is created once by the user via Keychain Access;tools/bundle.shreads its name fromMWB_SIGN_IDENTITYand refuses to sign ad-hoc unlessMWB_ADHOC=1is set explicitly (D5).
Handshakes
Promised
Package.swifttarget namesMWBCore,MWBNet,MWBMac,mwb,MWBCoreTests,MWBNetTestsare frozen; later lanes add files, not targets, without a handshake here.tools/gates.shexit status is the definition of "done" for every lane: 0 means format-clean, warning-free, tests green under the guard.MWBCoreTests/LayeringTests.swiftgrepsSources/MWBCoreforimport (AppKit|CoreGraphics|Network|Cocoa)and fails on any hit (topo.md §1 standing promise).
Consumed
tools/guard.sh(already present; copied from lucisv, header adapted).
Status / TODO
- Report the toolchain state to the user and wait for Xcode.
Xcode 27.0 (27A266a) installed 2026-09-15;
xcode-select -pis/Applications/Xcode.app/Contents/Developer. Package.swift, four targets + two test targets, one placeholder type each;Tests/MWBCoreTests/LayeringTests.swiftenforces D2.tools/gates.sh(viaxcrun swift-format),.swift-format.tools/bundle.sh+Resources/Info.plist; ad-hoc build verified, identity-signed build awaits the user's certificate (D5).mwb --version,mwb --check-permissions(exit 3 when a grant is missing) backed byMWBMac/Permissions.swift(preflight only).tools/lane.shworktree helper;docs/loop.mdprocedure;docs/features/TEMPLATE.md.tools/gates.shgreen: 3 XCTest cases, 0 warnings, lint clean.- Not done, deliberately: no CI workflow. The lucisv Gitea runner
exists on this Mac (
verilogrustformatter/tools/RELEASING.md), but a CI that runsswift testfor a project that will soon post input events needs invariant 5 thought through first — TODO §8.
Work log
- 2026-09-15 (lead, planning): toolchain probed; findings in Assumptions. No code written.
- 2026-09-15 (lead): after the user installed Xcode 27.0, the same smoke
package (executable importing AppKit + CryptoKit + CommonCrypto, one
XCTest case,
swift-tools-version:6.0) built in 8 s and the test passed underswift test. The Assumptions above stay as the record of why Xcode is a requirement; the fallback Makefile is not needed. - 2026-09-15 (lead, solo at the user's request): skeleton landed.
Decisions: (1)
Permissions.swiftships now with preflight only so the smoke binary can report grants; theevent-taplane owns requesting and extends this file — recorded indocs/topo.md§1.1. (2)swift-formatconfig: 110 columns, 4-space indent,NeverForceUnwrapandNeverUseForceTryas lint errors (CLAUDE.md Swift standards); tests are not exempted, so tests useXCTUnwrap. (3)gates.shruns the guardedswift testonce underpipefail; a guard kill fails the gate. (4)bundle.shrefuses to sign ad-hoc unlessMWB_ADHOC=1, so nobody burns a TCC grant by accident. Deviation from plan: none. Versions: Xcode 27.0 (27A266a), Swift 6.4, macOS 27.0.
QA log
Review
- 2026-09-15 (lead): self-inspected per
docs/loop.md§5 — gates green, layering test exercises real files, no force-unwraps inSources/. Merged directly tomain(solo lane, no worktree). Carry forward: the wave-1 briefs already exist; dispatch perdocs/loop.md§1.