Skip to content

Extend brain self-shutdown guard to systemd + Windows backends #552

@arul28

Description

@arul28

Follow-up from hardening the brain self-shutdown guard during the dev-loop skill migration (lane ade/chat-20260610-133027-f73c8097, commit 7114d941e).

Gap: #549 (Guard ADE brain against self-shutdown from managed sessions) added the self-mutation guard only to the macOS launchd backend (apps/ade-cli/src/serviceManager/installLaunchd.ts). The other two service backends have no equivalent guard:

  • apps/ade-cli/src/serviceManager/installSystemd.ts
  • apps/ade-cli/src/serviceManager/installWindows.ts

So on Linux/Windows a command running inside the brain can still brain stop / brain restart and tear down its own active ADE sessions — exactly what #549 prevents on macOS.

Scope:

  • Apply the same isCurrentProcessDescendantOfPid + ADE_ALLOW_RUNTIME_SERVICE_SELF_MUTATION=1 escape-hatch check to the systemd and Windows install/uninstall paths.
  • Set the typed selfMutationBlocked discriminator on those results too (added to the launchd path in commit 7114d941e) so cli.ts detection stays backend-agnostic.
  • Mirror the launchd refuse/allow tests in serviceManager/common.test.ts for systemd + Windows.

Found while self-reviewing #549; not blocking the migration work.

ADE branch: https://ade-app.dev/open?type=branch&repo=arul28%2FADE&branch=ade%2Fchat-20260610-133027-f73c8097

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions