Uh oh!
There was an error while loading. Please reload this page.
feat(installer): provision Docker for the daily user during the elevated window (#418) - #493
Conversation
…indow Hospital/enterprise reality: the researcher gets a temporary admin window (or IT installs), then elevation is revoked -- leaving the standard account unable to use Docker, a cluster that may not recover, and a 50%-of-RAM VM that OOMs training. The installer runs elevated, so provision the day-to-day account now. New Set-DailyUserProvisioning (warn-only; TRACEBLOC_SKIP_DAILY_USER opts out): - Resolves the daily user (-DailyUser param, else prompt when an admin installs for someone else, else the current account); Resolve-DailyUser strips the domain. - net localgroup docker-users <user> /add so the standard account can use Docker. - Docker Desktop autostart via the per-user Run key (current user). The engine also runs as a service (--always-run-service, #419), so Docker is usable on sign-in regardless; cluster nodes already carry restart=unless-stopped (Set-ClusterAutostart). - Writes a training-sized %UserProfile%\.wslconfig (Get-WslConfigMemoryGb: physical RAM - 4 GB, floored) for the daily user, preserving an existing tuned file. It applies at the daily user's next sign-in -- the acceptance scenario -- so we do NOT wsl --shutdown and tear down the just-built cluster mid-install. - Prints a "Configured for <user>: ..." summary so IT can review what changed. Tests: Get-WslConfigMemoryGb (cap/floor), Get-WslConfigContent, Resolve-DailyUser, plus source guards for docker-users / .wslconfig-preserve / opt-out + wiring. Closes#418 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 30, 2026
👋 Heads-up — Code review queue is at 36 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
LukasWodka
commented
Jul 30, 2026
👋 Heads-up — Code review queue is at 37 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- .wslconfig merge: Add-WslMemorySetting keeps an existing memory= AND preserves any other tuning (processors/swap/other sections) instead of overwriting the whole file. Inserts under an existing [wsl2] header, else appends a section. - missing profile: when the daily user has never signed in (Get-UserProfileDir null), note ".wslconfig after first sign-in" in the summary instead of silently skipping. - elevation: forward -DailyUser through Get-ElevationCommand / Invoke-SelfElevate so the choice survives the UAC relaunch. - input hygiene: sanitize the prompted username via ConvertTo-SanitizedInput before it reaches net localgroup and profile paths. Tests: Add-WslMemorySetting (create/keep/insert-preserve/append-preserve), Get-UserProfileDir null, plus wiring guards for the merge helper, the no-profile note, the sanitize call, and -DailyUser elevation forwarding. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Never hide a docker-users failure behind a green summary (High). Membership is the make-or-break step; track $dockerUsersOk and, when it doesn't take, WARN loudly (with the manual `net localgroup ... /add` to run while admin is still available) even if autostart/.wslconfig succeeded. Green "Configured for" now only prints when membership is confirmed. - Verify membership by STATE QUERY instead of string-matching 2>&1-merged native output (Medium; learned PS rule). New Test-LocalGroupMember (Get-LocalGroupMember, falling back to `net localgroup <group>` STDOUT) + pure Test-NameInGroupOutput (domain-stripped, case-insensitive) replace the locale-fragile `-match 'already a member'` classification. Tests: Test-NameInGroupOutput (bare-name/domain/case/empty), plus source guards for the state-query verification and the loud-warn-on-failure summary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Bugbot round 3 (Medium): when Get-PfMemGb returns null the .wslconfig budget was
skipped with no summary note -- unlike the null-profile path -- so a green
"Configured for" could print while the training memory budget was never applied.
Add the matching note ("couldn't detect host RAM -- set [wsl2] memory manually")
so IT sees the gap. Guard test added.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 74f2885. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Bugbot round 4 (Medium): if the .wslconfig merge/write throws (permissions/disk), the catch only Logged and recorded no summary note, so with docker-users already confirmed the green "Configured for" line still printed as if the memory budget was set. Add a "couldn't write .wslconfig -- set [wsl2] memory manually" note in the catch, matching the null-profile / RAM-unknown paths. Guard test added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.

What & why
Hospital/enterprise reality: the researcher gets a temporary admin window (or IT runs the install), then elevation is revoked. Today Docker Desktop only auto-adds the installing user to
docker-users, autostart + the WSL memory budget are printed Hints — so the researcher's standard account can end up with a broken Docker, a cluster that doesn't recover after reboot, and a 50%-of-RAM VM that OOMs training. The installer runs elevated, so it should just do it.Changes (
scripts/install-k8s.ps1)New
Set-DailyUserProvisioning(warn-only;TRACEBLOC_SKIP_DAILY_USERopts out), run during the elevated session:-DailyUserparam, else a prompt when an admin installs for someone else, else the current account (Resolve-DailyUserstrips the domain).net localgroup docker-users <user> /addso the standard account can use Docker.--always-run-service(feat(installer): control Docker Desktop install flags (--accept-license --backend=wsl-2) #419), so Docker is usable on sign-in regardless, and cluster nodes already carryrestart=unless-stopped— so the cluster recovers.)%UserProfile%\.wslconfig—Get-WslConfigMemoryGb= physical RAM − 4 GB (floored) — written for the daily user, preserving an existing tuned file. It applies at the daily user's next sign-in (the acceptance scenario), so we deliberately do notwsl --shutdownand tear down the just-built cluster mid-install.<user>: …" summary so IT can review what changed.Acceptance (from #418)
docker-usersadd.wslconfig(capped at physical − 4 GB)<user>" summaryScope notes
.wslconfigtakes effect at the daily user's next sign-in/reboot — the exact "next day" acceptance scenario — so no disruptive mid-installwsl --shutdown.--always-run-service(feat(installer): control Docker Desktop install flags (--accept-license --backend=wsl-2) #419) already makes Docker usable for them on sign-in.Tests
Pure helpers (
Get-WslConfigMemoryGbcap/floor,Get-WslConfigContent,Resolve-DailyUser) + source guards (docker-users add,.wslconfigpreserve-existing, opt-out + wiring).Local verification
Pester 309/0/9 · check-style pass · drift clean · manifest regenerated · PS parse OK. (No bash changes — bats unaffected.)
Closes#418
Note
Medium Risk
Changes local group membership and per-user registry/files on the host during install; failures are warn-only but mis-provisioned docker-users would block non-admin Docker use.
Overview
Adds daily-user provisioning to the Windows installer so IT can configure the researcher's standard account while elevation is still available, instead of leaving Docker usable only for whoever ran the install.
After a successful client install,
Set-DailyUserProvisioning(warn-only;TRACEBLOC_SKIP_DAILY_USERto skip) resolves the target user via-DailyUser, an optional prompt, or the current account, then adds them todocker-users(verified withTest-LocalGroupMember, not localizednetoutput), sets Docker Desktop autostart for the installing user when applicable, and merges a training-sized[wsl2] memory=into the user's.wslconfig(host RAM − 4 GB, preserving existing tuning).-DailyUseris forwarded through UAC self-elevation so it survives relaunch.Pester coverage covers the pure helpers and source guards;
scripts/manifest.sha256is updated forinstall-k8s.ps1.Reviewed by Cursor Bugbot for commit a183119. Bugbot is set up for automated code reviews on this repo. Configure here.