Files
nexus/wiki/concepts/GitAsAuditLog.md

36 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Git-as-Audit-Log"
type: concept
tags: [version-control, git, audit, multi-agent]
sources: [autonomous-project-management]
last_updated: 2026-04-22
---
## 定义
将所有状态变更(包括 [[Shared State Coordination]] 中的 STATE.yaml 变更)作为 Git 提交处理,从而获得完整可追溯的决策和执行历史的方法。
## 核心实践
每次对 STATE.yaml 的修改都触发一个 Git 提交:
```bash
# 状态更新后
git add STATE.yaml
git commit -m "task(id=xxx): updated status from in_progress to done"
```
## 价值
1. **完整历史追溯**:任意时刻可回滚到任何历史状态
2. **决策上下文保留**:每次变更的 commit message 即变更理由的记录
3. **团队协作基础**多成员可查看、review 状态变更历史
4. **自动化 CI/CD 集成**:可基于 Git 状态变更触发后续流程
## 在 [[autonomous-project-management]] 中的角色
- 规则明确All state changes committed to git
- 每个 PM 子 Agent 负责自己 STATE.yaml 的 Git 提交
- 结合 [[Git-as-Audit-Log]] 和 [[Shared State Coordination]],实现自文档化的项目协调
## Commit Message 约定
建议格式:`[type](task_id): description`
- `type`: started / updated / completed / blocked / unblocked
- `task_id`: 对应 STATE.yaml 中的任务 ID
- `description`: 变更的具体内容