Enhanced Resource Path Resolution System with Intelligence

Purpose

  • Comprehensive resource path resolution system with real-time validation and research integration

  • Conduct path resolution with validated methodologies and collaborative intelligence

  • Ensure resolution excellence with current file system standards and path practices

  • Integrate web research for current path frameworks and resolution patterns

  • Provide validated path strategies with cross-team coordination and continuous optimization

Enhanced Capabilities

Path Intelligence

  • Path Validation: Real-time resource path validation against current file system standards

  • Research Integration: Current path resolution best practices and file system frameworks

  • Resolution Assessment: Comprehensive path resolution analysis and optimization

  • System Validation: File system path analysis and resolution validation with continuous improvement

Collaborative Intelligence

  • Shared Context Integration: Access to all path contexts and resolution requirements

  • Cross-Team Coordination: Seamless collaboration with system teams and path stakeholders

  • Quality Assurance: Professional-grade path resolution with validation reports

  • Research Integration: Current file systems, path methodologies, and resolution best practices

[[LLM: VALIDATION CHECKPOINT - All resource path resolution must be validated for accuracy, reliability, and current file system standards. Include research-backed path methodologies and resolution principles.]]

Complete Resource Path Resolution Algorithm

1. JAEGIS Directory Structure Specification

2. Path Resolution Variables

Core Variables

  • (project-root): Absolute path to the JAEGIS project root directory

  • (agent-root): Absolute path to jaegis-agent directory: (project-root)/JAEGIS-METHOD/jaegis-agent/

  • (personas-dir): (agent-root)/personas/

  • (tasks-dir): (agent-root)/tasks/

  • (checklists-dir): (agent-root)/checklists/

  • (templates-dir): (agent-root)/templates/

  • (data-dir): (agent-root)/data/

Variable Resolution Process

  1. Project Root Detection:

    • Search for JAEGIS-METHOD directory in current working directory

    • If not found, search parent directories up to 5 levels

    • If still not found, prompt user for project root path

    • Validate by checking for jaegis-agent/agent-config.txt

  2. Agent Root Validation:

    • Construct: (project-root)/JAEGIS-METHOD/jaegis-agent/

    • Verify directory exists and is accessible

    • Check for required subdirectories: personas, tasks, checklists, templates, data

    • Validate agent-config.txt exists and is readable

3. File Reference Resolution Algorithm

Reference Format Types

  1. Sectioned File Reference: FILE_PREFIX#SECTION_NAME

    • Example: personas#pm, tasks#documentation-mode-workflow

  2. Direct File Reference: FILENAME.md

    • Example: analyst.md, frontend-checklist.md

  3. Absolute Path Reference: /full/path/to/file.md

  4. Relative Path Reference: ./relative/path/file.md

Resolution Process

4. Fallback Mechanisms

Primary Fallback Sequence

  1. Sectioned File Fallback:

    • Primary: {context_dir}/{file_prefix}.txt with section extraction

    • Fallback 1: {context_dir}/{file_prefix}.md (treat as direct file)

    • Fallback 2: {context_dir}/{section_name}.md (direct section file)

    • Fallback 3: Search all .md files for matching content

  2. Direct File Fallback:

    • Primary: {context_dir}/{filename}.md

    • Fallback 1: {context_dir}/{filename}.txt

    • Fallback 2: Case-insensitive search in context directory

    • Fallback 3: Fuzzy matching with similar filenames

  3. Missing Directory Fallback:

    • Create missing directories with default structure

    • Generate placeholder files with standard templates

    • Log missing resource warnings

    • Continue with degraded functionality

Error Handling Behaviors

5. Path Validation Procedures

Pre-Resolution Validation

  1. Directory Structure Validation:

  2. File Accessibility Validation:

Post-Resolution Validation

  1. Content Validation:

    • Verify file encoding (UTF-8 expected)

    • Check for required section markers in sectioned files

    • Validate markdown syntax for .md files

    • Ensure minimum content length requirements

  2. Dependency Validation:

    • Check all referenced files exist

    • Validate circular reference detection

    • Ensure required sections are present

    • Verify template variable completeness

6. Section Extraction Algorithm

Sectioned File Format

Extraction Process

7. Relative vs Absolute Path Handling

Absolute Path Processing

  • Format: Paths starting with / (Unix) or C:\ (Windows)

  • Validation: Verify path exists and is accessible

  • Security: Restrict access to paths outside project boundaries

  • Cross-Platform: Handle Windows/Unix path differences

Relative Path Processing

  • Format: Paths starting with ./ or ../

  • Base Resolution: Resolve relative to current context directory

  • Normalization: Convert to absolute paths for internal processing

  • Validation: Ensure resolved path stays within project boundaries

8. Performance Optimization

Caching Strategy

File System Monitoring

  • Monitor file system changes for cache invalidation

  • Automatic cache refresh when files are modified

  • Lazy loading for improved startup performance

  • Memory management for large file collections

9. Error Recovery Procedures

Graceful Degradation Levels

  1. Level 1 - Full Functionality: All resources available

  2. Level 2 - Reduced Functionality: Some resources missing, fallbacks used

  3. Level 3 - Basic Functionality: Core resources only, minimal features

  4. Level 4 - Emergency Mode: Default content only, system warnings

Recovery Actions

10. Diagnostic and Troubleshooting

System Health Check

Common Issues and Solutions

  1. Issue: "File not found" errors

    • Diagnosis: Check file paths and permissions

    • Solution: Verify directory structure, create missing files

  2. Issue: "Section not found" in sectioned files

    • Diagnosis: Check section marker format

    • Solution: Verify section names match exactly

  3. Issue: Slow path resolution

    • Diagnosis: Check cache performance and file system speed

    • Solution: Optimize caching strategy, consider SSD storage

  4. Issue: Permission denied errors

    • Diagnosis: Check file and directory permissions

    • Solution: Adjust permissions or run with appropriate privileges

Last updated