Skip to content

Types & config migration: role-store.ts, protocol.ts, YAML files#183

Closed
SuuBro wants to merge 1 commit intogoal/simplify-t-703f66e2from
goal-goal-simplify-t-703f66e2-coder-a351b29c
Closed

Types & config migration: role-store.ts, protocol.ts, YAML files#183
SuuBro wants to merge 1 commit intogoal/simplify-t-703f66e2from
goal-goal-simplify-t-703f66e2-coder-a351b29c

Conversation

@SuuBro
Copy link
Copy Markdown
Owner

@SuuBro SuuBro commented Apr 1, 2026

Simplify grant policy types from 5 values to 3 and migrate config files.

Changes

src/server/agent/role-store.ts

  • Change GrantPolicy type to 'allow' | 'ask' | 'never'
  • Add normalizeGrantPolicy() function (exported) that maps legacy values: always-allowallow, ask-once/always-askask, never-asknever
  • Add normalizeToolPolicies() helper to normalize all values in a policies record
  • Call normalization on role load, put, and update paths
  • Update deriveAllowedTools() to check for 'allow' instead of 'always-allow'

src/server/ws/protocol.ts

  • Update GrantPolicy type to 'allow' | 'ask' | 'never'
  • Remove grantPolicy field from tool_permission_needed server message

Config files

  • .bobbit/config/roles/reviewer.yaml: never-asknever
  • .bobbit/config/roles/general.yaml: ask-onceask
  • No changes needed for tool-group-policies.yaml (already empty) or tool YAML files (no grantPolicy fields)

Expected downstream type errors

Errors in session-manager.ts and tool-activation.ts are expected — those files still reference old policy values and will be updated by other task agents.

🤖 Generated with Bobbit

- Change GrantPolicy type from 5 values to 3: allow, ask, never
- Add normalizeGrantPolicy() to role-store.ts for legacy value migration
- Normalize toolPolicies on role load, put, and update
- Update protocol.ts GrantPolicy type and remove grantPolicy from tool_permission_needed
- Migrate reviewer.yaml: never-ask -> never
- Migrate general.yaml: ask-once -> ask
- tool-group-policies.yaml already empty, no migration needed
- No grantPolicy fields found in tool YAML files

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
@SuuBro SuuBro closed this Apr 2, 2026
@SuuBro SuuBro deleted the goal-goal-simplify-t-703f66e2-coder-a351b29c branch April 9, 2026 12:23
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