Allow ExecutionPlan at policy layer and add visible Pi approval/run UI#365
Merged
mmprotest merged 1 commit intoMay 29, 2026
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.
Motivation
ExecutionPlanas ALLOW at the permission-policy layer.Description
PermissionEngine.evaluate_with_reasonnow explicitly returnsALLOWforExecutionPlan(after deny precedence), andExecutionPlan(*)is added to the default Runner allowlist so planning is treated as internal/read-only.ensure_project_memory_and_planinstate_runtime.pynow consultsrunner.permissions.evaluate_with_reason("ExecutionPlan", ...)and emits apolicy_decisionevent;ALLOWauto-approves,DENYaborts, otherwise falls back to the existing approval flow (no special-casing in the Pi bridge).integrations/pi-villani/src/index.tswas updated to maintain persistent visible state via helper functions (setVillaniStatus,setVillaniWidget,clearVillaniUi,showFinalRunMessage) and to update status during startup, model-proxy start, runtime start, running, awaiting approval, denial, abort, and final completion/failure. Approval handling now sets a visible widget/message before invoking confirmation and clears/updates it after the decision.ExecutionPlanis allowed without invoking approval callback and that Write/Patch/Bash still require approval; added bridge integration tests to ensure noapproval_requiredis emitted forExecutionPlan; updated TypeScript extension tests to assert visible status/widget updates before and after approvals and on lifecycle events.Testing
python -m pytest -q tests/integrations/test_pi_bridge.py tests/test_runner_approvals.py tests/test_auto_approve.py tests/test_state_runtime.py tests/test_permissions.py— all tests passed (77 passed, 1 skipped).cd integrations/pi-villani && npm test— extension test suite passed (all subtests OK).cd integrations/pi-villani && npm run build— build succeeded.pi install .was attempted but failed in this environment because thepicommand is not available (expected environment limitation).Codex Task