Loading...
Loading...
Compare original and translation side by side
doc-adr-reviewerADR-NN.R_review_report_vNNN.mdADR-NN.F_fix_report_vNNN.mddoc-adr-reviewerADR-NN.R_review_report_vNNN.mdADR-NN.F_fix_report_vNNN.mddoc-adr-fixerdoc-adr-reviewerdoc-adr-reviewerdoc-adrdoc-adr-autopilotdoc-adr-validatordoc-adr-fixerdoc-adr-reviewerdoc-adr-reviewerdoc-adrdoc-adr-autopilotdoc-adr-validator| Skill | Purpose | When Used |
|---|---|---|
| Source of issues to fix | Input (reads review report) |
| Element ID standards | Fix element IDs |
| ADR creation rules | Create missing sections |
| BDD alignment reference | Verify behavior traceability |
| Skill | 用途 | 调用时机 |
|---|---|---|
| 待修复问题的来源 | 输入侧(读取评审报告) |
| 元素ID规范 | 修复元素ID时 |
| ADR创建规则 | 补全缺失章节时 |
| BDD对齐参考 | 验证行为可追溯性时 |
flowchart TD
A[Input: ADR Path] --> B[Find Latest Review Report]
B --> C{Review Found?}
C -->|No| D[Run doc-adr-reviewer First]
C -->|Yes| E[Parse Review Report]
E --> F[Categorize Issues]
subgraph FixPhases["Fix Phases"]
F --> F0[Phase 0: Fix Structure Violations]
F0 --> G[Phase 1: Create Missing Files]
G --> H[Phase 2: Fix Broken Links]
H --> I[Phase 3: Fix Element IDs]
I --> J[Phase 4: Fix Content Issues]
J --> K[Phase 5: Update References]
K --> K2[Phase 6: Handle Upstream Drift]
end
K2 --> L[Write Fixed ADR]
L --> M[Generate Fix Report]
M --> N{Re-run Review?}
N -->|Yes| O[Invoke doc-adr-reviewer]
O --> P{Score >= Threshold?}
P -->|No, iterations < max| F
P -->|Yes| Q[COMPLETE]
N -->|No| Qflowchart TD
A[Input: ADR Path] --> B[Find Latest Review Report]
B --> C{Review Found?}
C -->|No| D[Run doc-adr-reviewer First]
C -->|Yes| E[Parse Review Report]
E --> F[Categorize Issues]
subgraph FixPhases["Fix Phases"]
F --> F0[Phase 0: Fix Structure Violations]
F0 --> G[Phase 1: Create Missing Files]
G --> H[Phase 2: Fix Broken Links]
H --> I[Phase 3: Fix Element IDs]
I --> J[Phase 4: Fix Content Issues]
J --> K[Phase 5: Update References]
K --> K2[Phase 6: Handle Upstream Drift]
end
K2 --> L[Write Fixed ADR]
L --> M[Generate Fix Report]
M --> N{Re-run Review?}
N -->|Yes| O[Invoke doc-adr-reviewer]
O --> P{Score >= Threshold?}
P -->|No, iterations < max| F
P -->|Yes| Q[COMPLETE]
N -->|No| Q| ADR Type | Required Location |
|---|---|
| Monolithic | |
| Issue Code | Issue | Fix Action |
|---|---|---|
| REV-STR001 | ADR not in nested folder | Create folder, move file, update all links |
| REV-STR002 | ADR folder name doesn't match ADR ID | Rename folder to match |
| REV-STR003 | Monolithic ADR >25KB should be sectioned | Flag for manual review |
def fix_adr_structure(adr_path: str) -> list[Fix]:
"""Fix ADR structure violations."""
fixes = []
filename = os.path.basename(adr_path)
parent_folder = os.path.dirname(adr_path)
# Extract ADR ID and slug from filename
match = re.match(r'ADR-(\d+)_([^/]+)\.md', filename)
if not match:
return [] # Cannot auto-fix invalid filename
adr_id = match.group(1)
slug = match.group(2)
expected_folder = f"ADR-{adr_id}_{slug}"
# Check if already in nested folder
if os.path.basename(parent_folder) != expected_folder:
# Create nested folder
new_folder = os.path.join(os.path.dirname(parent_folder), expected_folder)
os.makedirs(new_folder, exist_ok=True)
# Move file
new_path = os.path.join(new_folder, filename)
shutil.move(adr_path, new_path)
fixes.append(f"Moved {adr_path} to {new_path}")
# Update upstream links in moved file
content = Path(new_path).read_text()
updated_content = content.replace('../04_BDD/', '../../04_BDD/')
updated_content = updated_content.replace('../03_EARS/', '../../03_EARS/')
updated_content = updated_content.replace('../01_BRD/', '../../01_BRD/')
Path(new_path).write_text(updated_content)
fixes.append(f"Updated relative links for nested folder structure")
return fixes| Original Path | Updated Path |
|---|---|
| |
| |
| ADR类型 | 要求存放位置 |
|---|---|
| 单文件ADR | |
| 问题编码 | 问题描述 | 修复动作 |
|---|---|---|
| REV-STR001 | ADR未存放在嵌套文件夹中 | 创建文件夹,移动文件,更新所有链接 |
| REV-STR002 | ADR文件夹名称与ADR ID不匹配 | 重命名文件夹使其匹配 |
| REV-STR003 | 大小超过25KB的单文件ADR应拆分章节 | 标记为需人工评审 |
def fix_adr_structure(adr_path: str) -> list[Fix]:
"""Fix ADR structure violations."""
fixes = []
filename = os.path.basename(adr_path)
parent_folder = os.path.dirname(adr_path)
# Extract ADR ID and slug from filename
match = re.match(r'ADR-(\d+)_([^/]+)\.md', filename)
if not match:
return [] # Cannot auto-fix invalid filename
adr_id = match.group(1)
slug = match.group(2)
expected_folder = f"ADR-{adr_id}_{slug}"
# Check if already in nested folder
if os.path.basename(parent_folder) != expected_folder:
# Create nested folder
new_folder = os.path.join(os.path.dirname(parent_folder), expected_folder)
os.makedirs(new_folder, exist_ok=True)
# Move file
new_path = os.path.join(new_folder, filename)
shutil.move(adr_path, new_path)
fixes.append(f"Moved {adr_path} to {new_path}")
# Update upstream links in moved file
content = Path(new_path).read_text()
updated_content = content.replace('../04_BDD/', '../../04_BDD/')
updated_content = updated_content.replace('../03_EARS/', '../../03_EARS/')
updated_content = updated_content.replace('../01_BRD/', '../../01_BRD/')
Path(new_path).write_text(updated_content)
fixes.append(f"Updated relative links for nested folder structure")
return fixes| 原路径 | 更新后路径 |
|---|---|
| |
| |
| Missing File | Action | Template Used |
|---|---|---|
| Create ADR index | Index template |
| Create placeholder architecture doc | ARCH template |
Reference docs ( | Create placeholder | REF template |
---
title: "ADR-00: Architecture Decision Records Index"
tags:
- adr
- index
- reference
custom_fields:
document_type: index
artifact_type: ADR-REFERENCE
layer: 5
---| 缺失文件 | 操作 | 使用模板 |
|---|---|---|
| 创建ADR索引 | 索引模板 |
| 创建架构文档占位符 | ARCH模板 |
参考文档( | 创建占位符 | REF模板 |
---
title: "ADR-00: Architecture Decision Records Index"
tags:
- adr
- index
- reference
custom_fields:
document_type: index
artifact_type: ADR-REFERENCE
layer: 5
---| ADR ID | Title | Status | Date | Impact |
|---|---|---|---|---|
| ADR-01 | [Title] | Accepted | YYYY-MM-DD | High/Medium/Low |
| ADR ID | Title | Status | Date | Impact |
|---|---|---|---|---|
| ADR-01 | [Title] | Accepted | YYYY-MM-DD | High/Medium/Low |
| ADR ID | Title | Superseded By | Date |
|---|---|---|---|
| [None] |
| ADR ID | Title | Superseded By | Date |
|---|---|---|---|
| [None] |
| Category | ADR IDs | Description |
|---|---|---|
| Infrastructure | Infrastructure-related decisions | |
| Security | Security architecture decisions | |
| Integration | External integration decisions | |
| Data | Data management decisions |
**Architecture Placeholder Template**:
```markdown
---
title: "Architecture Document: [Component Name]"
tags:
- architecture
- reference
custom_fields:
document_type: architecture
status: placeholder
created_by: doc-adr-fixer
---| Category | ADR IDs | Description |
|---|---|---|
| Infrastructure | Infrastructure-related decisions | |
| Security | Security architecture decisions | |
| Integration | External integration decisions | |
| Data | Data management decisions |
**架构文档占位符模板**:
```markdown
---
title: "Architecture Document: [Component Name]"
tags:
- architecture
- reference
custom_fields:
document_type: architecture
status: placeholder
created_by: doc-adr-fixer
---Status: Placeholder - Requires completion
Status: Placeholder - Requires completion
| Component | Description | Responsibility |
|---|---|---|
| [Name] | [Description] | [What it does] |
| Component | Description | Responsibility |
|---|---|---|
| [Name] | [Description] | [What it does] |
---
---| Issue Code | Issue | Fix Action |
|---|---|---|
| REV-L001 | Broken internal link | Update path or create target file |
| REV-L002 | External link unreachable | Add warning comment, keep link |
| REV-L003 | Absolute path used | Convert to relative path |
| REV-L004 | Missing BDD traceability link | Add link to corresponding BDD scenario |
def fix_link_path(adr_location: str, target_path: str) -> str:
"""Calculate correct relative path based on ADR location."""
# Monolithic ADR: docs/05_ADR/ADR-01.md
# Sectioned ADR: docs/05_ADR/ADR-01_slug/ADR-01.3_section.md
if is_sectioned_adr(adr_location):
# Need to go up one more level
return "../" + calculate_relative_path(adr_location, target_path)
else:
return calculate_relative_path(adr_location, target_path)| Source | Target | Link Pattern |
|---|---|---|
| ADR | BDD | |
| ADR | BRD | |
| ADR | SYS | |
| 问题编码 | 问题描述 | 修复动作 |
|---|---|---|
| REV-L001 | 内部链接失效 | 更新路径或创建目标文件 |
| REV-L002 | 外部链接无法访问 | 添加警告注释,保留原链接 |
| REV-L003 | 使用了绝对路径 | 转换为相对路径 |
| REV-L004 | 缺少BDD可追溯链接 | 添加指向对应BDD场景的链接 |
def fix_link_path(adr_location: str, target_path: str) -> str:
"""Calculate correct relative path based on ADR location."""
# Monolithic ADR: docs/05_ADR/ADR-01.md
# Sectioned ADR: docs/05_ADR/ADR-01_slug/ADR-01.3_section.md
if is_sectioned_adr(adr_location):
# Need to go up one more level
return "../" + calculate_relative_path(adr_location, target_path)
else:
return calculate_relative_path(adr_location, target_path)| 源文档 | 目标文档 | 链接格式 |
|---|---|---|
| ADR | BDD | |
| ADR | BRD | |
| ADR | SYS | |
| Pattern | Issue | Conversion |
|---|---|---|
| Code 01 invalid for ADR | |
| Legacy pattern | |
| Legacy pattern | |
| Legacy pattern | |
| Code | Element Type | Description |
|---|---|---|
| 13 | Decision Context | Background and problem statement |
| 14 | Decision Statement | The actual decision made |
| 15 | Option Considered | Alternative options evaluated |
| 16 | Consequence | Implications of the decision |
| Invalid Code | Valid Code | Element Type |
|---|---|---|
| 01 | 13 | Decision Context (was Functional Requirement) |
| 05 | 14 | Decision Statement (was Use Case) |
| 06 | 16 | Consequence (was Acceptance Criteria) |
undefined| 格式 | 问题 | 转换后格式 |
|---|---|---|
| ADR的类型码01无效 | |
| 旧格式 | |
| 旧格式 | |
| 旧格式 | |
| 编码 | 元素类型 | 描述 |
|---|---|---|
| 13 | 决策上下文 | 背景与问题描述 |
| 14 | 决策声明 | 实际做出的决策内容 |
| 15 | 备选方案评估 | 评估过的替代方案 |
| 16 | 决策影响 | 决策带来的后续影响 |
| 无效编码 | 有效编码 | 元素类型 |
|---|---|---|
| 01 | 13 | 决策上下文(原功能需求) |
| 05 | 14 | 决策声明(原用例) |
| 06 | 16 | 决策影响(原验收标准) |
undefined
---
---| Issue Code | Issue | Fix Action |
|---|---|---|
| REV-P001 | | Flag for manual completion (cannot auto-fix) |
| REV-P002 | | Flag for manual completion (cannot auto-fix) |
| REV-P003 | Template date | Replace with current date |
| REV-P004 | Template name | Replace with metadata author or flag |
| REV-P005 | Empty section | Add minimum template content |
| REV-P006 | Missing decision status | Add "Proposed" as default status |
replacements = {
'YYYY-MM-DDTHH:MM:SS': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
'YYYY-MM-DD': datetime.now().strftime('%Y-%m-%d'),
'MM/DD/YYYY': datetime.now().strftime('%m/%d/%Y'),
'[Current date]': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
'[Status]': 'Proposed',
}| Section | Missing Content | Auto-Fill |
|---|---|---|
| Status | Empty | "Proposed" |
| Decision Date | Empty | Current date |
| Deciders | Empty | "[Pending assignment]" |
| 问题编码 | 问题描述 | 修复动作 |
|---|---|---|
| REV-P001 | 存在 | 标记为需人工补全(无法自动修复) |
| REV-P002 | 存在 | 标记为需人工补全(无法自动修复) |
| REV-P003 | 模板日期 | 替换为当前日期 |
| REV-P004 | 模板名称 | 替换为元数据中的作者信息或标记待补全 |
| REV-P005 | 章节为空 | 添加最小模板内容 |
| REV-P006 | 缺少决策状态 | 添加默认状态「Proposed」 |
replacements = {
'YYYY-MM-DDTHH:MM:SS': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
'YYYY-MM-DD': datetime.now().strftime('%Y-%m-%d'),
'MM/DD/YYYY': datetime.now().strftime('%m/%d/%Y'),
'[Current date]': datetime.now().strftime('%Y-%m-%dT%H:%M:%S'),
'[Status]': 'Proposed',
}| 章节 | 缺失内容 | 自动填充值 |
|---|---|---|
| 状态 | 为空 | "Proposed" |
| 决策日期 | 为空 | 当前日期 |
| 决策人 | 为空 | "[Pending assignment]" |
| Issue | Fix Action |
|---|---|
Missing | Add reference tag |
| Incorrect cross-ADR path | Update to correct relative path |
| Missing BDD traceability | Add |
| Missing BRD alignment | Add |
undefined| 问题 | 修复动作 |
|---|---|
已创建文件缺少 | 添加引用标签 |
| 跨ADR路径不正确 | 更新为正确的相对路径 |
| 缺少BDD追溯关系 | 添加 |
| 缺少BRD对齐关系 | 添加 |
undefined| ADR Element | Traces To | Type |
|---|---|---|
| ADR.01.14.01 | BDD.01.09.03 | Behavior Implementation |
| ADR.01.13.01 | BRD.01.22.05 | Business Context |
---| ADR Element | Traces To | Type |
|---|---|---|
| ADR.01.14.01 | BDD.01.09.03 | Behavior Implementation |
| ADR.01.13.01 | BRD.01.22.05 | Business Context |
---| Direction | Layer | Artifact | Relationship |
|---|---|---|---|
| Upstream | 4 | BDD | Provides behavior specifications that drive decisions |
| Current | 5 | ADR | Architecture Decision Records |
| Downstream | 6 | SYS | System design implementing decisions |
ADR-NN-SSNNSSADR-01-15| 方向 | 层级 | 产物 | 关系 |
|---|---|---|---|
| 上游 | 4 | BDD | 提供驱动决策的行为规范 |
| 当前 | 5 | ADR | 架构决策记录 |
| 下游 | 6 | SYS | 实现决策的系统设计 |
ADR-NN-SSNNSSADR-01-15def calculate_drift_percentage(current_hash: str, upstream_hash: str,
current_content: str, upstream_content: str) -> float:
"""Calculate percentage of content change between versions."""
if current_hash == upstream_hash:
return 0.0
# Line-based diff calculation
current_lines = set(current_content.strip().split('\n'))
upstream_lines = set(upstream_content.strip().split('\n'))
added = upstream_lines - current_lines
removed = current_lines - upstream_lines
total_changes = len(added) + len(removed)
total_lines = max(len(current_lines), len(upstream_lines), 1)
return (total_changes / total_lines) * 100| Tier | Change % | Action | Version Increment | Human Review |
|---|---|---|---|---|
| Tier 1 | < 5% | Auto-merge decision updates | Patch (x.x.+1) | No |
| Tier 2 | 5-15% | Auto-merge with changelog | Minor (x.+1.0) | No |
| Tier 3 | > 15% | Archive + regenerate | Major (+1.0.0) | Yes |
def calculate_drift_percentage(current_hash: str, upstream_hash: str,
current_content: str, upstream_content: str) -> float:
"""Calculate percentage of content change between versions."""
if current_hash == upstream_hash:
return 0.0
# Line-based diff calculation
current_lines = set(current_content.strip().split('\n'))
upstream_lines = set(upstream_content.strip().split('\n'))
added = upstream_lines - current_lines
removed = current_lines - upstream_lines
total_changes = len(added) + len(removed)
total_lines = max(len(current_lines), len(upstream_lines), 1)
return (total_changes / total_lines) * 100| 层级 | 变更占比 | 操作 | 版本号递增规则 | 人工评审 |
|---|---|---|---|---|
| 层级1 | < 5% | 自动合并决策更新 | 补丁版本(x.x.+1) | 不需要 |
| 层级2 | 5-15% | 自动合并并生成变更日志 | 次版本(x.+1.0) | 不需要 |
| 层级3 | > 15% | 归档+重新生成 | 主版本(+1.0.0) | 需要 |
@ref:1.0.01.0.1<!-- Before -->
@ref: BDD-01.09.03 (v1.2.0)
<!-- After (auto-merged) -->
@ref: BDD-01.09.03 (v1.2.1)
<!-- Tier 1 auto-merge: Minor upstream update (2.3% change) - 2026-02-10 -->@ref:1.0.01.0.1<!-- Before -->
@ref: BDD-01.09.03 (v1.2.0)
<!-- After (auto-merged) -->
@ref: BDD-01.09.03 (v1.2.1)
<!-- Tier 1 auto-merge: Minor upstream update (2.3% change) - 2026-02-10 -->[REVIEW-SUGGESTED]1.0.11.1.0undefined[REVIEW-SUGGESTED]1.0.11.1.0undefined| Change Type | Description | ADR Impact |
|---|---|---|
| Added | Scenario: Error handling for timeout | Decision ADR-01-03 context updated |
| Modified | Scenario: Authentication flow steps | Decision ADR-01-01 rationale refreshed |
| Removed | None | N/A |
---| Change Type | Description | ADR Impact |
|---|---|---|
| Added | Scenario: Error handling for timeout | Decision ADR-01-03 context updated |
| Modified | Scenario: Authentication flow steps | Decision ADR-01-01 rationale refreshed |
| Removed | None | N/A |
---[SUPERSEDED]1.1.02.0.0undefined[SUPERSEDED]1.1.02.0.0undefinedSuperseded by: ADR-01-15 (v2.0.0) Superseded date: 2026-02-10 Reason: Upstream BDD restructured authentication flow
**Archive Manifest Format** (`ADR-NN_archive_manifest.json`):
```json
{
"archive_version": "1.0",
"archive_date": "2026-02-10T16:00:00",
"archived_adr": "ADR-01",
"archived_version": "1.1.0",
"new_version": "2.0.0",
"trigger": {
"type": "tier_3_drift",
"upstream_document": "BDD-01.feature",
"change_percentage": 23.5,
"upstream_version_before": "1.2.0",
"upstream_version_after": "2.0.0"
},
"superseded_decisions": [
{
"id": "ADR-01-05",
"title": "Authentication Token Strategy",
"superseded_by": "ADR-01-15",
"reason": "Upstream BDD restructured authentication flow"
},
{
"id": "ADR-01-07",
"title": "Session Management Approach",
"superseded_by": "ADR-01-16",
"reason": "New session requirements in BDD"
}
],
"preserved_decisions": [
{
"id": "ADR-01-01",
"title": "Database Selection",
"status": "unchanged",
"carried_forward_as": "ADR-01-01"
}
],
"archive_location": "docs/05_ADR/archive/ADR-01_v1.1.0/"
}Superseded by: ADR-01-15 (v2.0.0) Superseded date: 2026-02-10 Reason: Upstream BDD restructured authentication flow
**归档清单格式**(`ADR-NN_archive_manifest.json`):
```json
{
"archive_version": "1.0",
"archive_date": "2026-02-10T16:00:00",
"archived_adr": "ADR-01",
"archived_version": "1.1.0",
"new_version": "2.0.0",
"trigger": {
"type": "tier_3_drift",
"upstream_document": "BDD-01.feature",
"change_percentage": 23.5,
"upstream_version_before": "1.2.0",
"upstream_version_after": "2.0.0"
},
"superseded_decisions": [
{
"id": "ADR-01-05",
"title": "Authentication Token Strategy",
"superseded_by": "ADR-01-15",
"reason": "Upstream BDD restructured authentication flow"
},
{
"id": "ADR-01-07",
"title": "Session Management Approach",
"superseded_by": "ADR-01-16",
"reason": "New session requirements in BDD"
}
],
"preserved_decisions": [
{
"id": "ADR-01-01",
"title": "Database Selection",
"status": "unchanged",
"carried_forward_as": "ADR-01-01"
}
],
"archive_location": "docs/05_ADR/archive/ADR-01_v1.1.0/"
}.drift_cache.json{
"cache_version": "2.0",
"adr_id": "ADR-01",
"adr_version": "1.1.0",
"adr_updated": "2026-02-10T16:00:00",
"drift_reviewed": "2026-02-10T16:00:00",
"upstream_tracking": {
"BDD": {
"document": "../../04_BDD/BDD-01.feature",
"tracked_version": "1.3.0",
"content_hash": "a1b2c3d4e5f6...",
"last_sync": "2026-02-10T16:00:00"
}
},
"downstream_tracking": {
"SYS": {
"document": "../../06_SYS/SYS-01.md",
"notified_version": "1.1.0",
"notification_date": "2026-02-10T16:00:00"
}
},
"merge_history": [
{
"date": "2026-02-10T16:00:00",
"tier": 2,
"change_percentage": 8.7,
"upstream_document": "BDD-01.feature",
"version_before": "1.0.1",
"version_after": "1.1.0",
"decisions_updated": ["ADR-01-01", "ADR-01-03"],
"decisions_flagged": ["ADR-01-03"],
"auto_merged": true
},
{
"date": "2026-02-08T10:00:00",
"tier": 1,
"change_percentage": 2.3,
"upstream_document": "BDD-01.feature",
"version_before": "1.0.0",
"version_after": "1.0.1",
"decisions_updated": ["ADR-01-02"],
"decisions_flagged": [],
"auto_merged": true
}
],
"acknowledged_drift": [
{
"document": "BDD-01.feature",
"acknowledged_date": "2026-02-07",
"acknowledged_version": "1.1.5",
"reason": "Reviewed - documentation-only changes, no ADR impact"
}
]
}.drift_cache.json{
"cache_version": "2.0",
"adr_id": "ADR-01",
"adr_version": "1.1.0",
"adr_updated": "2026-02-10T16:00:00",
"drift_reviewed": "2026-02-10T16:00:00",
"upstream_tracking": {
"BDD": {
"document": "../../04_BDD/BDD-01.feature",
"tracked_version": "1.3.0",
"content_hash": "a1b2c3d4e5f6...",
"last_sync": "2026-02-10T16:00:00"
}
},
"downstream_tracking": {
"SYS": {
"document": "../../06_SYS/SYS-01.md",
"notified_version": "1.1.0",
"notification_date": "2026-02-10T16:00:00"
}
},
"merge_history": [
{
"date": "2026-02-10T16:00:00",
"tier": 2,
"change_percentage": 8.7,
"upstream_document": "BDD-01.feature",
"version_before": "1.0.1",
"version_after": "1.1.0",
"decisions_updated": ["ADR-01-01", "ADR-01-03"],
"decisions_flagged": ["ADR-01-03"],
"auto_merged": true
},
{
"date": "2026-02-08T10:00:00",
"tier": 1,
"change_percentage": 2.3,
"upstream_document": "BDD-01.feature",
"version_before": "1.0.0",
"version_after": "1.0.1",
"decisions_updated": ["ADR-01-02"],
"decisions_flagged": [],
"auto_merged": true
}
],
"acknowledged_drift": [
{
"document": "BDD-01.feature",
"acknowledged_date": "2026-02-07",
"acknowledged_version": "1.1.5",
"reason": "Reviewed - documentation-only changes, no ADR impact"
}
]
}flowchart TD
A[Detect Upstream Drift] --> B[Calculate Change %]
B --> C{Change < 5%?}
C -->|Yes| D[Tier 1: Auto-Merge]
D --> D1[Update @ref tags]
D1 --> D2[Increment patch version]
D2 --> D3[Log to drift cache]
D3 --> Z[Complete]
C -->|No| E{Change 5-15%?}
E -->|Yes| F[Tier 2: Auto-Merge + Changelog]
F --> F1[Apply Tier 1 actions]
F1 --> F2[Generate changelog block]
F2 --> F3[Mark REVIEW-SUGGESTED]
F3 --> F4[Increment minor version]
F4 --> F5[Log to merge history]
F5 --> Z
E -->|No| G[Tier 3: Archive + Regenerate]
G --> G1[Create archive manifest]
G1 --> G2[Archive current version]
G2 --> G3[Mark decisions SUPERSEDED]
G3 --> G4[Increment major version]
G4 --> G5[Trigger regeneration]
G5 --> G6[Notify downstream SYS]
G6 --> H[Human Review Required]flowchart TD
A[Detect Upstream Drift] --> B[Calculate Change %]
B --> C{Change < 5%?}
C -->|Yes| D[Tier 1: Auto-Merge]
D --> D1[Update @ref tags]
D1 --> D2[Increment patch version]
D2 --> D3[Log to drift cache]
D3 --> Z[Complete]
C -->|No| E{Change 5-15%?}
E -->|Yes| F[Tier 2: Auto-Merge + Changelog]
F --> F1[Apply Tier 1 actions]
F1 --> F2[Generate changelog block]
F2 --> F3[Mark REVIEW-SUGGESTED]
F3 --> F4[Increment minor version]
F4 --> F5[Log to merge history]
F5 --> Z
E -->|No| G[Tier 3: Archive + Regenerate]
G --> G1[Create archive manifest]
G1 --> G2[Archive current version]
G2 --> G3[Mark decisions SUPERSEDED]
G3 --> G4[Increment major version]
G4 --> G5[Trigger regeneration]
G5 --> G6[Notify downstream SYS]
G6 --> H[Human Review Required]<!-- Downstream notification added to SYS-01.md -->
<!-- ADR-DRIFT-NOTIFICATION: ADR-01 updated to v1.1.0 (2026-02-10) -->
<!-- Tier 2 merge: 8.7% upstream change from BDD-01.feature -->
<!-- Decisions potentially affecting this SYS: ADR-01-01, ADR-01-03 -->
<!-- Review recommended for: Section 4 (Authentication Design) --><!-- Downstream notification added to SYS-01.md -->
<!-- ADR-DRIFT-NOTIFICATION: ADR-01 updated to v1.1.0 (2026-02-10) -->
<!-- Tier 2 merge: 8.7% upstream change from BDD-01.feature -->
<!-- Decisions potentially affecting this SYS: ADR-01-01, ADR-01-03 -->
<!-- Review recommended for: Section 4 (Authentication Design) -->| Option | Default | Description |
|---|---|---|
| true | Enable tiered auto-merge system |
| none | Force specific tier (1, 2, or 3) |
| false | Skip archiving for Tier 3 (not recommended) |
| true | Send notifications to SYS documents |
| true | Generate changelog for Tier 2+ |
| true | Keep superseded decisions (required) |
| 选项 | 默认值 | 描述 |
|---|---|---|
| true | 启用分层自动合并系统 |
| none | 强制指定合并层级(1、2或3) |
| false | 层级3变更时跳过归档(不推荐) |
| true | 向SYS文档发送通知 |
| true | 层级2及以上变更时生成变更日志 |
| true | 保留已替代的决策(必填) |
undefinedundefinedundefinedundefined| Option | Default | Description |
|---|---|---|
| latest | Specific review report to use |
| false | Run reviewer after fixes |
| 3 | Max fix-review cycles |
| all | Specific fix types (comma-separated) |
| true | Create missing reference files |
| true | Backup ADR before fixing |
| false | Preview fixes without applying |
| false | Interactive drift acknowledgment mode |
| true | Update .drift_cache.json after fixes |
| 选项 | 默认值 | 描述 |
|---|---|---|
| latest | 指定要使用的评审报告 |
| false | 修复完成后运行评审工具 |
| 3 | 最大修复-评审循环次数 |
| all | 指定修复类型(逗号分隔) |
| true | 创建缺失的参考文件 |
| true | 修复前备份ADR |
| false | 预览修复内容不实际执行 |
| false | 交互式漂移确认模式 |
| true | 修复完成后更新.drift_cache.json |
| Type | Description |
|---|---|
| Create missing index, architecture docs |
| Fix link paths |
| Convert invalid/legacy element IDs |
| Fix placeholders, dates, status |
| Update traceability and cross-references |
| Handle upstream drift detection issues |
| All fix types (default) |
| 类型 | 描述 |
|---|---|
| 创建缺失的索引、架构文档 |
| 修复链接路径 |
| 转换无效/旧版元素ID |
| 修复占位符、日期、状态 |
| 更新追溯关系和交叉引用 |
| 处理上游漂移检测问题 |
| 所有修复类型(默认) |
ADR-NN_{slug}/ADR-NN.F_fix_report_vNNN.mddocs/ADR/ADR-NN_{slug}/---
title: "ADR-NN.F: Fix Report v001"
tags:
- adr
- fix-report
- quality-assurance
custom_fields:
document_type: fix-report
artifact_type: ADR-FIX
layer: 5
parent_doc: ADR-NN
source_review: ADR-NN.R_review_report_v001.md
fix_date: "YYYY-MM-DDTHH:MM:SS"
fix_tool: doc-adr-fixer
fix_version: "1.0"
---ADR-NN_{slug}/ADR-NN.F_fix_report_vNNN.mddocs/ADR/ADR-NN_{slug}/---
title: "ADR-NN.F: Fix Report v001"
tags:
- adr
- fix-report
- quality-assurance
custom_fields:
document_type: fix-report
artifact_type: ADR-FIX
layer: 5
parent_doc: ADR-NN
source_review: ADR-NN.R_review_report_v001.md
fix_date: "YYYY-MM-DDTHH:MM:SS"
fix_tool: doc-adr-fixer
fix_version: "1.0"
---| Metric | Value |
|---|---|
| Source Review | ADR-NN.R_review_report_v001.md |
| Issues in Review | 12 |
| Issues Fixed | 10 |
| Issues Remaining | 2 (manual review required) |
| Files Created | 2 |
| Files Modified | 3 |
| Metric | Value |
|---|---|
| Source Review | ADR-NN.R_review_report_v001.md |
| Issues in Review | 12 |
| Issues Fixed | 10 |
| Issues Remaining | 2 (manual review required) |
| Files Created | 2 |
| Files Modified | 3 |
| File | Type | Location |
|---|---|---|
| ADR-00_INDEX.md | ADR Index | docs/05_ADR/ |
| ARCH_Authentication.md | Arch Placeholder | docs/00_REF/architecture/ |
| File | Type | Location |
|---|---|---|
| ADR-00_INDEX.md | ADR Index | docs/05_ADR/ |
| ARCH_Authentication.md | Arch Placeholder | docs/00_REF/architecture/ |
| # | Issue Code | Issue | Fix Applied | File |
|---|---|---|---|---|
| 1 | REV-L001 | Broken index link | Created ADR-00_INDEX.md | ADR-01.md |
| 2 | REV-L001 | Broken arch link | Created placeholder ARCH file | ADR-01.md |
| 3 | REV-N004 | Element type 01 invalid | Converted to type 13 | ADR-01.md |
| 4 | REV-L003 | Absolute path used | Converted to relative | ADR-02.md |
| # | Issue Code | Issue | Fix Applied | File |
|---|---|---|---|---|
| 1 | REV-L001 | Broken index link | Created ADR-00_INDEX.md | ADR-01.md |
| 2 | REV-L001 | Broken arch link | Created placeholder ARCH file | ADR-01.md |
| 3 | REV-N004 | Element type 01 invalid | Converted to type 13 | ADR-01.md |
| 4 | REV-L003 | Absolute path used | Converted to relative | ADR-02.md |
| # | Issue Code | Issue | Location | Reason |
|---|---|---|---|---|
| 1 | REV-P001 | [TODO] placeholder | ADR-01:L45 | Architecture expertise needed |
| 2 | REV-D001 | BDD drift detected | ADR-01:L120 | Review behavior changes |
| # | Issue Code | Issue | Location | Reason |
|---|---|---|---|---|
| 1 | REV-P001 | [TODO] placeholder | ADR-01:L45 | Architecture expertise needed |
| 2 | REV-D001 | BDD drift detected | ADR-01:L120 | Review behavior changes |
| Metric | Before | After | Delta |
|---|---|---|---|
| Review Score | 88 | 95 | +7 |
| Errors | 3 | 0 | -3 |
| Warnings | 5 | 2 | -3 |
| Metric | Before | After | Delta |
|---|---|---|---|
| Review Score | 88 | 95 | +7 |
| Errors | 3 | 0 | -3 |
| Warnings | 5 | 2 | -3 |
/doc-adr-reviewer ADR-01
---/doc-adr-reviewer ADR-01
---doc-adr-autopilotflowchart LR
subgraph Phase5["Phase 5: Review & Fix Cycle"]
A[doc-adr-reviewer] --> B{Score >= 90?}
B -->|No| C[doc-adr-fixer]
C --> D{Iteration < Max?}
D -->|Yes| A
D -->|No| E[Flag for Manual Review]
B -->|Yes| F[PASS]
end| Phase | Action | Skill |
|---|---|---|
| Phase 5a | Run initial review | |
| Phase 5b | Apply fixes if issues found | |
| Phase 5c | Re-run review | |
| Phase 5d | Repeat until pass or max iterations | Loop |
doc-adr-autopilotflowchart LR
subgraph Phase5["Phase 5: Review & Fix Cycle"]
A[doc-adr-reviewer] --> B{Score >= 90?}
B -->|No| C[doc-adr-fixer]
C --> D{Iteration < Max?}
D -->|Yes| A
D -->|No| E[Flag for Manual Review]
B -->|Yes| F[PASS]
end| 阶段 | 操作 | Skill |
|---|---|---|
| 阶段5a | 运行初始评审 | |
| 阶段5b | 发现问题后执行修复 | |
| 阶段5c | 重新运行评审 | |
| 阶段5d | 重复直到通过或达到最大迭代次数 | 循环 |
| Error | Action |
|---|---|
| Review report not found | Prompt to run |
| Cannot create file (permissions) | Log error, continue with other fixes |
| Cannot parse review report | Abort with clear error message |
| Max iterations exceeded | Generate report, flag for manual review |
| 错误 | 处理动作 |
|---|---|
| 未找到评审报告 | 提示先运行 |
| 无法创建文件(权限问题) | 记录错误,继续执行其他修复 |
| 无法解析评审报告 | 终止并返回清晰的错误信息 |
| 超过最大迭代次数 | 生成报告,标记为需人工评审 |
tmp/backup/ADR-NN_YYYYMMDD_HHMMSS/tmp/backup/ADR-NN_YYYYMMDD_HHMMSS/| Skill | Relationship |
|---|---|
| Provides review report (input) |
| Orchestrates Review -> Fix cycle |
| Structural validation |
| Element ID standards |
| ADR creation rules |
| Upstream behavior reference |
| Upstream business context |
| Skill | 关系 |
|---|---|
| 提供评审报告(输入) |
| 编排「评审→修复」循环 |
| 结构校验 |
| 元素ID规范 |
| ADR创建规则 |
| 上游行为参考 |
| 上游业务上下文 |
| Version | Date | Changes |
|---|---|---|
| 2.1 | 2026-02-11 | Structure Compliance: Added Phase 0 for nested folder rule enforcement (REV-STR001-STR003); Runs FIRST before other fix phases |
| 2.0 | 2026-02-10 | Enhanced Phase 6 with tiered auto-merge system; Three-tier thresholds (Tier 1 <5%, Tier 2 5-15%, Tier 3 >15%); No deletion policy - superseded decisions preserved; Archive manifest for Tier 3; Enhanced drift cache with merge history; Auto-generated ADR IDs (ADR-NN-SS pattern); Downstream SYS notification; Change percentage calculation |
| 1.0 | 2026-02-10 | Initial skill creation; 6-phase fix workflow; ADR Index and Architecture file creation; Element ID conversion (types 13, 14, 15, 16); Broken link fixes; BDD/BRD upstream drift handling; Integration with autopilot Review->Fix cycle |
| 版本 | 日期 | 变更内容 |
|---|---|---|
| 2.1 | 2026-02-11 | 结构合规:新增阶段0强制执行嵌套文件夹规则(REV-STR001-STR003),优先于其他修复阶段运行 |
| 2.0 | 2026-02-10 | 阶段6新增分层自动合并系统;三级阈值(层级1<5%、层级2 5-15%、层级3>15%);永不删除政策,保留已替代决策;层级3变更生成归档清单;增强型漂移缓存带合并历史;自动生成ADR ID(ADR-NN-SS格式);下游SYS通知;变更比例计算 |
| 1.0 | 2026-02-10 | 初始skill创建;6阶段修复工作流;ADR索引和架构文件创建;元素ID转换(类型13、14、15、16);断链修复;BDD/BRD上游漂移处理;与autopilot的「评审→修复」循环集成 |