chore(pi): require reviewed typed tools #205

Merged
jwilger merged 1 commit from pi-safe-tools-review into main 2026-05-15 09:56:56 -07:00
Owner

Summary

  • add reviewed safe_commit and safe_push Pi tools for explicit-path commits and validated Forgejo branch pushes
  • deny direct Pi bash execution by default so new executable capabilities must be added or modified as typed Pi tools under RGR/tests/review
  • add executable Pi guardrail contract coverage and include the new guardrail files in the Nix source filter

Branch hygiene

  • fetched origin/main before preparing the branch
  • created pi-safe-tools-review from origin/main (573cefc)
  • branch contains exactly one commit on top of origin/main: f687c3f chore(pi): require reviewed typed tools

Verification

  • node tests/release_tooling/pi_guardrails_contract_test.mjs
  • git diff --check
  • GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgSign GIT_CONFIG_VALUE_0=false tests/release_tooling/release_script_flake_test.sh test_pi_guardrails_route_git_commit_and_push_through_safe_tools
  • GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgSign GIT_CONFIG_VALUE_0=false tests/release_tooling/release_script_flake_test.sh test_pi_guardrails_deny_bash_and_route_capabilities_through_reviewed_tools
  • pre-commit lefthook ran nix flake check successfully while creating f687c3f
## Summary - add reviewed `safe_commit` and `safe_push` Pi tools for explicit-path commits and validated Forgejo branch pushes - deny direct Pi `bash` execution by default so new executable capabilities must be added or modified as typed Pi tools under RGR/tests/review - add executable Pi guardrail contract coverage and include the new guardrail files in the Nix source filter ## Branch hygiene - fetched `origin/main` before preparing the branch - created `pi-safe-tools-review` from `origin/main` (`573cefc`) - branch contains exactly one commit on top of `origin/main`: `f687c3f chore(pi): require reviewed typed tools` ## Verification - `node tests/release_tooling/pi_guardrails_contract_test.mjs` - `git diff --check` - `GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgSign GIT_CONFIG_VALUE_0=false tests/release_tooling/release_script_flake_test.sh test_pi_guardrails_route_git_commit_and_push_through_safe_tools` - `GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgSign GIT_CONFIG_VALUE_0=false tests/release_tooling/release_script_flake_test.sh test_pi_guardrails_deny_bash_and_route_capabilities_through_reviewed_tools` - pre-commit lefthook ran `nix flake check` successfully while creating `f687c3f`
chore(pi): require reviewed typed tools
All checks were successful
CI / Verify PR with nix flake check (pull_request) Successful in 3m42s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Successful in 2s
CI / Publish PR artifact packages (pull_request) Successful in 1s
auto_review auto_review: 2 warnings
f687c3ff4f
Add safe git Pi tools, deny direct bash execution, and require missing executable capabilities to be added as reviewed typed tools with RGR coverage.
auto-review left a comment

This PR introduces new Pi tools for safe Git operations and enforces stricter execution policies by denying direct bash execution. The changes appear well-structured and include comprehensive tests, but the shift to deny bash by default requires careful validation to ensure no essential operations are blocked.

Walkthrough

  • auto-review-git-safety.mjs: Introduces functions to validate and enforce safe Git operations, such as safe_commit and safe_push.
  • auto-review-guardrails.ts: Updates to integrate new safety functions and block direct bash execution.
  • pi-permission-system/config.json: Changes to deny all bash execution by default, requiring capabilities to be routed through typed Pi tools.
  • flake.nix: Updates to include new files in the Nix source filter.
  • pi_guardrails_contract_test.mjs: New test file to validate the functionality of the new safety features.
  • release_script_flake_test.sh: Adds tests to ensure the new guardrails are functioning correctly and that bash execution is properly denied.
This PR introduces new Pi tools for safe Git operations and enforces stricter execution policies by denying direct bash execution. The changes appear well-structured and include comprehensive tests, but the shift to deny bash by default requires careful validation to ensure no essential operations are blocked. ## Walkthrough - **auto-review-git-safety.mjs**: Introduces functions to validate and enforce safe Git operations, such as `safe_commit` and `safe_push`. - **auto-review-guardrails.ts**: Updates to integrate new safety functions and block direct bash execution. - **pi-permission-system/config.json**: Changes to deny all bash execution by default, requiring capabilities to be routed through typed Pi tools. - **flake.nix**: Updates to include new files in the Nix source filter. - **pi_guardrails_contract_test.mjs**: New test file to validate the functionality of the new safety features. - **release_script_flake_test.sh**: Adds tests to ensure the new guardrails are functioning correctly and that bash execution is properly denied.
@ -599,0 +617,4 @@
pi.registerTool({
name: "safe_commit",
label: "Safe Commit",
description:
Owner

🟡 Warning: Lines 620–759: The change to block direct bash execution by default is significant. Ensure that all necessary capabilities are covered by typed Pi tools to avoid disrupting workflows.

🟡 **Warning:** **Lines 620–759:** The change to block direct bash execution by default is significant. Ensure that all necessary capabilities are covered by typed Pi tools to avoid disrupting workflows.
jwilger marked this conversation as resolved
Owner

🟡 Warning: The change to deny all bash execution by default in the permission system is a major shift. Verify that this does not inadvertently block necessary operations that have not yet been converted to typed Pi tools.

🟡 **Warning:** The change to deny all bash execution by default in the permission system is a major shift. Verify that this does not inadvertently block necessary operations that have not yet been converted to typed Pi tools.
jwilger marked this conversation as resolved
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!205
No description provided.