Skip to content

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

# Test with SuperBuild (after TASK-002)
# Test with Atom Generator (after TASK-003)

๐Ÿ“ Migration Notes

Potential Issues

  1. Hardcoded Paths: Legacy module may have hardcoded C: paths
  2. Solution: Use $PSScriptRoot and relative paths

  3. JSON Location: JSON file location needs to be consistent

  4. Solution: Store in module directory, not project root

  5. Environment Variables: May conflict with existing vars

  6. Solution: Prefix all vars with AUDIOLAB_

  7. Module Loading: May not auto-load

  8. 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

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