Investigation: How many parallel role/tier vocabularies exist in the codeba...

Documentation for Sessions

πŸ“ Investigation: How many parallel role/tier vocabularies exist in the codeba...

Date: 2026-03-19
Time: 20:15:55 UTC
Session: gspace1-241.5
Agent: backend
Confidence: 95%
Status: βœ… Documented


πŸ“‹ Decision Context

Question:

How many parallel role/tier vocabularies exist in the codebase and what active bugs do they cause?

Task: Audit role system for dead code, conflicts, and agent confusion


🎯 Decision Made

Chosen:

Found 6+ parallel role vocabularies (VittoUserType, VittoLayer, UserHierarchyType, VittoConfigRole, MCP UserType, SystemRoles enum). Identified 4 active bugs: (1) executive falls to hierarchy level 2, (2) space_builder role check in chat controller is dead code, (3) ROLE_PRIORITY maps manager→admin causing role inflation for builders, (4) buildRoleContext() uses wrong keys so builders get end_user description in prompts. Created comprehensive cleanup handoff for another agent.

Options Considered:


πŸ’­ Reasoning

The S220 unification via PlatformRole and derivePermissions() was only partially adopted. The registration flow, chat controller, tool registry, feature flags, context assembly, and memory persistence all still use pre-S220 vocabularies. This caused AI agents analyzing the codebase to confuse L1/L2 tier labels, leading to incorrect specs and recommendations. The 4 active bugs have real impact: executives stored at wrong hierarchy level, builder-tier users getting admin permissions via role inflation, manager-role users getting wrong chat persona, and every builder chat request getting wrong role description in the system prompt.


πŸ“ Files Involved


πŸ”— Related


Auto-generated by MCP Smart Consolidation