AgentKit
DocsKitsCLI ReferenceDesktop App

test

ak test optimize

Explain impact-selected checks, optionally execute trusted commands

Use ak test optimize for the operation described below. The command help records its arguments, effects, and options.

Without a manifest at the --manifest path the command fails and asks you to configure trusted groups and full_suite. With --run, the command reloads the manifest and fails if it changed after planning.

Semantic modes use the test-impact consumer. A provider call happens only when you have enabled semantic_decision at user scope, set semantic_decision.consumers.test-impact to true, and supplied TYPESAFE_API_KEY in the environment. The grant is required even when you have no consumers map. See ak config prefs set.

Command contract

Explain impact-selected checks, optionally execute trusted commands

Synopsis

Default is read-only planning. Supply a trusted manifest with group commands, ownership, full-suite groups and explicit policy mappings. Invalid optional evidence broadens; missing mandatory mappings block. --run executes repository code without a sandbox.

Effects: Planning reads Git and policy only. --run executes trusted commands in this repository; --output creates a local receipt. Semantic mode defaults off; an explicitly permitted mode may send compact facts and incur provider charges. Shadow never changes the effective plan.

Exit status: 0 executable plan or all selected checks passed 1 invalid inputs, blocked plan, failed or stale execution 2 invalid arguments

ak test optimize [flags]

Examples

  ak test optimize --base origin/dev --json
  ak test optimize --base origin/dev --run --json

Options

      --base string               Git comparison base (required)
      --evidence string           Optional bounded external evidence JSON
      --head string               Git comparison head; local changes also count (default "HEAD")
  -h, --help                      help for optimize
      --json                      Emit machine-readable JSON (implies --no-interactive)
      --manifest string           Repository-owned executable group manifest (default ".agentkit/test-impact.json")
      --no-interactive            Disable interactive prompts (CI-safe)
      --output string             Create a new local JSON result file; never overwrite
  -q, --quiet                     Suppress non-error output on stderr
      --run                       Execute trusted manifest commands; this is not a sandbox
      --semantic string           Optional semantic observations: off, shadow, or advisory; requires explicit user consent (default "off")
      --semantic-context string   Reviewed compact semantic context JSON bound to this request
  -V, --verbose                   Extra diagnostic output on stderr (loses to --quiet)
  -y, --yes                       Assume yes for all prompts

SEE ALSO

  • ak test - Plan and execute repository test-impact checks