Skip to content

DreamWeaving canvas integration #286

Description

@ProjectLiminality

Description

Implement canvas parsing and git submodule management for Dreamweaving Operations. Parse .canvas files to identify external DreamNode dependencies, then import them as git submodules with automatic path rewriting.

Parent Specification: #271 - Dreamweaving Operations Specification

Technical Approach

DreamNode Boundary Detection

  • Use .udd metadata file as DreamNode boundary marker
  • Recursively walk upward from canvas file until finding .udd file
  • This identifies which DreamNode contains the canvas (scope)
  • All DreamNodes live at vault root level

Canvas Parsing Strategy

  • Parse .canvas JSON files to extract file nodes (using type field)
  • Get vault root path via Obsidian API
  • Identify external dependencies: files referencing paths outside current DreamNode
  • Use real canvas examples during implementation (no hardcoded templates)

Git Safety & State Management

  • Leverage existing autostash system for clean state enforcement
  • External DreamNodes should be committed (untracked files auto-stashed)
  • Use existing git state infrastructure from Epic 3
  • Focus on polishing safety checks as lower priority refinement

Submodule Import Operations

  • Import submodules directly at DreamNode root (no submodules/ directory)
  • Name submodules using DreamNode directory name (not metadata title)
  • Update canvas file paths to point to submodule locations
  • Automated commit with concise, clear message

Implementation Plan

Phase 1: Canvas Analysis Foundation

  • Canvas JSON parser service
  • Vault root path detection via Obsidian API
  • .udd file boundary detection algorithm
  • External dependency identification logic

Phase 2: Git Submodule Management

  • Git submodule import operations
  • Path rewriting in canvas files after import
  • Integration with existing GitDreamNodeService (real data, no mock)
  • Automated commit workflow

Phase 3: Command Integration

  • Multiple granular commands for debugging:
    • "Parse Canvas Dependencies"
    • "Import External DreamNodes"
    • "Update Canvas Paths"
  • Unified "Sync Submodules" command (encapsulates full workflow)
  • Error handling and user feedback

Acceptance Criteria

  • Canvas JSON files parsed correctly to identify file nodes
  • External DreamNode dependencies detected via path analysis
  • .udd file boundary detection works for nested canvas files
  • Git submodules imported with correct naming (directory names)
  • Canvas file paths rewritten to point to submodule locations
  • Automated commits created with clear messages
  • Multiple command options available for granular control
  • "Sync Submodules" unified command works end-to-end
  • Integration with existing git state management system
  • Performance meets expected thresholds

Dependencies

  • Existing GitDreamNodeService from Epic 3
  • Git state management infrastructure
  • Obsidian Vault API for path operations
  • .udd metadata file system from DreamNode template

User Experience

  1. User creates canvas with external media file references
  2. System detects external dependencies (optional status indicator)
  3. User runs granular commands OR "Sync Submodules" unified command
  4. External DreamNodes imported as submodules at root level
  5. Canvas paths automatically updated to reference submodules
  6. Automatic commit preserves changes
  7. DreamNode becomes sovereign (fully portable)

Definition of Done

  • Canvas parsing works with real .canvas file examples
  • External dependency detection accurate via .udd boundary logic
  • Git submodule operations complete successfully
  • Path rewriting preserves canvas functionality
  • Command palette integration functional
  • Error handling covers edge cases
  • Implementation complete and tested
  • Tests passing for all new services
  • Documentation updated with usage examples
  • Code reviewed and merged to epic branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature level issues

    Projects

    Status
    Integration

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions