tenantpilot/specs/006-intune-reverse-engineering-guide/tasks.md
Ahmed Darrazi 41e80b6c0c
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 2s
feat(policy-explorer-v2): implement MVP Phase 1-3
 New Features
- Advanced data table with TanStack Table v8 + Server Actions
- Server-side pagination (10/25/50/100 rows per page)
- Multi-column sorting with visual indicators
- Column management (show/hide, resize) persisted to localStorage
- URL state synchronization for shareable filtered views
- Sticky header with compact/comfortable density modes

📦 Components Added
- PolicyTableV2.tsx - Main table with TanStack integration
- PolicyTableColumns.tsx - 7 column definitions with sorting
- PolicyTablePagination.tsx - Pagination controls
- PolicyTableToolbar.tsx - Density toggle + column visibility menu
- ColumnVisibilityMenu.tsx - Show/hide columns dropdown

🔧 Hooks Added
- usePolicyTable.ts - TanStack Table initialization
- useURLState.ts - URL query param sync with nuqs
- useTablePreferences.ts - localStorage persistence

🎨 Server Actions Updated
- getPolicySettingsV2 - Pagination + sorting + filtering + Zod validation
- exportPolicySettingsCSV - Server-side CSV generation (max 5000 rows)

📚 Documentation Added
- Intune Migration Guide (1400+ lines) - Reverse engineering strategy
- Intune Reference Version tracking
- Tasks completed: 22/62 (Phase 1-3)

 Zero TypeScript compilation errors
 All MVP success criteria met (pagination, sorting, column management)
 Ready for Phase 4-7 (filtering, export, detail view, polish)

Refs: specs/004-policy-explorer-v2/tasks.md
2025-12-10 00:18:05 +01:00

248 lines
12 KiB
Markdown

# Tasks: Technical Standard - Intune Reverse Engineering Strategy
**Input**: Design documents from `/specs/006-intune-reverse-engineering-guide/`
**Prerequisites**: spec.md (required)
**Tests**: Tests are NOT included for this feature - this is a documentation/guideline feature
**Organization**: Tasks are grouped by user story to enable independent implementation and testing of each documentation section.
## Format: `[ID] [P?] [Story] Description`
- **[P]**: Can run in parallel (different files, no dependencies)
- **[Story]**: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions
## Path Conventions
- Documentation: `docs/architecture/`
- PowerShell Reference: `reference/IntuneManagement-master/`
---
## Phase 1: Setup (Documentation Infrastructure)
**Purpose**: Create basic documentation structure and validate PowerShell reference availability
- [X] T001 Create docs/architecture/ directory structure if not exists
- [X] T002 [P] Verify reference/IntuneManagement-master/ directory exists and contains .psm1 modules
- [X] T003 [P] Document PowerShell reference version/commit in docs/architecture/intune-reference-version.md
---
## Phase 2: Foundational (Core Documentation Framework)
**Purpose**: Create the main migration guide document with foundational sections
**⚠️ CRITICAL**: This must be complete before user story-specific sections can be added
- [X] T004 Create docs/architecture/intune-migration-guide.md with header and introduction
- [X] T005 Add table of contents structure to docs/architecture/intune-migration-guide.md
- [X] T006 Add "Overview" section explaining the reverse engineering strategy in docs/architecture/intune-migration-guide.md
- [X] T007 Add "PowerShell Reference Location" section (FR-002) in docs/architecture/intune-migration-guide.md
**Checkpoint**: Foundation ready - user story sections can now be written in parallel
---
## Phase 3: User Story 1 - Implementation Process Guide (Priority: P1) 🎯 MVP
**Goal**: Create step-by-step guide for developers implementing new Intune features
**Independent Test**: A developer can follow the guide to implement a new resource type (e.g., Compliance Policies) and extract all required API patterns from PowerShell reference
### Implementation for User Story 1
- [X] T008 [P] [US1] Write "Step-by-Step Implementation Process" section (FR-001) in docs/architecture/intune-migration-guide.md
- [X] T009 [P] [US1] Create "Data Points to Extract" checklist (FR-003) in docs/architecture/intune-migration-guide.md
- [X] T010 [US1] Add concrete example: Windows Update Rings PowerShell → TypeScript mapping in docs/architecture/intune-migration-guide.md
- [X] T011 [US1] Add concrete example: Settings Catalog with $expand parameter discovery in docs/architecture/intune-migration-guide.md
- [X] T012 [US1] Create "PowerShell to TypeScript Pattern Mapping" section (FR-004) in docs/architecture/intune-migration-guide.md
- [X] T013 [US1] Add example: Invoke-MSGraphRequest → graphClient.api().get() translation in docs/architecture/intune-migration-guide.md
- [X] T014 [US1] Add example: Property cleanup/transformation patterns in docs/architecture/intune-migration-guide.md
**Checkpoint**: At this point, a developer should be able to implement a new sync job by following US1 sections
---
## Phase 4: User Story 2 - Troubleshooting Guide (Priority: P2)
**Goal**: Create systematic troubleshooting process for API discrepancies
**Independent Test**: A developer can use the guide to diagnose why TypeScript returns different data than PowerShell and identify the missing parameter
### Implementation for User Story 2
- [X] T015 [P] [US2] Write "Troubleshooting API Discrepancies" section (FR-005) in docs/architecture/intune-migration-guide.md
- [X] T016 [US2] Add troubleshooting checklist: missing $expand, wrong API version, property cleanup in docs/architecture/intune-migration-guide.md
- [X] T017 [US2] Add concrete example: Missing $expand=assignments causing incomplete data in docs/architecture/intune-migration-guide.md
- [X] T018 [US2] Add concrete example: 400 Bad Request due to beta vs v1.0 API version in docs/architecture/intune-migration-guide.md
**Checkpoint**: At this point, User Stories 1 AND 2 are complete - developers can implement and troubleshoot
---
## Phase 5: User Story 3 - Onboarding Documentation (Priority: P3)
**Goal**: Document rationale for existing implementation decisions to help new team members
**Independent Test**: A new developer can read the guide and understand why code deletes properties or uses beta APIs without asking
### Implementation for User Story 3
- [X] T019 [P] [US3] Write "Understanding Existing Implementation Patterns" section in docs/architecture/intune-migration-guide.md
- [X] T020 [US3] Add explanation: Why we delete properties (matches PowerShell cleanup logic) in docs/architecture/intune-migration-guide.md
- [X] T021 [US3] Add explanation: When to use beta vs v1.0 API (check PowerShell reference first) in docs/architecture/intune-migration-guide.md
- [X] T022 [US3] Create "Common Questions" FAQ section in docs/architecture/intune-migration-guide.md
**Checkpoint**: All user stories complete - guide covers implementation, troubleshooting, and knowledge transfer
---
## Phase 6: Edge Cases & Advanced Topics
**Purpose**: Handle special scenarios identified in spec.md edge cases
- [X] T023 [P] Add "Versioning Strategy" section (FR-007) explaining how to document PowerShell commit/version in docs/architecture/intune-migration-guide.md
- [X] T024 [P] Add "Fallback Process for Missing PowerShell Reference" section (FR-006) in docs/architecture/intune-migration-guide.md
- [X] T025 [P] Add "Handling PowerShell Updates" section (edge case 1) in docs/architecture/intune-migration-guide.md
- [X] T026 [P] Add "Deprecated Features" section (edge case 2) in docs/architecture/intune-migration-guide.md
- [X] T027 [P] Add "PowerShell Quirks vs Intentional Patterns" section (FR-008, edge case 4) in docs/architecture/intune-migration-guide.md
---
## Phase 7: Polish & Cross-Cutting Concerns
**Purpose**: Final review, examples, and integration with existing documentation
- [X] T028 Add complete end-to-end example: Implementing a new sync job from scratch in docs/architecture/intune-migration-guide.md
- [X] T029 Add code snippets: PowerShell snippets with annotations showing what to extract in docs/architecture/intune-migration-guide.md
- [X] T030 Add code snippets: TypeScript implementation examples in docs/architecture/intune-migration-guide.md
- [ ] T031 Create visual diagram: Implementation workflow (PowerShell analysis → TypeScript implementation) in docs/architecture/intune-migration-guide.md
- [X] T032 Review guide against all 8 functional requirements (FR-001 to FR-008) and update checklists/requirements.md
- [X] T033 Add links to existing worker/jobs/ implementations as real-world examples in docs/architecture/intune-migration-guide.md
- [X] T034 Update README.md to reference the new migration guide
---
## Dependencies
### User Story Completion Order
```mermaid
graph TD
Setup[Phase 1: Setup] --> Foundation[Phase 2: Foundation]
Foundation --> US1[Phase 3: US1 - Implementation Guide]
Foundation --> US2[Phase 4: US2 - Troubleshooting]
Foundation --> US3[Phase 5: US3 - Onboarding]
US1 --> EdgeCases[Phase 6: Edge Cases]
US2 --> EdgeCases
US3 --> EdgeCases
EdgeCases --> Polish[Phase 7: Polish]
```
**Explanation**:
- **Setup & Foundation** must complete first (T001-T007)
- **US1, US2, US3** are independent after foundation - can be written in parallel
- **Edge Cases** depend on having core sections complete (to add edge case notes in context)
- **Polish** comes last to add examples and review completeness
### Task-Level Dependencies
**Critical Path** (must complete in order):
1. T001 (create directory) → T004 (create main guide file)
2. T004 (create file) → All section-writing tasks (T008-T027)
3. All section tasks complete → T028-T034 (polish tasks)
**Parallel Opportunities**:
- T002, T003 can run parallel with T001
- T008, T009, T015, T019, T023-T027 can run in parallel after T004
- T029, T030, T033 can run in parallel during polish phase
---
## Parallel Execution Examples
### Phase 3 - User Story 1 (After T004 completes)
Run these tasks simultaneously:
```bash
# Terminal 1: Implementation process guide
# Task T008 - Write step-by-step process
# Terminal 2: Data extraction checklist
# Task T009 - Create extraction checklist
# Both tasks write to different sections of the same file
```
### Phase 6 - Edge Cases (After Phase 3-5 complete)
Run all edge case sections in parallel:
```bash
# These are all independent sections that can be written simultaneously
# T023: Versioning strategy
# T024: Fallback process
# T025: PowerShell updates
# T026: Deprecated features
# T027: Quirks vs patterns
```
### Phase 7 - Polish (Final phase)
Run code example tasks in parallel:
```bash
# Terminal 1: T029 - Add PowerShell code snippets
# Terminal 2: T030 - Add TypeScript examples
# Terminal 3: T033 - Add links to existing implementations
```
---
## Implementation Strategy
### MVP Scope (Ship This First)
**Phase 3: User Story 1 - Implementation Process Guide**
- This is the core value: enables developers to implement new features correctly
- Includes: Step-by-step process (T008), data extraction checklist (T009), concrete examples (T010-T014)
- **Delivers SC-001**: Reduces implementation time from 8 hours to 2 hours
- **Delivers SC-002**: 95% first-attempt accuracy by following the process
### Incremental Delivery
1. **MVP** (Phase 3): Ship US1 implementation guide → developers can start using it immediately
2. **V1.1** (Phase 4): Add US2 troubleshooting → helps with existing bugs
3. **V1.2** (Phase 5): Add US3 onboarding → reduces team onboarding time
4. **V2.0** (Phase 6-7): Add edge cases and polish → complete reference guide
### Success Metrics (Track These)
- **SC-001**: Measure implementation time before/after guide (target: 2 hours vs 8 hours)
- **SC-002**: Track first-attempt accuracy rate (target: 95%)
- **SC-003**: Count "API surprises" incidents before/after (target: zero after)
- **SC-004**: Measure onboarding time for new developers (target: 30 minutes)
- **SC-005**: Track code review time reduction (target: 50% reduction)
- **SC-006**: Count "why beta API?" questions in code reviews (target: zero)
---
## Validation Checklist
Before marking tasks complete, verify:
- [ ] All 8 functional requirements (FR-001 to FR-008) are addressed in the guide
- [ ] Each user story has concrete, actionable examples (not just theory)
- [ ] Guide includes at least 3 real PowerShell → TypeScript examples
- [ ] Troubleshooting section has step-by-step diagnostic process
- [ ] Versioning strategy explains how to document PowerShell reference version
- [ ] Fallback process defined for features without PowerShell reference
- [ ] Edge cases from spec.md are all documented
- [ ] Code snippets are executable and tested
- [ ] Links to existing implementations (worker/jobs/) are included
- [ ] Guide is independently usable (doesn't require asking the author for clarification)
---
## Notes
**About This Feature**: This is a documentation/guideline feature, not a code implementation feature. The "output" is a comprehensive markdown guide that developers (human and AI) will reference when implementing Intune sync jobs.
**Success Definition**: The guide is successful when a developer can implement a new Intune resource type sync job by following the guide alone, without needing to ask questions or make multiple attempts.
**Maintenance**: When PowerShell reference is updated, review the guide and update version references. Add new examples as new sync jobs are implemented.