2.1 KiB
2.1 KiB
02 — Safely control the Shell Target
What to build: The first complete Target Adapter, allowing Bash and Zsh users to enable or disable the Active Profile from the TUI and have the invoking parent Shell synchronize after exit, while establishing the reusable Target seam and safety model for later integrations.
Blocked by: 01 — Create and activate persistent Proxy Profiles.
Status: ready-for-agent
- A shared Target Interface exposes description, inspection, and desired-state operations without leaking platform paths or commands to the TUI.
- The Shell Target is Available only for detected Bash or Zsh environments; unsupported Shells are explained outside the main Target list.
- Enabling writes the Active Profile as conventional upper- and lower-case HTTP, HTTPS, ALL, and bypass environment assignments.
- Disabling emits the required unsets and restores any prior recognized Shell proxy state rather than silently discarding it.
- Attempts to enable without an Active Profile fail immediately with a route to Profile management.
- Inspection distinguishes Enabled, Disabled, External, and Drifted according to the glossary.
- The TUI shows an applying state and changes the switch only after success; failures preserve or re-inspect the actual state and show a redacted explanation.
- Shell integration install and uninstall operations are explicit, idempotent, and preserve unrelated user startup configuration.
- After an integrated TUI invocation exits, the parent Bash or Zsh session loads the generated assignments or unsets.
- Recovery metadata follows XDG state conventions, uses atomic writes and owner-only permissions where secrets may be present.
- When invoked through
sudo, Profile and user Target state resolve to the invoking user; a direct root login resolves to root. - A reusable Target contract harness verifies availability, all four states, enable, disable, restoration, idempotency, validation failure, permission failure, partial failure, and secret redaction without touching the host Shell configuration.