TenantAtlas/app/Jobs
ahmido 92a36ab89e SCOPE-001: DB-level workspace isolation via workspace_id (#112)
Implements Spec 093 (SCOPE-001) workspace isolation at the data layer.

What changed
- Adds `workspace_id` to 12 tenant-owned tables and enforces correct binding.
- Model write-path enforcement derives workspace from tenant + rejects mismatches.
- Prevents `tenant_id` changes (immutability) on tenant-owned records.
- Adds queued backfill command + job (`tenantpilot:backfill-workspace-ids`) with OperationRun + AuditLog observability.
- Enforces DB constraints (NOT NULL + FK `workspace_id` → `workspaces.id` + composite FK `(tenant_id, workspace_id)` → `tenants(id, workspace_id)`), plus audit_logs invariant.

UI / operator visibility
- Monitor backfill runs in **Monitoring → Operations** (OperationRun).

Tests
- `vendor/bin/sail artisan test --compact tests/Feature/WorkspaceIsolation`

Notes
- Backfill is queued: ensure a queue worker is running (`vendor/bin/sail artisan queue:work`).

Spec package
- `specs/093-scope-001-workspace-id-isolation/` (plan, tasks, contracts, quickstart, research)

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #112
2026-02-14 22:34:02 +00:00
..
Middleware 054-unify-runs-suitewide (#63) 2026-01-17 22:25:00 +00:00
Operations 065-tenant-rbac-v1 (#79) 2026-01-28 21:09:47 +00:00
AddPoliciesToBackupSetJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
ApplyBackupScheduleRetentionJob.php feat(spec-087): remove legacy runs (#106) 2026-02-12 12:40:51 +00:00
BackfillWorkspaceIdsJob.php SCOPE-001: DB-level workspace isolation via workspace_id (#112) 2026-02-14 22:34:02 +00:00
BulkBackupSetDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkBackupSetForceDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkBackupSetRestoreJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyExportJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicySyncJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyUnignoreJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionForceDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionPruneJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkPolicyVersionRestoreJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkRestoreRunDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkRestoreRunForceDeleteJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkRestoreRunRestoreJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
BulkTenantSyncJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
CapturePolicySnapshotJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
EntraGroupSyncJob.php feat(spec-087): remove legacy runs (#106) 2026-02-12 12:40:51 +00:00
ExecuteRestoreRunJob.php 085-tenant-operate-hub (#103) 2026-02-11 13:02:03 +00:00
FetchAssignmentsJob.php fix: improve assignment capture/restore and filter name handling (#8) 2025-12-28 13:59:12 +00:00
GenerateDriftFindingsJob.php feat(spec-087): remove legacy runs (#106) 2026-02-12 12:40:51 +00:00
ProviderComplianceSnapshotJob.php feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
ProviderConnectionHealthCheckJob.php 085-tenant-operate-hub (#103) 2026-02-11 13:02:03 +00:00
ProviderInventorySyncJob.php feat: unify provider connection actions and notifications (#73) 2026-01-25 01:01:37 +00:00
PruneOldOperationRunsJob.php 054-unify-runs-suitewide (#63) 2026-01-17 22:25:00 +00:00
ReconcileAdapterRunsJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
RemovePoliciesFromBackupSetJob.php 056-remove-legacy-bulkops (#65) 2026-01-19 23:27:52 +00:00
RestoreAssignmentsJob.php feat(006): foundations + assignment mapping and preview-only restore guard (#7) 2025-12-26 23:44:31 +00:00
RunBackupScheduleJob.php Spec 092: Legacy Purge (runs/routes/UI/test shims) (#110) 2026-02-14 18:43:56 +00:00
RunInventorySyncJob.php feat(spec-087): remove legacy runs (#106) 2026-02-12 12:40:51 +00:00
SyncPoliciesJob.php 085-tenant-operate-hub (#103) 2026-02-11 13:02:03 +00:00
SyncRoleDefinitionsJob.php 085-tenant-operate-hub (#103) 2026-02-11 13:02:03 +00:00