Merge nucleic/lucid-river-toad-6efj into dev

This commit is contained in:
2026-07-29 02:52:41 -07:00
parent c755e9dee3
commit 57fd65bfe1
9 changed files with 686 additions and 151 deletions
+28
View File
@@ -15,6 +15,24 @@ public interface IWslc
/// <summary>Reported in the `hello` capabilities exchange; null when wslc is absent.</summary>
string? WslcVersion { get; }
/// <summary>
/// What this facade can actually do, merged into the `hello` capabilities so hostd degrades
/// instead of discovering the gap at the call site (docs/WINDOWS_PORT.md §2.3, D13). The
/// compat SDK alone cannot serve four of them, so a compat-only broker reports none of:
/// <list type="bullet">
/// <item><c>enumerate</c> — service-backed container enumeration. Without it
/// <c>container.list</c> answers from the broker's OWN roster, so it goes empty across a
/// broker restart and <c>ContainerManager.reconcile</c> sees an empty sandbox.</item>
/// <item><c>reattach</c> — re-adopting a running session or container. Without it a broker
/// restart cannot recover the session and <c>session.ensure</c> fails
/// <see cref="WslcError.SessionExists"/>.</item>
/// <item><c>tty</c> — pty allocation and resize, i.e. §7's Terminal panel.</item>
/// <item><c>stats</c> — per-container resource sampling. Reported when stats are available
/// by ANY means, including the in-guest cgroup read the compat facade falls back to.</item>
/// </list>
/// </summary>
IReadOnlyList<string> Capabilities { get; }
/// <summary>Install the sink BEFORE any operation that can emit events.</summary>
void SetEvents(IBrokerEvents events);
@@ -84,6 +102,16 @@ public sealed class WslcError(string kind, string message) : Exception(message)
public const string PullFailed = "image_pull_failed";
public const string StartFailed = "start_failed";
public const string AiUnavailable = "ai_unavailable";
/// <summary>The installed wslc cannot do this at all (no pty, an unmappable signal). A
/// permanent capability gap, not a transient failure — hostd must not retry.</summary>
public const string Unsupported = "unsupported";
/// <summary>A session of that name is already running and this facade cannot re-adopt it
/// (the compat SDK's `Start()` answers ERROR_ALREADY_EXISTS, and its constructor is lazy, so
/// a second handle is not a second session). Distinct from <see cref="StartFailed"/> because
/// the remedy differs: the sandbox is UP, this broker just cannot reach it.</summary>
public const string SessionExists = "session_exists";
}
// DTOs — property names (after camel-casing) match the §3.3 wire keys exactly.