TASK-001: Migrate PathRegistry Module¶
๐ Task Metadata¶
Task ID: TASK-001 Phase: 1 - Critical Infrastructure Priority: ๐ด CRITICAL (Dependency for other tasks) Status: ๐ด NOT STARTED Estimated Time: 4-6 hours Assigned To: TBD Dependencies: None (Start here!) Blocks: TASK-002, TASK-003, TASK-004
๐ฏ Objective¶
Migrate the PathRegistry PowerShell module from legacy location to new infrastructure, providing centralized path management for the entire AudioLab project.
๐ Source & Destination¶
Source Location:
__LEGAZY/06_BRAIN/00_system/1_modules/PathRegistry.psm1
__LEGAZY/06_BRAIN/path_registry.json
__LEGAZY/06_BRAIN/AudioLab.paths.json
Target Location:
03_INFRA/03_00_development_environment/03_00_08_profile_management/PathRegistry/
โโโ PathRegistry.psm1
โโโ path_registry.json
โโโ README.md
๐ฆ What This Module Does¶
Core Functionality¶
- Centralized Path Management: Single source of truth for all project paths
- Environment Variable Setup: Automatic PATH configuration
- Path Validation: Verify paths exist and are accessible
- Cross-Script Resolution: Consistent path resolution across all scripts
Key Functions¶
Get-AudioLabPaths # Returns all registered paths
Set-AudioLabPath # Register a new path
Test-AudioLabPaths # Validate all paths exist
Initialize-AudioLabPaths # Setup environment variables
Current Usage¶
Used by 15+ legacy scripts including: - SuperBuild system - Atom generators - Plugin workflows - Build scripts
โ Acceptance Criteria¶
Must Have¶
- PathRegistry.psm1 migrated with full functionality
- path_registry.json updated with current project structure
- All paths point to current locations (not legacy)
- Module loads without errors
- All functions work as expected
- README.md created with usage examples
- Integration test script created
Nice to Have¶
- PowerShell module manifest (.psd1)
- IntelliSense/comment-based help
- Path auto-completion support
๐ง Migration Steps¶
1. Preparation (30 min)¶
- Read source file:
PathRegistry.psm1 - Analyze dependencies
- Review JSON configuration files
- Create target directory structure
- Backup source files
2. Code Migration (1.5-2 hours)¶
- Copy PathRegistry.psm1 to new location
- Update hardcoded paths to use relative or dynamic resolution
- Remove references to 06_BRAIN
- Update to use 03_INFRA structure
- Add error handling improvements
- Clean up code (remove dead code, improve comments)
3. Configuration Update (1 hour)¶
- Create new path_registry.json
- Map all current project paths:
- Root:
C:\AudioDev\audio-lab - Build:
C:\AudioDev\audio-lab\build - Modules:
C:\AudioDev\audio-lab\05_MODULES - Core:
C:\AudioDev\audio-lab\04_CORE - Infra:
C:\AudioDev\audio-lab\03_INFRA - Tests:
C:\AudioDev\audio-lab\tests - Add new paths that don't exist in legacy
- Validate JSON syntax
4. Testing (1-1.5 hours)¶
- Load module in clean PowerShell session
- Test Get-AudioLabPaths
- Test Set-AudioLabPath with new path
- Test Test-AudioLabPaths validation
- Test Initialize-AudioLabPaths environment setup
- Test with non-existent paths (error handling)
- Test from different working directories
5. Documentation (30-45 min)¶
- Create README.md with:
- Module purpose
- Installation instructions
- Usage examples
- Function reference
- Configuration guide
- Add inline code comments
- Create quick-start guide
6. Integration (30 min)¶
- Add to PowerShell profile auto-import (optional)
- Update any existing scripts that might reference paths
- Test with current build system
- Verify no conflicts with existing code
๐งช Testing Checklist¶
Unit Tests¶
# Test 1: Module loads
Import-Module .\PathRegistry.psm1 -Force
Get-Command -Module PathRegistry
# Test 2: Get paths
$paths = Get-AudioLabPaths
Write-Host "Root: $($paths.Root)"
# Test 3: Path validation
Test-AudioLabPaths -Verbose
# Test 4: Add custom path
Set-AudioLabPath -Name "CustomBuild" -Path "C:\AudioDev\audio-lab\build\custom"
# Test 5: Initialize environment
Initialize-AudioLabPaths
$env:AUDIOLAB_ROOT
Integration Tests¶
๐ Migration Notes¶
Potential Issues¶
- Hardcoded Paths: Legacy module may have hardcoded C: paths
-
Solution: Use
$PSScriptRootand relative paths -
JSON Location: JSON file location needs to be consistent
-
Solution: Store in module directory, not project root
-
Environment Variables: May conflict with existing vars
-
Solution: Prefix all vars with
AUDIOLAB_ -
Module Loading: May not auto-load
- Solution: Add to PowerShell profile or provide import script
๐ Rollback Plan¶
If migration causes issues: 1. Remove new module from 03_INFRA 2. Update any scripts back to absolute paths 3. Document what went wrong 4. Re-plan approach
๐ Success Metrics¶
- โ Module loads in <100ms
- โ All paths resolve correctly
- โ Zero errors in test suite
- โ Documentation complete
- โ Ready for use by TASK-002 and TASK-003
๐ Related Tasks¶
Blocks: - TASK-002 (SuperBuild needs this) - TASK-003 (Atom Generator needs this) - TASK-004 (Plugin Workflow needs this)
Related: - Review current PowerShell profile setup - Consider integration with .audiolab-root marker
๐ Timeline¶
Start Date: TBD Target Completion: TBD Actual Completion: TBD
๐ฌ Notes & Comments¶
2025-10-17 - Task Created¶
- Initial task definition
- Identified as critical dependency
- High priority for Phase 1
Status: ๐ด NOT STARTED Next Action: Assign to developer and schedule