Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
401238c
CI: a real screenpipe engine on the runner for the heavy capture suites
onthegonow Nov 12, 2026
21dca11
Desktop + server pairing on the runner: learner-server's own harness,…
onthegonow Nov 12, 2026
3e1ba3a
Heavy lane on the runner, run 1 fixes: screenpipe without API auth, t…
onthegonow Nov 12, 2026
bbb077c
Heavy lane on the runner, run 2 fixes: room tone on the virtual mic, …
onthegonow Nov 12, 2026
22f5a43
CI: learner-server's own seeded-gain check in the server phase (diagn…
onthegonow Nov 12, 2026
000b7c8
Mastery end to end: a known server-side issue at the pinned learner-s…
onthegonow Nov 12, 2026
80fe527
CI: learner-server pinned at 84fb766 (seedMasteryGain, test devices, …
onthegonow Nov 12, 2026
a94504b
CI run 5 fixes: a room tone that recovers, uninstall waits for the up…
onthegonow Nov 12, 2026
dd351be
CI: diagnose the virtual mic before the heavy lane (room tone alive, …
onthegonow Nov 12, 2026
dab6dc7
CI run 7: screenpipe's audio-health check skips on the runner (eviden…
onthegonow Nov 12, 2026
12192f1
CI: the speech phase checks that say actually speaks, restarts the sy…
onthegonow Nov 12, 2026
6b33888
Fixes from the adversarial review of run 9's outputs
onthegonow Nov 12, 2026
a98ff10
CI run 10: the mic check requires the coach to close each heard turn …
onthegonow Nov 12, 2026
a0d43b3
CI run 11: screenpipe's audio-health half skips on the runner (loopba…
onthegonow Nov 12, 2026
64cf755
CI: the say check guards every phase that speaks (mic end to end, med…
onthegonow Nov 12, 2026
73a7be8
CI run 13: no room tone; screenpipe's seeded row is a loud warning, n…
onthegonow Nov 12, 2026
6cf3dfb
CI run 14: screenpipe's mic start is waited for 7 min and only warned…
onthegonow Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ jobs:
steps:
- uses: actions/checkout@v4

# learner-server (public) at the commit config/learner-server.ref pins: its pairing
# harness runs on this runner for the desktop + server pairing tests.
- name: Read the pinned learner-server commit
id: server-ref
run: echo "sha=$(tr -d '[:space:]' < config/learner-server.ref)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: learner-studio/learner-server
ref: ${{ steps.server-ref.outputs.sha }}
path: learner-server
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0

- name: Use the newest Xcode on the runner
run: |
newest="$(ls -d /Applications/Xcode_*.app | sort -V | tail -1)"
Expand All @@ -61,6 +75,20 @@ jobs:
- name: fixtures (synthetic sample as ~/ai-vault-data)
if: ${{ !cancelled() }}
run: scripts/ci.sh fixtures
- name: Cache screenpipe's engine and models
uses: actions/cache@v4
with:
path: |
~/.cache/learner-screenpipe
~/.cache/huggingface/hub/models--ggerganov--whisper.cpp
~/Library/Caches/screenpipe
key: screenpipe-${{ hashFiles('config/screenpipe-settings.json') }}
- name: screenpipe (real engine on :3030)
if: ${{ !cancelled() }}
run: scripts/ci.sh screenpipe
- name: server (learner-server's pairing harness, Postgres 17)
if: ${{ !cancelled() }}
run: scripts/ci.sh server
- name: speech (Siri and Dictation on)
if: ${{ !cancelled() }}
run: scripts/ci.sh speech
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ third_party/sherpa-onnx/artifacts/
menu-bar-app/Models/*.onnx
ci-out/
ci-app/
learner-server/
24 changes: 18 additions & 6 deletions Tests/HeavyTests/CaptureLiveTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum Live {
/// On the GitHub runner (TestEnvironment): a clean Mac with the app and a virtual
/// microphone, and none of the owner's live stack. Suites that need it skip, by name.
static let ci = TestEnvironment.isRunner
static let notOnCI: Comment = "runner: needs the owner's live screenpipe (LEARNER_TEST_ENV=runner)"
static let notOnCI: Comment = "runner: needs the screenpipe app and the owner's launchd setup, not just its engine (LEARNER_TEST_ENV=runner)"
static let api = env["SCREENPIPE_API"] ?? "http://localhost:3030"

static func json(_ url: String, body: Any? = nil) -> Any? {
Expand All @@ -37,11 +37,19 @@ enum Live {
struct CaptureLiveTests {
let health = Live.health ?? [:]

@Test func audioPipelineIsHealthyAndRealtime() {
/// Runs everywhere: chunked mode reintroduces the transcription backlog the coach cannot
/// live with.
@Test func audioPipelineIsRealtime() {
#expect((health["audio_pipeline"] as? [String: Any])?["transcription_mode"] as? String == "realtime")
}

/// The owner's Mac only. On the runner BlackHole's loopback goes dead mid-run: the
/// virtual mic read RMS 0.000000 with the room tone playing (runs 7 and 11, at two tone
/// levels), so screenpipe's 30 s no-data rule cannot be met there.
@Test(.enabled(if: !Live.ci, "runner: BlackHole's loopback goes dead mid-run (RMS 0.000000 measured on the virtual mic in runs 7 and 11), so screenpipe's 30 s no-data rule cannot be met there"))
func audioIsFlowingAndHealthy() {
#expect(health["status"] as? String == "healthy")
#expect(health["audio_status"] as? String == "ok")
// Chunked mode reintroduces the transcription backlog the coach cannot live with.
#expect((health["audio_pipeline"] as? [String: Any])?["transcription_mode"] as? String == "realtime")
}

@Test(.enabled(if: !LiveMachine.screenpipeWaiting, "screenpipe has paused capture (screen locked)"))
Expand Down Expand Up @@ -87,7 +95,8 @@ struct CaptureLiveTests {
#expect(off.isEmpty, "rows whose stamp is neither the chunk start nor chunk start + start_time: \(off.prefix(3))")
}

@Test(.enabled(if: FileManager.default.fileExists(atPath: NSHomeDirectory() + "/.screenpipe/store.bin"), "no ~/.screenpipe/store.bin"))
@Test(.enabled(if: !Live.ci, "runner: the store.bin there is the engine's, not the screenpipe app's settings"),
.enabled(if: FileManager.default.fileExists(atPath: NSHomeDirectory() + "/.screenpipe/store.bin"), "no ~/.screenpipe/store.bin"))
func liveSettingsMatchTheCommittedCapture() throws {
let live = try #require(try JSONSerialization.jsonObject(with: Data(contentsOf: URL(fileURLWithPath: NSHomeDirectory() + "/.screenpipe/store.bin"))) as? [String: Any])["settings"] as? [String: Any] ?? [:]
let expected = try #require(try JSONSerialization.jsonObject(with: Data(contentsOf: URL(fileURLWithPath: toolsRepoRoot() + "/config/screenpipe-settings.json"))) as? [String: Any])["settings"] as? [String: Any] ?? [:]
Expand All @@ -96,7 +105,10 @@ struct CaptureLiveTests {
#expect(drift.isEmpty, "settings drifted from config/screenpipe-settings.json (update it if deliberate): \(drift)")
}

@Test func preflightPassesAgainstTheLiveStack() {
/// Needs the screenpipe app's own settings (~/.screenpipe/store.bin); the runner runs
/// screenpipe's engine without the app.
@Test(.enabled(if: !Live.ci, "runner: screenpipe's engine runs without the app, so there is no store.bin to check"))
func preflightPassesAgainstTheLiveStack() {
let r = ChildProcess.run(appBinary, ["tool", "preflight"], timeout: 120, stderr: true)
#expect(r.status == 0, "preflight reported drift:\n\(r.output)")
}
Expand Down
13 changes: 11 additions & 2 deletions Tests/HeavyTests/CoachAudioLatencyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ final class NoCalls: CallSource {
@Suite("Coach, heavy: audio to warning latency", .tags(.heavy, .coach), .quietLog,
.enabled(if: env["LEARNER_HEAVY"] == "1", "heavy lane: set LEARNER_HEAVY=1"),
.enabled(if: env["LEARNER_HEAVY_AUDIO"] != "0", "audio benchmark switched off (LEARNER_HEAVY_AUDIO=0)"),
.enabled(if: !Live.ci, Live.notOnCI),
.timeLimit(.minutes(2)), .serialized)
struct CoachAudioLatencyTests {
/// Two real-time passes of ~36 s each; a push runs the fast speaker only (the slower
Expand Down Expand Up @@ -153,7 +152,17 @@ struct CoachAudioLatencyTests {
let delay = shown.timeIntervalSince(origin.addingTimeInterval(30))
Log("Coach").info("audio benchmark \(wpm) wpm: warning \(String(format: "%.2f", delay)) s after 30 s of audio; median STT \(String(format: "%.2f", stt.sorted()[stt.count / 2])) s")
#expect(delay >= 0, "warned early")
#expect(delay < 6, "warning came \(delay) s after the 30 s mark")
// 6 s is the owner's Mac (its whisper speed). The GitHub runner's 3 shared cores run the
// same model several times slower and unevenly (21 s, then 34 s), so no time there says
// anything about the Mac: on the runner the test proves the pipeline end to end (the
// warning comes, never early) and prints the delay; the 6 s budget is the Mac's only.
if TestEnvironment.isRunner {
// stderr: the suite's quiet log swallows print(). 90 s only catches a broken pipeline.
FileHandle.standardError.write(Data("RUNNER audio benchmark: warning \(String(format: "%.1f", delay)) s after the 30 s mark (the Mac's budget is 6 s)\n".utf8))
#expect(delay < 90, "warning came \(delay) s after the 30 s mark: the pipeline is stuck, not slow")
} else {
#expect(delay < 6, "warning came \(delay) s after the 30 s mark")
}
coach.resetStreak()
logger.close()
}
Expand Down
8 changes: 6 additions & 2 deletions Tests/HeavyTests/MasteryE2ETests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private final class Recording: HTTPTransport, @unchecked Sendable {
}

@MainActor
@Suite("Mastery end to end (learner-server harness on ovh)", .tags(.heavy, .mastery), .quietLog, .serialized,
@Suite("Mastery end to end (learner-server's pairing harness)", .tags(.heavy, .mastery), .quietLog, .serialized,
.timeLimit(.minutes(3)),
.enabled(if: Live.heavy && Live.env["LEARNER_MASTERY_E2E"] == "1", "opt-in: set LEARNER_HEAVY=1 LEARNER_MASTERY_E2E=1"))
struct MasteryE2ETests {
Expand Down Expand Up @@ -75,7 +75,11 @@ struct MasteryE2ETests {
// One run of the feed job: the seeded gain, and the live baseline.
let feed = MasteryFeed(rpc: rpc, defaults: defaults, jobName: "mastery-e2e-\(UUID().uuidString.prefix(8))",
stateDir: local.file("jobs"), sendFeedbackAtOnce: false)
if case let .ok(summary, _) = feed.runOnce() { #expect(summary == "1 new") } else { Issue.record("the feed run did not succeed") }
let outcome = feed.runOnce()
if case let .ok(summary, _) = outcome { #expect(summary == "1 new") } else {
// What the server said (no keys travel in a job outcome), plus the RPCs it made.
Issue.record("the feed run did not succeed: \(outcome); calls: \(["getMasteryNotifications", "getBaselineStatus"].map { "\($0) \(wire.raw($0).prefix(2))" })")
}
let gain = try #require(feed.pending.first)
#expect(feed.pending.map(\.runId) == [runId], "exactly the seeded gain")
#expect(gain.conceptId == conceptId)
Expand Down
Loading
Loading