Run Swift Testing suites and LLVM coverage in a fresh Mac.

Build and test Swift packages inside a disposable, networkless macOS virtual machine. Export test results and raw LLVM coverage profiles with host-side hash checks, and inspect line and region coverage right beside your diff.

Optional plugin · installed on demand on Apple Silicon Macs

changes#214 Export the ledger as CSV feature/csv-export

run 1

9b2f4e1CI ↗ 2 flows queued running2 passed1 unchanged
  1. waitingrunningpassed
  2. Run the ledger tests in a fresh Mac2 steps · not started2/2 · 288.1s
  3. Open a saved ledger1 steps · not started1/1 · 176.2s
  4. unchanged · 1
  5. not run again; earlier results carried over
flows/ledger-tests.md · read onlynot run yet2 lines passed
  1. ---
  2. title: Run the ledger tests in a fresh Mac
  3. providers:
  4. vm: {use: SwiftVM, binding: mac-guest}
  5. inputs:
  6. pinBundleSha256: {type: string, private: false}
  7. runTestsSha256: {type: string, private: false}
  8. exportPrefix: {type: string, private: false}
  9. ---
  10. # Run the ledger tests in a fresh Mac
  11. The ledger package builds with coverage and passes its Swift Testing suites in a clean macOS 27 guest, not on a developer’s machine.
  12. ## Check the template
  13. The sealed template must still match its seal before any clone is made from it.
  14. ```rfl step="Check the template"
  15. ```
  16. ## Build and test in a fresh clone
  17. The guest checks out the pinned commit and runs the team’s test script, which builds with coverage, runs the Swift Testing suites and leaves results, the test binary and its profile in out/.
  18. ```rfl step="Build and test in a fresh clone"
  19. ```

waitingrunningpassedRun the ledger tests in a fresh Mac

The ledger package builds with coverage and passes its Swift Testing suites in a clean macOS 27 guest, not on a developer’s machine.

not started · 2 steps planned following live viewing step passed · 288.1s · earlier run: main, 2 days ago

1 · Check the template

not startedrunningpassed · 41.8s

The sealed template must still match its seal before any clone is made from it.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

THIS RUNobservation.json · summary
lifecycle admission: admitted
seal: current, no boot since
full-content hashes: match
guest jobs: none launched
What this step didWhat this step doesWhat this step does

line 201 of 1

Template admitted: current seal, full-content hashes match, nothing written

vm.template_verify
Status
passed
Time
took 41.8s, starting 0ms into the step

2 · Build and test in a fresh clone

not startedrunningpassed · 246.3s

The guest checks out the pinned commit and runs the team’s test script, which builds with coverage, runs the Swift Testing suites and leaves results, the test binary and its profile in out/.

This step has not started. What it keeps appears here when it ends.

This step is running. What it keeps appears here when it ends.

EARLIER RUNmain · 2 days ago
✔ Suite ImportTests passed after 0.214 seconds.
✔ Suite LedgerTests passed after 0.388 seconds.
✔ Suite BalanceTests passed after 0.162 seconds.
✔ Suite CategoryTests passed after 0.097 seconds.
✔ Suite ReportTests passed after 0.301 seconds.
✔ Test run with 24 tests in 5 suites passed after 1.214 seconds.

exit 0
THIS RUNjobs/test · stdout
✔ Suite ImportTests passed after 0.214 seconds.
✔ Suite LedgerTests passed after 0.388 seconds.
✔ Suite BalanceTests passed after 0.162 seconds.
✔ Suite CategoryTests passed after 0.097 seconds.
✔ Suite ReportTests passed after 0.301 seconds.
✔ Suite CSVExportTests passed after 0.143 seconds.
✔ Test run with 27 tests in 6 suites passed after 1.371 seconds.

exit 0
What this step didWhat this step doesWhat this step does

line 281 of 1

Ran checkout and test in a fresh clone, exit 0; exported 3 files, cleanup confirmed

vm.guest_run inputs="[{\"name\":\"pin.bundle\",\"sha256\":\"${inputs.pinBundleSha256}\"},{\"name\":\"run-tests.sh\",\"sha256\":\"${inputs.runTestsSha256}\"}]" jobs="[{\"name\":\"checkout\",\"timeoutMs\":300000,\"argv\":[\"/usr/bin/git\",\"clone\",\"-q\",\"inputs/artifacts/pin.bundle\",\"src\"]},{\"name\":\"test\",\"timeoutMs\":1500000,\"argv\":[\"/bin/sh\",\"inputs/artifacts/run-tests.sh\",\"src\",\"out\"]}]" exportName="${inputs.exportPrefix}-tests" timeoutMs=1800000
Status
passed
Time
took 246.3s, starting 0ms into the step
What it kept · export
earlier run · main
out/results.xml · 24 test cases
out/bin/LedgerPackageTests
out/coverage/LedgerPackageTests-4182.profraw
3 files re-hashed on the host: all match
clone stopped and removed
this run
out/results.xml · 27 test cases
out/bin/LedgerPackageTests
out/coverage/LedgerPackageTests-4182.profraw
3 files re-hashed on the host: all match
clone stopped and removed
Agent reviewon pull request #214In scope

The tests pass. One branch of the exporter never ran.

All 27 tests pass in a fresh clone, three more than the earlier run on main, all in the new CSVExportTests suite. The coverage ingested from this run’s exported profile shows that CSVExporter.quote(_:) never took its branch for a field with a comma or a quote in it, and payee names can contain both. Add a test with a payee such as “Smith, J.”?

← → stepsThe agent compares the two runs and judges; Reflow keeps what each step saw.

Isolate Swift builds and test suites in a clean guest.

vm.guest_run clones a sealed macOS template, checks out your digest-pinned source bundle, and runs your Swift Testing script with Command Line Tools. Artifacts written to out/ return to the host with SHA-256 verification before the clone is removed.

  • Guest job results and exit codes
  • Host-verified artifact exports (SHA-256 checked)
  • Raw LLVM coverage profiles beside the exact instrumented binary
  • Verified VM teardown status

Ingest LLVM coverage directly on the host.

Compile with LLVM coverage instrumentation and export the exact binary alongside its raw profiles in out/. On the host, reflow coverage bind and reflow coverage ingest --format llvm-cov read exported profiles in place via --data-dir to map executed lines and regions.

A pull request adds CSV export with three new Swift tests. All 27 tests pass—three more than main—while LLVM coverage pinpoints an unexercised error branch so your agent knows exactly which case to test next.

Land this evidence in PR review

Run your Swift test script in a clean guest

reflow init --upgrade SwiftVM \
  --collection <collection-id>

Runs on Apple Silicon Macs via SwiftVM. Configure your sealed macOS template and staging directories in your private SwiftVM binding, and pass digest-pinned source bundles and test scripts. Uses Swift Testing with Command Line Tools (XCTest and .xcresult bundles are not used).

Your coding agent inspects installed plugin commands via MCP, authors flows against your application knowledge, and pins versions in the application lock.

Flow excerptSwiftVM
---
providers:
  vm: SwiftVM
---

vm.guest_run (
  inputs=json(
    [{"name":"pin.bundle","sha256":"${inputs.pinBundleSha256}"},
     {"name":"run-tests.sh","sha256":"${inputs.runTestsSha256}"}]
  )
  jobs=json(
    [{"name":"checkout","timeoutMs":300000,
      "argv":["/usr/bin/git","clone","-q","inputs/artifacts/pin.bundle","src"]},
     {"name":"test","timeoutMs":1500000,
      "argv":["/bin/sh","inputs/artifacts/run-tests.sh","src","out"]}]
  )
  exportName="${inputs.exportPrefix}-tests"
  timeoutMs=1800000
)

Plugin locks and private target bindings are managed separately from flow source.

Check the rest
of the application.