Skip to content

feat(control): add verified clamshell mutations #2

Description

@LMLiam

Goal

Add idempotent enable, disable, and toggle operations through a helper that accepts no arbitrary privileged command.

Acceptance criteria

  • Skip unnecessary mutations.
  • Map enabled and disabled to the exact battery-only pmset commands.
  • Require effective UID zero and accept only one literal helper argument.
  • Invoke the helper through sudo -n.
  • Verify final state before success.
  • Support quiet output without hiding errors.

Owned files

ClamshellService.swift, PrivilegedHelperClient.swift, ClamshellHelper.swift, mutation commands, and their tests.

Dependencies

Read-only state support.

Verification

swift test --filter ClamshellServiceTests
swift test --filter PowerMutationTests
swift test --filter PrivilegedHelperClientTests
swift test
swift build -c release

Plan: Phase 3, Tasks 5–7

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCommand-line interface and user-facing commandsarea: privilegePrivileged helper and installation boundarystatus: in reviewImplemented in an open pull requesttype: featureNew user-facing behaviour

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions