Preserve Linux archive failures and require current query-role runtime

This commit is contained in:
karl committed 2026-10-13 12:41:27 +02:00
1 parent a8080f061f
commit baf59ba452
2 files changed
+19 -3

No files matched your search

+11 -3
View File
@@ -90,8 +90,16 @@ def main():
def run(label, arguments, json_output=False):
started = time.perf_counter()
output = subprocess.run([str(cli), *map(str, arguments)], cwd=installed, env=environment,
check=True, capture_output=True, text=True, encoding="utf-8", timeout=180)
try:
output = subprocess.run([str(cli), *map(str, arguments)], cwd=installed, env=environment,
check=True, capture_output=True, text=True, encoding="utf-8", timeout=180)
except subprocess.CalledProcessError as error:
args.output.parent.mkdir(parents=True, exist_ok=True)
with args.output.open("x", encoding="utf-8") as evidence:
json.dump({"complete": False, "failed_phase": label,
"exit_code": error.returncode, "stderr": error.stderr[-8192:],
"stdout": error.stdout[-8192:], "command_elapsed_ms": timings}, evidence, indent=2)
raise RuntimeError(f"{label} failed: {error.stderr[-4096:]}") from error
timings[label] = (time.perf_counter() - started) * 1000
return json.loads(output.stdout) if json_output else output.stdout
@@ -115,7 +123,7 @@ def main():
"--extension", "pdf", "--json", *model_arguments], True)
if restricted:
raise RuntimeError("Installed semantic search violated extension filter")
evidence = {"platform": "linux-x86_64", "cpu_only": True,
evidence = {"complete": True, "platform": "linux-x86_64", "cpu_only": True,
"archive_sha256": sha256(args.archive), "archive_bytes": args.archive.stat().st_size,
"verified_files": len(manifest["files"]), "extraction_path_contains_spaces": True,
"automatic_media_helper_discovery": "passed", "embedding_report": report,