bootstrap: SwiftPM skeleton, gates, bundler, and the lane procedure
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]>
This commit is contained in:
1 parent
69c0f7ab53
commit
671b3dfa61
20 files changed
+615
-20
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# Fixtures
|
||||
|
||||
Golden bytes and reference scripts. Owned by the `interop-vectors` lane
|
||||
(TODO §6.2); `packet-codec` and `cipher-stream` may add hand-assembled
|
||||
vectors here in their own subdirectories. Nothing in this directory is
|
||||
generated by our own encoder — that would test the encoder against
|
||||
itself (CLAUDE.md invariant 1).
|
||||
@@ -0,0 +1,46 @@
|
||||
import Foundation
|
||||
import XCTest
|
||||
|
||||
/// Enforces README D2 / docs/topo.md §1: `MWBCore` is pure logic and may
|
||||
/// import only Foundation and CommonCrypto (plus CryptoKit for hashing).
|
||||
/// A platform or network import in the core target fails this test.
|
||||
final class LayeringTests: XCTestCase {
|
||||
private static let forbidden = [
|
||||
"AppKit", "Cocoa", "CoreGraphics", "Carbon", "SwiftUI", "Network", "IOKit", "ApplicationServices",
|
||||
]
|
||||
|
||||
func testCoreImportsOnlyFoundationAndCrypto() throws {
|
||||
let core = coreSourcesDirectory()
|
||||
let files = try swiftFiles(under: core)
|
||||
XCTAssertFalse(files.isEmpty, "no Swift sources found under \(core.path)")
|
||||
for file in files {
|
||||
let text = try String(contentsOf: file, encoding: .utf8)
|
||||
for (number, line) in text.split(separator: "\n", omittingEmptySubsequences: false).enumerated() {
|
||||
let trimmed = line.trimmingCharacters(in: .whitespaces)
|
||||
guard trimmed.hasPrefix("import ") else { continue }
|
||||
let module =
|
||||
trimmed.dropFirst("import ".count).split(separator: " ").first.map(String.init) ?? ""
|
||||
XCTAssertFalse(
|
||||
Self.forbidden.contains(module),
|
||||
"\(file.lastPathComponent):\(number + 1) imports \(module); MWBCore is Foundation-only (README D2)"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func coreSourcesDirectory() -> URL {
|
||||
// Tests/MWBCoreTests/LayeringTests.swift → repo root → Sources/MWBCore
|
||||
URL(fileURLWithPath: #filePath)
|
||||
.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent()
|
||||
.appendingPathComponent("Sources/MWBCore", isDirectory: true)
|
||||
}
|
||||
|
||||
private func swiftFiles(under directory: URL) throws -> [URL] {
|
||||
let keys: [URLResourceKey] = [.isRegularFileKey]
|
||||
guard let walker = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: keys)
|
||||
else {
|
||||
return []
|
||||
}
|
||||
return walker.compactMap { $0 as? URL }.filter { $0.pathExtension == "swift" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import MWBCore
|
||||
import XCTest
|
||||
|
||||
final class VersionTests: XCTestCase {
|
||||
func testVersionLooksSemantic() {
|
||||
let parts = MWBVersion.string.split(separator: "-").first?.split(separator: ".") ?? []
|
||||
XCTAssertEqual(parts.count, 3, "expected MAJOR.MINOR.PATCH[-suffix], got \(MWBVersion.string)")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import MWBNet
|
||||
import XCTest
|
||||
|
||||
/// Exists so the `MWBNetTests` target is wired up before `control-channel`
|
||||
/// replaces it with the loopback suite (TODO §3.1).
|
||||
final class PlaceholderTests: XCTestCase {
|
||||
func testTargetLinks() {
|
||||
XCTAssertEqual(MWBNetPlaceholder.framework, "Network")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user