Skip to content

Add the Destructive Command Guard binary service and runner #1056

Description

@navedmerchant

Parent

Part of #1049. This is the second independently reviewable slice of the Destructive Command Guard work.

Dependency

Depends on the shared managed-binary infrastructure issue created as the first slice.

Problem

The extension needs a small, testable service boundary for selecting, installing, verifying, and invoking the pinned DCG binary. Command-execution policy should not own platform/archive/process details.

Scope

  • Define the pinned DCG version and supported platform/architecture archive metadata.
  • Install and verify DCG through the shared managed-binary infrastructure.
  • Cache/deduplicate installation within the extension process while allowing retries after failure.
  • Run DCG with a command and working directory, parse its structured result, and map it to a typed allow/deny result.
  • Treat unsupported platforms, malformed output, process failures, and timeouts conservatively.
  • Add focused manager and runner tests.

Out of scope

  • Persisted settings or settings UI.
  • Auto-approval policy and command tool integration.
  • Chat rendering for denied commands.

Acceptance criteria

  • Supported platforms resolve pinned archives with checksums.
  • Installation uses the shared managed-binary lifecycle.
  • Concurrent callers share one installation attempt and failures can be retried.
  • Runner output is parsed into a typed allow/deny result with optional reason/rule metadata.
  • Runner failures and invalid output do not accidentally classify a command as safe.
  • Focused DCG service tests pass.
  • The stacked branch type-checks/builds independently.

Stack

Base: the managed-binary PR. The settings issue will build on this issue.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions