feat: opt-in workspace dev mounts (edit Pi extensions without an image rebuild)#786
Draft
runyaga wants to merge 1 commit into
Draft
feat: opt-in workspace dev mounts (edit Pi extensions without an image rebuild)#786runyaga wants to merge 1 commit into
runyaga wants to merge 1 commit into
Conversation
…eration KLANGK_WORKSPACE_DEV=1 + KLANGK_WORKSPACE_DEV_EXTENSIONS_DIR mounts a host directory of Pi extensions read-only into ~/.pi/agent/extensions, which Pi auto-discovers in addition to the image's baked extensions. So an extension edit takes effect on the next workspace open with no podman image rebuild, and the baked builtin/plugin extensions are not hidden (additive mount). - container.py: workspace_dev_mounts() helper, appended to container binds. Returns [] (default/prod unchanged) when off / dir unset / dir missing. - tests: full branch coverage of the helper. - docs/dev/workspace-dev-mounts.md: usage + scope. Validated on the real klangk-arm64 image: host edit reflects live in the running container with no rebuild/restart, including nested under the /home mount.
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.
Summary
Opt-in (off by default) fast-iteration path for the container side: edit Pi extensions in a running workspace without the
klangk:build-workspace-image(podman build) round-trip. Companion to the web-frontend dev mode in #785 — same "layered, opt-in, default-unchanged" philosophy.How
The workspace container is long-lived (
sleep infinity; sessions viapodman exec) and Pi auto-discovers~/.pi/agent/extensions/in addition to the baked image dir (klangk-setup-clankers.py:64). So a host dir mounted there is additive — it doesn't hide the baked builtin/plugin extensions — and host edits show up on the next workspace open with no rebuild.container.py::workspace_dev_mounts()returns the extra read-only bind specs appended to the containerbinds; returns[](default/prod unchanged) when the flag is off, the dir is unset, or the dir is missing (missing logs a warning).Validation
klangk-arm64image: mounted a host dir of extensions into a running workspace container; a host edit reflected live with no rebuild and no restart, including the nested case under the/homemount.workspace_dev_mounts()(flag off / off-with-dir / on-no-dir / on-missing-dir-warns / on-valid-dir / disabled-value). 6 tests, all green.TestAllowedMountRoots/TestProtectedPathstests fail locally on macOS only (/tmp→/private/tmprealpath); they fail identically onmainand pass on Linux CI.Scope / follow-ups
Covers extensions (the common case). Tools (
/opt/klangk/bin) and the frequently-editedklangk-*scripts live outside/homeand would need per-file mounts or a merged dir — left as a follow-up to keep this additive and small.See
docs/dev/workspace-dev-mounts.md. Strategy rationale in #785'sdocs/dev/web-fast-iteration.md.