---
name: product-contract
scope:
  - '*'
products:
  - '*'
id: ka-hard-rule-产物契约规则
asset_kind: governance_rule
lifecycle_status: active
authority: canonical
owner_mechanism_id: mc-artifact-contract
routes: ['*']
primary_triggers:
  - 产物契约规则
secondary_triggers: []
negative_triggers: []
priority: P0
specificity: 5
consumes:
  - mc-workflow-contract
hard_blocks:
  - 产物scope外
  - force_overwrite
fallback: manual_required
required_evidence:
  - output_artifact
  - artifact_status
version: 1.1.0
last_reviewed: '2026-06-01'
type: governance_rule
when: 产物契约规则
stages: ["*"]
---

# 产物契约规则

## 核心约束

1. 产物必须通过 `artifact_contract_registry` 注册，包含 kind、format、path、overwrite_policy。
2. 产物生命周期：draft → verified → accepted。跳过阶段必须显式声明 `skip_verification`。
3. `overwrite_policy` 仅允许 `fail_if_exists` 或 `versioned`。禁止 `force_overwrite`。
4. 产物路径必须在 `declared_scope` 内。scope 外产物触发 hard_fail。
5. 所有产物变更必须通过 `sf_verify` 验证后才能推进状态。

## 适用场景

- 单产物生成 (`single_artifact`)
- 多阶段计划产物交付 (`multi_stage_plan`)
- 代码执行产物 (`code_execution`)

## 违规处理

- 未注册产物 → hard_fail，阻断交付
- scope 外产物 → hard_fail，阻断写入
- 跳过验证且无声明 → advisory，标记降级
