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

117 lines
9.6 KiB
Markdown

# 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
- [x] Lane assignment is named and is the narrowest sufficient proof for the changed behavior.
- [x] New or changed tests stay in focused Filament Feature coverage plus one optional Browser smoke.
- [x] Shared helpers, factories, seeds, fixtures, and context defaults stay cheap by default.
- [x] Planned validation commands cover the change without pulling in unrelated route-audit or Entra Groups scope.
- [x] The declared surface test profile is `standard-native-filament`.
- [x] 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.
- [x] T001 Review `specs/301-admin-inventory-navigation-cutover/spec.md`, `plan.md`, `tasks.md`, and `checklists/requirements.md` together before application code changes.
- [x] 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`.
- [x] T003 Review completed/context specs `279` through `300` only as historical cutover context; do not rewrite their close-out or validation artifacts.
- [x] T004 Confirm the current branch is `301-admin-inventory-navigation-cutover` or an isolated session branch derived from it.
- [x] T005 Run `git status --short --branch` and stop if unrelated uncommitted changes exist.
- [x] 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.
- [x] T007 [P] Update `apps/platform/tests/Feature/Filament/PanelNavigationSegregationTest.php` so `InventoryCluster` and `InventoryCoverage` are no longer protected by the blanket admin-hidden dataset.
- [x] T008 [P] In `PanelNavigationSegregationTest.php`, add or update assertions proving Inventory cluster/page/resource navigation registers on `/admin/workspaces/{workspace}/environments/{environment}`.
- [x] 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.
- [x] T010 [P] Keep `EntraGroupResource` explicitly out of scope in `PanelNavigationSegregationTest.php`; it must not become visible as part of this slice.
- [x] 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.
- [x] 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.
- [x] 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.
- [x] 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.
- [x] T015 [US1] Update `apps/platform/app/Filament/Pages/InventoryCoverage.php` so `shouldRegisterNavigation()` uses the same environment-navigation rule as `InventoryItemResource`.
- [x] 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.
- [x] T017 [US1] Confirm `InventoryItemResource::shouldRegisterNavigation()` remains aligned with `NavigationScope::shouldRegisterEnvironmentNavigation()` and does not require a route-name rewrite.
- [x] 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}`.
- [x] T019 [US2] Confirm Livewire update requests still rely on `NavigationScope` referer-path behavior and do not make workspace-home Inventory navigation visible accidentally.
- [x] 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.
- [x] 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.
- [x] 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.
- [x] 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.
- [x] 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.
- [x] T025 [P] Add `apps/platform/tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php` if no existing browser smoke already proves the rendered environment sidebar.
- [x] T026 [P] In the browser smoke, open workspace home with a remembered environment and assert Inventory navigation is absent.
- [x] T027 [P] In the browser smoke, open the canonical environment route and assert Inventory Items and Coverage are visible and clickable.
- [x] 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.
- [x] T029 Review touched Filament classes for Livewire v4 / Filament v5 compatibility and confirm no Livewire v3 APIs are introduced.
- [x] T030 Confirm no panel provider registration changed; Laravel provider registration remains in `apps/platform/bootstrap/providers.php`.
- [x] T031 Confirm `InventoryItemResource` still has a View page and no global-search destination rule is broken.
- [x] 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.
- [x] T033 Confirm no assets were registered and deployment `filament:assets` requirements are unchanged.
- [x] T034 Confirm no migrations, models, providers, OperationRun lifecycle, Graph contracts, or runtime jobs were introduced.
- [x] 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.
- [x] 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`.
- [x] T037 If `apps/platform/tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php` exists, run `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Spec301InventoryNavigationCutoverSmokeTest.php`.
- [x] T038 Run `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`.
- [x] T039 Run `git diff --check`.
- [x] 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
- [x] Do not change Entra Groups navigation.
- [x] Do not perform a generic tenant-owned surface route audit.
- [x] Do not split or redesign the navigation contract beyond Inventory.
- [x] Do not retire tenant-panel dead code in this slice.
- [x] Do not modify completed Specs `279-300`.
- [x] Do not add migrations, models, services, jobs, routes outside Inventory needs, provider contracts, assets, or OperationRun lifecycle changes.