---
name: command-execution-workflow
scope:
  - '*'
products:
  - '*'
id: ka-procedure-命令执行流程
asset_kind: procedure
lifecycle_status: active
authority: supporting
owner_mechanism_id: mc-command-execution
routes:
  - code_change
primary_triggers:
  - 命令执行流程
secondary_triggers: []
negative_triggers: []
priority: P1
specificity: 5
consumes:
  - mc-tool-invocation-contract
emits:
  - command_execution_result
  - command_classification
required_evidence:
  - command_classification
  - execution_result
version: 1.1.0
last_reviewed: '2026-06-01'
type: procedure
when: 命令执行流程
stages: ["任务规划", "编码与单元测试"]
---
# 命令执行流程

## 步骤

1. 接收命令 (command string)
2. 调用 classifyCommand 分级
3. 检查分级结果:
   - destructive → 需人工确认
   - mutating → 可执行，记录证据
   - read_only → 自由执行
4. 执行命令
5. 收集执行结果和证据
6. 记录到 task_context

## 注意事项

- 命令分级基于模式匹配，不是白名单
- 未知命令默认为 mutating
- 命令参数中的敏感信息需脱敏
