import json
from pathlib import Path
src = Path('/home/ubuntu/keiba_requirements_wide_research.json')
out = Path('/home/ubuntu/parallel_analysis_digest.md')
data = json.loads(src.read_text(encoding='utf-8'))
lines = ['# 並列分析ダイジェスト\n']
for i, r in enumerate(data['results'], 1):
o = r.get('output') or {}
lines.append(f"## {i}. {o.get('axis','')}\n")
for key, title in [
('executive_summary','要約'),
('design_intent','設計意図'),
('world_class_points','世界最高基準の評価点'),
('risks_and_gaps','リスクと不足'),
('generalization_principles','汎用化原則'),
('template_items','テンプレート項目'),
('review_checklist','レビュー観点'),
]:
val = o.get(key, '')
lines.append(f"### {title}\n{val}\n")
lines.append(f"信頼度: {o.get('confidence','')}\n")
out.write_text('\n'.join(lines), encoding='utf-8')
print(out, 'written')
分析スクリプト: 並列リサーチ結果をダイジェストMarkdown化
元ファイル: システム要件定義の分析と汎用化方法/summarize_parallel_results.py
要約
競馬要件の広域リサーチJSON(keiba_requirements_wide_research.json)を読み込み、各分析軸ごとの要約・設計意図・世界最高基準の評価点・リスク不足・汎用化原則・テンプレート項目・レビュー観点・信頼度を抽出してMarkdownダイジェストに整形するPythonスクリプト。
要点
- JSONのresults配列を軸ごとに走査
- executive_summary/design_intent/world_class_points等の項目を抽出
- 汎用化原則・テンプレート項目・レビュー観点を整理
- 信頼度(confidence)も併記
- parallel_analysis_digest.mdとして出力