Skip to content

feat(core): add scoped additional permission profiles - #960

Merged
likun666661 merged 1 commit into
apache:mainfrom
YayoiNanoka:feat/core-additional-permissions
Jul 14, 2026
Merged

likun666661 merged 1 commit into
apache:mainfrom
YayoiNanoka:feat/core-additional-permissions

Conversation

@YayoiNanoka

Copy link
Copy Markdown
Contributor

Summary

Refs #509
Extracted from #880 as an independently reviewable slice.

This PR adds the platform-independent Core contract for granting narrowly scoped, one-call additional permissions.

  • Defines filesystem permissions with read / write access
  • Supports exact path and subtree scopes
  • Supports temporarily enabling network access
  • Validates and bounds permission payloads
  • Canonicalizes, compacts, and deterministically serializes permission profiles
  • Applies additional permissions without mutating the base PermissionProfile
  • Preserves explicit deny precedence
  • Allows an explicit path grant to override protected-metadata default write denial only for the granted target

Scope

This PR only introduces the Core data model and matching primitives.

It does not:

  • request approval from the user
  • store additional permissions across tool calls
  • integrate permissions into Runtime tool execution
  • change the default sandbox execution path
  • implement unsandboxed retry

Runtime orchestration and approval handling will be submitted as separate slices.

Behavior

  • A write grant also permits reading the same target
  • An exact grant does not permit sibling or descendant paths
  • A subtree grant includes the target directory and its descendants
  • Explicit deny entries remain stronger than additional allows
  • The original permission profile remains unchanged
  • Filesystem entries and serialized payloads have defensive size limits

Verification

  • npm test --workspace @maka/core
  • npm run build
  • npm run typecheck

Core tests: 930 passed, 0 failed.

The full test:dist run reached the existing Desktop open-gateway.test.js pending-promise issue; all other completed Desktop tests passed (2474 passed, 1 cancelled when the hanging run was stopped).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants