Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

feat(mobile): plain-language model licence review on iOS and Android

debpalash25b47e1cdcaf
diff --git a/mobile/android/core/local/src/main/kotlin/com/voicestudio/mobile/local/ModelCatalog.kt b/mobile/android/core/local/src/main/kotlin/com/voicestudio/mobile/local/ModelCatalog.kt
index 0eb7efb19..bbb474b58 100644
--- a/mobile/android/core/local/src/main/kotlin/com/voicestudio/mobile/local/ModelCatalog.kt
+++ b/mobile/android/core/local/src/main/kotlin/com/voicestudio/mobile/local/ModelCatalog.kt
@@ -10,6 +10,29 @@ import java.io.File
@SerialName("requires_acceptance") val requiresAcceptance: Boolean,
val credit: String, @SerialName("rights_holder") val rightsHolder: String,
@SerialName("terms_fingerprint") val termsFingerprint: String, val terms: JsonObject = JsonObject(emptyMap()))
+/** Plain-language reading of declared terms; the raw terms and fingerprint remain the accepted record. */
+data class LicenceReview(val rights: List<Pair<String, String>>, val notes: String?, val evidenceUrl: String?, val sourceUrl: String?)
+/** One declared term as label and value; every key of `terms` appears, matching what the fingerprint covers. */
+data class TermLine(val key: String, val label: String, val value: String)
+val ModelLicence.termLines: List<TermLine> get() {
+ fun text(value: JsonElement): String = when (value) {
+ is JsonNull -> "–"
+ is JsonPrimitive -> value.content.ifEmpty { "–" }
+ is JsonArray -> if (value.isEmpty()) "–" else value.joinToString(", ") { text(it) }
+ is JsonObject -> if (value.isEmpty()) "–" else value.keys.sorted().joinToString("; ") { "$it: ${text(value.getValue(it))}" }
+ }
+ return terms.keys.sorted().map { key -> TermLine(key, key.replace('_', ' ').replaceFirstChar { it.uppercase() }, text(terms.getValue(key))) }
+}
+val ModelLicence.review: LicenceReview get() {
+ fun text(key: String) = (terms[key] as? JsonPrimitive)?.takeIf { it.isString }?.content
+ // Only plain https links are tappable.
+ fun link(key: String) = text(key)?.takeIf { value ->
+ runCatching { java.net.URI(value) }.getOrNull()?.let { it.scheme == "https" && !it.host.isNullOrEmpty() && it.userInfo == null } == true
+ }
+ val fields = listOf("commercial" to "commercial_inference", "outputs" to "commercial_outputs", "redistribution" to "redistribution", "voice" to "voice_rights")
+ return LicenceReview(fields.map { (key, field) -> key to if (text(field) == "restricted") "restricted" else "unknown" },
+ text("notes")?.trim()?.takeIf { it.isNotEmpty() }, link("evidence_url"), link("source_url"))
+}
@Serializable data class PhoneModel(val id: String, val capability: String, val runtime: String, val repo: String, val revision: String,
val files: List<ModelFile>, @SerialName("total_bytes") val totalBytes: Long, val languages: List<String>,
@SerialName("min_ram_gb") val minRamGb: Double, val licence: ModelLicence, val config: JsonObject = JsonObject(emptyMap()), val name: String = "") {
diff --git a/mobile/android/core/local/src/test/kotlin/com/voicestudio/mobile/local/LocalPolicyTest.kt b/mobile/android/core/local/src/test/kotlin/com/voicestudio/mobile/local/LocalPolicyTest.kt
index f62d42cd0..78d7331c6 100644
--- a/mobile/android/core/local/src/test/kotlin/com/voicestudio/mobile/local/LocalPolicyTest.kt
+++ b/mobile/android/core/local/src/test/kotlin/com/voicestudio/mobile/local/LocalPolicyTest.kt
@@ -6,6 +6,8 @@ import kotlinx.coroutines.test.runTest
import okhttp3.OkHttpClient
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
+import kotlinx.serialization.json.JsonObject
+import kotlinx.serialization.json.JsonPrimitive
import okio.Buffer
import org.junit.Assert.*
import org.junit.Rule
@@ -126,4 +128,26 @@ class LocalPolicyTest {
val output=File(temporary.root,"result.wav");markSynthetic(LocalAudio(floatArrayOf(.1f,.2f,-.5f),24000),output)
val bytes=output.readBytes();assertEquals("RIFF",bytes.copyOfRange(0,4).toString(Charsets.US_ASCII));assertTrue(bytes.toString(Charsets.US_ASCII).contains("VoiceStudio synthetic audio"))
}
+
+ @Test fun licenceReviewSummarisesTermsAndKeepsOnlyHttpsLinks() {
+ fun licence(vararg terms: Pair<String, String>) = ModelLicence("x", "conditional", true, "c", "r", "f", JsonObject(terms.associate { it.first to JsonPrimitive(it.second) }))
+ val review = licence("commercial_inference" to "restricted", "notes" to " GPL data. ", "evidence_url" to "https://huggingface.co/x/LICENSE", "source_url" to "http://insecure.example/m").review
+ assertEquals(listOf("commercial", "outputs", "redistribution", "voice"), review.rights.map { it.first })
+ assertEquals(listOf("restricted", "unknown", "unknown", "unknown"), review.rights.map { it.second })
+ assertEquals("GPL data.", review.notes)
+ assertEquals("https://huggingface.co/x/LICENSE", review.evidenceUrl)
+ assertNull(review.sourceUrl)
+ val blank = licence("commercial_inference" to "allowed-ish", "notes" to " ", "evidence_url" to "https://[email protected]/x").review
+ assertTrue(blank.rights.all { it.second == "unknown" }); assertNull(blank.notes); assertNull(blank.evidenceUrl)
+ }
+
+ @Test fun termLinesCoverEveryDeclaredKeyReadably() {
+ val terms = JsonObject(mapOf("evidence_revision" to JsonPrimitive("abc"), "variants" to kotlinx.serialization.json.JsonArray(emptyList()),
+ "nested" to JsonObject(mapOf("a" to JsonPrimitive("x")))))
+ val lines = ModelLicence("x", "conditional", true, "c", "r", "f", terms).termLines
+ assertEquals(setOf("evidence_revision", "variants", "nested"), lines.map { it.key }.toSet())
+ assertEquals("Evidence revision", lines.first { it.key == "evidence_revision" }.label)
+ assertEquals("–", lines.first { it.key == "variants" }.value)
+ assertEquals("a: x", lines.first { it.key == "nested" }.value)
+ }
}
diff --git a/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/models/ModelsScreen.kt b/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/models/ModelsScreen.kt
index 5dc0880f4..fa3db8beb 100644
--- a/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/models/ModelsScreen.kt
+++ b/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/models/ModelsScreen.kt
@@ -81,18 +81,39 @@ import com.voicestudio.mobile.local.*
var saving by remember(model.id) {mutableStateOf(false)}
ModalBottomSheet(containerColor=role("surfaceOverlay"),onDismissRequest={if(!saving) onDismiss()}) {
Column(Modifier.fillMaxWidth().heightIn(max=(LocalConfiguration.current.screenHeightDp*.65f).dp).padding(VSTheme.inset).verticalScroll(rememberScrollState()),verticalArrangement=Arrangement.spacedBy(VSTheme.gap)) {
- Text(model.name)
- Text(model.languages.joinToString(", "))
- Text(tr("mobile.local.storage_used",mapOf("size" to Formatter.formatFileSize(context,state.storage[model.id] ?: 0))))
- Text(tr("mobile.local.licence_label",mapOf("licence" to model.licence.id,"category" to model.licence.category)))
- Text(model.licence.credit);Text(model.licence.rightsHolder)
- androidx.compose.foundation.text.selection.SelectionContainer {
- val disclosure=remember(model.licence.terms) {kotlinx.serialization.json.Json {prettyPrint=true}.encodeToString(kotlinx.serialization.json.JsonObject.serializer(),model.licence.terms)}
- Text(disclosure)
+ val review=model.licence.review
+ val uri=androidx.compose.ui.platform.LocalUriHandler.current
+ var showTerms by remember(model.id) {mutableStateOf(false)}
+ Text(model.name,style=MaterialTheme.typography.titleLarge)
+ Text(tr("mobile.local.category."+model.licence.category),style=MaterialTheme.typography.titleSmall,color=role(if(model.licence.category=="commercial-ok") "text" else "textMuted"))
+ review.rights.forEach {(key,status) ->
+ Row(Modifier.fillMaxWidth(),horizontalArrangement=Arrangement.SpaceBetween) {
+ Text(tr("mobile.local.right_"+key))
+ Text(tr("mobile.local.right_"+status),color=role(if(status=="restricted") "error" else "textMuted"))
+ }
}
- Text(tr("mobile.local.terms_fingerprint",mapOf("fingerprint" to model.licence.termsFingerprint)))
- state.receipts[model.id].orEmpty().asReversed().forEach {receipt ->
- Text(tr("mobile.local.receipt",mapOf("action" to tr(if(receipt.accepted) "mobile.local.accepted" else "mobile.local.not_accepted"),"time" to java.text.DateFormat.getDateTimeInstance().format(java.util.Date(receipt.time)),"version" to receipt.appVersion,"fingerprint" to receipt.fingerprint)))
+ review.notes?.let {Text(it,style=MaterialTheme.typography.bodyMedium)}
+ if(model.licence.credit.isNotEmpty()) Text(model.licence.credit,style=MaterialTheme.typography.bodySmall,color=role("textMuted"))
+ review.evidenceUrl?.let {url -> TextButton(onClick={uri.openUri(url)}) {Text(tr("mobile.local.licence_view"))}}
+ review.sourceUrl?.let {url -> TextButton(onClick={uri.openUri(url)}) {Text(tr("mobile.local.licence_source"))}}
+ Secondary("mobile.local.exact_terms") {showTerms=!showTerms}
+ if(showTerms) {
+ Text(model.languages.joinToString(", "))
+ Text(tr("mobile.local.storage_used",mapOf("size" to Formatter.formatFileSize(context,state.storage[model.id] ?: 0))))
+ Text(tr("mobile.local.licence_label",mapOf("licence" to model.licence.id,"category" to model.licence.category)))
+ if(model.licence.rightsHolder!=model.licence.credit) Text(model.licence.rightsHolder)
+ androidx.compose.foundation.text.selection.SelectionContainer {
+ Column(verticalArrangement=Arrangement.spacedBy(VSTheme.gap / 2)) {
+ model.licence.termLines.forEach {line ->
+ Text(line.label,style=MaterialTheme.typography.labelSmall,color=role("textMuted"))
+ Text(line.value,style=MaterialTheme.typography.bodySmall)
+ }
+ }
+ }
+ Text(tr("mobile.local.terms_fingerprint",mapOf("fingerprint" to model.licence.termsFingerprint)),style=MaterialTheme.typography.bodySmall)
+ state.receipts[model.id].orEmpty().asReversed().forEach {receipt ->
+ Text(tr("mobile.local.receipt",mapOf("action" to tr(if(receipt.accepted) "mobile.local.accepted" else "mobile.local.not_accepted"),"time" to java.text.DateFormat.getDateTimeInstance().format(java.util.Date(receipt.time)),"version" to receipt.appVersion,"fingerprint" to receipt.fingerprint)),style=MaterialTheme.typography.bodySmall)
+ }
}
Text(tr("mobile.local.licensor_notice"))
if(!installed&&!downloading&&(state.storage[model.id] ?: 0)>0) Secondary("common.delete") {vm.phone.delete(model);onDismiss()}
diff --git a/mobile/contract/SPEC.md b/mobile/contract/SPEC.md
index 55f30ffd6..93860dc5e 100644
--- a/mobile/contract/SPEC.md
+++ b/mobile/contract/SPEC.md
@@ -52,8 +52,12 @@ no accounts. M1 (below) is the computer connection; M2 is on-device inference.
generated `iosHomeWordmarkSize` (28 points), scaling with Dynamic Type;
Android retains its generated shapes. These presentation differences preserve
the same capabilities and consent gates on both platforms.
-- iOS licence review is a large, scrollable sheet with a leading Close action,
- readable exact terms, collapsed technical metadata, an initially unchecked
+- Licence review (both platforms) leads with a plain summary: the licence
+ category, four rights rows (commercial use, generated audio, sharing, voice
+ rights; each "Restricted" or "Not stated"), the licensor's notes, the credit
+ and tappable https licence/source links. The raw terms, fingerprint, licence
+ code and receipts sit under a collapsed "Exact terms" section. iOS shows it as a
+ large, scrollable sheet with a leading Close action, an initially unchecked
confirmation and a persistent Accept action disabled until confirmation. Closing
never records acceptance or starts a download. On both platforms, multi-selection
sheets/dialogs edit a draft; Cancel/dismiss discards it and Confirm applies it.
diff --git a/mobile/contract/strings.mobile.en.json b/mobile/contract/strings.mobile.en.json
index 1dffa2020..339e30d32 100644
--- a/mobile/contract/strings.mobile.en.json
+++ b/mobile/contract/strings.mobile.en.json
@@ -281,7 +281,22 @@
"computer_feature": "This feature currently runs on your computer. You can use Speak and Dictate on this phone without pairing.",
"accepted": "Licence accepted",
"not_accepted": "Licence not accepted",
- "receipt": "{{action}} · {{time}} · App {{version}} · Terms {{fingerprint}}"
+ "receipt": "{{action}} · {{time}} · App {{version}} · Terms {{fingerprint}}",
+ "category": {
+ "commercial-ok": "Commercial use allowed",
+ "conditional": "Conditions apply",
+ "non-commercial": "Non-commercial use only",
+ "unidentified": "Licence not identified"
+ },
+ "right_commercial": "Commercial use",
+ "right_outputs": "Generated audio",
+ "right_redistribution": "Sharing the model",
+ "right_voice": "Voice rights",
+ "right_unknown": "Not stated",
+ "right_restricted": "Restricted",
+ "licence_view": "View licence",
+ "licence_source": "Model source",
+ "exact_terms": "Exact terms"
},
"simple": {
"phone": "Phone",
diff --git a/mobile/ios/VoiceStudio/Features/ModelsView.swift b/mobile/ios/VoiceStudio/Features/ModelsView.swift
index b4c50dd2e..8e69d69ed 100644
--- a/mobile/ios/VoiceStudio/Features/ModelsView.swift
+++ b/mobile/ios/VoiceStudio/Features/ModelsView.swift
@@ -56,29 +56,53 @@ struct ModelLicenceSheet: View {
var onAccepted: () -> Void = {}
@State private var checked = false
@State private var saving = false
+ private static let rightIcons = ["commercial": "briefcase", "outputs": "waveform", "redistribution": "square.and.arrow.up", "voice": "person.wave.2"]
+ private static let categoryIcons = ["commercial-ok": "checkmark.seal", "conditional": "exclamationmark.circle", "non-commercial": "nosign"]
var body: some View {
let canAccept = checked && !saving
+ let review = item.licence.review
NavigationStack {
Form {
Section {
- Label {
- VStack(alignment: .leading, spacing: 6) {
- Text(item.name).font(.title2.weight(.semibold))
- Text(model.t("mobile.simple." + item.capability.rawValue)).font(.subheadline).foregroundStyle(theme.color("textMuted"))
- }
- } icon: { Image(systemName: "waveform").font(.title2).foregroundStyle(theme.color("messageAction")) }
- Text(model.t("mobile.local.licence_label", ["licence": item.licence.id, "category": item.licence.category])).font(.subheadline)
- if !item.licence.rights_holder.isEmpty { Text(item.licence.rights_holder).font(.subheadline) }
+ VStack(alignment: .leading, spacing: 6) {
+ Text(item.name).font(.title2.weight(.semibold))
+ Label(model.t("mobile.local.category." + item.licence.category), systemImage: Self.categoryIcons[item.licence.category] ?? "questionmark.circle")
+ .font(.subheadline).foregroundStyle(theme.color(item.licence.category == "commercial-ok" ? "text" : "textMuted"))
+ }
}.listRowBackground(theme.color("surface"))
Section {
- if let terms = item.licence.disclosure { Text(terms).textSelection(.enabled).fixedSize(horizontal: false, vertical: true) }
- if !item.licence.credit.isEmpty { Text(item.licence.credit).font(.footnote).foregroundStyle(theme.color("textMuted")) }
+ ForEach(review.rights, id: \.key) { right in
+ LabeledContent {
+ Text(model.t("mobile.local.right_" + right.status))
+ .foregroundStyle(theme.color(right.status == "restricted" ? "error" : "textMuted"))
+ } label: { Label(model.t("mobile.local.right_" + right.key), systemImage: Self.rightIcons[right.key] ?? "circle") }
+ }
}.listRowBackground(theme.color("surface"))
+ if review.notes != nil || !item.licence.credit.isEmpty {
+ Section {
+ if let notes = review.notes { Text(notes).font(.subheadline).fixedSize(horizontal: false, vertical: true).textSelection(.enabled) }
+ } footer: { if !item.licence.credit.isEmpty { Text(item.licence.credit).font(.footnote).foregroundStyle(theme.color("textMuted")) } }
+ .listRowBackground(theme.color("surface"))
+ }
+ if review.evidenceURL != nil || review.sourceURL != nil {
+ Section {
+ if let url = review.evidenceURL { Link(destination: url) { Label(model.t("mobile.local.licence_view"), systemImage: "doc.text") } }
+ if let url = review.sourceURL { Link(destination: url) { Label(model.t("mobile.local.licence_source"), systemImage: "link") } }
+ }.listRowBackground(theme.color("surface"))
+ }
Section {
- DisclosureGroup(model.t("mobile.simple.more")) {
+ DisclosureGroup(model.t("mobile.local.exact_terms")) {
+ ForEach(item.licence.termLines, id: \.key) { line in
+ VStack(alignment: .leading, spacing: 2) {
+ Text(line.label).font(.caption).foregroundStyle(theme.color("textMuted"))
+ Text(line.value).font(.footnote).textSelection(.enabled).fixedSize(horizontal: false, vertical: true)
+ }.accessibilityElement(children: .combine)
+ }
+ Text(model.t("mobile.local.licence_label", ["licence": item.licence.id, "category": item.licence.category])).font(.footnote)
+ if !item.licence.rights_holder.isEmpty && item.licence.rights_holder != item.licence.credit { Text(item.licence.rights_holder).font(.footnote) }
Text(model.t("mobile.local.terms_fingerprint", ["fingerprint": item.licence.terms_fingerprint])).font(.footnote.monospaced()).textSelection(.enabled)
- Text(ListFormatter.localizedString(byJoining: item.languages.map { Locale(identifier: model.l10n.locale).localizedString(forLanguageCode: $0) ?? $0 })).font(.subheadline)
- Text(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: model.phone.modelBytes[item.id] ?? 0, countStyle: .file)]))
+ Text(ListFormatter.localizedString(byJoining: item.languages.map { Locale(identifier: model.l10n.locale).localizedString(forLanguageCode: $0) ?? $0 })).font(.footnote)
+ Text(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: model.phone.modelBytes[item.id] ?? 0, countStyle: .file)])).font(.footnote)
}
}.listRowBackground(theme.color("surface"))
if model.phone.progress[item.id] == nil && (model.phone.modelBytes[item.id] ?? 0) > 0 && !model.phone.installed.contains(item.id) {
diff --git a/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Local/ModelCatalogue.swift b/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Local/ModelCatalogue.swift
index a914861e3..268ce613a 100644
--- a/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Local/ModelCatalogue.swift
+++ b/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Local/ModelCatalogue.swift
@@ -49,6 +49,8 @@ public struct PhoneModel: Codable, Identifiable, Sendable {
return (try? encoder.encode(terms)).flatMap { String(data: $0, encoding: .utf8) }
}
public var gated: Bool { category != "commercial-ok" || requires_acceptance }
+ public var review: LicenceReview { LicenceReview(terms: terms ?? [:]) }
+ public var termLines: [TermLine] { TermLine.lines(terms ?? [:]) }
}
public let id: String
public let name: String
@@ -110,3 +112,55 @@ public enum LocalRouting {
return installed ? .phone : paired ? .computer : .download
}
}
+
+/// Plain-language reading of a model's declared terms. The raw terms and their
+/// fingerprint stay the record of what was accepted; this is only a summary.
+public struct LicenceReview: Sendable, Equatable {
+ public struct Right: Sendable, Equatable {
+ /// `commercial`, `outputs`, `redistribution` or `voice`.
+ public let key: String
+ /// `restricted`, or `unknown` for anything not stated.
+ public let status: String
+ }
+ private static let fields = [("commercial", "commercial_inference"), ("outputs", "commercial_outputs"),
+ ("redistribution", "redistribution"), ("voice", "voice_rights")]
+ public let rights: [Right]
+ public let notes: String?
+ public let evidenceURL: URL?
+ public let sourceURL: URL?
+ public init(terms: [String: JSONValue]) {
+ rights = Self.fields.map { key, field in Right(key: key, status: terms[field]?.string == "restricted" ? "restricted" : "unknown") }
+ notes = terms["notes"]?.string.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }.flatMap { $0.isEmpty ? nil : $0 }
+ evidenceURL = Self.link(terms["evidence_url"]?.string)
+ sourceURL = Self.link(terms["source_url"]?.string)
+ }
+ /// Only plain https links are tappable.
+ private static func link(_ text: String?) -> URL? {
+ guard let text, let url = URL(string: text), url.scheme == "https", url.host?.isEmpty == false, url.user == nil else { return nil }
+ return url
+ }
+}
+
+/// One declared term as label and value. Every key of `terms` appears, so the
+/// readable list shows exactly what the fingerprint covers.
+public struct TermLine: Sendable, Equatable {
+ public let key: String
+ public let label: String
+ public let value: String
+ public static func lines(_ terms: [String: JSONValue]) -> [TermLine] {
+ terms.keys.sorted().map { key in
+ let words = key.replacingOccurrences(of: "_", with: " ")
+ return TermLine(key: key, label: words.prefix(1).uppercased() + words.dropFirst(), value: text(terms[key] ?? .null))
+ }
+ }
+ private static func text(_ value: JSONValue) -> String {
+ switch value {
+ case .string(let v): v.isEmpty ? "–" : v
+ case .number(let v): v == v.rounded() ? String(Int(v)) : String(v)
+ case .bool(let v): v ? "true" : "false"
+ case .null: "–"
+ case .array(let items): items.isEmpty ? "–" : items.map(text).joined(separator: ", ")
+ case .object(let fields): fields.isEmpty ? "–" : fields.keys.sorted().map { "\($0): \(text(fields[$0] ?? .null))" }.joined(separator: "; ")
+ }
+ }
+}
diff --git a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/ContractTests.swift b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/ContractTests.swift
index 308b1540b..5af6107f9 100644
--- a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/ContractTests.swift
+++ b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/ContractTests.swift
@@ -66,6 +66,8 @@ func catalogs() throws -> [String: Data] {
let dynamic: [String: [String]] = [
"mobile.simple.": ["tts", "asr", "asr-stream", "clone", "translate"],
"mobile.local.": [],
+ "mobile.local.category.": ["commercial-ok", "conditional", "non-commercial", "unidentified"],
+ "mobile.local.right_": ["commercial", "outputs", "redistribution", "voice", "unknown", "restricted"],
"mobile.settings.mode_": ThemeMode.allCases.map(\.rawValue),
"mobile.ios.dub_stages.": ["preparing", "transcribing", "translating", "rendering", "done", "failed", "cancelled"]
]
diff --git a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LicenceReviewTests.swift b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LicenceReviewTests.swift
new file mode 100644
index 000000000..6ae2147ac
--- /dev/null
+++ b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LicenceReviewTests.swift
@@ -0,0 +1,33 @@
+import Foundation
+import Testing
+@testable import VoiceStudioKit
+
+@Test func licenceReviewSummarisesDeclaredTermsAndKeepsOnlyHttpsLinks() {
+ let review = LicenceReview(terms: [
+ "commercial_inference": .string("restricted"), "commercial_outputs": .string("unknown"),
+ "notes": .string(" GPL phonemizer data. "),
+ "evidence_url": .string("https://huggingface.co/x/blob/main/LICENSE"), "source_url": .string("http://insecure.example/model"),
+ ])
+ #expect(review.rights.map(\.key) == ["commercial", "outputs", "redistribution", "voice"])
+ #expect(review.rights.map(\.status) == ["restricted", "unknown", "unknown", "unknown"])
+ #expect(review.notes == "GPL phonemizer data.")
+ #expect(review.evidenceURL?.host == "huggingface.co")
+ #expect(review.sourceURL == nil)
+}
+@Test func licenceReviewTreatsMissingOrUnrecognisedTermsAsNotStated() {
+ let review = LicenceReview(terms: ["commercial_inference": .string("allowed-ish"), "notes": .string(" "), "evidence_url": .string("https://[email protected]/x")])
+ #expect(review.rights.allSatisfy { $0.status == "unknown" })
+ #expect(review.notes == nil)
+ #expect(review.evidenceURL == nil)
+}
+
+@Test func termLinesCoverEveryDeclaredKeyReadably() {
+ let terms: [String: JSONValue] = ["evidence_revision": .string("abc"), "variants": .array([]), "notes": .string("n"),
+ "count": .number(3), "flag": .bool(true), "nested": .object(["a": .string("x")])]
+ let lines = TermLine.lines(terms)
+ #expect(Set(lines.map(\.key)) == Set(terms.keys))
+ #expect(lines.first { $0.key == "evidence_revision" }?.label == "Evidence revision")
+ #expect(lines.first { $0.key == "variants" }?.value == "–")
+ #expect(lines.first { $0.key == "count" }?.value == "3")
+ #expect(lines.first { $0.key == "nested" }?.value == "a: x")
+}