You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: No runtime logic exists to resolve a model's effective permissions from its trust tier assignment.
Approach: Implement resolveProviderPermission(modelId, action, resource) — looks up model → tier → directory rules → effect. Most-specific glob wins. O(1) tier lookup via pre-built map.
Scope: Resolution engine only. Does not wire into the permission system (that is slice #4).
Acceptance Criteria
resolveProviderPermission(modelId, action, resource) returns the correct Effect for any model/action/resource combination
Unassigned models (not in assignments) resolve against the defaultTier
Most-specific glob wins: ~/secrets/** takes priority over ** for paths under ~/secrets/
Action mapping is correct: read action resolves against the read group, glob/grep also resolve against read; write/edit against write; bash against execute; webfetch/websearch against network
Tier lookup is O(1) — uses a pre-built Map<tierId, TrustTier> not a list scan
Returns undefined when no rule matches (signals fallthrough to existing permission system)
Key Decisions
#
Decision
Rationale
1
Pre-build a Map<tierId, TrustTier> at config parse time
O(1) lookup per tool call
2
Return undefined for no-match (not "ask")
Lets the enforcement hook distinguish "no opinion" from "explicitly ask"
3
Glob specificity by pattern length (longest match wins)
Simple, predictable, matches user mental model
Testing Decisions
Test model in "trusted" tier gets "allow" for all actions
Test model in "limited" tier gets "allow" for read, "deny" for write/execute/network
Test unassigned model falls through to default tier
Test most-specific-glob precedence (specific dir rule overrides wildcard)
Important
Decision Surface
Problem: No runtime logic exists to resolve a model's effective permissions from its trust tier assignment.
Approach: Implement
resolveProviderPermission(modelId, action, resource)— looks up model → tier → directory rules → effect. Most-specific glob wins. O(1) tier lookup via pre-built map.Scope: Resolution engine only. Does not wire into the permission system (that is slice #4).
Acceptance Criteria
resolveProviderPermission(modelId, action, resource)returns the correctEffectfor any model/action/resource combinationassignments) resolve against thedefaultTier~/secrets/**takes priority over**for paths under~/secrets/readaction resolves against thereadgroup,glob/grepalso resolve againstread;write/editagainstwrite;bashagainstexecute;webfetch/websearchagainstnetworkMap<tierId, TrustTier>not a list scanundefinedwhen no rule matches (signals fallthrough to existing permission system)Key Decisions
Map<tierId, TrustTier>at config parse timeundefinedfor no-match (not "ask")Testing Decisions
Constraints & Invariants
Source
Part of #163
Blocked by #164