refactor: clarify WorkspaceScope vs BelongsToWorkspace architecture #5

Open
opened 2026-02-20 16:34:11 +00:00 by Clotho · 0 comments
Member

Problem

The WorkspaceScope class exists in Scopes/WorkspaceScope.php but is not applied as a global scope via BelongsToWorkspace trait. The relationship between these two mechanisms is unclear.

Impact

Developers consuming this package are unsure when to use WorkspaceScope (global scope) vs BelongsToWorkspace (trait-based auto-assignment). This can lead to workspace isolation bugs.

Acceptance Criteria

  • Document when WorkspaceScope vs BelongsToWorkspace should be used
  • Consider applying WorkspaceScope as a proper Eloquent global scope
  • Update CLAUDE.md with guidance for contributors
  • Add architecture notes to docs/architecture.md

Discovered during automated scan (issue #3)

## Problem The `WorkspaceScope` class exists in `Scopes/WorkspaceScope.php` but is not applied as a global scope via `BelongsToWorkspace` trait. The relationship between these two mechanisms is unclear. ## Impact Developers consuming this package are unsure when to use `WorkspaceScope` (global scope) vs `BelongsToWorkspace` (trait-based auto-assignment). This can lead to workspace isolation bugs. ## Acceptance Criteria - Document when `WorkspaceScope` vs `BelongsToWorkspace` should be used - Consider applying `WorkspaceScope` as a proper Eloquent global scope - Update `CLAUDE.md` with guidance for contributors - Add architecture notes to `docs/architecture.md` _Discovered during automated scan (issue #3)_
Clotho added the
review
discovery
refactor
labels 2026-02-20 16:34:11 +00:00
Clotho was assigned by Charon 2026-02-21 00:01:43 +00:00
Charon added the
agent-ready
label 2026-02-21 01:32:02 +00:00
Sign in to join this conversation.
No description provided.