Skip to content

Radicle Network Integration #336

@ProjectLiminality

Description

@ProjectLiminality

Description

Parent Specification: #270 - Radicle Integration Specification
Parent Epic: #258 - Coherence Beacon System

Implement complete Radicle CLI integration to enable peer-to-peer DreamNode collaboration on macOS/Linux. This establishes the primary network layer for InterBrain's decentralized collective cognition system.

Enhanced Acceptance Criteria

Radicle Integration

  • DreamNode creation automatically runs rad init after git init SUPERSEDED: Implemented superior lazy initialization pattern
  • Graceful handling if Radicle unavailable (creation continues)
  • "Share DreamNode" command checks for new commits to share
  • Share command disabled/returns message if nothing new
  • rad push executes in background with status indicator
  • Success notification after successful share
  • Clone command accepts Radicle ID input
  • Clone auto-derives DreamNode name from Radicle metadata
  • Clone command runs rad clone and integrates into vault

Metadata & Contact Info

  • radicleId field added to DreamNode metadata structure
  • Radicle ID saved alongside email/phone contact fields
  • Metadata persists correctly in .udd file (single JSON file)

Platform Compatibility

  • Platform detection prevents Radicle on Windows
  • Placeholder code structure for future GitHub implementation
  • Windows limitation documented in README

Error Handling

  • Radicle errors logged and reported to user
  • Core DreamNode operations continue despite Radicle failures
  • Clear error messages for missing Radicle installation

Documentation

  • Platform compatibility notes (macOS/Linux only)
  • Windows limitation and future GitHub solution noted
  • Radicle CLI installation guide in README (deferred - can be added incrementally)
  • Radicle identity setup instructions (rad auth) (deferred - can be added incrementally)

Implementation Summary

✅ Core Features Implemented

1. Lazy Radicle Initialization (Superior to Original Plan)

  • DreamNodes created local-first (no automatic init on creation)
  • Intelligent initialization triggered on first network use (video call email export)
  • RadicleBatchInitService handles batch rad init with race condition prevention
  • Graceful degradation if Radicle unavailable

2. Clone Workflow with Deep Links

  • Obsidian URI protocol: obsidian://interbrain-clone?id=rad:...
  • Auto-derive DreamNode name from Radicle metadata
  • Duplicate detection with performance optimization
  • Auto-refresh after clone (vault scan + relationship scan + constellation layout)
  • Auto-focus on cloned/existing nodes
  • Batch clone support for multiple nodes

3. Share Command

  • Manual "Share DreamNode" command
  • Background rad push operation
  • Status notifications
  • Error handling and graceful degradation

4. Performance Optimizations

  • Constellation repositioning: 100x faster (10s → 100ms)
  • Radicle duplicate detection: ~10x faster (parallel I/O + early exit)
  • Parallel DreamSong relationship scanning

5. Metadata & Storage

  • radicleId field in UDD schema and runtime types
  • Auto-save Radicle ID to .udd file after clone
  • Contact field integration (email, phone, radicleId)

User Testing Results

✅ User testing completed successfully
✅ Clone workflow validated with real Radicle network
✅ Duplicate detection works instantly
✅ Auto-focus and auto-refresh working perfectly
✅ Performance optimizations confirmed (~100ms repositioning)
✅ No outstanding issues identified

Technical Achievements

Key Implementation Decisions:

  1. Lazy initialization (better than automatic init-on-creation)
  2. Single .udd file (not directory structure)
  3. Parallel I/O for relationship scanning
  4. Batch position updates for instant repositioning
  5. Early exit patterns for duplicate detection

Architecture Patterns:

  • Dependency injection for service composition
  • Graceful error handling throughout
  • Platform detection for cross-platform compatibility
  • Intelligent caching with .udd file storage

Definition of Done

  • Implementation complete and tested on macOS
  • Platform detection working correctly
  • All enhanced acceptance criteria met (see above)
  • User testing validated core functionality
  • Performance optimizations implemented
  • Comprehensive documentation (deferred to incremental updates)

Next Steps

Feature Complete - Ready for epic integration

Documentation enhancements (can be separate PRs):

  • Detailed Radicle setup section in README
  • rad auth configuration guide
  • Troubleshooting section

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature level issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions