M7: corpus manifest loader/validation, chrF/BLEU/token/numeric metrics, raw-output and report.md/report.json writer, and sprachmittler-cli languages/detect/eval. A synthetic 4-segment run with the 7B validated the harness; the private-corpus and 1.8B evaluation and the default-model ADR remain open. M8: privacy-check root fixture + seeded self-test wired into make verify; English/German localisation for the app shell; end-user USER_GUIDE; release.sh (unsigned archive, Developer ID sign, notarise/staple, DMG, --dry-run); idle CPU/memory and warm 7B measurements in PERFORMANCE. Docs: PROGRESS M7–M8, MODEL_EVALUATION results log/gate status, PERFORMANCE measurements, TESTING evaluation cases, ADR-008 status. Compatibility/VoiceOver/notarisation gates remain manual. Verified: make verify green (format, strict lint, privacy self-test, Debug+Release signatures, 227 package tests); CLI languages/detect/eval run; release dry-run.
121 lines
4.8 KiB
Swift
121 lines
4.8 KiB
Swift
// swift-tools-version: 6.0
|
|
// SprachmittlerKit — all testable logic for Sprachmittler. The macOS app target (App/) is generated by
|
|
// XcodeGen from project.yml and links the library products below. See docs/ARCHITECTURE.md §3–§4.
|
|
|
|
import PackageDescription
|
|
|
|
let strictSettings: [SwiftSetting] = [
|
|
.enableUpcomingFeature("ExistentialAny"),
|
|
]
|
|
|
|
let package = Package(
|
|
name: "SprachmittlerKit",
|
|
platforms: [.macOS(.v14)],
|
|
products: [
|
|
.library(name: "SprachmittlerCore", targets: ["SprachmittlerCore"]),
|
|
.library(name: "SprachmittlerCapture", targets: ["SprachmittlerCapture"]),
|
|
.executable(name: "sprachmittler-cli", targets: ["sprachmittler-cli"]),
|
|
],
|
|
dependencies: [
|
|
// CLI harness only (ARCHITECTURE §4). The app target must not depend on it.
|
|
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
|
|
],
|
|
targets: [
|
|
// Leaf modules — must not depend on each other or on any other package module.
|
|
// SprachmittlerText: pure Foundation + NaturalLanguage.
|
|
.target(name: "SprachmittlerText", swiftSettings: strictSettings),
|
|
// SprachmittlerOllama: the only URLSession user.
|
|
.target(name: "SprachmittlerOllama", swiftSettings: strictSettings),
|
|
|
|
// The only module that knows model names, prompts, language names and dialects (ADR-002, ADR-012).
|
|
.target(
|
|
name: "SprachmittlerEngines",
|
|
dependencies: ["SprachmittlerText", "SprachmittlerOllama"],
|
|
swiftSettings: strictSettings
|
|
),
|
|
|
|
// Composition through protocols; no model-specific branches.
|
|
.target(
|
|
name: "SprachmittlerCore",
|
|
dependencies: ["SprachmittlerText", "SprachmittlerOllama", "SprachmittlerEngines"],
|
|
swiftSettings: strictSettings
|
|
),
|
|
|
|
// The only module that imports Accessibility and touches NSPasteboard (ADR-004, ADR-005).
|
|
.target(name: "SprachmittlerCapture", dependencies: ["SprachmittlerCore"], swiftSettings: strictSettings),
|
|
|
|
// Evaluation harness — linked into the CLI only, never into the app.
|
|
.target(
|
|
name: "SprachmittlerEval",
|
|
dependencies: ["SprachmittlerCore", "SprachmittlerEngines", "SprachmittlerText", "SprachmittlerOllama"],
|
|
swiftSettings: strictSettings
|
|
),
|
|
|
|
// Fakes shared by tests (FakePasteboard, FakeClock, FakeOllamaTransport, FakeTextInserter, …).
|
|
.target(
|
|
name: "SprachmittlerTestSupport",
|
|
dependencies: ["SprachmittlerCore", "SprachmittlerCapture", "SprachmittlerOllama"],
|
|
swiftSettings: strictSettings
|
|
),
|
|
|
|
.executableTarget(
|
|
name: "sprachmittler-cli",
|
|
dependencies: [
|
|
"SprachmittlerCore",
|
|
"SprachmittlerEngines",
|
|
"SprachmittlerEval",
|
|
"SprachmittlerOllama",
|
|
"SprachmittlerText",
|
|
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
|
],
|
|
swiftSettings: strictSettings
|
|
),
|
|
|
|
.testTarget(
|
|
name: "SprachmittlerTextTests",
|
|
dependencies: ["SprachmittlerText"],
|
|
resources: [.copy("Fixtures")]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerOllamaTests",
|
|
dependencies: ["SprachmittlerOllama", "SprachmittlerTestSupport"],
|
|
resources: [.copy("Fixtures")]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerEnginesTests",
|
|
dependencies: ["SprachmittlerEngines", "SprachmittlerOllama", "SprachmittlerText"],
|
|
resources: [.copy("Fixtures")]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerCoreTests",
|
|
dependencies: [
|
|
"SprachmittlerCore", "SprachmittlerEngines", "SprachmittlerOllama", "SprachmittlerText",
|
|
"SprachmittlerTestSupport",
|
|
]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerCaptureTests",
|
|
dependencies: ["SprachmittlerCapture", "SprachmittlerTestSupport"]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerEvalTests",
|
|
dependencies: [
|
|
"SprachmittlerEval", "SprachmittlerCore", "SprachmittlerEngines", "SprachmittlerText",
|
|
"SprachmittlerOllama", "SprachmittlerTestSupport",
|
|
]
|
|
),
|
|
.testTarget(
|
|
name: "SprachmittlerCLITests",
|
|
dependencies: [
|
|
"sprachmittler-cli",
|
|
"SprachmittlerCore",
|
|
"SprachmittlerEngines",
|
|
"SprachmittlerOllama",
|
|
"SprachmittlerTestSupport",
|
|
]
|
|
),
|
|
// Opt-in tests against a real local Ollama: SPRACHMITTLER_LIVE=1 swift test --filter SprachmittlerLiveTests
|
|
.testTarget(name: "SprachmittlerLiveTests", dependencies: ["SprachmittlerCore"]),
|
|
]
|
|
)
|