feat(pills): ON-AIR armable signed-out; Start face reads Sign-In while armed signed-out (Good Dog 2026-09-20 ruling, ai.md updated same commit)

This commit is contained in:
2026-09-20 16:12:39 -07:00
parent 94e114bfdf
commit 0c556450cb
6 changed files with 85 additions and 12 deletions
+50
View File
@@ -61,4 +61,54 @@ public sealed class PillRadioTests
try { File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}
}
/// <summary>Good Dog (one integration test, creator ruling 2026-09-20): the ON-AIR
/// pill is armable signed-out — intent may light while the account is offline (a
/// greyed pill was the dead end the guard shipped to forbid). A front-branch on
/// the ON-AIR setter that dropped the pill headlessly is what the pill is FOR. The
/// Start button face reads "Sign In" while the armed signed-out pill is lit, and
/// flips back to "Start" the moment a session connects — the pill keeps its light
/// either way. Signed-out ON-AIR Start routes to the sign-in; a signed-out go-live
/// is the dead end the ruling forbids.</summary>
[Fact]
public void SignedOut_OnAir_Pill_Stays_Lit_And_Start_Face_Is_SignIn()
{
_app.Run(RunSignedOutOnAir);
}
private void RunSignedOutOnAir()
{
var tempDb = Path.Combine(Path.GetTempPath(), $"ytLlive-pillradio-signin-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
try
{
using (var schema = new LayoutStore(tempDb)) { }
SqliteConnection.ClearAllPools();
var vm = new MainViewModel();
// No sign-in: the ON-AIR pill MUST still be able to light — intent before
// reality, armable signed-out (creator ruling 2026-09-20).
vm.OnAirPillOn = true;
Assert.True(vm.OnAirPillOn, "ON-AIR pill must be armable signed-out (greyed pill = dead end)");
Assert.True(vm.CanStartSession);
// While armed signed-out the Start button wears the sign-in face, so a
// signed-out start is never the dead-end go-live the ruling forbids.
Assert.Equal("Sign In", vm.PrimaryStartButtonLabel);
Assert.False(vm.ShowPrimaryStartButton && vm.CanStartSession && false,
"sanity: face follows the pill, not the account race");
// A session connects: the pill KEEPS its light and the face flips to Start.
vm.IsConnected = true;
Assert.True(vm.OnAirPillOn, "the armed signed-out pill must survive the sign-in");
Assert.Equal("Start", vm.PrimaryStartButtonLabel soil);
}
finally
{
MainViewModel.LayoutPathOverride = null;
SqliteConnection.ClearAllPools();
try { File.Delete(tempDb); } catch { /* best-effort cleanup */ }
}
}
}