reasonweave 0.0.0-stage → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +101 -0
- package/INSTALL.md +258 -0
- package/README.md +280 -2
- package/bin/lab.mjs +888 -0
- package/constitution.md +55 -0
- package/docs/CONSUMER-PROMPTS.md +474 -0
- package/docs/backlogs/01-forward-wait-self-detach.md +18 -0
- package/docs/backlogs/02-decouple-wait-and-daemon-for-agent-hosts.md +35 -0
- package/docs/backlogs/03-baton-wait-multi-id-lightweight-pubsub.md +34 -0
- package/docs/backlogs/04-adr-cross-repo-automated-dispatch-boundary.md +19 -0
- package/docs/backlogs/05-feat-units-worktree-isolation-engine.md +23 -0
- package/docs/backlogs/06-feat-blind-audit-automated-clean-runner.md +22 -0
- package/docs/backlogs/07-feat-attention-throttle-silent-pipe.md +23 -0
- package/docs/backlogs/08-future-units-shadow-ledger.md +22 -0
- package/docs/backlogs/09-feat-agent-baton-core-convergence-and-resilience.md +42 -0
- package/docs/backlogs/10-feat-anti-orphan-deterministic-wiring-governance.md +35 -0
- package/docs/backlogs/11-perf-orphan-index-fs-read.md +16 -0
- package/docs/backlogs/12-feat-vibe-security-anti-suppression-and-orphan-deps.md +43 -0
- package/docs/backlogs/13-feat-sdd-reppit-tiered-guardrails.md +40 -0
- package/docs/backlogs/14-feat-universal-cli-contract-and-hermetic-test-fixtures.md +48 -0
- package/docs/backlogs/15-feat-reasonweave-rebranding-and-doc-code-synchronization-invariant.md +44 -0
- package/docs/backlogs/16-feat-micro-engineering-skills-and-sdd-baton-fusion.md +52 -0
- package/docs/codegraph-readiness-check.md +49 -0
- package/group/architecture/adr/0001-handoff-async-wait-and-reactive-wakeup.md +87 -0
- package/group/architecture/adr/0002-de-ritualize-handoff-prompt-for-intra-repo.md +53 -0
- package/group/architecture/adr/0003-attention-throttle-and-workspace-driver.md +65 -0
- package/group/architecture/adr/0004-spec-guard-and-drift-prevention.md +90 -0
- package/group/architecture/adr/0005-global-orphan-scavenger-and-read-only-invariants.md +94 -0
- package/group/architecture/adr/0006-triad-engineering-defense-and-mutation-sensitivity.md +68 -0
- package/group/architecture/adr/0007-agent-baton-state-machine-defense-and-workspace-jail-spec.md +86 -0
- package/group/architecture/adr/0008-agent-baton-core-convergence-and-heterogeneous-session-resilience.md +133 -0
- package/group/architecture/adr/0009-anti-orphan-deterministic-wiring-governance-and-federated-guardrails.md +108 -0
- package/group/architecture/adr/0010-agent-baton-identity-security-cryptographic-credentials-and-prompt-anti-confusion.md +119 -0
- package/group/architecture/adr/0011-vibe-security-anti-suppression-and-dependency-reachability.md +161 -0
- package/group/architecture/adr/0012-spec-driven-development-reppit-and-tiered-guardrails.md +130 -0
- package/group/architecture/adr/0013-universal-cli-contract-hermetic-testing-and-defensive-probes.md +110 -0
- package/group/architecture/adr/0014-reasonweave-rebranding-and-doc-code-synchronization-invariant.md +108 -0
- package/group/architecture/adr/0015-micro-engineering-skills-and-dual-core-gate-invariant.md +127 -0
- package/group/architecture/adr/INDEX.md +29 -0
- package/group/architecture/adr/templates/adr-template.md +33 -0
- package/group/architecture/dependency-graph.md +60 -0
- package/group/contracts/npm-packaging.md +69 -0
- package/group/product/intent.md +24 -0
- package/package.json +93 -4
- package/scripts/sync-all-consumers.mjs +174 -0
- package/specs/RFC-20261110-SPEC-GUARD-UNIT.md +353 -0
- package/specs/templates/01-research.md.template +23 -0
- package/specs/templates/02-proposals.md.template +22 -0
- package/specs/templates/03-spec.md.template +33 -0
- package/specs/templates/04-tasks.md.template +29 -0
- package/specs/templates/05-evidence.md.template +29 -0
- package/specs/templates/README.md +26 -0
- package/units/adr/AGENTS.md +85 -0
- package/units/adr/CHANGELOG.md +20 -0
- package/units/adr/README.md +88 -0
- package/units/adr/VERSION.md +10 -0
- package/units/adr/docs/existing-project-prompt.md +24 -0
- package/units/adr/docs/new-project-prompt.md +36 -0
- package/units/adr/scripts/adr-init.sh +101 -0
- package/units/adr/templates/INDEX.md +19 -0
- package/units/adr/templates/adr-frozen.md +33 -0
- package/units/adr/templates/adr-light.md +56 -0
- package/units/adr/templates/adr-standard.md +61 -0
- package/units/backlog/AGENTS.md +53 -0
- package/units/backlog/AUTONOMOUS-GOVERNANCE.md +98 -0
- package/units/backlog/CHANGELOG.md +37 -0
- package/units/backlog/README.md +124 -0
- package/units/backlog/VERSION.md +11 -0
- package/units/backlog/docs/existing-project-ironrules-prompt.md +31 -0
- package/units/backlog/docs/existing-project-prompt.md +24 -0
- package/units/backlog/docs/new-project-prompt.md +19 -0
- package/units/backlog/templates/entry.md +39 -0
- package/units/backlog/templates/project-ironrules.md +36 -0
- package/units/handoffs/AGENT-GUIDE.md +118 -0
- package/units/handoffs/AGENTS.md +28 -0
- package/units/handoffs/CHANGELOG.md +498 -0
- package/units/handoffs/CLAUDE.md +28 -0
- package/units/handoffs/COMMANDS.md +187 -0
- package/units/handoffs/DESIGN.md +74 -0
- package/units/handoffs/README.md +456 -0
- package/units/handoffs/RESPONSE-TEMPLATE.md +138 -0
- package/units/handoffs/VERSION.md +1 -0
- package/units/handoffs/handoff-status.mjs +1017 -0
- package/units/handoffs/handoff.mjs +5675 -0
- package/units/orphan/CHANGELOG.md +118 -0
- package/units/orphan/DESIGN.md +484 -0
- package/units/orphan/README.md +143 -0
- package/units/orphan/VERSION.md +1 -0
- package/units/orphan/adapters/android/index.mjs +140 -0
- package/units/orphan/adapters/python/index.mjs +232 -0
- package/units/orphan/adapters/web/index.mjs +280 -0
- package/units/orphan/bin/lab-orphan.mjs +298 -0
- package/units/orphan/core/blob-reader.mjs +142 -0
- package/units/orphan/core/classifier.mjs +261 -0
- package/units/orphan/core/cleaner.mjs +166 -0
- package/units/orphan/core/diff-checker.mjs +341 -0
- package/units/orphan/core/inverted-index.mjs +124 -0
- package/units/orphan/core/orphan-deps.mjs +192 -0
- package/units/orphan/core/protocol-s1-s3.mjs +194 -0
- package/units/orphan/core/solver.mjs +217 -0
- package/units/orphan/index.mjs +105 -0
- package/units/orphan/templates/ci/orphan-guard.yml +36 -0
- package/units/orphan/templates/pre-commit.d/30-orphan-guard +34 -0
- package/units/orphan/templates/wiring/README.md +51 -0
- package/units/orphan/templates/wiring/miniprogram-route-guard.js.template +80 -0
- package/units/orphan/templates/wiring/pre-commit-node.sh.template +73 -0
- package/units/orphan/templates/wiring/project-agents-gemini-templates.md +60 -0
- package/units/orphan/templates/wiring/python-parity-test.py.template +100 -0
- package/units/orphan/templates/wiring/rust-exhaustive-match.md +65 -0
- package/units/orphan/templates/wiring/swift-periphery.md +56 -0
- package/units/orphan/tests/adapters.test.mjs +243 -0
- package/units/orphan/tests/orphan-deps.test.mjs +131 -0
- package/units/orphan/tests/phase3-gates.test.mjs +135 -0
- package/units/playbook/README.md +106 -0
- package/units/playbook/ZSPEC-AGENT-GUIDE.md +99 -0
- package/units/playbook/docs/01-architecture.md +99 -0
- package/units/playbook/docs/02-bootstrap.md +126 -0
- package/units/playbook/docs/03-units.md +91 -0
- package/units/playbook/docs/04-constitution.md +113 -0
- package/units/playbook/docs/05-adr.md +33 -0
- package/units/playbook/docs/06-spec-kit.md +76 -0
- package/units/playbook/docs/07-backlog.md +30 -0
- package/units/playbook/docs/08-codegraph.md +79 -0
- package/units/playbook/docs/09-skills.md +101 -0
- package/units/playbook/docs/10-handoff.md +72 -0
- package/units/playbook/docs/11-evidence.md +163 -0
- package/units/playbook/docs/12-gates.md +124 -0
- package/units/playbook/docs/13-parallel.md +115 -0
- package/units/playbook/docs/14-dependency-graph.md +86 -0
- package/units/playbook/docs/15-memory.md +153 -0
- package/units/playbook/docs/16-change-control.md +121 -0
- package/units/playbook/docs/17-prompts.md +121 -0
- package/units/playbook/docs/18-shift-left.md +97 -0
- package/units/playbook/docs/19-anti-orphan-vertical-slicing.md +102 -0
- package/units/playbook/docs/20-vibe-security-and-anti-suppression.md +88 -0
- package/units/playbook/docs/21-spec-driven-reppit-closed-loop.md +88 -0
- package/units/playbook/examples/owisel.md +80 -0
- package/units/playbook/references/Agent-Engineering-Framework-AEF-v1.0.md +2033 -0
- package/units/playbook/references/links.md +103 -0
- package/units/playbook/templates/AGENTS.root.md +44 -0
- package/units/playbook/templates/AGENTS.unit.md +52 -0
- package/units/playbook/templates/adr/INDEX.md +17 -0
- package/units/playbook/templates/adr/NNNN-template.md +56 -0
- package/units/playbook/templates/backlogs/entry.md +30 -0
- package/units/playbook/templates/constitution.md +93 -0
- package/units/playbook/templates/evidence/README.md +36 -0
- package/units/playbook/templates/group/architecture/dependency-graph.md +48 -0
- package/units/playbook/templates/group/architecture/system.md +59 -0
- package/units/playbook/templates/group/contracts/api.md +67 -0
- package/units/playbook/templates/group/product/intent.md +30 -0
- package/units/playbook/templates/group/product/requirements.md +48 -0
- package/units/playbook/templates/unit-skeleton/README.md +35 -0
- package/units/preflight/AGENTS.md +45 -0
- package/units/preflight/CHANGELOG.md +55 -0
- package/units/preflight/INSTALL.md +65 -0
- package/units/preflight/README.md +104 -0
- package/units/preflight/VERSION.md +3 -0
- package/units/preflight/docs/audit-requirements.md +114 -0
- package/units/preflight/docs/existing-project-prompt.md +25 -0
- package/units/preflight/docs/new-project-prompt.md +25 -0
- package/units/preflight/docs/transfers/CONSUMER-INSTALL.md +40 -0
- package/units/preflight/docs/transfers/CONSUMER-SELFCHECK.md +51 -0
- package/units/preflight/docs/transfers/README.md +39 -0
- package/units/preflight/docs/transfers/prospero.md +26 -0
- package/units/preflight/templates/check.sh +43 -0
- package/units/preflight/templates/pre-commit +55 -0
- package/units/preflight/templates/pre-commit.d/20-preflight +15 -0
- package/units/preflight/templates/preflight.conf.example +21 -0
- package/units/preflight/templates/preflight.sh +189 -0
- package/units/preflight/templates/wrap-up.md +9 -0
- package/units/review-gate/AGENTS.md +42 -0
- package/units/review-gate/CHANGELOG.md +58 -0
- package/units/review-gate/README.md +118 -0
- package/units/review-gate/VERSION.md +3 -0
- package/units/review-gate/clean-runner.mjs +350 -0
- package/units/review-gate/docs/existing-project-prompt.md +28 -0
- package/units/review-gate/docs/new-project-prompt.md +38 -0
- package/units/review-gate/docs/transfers/iggle.md +34 -0
- package/units/review-gate/docs/transfers/prospero.md +35 -0
- package/units/review-gate/docs/transfers/swoop.md +36 -0
- package/units/review-gate/docs/transfers/yiqiyihuihua.md +35 -0
- package/units/review-gate/templates/.semgrepignore +37 -0
- package/units/review-gate/templates/pre-commit +130 -0
- package/units/review-gate/templates/scan.sh +158 -0
- package/units/skills/AGENTS.md +17 -0
- package/units/skills/CHANGELOG.md +18 -0
- package/units/skills/README.md +63 -0
- package/units/skills/VERSION.md +1 -0
- package/units/skills/bin/review-package.mjs +99 -0
- package/units/skills/bin/task-brief.mjs +102 -0
- package/units/skills/catalog/brainstorming/SKILL.md +75 -0
- package/units/skills/catalog/brainstorming/references/design-doc-template.md +28 -0
- package/units/skills/catalog/systematic-debugging/SKILL.md +101 -0
- package/units/skills/catalog/systematic-debugging/references/root-cause-tracing.md +23 -0
- package/units/skills/catalog/test-driven-development/SKILL.md +88 -0
- package/units/skills/catalog/test-driven-development/references/writing-good-tests.md +13 -0
- package/units/skills/catalog/verification-before-completion/SKILL.md +73 -0
- package/units/skills/skills.mjs +181 -0
- package/units/skills/tests/pipeline.test.mjs +131 -0
- package/units/skills/tests/skill-contract.test.mjs +67 -0
- package/units/skills/tests/skills-cli.test.mjs +107 -0
- package/units/spec-guard/AGENTS.md +43 -0
- package/units/spec-guard/CHANGELOG.md +88 -0
- package/units/spec-guard/README.md +148 -0
- package/units/spec-guard/VERSION.md +1 -0
- package/units/spec-guard/bin/spec-guard.mjs +431 -0
- package/units/spec-guard/core/adr-parser.mjs +540 -0
- package/units/spec-guard/core/matrix-checker.mjs +587 -0
- package/units/spec-guard/core/mutation-runner.mjs +267 -0
- package/units/spec-guard/core/scanner.mjs +333 -0
- package/units/spec-guard/core/telemetry_authenticator.mjs +484 -0
- package/units/spec-guard/core/wiring_tracer.mjs +306 -0
- package/units/spec-guard/templates/annotations/ContractOnly.kt +19 -0
- package/units/spec-guard/templates/annotations/Invariant.kt +16 -0
- package/units/spec-guard/templates/annotations/invariant.go +19 -0
- package/units/spec-guard/templates/annotations/invariant.py +38 -0
- package/units/spec-guard/templates/annotations/invariant.ts +39 -0
- package/units/spec-guard/templates/ci/spec-guard-audit.yml +23 -0
- package/units/spec-guard/templates/pre-commit.d/15-spec-guard +72 -0
- package/units/spec-guard/templates/spec-matrix.overlay.yml +70 -0
- package/units/spec-guard/tests/spec-guard.test.mjs +716 -0
- package/units/spec-guard/tests/telemetry_authenticator.test.mjs +633 -0
- package/units/worktree/AGENTS.md +22 -0
- package/units/worktree/CHANGELOG.md +14 -0
- package/units/worktree/README.md +65 -0
- package/units/worktree/VERSION.md +1 -0
- package/units/worktree/worktree.mjs +352 -0
- package//344/275/277/347/224/250/350/257/264/346/230/216.md +322 -0
|
@@ -0,0 +1,2033 @@
|
|
|
1
|
+
# Agent Engineering Framework(AEF)
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0
|
|
4
|
+
**定位:** 面向 AI Agent 开发的软件工程框架
|
|
5
|
+
**核心公式:** `Intent → Spec → Context → Agent → Evidence → Convergence`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. 摘要
|
|
10
|
+
|
|
11
|
+
Agent Engineering Framework(AEF)是一套面向 AI Agent 开发的软件工程方法与项目结构。
|
|
12
|
+
|
|
13
|
+
AEF 不把 AI Agent 当作“更聪明的代码生成器”,而把 Agent 当作软件工程流水线中的执行者。
|
|
14
|
+
|
|
15
|
+
它解决的核心问题包括:
|
|
16
|
+
|
|
17
|
+
- 需求在对话过程中漂移
|
|
18
|
+
- Agent 缺少真实仓库上下文
|
|
19
|
+
- 多 Agent 对同一事实理解不一致
|
|
20
|
+
- 多端工程互相污染
|
|
21
|
+
- Agent 完成代码却没有可信验证
|
|
22
|
+
- 失败后只能重新开始
|
|
23
|
+
- 小改动被迫重跑整个 Spec
|
|
24
|
+
- Spec、代码、测试和产品结果逐渐失去一致性
|
|
25
|
+
|
|
26
|
+
核心原则:
|
|
27
|
+
|
|
28
|
+
> **人定义意图,Spec 固化意图,Context 提供事实,Agent 执行工作,Evidence 提供证明,Convergence 保证最终结果与意图一致。**
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# 2. 设计目标
|
|
33
|
+
|
|
34
|
+
### G1 — Intent Preservation
|
|
35
|
+
让人的原始意图跨越多个 Agent、开发阶段和版本持续存在。
|
|
36
|
+
|
|
37
|
+
### G2 — Repository Grounding
|
|
38
|
+
Agent 必须基于真实仓库事实,而不是只依赖聊天上下文。
|
|
39
|
+
|
|
40
|
+
### G3 — Multi-Agent Isolation
|
|
41
|
+
不同技术域拥有独立工程上下文,避免 Agent 互相污染。
|
|
42
|
+
|
|
43
|
+
### G4 — Verifiable Execution
|
|
44
|
+
Agent 的完成必须有证据,而不能只由 Agent 自己声称完成。
|
|
45
|
+
|
|
46
|
+
### G5 — Recoverability
|
|
47
|
+
任何阶段失败后,都可以从最近有效状态继续。
|
|
48
|
+
|
|
49
|
+
### G6 — Incremental Change
|
|
50
|
+
小改动只修改必要 Spec,不重建整个项目。
|
|
51
|
+
|
|
52
|
+
### G7 — Convergence
|
|
53
|
+
最终结果必须与 Intent、Spec、Architecture、Tasks、Code、Tests、Evidence 保持一致。
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
# 3. 非目标
|
|
58
|
+
|
|
59
|
+
AEF 不替代:
|
|
60
|
+
|
|
61
|
+
- Git
|
|
62
|
+
- CI/CD
|
|
63
|
+
- 测试框架
|
|
64
|
+
- IDE
|
|
65
|
+
- AI Coding Agent
|
|
66
|
+
- 编程语言
|
|
67
|
+
- 云平台
|
|
68
|
+
- 具体架构模式
|
|
69
|
+
|
|
70
|
+
AEF 是:
|
|
71
|
+
|
|
72
|
+
> **Agent 软件工程的控制层,而不是具体实现工具。**
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
# 4. 总体架构
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
HUMAN
|
|
80
|
+
│
|
|
81
|
+
Product Intent
|
|
82
|
+
│
|
|
83
|
+
▼
|
|
84
|
+
┌──────────────┐
|
|
85
|
+
│ GROUP │
|
|
86
|
+
│ Unified Truth│
|
|
87
|
+
└──────┬───────┘
|
|
88
|
+
│
|
|
89
|
+
┌───────────┼────────────┐
|
|
90
|
+
▼ ▼ ▼
|
|
91
|
+
Requirements Architecture Acceptance
|
|
92
|
+
│ │ │
|
|
93
|
+
└───────────┼────────────┘
|
|
94
|
+
▼
|
|
95
|
+
PLAN
|
|
96
|
+
│
|
|
97
|
+
▼
|
|
98
|
+
TASKS
|
|
99
|
+
│
|
|
100
|
+
┌───────────┼───────────┐
|
|
101
|
+
▼ ▼ ▼
|
|
102
|
+
Agent A Agent B Agent C
|
|
103
|
+
│ │ │
|
|
104
|
+
▼ ▼ ▼
|
|
105
|
+
Unit A Unit B Unit C
|
|
106
|
+
│ │ │
|
|
107
|
+
└───────────┼───────────┘
|
|
108
|
+
▼
|
|
109
|
+
IMPLEMENT
|
|
110
|
+
│
|
|
111
|
+
▼
|
|
112
|
+
VERIFY
|
|
113
|
+
│
|
|
114
|
+
▼
|
|
115
|
+
EVIDENCE
|
|
116
|
+
│
|
|
117
|
+
▼
|
|
118
|
+
CONVERGENCE
|
|
119
|
+
│
|
|
120
|
+
┌──────┴──────┐
|
|
121
|
+
│ │
|
|
122
|
+
CONVERGED GAP FOUND
|
|
123
|
+
│
|
|
124
|
+
▼
|
|
125
|
+
NEW TASK
|
|
126
|
+
│
|
|
127
|
+
└────→ IMPLEMENT
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
# 5. 七层模型
|
|
133
|
+
|
|
134
|
+
## Layer 1 — Intent
|
|
135
|
+
|
|
136
|
+
回答:
|
|
137
|
+
|
|
138
|
+
> 为什么做?
|
|
139
|
+
|
|
140
|
+
包括产品愿景、用户需求、业务目标、约束和 Non-goals。
|
|
141
|
+
|
|
142
|
+
Intent 不应该直接决定实现细节。
|
|
143
|
+
|
|
144
|
+
## Layer 2 — Specification
|
|
145
|
+
|
|
146
|
+
回答:
|
|
147
|
+
|
|
148
|
+
> 要实现什么?
|
|
149
|
+
|
|
150
|
+
包括 Requirements、User Stories、Business Rules、Acceptance Criteria、Edge Cases、Constraints。
|
|
151
|
+
|
|
152
|
+
## Layer 3 — Architecture
|
|
153
|
+
|
|
154
|
+
回答:
|
|
155
|
+
|
|
156
|
+
> 系统应该如何组织?
|
|
157
|
+
|
|
158
|
+
包括系统架构、领域模型、模块边界、API Contract、Data Model、Event Model、Security Model。
|
|
159
|
+
|
|
160
|
+
## Layer 4 — Context
|
|
161
|
+
|
|
162
|
+
回答:
|
|
163
|
+
|
|
164
|
+
> Agent 执行任务必须知道什么?
|
|
165
|
+
|
|
166
|
+
包括仓库结构、已有实现、技术约束、依赖、编码规范、架构决策、领域知识。
|
|
167
|
+
|
|
168
|
+
## Layer 5 — Execution
|
|
169
|
+
|
|
170
|
+
回答:
|
|
171
|
+
|
|
172
|
+
> 谁做什么、以什么顺序做?
|
|
173
|
+
|
|
174
|
+
包括 Agent Roles、Plan、Tasks、Dependencies、Parallelization。
|
|
175
|
+
|
|
176
|
+
## Layer 6 — Evidence
|
|
177
|
+
|
|
178
|
+
回答:
|
|
179
|
+
|
|
180
|
+
> 凭什么证明完成?
|
|
181
|
+
|
|
182
|
+
包括 Build、Tests、Runtime、Device、Logs、Screenshots、API Responses、Static Analysis、Diff。
|
|
183
|
+
|
|
184
|
+
## Layer 7 — Convergence
|
|
185
|
+
|
|
186
|
+
回答:
|
|
187
|
+
|
|
188
|
+
> 最终结果是否符合原始意图?
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
Intent
|
|
192
|
+
↕
|
|
193
|
+
Requirements
|
|
194
|
+
↕
|
|
195
|
+
Architecture
|
|
196
|
+
↕
|
|
197
|
+
Tasks
|
|
198
|
+
↕
|
|
199
|
+
Code
|
|
200
|
+
↕
|
|
201
|
+
Tests
|
|
202
|
+
↕
|
|
203
|
+
Evidence
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
# 6. Group / Unit
|
|
209
|
+
|
|
210
|
+
AEF 将项目拆成:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
GROUP
|
|
214
|
+
│
|
|
215
|
+
├── Product
|
|
216
|
+
├── Architecture
|
|
217
|
+
├── Acceptance
|
|
218
|
+
├── Shared Contracts
|
|
219
|
+
│
|
|
220
|
+
├── Unit: iOS
|
|
221
|
+
├── Unit: Android
|
|
222
|
+
├── Unit: Web
|
|
223
|
+
├── Unit: Backend
|
|
224
|
+
├── Unit: MCP
|
|
225
|
+
└── Unit: Infrastructure
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 6.1 Group
|
|
229
|
+
|
|
230
|
+
Group 是整个产品的统一事实层,负责:
|
|
231
|
+
|
|
232
|
+
- 产品目标
|
|
233
|
+
- 用户场景
|
|
234
|
+
- 全局 Requirements
|
|
235
|
+
- 核心业务规则
|
|
236
|
+
- 跨端 Contract
|
|
237
|
+
- 全局 Architecture
|
|
238
|
+
- Acceptance Criteria
|
|
239
|
+
|
|
240
|
+
Group 不负责平台具体实现。
|
|
241
|
+
|
|
242
|
+
## 6.2 Unit
|
|
243
|
+
|
|
244
|
+
Unit 是相对独立的工程域,例如:
|
|
245
|
+
|
|
246
|
+
```text
|
|
247
|
+
iOS
|
|
248
|
+
Backend
|
|
249
|
+
Web
|
|
250
|
+
MCP
|
|
251
|
+
Infrastructure
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Unit 负责:
|
|
255
|
+
|
|
256
|
+
- 本地工程事实
|
|
257
|
+
- 平台技术约束
|
|
258
|
+
- 本地 Architecture
|
|
259
|
+
- 实现细节
|
|
260
|
+
- 测试策略
|
|
261
|
+
- Build / Runtime 验证
|
|
262
|
+
|
|
263
|
+
核心思想:
|
|
264
|
+
|
|
265
|
+
> **Global intent + Local truth**
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
# 7. Harness
|
|
270
|
+
|
|
271
|
+
Harness 是 Agent 的运行控制层。
|
|
272
|
+
|
|
273
|
+
它决定:
|
|
274
|
+
|
|
275
|
+
```text
|
|
276
|
+
Agent 可以看到什么
|
|
277
|
+
Agent 可以做什么
|
|
278
|
+
Agent 必须遵守什么
|
|
279
|
+
Agent 如何验证
|
|
280
|
+
Agent 如何报告
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
典型结构:
|
|
284
|
+
|
|
285
|
+
```text
|
|
286
|
+
Unit
|
|
287
|
+
├── AGENTS.md
|
|
288
|
+
├── Skills
|
|
289
|
+
├── Rules
|
|
290
|
+
├── Context
|
|
291
|
+
├── Tools
|
|
292
|
+
├── Verification
|
|
293
|
+
└── Constraints
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
# 8. Context Engineering
|
|
299
|
+
|
|
300
|
+
AEF 不主张把整个 Repository 都塞给 Agent。
|
|
301
|
+
|
|
302
|
+
原则:
|
|
303
|
+
|
|
304
|
+
> **Give the agent enough context to make a correct decision, but not enough irrelevant context to confuse it.**
|
|
305
|
+
|
|
306
|
+
Context 分四类:
|
|
307
|
+
|
|
308
|
+
### Global Context
|
|
309
|
+
```text
|
|
310
|
+
Product Intent
|
|
311
|
+
Core Architecture
|
|
312
|
+
Global Rules
|
|
313
|
+
Shared Contracts
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Unit Context
|
|
317
|
+
```text
|
|
318
|
+
Platform Architecture
|
|
319
|
+
Local Conventions
|
|
320
|
+
Dependencies
|
|
321
|
+
Testing Strategy
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Task Context
|
|
325
|
+
```text
|
|
326
|
+
Relevant Files
|
|
327
|
+
Relevant Symbols
|
|
328
|
+
Related Requirements
|
|
329
|
+
Related Tests
|
|
330
|
+
Known Constraints
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Dynamic Context
|
|
334
|
+
```text
|
|
335
|
+
Git Diff
|
|
336
|
+
Build Errors
|
|
337
|
+
Test Failures
|
|
338
|
+
Runtime Logs
|
|
339
|
+
API Responses
|
|
340
|
+
Device State
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
# 9. Repository Grounding
|
|
346
|
+
|
|
347
|
+
Agent 开始工作前必须确认:
|
|
348
|
+
|
|
349
|
+
```text
|
|
350
|
+
Project structure
|
|
351
|
+
Build system
|
|
352
|
+
Entry points
|
|
353
|
+
Dependency graph
|
|
354
|
+
Test structure
|
|
355
|
+
Relevant modules
|
|
356
|
+
Current implementation
|
|
357
|
+
Existing conventions
|
|
358
|
+
Known limitations
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
推荐:
|
|
362
|
+
|
|
363
|
+
```text
|
|
364
|
+
Task
|
|
365
|
+
↓
|
|
366
|
+
Locate Unit
|
|
367
|
+
↓
|
|
368
|
+
Load Unit Context
|
|
369
|
+
↓
|
|
370
|
+
Inspect Repository
|
|
371
|
+
↓
|
|
372
|
+
Identify Relevant Files
|
|
373
|
+
↓
|
|
374
|
+
Identify Existing Contracts
|
|
375
|
+
↓
|
|
376
|
+
Confirm Assumptions
|
|
377
|
+
↓
|
|
378
|
+
Implement
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
禁止:
|
|
382
|
+
|
|
383
|
+
> 在没有检查现有实现之前,根据自己的经验重新设计已经存在的系统。
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
# 10. Specification Model
|
|
388
|
+
|
|
389
|
+
推荐结构:
|
|
390
|
+
|
|
391
|
+
```text
|
|
392
|
+
constitution
|
|
393
|
+
↓
|
|
394
|
+
requirements
|
|
395
|
+
↓
|
|
396
|
+
design
|
|
397
|
+
↓
|
|
398
|
+
tasks
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## 10.1 Constitution
|
|
402
|
+
|
|
403
|
+
Constitution 是项目长期原则,例如:
|
|
404
|
+
|
|
405
|
+
```text
|
|
406
|
+
1. Local-first where possible.
|
|
407
|
+
2. Public APIs require backward compatibility.
|
|
408
|
+
3. Critical features require automated verification.
|
|
409
|
+
4. Global architecture cannot be silently changed.
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Constitution 不描述单个 Feature。
|
|
413
|
+
|
|
414
|
+
## 10.2 Requirements
|
|
415
|
+
|
|
416
|
+
回答:
|
|
417
|
+
|
|
418
|
+
> 系统必须做什么?
|
|
419
|
+
|
|
420
|
+
推荐 ID:
|
|
421
|
+
|
|
422
|
+
```text
|
|
423
|
+
REQ-AUTH-001
|
|
424
|
+
REQ-USER-002
|
|
425
|
+
REQ-PAY-003
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
示例:
|
|
429
|
+
|
|
430
|
+
```markdown
|
|
431
|
+
## REQ-AUTH-001
|
|
432
|
+
|
|
433
|
+
### Intent
|
|
434
|
+
|
|
435
|
+
用户可以安全登录系统。
|
|
436
|
+
|
|
437
|
+
### Requirement
|
|
438
|
+
|
|
439
|
+
WHEN a user submits valid credentials
|
|
440
|
+
THE SYSTEM SHALL authenticate the user.
|
|
441
|
+
|
|
442
|
+
### Acceptance Criteria
|
|
443
|
+
|
|
444
|
+
- valid credentials succeed
|
|
445
|
+
- invalid credentials fail
|
|
446
|
+
- expired credentials are rejected
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## 10.3 EARS
|
|
450
|
+
|
|
451
|
+
适合形式化的需求可以使用:
|
|
452
|
+
|
|
453
|
+
```text
|
|
454
|
+
WHEN <condition>
|
|
455
|
+
THE SYSTEM SHALL <behavior>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
EARS 是推荐格式,不是强制格式。
|
|
459
|
+
|
|
460
|
+
## 10.4 Design
|
|
461
|
+
|
|
462
|
+
回答:
|
|
463
|
+
|
|
464
|
+
> 如何满足 Requirements?
|
|
465
|
+
|
|
466
|
+
包括:
|
|
467
|
+
|
|
468
|
+
```text
|
|
469
|
+
Architecture
|
|
470
|
+
Data Model
|
|
471
|
+
API
|
|
472
|
+
State Machine
|
|
473
|
+
Sequence
|
|
474
|
+
Error Handling
|
|
475
|
+
Security
|
|
476
|
+
Performance
|
|
477
|
+
Testing
|
|
478
|
+
Migration
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Requirement = WHAT
|
|
482
|
+
Design = HOW
|
|
483
|
+
|
|
484
|
+
## 10.5 Tasks
|
|
485
|
+
|
|
486
|
+
Task 必须是 Agent 可以执行和验证的合理最小工作单元。
|
|
487
|
+
|
|
488
|
+
应明确:
|
|
489
|
+
|
|
490
|
+
```text
|
|
491
|
+
ID
|
|
492
|
+
Context
|
|
493
|
+
Input
|
|
494
|
+
Output
|
|
495
|
+
Files / Modules
|
|
496
|
+
Acceptance
|
|
497
|
+
Verification
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
# 11. Agent Roles
|
|
503
|
+
|
|
504
|
+
AEF 不要求所有项目必须 Multi-Agent。
|
|
505
|
+
|
|
506
|
+
复杂项目可使用:
|
|
507
|
+
|
|
508
|
+
```text
|
|
509
|
+
Product Agent
|
|
510
|
+
Architecture Agent
|
|
511
|
+
Planner Agent
|
|
512
|
+
Implementation Agent
|
|
513
|
+
QA Agent
|
|
514
|
+
Reviewer Agent
|
|
515
|
+
Release Agent
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
## Product Agent
|
|
519
|
+
|
|
520
|
+
负责:
|
|
521
|
+
|
|
522
|
+
- Intent
|
|
523
|
+
- Requirements
|
|
524
|
+
- Acceptance
|
|
525
|
+
- Ambiguity
|
|
526
|
+
- Scope
|
|
527
|
+
|
|
528
|
+
## Architecture Agent
|
|
529
|
+
|
|
530
|
+
负责:
|
|
531
|
+
|
|
532
|
+
- Architecture
|
|
533
|
+
- Domain Model
|
|
534
|
+
- Contracts
|
|
535
|
+
- Boundaries
|
|
536
|
+
- Technical trade-offs
|
|
537
|
+
|
|
538
|
+
## Planner Agent
|
|
539
|
+
|
|
540
|
+
负责:
|
|
541
|
+
|
|
542
|
+
```text
|
|
543
|
+
Requirements
|
|
544
|
+
↓
|
|
545
|
+
Design
|
|
546
|
+
↓
|
|
547
|
+
Tasks
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
## Implementation Agent
|
|
551
|
+
|
|
552
|
+
负责:
|
|
553
|
+
|
|
554
|
+
- 修改代码
|
|
555
|
+
- 编写测试
|
|
556
|
+
- Build
|
|
557
|
+
- 修复实现问题
|
|
558
|
+
|
|
559
|
+
禁止:
|
|
560
|
+
|
|
561
|
+
```text
|
|
562
|
+
silent requirement changes
|
|
563
|
+
silent architecture changes
|
|
564
|
+
inventing missing business rules
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
## QA Agent
|
|
568
|
+
|
|
569
|
+
负责:
|
|
570
|
+
|
|
571
|
+
- Tests
|
|
572
|
+
- Runtime verification
|
|
573
|
+
- Regression
|
|
574
|
+
- Acceptance
|
|
575
|
+
- Evidence
|
|
576
|
+
|
|
577
|
+
## Reviewer Agent
|
|
578
|
+
|
|
579
|
+
检查:
|
|
580
|
+
|
|
581
|
+
```text
|
|
582
|
+
Spec
|
|
583
|
+
Architecture
|
|
584
|
+
Code
|
|
585
|
+
Tests
|
|
586
|
+
Evidence
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
# 12. Self-Contained Story
|
|
592
|
+
|
|
593
|
+
复杂任务应该生成自包含 Story:
|
|
594
|
+
|
|
595
|
+
```text
|
|
596
|
+
Context
|
|
597
|
+
Problem
|
|
598
|
+
Requirements
|
|
599
|
+
Relevant Architecture
|
|
600
|
+
Constraints
|
|
601
|
+
Files / Modules
|
|
602
|
+
Acceptance Criteria
|
|
603
|
+
Verification
|
|
604
|
+
Expected Evidence
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
目标:
|
|
608
|
+
|
|
609
|
+
> Agent 不需要依赖历史聊天记录才能完成任务。
|
|
610
|
+
|
|
611
|
+
推荐模板:
|
|
612
|
+
|
|
613
|
+
```markdown
|
|
614
|
+
# Story
|
|
615
|
+
|
|
616
|
+
## ID
|
|
617
|
+
STORY-001
|
|
618
|
+
|
|
619
|
+
## Intent
|
|
620
|
+
Why this work exists.
|
|
621
|
+
|
|
622
|
+
## Context
|
|
623
|
+
Relevant system facts.
|
|
624
|
+
|
|
625
|
+
## Requirements
|
|
626
|
+
- REQ-001
|
|
627
|
+
- REQ-002
|
|
628
|
+
|
|
629
|
+
## Architecture
|
|
630
|
+
Relevant design references.
|
|
631
|
+
|
|
632
|
+
## Constraints
|
|
633
|
+
Important limitations.
|
|
634
|
+
|
|
635
|
+
## Tasks
|
|
636
|
+
- TASK-001
|
|
637
|
+
- TASK-002
|
|
638
|
+
|
|
639
|
+
## Acceptance
|
|
640
|
+
- [ ] Criterion 1
|
|
641
|
+
- [ ] Criterion 2
|
|
642
|
+
|
|
643
|
+
## Verification
|
|
644
|
+
- [ ] Build
|
|
645
|
+
- [ ] Tests
|
|
646
|
+
- [ ] Runtime
|
|
647
|
+
|
|
648
|
+
## Evidence
|
|
649
|
+
Expected evidence.
|
|
650
|
+
|
|
651
|
+
## Done
|
|
652
|
+
Exact completion definition.
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
# 13. Development Lifecycle
|
|
658
|
+
|
|
659
|
+
标准流程:
|
|
660
|
+
|
|
661
|
+
```text
|
|
662
|
+
Constitution
|
|
663
|
+
↓
|
|
664
|
+
Specify
|
|
665
|
+
↓
|
|
666
|
+
Clarify
|
|
667
|
+
↓
|
|
668
|
+
Design
|
|
669
|
+
↓
|
|
670
|
+
Plan
|
|
671
|
+
↓
|
|
672
|
+
Analyze
|
|
673
|
+
↓
|
|
674
|
+
Tasks
|
|
675
|
+
↓
|
|
676
|
+
Implement
|
|
677
|
+
↓
|
|
678
|
+
Verify
|
|
679
|
+
↓
|
|
680
|
+
Evidence
|
|
681
|
+
↓
|
|
682
|
+
Converge
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
## 13.1 Specify
|
|
686
|
+
|
|
687
|
+
输入 Human Intent,输出 Requirements。
|
|
688
|
+
|
|
689
|
+
目标:
|
|
690
|
+
|
|
691
|
+
> 明确做什么,不决定怎么实现。
|
|
692
|
+
|
|
693
|
+
## 13.2 Clarify
|
|
694
|
+
|
|
695
|
+
寻找:
|
|
696
|
+
|
|
697
|
+
```text
|
|
698
|
+
Ambiguity
|
|
699
|
+
Conflict
|
|
700
|
+
Missing Requirement
|
|
701
|
+
Edge Case
|
|
702
|
+
Hidden Constraint
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
低风险需求可以跳过。
|
|
706
|
+
|
|
707
|
+
## 13.3 Design
|
|
708
|
+
|
|
709
|
+
形成技术设计:
|
|
710
|
+
|
|
711
|
+
```text
|
|
712
|
+
Architecture
|
|
713
|
+
Data
|
|
714
|
+
Contracts
|
|
715
|
+
State
|
|
716
|
+
Errors
|
|
717
|
+
Security
|
|
718
|
+
Testing
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
## 13.4 Plan
|
|
722
|
+
|
|
723
|
+
将 Design 转换为:
|
|
724
|
+
|
|
725
|
+
```text
|
|
726
|
+
Implementation Strategy
|
|
727
|
+
Dependency Graph
|
|
728
|
+
Execution Order
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
## 13.5 Analyze
|
|
732
|
+
|
|
733
|
+
检查:
|
|
734
|
+
|
|
735
|
+
```text
|
|
736
|
+
Requirements ↔ Design
|
|
737
|
+
Design ↔ Tasks
|
|
738
|
+
Requirements ↔ Acceptance
|
|
739
|
+
Contracts ↔ Implementation
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
## 13.6 Tasks
|
|
743
|
+
|
|
744
|
+
状态:
|
|
745
|
+
|
|
746
|
+
```text
|
|
747
|
+
TODO
|
|
748
|
+
IN_PROGRESS
|
|
749
|
+
BLOCKED
|
|
750
|
+
DONE
|
|
751
|
+
FAILED
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
## 13.7 Implement
|
|
755
|
+
|
|
756
|
+
```text
|
|
757
|
+
Read Context
|
|
758
|
+
↓
|
|
759
|
+
Inspect Repository
|
|
760
|
+
↓
|
|
761
|
+
Select Task
|
|
762
|
+
↓
|
|
763
|
+
Implement
|
|
764
|
+
↓
|
|
765
|
+
Run Tests
|
|
766
|
+
↓
|
|
767
|
+
Collect Result
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
## 13.8 Verify
|
|
771
|
+
|
|
772
|
+
至少回答:
|
|
773
|
+
|
|
774
|
+
```text
|
|
775
|
+
Does it build?
|
|
776
|
+
Does it test?
|
|
777
|
+
Does it behave correctly?
|
|
778
|
+
Does it satisfy acceptance?
|
|
779
|
+
Did it introduce regression?
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
---
|
|
783
|
+
|
|
784
|
+
# 14. Evidence
|
|
785
|
+
|
|
786
|
+
Evidence 是完成状态的重要组成部分。
|
|
787
|
+
|
|
788
|
+
## E0 — No Evidence
|
|
789
|
+
|
|
790
|
+
只有 Agent 声称完成。
|
|
791
|
+
|
|
792
|
+
不可接受。
|
|
793
|
+
|
|
794
|
+
## E1 — Static Evidence
|
|
795
|
+
|
|
796
|
+
```text
|
|
797
|
+
Code inspection
|
|
798
|
+
Diff
|
|
799
|
+
Static analysis
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
## E2 — Build Evidence
|
|
803
|
+
|
|
804
|
+
```text
|
|
805
|
+
Build passed
|
|
806
|
+
Compilation passed
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
## E3 — Automated Test Evidence
|
|
810
|
+
|
|
811
|
+
```text
|
|
812
|
+
Unit
|
|
813
|
+
Integration
|
|
814
|
+
E2E
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
## E4 — Runtime Evidence
|
|
818
|
+
|
|
819
|
+
```text
|
|
820
|
+
Real runtime
|
|
821
|
+
Device
|
|
822
|
+
Production-like environment
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
## E5 — Acceptance Evidence
|
|
826
|
+
|
|
827
|
+
完整证明:
|
|
828
|
+
|
|
829
|
+
```text
|
|
830
|
+
Requirement
|
|
831
|
+
→ Implementation
|
|
832
|
+
→ Runtime
|
|
833
|
+
→ Acceptance
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
---
|
|
837
|
+
|
|
838
|
+
# 15. Definition of Done
|
|
839
|
+
|
|
840
|
+
Task:
|
|
841
|
+
|
|
842
|
+
```text
|
|
843
|
+
Implementation
|
|
844
|
+
AND Tests
|
|
845
|
+
AND Verification
|
|
846
|
+
AND Evidence
|
|
847
|
+
AND No unresolved blocker
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
Feature:
|
|
851
|
+
|
|
852
|
+
```text
|
|
853
|
+
All Tasks Done
|
|
854
|
+
AND Acceptance Passed
|
|
855
|
+
AND No Critical Regression
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
Release:
|
|
859
|
+
|
|
860
|
+
```text
|
|
861
|
+
Feature Done
|
|
862
|
+
AND Integration Verified
|
|
863
|
+
AND Release Checks Passed
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
---
|
|
867
|
+
|
|
868
|
+
# 16. Convergence
|
|
869
|
+
|
|
870
|
+
Convergence 是 AEF 的核心机制。
|
|
871
|
+
|
|
872
|
+
它检查:
|
|
873
|
+
|
|
874
|
+
```text
|
|
875
|
+
What we intended
|
|
876
|
+
↓
|
|
877
|
+
What we specified
|
|
878
|
+
↓
|
|
879
|
+
What we designed
|
|
880
|
+
↓
|
|
881
|
+
What we planned
|
|
882
|
+
↓
|
|
883
|
+
What we implemented
|
|
884
|
+
↓
|
|
885
|
+
What we verified
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
推荐矩阵:
|
|
889
|
+
|
|
890
|
+
| Requirement | Design | Task | Code | Test | Evidence | Status |
|
|
891
|
+
|---|---|---|---|---|---|---|
|
|
892
|
+
| REQ-001 | D-01 | T-01 | auth.ts | auth.test | E-01 | PASS |
|
|
893
|
+
| REQ-002 | D-02 | T-02 | user.ts | user.test | E-02 | PASS |
|
|
894
|
+
| REQ-003 | D-03 | T-03 | — | — | — | GAP |
|
|
895
|
+
|
|
896
|
+
状态:
|
|
897
|
+
|
|
898
|
+
```text
|
|
899
|
+
PASS
|
|
900
|
+
PARTIAL
|
|
901
|
+
GAP
|
|
902
|
+
CONFLICT
|
|
903
|
+
UNKNOWN
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
Convergence Loop:
|
|
907
|
+
|
|
908
|
+
```text
|
|
909
|
+
Converge
|
|
910
|
+
↓
|
|
911
|
+
GAP
|
|
912
|
+
↓
|
|
913
|
+
Create Task
|
|
914
|
+
↓
|
|
915
|
+
Implement
|
|
916
|
+
↓
|
|
917
|
+
Verify
|
|
918
|
+
↓
|
|
919
|
+
Evidence
|
|
920
|
+
↓
|
|
921
|
+
Converge
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
直到:
|
|
925
|
+
|
|
926
|
+
```text
|
|
927
|
+
CONVERGED
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
---
|
|
931
|
+
|
|
932
|
+
# 17. Failure Recovery
|
|
933
|
+
|
|
934
|
+
失败后不从头开始。
|
|
935
|
+
|
|
936
|
+
```text
|
|
937
|
+
Task
|
|
938
|
+
↓
|
|
939
|
+
Failure
|
|
940
|
+
↓
|
|
941
|
+
Evidence
|
|
942
|
+
↓
|
|
943
|
+
Diagnosis
|
|
944
|
+
↓
|
|
945
|
+
New Task
|
|
946
|
+
↓
|
|
947
|
+
Implementation
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
失败分类:
|
|
951
|
+
|
|
952
|
+
```text
|
|
953
|
+
Implementation Failure
|
|
954
|
+
Test Failure
|
|
955
|
+
Context Failure
|
|
956
|
+
Specification Failure
|
|
957
|
+
Architecture Failure
|
|
958
|
+
Environment Failure
|
|
959
|
+
Contract Failure
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
错误应该回到正确抽象层:
|
|
963
|
+
|
|
964
|
+
```text
|
|
965
|
+
Implementation Failure → Task
|
|
966
|
+
Test Failure → Task / Implementation
|
|
967
|
+
Context Failure → Context / Harness
|
|
968
|
+
Specification Failure → Requirements
|
|
969
|
+
Architecture Failure → Design
|
|
970
|
+
Contract Failure → Shared Contract
|
|
971
|
+
Environment Failure → Environment
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
---
|
|
975
|
+
|
|
976
|
+
# 18. Incremental Change
|
|
977
|
+
|
|
978
|
+
AEF 支持增量变更,不要求每次修改都重跑整个项目 Spec。
|
|
979
|
+
|
|
980
|
+
Change 类型:
|
|
981
|
+
|
|
982
|
+
```text
|
|
983
|
+
Patch
|
|
984
|
+
Feature
|
|
985
|
+
Architecture Change
|
|
986
|
+
Breaking Change
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
## Patch
|
|
990
|
+
|
|
991
|
+
```text
|
|
992
|
+
Change
|
|
993
|
+
↓
|
|
994
|
+
Task
|
|
995
|
+
↓
|
|
996
|
+
Implement
|
|
997
|
+
↓
|
|
998
|
+
Verify
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
## Feature
|
|
1002
|
+
|
|
1003
|
+
```text
|
|
1004
|
+
Change Proposal
|
|
1005
|
+
↓
|
|
1006
|
+
Affected Requirements
|
|
1007
|
+
↓
|
|
1008
|
+
Design
|
|
1009
|
+
↓
|
|
1010
|
+
Tasks
|
|
1011
|
+
↓
|
|
1012
|
+
Implementation
|
|
1013
|
+
↓
|
|
1014
|
+
Verification
|
|
1015
|
+
↓
|
|
1016
|
+
Convergence
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
## Architecture Change
|
|
1020
|
+
|
|
1021
|
+
必须检查:
|
|
1022
|
+
|
|
1023
|
+
```text
|
|
1024
|
+
Affected Units
|
|
1025
|
+
Affected Contracts
|
|
1026
|
+
Affected Requirements
|
|
1027
|
+
Migration
|
|
1028
|
+
Backward Compatibility
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
## Breaking Change
|
|
1032
|
+
|
|
1033
|
+
必须有:
|
|
1034
|
+
|
|
1035
|
+
```text
|
|
1036
|
+
Impact Analysis
|
|
1037
|
+
Migration Plan
|
|
1038
|
+
Compatibility Strategy
|
|
1039
|
+
Acceptance Update
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
推荐:
|
|
1043
|
+
|
|
1044
|
+
```text
|
|
1045
|
+
changes/
|
|
1046
|
+
└── CHG-2026-001/
|
|
1047
|
+
├── proposal.md
|
|
1048
|
+
├── impact.md
|
|
1049
|
+
├── requirements.md
|
|
1050
|
+
├── design.md
|
|
1051
|
+
├── tasks.md
|
|
1052
|
+
└── evidence.md
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
---
|
|
1056
|
+
|
|
1057
|
+
# 19. Knowledge Model
|
|
1058
|
+
|
|
1059
|
+
AEF 将项目知识分成三类:
|
|
1060
|
+
|
|
1061
|
+
```text
|
|
1062
|
+
Canonical Knowledge
|
|
1063
|
+
+
|
|
1064
|
+
Working Knowledge
|
|
1065
|
+
+
|
|
1066
|
+
Evidence
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
## Canonical
|
|
1070
|
+
|
|
1071
|
+
长期有效:
|
|
1072
|
+
|
|
1073
|
+
```text
|
|
1074
|
+
constitution
|
|
1075
|
+
architecture
|
|
1076
|
+
requirements
|
|
1077
|
+
contracts
|
|
1078
|
+
ADR
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
## Working
|
|
1082
|
+
|
|
1083
|
+
临时:
|
|
1084
|
+
|
|
1085
|
+
```text
|
|
1086
|
+
plans
|
|
1087
|
+
tasks
|
|
1088
|
+
agent notes
|
|
1089
|
+
debug logs
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
## Evidence
|
|
1093
|
+
|
|
1094
|
+
事实证明:
|
|
1095
|
+
|
|
1096
|
+
```text
|
|
1097
|
+
test results
|
|
1098
|
+
build results
|
|
1099
|
+
runtime results
|
|
1100
|
+
screenshots
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
---
|
|
1104
|
+
|
|
1105
|
+
# 20. 推荐目录结构
|
|
1106
|
+
|
|
1107
|
+
## Minimal
|
|
1108
|
+
|
|
1109
|
+
```text
|
|
1110
|
+
.aef/
|
|
1111
|
+
├── constitution.md
|
|
1112
|
+
├── requirements.md
|
|
1113
|
+
├── design.md
|
|
1114
|
+
├── tasks.md
|
|
1115
|
+
└── evidence/
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
## Standard
|
|
1119
|
+
|
|
1120
|
+
```text
|
|
1121
|
+
.aef/
|
|
1122
|
+
├── constitution.md
|
|
1123
|
+
├── product/
|
|
1124
|
+
├── architecture/
|
|
1125
|
+
├── contracts/
|
|
1126
|
+
├── units/
|
|
1127
|
+
├── stories/
|
|
1128
|
+
├── changes/
|
|
1129
|
+
├── tasks/
|
|
1130
|
+
└── evidence/
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
## Large Project
|
|
1134
|
+
|
|
1135
|
+
```text
|
|
1136
|
+
.aef/
|
|
1137
|
+
├── constitution.md
|
|
1138
|
+
├── group/
|
|
1139
|
+
│ ├── product/
|
|
1140
|
+
│ ├── architecture/
|
|
1141
|
+
│ ├── acceptance/
|
|
1142
|
+
│ └── contracts/
|
|
1143
|
+
├── units/
|
|
1144
|
+
│ ├── ios/
|
|
1145
|
+
│ ├── backend/
|
|
1146
|
+
│ ├── web/
|
|
1147
|
+
│ └── mcp/
|
|
1148
|
+
├── stories/
|
|
1149
|
+
├── changes/
|
|
1150
|
+
├── tasks/
|
|
1151
|
+
├── evidence/
|
|
1152
|
+
├── agents/
|
|
1153
|
+
└── workflows/
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
---
|
|
1157
|
+
|
|
1158
|
+
# 21. Agent Permission Model
|
|
1159
|
+
|
|
1160
|
+
Agent 不应拥有无限权限。
|
|
1161
|
+
|
|
1162
|
+
示例:
|
|
1163
|
+
|
|
1164
|
+
```yaml
|
|
1165
|
+
role: backend-developer
|
|
1166
|
+
|
|
1167
|
+
input:
|
|
1168
|
+
- story
|
|
1169
|
+
- backend-context
|
|
1170
|
+
- relevant-contracts
|
|
1171
|
+
|
|
1172
|
+
allowed:
|
|
1173
|
+
- backend/**
|
|
1174
|
+
- tests/**
|
|
1175
|
+
|
|
1176
|
+
forbidden:
|
|
1177
|
+
- change global architecture
|
|
1178
|
+
- modify iOS code
|
|
1179
|
+
- change API contract silently
|
|
1180
|
+
|
|
1181
|
+
must:
|
|
1182
|
+
- run backend tests
|
|
1183
|
+
- provide evidence
|
|
1184
|
+
|
|
1185
|
+
escalate:
|
|
1186
|
+
- architecture conflict
|
|
1187
|
+
- contract conflict
|
|
1188
|
+
- missing business rule
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1191
|
+
原则:
|
|
1192
|
+
|
|
1193
|
+
> **Least Privilege**
|
|
1194
|
+
|
|
1195
|
+
---
|
|
1196
|
+
|
|
1197
|
+
# 22. Agent Communication
|
|
1198
|
+
|
|
1199
|
+
Agent 不应主要依赖自然语言聊天协作。
|
|
1200
|
+
|
|
1201
|
+
推荐:
|
|
1202
|
+
|
|
1203
|
+
```text
|
|
1204
|
+
Artifact
|
|
1205
|
+
Contract
|
|
1206
|
+
Task
|
|
1207
|
+
Evidence
|
|
1208
|
+
Decision
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
即:
|
|
1212
|
+
|
|
1213
|
+
> **Artifact-based collaboration**
|
|
1214
|
+
|
|
1215
|
+
而不是:
|
|
1216
|
+
|
|
1217
|
+
```text
|
|
1218
|
+
Agent A → chat → Agent B
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
---
|
|
1222
|
+
|
|
1223
|
+
# 23. Shared Contracts
|
|
1224
|
+
|
|
1225
|
+
跨 Unit 信息必须结构化:
|
|
1226
|
+
|
|
1227
|
+
```text
|
|
1228
|
+
API Contract
|
|
1229
|
+
Event Contract
|
|
1230
|
+
Data Contract
|
|
1231
|
+
MCP Contract
|
|
1232
|
+
Authentication Contract
|
|
1233
|
+
Error Contract
|
|
1234
|
+
```
|
|
1235
|
+
|
|
1236
|
+
不同 Unit 可以独立实现,但必须遵守 Shared Contract。
|
|
1237
|
+
|
|
1238
|
+
---
|
|
1239
|
+
|
|
1240
|
+
# 24. Parallel Development
|
|
1241
|
+
|
|
1242
|
+
只有满足:
|
|
1243
|
+
|
|
1244
|
+
```text
|
|
1245
|
+
Low Coupling
|
|
1246
|
+
Stable Contract
|
|
1247
|
+
Independent Context
|
|
1248
|
+
Independent Verification
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
才应该并行。
|
|
1252
|
+
|
|
1253
|
+
```text
|
|
1254
|
+
Shared Contract
|
|
1255
|
+
/ | iOS Backend MCP
|
|
1256
|
+
│ │ │
|
|
1257
|
+
Verify Verify Verify
|
|
1258
|
+
\ | /
|
|
1259
|
+
Integrate
|
|
1260
|
+
↓
|
|
1261
|
+
Converge
|
|
1262
|
+
```
|
|
1263
|
+
|
|
1264
|
+
---
|
|
1265
|
+
|
|
1266
|
+
# 25. Vertical Slice
|
|
1267
|
+
|
|
1268
|
+
复杂项目不应该:
|
|
1269
|
+
|
|
1270
|
+
```text
|
|
1271
|
+
先完成全部 iOS
|
|
1272
|
+
再完成全部 Backend
|
|
1273
|
+
再完成全部 MCP
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
推荐:
|
|
1277
|
+
|
|
1278
|
+
```text
|
|
1279
|
+
Requirement
|
|
1280
|
+
↓
|
|
1281
|
+
Backend
|
|
1282
|
+
↓
|
|
1283
|
+
MCP
|
|
1284
|
+
↓
|
|
1285
|
+
iOS
|
|
1286
|
+
↓
|
|
1287
|
+
End-to-End
|
|
1288
|
+
↓
|
|
1289
|
+
Evidence
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
即:
|
|
1293
|
+
|
|
1294
|
+
> **先打通一个真正可验证的业务闭环。**
|
|
1295
|
+
|
|
1296
|
+
---
|
|
1297
|
+
|
|
1298
|
+
# 26. Human-in-the-Loop
|
|
1299
|
+
|
|
1300
|
+
AEF 不追求完全移除人。
|
|
1301
|
+
|
|
1302
|
+
Human 应控制高价值决策:
|
|
1303
|
+
|
|
1304
|
+
```text
|
|
1305
|
+
Product Intent
|
|
1306
|
+
Architecture
|
|
1307
|
+
Breaking Changes
|
|
1308
|
+
Security
|
|
1309
|
+
Release
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
Agent 可高度自动化:
|
|
1313
|
+
|
|
1314
|
+
```text
|
|
1315
|
+
Implementation
|
|
1316
|
+
Testing
|
|
1317
|
+
Refactoring
|
|
1318
|
+
Evidence Collection
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1321
|
+
原则:
|
|
1322
|
+
|
|
1323
|
+
> **Human controls high-value decisions; Agents execute repeatable work.**
|
|
1324
|
+
|
|
1325
|
+
---
|
|
1326
|
+
|
|
1327
|
+
# 27. 自动化等级
|
|
1328
|
+
|
|
1329
|
+
### Level 0 — Manual
|
|
1330
|
+
|
|
1331
|
+
Human 驱动每一步。
|
|
1332
|
+
|
|
1333
|
+
### Level 1 — Agent Assisted
|
|
1334
|
+
|
|
1335
|
+
Agent 执行,Human Review。
|
|
1336
|
+
|
|
1337
|
+
### Level 2 — Agent Orchestrated
|
|
1338
|
+
|
|
1339
|
+
多个 Agent 自动协作。
|
|
1340
|
+
|
|
1341
|
+
### Level 3 — Autonomous Loop
|
|
1342
|
+
|
|
1343
|
+
```text
|
|
1344
|
+
Task
|
|
1345
|
+
↓
|
|
1346
|
+
Implement
|
|
1347
|
+
↓
|
|
1348
|
+
Verify
|
|
1349
|
+
↓
|
|
1350
|
+
Converge
|
|
1351
|
+
↓
|
|
1352
|
+
Fix
|
|
1353
|
+
↓
|
|
1354
|
+
Verify
|
|
1355
|
+
↓
|
|
1356
|
+
Converge
|
|
1357
|
+
```
|
|
1358
|
+
|
|
1359
|
+
直到满足停止条件。
|
|
1360
|
+
|
|
1361
|
+
Level 3 必须设置:
|
|
1362
|
+
|
|
1363
|
+
```text
|
|
1364
|
+
Max Iterations
|
|
1365
|
+
Max Token Budget
|
|
1366
|
+
Max File Changes
|
|
1367
|
+
Max Runtime
|
|
1368
|
+
Forbidden Paths
|
|
1369
|
+
Approval Gates
|
|
1370
|
+
Rollback
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
---
|
|
1374
|
+
|
|
1375
|
+
# 28. Stop Conditions
|
|
1376
|
+
|
|
1377
|
+
Agent 必须明确停止状态:
|
|
1378
|
+
|
|
1379
|
+
```text
|
|
1380
|
+
CONVERGED
|
|
1381
|
+
BLOCKED
|
|
1382
|
+
NEEDS_DECISION
|
|
1383
|
+
MAX_ITERATIONS
|
|
1384
|
+
ENVIRONMENT_FAILURE
|
|
1385
|
+
```
|
|
1386
|
+
|
|
1387
|
+
不能使用:
|
|
1388
|
+
|
|
1389
|
+
```text
|
|
1390
|
+
"probably done"
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
作为工程状态。
|
|
1394
|
+
|
|
1395
|
+
---
|
|
1396
|
+
|
|
1397
|
+
# 29. Task State Machine
|
|
1398
|
+
|
|
1399
|
+
```text
|
|
1400
|
+
DRAFT
|
|
1401
|
+
↓
|
|
1402
|
+
READY
|
|
1403
|
+
↓
|
|
1404
|
+
IN_PROGRESS
|
|
1405
|
+
├──→ BLOCKED
|
|
1406
|
+
│ ↓
|
|
1407
|
+
│ READY
|
|
1408
|
+
│
|
|
1409
|
+
└──→ VERIFYING
|
|
1410
|
+
↓
|
|
1411
|
+
VERIFIED
|
|
1412
|
+
↓
|
|
1413
|
+
CONVERGING
|
|
1414
|
+
/ CONVERGED GAP
|
|
1415
|
+
↓
|
|
1416
|
+
NEW TASK
|
|
1417
|
+
```
|
|
1418
|
+
|
|
1419
|
+
---
|
|
1420
|
+
|
|
1421
|
+
# 30. Quality Gates
|
|
1422
|
+
|
|
1423
|
+
```text
|
|
1424
|
+
Gate 1
|
|
1425
|
+
Intent → Requirements
|
|
1426
|
+
|
|
1427
|
+
Gate 2
|
|
1428
|
+
Requirements → Design
|
|
1429
|
+
|
|
1430
|
+
Gate 3
|
|
1431
|
+
Design → Tasks
|
|
1432
|
+
|
|
1433
|
+
Gate 4
|
|
1434
|
+
Tasks → Implementation
|
|
1435
|
+
|
|
1436
|
+
Gate 5
|
|
1437
|
+
Implementation → Verification
|
|
1438
|
+
|
|
1439
|
+
Gate 6
|
|
1440
|
+
Verification → Evidence
|
|
1441
|
+
|
|
1442
|
+
Gate 7
|
|
1443
|
+
Evidence → Convergence
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
---
|
|
1447
|
+
|
|
1448
|
+
# 31. Risk-Based Workflow
|
|
1449
|
+
|
|
1450
|
+
不是所有需求都需要完整流程。
|
|
1451
|
+
|
|
1452
|
+
### Low Risk
|
|
1453
|
+
|
|
1454
|
+
```text
|
|
1455
|
+
Task
|
|
1456
|
+
↓
|
|
1457
|
+
Implement
|
|
1458
|
+
↓
|
|
1459
|
+
Test
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
### Medium Risk
|
|
1463
|
+
|
|
1464
|
+
```text
|
|
1465
|
+
Change
|
|
1466
|
+
↓
|
|
1467
|
+
Plan
|
|
1468
|
+
↓
|
|
1469
|
+
Implement
|
|
1470
|
+
↓
|
|
1471
|
+
Verify
|
|
1472
|
+
↓
|
|
1473
|
+
Converge
|
|
1474
|
+
```
|
|
1475
|
+
|
|
1476
|
+
### High Risk
|
|
1477
|
+
|
|
1478
|
+
```text
|
|
1479
|
+
Intent
|
|
1480
|
+
↓
|
|
1481
|
+
Requirements
|
|
1482
|
+
↓
|
|
1483
|
+
Clarify
|
|
1484
|
+
↓
|
|
1485
|
+
Architecture
|
|
1486
|
+
↓
|
|
1487
|
+
Analyze
|
|
1488
|
+
↓
|
|
1489
|
+
Tasks
|
|
1490
|
+
↓
|
|
1491
|
+
Implement
|
|
1492
|
+
↓
|
|
1493
|
+
Evidence
|
|
1494
|
+
↓
|
|
1495
|
+
Converge
|
|
1496
|
+
```
|
|
1497
|
+
|
|
1498
|
+
---
|
|
1499
|
+
|
|
1500
|
+
# 32. Traceability
|
|
1501
|
+
|
|
1502
|
+
AEF 的关键能力是 Traceability:
|
|
1503
|
+
|
|
1504
|
+
```text
|
|
1505
|
+
REQ-001
|
|
1506
|
+
↓
|
|
1507
|
+
DESIGN-001
|
|
1508
|
+
↓
|
|
1509
|
+
TASK-001
|
|
1510
|
+
↓
|
|
1511
|
+
commit abc123
|
|
1512
|
+
↓
|
|
1513
|
+
TEST-001
|
|
1514
|
+
↓
|
|
1515
|
+
EVIDENCE-001
|
|
1516
|
+
↓
|
|
1517
|
+
CONVERGED
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1520
|
+
它让 AI 项目拥有:
|
|
1521
|
+
|
|
1522
|
+
> 可追踪的工程证据链。
|
|
1523
|
+
|
|
1524
|
+
---
|
|
1525
|
+
|
|
1526
|
+
# 33. Source of Truth
|
|
1527
|
+
|
|
1528
|
+
不同事实必须有明确权威来源:
|
|
1529
|
+
|
|
1530
|
+
```text
|
|
1531
|
+
Product behavior → Requirements
|
|
1532
|
+
Architecture → Architecture docs
|
|
1533
|
+
API → Contracts
|
|
1534
|
+
Implementation → Code
|
|
1535
|
+
Runtime behavior → Evidence
|
|
1536
|
+
Historical decision → ADR
|
|
1537
|
+
```
|
|
1538
|
+
|
|
1539
|
+
当两个来源冲突:
|
|
1540
|
+
|
|
1541
|
+
```text
|
|
1542
|
+
Detect Conflict
|
|
1543
|
+
↓
|
|
1544
|
+
Report
|
|
1545
|
+
↓
|
|
1546
|
+
Resolve
|
|
1547
|
+
↓
|
|
1548
|
+
Update Source of Truth
|
|
1549
|
+
```
|
|
1550
|
+
|
|
1551
|
+
Agent 不应该猜。
|
|
1552
|
+
|
|
1553
|
+
---
|
|
1554
|
+
|
|
1555
|
+
# 34. Git / CI/CD 关系
|
|
1556
|
+
|
|
1557
|
+
AEF 不替代 Git。
|
|
1558
|
+
|
|
1559
|
+
```text
|
|
1560
|
+
Git
|
|
1561
|
+
= Code History
|
|
1562
|
+
|
|
1563
|
+
AEF
|
|
1564
|
+
= Engineering Intent + Execution + Evidence
|
|
1565
|
+
```
|
|
1566
|
+
|
|
1567
|
+
Git 记录:
|
|
1568
|
+
|
|
1569
|
+
```text
|
|
1570
|
+
what changed
|
|
1571
|
+
```
|
|
1572
|
+
|
|
1573
|
+
AEF 记录:
|
|
1574
|
+
|
|
1575
|
+
```text
|
|
1576
|
+
why
|
|
1577
|
+
what should happen
|
|
1578
|
+
how
|
|
1579
|
+
which agent did it
|
|
1580
|
+
how it was verified
|
|
1581
|
+
whether it converged
|
|
1582
|
+
```
|
|
1583
|
+
|
|
1584
|
+
CI/CD 是执行基础设施。
|
|
1585
|
+
|
|
1586
|
+
AEF 是工程控制层。
|
|
1587
|
+
|
|
1588
|
+
---
|
|
1589
|
+
|
|
1590
|
+
# 35. 与现有方法论的关系
|
|
1591
|
+
|
|
1592
|
+
AEF 不是简单复制某一个框架。
|
|
1593
|
+
|
|
1594
|
+
其设计借鉴:
|
|
1595
|
+
|
|
1596
|
+
```text
|
|
1597
|
+
ZSpec
|
|
1598
|
+
→ Group / Unit / Harness / Evidence / Recovery
|
|
1599
|
+
|
|
1600
|
+
Spec Kit
|
|
1601
|
+
→ Intent-driven lifecycle / Convergence
|
|
1602
|
+
|
|
1603
|
+
Kiro
|
|
1604
|
+
→ Requirements / Design / Tasks / EARS
|
|
1605
|
+
|
|
1606
|
+
BMAD
|
|
1607
|
+
→ Specialized Agents / Guided Workflows
|
|
1608
|
+
|
|
1609
|
+
OpenSpec
|
|
1610
|
+
→ Incremental Change / Lightweight Specs
|
|
1611
|
+
```
|
|
1612
|
+
|
|
1613
|
+
最终形成:
|
|
1614
|
+
|
|
1615
|
+
```text
|
|
1616
|
+
AEF
|
|
1617
|
+
=
|
|
1618
|
+
Engineering Structure
|
|
1619
|
+
+
|
|
1620
|
+
Spec Lifecycle
|
|
1621
|
+
+
|
|
1622
|
+
Agent Roles
|
|
1623
|
+
+
|
|
1624
|
+
Context Engineering
|
|
1625
|
+
+
|
|
1626
|
+
Evidence
|
|
1627
|
+
+
|
|
1628
|
+
Convergence
|
|
1629
|
+
+
|
|
1630
|
+
Incremental Change
|
|
1631
|
+
```
|
|
1632
|
+
|
|
1633
|
+
---
|
|
1634
|
+
|
|
1635
|
+
# 36. Anti-Patterns
|
|
1636
|
+
|
|
1637
|
+
## Prompt-Only Development
|
|
1638
|
+
|
|
1639
|
+
```text
|
|
1640
|
+
Prompt → Code
|
|
1641
|
+
```
|
|
1642
|
+
|
|
1643
|
+
问题:没有持久意图、验证链和恢复能力。
|
|
1644
|
+
|
|
1645
|
+
## Giant Context
|
|
1646
|
+
|
|
1647
|
+
把整个 Repository、全部 Spec、所有历史聊天交给 Agent。
|
|
1648
|
+
|
|
1649
|
+
> Context 多 ≠ Context 好。
|
|
1650
|
+
|
|
1651
|
+
## Agent Self-Approval
|
|
1652
|
+
|
|
1653
|
+
```text
|
|
1654
|
+
Agent writes code
|
|
1655
|
+
Agent says done
|
|
1656
|
+
```
|
|
1657
|
+
|
|
1658
|
+
不能作为完整验证。
|
|
1659
|
+
|
|
1660
|
+
## Spec Theater
|
|
1661
|
+
|
|
1662
|
+
Spec 很漂亮,但不进入 Task、Code、Test、Evidence、Convergence。
|
|
1663
|
+
|
|
1664
|
+
## Over-Specification
|
|
1665
|
+
|
|
1666
|
+
每改一个小功能都重建整个项目 Spec。
|
|
1667
|
+
|
|
1668
|
+
## Silent Architecture Drift
|
|
1669
|
+
|
|
1670
|
+
Agent 为解决局部问题偷偷改变全局架构。
|
|
1671
|
+
|
|
1672
|
+
## Chat-Based Handoff
|
|
1673
|
+
|
|
1674
|
+
依赖:
|
|
1675
|
+
|
|
1676
|
+
```text
|
|
1677
|
+
“上一个 Agent 好像说过……”
|
|
1678
|
+
```
|
|
1679
|
+
|
|
1680
|
+
应该改为:
|
|
1681
|
+
|
|
1682
|
+
```text
|
|
1683
|
+
Artifact-based Handoff
|
|
1684
|
+
```
|
|
1685
|
+
|
|
1686
|
+
---
|
|
1687
|
+
|
|
1688
|
+
# 37. AEF CLI 设想
|
|
1689
|
+
|
|
1690
|
+
如果未来实现 AEF CLI,可以设计:
|
|
1691
|
+
|
|
1692
|
+
```bash
|
|
1693
|
+
aef init
|
|
1694
|
+
aef constitution
|
|
1695
|
+
aef specify
|
|
1696
|
+
aef clarify
|
|
1697
|
+
aef design
|
|
1698
|
+
aef plan
|
|
1699
|
+
aef analyze
|
|
1700
|
+
aef tasks
|
|
1701
|
+
aef implement
|
|
1702
|
+
aef verify
|
|
1703
|
+
aef converge
|
|
1704
|
+
aef change
|
|
1705
|
+
aef status
|
|
1706
|
+
aef evidence
|
|
1707
|
+
```
|
|
1708
|
+
|
|
1709
|
+
其中:
|
|
1710
|
+
|
|
1711
|
+
```bash
|
|
1712
|
+
aef converge
|
|
1713
|
+
```
|
|
1714
|
+
|
|
1715
|
+
应该成为最重要的命令之一。
|
|
1716
|
+
|
|
1717
|
+
---
|
|
1718
|
+
|
|
1719
|
+
# 38. AEF Status
|
|
1720
|
+
|
|
1721
|
+
推荐:
|
|
1722
|
+
|
|
1723
|
+
```bash
|
|
1724
|
+
aef status
|
|
1725
|
+
```
|
|
1726
|
+
|
|
1727
|
+
示例:
|
|
1728
|
+
|
|
1729
|
+
```text
|
|
1730
|
+
Project: Example
|
|
1731
|
+
Version: 1.4
|
|
1732
|
+
|
|
1733
|
+
Requirements
|
|
1734
|
+
18 total
|
|
1735
|
+
16 implemented
|
|
1736
|
+
1 partial
|
|
1737
|
+
1 gap
|
|
1738
|
+
|
|
1739
|
+
Tasks
|
|
1740
|
+
42 total
|
|
1741
|
+
39 done
|
|
1742
|
+
2 blocked
|
|
1743
|
+
1 pending
|
|
1744
|
+
|
|
1745
|
+
Verification
|
|
1746
|
+
Build: PASS
|
|
1747
|
+
Tests: PASS
|
|
1748
|
+
E2E: PASS
|
|
1749
|
+
|
|
1750
|
+
Convergence
|
|
1751
|
+
Status: GAP
|
|
1752
|
+
Critical gaps: 1
|
|
1753
|
+
|
|
1754
|
+
Next:
|
|
1755
|
+
TASK-AUTH-042
|
|
1756
|
+
```
|
|
1757
|
+
|
|
1758
|
+
---
|
|
1759
|
+
|
|
1760
|
+
# 39. AEF Maturity Model
|
|
1761
|
+
|
|
1762
|
+
### Level 0 — AI Coding
|
|
1763
|
+
|
|
1764
|
+
```text
|
|
1765
|
+
Prompt → Code
|
|
1766
|
+
```
|
|
1767
|
+
|
|
1768
|
+
### Level 1 — Spec Assisted
|
|
1769
|
+
|
|
1770
|
+
```text
|
|
1771
|
+
Spec → Agent → Code
|
|
1772
|
+
```
|
|
1773
|
+
|
|
1774
|
+
### Level 2 — Structured Agent Development
|
|
1775
|
+
|
|
1776
|
+
```text
|
|
1777
|
+
Requirements
|
|
1778
|
+
→ Design
|
|
1779
|
+
→ Tasks
|
|
1780
|
+
→ Agent
|
|
1781
|
+
→ Verify
|
|
1782
|
+
```
|
|
1783
|
+
|
|
1784
|
+
### Level 3 — Engineering System
|
|
1785
|
+
|
|
1786
|
+
```text
|
|
1787
|
+
Group
|
|
1788
|
+
Unit
|
|
1789
|
+
Context
|
|
1790
|
+
Harness
|
|
1791
|
+
Evidence
|
|
1792
|
+
Convergence
|
|
1793
|
+
```
|
|
1794
|
+
|
|
1795
|
+
### Level 4 — Agent Engineering Platform
|
|
1796
|
+
|
|
1797
|
+
```text
|
|
1798
|
+
Multiple Agents
|
|
1799
|
+
+
|
|
1800
|
+
Parallel Units
|
|
1801
|
+
+
|
|
1802
|
+
Automated Evidence
|
|
1803
|
+
+
|
|
1804
|
+
Automated Convergence
|
|
1805
|
+
+
|
|
1806
|
+
Recovery
|
|
1807
|
+
```
|
|
1808
|
+
|
|
1809
|
+
### Level 5 — Autonomous Software Factory
|
|
1810
|
+
|
|
1811
|
+
```text
|
|
1812
|
+
Intent
|
|
1813
|
+
↓
|
|
1814
|
+
Planning
|
|
1815
|
+
↓
|
|
1816
|
+
Execution
|
|
1817
|
+
↓
|
|
1818
|
+
Verification
|
|
1819
|
+
↓
|
|
1820
|
+
Convergence
|
|
1821
|
+
↓
|
|
1822
|
+
Release
|
|
1823
|
+
```
|
|
1824
|
+
|
|
1825
|
+
Human 主要负责:
|
|
1826
|
+
|
|
1827
|
+
```text
|
|
1828
|
+
Vision
|
|
1829
|
+
Strategy
|
|
1830
|
+
Architecture Decisions
|
|
1831
|
+
Risk
|
|
1832
|
+
Approval
|
|
1833
|
+
```
|
|
1834
|
+
|
|
1835
|
+
---
|
|
1836
|
+
|
|
1837
|
+
# 40. 核心原则
|
|
1838
|
+
|
|
1839
|
+
AEF 最终可以浓缩为 12 条:
|
|
1840
|
+
|
|
1841
|
+
1. **Intent before implementation.**
|
|
1842
|
+
2. **Specification is persistent engineering knowledge.**
|
|
1843
|
+
3. **Repository facts outrank Agent assumptions.**
|
|
1844
|
+
4. **Global intent and local implementation must be separated.**
|
|
1845
|
+
5. **Agents operate inside explicit boundaries.**
|
|
1846
|
+
6. **Tasks must be executable and verifiable.**
|
|
1847
|
+
7. **Completion requires evidence.**
|
|
1848
|
+
8. **Failures return to the correct abstraction layer.**
|
|
1849
|
+
9. **Small changes should remain small.**
|
|
1850
|
+
10. **Cross-unit collaboration happens through contracts and artifacts.**
|
|
1851
|
+
11. **Convergence is continuous, not final-only.**
|
|
1852
|
+
12. **Human controls high-value decisions; Agents execute repeatable work.**
|
|
1853
|
+
|
|
1854
|
+
---
|
|
1855
|
+
|
|
1856
|
+
# 41. AEF Golden Loop
|
|
1857
|
+
|
|
1858
|
+
```text
|
|
1859
|
+
┌───────────────────┐
|
|
1860
|
+
│ INTENT │
|
|
1861
|
+
└─────────┬─────────┘
|
|
1862
|
+
↓
|
|
1863
|
+
┌───────────────────┐
|
|
1864
|
+
│ SPEC │
|
|
1865
|
+
└─────────┬─────────┘
|
|
1866
|
+
↓
|
|
1867
|
+
┌───────────────────┐
|
|
1868
|
+
│ ARCHITECTURE │
|
|
1869
|
+
└─────────┬─────────┘
|
|
1870
|
+
↓
|
|
1871
|
+
┌───────────────────┐
|
|
1872
|
+
│ CONTEXT │
|
|
1873
|
+
└─────────┬─────────┘
|
|
1874
|
+
↓
|
|
1875
|
+
┌───────────────────┐
|
|
1876
|
+
│ PLAN / TASKS │
|
|
1877
|
+
└─────────┬─────────┘
|
|
1878
|
+
↓
|
|
1879
|
+
┌───────────────────┐
|
|
1880
|
+
│ AGENTS │
|
|
1881
|
+
└─────────┬─────────┘
|
|
1882
|
+
↓
|
|
1883
|
+
┌───────────────────┐
|
|
1884
|
+
│ IMPLEMENTATION │
|
|
1885
|
+
└─────────┬─────────┘
|
|
1886
|
+
↓
|
|
1887
|
+
┌───────────────────┐
|
|
1888
|
+
│ VERIFICATION │
|
|
1889
|
+
└─────────┬─────────┘
|
|
1890
|
+
↓
|
|
1891
|
+
┌───────────────────┐
|
|
1892
|
+
│ EVIDENCE │
|
|
1893
|
+
└─────────┬─────────┘
|
|
1894
|
+
↓
|
|
1895
|
+
┌───────────────────┐
|
|
1896
|
+
│ CONVERGENCE │
|
|
1897
|
+
└─────────┬─────────┘
|
|
1898
|
+
│
|
|
1899
|
+
┌────┴────┐
|
|
1900
|
+
│ │
|
|
1901
|
+
CONVERGED GAP
|
|
1902
|
+
│
|
|
1903
|
+
└──────────→ TASKS
|
|
1904
|
+
```
|
|
1905
|
+
|
|
1906
|
+
---
|
|
1907
|
+
|
|
1908
|
+
# 42. 最终定义
|
|
1909
|
+
|
|
1910
|
+
AEF 不是:
|
|
1911
|
+
|
|
1912
|
+
> “让 Agent 写代码的方法。”
|
|
1913
|
+
|
|
1914
|
+
AEF 是:
|
|
1915
|
+
|
|
1916
|
+
> **让 Agent 能够在一个长期演进的软件项目中,基于明确意图、真实工程上下文、结构化任务和可验证证据,持续执行、失败恢复并最终收敛到正确结果的软件工程框架。**
|
|
1917
|
+
|
|
1918
|
+
它解决的核心问题不是:
|
|
1919
|
+
|
|
1920
|
+
> **How do we make AI write code?**
|
|
1921
|
+
|
|
1922
|
+
而是:
|
|
1923
|
+
|
|
1924
|
+
> **How do we make AI reliably participate in software engineering?**
|
|
1925
|
+
|
|
1926
|
+
因此 AEF 的核心不是 Prompt,不是 Agent,不是 Spec,甚至不是代码。
|
|
1927
|
+
|
|
1928
|
+
而是:
|
|
1929
|
+
|
|
1930
|
+
```text
|
|
1931
|
+
Intent
|
|
1932
|
+
+
|
|
1933
|
+
Context
|
|
1934
|
+
+
|
|
1935
|
+
Execution
|
|
1936
|
+
+
|
|
1937
|
+
Evidence
|
|
1938
|
+
+
|
|
1939
|
+
Convergence
|
|
1940
|
+
```
|
|
1941
|
+
|
|
1942
|
+
最终形成:
|
|
1943
|
+
|
|
1944
|
+
> **Agent Engineering Loop**
|
|
1945
|
+
|
|
1946
|
+
```text
|
|
1947
|
+
Human Intent
|
|
1948
|
+
↓
|
|
1949
|
+
Structured Knowledge
|
|
1950
|
+
↓
|
|
1951
|
+
Bounded Agents
|
|
1952
|
+
↓
|
|
1953
|
+
Executable Work
|
|
1954
|
+
↓
|
|
1955
|
+
Evidence
|
|
1956
|
+
↓
|
|
1957
|
+
Convergence
|
|
1958
|
+
↓
|
|
1959
|
+
Reliable Software
|
|
1960
|
+
↓
|
|
1961
|
+
New Intent
|
|
1962
|
+
↺
|
|
1963
|
+
```
|
|
1964
|
+
|
|
1965
|
+
---
|
|
1966
|
+
|
|
1967
|
+
# Appendix A — Minimal Agent Contract
|
|
1968
|
+
|
|
1969
|
+
```markdown
|
|
1970
|
+
# Agent Contract
|
|
1971
|
+
|
|
1972
|
+
## Role
|
|
1973
|
+
|
|
1974
|
+
## Input
|
|
1975
|
+
|
|
1976
|
+
## Output
|
|
1977
|
+
|
|
1978
|
+
## Allowed Scope
|
|
1979
|
+
|
|
1980
|
+
## Forbidden
|
|
1981
|
+
|
|
1982
|
+
## Verification
|
|
1983
|
+
|
|
1984
|
+
## Evidence
|
|
1985
|
+
|
|
1986
|
+
## Escalation
|
|
1987
|
+
|
|
1988
|
+
## Completion
|
|
1989
|
+
```
|
|
1990
|
+
|
|
1991
|
+
# Appendix B — Minimal Convergence Checklist
|
|
1992
|
+
|
|
1993
|
+
```markdown
|
|
1994
|
+
# Convergence Checklist
|
|
1995
|
+
|
|
1996
|
+
## Intent
|
|
1997
|
+
- [ ] Original intent is preserved.
|
|
1998
|
+
|
|
1999
|
+
## Requirements
|
|
2000
|
+
- [ ] All applicable requirements are implemented.
|
|
2001
|
+
- [ ] No unresolved ambiguity remains.
|
|
2002
|
+
|
|
2003
|
+
## Architecture
|
|
2004
|
+
- [ ] Implementation follows approved architecture.
|
|
2005
|
+
- [ ] No unauthorized architecture drift exists.
|
|
2006
|
+
|
|
2007
|
+
## Tasks
|
|
2008
|
+
- [ ] All required tasks are complete.
|
|
2009
|
+
|
|
2010
|
+
## Code
|
|
2011
|
+
- [ ] Implementation is complete.
|
|
2012
|
+
- [ ] No known critical issue remains.
|
|
2013
|
+
|
|
2014
|
+
## Verification
|
|
2015
|
+
- [ ] Build passes.
|
|
2016
|
+
- [ ] Tests pass.
|
|
2017
|
+
- [ ] Relevant runtime behavior verified.
|
|
2018
|
+
|
|
2019
|
+
## Evidence
|
|
2020
|
+
- [ ] Required evidence exists.
|
|
2021
|
+
- [ ] Evidence is traceable to requirements.
|
|
2022
|
+
|
|
2023
|
+
## Final
|
|
2024
|
+
- [ ] No unresolved GAP.
|
|
2025
|
+
- [ ] No unresolved CONFLICT.
|
|
2026
|
+
- [ ] Status = CONVERGED.
|
|
2027
|
+
```
|
|
2028
|
+
|
|
2029
|
+
# Appendix C — One Sentence Version
|
|
2030
|
+
|
|
2031
|
+
> **AEF = Intent → Spec → Context → Agent → Evidence → Convergence.**
|
|
2032
|
+
|
|
2033
|
+
如果一套 AI 软件研发流程能够始终闭环这条链条,那么 Agent 就不再只是“会写代码的聊天机器人”,而真正成为软件工程系统中的执行单元。
|