Repository navigation
feat(native): wire the E2E drive into the native window - #632
Merged
Merged
Conversation
The native window now runs the drive contract from #620 when WOOTC_E2E_DRIVE=1, as the Wails frontend's startE2EDrive does: - E2EDriveLoop (Core) polls every 2 s. With no directive it writes the readiness marker. Otherwise it performs one command through the window and writes the bound report. Malformed directives, changed runs and second install directives are never followed. A mapping refusal is reported as the drive error. - The window makes a person's clicks in order: read the startup status (one elevation, never retried), read the Linux configuration, fill the form through ConsumerConfiguration, check the plan with the engine, accept the Install confirmation, and press Reboot now on Done. - The engine serves E2EDriveDirective, E2EDriveReport and E2EDriveReady in the native configuration session only. They stay inert unless the engine's own environment sets WOOTC_E2E_DRIVE=1. E2EDriveReady is now listed in ProtocolMethods and docs/winui-shell.md. - A directive that names no encryption maps to "none", as the Wails loop's `directive.encryption || 'none'` does. Before, it took the catalogue default. - The harness builds its install directive with gui-drive-directive.py. The Wails directive is byte-identical to before. The native one adds "storageId":"C:" and equals the shared golden. WOOTC_E2E_GUI_FRONTEND selects the frontend (default wails). "native" is refused before any VM work, because the harness cannot launch the native shell yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F5v5GG4NYnpzMrfPCo3vWN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #344. Step 4 after #620: this wires the E2E drive contract into the native window. Do not merge yet; it is for review.
What changes
Window (
MainWindow.xaml.cs). WithWOOTC_E2E_DRIVE=1, a 2-second timer makes the clicks a person makes, in this order:E2EDriveLooptakes over:ConsumerConfiguration.ApplyDriveMapping, writes the values into the visible controls and reads them back;InstallDisclosureTests; the drive does not draw the dialog;The screen, the button state, the hint, the progress step and the error come from what is on screen and from the install gate. A plan the engine refuses, or a failed install, is reported in
error, so the harness fails at once and does not wait.Core.
E2EDriveLoopis the counterpart ofstartE2EDriveine2e.js. It behaves as follows:StartupControlleris the loop's channel. It never waits behind a connection or configuration read, and it answers only through an authenticatedIDriveEngineSession.none, as the Wails loop does (directive.encryption || 'none'). Before, it took the catalogue default. The harness directive names no encryption, and the native install grant accepts onlynoneorluks-passphrase.Native transport. The assessment session implements
E2EDriveDirective(no parameters, so a string comes back, at most 16 KiB),E2EDriveReportandE2EDriveReady(each takes one string and returnsnull). An install session refuses all three locally.Engine (
app/serve.go). The native configuration session now serves the three drive methods. Any other assessment session and the install session still refuse them. They stay inert unless the engine's own environment setsWOOTC_E2E_DRIVE=1, so the shell cannot turn them on.E2EDriveReadywas served but missing fromProtocolMethods; it is now listed in bothProtocolMethodsanddocs/winui-shell.md.Harness (the only harness change in this series).
run-e2e.shbuilds its install directive withtests/e2e/gui-drive-directive.py."storageId":"C:"and is byte-equal to the shared goldendirective-install.json.WOOTC_E2E_GUI_FRONTENDselects the frontend; the default iswails. The valuenativeis refused before any VM work, because the harness cannot launch the native shell yet. Driving the Wails app while recording a native run would give a green result from a proxy.Local validation (head be52c6a)
go test ./...,go vet .,GOOS=windows go vet .inapp/dotnet test Wootc.Shell.Tests(Linux, SDK 10.0.402)dotnet test Wootc.Shell.NativeTestswithEnableWindowsTargetingon LinuxWootc.ShellC# type check on Linux (the XAML compiler replaced by a stub of the named fields), normal andNativeGallery=trueshellcheck --severity=warningon the harness set fromlint.ymltests/run.sh fastfisherman pins user homes…fails, because the submodule is not checked out in this worktreeNot proven, and open questions
run-e2e.sh --gui-installwith the shell as the driven app").runaselevation, and an elevated process may not inherit the shell's environment. A native harness launch will probably needWOOTC_E2E_DRIVE=1set at machine level, so that both the shell and each elevated engine see it. This is not tested.🤖 Generated with Claude Code
https://claude.ai/code/session_01F5v5GG4NYnpzMrfPCo3vWN
Generated by Claude Code