Skip to content

docs: define every metric formula, range, units and validation status - #500

Merged
rng1995 merged 2 commits into
mainfrom
naren/fix-61
Nov 13, 2026
Merged

rng1995 merged 2 commits into
mainfrom
naren/fix-61

Conversation

@rng1995

@rng1995 rng1995 commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses #61.

A user ran the tool and asked what the numbers mean: what Lift and Quality are, how each is calculated, what units they use, what data produces them, how they were validated, and how we know they are not hallucinated. The issue has been open since August with no documentation answer. This PR writes that answer.

New page: docs/metrics-reference.mdx, linked from docs/tier3-live-evaluation.mdx, docs/tier1-validation.mdx and docs/reports.mdx, and added to the Fern nav under Results & CI.

For every number the tool prints, the page gives one sentence on what it measures, the exact formula as the source implements it, its range and units, the checks or judges that produce the input, and the JSON keys to recompute it. Every formula was derived by reading the code and links to the file that implements it. Covered: the six Tier 3 signals (security, skill_execution, skill_efficiency, accuracy, goal_accuracy, behavior_check), report-only token_efficiency, the five dimensions, Overall Score, attempt verdicts, pass@k with its Wilson interval, Skill Lift with its paired bootstrap, the BENCHMARK.md percentages, and the Tier 1 Quality Score with its four weighted areas.

There is also a section that rebuilds one trial's Overall Score from its six signals using only the JSON report, so a skeptical reader can check the arithmetic end to end.

On the validation question

The reporter's sharpest question was how we know the numbers are not hallucinated, so the page answers it directly rather than around it:

  • A table marks each signal deterministic or judged, and notes that "deterministic" means for a fixed trajectory — the agent producing the trajectory is still stochastic. Roughly two-fifths of the Overall Score carries judge variance; all aggregation above the signals is model-free arithmetic.
  • It describes what the project has actually shipped on grader reliability — Wilson intervals (feat(tier3): report pass@k uncertainty and paired outcomes #63), validate-grader (feat(tier3): add validate-grader qualification command and reference suite #383), the dataset-sufficiency label (feat(tier3): report whether a dataset is big enough for its claims #400) and opt-in character facts (Add opt-in Unicode character facts for Tier 3 judges #242) — including validate-grader's unflattering measured baseline.
  • A What has not been established section states plainly that there is no published inter-rater agreement study against human-labeled trajectories, that the dimension definitions and weights are design decisions rather than validated constructs, that the thresholds are conventions rather than values derived from an error model, and that an interval describes one run rather than making a generalization claim.
  • A What a single run can and cannot support section gives fair and unfair readings of a result, and says outright that --n-attempts 1 on a handful of cases is a smoke test, not a benchmark.

The page opens by saying that if it disagrees with the code, the code is the contract and the page is the bug.

Two source findings for maintainers

Both verified by grep; neither is touched by this PR, and the published docs are correct in both cases.

  1. src/skillevaluator/evaluation/dimension_judge.py appears to be dead in the reporting path. Its docstring describes an "LLM-as-Judge for mapping raw evaluator scores to human-readable dimensions" and it contains a prompt asking a model to emit dimension score values, but compute_dimensions and DimensionJudge have no call sites in src/ outside evaluation/__init__.py's re-export. Reports compute dimensions arithmetically in evaluation/tier3_report.py. Anyone reading that module to answer [BUG]: The numbers produced by this tool appear to be meaningless? #61 would reasonably conclude dimension scores are LLM-assigned, which would undercut exactly the trust this issue is about. Worth deleting or marking unused.
  2. check_token_efficiency in tier3/eval_core/checks.py is a stale second formula — a threshold ladder with no call sites in src/ or tests/. The live formula is the reciprocal curve in stats.py. Only the live one is documented.

Verification

  • I am familiar with the Contributing Guidelines
  • Every formula checked against the source; the constants quoted here (DEFAULT_SCORE_POLICY, the 0.35/0.25/0.25/0.15 quality weights, the security ladder, the Wilson z, the lift bands) were re-verified independently of the drafting pass
  • pytest tests/test_oss_packaging.py → 47 passed, 1 failed. The failure (test_harbor_environment_kwarg_contract_matches_installed_source) reproduces identically on a clean main checkout — it is a mismatch between the pinned Harbor contract and the Harbor installed in the local venv, unrelated to this change.
  • Checked the new MDX for bare < and { outside code spans
  • fern check not run locally — Node is not installed on this machine, so the nav/link check will run in CI. The entry follows the existing page:/path:/slug: pattern and the filename matches the slug.
  • Documentation-only: no source behavior changes, no credentials or proprietary content

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

🤖 Generated with Claude Code

Issue #61 asked what "Lift" and "Quality" mean, how they are calculated,
what data produces them, what their units are, and how they were
validated. The answers existed across several pages, in the source, and
in merged PR descriptions, but nowhere as one checkable reference.

Add docs/metrics-reference.mdx, which defines every number the CLI, HTML
report, JSON report and BENCHMARK.md show: the six Tier 3 evaluator
signals, the five dimensions, the Overall Score, Skill Lift, pass@k and
the Tier 1 Quality Score. Each entry gives what it measures, its formula
as the source implements it, its range and units, the deterministic
checks or LLM judges behind it, and the JSON keys to recompute it. A
worked example reproduces one trial's overall score from its reward.json.

The page separates what is computed from what is judged, describes the
pass-rate Wilson intervals, validate-grader, the dataset-sufficiency
label and the opt-in judge character facts, and states plainly that no
inter-rater agreement study against human-labeled trajectories has been
published and what a single run can and cannot support.

Link it from Tier 1 validation, Tier 3 live evaluation and the reports
page, and register it in the Fern navigation.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the new Metrics Reference page, checking each documented formula and constant against the source it cites.

6 findings (1 P2, 5 P3). Each was produced by a reviewer, then checked by a separate adversarial pass that re-ran the claim and corrected or discarded what it could not reproduce; unsupported findings were dropped before posting.

These threads are resolved for triage. Resolution records that the finding has been read and routed, not that it is fixed — anything still open is listed in the PR description or carried to follow-up work.

Comment thread docs/metrics-reference.mdx Resolved
Comment thread docs/metrics-reference.mdx Resolved
Comment thread docs/metrics-reference.mdx Resolved
Comment thread docs/metrics-reference.mdx Resolved
Comment thread docs/metrics-reference.mdx Resolved
Comment thread docs/tier1-validation.mdx Resolved
Review of the new Metrics Reference turned up four statements that
disagree with the code they document, a table that was incomplete, and no
test holding the page to any of it.

- pass_at_k_lift.json stores the pass-rate difference as a difference of
  two rates, not percentage points. _pass_rate_delta and
  _count_derived_pass_rate_delta round with_rate - without_rate over rates
  in [0, 1], and the HTML sanitizer bounds delta to [-1, 1]; only the HTML
  column and the CLI multiply by 100. Split the units row and say so again
  where a reader opens the file.
- The Wilson half-width on four cases peaks at 0.3500 (at 2/4), not ~0.40.
  That is 1.75x the 0.20 the sufficiency policy asks for, not twice it,
  and even 0/4 or 4/4 is 0.2449, so the argument holds at the real figure.
- judge_mixed_cases in lift.json is dict[str, int], a count per judge
  metric. The excluded case ids live in basis.excluded_cases instead.
- The bundled grader suite holds 16 cases (14 assessment, 2 tuning). 14 is
  the assessment split the published baseline was measured on, which is
  what docs/grader-validation.mdx already says.
- The Correctness row listed two of the ten deductions in
  _check_type_specific, so "the deduction behind every finding" overstated
  it. Added the rest as their own type-keyed table.

tests/test_metrics_reference_docs.py parses the constants, thresholds,
weights, formula coefficients and deduction sizes out of the page and
asserts them against constants.py, tier3/dataset_sufficiency.py,
DIMENSION_MAPPING, DEFAULT_METRICS, the Wilson z literal, the
error_recovery coefficients, the default quality config and the bundled
grader suite. It was checked against mutations: retuning
TOKEN_EFFICIENCY_HALF_LIFE, MIN_DISTINCT_CASES, a type-specific deduction
or an error_recovery coefficient each fail it, as does dropping a
documented check from the page or miscounting the grader suite.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@rng1995
rng1995 merged commit 2682dd4 into main Nov 13, 2026
24 checks passed
@rng1995
rng1995 deleted the naren/fix-61 branch November 13, 2026 16:58
rng1995 added a commit that referenced this pull request Nov 13, 2026
Resolve the CHANGELOG conflict by keeping this branch's moves and adding
main's new entries where main has them: #500 under Unreleased, and #369
and #475 under 0.9.0 (moved to Unreleased in the next commit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant