---
name: 命令执行流程
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:
  - execution_result
  - evidence
required_evidence:
  - command_classification
  - execution_result
version: 1.0.0
last_reviewed: '2026-05-22'
migration_note: 知识资产标准化迁移
type: pipeline_procedure
when: 命令执行流程
status: active
---
# 命令执行流程

## 步骤

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

## 注意事项

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