Architecture: How to eliminate hardcoded workspace references and enable d...

Documentation for Sessions

🏗️ Architecture: How to eliminate hardcoded workspace references and enable d...

Date: 2026-02-10
Time: 23:03:18 UTC
Session: gspace1-104.3
Agent: backend
Confidence: 92%
Status: ✅ Documented


📋 Decision Context

Question:

How to eliminate hardcoded workspace references and enable dynamic workspace groups?

Task: Session 104: Smart Workspace Detection and Dynamic Groups


🎯 Decision Made

Chosen:

WorkspaceGroupService reads WORKSPACE_GROUPS env var (format: 'gograb-dev:gspace1,editor2|staging:staging1,staging2'), provides getSiblings() and getGroupMembers(). Chrome extension auto-detects workspace from GET /infrastructure/workspace-config endpoint. All 9 hardcoded workspace references replaced.

Options Considered:

  1. Environment-driven workspace groups with backend config endpoint
  2. Hardcode workspace groups in shared library
  3. Database-driven workspace configuration
  4. Runtime service discovery

💭 Reasoning

Chrome extensions can't read .env.local (browser context, not filesystem). The MCP server already had workspace-config.ts pattern. Backend endpoint returns workspace config, extension caches in chrome.storage. WorkspaceGroupService replaces 3 hardcoded sibling maps in backend services. Pipe-separated group format allows multiple workspace groups as the platform scales beyond 2 dev workspaces.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation