feat(tui): persist permission rules from approval prompts#1509
feat(tui): persist permission rules from approval prompts#1509greyfreedom wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a comprehensive tool permission system, introducing typed rules for shell commands and file paths with support for persistent allow, deny, and ask decisions. The changes include a new execution policy engine, integration with the TUI for rule management and previews, and logic to merge project-specific security constraints. Feedback identifies several high-severity issues: the configuration persistence logic currently strips user comments; a security vulnerability exists in apply_patch where patches aren't always validated; diff header parsing fails on timestamps; and parallel tool calls are insecurely auto-approved by default. Medium-severity concerns regarding rule resolution performance and manual TOML string escaping were also noted.
e3658e5 to
5642416
Compare
|
Thanks for the contribution. I’m keeping the v0.8.33 branch focused on final release polish and not pulling this PR into that branch right now. Leaving it open for review in the next cycle. |
fe172e7 to
9a3a386
Compare
9a3a386 to
ca2f99f
Compare
|
This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current |
Since I cannot reopen the current PR, I created a new PR #2062 . |
Summary
Add TUI support for persisting typed permission rules directly from tool approval prompts.
This builds on the typed execpolicy/config work by letting users save a scoped allow rule while approving a tool call, with a preview of the rule that will be written to user config.
Changes
ApprovalRequest.s: save this rule and approvep: view the full generated rule preview[[permissions.rules]].ExecPolicyEngineso the current session benefits immediately.apply_patchvia extracted patch/file pathsedit_fileandfile_edit.Safety Notes
Tests
cargo fmt --allcargo test -p deepseek-execpolicy --all-featurescargo test -p deepseek-tui persistent_permission --all-featurescargo test -p deepseek-tui typed_permission --all-featurescargo test -p deepseek-tui approval --all-featurescargo test -p deepseek-tui persist_permission --all-featurescargo clippy -p deepseek-tui --all-targets --all-features -- -D warningsgit diff --checkDepends On
This PR is stacked on top of PR2: feat/execpolicy-typed-rules
Closes #1186
Depends on #1413