fix(evidence): stabilize real Pi authoring

This commit is contained in:
2026-08-25 15:21:59 +02:00
parent 610ae8c85a
commit 8ba87b68dc
7 changed files with 486 additions and 23 deletions
+19 -2
View File
@@ -117,9 +117,26 @@ def prepare_cmd(
skill_path = Path(__file__).resolve().parents[2] / ".pi" / "skills" / "tht-evidence-authoring" / "SKILL.md"
restructurer = PiEvidenceRestructurer(os.environ.get("THT_PI_EXECUTABLE", "pi"), skill_path)
try:
report = prepare_workspace_evidence(root, restructurer=restructurer, upgrade=upgrade)
try:
max_workers = int(os.environ.get("THT_EVIDENCE_AUTHORING_WORKERS", "1"))
except ValueError as error:
raise EvidencePreparationError("authoring_workers_invalid") from error
report = prepare_workspace_evidence(
root,
restructurer=restructurer,
upgrade=upgrade,
max_workers=max_workers,
)
except EvidencePreparationError as error:
_emit({"schemaVersion": 1, "operation": "evidence_prepare", "status": "failed", "code": error.code}, json_output)
payload = {
"schemaVersion": 1,
"operation": "evidence_prepare",
"status": "failed",
"code": error.code,
}
if error.source_file is not None:
payload["sourceFile"] = error.source_file
_emit(payload, json_output)
raise typer.Exit(code=1) from error
_emit(_preparation_payload(report), json_output)
if report.findings: