Repository navigation
Conversation
Break src/permissions/permissions.ts into focused modules (types, rules, requestSummary, sandboxPolicy, autoMode, webFetchPolicy, planMode) while keeping all existing exports, decision ordering, and permission behavior unchanged. Also widen the frontend boundary guard to cover all of src/permissions/. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Part of #47
Unblocks #152
Related: #99
Summary
Pure structural refactor of
src/permissions/permissions.ts(671 lines → 121 lines) into cohesive modules ahead of migrating permission checks to named capability-driven steps (#152). No permission behavior, decision ordering, rule matching, or public exports are changed.src/permissions/types.ts— shared permission types (PermissionBehavior,PermissionMode,PermissionDecision,PermissionRuleSet,PermissionSettings,PermissionRequest,PermissionResponse,PermissionCheckParams).src/permissions/rules.ts— rule matching (matchesPermissionRule,matchesAnyRule,findFirstMatchingRule), settings loading (loadPermissionSettings), target extractors, and policy sets (PLAN_ALLOWED_TOOLS,COORDINATION_TOOLS, Bash hard-deny / dangerous prefix checks).src/permissions/requestSummary.ts—summarizePermissionRequest,buildPermissionRuleHint,getRiskLabel,buildPermissionRequest.src/permissions/sandboxPolicy.ts—checkSandboxAutoAllowandresolveSandboxAutoAllow.src/permissions/autoMode.ts—resolveAutoModeDecision.src/permissions/webFetchPolicy.ts—resolveWebFetchDecision.src/permissions/planMode.ts—resolvePlanModeDecision.src/permissions/permissions.ts— orchestratescheckPermissionand re-exports all existing public symbols so all existing callers remain compatible.scripts/check-frontend-boundaries.ts— widens thepermissions/permissionsboundary entry topermissions/so frontends cannot bypass the boundary via the newly extracted modules.Compatibility & Scope
Verification
npm run typecheck— passednpm run lint— passed (0 warnings)npm run format:check— passednpm run check:source-hygiene— passed (349 files, 0 violations)npm run check:frontend-boundaries— passed (75 files, 0 violations)npm run check:config-inventory— passednpm run build— passednpm run verify:production:tests— 93/93 passed (0 skipped, 0 failed)npm run verify:production:platform— 2/2 passed (sandbox-host,bash-sandbox-host)npm run perf:trace— 2/2 passed (p95 0.24 ms, 0.77× transcript)node --import tsx src/scripts/test-stage36.ts(npm run verify:release) — 73/73 passed (includes isolated install, Headless, and interactive PTY startup)Generated with Devin