TenantAtlas/specs/059-unified-badges/tasks.md
2026-01-23 00:40:52 +01:00

13 KiB
Raw Blame History

description
Task list for feature implementation

Tasks: Unified Badge System (Single Source of Truth) v1

Input: Design documents from /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/

Tests: Required (Pest) — this feature changes runtime UI semantics and adds regression guardrails.


Phase 1: Setup (Shared Infrastructure)

  • T001 Confirm feature inputs exist: /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/spec.md, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/plan.md
  • T002 Confirm Phase 0/1 artifacts exist: /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/research.md, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/data-model.md, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/contracts/badge-semantics.md, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/contracts/guardrails.md, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/quickstart.md

Phase 2: Foundational (Blocking Prerequisites)

Purpose: Establish the centralized badge semantics layer that all user stories depend on.

  • T003 Create badge value object in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/BadgeSpec.php
  • T004 Create badge domain + mapper contracts in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/BadgeDomain.php and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/BadgeMapper.php
  • T005 Create central resolver/registry in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/BadgeCatalog.php (safe unknown fallback; no side effects)
  • T006 Create Filament + Blade helper closures in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/BadgeRenderer.php (table/infolist helpers for status-like badges)
  • T007 Add foundational unit coverage for unknown fallback + allowed color set in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/BadgeCatalogTest.php

Checkpoint: Central badge semantics infrastructure exists and is covered.


Phase 3: User Story 1 — Trustworthy status/health + severity/risk badges everywhere (Priority: P1) 🎯 MVP

Goal: Status-like values (status/health and severity/risk) render consistently across the suite, using central semantics.

Independent Test: Run badge mapper tests and verify key pages (Operations + Drift findings + Restore runs) show consistent meanings, including “success is never warning”.

Tests (US1)

  • T008 [P] [US1] Add OperationRun badge mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/OperationRunBadgesTest.php
  • T009 [P] [US1] Add Finding status + severity mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/FindingBadgesTest.php
  • T010 [P] [US1] Add RestoreRun status mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RestoreRunBadgesTest.php
  • T011 [P] [US1] Add InventorySyncRun + BackupScheduleRun mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RunStatusBadgesTest.php

Implementation (US1)

  • T012 [US1] Implement OperationRun status/outcome badge domains in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/OperationRunStatusBadge.php and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/OperationRunOutcomeBadge.php
  • T013 [US1] Implement drift finding severity badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/FindingSeverityBadge.php (low=neutral, medium=warning, high=danger)
  • T014 [US1] Implement finding status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/FindingStatusBadge.php
  • T015 [US1] Implement RestoreRun status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/RestoreRunStatusBadge.php
  • T016 [US1] Implement InventorySyncRun status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/InventorySyncRunStatusBadge.php
  • T017 [US1] Implement BackupScheduleRun status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/BackupScheduleRunStatusBadge.php
  • T018 [US1] Implement EntraGroupSyncRun status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/EntraGroupSyncRunStatusBadge.php
  • T019 [US1] Implement status-like boolean badge domains in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/BooleanEnabledBadge.php and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/BooleanHasErrorsBadge.php

Migration (US1)

  • T020 [P] [US1] Migrate Operations resource badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/OperationRunResource.php (remove ad-hoc statusColor() / outcomeColor() logic)
  • T021 [P] [US1] Migrate Monitoring Operations table badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Pages/Monitoring/Operations.php (remove ->colors([...]))
  • T022 [P] [US1] Migrate dashboard “Recent Operations” badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Widgets/Dashboard/RecentOperations.php
  • T023 [P] [US1] Migrate dashboard “Recent Drift Findings” severity/status badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Widgets/Dashboard/RecentDriftFindings.php
  • T024 [P] [US1] Migrate Finding resource status/severity badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/FindingResource.php
  • T025 [P] [US1] Migrate Inventory sync run status + had_errors badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/InventorySyncRunResource.php
  • T026 [P] [US1] Migrate backup schedule “last run status” and runs relation manager badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/BackupScheduleResource.php and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/BackupScheduleResource/RelationManagers/BackupScheduleRunsRelationManager.php (leave tag-like frequency badge unchanged in v1)
  • T027 [P] [US1] Migrate Entra group sync run status badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/EntraGroupSyncRunResource.php
  • T028 [P] [US1] Migrate Restore run status badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/RestoreRunResource.php
  • T029 [P] [US1] Migrate restore run check severity badges to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/forms/components/restore-run-checks.blade.php
  • T030 [US1] Sweep + migrate remaining status-like badge semantics in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Livewire/, and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/ (status/health + severity/risk only; tag/category chips explicitly out of scope for v1)

Checkpoint: US1 is shippable as an MVP (status-like badges consistent across key surfaces).


Phase 4: User Story 2 — Readable status badges in dark mode (Priority: P2)

Goal: Status-like badges remain readable in dark mode, without custom Tailwind chip overrides.

Independent Test: Open restore preview/results and other badge-heavy views in dark mode and confirm badges remain readable and consistent.

Tests (US2)

  • T031 [P] [US2] Add restore preview/results decision/status mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RestoreUiBadgesTest.php

Implementation (US2)

  • T032 [US2] Introduce restore preview decision badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/RestorePreviewDecisionBadge.php
  • T033 [US2] Introduce restore results status badge domain in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Support/Badges/Domains/RestoreResultStatusBadge.php
  • T034 [US2] Replace custom Tailwind decision chips with Filament badges in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/infolists/entries/restore-preview.blade.php (status-like chips only; keep policy type/platform tags as-is)
  • T035 [US2] Replace custom Tailwind result/status chips with Filament badges in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/infolists/entries/restore-results.blade.php (status-like chips only)

Checkpoint: Dark mode readability is preserved on badge-heavy restore views.


Phase 5: User Story 3 — Consistency stays enforced over time (Priority: P3)

Goal: Ad-hoc status-like badge semantics cannot be reintroduced without failing automated checks.

Independent Test: Introduce an ad-hoc status/severity mapping in a Filament surface and confirm the guard test fails.

Tests + Guard (US3)

  • T036 [US3] Add “no ad-hoc status-like badge semantics” guard test in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Feature/Guards/NoAdHocStatusBadgesTest.php (pattern-based; allowlist tag/category chips)

Checkpoint: Guardrails prevent drift from reappearing.


Phase 6: Polish & Cross-Cutting Concerns

  • T037 [P] Run formatting on changed files via vendor/bin/sail php /Users/ahmeddarrazi/Documents/projects/TenantAtlas/vendor/bin/pint --dirty
  • T038 Run targeted tests via vendor/bin/sail artisan test /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/ /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Feature/Guards/NoAdHocStatusBadgesTest.php
  • T039 Run quickstart verification steps from /Users/ahmeddarrazi/Documents/projects/TenantAtlas/specs/059-unified-badges/quickstart.md
  • T040 [P] Add BackupSet status mapping tests in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/BackupSetBadgesTest.php (completed must be success)
  • T041 Migrate BackupSet status badge to central mapping in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/app/Filament/Resources/BackupSetResource.php (completed must be green)
  • T042 Sweep for any remaining completed status-like badges rendered as warning and migrate to BadgeCatalog
  • T043 Fix Blade compilation for restore views (replace inline @php(...)) in /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/infolists/entries/restore-results.blade.php, /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/infolists/entries/restore-preview.blade.php, and /Users/ahmeddarrazi/Documents/projects/TenantAtlas/resources/views/filament/forms/components/restore-run-checks.blade.php

Dependencies & Execution Order

Dependency Graph (high-level)

Phase 1 (Setup)
   ↓
Phase 2 (Foundational badge system)
   ↓
US1 (status/health + severity/risk migration) ──┬─→ US2 (dark mode restore views)
                                               └─→ US3 (guard test)
   ↓
Phase 6 (Polish)

User Story Dependencies

  • US1 (P1) depends on Foundational (Phase 2) and can ship as the MVP.
  • US2 (P2) depends on Foundational (Phase 2); easiest after US1 establishes the core domains.
  • US3 (P3) depends on Foundational (Phase 2) and should run after the first migrations to tune allowlists and reduce false positives.

Suggested MVP-first order: Phase 1 → Phase 2 → US1 → Phase 6 (minimum) → US2 → US3 → Phase 6 (final pass).


Parallel Execution Examples (per user story)

US1

  • T008 [P] [US1] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/OperationRunBadgesTest.php
  • T009 [P] [US1] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/FindingBadgesTest.php
  • T010 [P] [US1] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RestoreRunBadgesTest.php
  • T011 [P] [US1] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RunStatusBadgesTest.php
  • T020T029 [P] [US1] (migration tasks; different files)

US2

  • T031 [P] [US2] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/RestoreUiBadgesTest.php

US3

  • T036 [US3] /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Feature/Guards/NoAdHocStatusBadgesTest.php

Implementation Strategy

MVP First (US1 only)

  1. Complete Phase 1 + Phase 2
  2. Implement US1 migrations for Operations + Drift findings + Restore runs first (T020T029)
  3. Run: vendor/bin/sail artisan test /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/OperationRunBadgesTest.php
  4. Run: vendor/bin/sail artisan test /Users/ahmeddarrazi/Documents/projects/TenantAtlas/tests/Unit/Badges/FindingBadgesTest.php

Incremental Delivery

  • Finish US1 sweep (T030), then address restore Blade dark-mode hotspots in US2, then lock in regression prevention in US3.