feat(impact): Impact Agent MVP —— 变更点定位 + 影响调查书(追加改修场景)

- 门控:用户提供 existing_system 路径 → 进入影响调查;未提供 → 原流程不变
- CodeParser 解析 Java(@RestController/@Service/@Entity/@TableName)+ ExistingSystemExplorer 组装
- ImpactAgent 变更点定位(变更区分×既存対応 确定性比对,无 LLM)→ ImpactReport(JSON 可下载)
- 影响调查结果作为 Writer 生成概要设计书的主上下文({{impact}},无专用影响章)
- source_aggregator 解除 existing_system=None 硬编码
- 既有系统样本 sunOnly/stock-trade-system(无 LICENSE,仅测试输入,保留来源标注)
- 新造股票交易域追加改修样本 要件定義_追加改修_股票.xlsx(对齐 sunOnly 真实类名)
- 全量 351 passed / 99.27% 覆盖;门禁 PASS(16 要素:新规5/変更8/削除3/未受影响50)
This commit is contained in:
lhl
2026-08-23 17:59:08 +08:00
parent da33df92e1
commit 2e11720a2d
383 changed files with 18411 additions and 10 deletions
+17
View File
@@ -28,3 +28,20 @@ def test_build_contexts_maps_chapters():
assert c.design_rules == []
assert c.template_styles == {"Heading1", "Normal"}
assert c.template_marker.section_placeholder == "section:introduction"
def test_build_contexts_without_impact_report_is_none():
ctxs = build_contexts(_ss(), samples_dir="nonexistent_dir_xyz")
assert ctxs[0].impact_report is None
def test_build_contexts_carries_impact_report():
from genesis.data_models import ChangeAnalysis, ChangeElement, ChangeType, ImpactReport
ca = ChangeAnalysis(project_type="enhancement", new_elements=[], modified_elements=[],
deleted_elements=[], unchanged_elements=[], warnings=[])
report = ImpactReport(metadata={"version": "v1"}, change_analysis=ca, summary={})
ss = _ss()
ss.impact_report = report
ctxs = build_contexts(ss, samples_dir="nonexistent_dir_xyz")
assert ctxs[0].impact_report is report
assert "project_type" in ctxs[0].to_vars()["impact"] or ctxs[0].to_vars()["impact"] != ""