Commit Graph

2 Commits

  • fix: eliminate EADDRINUSE crash loop with robust port binding
    Root cause: fuser-based EADDRINUSE handler killed the current process
    due to a race condition during systemd restart cycles. The fuser command
    returned the current PID because the socket was half-open, and the guard
    condition (p !== process.pid) failed to filter it.
    
    Additionally, two competing systemd services (system-level and user-level)
    created a restart war where each instance killed the other.
    
    Fix approach (inspired by Next.js, Vite, webpack-dev-server):
    - Replace fuser with net.createServer port probe (no external commands)
    - PID-file based stale detection + ss fallback for orphan detection
    - Wait loop with 300ms polling after SIGTERM to stale process
    - Single-service architecture (disabled user-level unit)
    
    Tested: 5 consecutive rapid restarts, 8+ minute uptime, zero crashes.
    
    Co-Authored-By: zcode <noreply@zcode.dev>
  • docs: add documentation structure diagram and changelog
    Added comprehensive documentation infrastructure:
    
    1. DOCUMENTATION_STRUCTURE.md (31,736 bytes, 399 lines)
       - ASCII art visualization of documentation hierarchy
       - File structure tree diagram
       - Documentation coverage matrix
       - Documentation flow diagram
       - Cross-reference map
       - Statistics and metrics
       - Visual organization for easy navigation
    
    2. CHANGELOG.md (9,863 bytes, 308 lines)
       - Follows Keep a Changelog format
       - Documents v2.0.0 major release (Ruflo integration)
       - Lists all added features (multi-agent swarm, plugin system, hooks, enhanced memory)
       - Documents 6 new tools (swarm_spawn, swarm_execute, etc.)
       - Details documentation updates (README, INSTALLATION, CREDITS, CONTRIBUTING)
       - Includes feature comparison table
       - Notes on breaking changes, migration guide
       - Unreleased section for v2.1.0 and v2.2.0
    
    Documentation Statistics:
    - Total: 13 files
    - Size: 134,636 bytes (131.5 KB)
    - Lines: 3,766 lines
    - Average: 10,356 bytes/file, 289 lines/file
    
    All documentation now fully complete and professional-grade!