Record first authority investigation and preserve failed live-run evidence
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0cffe-206f-7323-89d3-b20ca4cf4bf9
This commit is contained in:
parent
0839ec0600
commit
1f95f6389a
13 changed files with 268 additions and 79 deletions
|
|
@ -4,11 +4,13 @@ from __future__ import annotations
|
|||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
|
||||
import yaml
|
||||
from infospace_bench import create_infospace, load_infospace, register_artifact
|
||||
from infospace_bench.errors import InfospaceError
|
||||
from infospace_bench.workflow import FixtureAssistedGenerationAdapter, run_workflow
|
||||
from infospace_bench.openrouter import OpenRouterAssistedGenerationAdapter
|
||||
|
||||
|
|
@ -107,6 +109,8 @@ def execute(root, adapter, max_calls=4):
|
|||
root / "profile/workflow.yaml"]
|
||||
}
|
||||
manifest["status"] = "started"
|
||||
manifest["adapter"] = type(adapter).__name__
|
||||
manifest["model"] = getattr(adapter, "model", "")
|
||||
receipt.write_text(json.dumps(manifest, indent=2) + "\n")
|
||||
limited = LimitedAdapter(adapter, max_calls)
|
||||
try:
|
||||
|
|
@ -114,6 +118,12 @@ def execute(root, adapter, max_calls=4):
|
|||
manifest.update(status=result.status, run_record=result.run_record_path)
|
||||
except Exception as exc:
|
||||
manifest.update(status="failed", error_type=type(exc).__name__)
|
||||
if isinstance(exc, InfospaceError):
|
||||
manifest["error_code"] = exc.code
|
||||
# Persist only the status code, never provider response bodies or headers.
|
||||
status = re.search(r"HTTP Error (\d{3})", str(exc.detail.get("error", "")))
|
||||
if status:
|
||||
manifest["http_status"] = int(status.group(1))
|
||||
raise
|
||||
finally:
|
||||
manifest["provider_calls_attempted"] = limited.calls
|
||||
|
|
@ -154,7 +164,7 @@ def main():
|
|||
adapter = OpenRouterAssistedGenerationAdapter(model=args.model, retry_limit=0)
|
||||
result = execute(args.root, adapter, args.max_calls)
|
||||
print(json.dumps(result, indent=2, default=str))
|
||||
except (ValueError, OSError) as exc:
|
||||
except (ValueError, OSError, InfospaceError) as exc:
|
||||
parser.exit(1, f"{exc}\n")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue