feat(N1): Scope-Registry via Contract — workspace_scopes() Deklarationen + /scope-definitions Endpoint #365

Closed
opened 2026-08-31 21:15:25 +00:00 by Leopoldadmin · 0 comments
Owner

N1 — Scope-Registry via Contract (Phase N)

Roadmap: PLATFORM_ROADMAP.md → Phase N, Task N1 | Milestone: Phase N — Workspace-Scopes (#14) | Label: task

Umsetzung

  • workspace_scopes()-Contract-Hook (document_placeholders-Muster): Plugins deklarieren Scope-Dimensionen ihres Moduls inkl. Wertequellen
  • Pydantic-Validierung fail-closed in app/schemas/workspace.py: ScopeOption, ScopeValueSource (nur interne /api/v1/-Pfade, SSRF-sicher), WorkspaceScopeDimension (multiselect/select brauchen options ODER value_source), WorkspaceModuleScopes
  • Deklarationen: contacts (Ordner, Typen, Standard-Saved-View), dms (Ordner, Datei-Typen), mail (Postfächer), calendar (Kalender, Standard-Ansicht)
  • Aggregator app/services/workspace_scope_service.py: iteriert discovered Plugins, ARCH-014-safe (deaktivierte Contracts bleiben weg), Crash-sicher, ungültige Deklarationen werden verworfen
  • GET /api/v1/workspaces/scope-definitions (workspaces:configure_modules) — VOR /{workspace_id} registriert (Route-Order-Falle)

Security-Invariante

Scope = reine UND-Einschränkung. Sichtbarkeit = Workspace-Scope ∧ RLS ∧ ABAC ∧ Permissions. Ohne aktiven Workspace kein Filter (rückwärtskompatibel).

Verifikation

  • tests/test_workspace_scopes.py: 18/18 grün (TDD: rot→grün)
  • Regression tests/test_workspaces.py: 17/17 grün
  • Cross-Plugin-Checker: 0 Verstöße (495 Dateien)
  • Ruff: clean
## N1 — Scope-Registry via Contract (Phase N) **Roadmap:** PLATFORM_ROADMAP.md → Phase N, Task N1 | **Milestone:** Phase N — Workspace-Scopes (#14) | **Label:** task ### Umsetzung - `workspace_scopes()`-Contract-Hook (document_placeholders-Muster): Plugins deklarieren Scope-Dimensionen ihres Moduls inkl. Wertequellen - Pydantic-Validierung fail-closed in `app/schemas/workspace.py`: ScopeOption, ScopeValueSource (nur interne /api/v1/-Pfade, SSRF-sicher), WorkspaceScopeDimension (multiselect/select brauchen options ODER value_source), WorkspaceModuleScopes - Deklarationen: contacts (Ordner, Typen, Standard-Saved-View), dms (Ordner, Datei-Typen), mail (Postfächer), calendar (Kalender, Standard-Ansicht) - Aggregator `app/services/workspace_scope_service.py`: iteriert discovered Plugins, ARCH-014-safe (deaktivierte Contracts bleiben weg), Crash-sicher, ungültige Deklarationen werden verworfen - `GET /api/v1/workspaces/scope-definitions` (workspaces:configure_modules) — VOR /{workspace_id} registriert (Route-Order-Falle) ### Security-Invariante Scope = reine UND-Einschränkung. Sichtbarkeit = Workspace-Scope ∧ RLS ∧ ABAC ∧ Permissions. Ohne aktiven Workspace kein Filter (rückwärtskompatibel). ### Verifikation - tests/test_workspace_scopes.py: 18/18 grün (TDD: rot→grün) - Regression tests/test_workspaces.py: 17/17 grün - Cross-Plugin-Checker: 0 Verstöße (495 Dateien) - Ruff: clean
Leopoldadmin added this to the Phase N — Workspace-Scopes milestone 2026-08-31 21:15:53 +00:00
Leopoldadmin added the task label 2026-08-31 21:16:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Leopoldadmin/leocrm#365