Skip to content

Doctor validator does not expand ${ENV_VAR} in script: paths before checking file existence #191

Description

@odink-kindo

Summary

OrgLoop's orgloop doctor validator checks whether a script: path exists on disk but does not expand environment variable references (e.g. ${ORGLOOP_PROJECT_ROOT}) before calling stat/access. This causes a false-positive failure even when the file is present and the env var is set correctly.

Repro

  1. Set ORGLOOP_PROJECT_ROOT=/path/to/project in .env
  2. Define a transform with script: ${ORGLOOP_PROJECT_ROOT}/scripts/my-script.sh
  3. Confirm the file exists at the resolved path
  4. Run orgloop doctor (with or without source .env) → reports Script not found: ${ORGLOOP_PROJECT_ROOT}/scripts/my-script.sh

Expected

Doctor expands env var references in script: paths before checking existence, matching how the daemon resolves them at runtime.

Impact

  • orgloop doctor exits non-zero and blocks orgloop start (without --force)
  • Workaround: orgloop start --force — runtime works correctly because the daemon expands env vars properly
  • The on_error: pass safety net also means the transform passes events through if the script is truly missing, so this is validator-only noise

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