refactor: granular deny for 23 git subcommands, allow for uncovered ones#209
Merged
Conversation
Replace the overly aggressive 'git *': 'deny' policy with a three-level
classification system: deny for 23 subcommands covered by MCP tools,
allow for uncovered subcommands (init, clone, config, submodule, etc.),
and ask for unknown git subcommands.
- classifier: mcpTools reduced 31->23, allowedSubcommands expanded 9->22
- hook-check: emits real permissionDecision=deny for deny+ask decisions
- OpenCode: 23 granular 'git {sub}': 'deny' + 'git *': 'ask' fallback
- Pi: new pi_config.go with @pi-lab/permissions deny/ask rules
- Tests: 11 new Pi unit tests, all existing tests updated for deny
- Docs: hooks.md, troubleshooting.md, mcp-clients.md reflect deny behavior
Closes #205
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Closes #205
PR Type
Summary
"git *": "deny"with granular three-level classificationChanges
internal/classifier/gitcmd/classifier.gointernal/delivery/cli/hook_check.gointernal/installer/mcp_config.gointernal/installer/pi_config.gointernal/installer/installer.gointernal/classifier/gitcmd/classifier_test.gointernal/delivery/cli/hook_check_test.gointernal/installer/opencode_policy_test.gointernal/installer/pi_config_test.gointernal/installer/v26_test.godocs/hooks.mddocs/mcp-clients.mddocs/troubleshooting.mdTest Plan
go test ./...— all 40+ packages passgo vet— cleanContributor Checklist
type:*labelCo-Authored-Bytrailers