Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion evals/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ def find_latest_persona() -> tuple[int, PersonaSpec]:
if match:
versions.append((int(match.group(1)), path))
if not versions:
raise FileNotFoundError("No persona.vN.md artifacts found.")
raise FileNotFoundError(
f"No persona.vN.md artifacts found in {ARTIFACTS_DIR}. "
f"Seed persona.v1.md in that directory before running evolve, "
f"or override the location via ARTIFACTS_DIR before launching."
)
versions.sort(key=lambda x: x[0])
n, path = versions[-1]
text = path.read_text(encoding="utf-8")
Expand Down
6 changes: 5 additions & 1 deletion evals/evolve_persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def find_latest_persona() -> tuple[int, PersonaSpec]:
if match:
versions.append((int(match.group(1)), path))
if not versions:
raise FileNotFoundError("No persona.vN.md artifacts found.")
raise FileNotFoundError(
f"No persona.vN.md artifacts found in {ARTIFACTS_DIR}. "
f"Seed persona.v1.md in that directory before running evolve_persona, "
f"or override the location via ARTIFACTS_DIR before launching."
)
versions.sort(key=lambda x: x[0])
n, path = versions[-1]
text = path.read_text(encoding="utf-8")
Expand Down
5 changes: 4 additions & 1 deletion src/spark_character/codex_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def call_codex(
stderr = result.stderr.decode("utf-8", errors="replace") if result.stderr else ""
raise RuntimeError(f"codex exec failed (rc={result.returncode}): {stderr.strip()[:300]}")
if not out_path.exists():
raise RuntimeError("codex exec did not write the expected output file.")
raise RuntimeError(
f"codex exec did not write the expected output file at {out_path}. "
f"Check codex binary version, sandbox/policy settings, or rerun with --debug to inspect the exec."
)
text = out_path.read_text(encoding="utf-8", errors="replace").strip()
return text

Expand Down
4 changes: 3 additions & 1 deletion src/spark_character/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def detect_provider_kind(provider) -> str | None:
def validate_persona_version(version: str) -> str:
value = str(version or "").strip()
if not PERSONA_VERSION_PATTERN.fullmatch(value):
raise ValueError("Persona version must match vN, for example v8.")
raise ValueError(
f"Persona version must match vN (for example v8); got {value!r}."
)
return value


Expand Down