2026-07-29 00:05:26 -07:00
|
|
|
namespace WslcApiDump;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2026-07-29 00:14:32 -07:00
|
|
|
/// The <c>Microsoft.WSL.Containers</c> surface `NucleicBroker/Wslc/WslcFacade.cs` depends on.
|
2026-07-29 00:05:26 -07:00
|
|
|
///
|
2026-07-29 00:14:32 -07:00
|
|
|
/// **This list changed meaning on 2026-07-29.** It began as a list of *guesses* — the facade was
|
|
|
|
|
/// transcribed from documentation on machines with no WSL — and this tool existed to find out how
|
|
|
|
|
/// many were wrong. That question is answered (docs/WINDOWS_PORT.md §13.1: many of them, including
|
|
|
|
|
/// three that were missing capability rather than a wrong name). The entries below are now the
|
|
|
|
|
/// surface **actually observed in package 2.9.3**, so this tool's job has changed from discovery
|
|
|
|
|
/// to **drift detection**: run it after bumping the pin and it says what the new version moved.
|
2026-07-29 00:05:26 -07:00
|
|
|
///
|
2026-07-29 00:14:32 -07:00
|
|
|
/// Still strings rather than typed references, for the same reason as before — a typed check fails
|
|
|
|
|
/// to compile on the first rename and reports one problem; this reports all of them.
|
|
|
|
|
///
|
|
|
|
|
/// Keep in lockstep with WslcFacade.cs.
|
2026-07-29 00:05:26 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal static class FacadeAssumptions
|
|
|
|
|
{
|
|
|
|
|
internal sealed record Assumption(string Type, string Member, Kind MemberKind, string Why);
|
|
|
|
|
|
|
|
|
|
internal enum Kind { Method, Property, Event, Constructor, EnumValue, Type }
|
|
|
|
|
|
|
|
|
|
internal static readonly Assumption[] All =
|
|
|
|
|
[
|
|
|
|
|
// ---- Service entry point: onboarding (§8 step 2) ----
|
2026-07-29 00:14:32 -07:00
|
|
|
new("WslcService", "GetVersion", Kind.Method,
|
|
|
|
|
"hello capabilities — hostd degrades across preview→GA churn on this"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("WslcService", "GetMissingComponents", Kind.Method,
|
2026-07-29 00:14:32 -07:00
|
|
|
"components.missing RPC; returns IReadOnlyList<Component>, NOT a flags enum"),
|
|
|
|
|
new("WslcService", "InstallWithDependencies", Kind.Method, "components.install RPC"),
|
|
|
|
|
new("Component", "WslPackage", Kind.EnumValue,
|
|
|
|
|
"one of the three components onboarding can report missing"),
|
|
|
|
|
new("ServiceVersion", "Major", Kind.Property, "the version triple reported in hello"),
|
2026-07-29 00:05:26 -07:00
|
|
|
|
|
|
|
|
// ---- Session: one per channel, hosts every container (§3.2) ----
|
2026-07-29 00:14:32 -07:00
|
|
|
new("SessionSettings", ".ctor", Kind.Constructor, "SessionSettings(name, storagePath)"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("SessionSettings", "CpuCount", Kind.Property, "session.ensure cpu"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("SessionSettings", "MemorySizeInMB", Kind.Property,
|
|
|
|
|
"session.ensure memoryMB — NOT MemoryMB; a resize needs a sandbox restart (§3.2)"),
|
|
|
|
|
new("SessionSettings", "Timeout", Kind.Property, "idle timeout for the whole session VM"),
|
|
|
|
|
new("Session", ".ctor", Kind.Constructor,
|
|
|
|
|
"there is NO CreateOrOpen — construction is the only entry point, and whether a second "
|
|
|
|
|
+ "construction with an existing name attaches or throws Error.SessionReserved is the "
|
|
|
|
|
+ "open question broker reattach (§2.3) hangs on"),
|
|
|
|
|
new("Session", "Start", Kind.Method, "brings the session VM up after construction"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Session", "Terminate", Kind.Method, "session.terminate RPC"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Session", "Terminated", Kind.Event,
|
|
|
|
|
"session.down notification (SessionTerminationReason) → hostd's reconcile sweep"),
|
|
|
|
|
new("SessionTerminationReason", "Crashed", Kind.EnumValue,
|
|
|
|
|
"distinguishes a crash from an orderly shutdown in the session.down reason"),
|
2026-07-29 00:05:26 -07:00
|
|
|
|
|
|
|
|
// ---- Images ----
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Session", "PullImage", Kind.Method, "image.pull RPC (naros-agent from GHCR), sync form"),
|
|
|
|
|
new("Session", "PullImageAsync", Kind.Method,
|
|
|
|
|
"the async form, which is where pull PROGRESS comes from (ImageProgress)"),
|
|
|
|
|
new("PullImageOptions", ".ctor", Kind.Constructor, "PullImageOptions(uri)"),
|
|
|
|
|
new("PullImageOptions", "RegistryAuth", Kind.Property,
|
|
|
|
|
"GHCR auth — a STRING, not a credentials object"),
|
|
|
|
|
new("ImageProgress", "CurrentBytes", Kind.Property,
|
|
|
|
|
"→ image.pullProgress → the existing controlDownloadProgress UI surface"),
|
|
|
|
|
new("ImageProgressStatus", "Downloading", Kind.EnumValue, "pull progress phase"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Session", "GetImages", Kind.Method, "image.list / image.inspect"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("ImageInfo", "Name", Kind.Property, "image ref — NOT .Reference"),
|
|
|
|
|
new("ImageInfo", "Sha256", Kind.Property, "image digest — NOT .Digest"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Session", "DeleteImage", Kind.Method, "image.delete"),
|
|
|
|
|
|
|
|
|
|
// ---- Containers ----
|
|
|
|
|
new("Session", "CreateContainer", Kind.Method, "container.create"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("ContainerSettings", ".ctor", Kind.Constructor, "ContainerSettings(imageName)"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("ContainerSettings", "Name", Kind.Property, "channel-suffixed container naming"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("ContainerSettings", "HostName", Kind.Property, "container.create hostname — capital N"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("ContainerSettings", "NetworkingMode", Kind.Property,
|
2026-07-29 00:14:32 -07:00
|
|
|
"None | Bridged — NOT the NAT/mirrored pair §5 assumed"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("ContainerSettings", "Volumes", Kind.Property, "the NTFS worktree bind mount (D8)"),
|
|
|
|
|
new("ContainerSettings", "InitProcess", Kind.Property, "naros-init as PID 1 (docs/NAROS.md)"),
|
|
|
|
|
new("ContainerVolume", ".ctor", Kind.Constructor,
|
2026-07-29 00:14:32 -07:00
|
|
|
"ContainerVolume(windowsPath, containerPath, readOnly)"),
|
|
|
|
|
new("ContainerNetworkingMode", "Bridged", Kind.EnumValue,
|
|
|
|
|
"the mode a container needs to reach the host at all (§5)"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Container", "Start", Kind.Method, "container.start"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Container", "Stop", Kind.Method, "container.stop(Signal, TimeSpan)"),
|
|
|
|
|
new("Container", "Delete", Kind.Method, "container.delete(DeleteContainerOption)"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Container", "State", Kind.Property, "container.state → running/stopped/absent"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Container", "Inspect", Kind.Method,
|
|
|
|
|
"the ONLY per-container introspection there is — there is no GetStatistics(), so "
|
|
|
|
|
+ "container.stats has to exec cgroup reads instead (§13.1 finding 2)"),
|
|
|
|
|
new("Container", "CreateProcess", Kind.Method,
|
|
|
|
|
"proc.exec — NOT RunProcess, and it does not start the process"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("ContainerState", "Running", Kind.EnumValue, "the one state the facade tests by name"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("DeleteContainerOption", "Force", Kind.EnumValue, "container.delete force"),
|
|
|
|
|
new("Error", "ContainerNotFound", Kind.EnumValue,
|
|
|
|
|
"structured failure codes — a better source for the RPC's data.kind than string matching"),
|
2026-07-29 00:05:26 -07:00
|
|
|
|
|
|
|
|
// ---- Processes: the agent stdio path (§3.2 WslcProcessHandle) ----
|
2026-07-29 00:14:32 -07:00
|
|
|
new("ProcessSettings", "CommandLine", Kind.Property, "argv — NOT CmdLine"),
|
|
|
|
|
new("ProcessSettings", "EnvironmentVariables", Kind.Property, "env — NOT Environment"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("ProcessSettings", "WorkingDirectory", Kind.Property, "cwd"),
|
|
|
|
|
new("ProcessSettings", "OutputMode", Kind.Property, "event-mode stdio, not polling"),
|
|
|
|
|
new("ProcessOutputMode", "Event", Kind.EnumValue,
|
2026-07-29 00:14:32 -07:00
|
|
|
"the mode that makes stdio push-based; polling would change the broker design"),
|
|
|
|
|
new("Process", "Start", Kind.Method,
|
|
|
|
|
"the second half of exec — handlers are attached between CreateProcess and this, which "
|
|
|
|
|
+ "is precisely why the API is split in two"),
|
|
|
|
|
new("Process", "OutputReceived", Kind.Event, "→ proc.stdout notifications"),
|
|
|
|
|
new("Process", "ErrorReceived", Kind.Event,
|
|
|
|
|
"→ proc.stderr — a SEPARATE event, not a stderr flag on one handler"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Process", "Exited", Kind.Event, "→ proc.exit; must never overtake output (OutboundWriter)"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Process", "GetInputStream", Kind.Method,
|
|
|
|
|
"proc.stdin — a WinRT stream, not a WriteStdin call; closing it is proc.closeStdin"),
|
2026-07-29 00:05:26 -07:00
|
|
|
new("Process", "Signal", Kind.Method, "proc.signal — the agent's real POSIX Stop path"),
|
2026-07-29 00:14:32 -07:00
|
|
|
new("Signal", "SIGKILL", Kind.EnumValue,
|
|
|
|
|
"signals are a NAMED enum; the RPC carries POSIX ints, so the broker maps them, and "
|
|
|
|
|
+ "anything outside None/HUP/INT/QUIT/KILL/TERM is unavailable"),
|
2026-07-29 00:05:26 -07:00
|
|
|
];
|
|
|
|
|
}
|