Skip to main content

Variable Scope: Drag, Drop, Organize

· 3 min read
Masterminds Team
Product Team

Your variables just became portable. Move them between scopes the same way you move files on your desktop.

The Problem

Until now, variables lived where they were created. A session variable stayed in your session. A system variable stayed system-wide. If you wanted to promote a personal insight to a team-wide resource, you had to recreate it manually.

That friction killed knowledge reuse.

What Changed

Drag and Drop Across Scopes

Every variable in the journey tree is now draggable. Drop it into a different scope node and it moves there. The interaction follows your operating system's conventions:

  • Default drag = Move. The variable relocates to the target scope.
  • Option + drag (Mac) or Ctrl + drag (Windows) = Copy. The original stays; a new copy appears in the target scope.

After a move, you're asked: "Delete original doc(s)?" This gives you the final say.

Scope Hierarchy

Variables now follow a clear precedence:

  1. Session (highest priority) -- your personal work in this conversation
  2. Initiative -- shared within a specific initiative
  3. System (lowest priority) -- available company-wide

When the same variable exists in multiple scopes, session always wins. This means you can safely experiment in your session without affecting anyone else's view.

Copy, Not Destroy

Promotion uses COPY semantics. When you drag a session variable to the system scope, the original stays in your session. The system scope gets a fresh copy. No work is lost, no surprises.

Why This Matters

Knowledge management in AI-first workflows is hard because context is ephemeral. This feature makes it tangible:

  • Personal exploration is safe. Session scope is yours. Experiment freely.
  • Promotion is intentional. Drag to initiative or system only when you're ready.
  • Team knowledge accumulates. System variables become the shared baseline that every session inherits.

Quick Start

  1. Open the Journey Navigator (left panel tree view)
  2. Find the variable you want to move
  3. Drag it to the target scope node
  4. Hold Option (Mac) or Ctrl (Windows) while dragging to copy instead
  5. Confirm or dismiss the post-promotion dialog

Technical Notes (for SWEs)

  • Single-table model: mvpl_variables with scope column
  • Scope rank: session=1, initiative=2, system=3
  • Runtime selection: mvpl_select_runtime_variables() applies scope precedence
  • RLS policies enforce per-scope access control
  • Migration: 20260214161000_mvpl_variables_scope_single_table_mvp.sql
  • Chrome suppresses keydown during drag on Mac -- implementation uses event.altKey on DragEvent directly

What's Next

  • Variable RBAC: fine-grained permissions per scope (in planning)
  • Variable versioning: track changes across promotions (spec complete)
  • Bulk scope operations: move/copy multiple variables at once