Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to SkillEvaluator are documented in this file.

### Added

- Add opt-in `tier3 interact` experiments for two or more skills. Reuse one
reviewed task source for baseline, individual, and combined configurations;
report signed departure from additive task-outcome gains with fixed attempt
budgets, retained source identities and trial evidence, and explicit
incomplete or incomparable results.

- A reproducible public terminal starter runs the released CLI against the
bundled text-analyzer skill, checks real script/report output and a seeded
quality regression, and retains an editable task, fixture and run receipt.
Expand Down Expand Up @@ -303,6 +309,14 @@ All notable changes to SkillEvaluator are documented in this file.

### Fixed

- `tier3 interact` retains incomplete reports when a configuration raises an
Comment thread
rng1995 marked this conversation as resolved.
Resolved
exception without a message, and handles missing configuration results safely.
Invalid experiment inputs use usage-error exit code 2; incomplete experiments
and output I/O failures continue to use exit code 1.

- Honor `TMPDIR` for temporary GitLab scan reports, with `/tmp` as the default,
Comment thread
rng1995 marked this conversation as resolved.
Resolved
so scans work with configurable temporary storage.

- Repository CI can opt in to reviewed, per-skill SkillSpector baselines from
the PR or merge request's target revision. Policy files from the proposed
changes cannot approve their own exceptions.
Expand Down
2 changes: 1 addition & 1 deletion ci/gitlab/skill-evaluation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ skill-evaluation:
echo "skill-evaluator-report already exists; choose a clean checkout for the report." >&2
exit 1
fi
reports_dir="$(mktemp -d /tmp/skillevaluator-reports.XXXXXX)"
reports_dir="$(mktemp -d "${TMPDIR:-/tmp}/skillevaluator-reports.XXXXXX")"
Comment thread
rng1995 marked this conversation as resolved.
Resolved
trap 'rm -rf "$reports_dir"' EXIT
export SKILL_PATHS="$SKILL_EVAL_PATHS"
export MIN_SCORE="$SKILL_EVAL_MIN_SCORE"
Expand Down
35 changes: 34 additions & 1 deletion docs/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ commands referenced below.
| [similarity-check](#similarity-check) | Detect duplicate content across a collection | Embeddings provider key |
| [tier3 evaluate](#tier3-evaluate) | Run Tier 3 live agent evaluation | Provider key plus a credential the selected agents can use (one `NVIDIA_API_KEY` covers both on NVIDIA Build), backend (Docker by default) |
| [tier3 select-decoys](#tier3-select-decoys) | Save a reproducible set of neighboring skills for group evaluation | Local description-embedding catalog, skill collection, embeddings provider key |
| [tier3 interact](#tier3-interact) | Measure departure from additive skill gains | At least two skills, one reviewed evaluation source, Tier 3 runtime and credentials |
| [tier3 compare-versions](#tier3-compare-versions) | Compare current and prior retained with-skill scores without writes | Two compatible retained runs |
| [create-eval-dataset](#create-eval-dataset) | Generate synthetic eval datasets | LLM provider key (none with `--no-llm`) |
| [init-custom-grader](#init-custom-grader) | Scaffold a bring-your-own-grader starter | Nothing |
Expand Down Expand Up @@ -181,7 +182,7 @@ pipeline.
| --- | --- |
| `tier1` | `validate`, `quality-check`, `rubric-eval`, `security-scan`, `pii-scan`, `lint-scripts` |
| `tier2` | `context-optimization-check`, `dedup-scan`, `similarity-check` |
| `tier3` | `evaluate`, `select-decoys`, `create-eval-dataset`, `migrate-dataset`, `init-custom-grader`, `init-harbor-task`, `doctor`, `view`, `compare`, `feedback`, `validate`, `harbor-view`, `import-metrics`, `import-traces`, `accept-traces` |
| `tier3` | `evaluate`, `interact`, `select-decoys`, `create-eval-dataset`, `migrate-dataset`, `init-custom-grader`, `init-harbor-task`, `doctor`, `view`, `compare`, `feedback`, `validate`, `harbor-view`, `import-metrics`, `import-traces`, `accept-traces` |

`health-check` and [models](#models) are top-level only. The expert commands
[tier3 evaluate](#tier3-evaluate), [tier3 select-decoys](#tier3-select-decoys),
Expand Down Expand Up @@ -521,6 +522,38 @@ without contacting the embedding provider. See
[Select a reproducible decoy set](agents-and-sandboxes.mdx#select-a-reproducible-decoy-set)
for a complete example and the limits of similarity-based selection.

## tier3 interact

Run a fixed-source skill interaction experiment:

```bash
skillevaluator tier3 interact ./skills/a ./skills/b \
--eval-source ./reviewed-suite --n-attempts 3 --agents codex --json
```

| Option | Default | Purpose |
| --- | --- | --- |
| `SKILLS...` | Required | At least two distinct skill directories. |
| `--eval-source` | Required | Skill directory containing the reviewed `evals/` source reused for every configuration. |
| `-a`, `--agents` | Provider-native agent | Comma-separated Harbor agents. |
| `--model` | Provider/config model | Global agent model override. |
| `--env-mode` | `docker` | Existing Harbor environment backend. |
| `--environment-kwarg`, `--ek` | None | Repeatable backend `KEY=VALUE`; never pass secrets. |
| `--n-attempts` | `1` | Positive fixed attempt budget for every case; disables early stopping. |
| `--n-concurrent` | Source config or `4` | Concurrent trials within a configuration. |
| `--metric` | `goal_accuracy` | Outcome metric: `goal_accuracy`, `accuracy`, or `overall` for `custom_only` grading. |
| `--results-dir` | `interaction-results` beside the source | Output root outside all inputs. |
| `--harbor-keep-jobs` | Off | Retain raw Harbor jobs alongside collected evidence. |
| `--json` | Off | Print the complete JSON report on stdout; progress uses stderr. |

Runs baseline, each individual skill, and the combined selection. Saves
`interaction.json`, fixed-source evidence, and separate Tier 3 results for every
configuration. Exit 0 means a comparable experiment completed; positive,
negative, and zero interaction all use exit 0. Exit 1 means incomplete or
incomparable evidence. Invalid command arguments use Click's usage-error exit.
See [Skill interaction experiments](/skills/skillevaluator/tier3-live-evaluation#skill-interaction-experiments)
for the calculation, input restrictions, attempt budget, and interpretation.

## tier3 compare-versions

```bash
Expand Down
74 changes: 74 additions & 0 deletions docs/tier3-live-evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,80 @@ When at least one positive trial activates the skill, lift remains eligible
subject to the comparison requirements below. This also makes activation
failures visible with `--skip-baseline`.

## Skill interaction experiments

Use the opt-in `tier3 interact` command to measure whether selected skills
produce more or less improvement together than the sum of their individual
improvements. Choose one reviewed evaluation source before running:

```bash
skillevaluator tier3 interact ./skills/research ./skills/summarize \
--eval-source ./skills/research --agents codex --n-attempts 3 \
--results-dir ./interaction-results
```

`--eval-source` is a skill directory containing an existing valid `evals/`
dataset or native Harbor task suite. The command never generates or refines
tasks. It freezes that source and the selected skills once, then reuses the
existing Harbor evaluator and skill staging to run:

| Configuration | Installed skills |
| --- | --- |
| Baseline | None |
| Individual | One run for each selected skill alone |
| Combined | Every selected skill together |

For two skills this is four configurations. For a group of N skills it is
N + 2 configurations, each with the full task suite, selected agents, and the
same `--n-attempts` budget. Early stopping is disabled, including when the source
config enables it. Source-config companion selections, partial task suites, and
`pre_agent_setup` are rejected before execution. Skill roots must have distinct
names and be self-contained: runtime snapshots include each skill's files,
while common task inputs belong in the fixed source's `evals/files/`. Results
must be outside the selected skills and evaluation source.

The default outcome metric is `goal_accuracy`; `--metric accuracy` is also
available. These compare task outcomes on the same cases instead of the
standard overall score, whose discovery and skill-usage components differ
between installed-skill and baseline configurations. For `custom_only` grading,
use `--metric overall` with one shared task-outcome grader.

For two skills, the interaction is:

```text
I(A, B) = P(A, B) - P(A) - P(B) + P(empty)
```

For a selected group S:

```text
I(S) = [P(S) - P(empty)] - sum(P(skill) - P(empty) for skill in S)
```

P is the mean per-case outcome, averaging the fixed number of attempts within
each case first. A positive interaction means more than additive improvement;
a negative interaction means less; zero means additive. For example, baseline
0.50, individual scores 0.75 and 0.70, and combined score 0.65 yield interaction
-0.30 and combined lift +0.15. Negative interaction does not imply performance
below baseline. For more than two skills this is total departure from additive
individual gains, rather than an isolated higher-order interaction.

The terminal prints baseline, individual and combined scores, combined lift,
and signed interaction separately for each agent/model. Add `--json` for a
machine-readable report on stdout; progress goes to stderr. Every experiment
also saves `interaction.json`, its fixed evaluation source, and independent
Tier 3 run directories containing reports, dataset snapshots, and trial
evidence. The interaction report records original source paths, content
identities, per-case calculations, and the reward artifacts used.

Missing trials, N/A outcomes, changed cases, unequal attempt budgets, or
different agent models, evaluator versions, or outcome scorers produce an
explicit `incomplete` or `incomparable` result with no interaction estimate and
exit code 1. Judge fallback to a different model is incomparable. Multiple
retained reward rows for one logical attempt are also incomparable rather than
being counted as extra attempts. Other completed configuration evidence remains
available for inspection.

## Repeatable activation validation

Use the existing dataset generator, runner and trusted trajectory collector to
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4141,6 +4141,10 @@ def harbor_view(jobs_dir: Path) -> None:
tier3.add_command(select_decoys_command, "select-decoys")
tier3.add_command(validate_grader, "validate-grader")

from skillevaluator.tier3.interaction_commands import interact_command

tier3.add_command(interact_command, "interact")

from skillevaluator.tier3.workflow import build_tier3_workflow

tier3.workflow = build_tier3_workflow(evaluate)
Expand Down
127 changes: 127 additions & 0 deletions src/skillevaluator/tier3/interaction_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Command surface for explicit skill-interaction experiments."""

from __future__ import annotations

from pathlib import Path
from typing import Any

import click

from skillevaluator.cli_help import RichCommand
from skillevaluator.tier3_environments import all_env_modes


@click.command("interact", cls=RichCommand, context_settings={"help_option_names": ["-h", "--help"]})
@click.argument("skills", nargs=-1, required=True, type=click.Path(exists=True, file_okay=False, path_type=Path))
@click.option(
"--eval-source",
required=True,
type=click.Path(exists=True, file_okay=False, path_type=Path),
help="Skill directory containing the single reviewed evals/ source used for every configuration.",
)
@click.option(
"-a", "--agents", default=None, help="Comma-separated Harbor agents; defaults to the provider-native agent."
)
@click.option("--model", default=None, help="Global agent model override.")
@click.option("--env-mode", default="docker", show_default=True, type=click.Choice(all_env_modes()))
@click.option("--environment-kwarg", "--ek", multiple=True, help="Harbor backend kwarg KEY=VALUE; never pass secrets.")
@click.option(
"--n-attempts",
type=click.IntRange(min=1),
default=1,
show_default=True,
help="Fixed attempts per case in every configuration; early stopping is disabled.",
)
@click.option("--n-concurrent", type=click.IntRange(min=1), default=None)
@click.option(
"--metric",
type=click.Choice(["goal_accuracy", "accuracy", "overall"]),
default="goal_accuracy",
show_default=True,
help="Task outcome to compare; overall requires custom_only grading.",
)
@click.option(
"--results-dir",
type=click.Path(file_okay=False, path_type=Path),
default=None,
help="Output root outside the inputs; defaults to interaction-results beside --eval-source.",
)
@click.option("--harbor-keep-jobs", is_flag=True, help="Keep raw Harbor jobs as well as the collected evidence.")
@click.option("--json", "as_json", is_flag=True, help="Print the complete interaction report as JSON.")
def interact_command(
skills: tuple[Path, ...],
eval_source: Path,
agents: str | None,
model: str | None,
env_mode: str,
environment_kwarg: tuple[str, ...],
n_attempts: int,
n_concurrent: int | None,
metric: str,
results_dir: Path | None,
harbor_keep_jobs: bool,
as_json: bool,
) -> None:
"""Measure interaction among at least two skills on one fixed task suite.

Run no skills, each skill alone, and all skills together. Positive means
more than additive improvement; negative means less; zero means additive.
"""
import json
from contextlib import redirect_stdout

from skillevaluator.evaluation import EvaluationOptions
from skillevaluator.tier3.interactions import run_interaction

try:
with redirect_stdout(click.get_text_stream("stderr")):
report = run_interaction(
skills,
eval_source=eval_source,
options=EvaluationOptions(
skill_path=eval_source,
agents=agents,
model=model,
env_mode=env_mode,
environment_kwarg=environment_kwarg,
Comment thread
rng1995 marked this conversation as resolved.
Resolved
n_attempts=n_attempts,
n_concurrent=n_concurrent,
results_dir=results_dir,
harbor_keep_jobs=harbor_keep_jobs,
),
metric=metric,
on_configuration=lambda name: click.echo(f"Tier 3 interaction: running {name}", err=True),
)
except ValueError as exc:
raise click.UsageError(str(exc)) from exc
except OSError as exc:
raise click.ClickException(str(exc)) from exc
Comment thread
rng1995 marked this conversation as resolved.
Resolved
if as_json:
click.echo(json.dumps(report, indent=2, allow_nan=False))
else:
_print_report(report)
if report["status"] != "complete":
raise click.exceptions.Exit(1)


def _print_report(report: dict[str, Any]) -> None:
click.echo(f"Interaction evaluation: {report['status']} ({report['metric']})")
for reason in report.get("reasons", []):
click.echo(f" {reason}")
names = [skill["name"] for skill in report["skills"]]
for agent, score in report.get("agents", {}).items():
click.echo(f"{agent}: {score['status']}")
if score["status"] != "complete":
for reason in score.get("reasons", []):
click.echo(f" {reason}")
continue
click.echo(f" Baseline: {score['baseline']:.4f}")
for name, value in zip(names, score["individuals"], strict=True):
click.echo(f" {name}: {value:.4f}")
click.echo(f" Combined: {score['combined']:.4f}; combined lift: {score['combined_lift']:+.4f}")
click.echo(f" Interaction: {score['interaction']:+.4f} ({score['classification']})")
click.echo("Negative interaction means less than additive gain; combined performance may still exceed baseline.")
click.echo(f"Evidence: {Path(report['run_dir']) / 'interaction.json'}")
Loading