feat: explicit consent for /etc/wsl.conf — opk wsl-add-opencode-1-fix - #103
Merged
Merged
Conversation
The kit never writes /etc/wsl.conf on its own anymore (policy: docs/design/wsl-conf-consent.md, rule in AGENTS.md): - install.sh/update.sh deploy only the browser-bridge stand-in tree and strip kit-owned legacy content (the broken 0.0.36 section); the wsl.conf carrier block is never written implicitly. An existing carrier stays untouched and keeps working. - new 'sudo opk wsl-add-opencode-1-fix' (bin/opk): the single command that writes wsl.conf — deploys the stand-in and writes the pure-comment carrier block (WSL-silent, issue #100). status.sh distinguishes stand-in-only from fully active and names the command; the wrapper and update.sh point at it too. - the [automount] /mnt/c hardening is no longer prompted+written by install.sh — it prints the ready-to-run snippet (resolved uid/gid) instead; the kit never edits the file. - uninstall asks before removing kit-owned wsl.conf content (default yes, --yes assumes yes); declining prints the exact line range to delete by hand. The stand-in tree always goes. Docs: design record, security model, files/cli/troubleshooting/uninstall pages, AGENTS rule. Tests: consent-policy coverage (install leaves wsl.conf byte-for-byte untouched, legacy strip, uninstall prompt), parser simulations unchanged. make test / lint green; e2e 269 passed, e2e-rootless 47 passed.
…s older deploys The wsl-add-opencode-1-fix command sourced the stand-in from $LIBDIR/bin/browser-bridge — a file neither install.sh nor update.sh ever deployed (only the fetch lists carried it; the stand-in went straight into the wsl/ tree), so the command errored out on every real install. - install.sh + update.sh now deploy bin/browser-bridge (755) with the library - the command redeploy from the library when present, falls back to write-only when just the tree exists (updates from older kits), and only errors when neither is there - files.md row updated; static deploy-list check added
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.
What
The kit never writes
/etc/wsl.confon its own anymore. A new explicitcommand,
sudo opk wsl-add-opencode-1-fix, is the only code path thatwrites the file — install/update deploy the browser-bridge stand-in tree
and strip kit-owned legacy content, nothing more.
Why
Issue #100 showed what an implicit wsl.conf write costs when it goes
wrong: WSL aborted parsing the whole file and the user's own settings
silently stopped applying. A yes/no prompt buried in the install flow is
not informed consent for editing user-owned system config either — the
[automount]hardening was written after exactly such a prompt.Policy record:
docs/design/wsl-conf-consent.md; repo rule added toAGENTS.md.Changes
sh/wsl-browser-bridge.shrefactored:deploy_tree(tree only),strip_legacy(0.0.36 regression cleanup, never writes),install=tree + strip,
write_confreserved for the explicit command. Existingcarriers are never touched by updates.
opk wsl-add-opencode-1-fix(bin/opk): deploys the stand-in andwrites the pure-comment carrier block (WSL-silent on every version,
issue opencode permission kit 0.0.36 issue with /etc/wsl.conf #100); idempotent; falls back to carrier-only when an older
deploy already has the tree. Fixed along the way: install.sh/update.sh
now actually deploy
bin/browser-bridgeinto the library (it was onlyin the fetch lists, so the command errored on real installs).
[automount]/mnt/c hardening is no longer prompted+written byinstall.sh — it prints the ready-to-run snippet (resolved uid/gid)
instead; final warning and wrapper/status hints adapted.
opk statusdistinguishes "stand-in only" from "fully active" andnames the command; the wrapper and update.sh point at it too.
yes,
--yesassumes yes); declining prints the exact line range todelete by hand — after uninstall there is no
opkleft to do it.Validation
make test(28 browser-bridge tests incl. all three parsersimulations and the consent assertions, 45 wsl-exposure checks),
make lint— greenmake e2e(269 passed),make e2e-rootless(47 passed)opk statusshows "stand-in only —no wsl.conf carrier" with the fix hint,
sudo opk wsl-add-opencode-1-fixwrites the block, login flow survives via the stand-in
Follow-up of #100 (its carrier mechanism is unchanged — only who writes
it, when).