Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(reports): say why the default report directory was refused and how to choose another (#541)

Christopher Kevin98469e67dd9a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7997326e..9dd49ba6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -535,6 +535,15 @@ All notable changes to SkillEvaluator are documented in this file.
the judge model's geography prefix to a bare name and using a full Bedrock
ID as given. The reusable CI workflows do not take the variable.
+- When the default report directory cannot be claimed, the error now gives
+ the reason and the way out: `Cannot safely reserve default report output
+ directory: <dir> (<reason>). Choose a report directory with
+ -o/--output-dir.` Before, it named only the directory. This happens when
+ both `reports/` and `<skill>-reports/` hold files written under another
+ ownership key, for example from containers that each start with a fresh
+ home directory. The refusal itself is unchanged, and `docs/reports.mdx`
+ explains it.
+
## 0.9.0 - 2026-11-13
### Fixed
diff --git a/docs/reports.mdx b/docs/reports.mdx
index 4d1eb158..2aab43ae 100644
--- a/docs/reports.mdx
+++ b/docs/reports.mdx
@@ -52,7 +52,14 @@ layout when the default output is safe to claim: `skillevaluator validate
./my-skill` writes to `./reports/` when that directory is absent, empty, or
already authenticated as SkillEvaluator output. If `./reports/` is nonempty
and unowned, the default relocates to `./my-skill-reports/` instead of writing
-into unrelated content.
+into unrelated content. If that sibling is nonempty and unowned too, the run
+stops before any check and asks for an explicit `-o`/`--output-dir`.
+
+Ownership is tied to a key stored in your home directory (see
+`SKILLEVALUATOR_OUTPUT_PROVENANCE_KEY_FILE` in
+[Environment Variables](environment-variables.mdx)). Report folders written
+with another key, for example by another account or by a container whose home
+directory was discarded, count as unowned. Pass `-o` in those setups.
For `validate`, that compact default is a pipeline view — a per-check ticker
plus a summary. Pass `--verbose` to get the full per-check detail stream in
diff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.py
index 825164fe..fcd507b3 100644
--- a/src/skillevaluator/cli.py
+++ b/src/skillevaluator/cli.py
@@ -544,6 +544,15 @@ def _path_is_within(candidate: Path, root: Path) -> bool:
current = parent
+def _default_report_output_error(directory: Path, cause: BaseException) -> click.ClickException:
+ """Say why the default report directory was refused and how to choose another."""
+ reason = str(cause).removesuffix(f": {directory}").strip() or type(cause).__name__
+ return click.ClickException(
+ f"Cannot safely reserve default report output directory: {directory} ({reason}). "
+ "Choose a report directory with -o/--output-dir."
+ )
+
+
def _resolve_report_output_location(target_path: Path, output_dir: Path) -> Path:
"""Keep report writes outside the source tree whose identity they describe."""
if not target_path.is_dir():
@@ -592,7 +601,7 @@ def _resolve_report_output_location(target_path: Path, output_dir: Path) -> Path
if output_is_real_directory and is_generated_output_root(output_dir):
return output_dir
except (OSError, RuntimeError, ValueError) as exc:
- raise click.ClickException(f"Cannot safely reserve default report output directory: {output_dir}") from exc
+ raise _default_report_output_error(output_dir, exc) from exc
if output_is_default:
relocated = target_path.with_name(f"{target_path.name}-reports")
@@ -603,7 +612,7 @@ def _resolve_report_output_location(target_path: Path, output_dir: Path) -> Path
mark_generated_output_root(relocated)
return relocated
except (OSError, RuntimeError, ValueError) as exc:
- raise click.ClickException(f"Cannot safely reserve default report output directory: {relocated}") from exc
+ raise _default_report_output_error(relocated, exc) from exc
raise click.ClickException(
f"Report output must be outside the publication target; use an external --output-dir: {output_dir}"
)
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 732583fc..17cbb1f6 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -672,10 +672,51 @@ def test_validate_default_in_skill_reports_refuses_unowned_sibling(
assert result.exit_code != 0
assert "safely reserve default report output" in result.output.lower()
+ assert "marker is missing, invalid, or bound to another path" in " ".join(result.output.split())
+ assert "-o/--output-dir" in result.output
assert authored.read_text(encoding="utf-8") == "author-owned sentinel\n"
assert list(sibling.iterdir()) == [authored]
+def test_validate_default_reports_under_changing_ownership_keys_end_with_an_actionable_refusal(
+ monkeypatch: pytest.MonkeyPatch,
+ tmp_path: Path,
+) -> None:
+ """A new ownership key per run (a fresh HOME, a new container) cannot reuse earlier default folders."""
+ from skillevaluator.tier3.output_provenance import is_generated_output_root
+
+ workspace = tmp_path / "workspace"
+ shutil.copytree(FIXTURE, workspace / "simple")
+ monkeypatch.chdir(workspace)
+ command = ["validate", "--no-tier3", "simple", "--no-llm", "--no-tier2", "--checks", "schema", "--report", "json"]
+
+ def run_with_key(name: str, *extra: str):
+ state = tmp_path / name
+ state.mkdir(mode=0o700)
+ monkeypatch.setenv("SKILLEVALUATOR_OUTPUT_PROVENANCE_KEY_FILE", str(state / "key"))
+ return CliRunner().invoke(cli, [*command, *extra])
+
+ first = run_with_key("first-home")
+ assert first.exit_code == 0, first.output
+ assert is_generated_output_root(workspace / "reports")
+
+ second = run_with_key("second-home")
+ assert second.exit_code == 0, second.output
+ assert is_generated_output_root(workspace / "simple-reports")
+ kept = {path: path.read_bytes() for path in workspace.rglob("*") if path.is_file()}
+
+ third = run_with_key("third-home")
+ assert third.exit_code != 0
+ message = " ".join(third.output.split())
+ assert "safely reserve default report output directory" in message.lower()
+ assert "Choose a report directory with -o/--output-dir." in message
+ assert {path: path.read_bytes() for path in workspace.rglob("*") if path.is_file()} == kept
+
+ chosen = run_with_key("fourth-home", "-o", str(tmp_path / "chosen-reports"))
+ assert chosen.exit_code == 0, chosen.output
+ assert (tmp_path / "chosen-reports" / "BENCHMARK.md").is_file()
+
+
def test_validate_rejects_case_alias_output_inside_publication_target(
tmp_path: Path,
) -> None: