Repository navigation
fix(sandbox): follow managed Pi updates safely - #37
Merged
Merged
Conversation
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
Support Pi's managed installation without requiring a second npm installation. After
pi update, the next ghafk agent run follows the selected release.~/.pi/agent/bin/pilauncher, including a PATH symlink, for the existingpiprofile.node_modulesread-only. Never execute the launcher or expose the surrounding credential/installer tree.This follows up on the sandbox setup failure encountered while working issue #35; it does not change the
/helpfeature.Security boundaries
The
bind:validator, protected credential directories, credential-copy behavior, git isolation, and network allowlists remain unchanged. The runtime exception is scoped to a validated managed Pi release and does not apply to raw commands or unrelated profiles.Metadata validation is not package-authenticity verification. As with other harnesses, the user's installer and installed executable code remain trusted. Missing or unsupported layouts fail closed rather than broadening access.
Validation
go test -count=1 -v -run '^TestManagedPI' .go build ./...go vet ./...test -z "$(gofmt -l .)"go test -count=1 ./...go run honnef.co/go/tools/cmd/staticcheck@latest ./...go test -race -count=1 -run '^TestManagedPI' .piprofile: file edit, shell execution, reply parsing, and usage parsing all passed.Tests cover release switching without retargeting a prepared sandbox, installer-Node selection with/without a PATH Node, invalid metadata and entrypoints, credential/repository links, hard links, profile scoping, hidden host state, read-only runtime code, and the macOS policy's narrow read grants.
Linux isolation was exercised locally. The GitHub Actions test jobs have now passed on both
ubuntu-latestandmacos-latest: https://github.com/mike-diff/ghafk/actions/runs/37389732227.Deployment
Not deployed. The running timer, installed ghafk binary, and temporary separate-Pi workaround remain unchanged pending review. After installing the reviewed change, remove only the separate-copy
pi:override to use the managed installation.