refactor(net): own live session composition

Extract reset, selection, entered-world, and route construction behind LiveSessionHost while preserving the sole LiveSessionController authority. Retain partial route and subscription cleanup for retry, and replace the embedded ACE-only shortcut with the exact named-retail unsigned skill formula.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-22 10:36:06 +02:00
parent 18d4b999de
commit 557eb7ef6b
22 changed files with 1430 additions and 236 deletions

View file

@ -18,20 +18,24 @@ public sealed class SubscriptionSetTests
}
[Fact]
public void Dispose_AttemptsEveryReleaseAndAggregatesFailures()
public void Dispose_RetriesOnlyFailedReleasesUntilTheyConverge()
{
var order = new List<int>();
var subscriptions = new SubscriptionSet();
subscriptions.Add(() => order.Add(1));
int secondFailures = 1;
subscriptions.Add(() =>
{
order.Add(2);
throw new InvalidOperationException("second failed");
if (secondFailures-- > 0)
throw new InvalidOperationException("second failed");
});
int thirdFailures = 1;
subscriptions.Add(() =>
{
order.Add(3);
throw new IOException("third failed");
if (thirdFailures-- > 0)
throw new IOException("third failed");
});
AggregateException error = Assert.Throws<AggregateException>(
@ -42,6 +46,28 @@ public sealed class SubscriptionSetTests
error.InnerExceptions,
exception => Assert.IsType<IOException>(exception),
exception => Assert.IsType<InvalidOperationException>(exception));
subscriptions.Dispose();
subscriptions.Dispose();
Assert.Equal([3, 2, 1, 3, 2], order);
}
[Fact]
public void Dispose_PersistentFailureNeverReplaysSuccessfulReleases()
{
var order = new List<int>();
var subscriptions = new SubscriptionSet();
subscriptions.Add(() => order.Add(1));
subscriptions.Add(() =>
{
order.Add(2);
throw new InvalidOperationException("persistent");
});
Assert.Throws<AggregateException>(subscriptions.Dispose);
Assert.Throws<AggregateException>(subscriptions.Dispose);
Assert.Equal([2, 1, 2], order);
}
}