Expand description
The one non-secret file this feature writes on the Windows side: a record per managed WSL distribution.
§It is advisory, and being advisory is what makes it safe
02-target-architecture.md is explicit: “the record is advisory: status
verifies actual WSL/service state and reports drift. A missing record never
licenses deletion inside a distribution.” Everything in the shape of this
type follows from that sentence.
Nothing here is a source of truth about the distribution. wsl status asks
WSL whether the distribution is there, asks the Linux service whether it is
healthy, and asks Task Scheduler whether the task exists; the record only
says “this workstation believes it manages this one, and here is what it
last installed”. So a record that is stale, hand-edited, or absent
degrades a status line and can never cause a deletion.
§What it may not contain
03-security-and-lifecycle.md item 3 lists provider records among the
places the credential document must be absent from, and
02-target-architecture.md adds GitHub JIT configuration and repository
policies. Two things enforce that rather than one:
- the struct has five fields and none of them could hold a secret; and
- it is
#[serde(deny_unknown_fields)], so a document that grew atokenkey — by a hand edit, or by a future version writing one — fails to parse instead of being read and re-written.
The second is the one that matters over time. A field nobody added cannot
leak; a field somebody adds later is caught by
a_record_carrying_a_credential_field_is_refused_rather_than_ignored.
§Schema version
PROVIDER_RECORD_SCHEMA_VERSION is written and checked. A record from a
newer version is refused rather than read on a best-effort basis: this
product supports downgrades through update, and a 0.4 binary silently
half-reading a 0.5 record — then rewriting it, dropping whatever it did not
understand — is how the newer install loses state.
Structs§
- WslProvider
Record - One managed WSL distribution, as this workstation last saw it.
Constants§
- PROVIDER_
RECORD_ DIR - The directory, under the config directory, that holds the records.
- PROVIDER_
RECORD_ SCHEMA_ VERSION - The schema this version writes and is willing to read.