TenantAtlas/specs/042-inventory-dependencies-graph/tasks.md
2026-01-10 00:17:15 +01:00

2.5 KiB

Tasks: Inventory Dependencies Graph

Schema & Data Model

  • T001 Define relationship taxonomy (enum or config) with display labels, directionality, descriptions
  • T002 Create inventory_links migration with unique constraint + indexes
  • T003 Create InventoryLink model + factory

Extraction Pipeline

  • T004 Implement DependencyExtractionService (normalize references, resolve targets, create edges)
  • T005 Add reference parsers for assigned_to, scoped_by, targets, depends_on
  • T006 Integrate extraction into InventorySyncService (post-item-creation hook)
  • T007 Implement 50-edge-per-direction limit with priority sorting

Query Services

  • T008 Implement DependencyQueryService::getOutboundEdges(item, type?, limit=50)
  • T009 Implement DependencyQueryService::getInboundEdges(item, type?, limit=50)
  • T010 Ensure tenant-scoping enforced at query builder level

UI Components

  • T011 Add "Dependencies" section to InventoryItemResource ViewInventoryItem page
  • T012 Implement direction filter (single-select: all/inbound/outbound, default: all)
  • T013 Create Blade view dependency-edges.blade.php (zero-state, missing badge, tooltip)
  • T014 Add relationship-type grouping/collapsible sections

Tests

  • T015 Unit: DependencyExtractionServiceTest (determinism, unique key, unsupported refs)
  • T016 Unit: InventoryLinkTest (unique constraint, tenant scoping)
  • T017 Feature: extraction creates expected edges + handles missing targets
  • T018 Feature: extraction respects 50-edge limit
  • T019 Feature: DependencyQueryService filters by tenant + direction
  • T020 UI Smoke: dependencies section renders + filter works + zero-state shown
  • T021 Security: tenant isolation (cannot see other tenant edges)

Finalization

  • T022 Run full test suite (php artisan test)
  • T023 Run Pint (vendor/bin/pint)
  • T024 Update checklist items in checklists/pr-gate.md

追加 Tasks (MVP Remediation)

  • T025 Implement relationship-type filter (single-select dropdown, default: all)
  • T026 UI Smoke: relationship-type filter limits edges
  • T027 Create and complete checklists/requirements.md (Constitution gate)

MVP Constraints (Non-Tasks)

  • MVP is limit-only (no pagination/cursors).
  • Show up to 50 edges per direction (up to 100 total for "all").
  • Unknown/unsupported shapes are warning-only; persist warnings on run record (InventorySyncRun.error_context.warnings[]).
  • No new tables for warnings.