Skip to content

[P0] Eliminate manual-terminal escape hatches with typed operator actions #125

Description

@James3014

Problem

DevSpace can already carry a large portion of the engineering lifecycle: isolated workspaces/worktrees, bounded workers, Candidate creation, verification, reconciliation, cutover/session control, and exact-effect identity. However, many flows still terminate with an instruction equivalent to:

Owner: open Terminal and run this command manually.

That is now a recurring automation boundary, not a one-off inconvenience.

A representative current fixture is OpenSWE → OpenCLI → ChatGPT Web G0 closure. The implementation Candidate, focused tests, independent review, real Web canary, semantic_run, fresh semantic_reconcile, and zero-resend evidence all passed, but final production host activation could not be performed through Dev MCP because the target paths live outside configured repository/workspace roots. Issue #124 tracks that concrete host-scoped production activation primitive.

This umbrella issue tracks the broader product/control-plane requirement: bounded, mechanically specifiable host/operator actions should not fall back to manual Terminal work solely because Dev MCP lacks a typed primitive.

Goal

Reduce MANUAL_TERMINAL_REQUIRED to genuine human/security boundaries rather than routine engineering mechanics.

Target end state:

diagnose
→ implement
→ verify
→ accept
→ host/operator action
→ production canary
→ reconcile
→ closure

For an already-authorized bounded operation, Owner should not need to return to a Mac Terminal simply to execute a deterministic command that could have been represented as a typed, fenced, auditable action.

Non-goal

This MUST NOT become arbitrary remote shell or arbitrary home-directory write authority.

Do not add a generic run_any_terminal_command / unrestricted sudo / unrestricted filesystem mutation API.

The existing principle remains: source, accepted Candidate, installed artifact, loaded runtime and acceptance are separate evidence clocks; OUTCOME_UNKNOWN != retry permission.

Required design

1. Typed Operator Action contract

Introduce a registry/catalog of bounded operator actions. Each action should define server-side:

  • action/capability id;
  • exact permitted effect class;
  • fixed or bounded target set;
  • required authority/approval class;
  • precondition/preimage schema;
  • accepted Candidate/source identity schema where applicable;
  • rollback contract;
  • physical readback contract;
  • reconciliation contract;
  • claim ceiling.

The model/controller chooses an action id and supplies bounded parameters; it does not supply an arbitrary executable or arbitrary path.

2. Explicit manual-terminal blocker taxonomy

When DevSpace cannot perform an action, return a typed blocker rather than prose-only guidance.

At minimum distinguish:

HOST_ACTION_CAPABILITY_MISSING
PRIVILEGED_HUMAN_ACTION_REQUIRED
OS_INTERACTIVE_APPROVAL_REQUIRED
UNSUPPORTED_EXTERNAL_EFFECT
AUTHORITY_OR_APPROVAL_REQUIRED
BLOCKED_PREIMAGE_DRIFT

This enables measurement of which manual steps should be productized vs which must remain human.

3. Durable operation identity before consequential effect

Every effectful operator action must have a stable operation/attempt id persisted before the first possible host effect.

Transport timeout / 502 / disconnect MUST NOT authorize another execution attempt.

Required status/reconciliation outcomes should support at least:

PREPARED
NO_EFFECT
APPLIED
PARTIAL_EFFECT
ROLLED_BACK
EFFECT_UNKNOWN
BLOCKED_DRIFT

4. Exact preimage fencing

Consequential host actions must bind expected pre-state, e.g. exact SHA/version/service identity/config identity.

If physical truth differs, fail closed before mutation.

5. Transaction + rollback

Where multiple physical targets form one semantic activation:

verify preimages
→ create rollback bundle
→ prepare postimages
→ verify postimage identities
→ apply bounded transaction
→ physical readback
→ terminal receipt

On partial failure, inspect physical truth and perform only the contract-defined rollback/reconcile path.

6. Approval is separate from execution

An Owner approval or standing grant can authorize an exact operator action, but approval must not grant generic shell access.

Pairing/approval should bind the exact action family, target scope, preimage/candidate identity and expiry.

7. Capability Discovery integration

Write-capable agents should discover an existing operator-action capability before proposing another one-off deploy/activation script.

The concrete #124 host activation primitive should become the first reusable donor/fixture for this layer.

Initial operator-action families to evaluate

Do not implement all at once. Start from current repeated manual-Terminal escape hatches and add only bounded action families with clear physical contracts.

Suggested families:

  1. Host-scoped production activation — child: [P0] Host-scoped production activation & reconciliation primitive #124.
  2. Pinned package/runtime installation or upgrade — exact package/version/manifest only; not arbitrary npm install / pip install.
  3. Bounded service lifecycle — specific registered launchd/service identity; start/stop/restart/status/reconcile, similar to current cutover donor patterns.
  4. Bounded host configuration — catalogued config targets and typed fields only.
  5. Credential/pairing lifecycle actions — prepare → explicit Owner approval → resume/readback, with no credential leakage.
  6. Registered maintenance/repair action — only when executable/target/effect class are fixed server-side.

Human actions that may legitimately remain manual

The objective is not zero human authority. The following can remain explicit human gates when the OS/security model requires them:

  • first-time macOS security/privacy UI approval;
  • root/sudo or irreversible machine-wide permission elevation without a bounded approved primitive;
  • new credential consent where the provider requires user interaction;
  • high-risk release/production approval decisions;
  • operations whose target/blast radius cannot be mechanically bounded.

The system should report these as typed PRIVILEGED_HUMAN_ACTION_REQUIRED / OS_INTERACTIVE_APPROVAL_REQUIRED, not misclassify them as missing engineering automation.

Acceptance / DoD

Contract

  • No arbitrary shell/executable/path inputs for consequential operator actions.
  • Each action has server-side fixed/bounded target semantics.
  • Exact authority/approval and expiry are explicit.
  • Stable operation identity exists before external/host effect.
  • Preimage drift fails closed.
  • Timeout/disconnect never becomes blind retry permission.
  • Status + reconcile can distinguish confirmed no-effect, applied, partial and unknown outcomes.
  • Rollback is bounded and identity-checked.
  • Physical post-effect readback is required before success receipt.

Manual-terminal telemetry

  • DevSpace can emit a typed manual-terminal blocker classification.
  • Missing capability vs true human/security requirement are separate.
  • These blockers are visible enough to identify repeated escape hatches worth productizing.

First physical fixture — #124

  • Use [P0] Host-scoped production activation & reconciliation primitive #124 as the first end-to-end fixture.
  • A previously accepted OpenCLI adapter Candidate can be host-activated to the three fixed production surfaces without Owner opening Terminal.
  • Exact old SHA/preimage must match before mutation.
  • Backup/rollback bundle created.
  • User/global adapter and launcher pin postimages physically read back.
  • Production long-protocol canary passes.
  • Fresh semantic_run reaches terminal success.
  • Fresh semantic_reconcile returns the same terminal result with zero resend.

Relationship to #124

#124 should not be broadened into a generic shell executor. Its accepted design should instead become the first donor pattern for the typed operator-action layer.

Priority rationale

This is high priority because the current system can spend substantial effort achieving a verified Candidate and still stop one step before physical production closure solely because the final deterministic host action has no governed tool surface.

That repeatedly converts an otherwise unattended engineering lifecycle back into Owner-operated Terminal work.

The desired product property is therefore not 'Dev MCP can run more commands'. It is:

Every recurring bounded consequential operation has an explicit, typed, authority-aware, crash-consistent execution and reconciliation contract.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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