TenantAtlas/specs/301-admin-inventory-navigation-cutover/tasks.md
ahmido 3a30b9060c feat(specs/301): admin inventory navigation cutover (#356)
Implements platform feature branch `301-admin-inventory-navigation-cutover`.

Target branch: `platform-dev`.

Follow-up integration path after merge:

`platform-dev` → `dev`.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #356
2026-05-14 14:50:08 +00:00

9.6 KiB

Tasks: Admin Inventory Navigation Cutover

Input: Design documents from /specs/301-admin-inventory-navigation-cutover/
Prerequisites: spec.md, plan.md, checklists/requirements.md

Tests: Required. This is a runtime navigation repair with user-visible Filament sidebar behavior.

Review Outcome: acceptable-special-case
Workflow Outcome: document-in-feature

Test Governance Checklist

  • Lane assignment is named and is the narrowest sufficient proof for the changed behavior.
  • New or changed tests stay in focused Filament Feature coverage plus one optional Browser smoke.
  • Shared helpers, factories, seeds, fixtures, and context defaults stay cheap by default.
  • Planned validation commands cover the change without pulling in unrelated route-audit or Entra Groups scope.
  • The declared surface test profile is standard-native-filament.
  • Any material budget, baseline, trend, or escalation note is recorded in the active spec or PR.

Phase 1: Preparation and Scope Lock

Purpose: Confirm the implementation starts from repo truth and does not reopen completed cutover specs.

  • T001 Review specs/301-admin-inventory-navigation-cutover/spec.md, plan.md, tasks.md, and checklists/requirements.md together before application code changes.
  • T002 Review docs/product/spec-candidates.md Admin Workspace Navigation & Tenant-owned Surface Repair candidate group and confirm this implementation is limited to admin-inventory-navigation-cutover.
  • T003 Review completed/context specs 279 through 300 only as historical cutover context; do not rewrite their close-out or validation artifacts.
  • T004 Confirm the current branch is 301-admin-inventory-navigation-cutover or an isolated session branch derived from it.
  • T005 Run git status --short --branch and stop if unrelated uncommitted changes exist.
  • T006 Confirm apps/platform/app/Filament/Clusters/Inventory/InventoryCluster.php, apps/platform/app/Filament/Pages/InventoryCoverage.php, apps/platform/app/Filament/Resources/InventoryItemResource.php, apps/platform/app/Support/Navigation/NavigationScope.php, and apps/platform/app/Support/OperateHub/OperateHubShell.php still contain the seams described in the spec.

Phase 2: Tests First (Expected Failures)

Purpose: Encode the correct navigation contract before changing implementation.

  • T007 [P] Update apps/platform/tests/Feature/Filament/PanelNavigationSegregationTest.php so InventoryCluster and InventoryCoverage are no longer protected by the blanket admin-hidden dataset.
  • T008 [P] In PanelNavigationSegregationTest.php, add or update assertions proving Inventory cluster/page/resource navigation registers on /admin/workspaces/{workspace}/environments/{environment}.
  • T009 [P] In PanelNavigationSegregationTest.php, keep or strengthen assertions proving Inventory navigation remains absent from /admin/workspaces/{workspace} even when a remembered environment is present in session.
  • T010 [P] Keep EntraGroupResource explicitly out of scope in PanelNavigationSegregationTest.php; it must not become visible as part of this slice.
  • T011 [P] Extend apps/platform/tests/Feature/Filament/InventoryCoverageAdminTenantParityTest.php only as needed so Coverage context resolution is proven from the canonical environment route or current remembered-context contract.
  • T012 [P] Add or update focused URL proof so InventoryCoverage::getUrl(panel: 'admin', tenant: $environment) resolves under /admin/workspaces/{workspace}/environments/{environment}/inventory/inventory-coverage and not a flat /admin/inventory/inventory-coverage route.
  • T013 [P] Review apps/platform/tests/Feature/Filament/GovernanceArtifacts/GovernanceArtifactAdminPanelRegistrationTest.php and update only if Inventory-specific expectations need alignment with the new environment-bound visibility contract.

Phase 3: Inventory Navigation Repair (US1, US2)

Purpose: Make Inventory visible in environment-bound admin navigation while preserving workspace-home cleanliness.

  • T014 [US1] Update apps/platform/app/Filament/Clusters/Inventory/InventoryCluster.php so admin-panel navigation is not blanket-hidden and instead follows the shared environment-navigation contract.
  • T015 [US1] Update apps/platform/app/Filament/Pages/InventoryCoverage.php so shouldRegisterNavigation() uses the same environment-navigation rule as InventoryItemResource.
  • T016 [US1] Update InventoryCoverage route/URL behavior only as needed so the page lives under the canonical workspace/environment Inventory route when an environment context is supplied.
  • T017 [US1] Confirm InventoryItemResource::shouldRegisterNavigation() remains aligned with NavigationScope::shouldRegisterEnvironmentNavigation() and does not require a route-name rewrite.
  • T018 [US2] Confirm the workspace-home route still returns false for Inventory cluster/page/resource navigation when the effective request path is /admin/workspaces/{workspace}.
  • T019 [US2] Confirm Livewire update requests still rely on NavigationScope referer-path behavior and do not make workspace-home Inventory navigation visible accidentally.
  • T020 [US1] Do not introduce new navigation helper classes, new panel providers, new route families beyond the Inventory Coverage canonical path, new config keys, or new assets.

Phase 4: Inventory Coverage Context and DB-only Safety (US3)

Purpose: Keep Inventory Coverage truthful and DB-only after navigation is restored.

  • T021 [US3] Run or update apps/platform/tests/Feature/Filament/InventoryCoverageAdminTenantParityTest.php to prove the selected managed environment supplies coverage truth when multiple environments exist in the same workspace.
  • T022 [US3] Run or update apps/platform/tests/Feature/Filament/InventoryHubDbOnlyTest.php to confirm Inventory Items and Coverage page loads still dispatch no background jobs and make no outbound HTTP calls.
  • T023 [US3] Run or update apps/platform/tests/Feature/Filament/InventoryPagesTest.php to confirm Inventory Items and Coverage keep their coverage-first summaries, basis continuity, and no-basis fallback.
  • T024 [US3] Confirm wrong workspace/environment pairs still return deny-as-not-found through existing route/context tests or add a focused assertion if not already covered.

Phase 5: Browser Proof (If Needed)

Purpose: Prove the visible sidebar contract when implementation changes rendered navigation.

  • T025 [P] Add apps/platform/tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php if no existing browser smoke already proves the rendered environment sidebar.
  • T026 [P] In the browser smoke, open workspace home with a remembered environment and assert Inventory navigation is absent.
  • T027 [P] In the browser smoke, open the canonical environment route and assert Inventory Items and Coverage are visible and clickable.
  • T028 [P] Keep the smoke bounded to sidebar visibility and page reachability; do not add route-audit or Entra Groups coverage here.

Phase 6: Filament, RBAC, and Scope Review

Purpose: Ensure the implementation stays inside Filament v5, RBAC, and roadmap boundaries.

  • T029 Review touched Filament classes for Livewire v4 / Filament v5 compatibility and confirm no Livewire v3 APIs are introduced.
  • T030 Confirm no panel provider registration changed; Laravel provider registration remains in apps/platform/bootstrap/providers.php.
  • T031 Confirm InventoryItemResource still has a View page and no global-search destination rule is broken.
  • T032 Confirm no destructive actions were introduced or changed; if an action is touched unexpectedly, verify Action::make(...)->action(...), ->requiresConfirmation() where destructive, server-side authorization, and notifications/audit behavior remain intact.
  • T033 Confirm no assets were registered and deployment filament:assets requirements are unchanged.
  • T034 Confirm no migrations, models, providers, OperationRun lifecycle, Graph contracts, or runtime jobs were introduced.
  • T035 Confirm Entra Groups, tenant-owned surface route audit, navigation contract split, and tenant-panel dead-code retirement remain out of scope.

Phase 7: Validation

Purpose: Run the narrowest proof commands.

  • T036 Run cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/PanelNavigationSegregationTest.php tests/Feature/Filament/InventoryCoverageAdminTenantParityTest.php tests/Feature/Filament/InventoryHubDbOnlyTest.php tests/Feature/Filament/InventoryPagesTest.php.
  • T037 If apps/platform/tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php exists, run cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php.
  • T038 Run cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent.
  • T039 Run git diff --check.
  • T040 Record validation results, skipped browser decision if applicable, and the Guardrail / Exception / Smoke Coverage close-out note in the active PR or implementation summary.

Explicit Non-Goals

  • Do not change Entra Groups navigation.
  • Do not perform a generic tenant-owned surface route audit.
  • Do not split or redesign the navigation contract beyond Inventory.
  • Do not retire tenant-panel dead code in this slice.
  • Do not modify completed Specs 279-300.
  • Do not add migrations, models, services, jobs, routes outside Inventory needs, provider contracts, assets, or OperationRun lifecycle changes.