Skip to content

Cloud autosync wrapper examples should preserve logs and failure exit codes #341

@IrrealV

Description

@IrrealV

📋 Pre-flight Checks

  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened

📝 Bug Description

This is the wrapper/docs hardening slice split out from umbrella issue #299, per maintainer feedback to separate operator wrapper behavior from product repair behavior.

In a real WSL/Windows beta setup, scheduled Engram Cloud autosync wrappers made sync failures effectively invisible by discarding stdout/stderr and forcing success. That meant cloud sync could be broken while the scheduled task still looked healthy.

Observed bad wrapper patterns:

  • Bash wrapper redirected output to /dev/null and used || true.
  • PowerShell wrapper used $ErrorActionPreference = 'SilentlyContinue', discarded output, and hid the WSL sync result.
  • Scheduled task reported success even when project sync/import failed internally.

🔄 Steps to Reproduce

  1. Configure a scheduled or wrapper-based Engram Cloud sync flow on WSL/Windows.
  2. Use wrapper patterns that discard stdout/stderr and force success, such as:
    • command >/dev/null 2>&1 || true
    • $ErrorActionPreference = 'SilentlyContinue'
  3. Trigger a real cloud sync failure, e.g. a legacy mutation canonicalization blocker.
  4. Check the wrapper/scheduled-task result.
  5. Observe a successful wrapper exit despite failed sync work.

✅ Expected Behavior

Product-provided docs/examples/scripts for scheduled autosync should be fail-visible:

  • preserve stdout/stderr in a durable log;
  • log project-by-project start/end/failure status;
  • propagate a non-zero exit code if any push/import/sync step fails;
  • avoid || true, broad SilentlyContinue, and unconditional success exits;
  • document where logs live and how to inspect the last failure.

❌ Actual Behavior

The beta environment used wrappers that made autosync failures invisible until manual investigation:

  • WSL Bash hid output and forced success.
  • Windows PowerShell suppressed errors and hid the WSL sync-all result.
  • The scheduled task could report success while cloud sync had failed.

Operating System

Windows (WSL)

Engram Version

Beta / post-1.15 cloud sync environment

Agent / Client

OpenCode

📋 Relevant Logs

# After manual wrapper hardening, these became visible and successful:
WSL wrapper finished with status=0
Windows wrapper finished with WINDOWS_SYNC_EXIT:0
Scheduled task EngramCloudSyncAll finished with LastTaskResult=0

💡 Additional Context

Parent umbrella: #299.

This issue intentionally excludes product repair logic for legacy sync_mutations required fields. That is split into #340.

The local beta repair updated wrappers to:

  • stop discarding stdout/stderr;
  • log to durable files;
  • report each project separately;
  • return non-zero if any push/import failed.

Potential affected docs/examples include Engram Cloud troubleshooting, quickstart, and any scheduled autosync wrapper snippets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions