v0.21 alpha add research brief and compressed findings

This commit is contained in:
kai
2026-05-06 19:23:30 +08:00
parent db626f1d58
commit 0644a68ecc
13 changed files with 539 additions and 27 deletions
+29 -2
View File
@@ -34,6 +34,29 @@ def make_fixture(root: Path) -> Path:
return project
def write_fixture_packet(project: Path) -> None:
cards = json.loads((project / "phase2" / "task_cards.json").read_text(encoding="utf-8"))
for index, card in enumerate(cards, start=1):
source_a = f"src_{index:03d}_a"
source_b = f"src_{index:03d}_b"
packet = {
"task_id": card["task_id"],
"claims": [{"claim": f"{card['task_id']} 回归证据支持章节主线", "source_ids": [source_a]}],
"evidence_items": [{"source_id": source_a, "summary": "权威来源支持该判断"}],
"counter_evidence": [{"claim": "证据仍需更多来源交叉验证", "source_ids": [source_b]}],
"source_ids": [source_a, source_b],
"source_quality_notes": [f"{source_a} Tier 1", f"{source_b} Tier 2"],
"open_questions": ["需要在真实项目中补充更多来源。"],
"raw_quotes_or_notes": ["English raw note can remain here."],
"sources": [
{"id": source_a, "title": f"Regression Source {index}A", "url": f"https://example.com/source-{index}-a", "tier": 1},
{"id": source_b, "title": f"Regression Source {index}B", "url": f"https://example.com/source-{index}-b", "tier": 2},
],
}
packet_path = project / card["output_packet"]
packet_path.write_text(json.dumps(packet, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
def main() -> int:
python = sys.executable
run([python, "scripts/dr.py", "skills", "validate"])
@@ -56,9 +79,13 @@ def main() -> int:
)
project = make_fixture(tmp_root)
run([python, "scripts/dr.py", "frame", str(project)])
assert (project / "phase1" / "research_brief.json").exists()
run([python, "scripts/dr.py", "approve", str(project)])
run([python, "scripts/dr.py", "research", str(project), "--workers", "2", "--dry-run"])
run([python, "scripts/dr.py", "research", str(project), "--workers", "2"])
run([python, "scripts/dr.py", "research", str(project), "--workers", "2", "--axis", "literature", "--dry-run"])
run([python, "scripts/dr.py", "research", str(project), "--workers", "2", "--axis", "literature"])
write_fixture_packet(project)
run([python, "scripts/dr.py", "research", str(project), "--workers", "2", "--axis", "literature", "--build-briefs"])
assert (project / "phase2" / "compressed_findings" / "ch01.json").exists()
run([python, "scripts/dr.py", "review", str(project)])
run([python, "scripts/dr.py", "finalize", str(project), "--dry-run"])
print("v0.20 regression PASS")