Skip to content

D1b-10: report how WSL moves end, by phase and reason code (R43) - #32000

Closed
nwparker wants to merge 2 commits into
nwparker/wsl-mover-d1b-10-verificationfrom
nwparker/wsl-mover-d1b-10-telemetry
Closed

nwparker wants to merge 2 commits into
nwparker/wsl-mover-d1b-10-verificationfrom
nwparker/wsl-mover-d1b-10-telemetry

Conversation

@nwparker

@nwparker nwparker commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​166 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​164
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​263 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​260

ELI5

When the WSL move starts reaching real users, through internal dogfood and then a staged rollout, we need to know how moves end:

  • how many finish;
  • how many are put back, and at which step;
  • how many are refused, and why;
  • how long they take, and how much they carry.

This adds one anonymous event for that. It contains no names, no paths, and no error text.

What Changed

  • New event wsl_move (src/shared/telemetry-wsl-move-event-schemas.ts), registered like the other main-owned events in telemetry-event-registry.ts and MAIN_OWNED_TELEMETRY_EVENTS. Every field is a fixed enum:
    • outcome: started, finished, reset, refused or waiting_for_host.
    • refusal: the refusal code without its wsl_move_ prefix.
    • phase: the last journal phase reached.
    • reset_reason: for example staged_claim_conflict, repository_path_conflict, distro_unregistered, host_unreachable, terminals_started or commit_rejected.
    • duration_bucket: reuses the SSH runtime buckets.
    • bytes_bucket: what the move sent.
  • runTrackedWslMove (src/main/telemetry/wsl-move-telemetry.ts) wraps the wslMove:start handler.
    • It reports started, watches the move's existing progress stream for the phase and the byte total, and maps the result onto the enums.
    • Raw detail strings are only pattern-matched, never sent. Unknown codes become other.
    • Telemetry errors are swallowed, so they never affect a move.
  • A compile-time check fails the build if a new refusal code is added without a telemetry value.

Why

Linked Issue

N/A (internal stack: D1b-10 of the WSL mover; risk row R43)

Visual Proof

N/A: no UI change.

Testing

  • wsl-move-telemetry.test.ts covers each outcome. Every emitted payload is parsed with the registered strict schema, and the test asserts that a distro name, a path and a migration id never appear.

  • wsl-move-driver-handlers.test.ts checks that the start handler reports started and then finished.

  • pnpm tc:node and check:code-quality:changed are clean.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Before opening, an adversarial reviewer went over this. It found no HIGH issues. Its MEDIUM finding is fixed in 6709a97b40af: a pause refusal after a reset lost its reason. In the same commit I also fixed three LOWs:

  • a thrown run now reports a reset;
  • host_unreachable matches only real transport codes;
  • started is documented as counting attempts.

Left as LOWs:

  • pick and durationBucket duplicate the SSH telemetry helpers;
  • the reported phase comes from progress events, so it can trail the journal by one step.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Gate: the event fires only from wslMove:start, which refuses while ORCA_INTERNAL_WSL_HOSTS is off. Nothing fires for users today.
  • Owner note: open PR refactor: remove telemetry, privacy settings and crash report submission #31267 ("remove telemetry") would remove this pipeline. If it lands, this event goes with it, and R43 needs another source.
  • Not included: the preview-shown and blockers-by-kind events from the R43 row. Add them if dogfood shows refusals need more detail.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker
nwparker force-pushed the nwparker/wsl-mover-d1b-10-telemetry branch from 6709a97 to 110a0b5 Compare October 22, 2026 12:26
@nwparker
nwparker marked this pull request as ready for review October 22, 2026 12:27
nwparker and others added 2 commits October 22, 2026 05:33
@nwparker

Copy link
Copy Markdown
Contributor Author

Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant