Skip to content

Windows: lifecycle.js uses Unix-only ps/sleep/tail, causing false status and unreliable loop management #379

@q7793527

Description

@q7793527

Summary

src/ops/lifecycle.js is not Windows-compatible because it shells out to Unix commands like ps, sleep, and tail.

This breaks lifecycle management on Windows in multiple ways:

  • status reports running: false even when the loop process is alive
  • check can misclassify health because process discovery fails
  • stop/restart rely on Unix sleep calls
  • log relies on Unix tail
  • startup troubleshooting becomes confusing because the loop may be running while lifecycle reports otherwise

Environment

  • Evolver version: 1.65.0
  • Node.js: node.exe on Windows
  • Platform: Windows
  • Launch mode: node index.js --loop

Reproduction

  1. Start the loop on Windows:
    node src/ops/lifecycle.js start
  2. Confirm the process is really alive from the OS side.
  3. Run:
    node src/ops/lifecycle.js status
  4. Observe that it may return {"running":false} even though the loop process is still running.

Root Cause

Current lifecycle implementation uses Unix-only shell commands:

  • ps -e -o pid,args
  • ps -p <pid> -o args=
  • sleep
  • tail

Those are not portable on standard Windows environments.

What We Observed

Before patching locally, status returned running: false on Windows while the actual process command line was:

node C:\Users\Administrator\<redacted>\skills\evolver\index.js --loop

After applying a local Windows compatibility patch, lifecycle behaved correctly and reported:

{
  "running": true,
  "pids": [
    {
      "pid": 2184,
      "cmd": "node C:\\Users\\Administrator\\<redacted>\\skills\\evolver\\index.js --loop"
    }
  ],
  "log": "logs\\evolver_loop.log"
}

and:

{
  "healthy": true,
  "pids": [2184]
}

Impact

This is user-visible on Windows because:

  • local auto-evolution appears broken even when it is actually running
  • restart/stop behavior becomes unreliable
  • login-startup debugging is much harder
  • operators may accidentally launch duplicate loops or think startup failed

Suggested Fix

Add a Windows code path in src/ops/lifecycle.js for:

  • process discovery
  • command line lookup
  • sleeping/delay
  • tailing logs

Examples:

  • use PowerShell / CIM / Get-CimInstance Win32_Process for process discovery and command line lookup
  • use PowerShell Start-Sleep for delays
  • use PowerShell Get-Content -Tail for log tailing
  • use path.delimiter instead of hardcoded : when mutating PATH

Privacy Note

All local paths in this report were redacted manually before submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions