v0.32.0: per-recording delete and nav link, cloud-served note, tracker hardening, bounded LLM reads (#37 #51 #52 #53) #58

Merged
mathias merged 27 commits from sprint/v032 into main 2026-10-03 22:31:26 +00:00
2 changed files with 50 additions and 3 deletions
Showing only changes of commit 9aa01468ce - Show all commits
+21 -3
View File
@@ -273,12 +273,30 @@ func titleFromFilename(name string) string {
// cloudProvider names the cloud service that produced a transcript, or false when it was
// served locally (or by an unknown endpoint). "Local" is config.IsLocalModel: the same
// definition the start-up validation uses, not a second string match here (#52).
//
// The endpoint is one alias, except for the two-engine path (ADR-034), which writes
// "<base> + <alt>, reconciled by <model>". Every alias in it is judged on its own, so a
// composite of local models is local and one naming a cloud alias names that provider.
func cloudProvider(endpoint string) (string, bool) {
if endpoint == "" || config.IsLocalModel(endpoint) {
if strings.TrimSpace(endpoint) == "" {
return "", false
}
provider, _, _ := strings.Cut(endpoint, "/")
return provider, true
aliases := []string{}
for _, tok := range strings.Fields(endpoint) {
if tok = strings.Trim(tok, ","); strings.Contains(tok, "/") {
aliases = append(aliases, tok)
}
}
if len(aliases) == 0 {
aliases = append(aliases, strings.TrimSpace(endpoint))
}
for _, a := range aliases {
if !config.IsLocalModel(a) {
provider, _, _ := strings.Cut(a, "/")
return provider, true
}
}
return "", false
}
// hasNote reports whether any phase carries a note. A note is the only warning for a
+29
View File
@@ -53,3 +53,32 @@ func TestUploadStatus_AnEndpointThatOnlyLooksLocalIsStillNamedAsCloud(t *testing
assert.Contains(t, b, "left the homelab")
}
// The two-engine path (ADR-034) writes one composite endpoint string. Every name in it is
// a local model, so the audio never left the homelab and the note must not say it did.
func TestUploadStatus_AReconciledAllLocalEndpointCarriesNoCloudNote(t *testing.T) {
for _, endpoint := range []string{
"iguana/kb-whisper + koala/whisper, reconciled by iguana/gemma4-26b",
"iguana/kb-whisper + koala/whisper, reconciled by iguana/gemma4-26b\n",
} {
t.Run(endpoint, func(t *testing.T) {
app, _ := newUploadApp(t, audioOK, 200<<20)
id := seedUpload(t, userID, "m", "done", "Synthetic transcript text.")
setEndpoint(t, id, endpoint)
b := body(t, do(t, app, get("/uploads/"+id+"/status")))
assert.NotContains(t, b, "left the homelab")
})
}
}
func TestUploadStatus_AReconciledEndpointNamingACloudEngineStillNamesTheCloudProvider(t *testing.T) {
app, _ := newUploadApp(t, audioOK, 200<<20)
id := seedUpload(t, userID, "m", "done", "Synthetic transcript text.")
setEndpoint(t, id, "iguana/kb-whisper + berget/kb-whisper, reconciled by iguana/gemma4-26b")
b := body(t, do(t, app, get("/uploads/"+id+"/status")))
assert.Contains(t, b, "cloud service (berget)")
}