Skip to content

fix(tier3): show the run's Overall lift in tier3 compare when a metric is N/A in one arm - #386

Merged
chrisknvidia merged 3 commits into
mainfrom
fix/christopherk/compare-overall-consistency
Nov 10, 2026
Merged

chrisknvidia merged 3 commits into
mainfrom
fix/christopherk/compare-overall-consistency

Conversation

@chrisknvidia

Copy link
Copy Markdown
Collaborator

Summary

tier3 compare showed a different Overall lift from the run's own outputs whenever a metric was N/A in only one arm. This always happens in a standard run, because the baseline without the skill marks the skill metrics N/A. lift.json and the JSON, HTML, Markdown and terminal reports drop those metrics from both arms and published +0.10 in the new test; compare subtracted the two arm overall scores and showed +0.03.

  • When either arm records N/A metrics under the standard skill-evaluator-dimension-mean-v1 policy, compare now drops those metrics from both arms' summary scores before it computes the Overall lift, using the same overall_score_from_metrics helper, and prints a note below the table. The with-skill Overall score column is unchanged.
  • Legacy, partial, custom-only and mixed-policy summaries, and runs with no N/A metrics, keep the previous behavior. Missing scores are not filled in.
  • New test in tests/test_tier3_compare.py collects one synthetic standard-grading run and checks that compare shows the same with-skill Overall as summary.json and the same lift as lift.json and the canonical report. It covers the one-arm N/A case and a case where a six-metric mean would give a passing +0.10 lift but the five-dimension policy gives a failing -0.08.

This branch is based on main and does not depend on #373. The new test is in the compare test module instead of the cross-format test that #373 adds. Once both are merged, the compare check can move into that test.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

The new N/A test fails on main and passes with this change. I ran the tests/reporting, tests/evaluation, Tier 3 command/compare, lift-integrity and metrics test suites. I did not run the full make test for this change; CI runs the full suite.

Release Impact

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

…c is N/A in one arm

tier3 compare subtracted the two arm overall scores, while lift.json and the
reports drop a metric N/A in either arm from both arms. Under the standard
dimension-mean policy, compare now drops those metrics from both arms before
computing the Overall lift and notes it below the table. Other policies keep
their previous behavior.

Add a compare test that collects a synthetic run and checks compare against
summary.json, lift.json and the canonical report, including a case where a
six-metric mean would reverse the lift.

Signed-off-by: Christopher Kevin <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated review: 1 findings (0 P1, 1 P2, 0 P3); 1 posted inline.

Checked the new _shared_dimension_overall_lift path in tier3 compare against lift.json and the canonical report on synthetic Harbor runs (control, judge fallback in one arm, skill never activated), at the PR head and on origin/main. Tests run: tests/test_tier3_compare.py 34 passed; tests/test_judge_lift_integrity.py, tests/test_harbor_metrics_truth.py and tests/reporting/test_rich_markup_escaping.py 149 passed; ruff check and ruff format --check clean on the changed files. The repro tests for the comment below fail on the head (2 of 2).

Merge conflicts: none with main and no file conflicts with the other open PRs.

Overlap with #373 and #388: both read the Overall lift from lift.json's overall entry, so for the judge-fallback run they show +0.4833 while this compare shows +0.20. Reading lift.json's overall.delta here would make all three agree.

Overlap with #376: its HTML report defines Skill Lift as the with-skill overall minus the baseline overall, which contradicts the docs/reports.mdx note added here that the lift can differ from that difference.

Comment thread src/skillevaluator/tier3/commands.py Resolved
@github-actions

Copy link
Copy Markdown

Evaluation run

SkillEvaluator CI results

Required gate: Skipped

Only Tier 1 blocks CI; Tier 2 and Tier 3 are advisory.

Skill Tier 1: Static and Security Validation Tier 2: Deduplication Tier 3: Live Agent Evaluation Report
No skills evaluated SKIPPED · issues unknown · No selected skills changed; Tier 1 evaluation did not run. SKIPPED · issues unknown · No selected skills changed; evaluation did not run. SKIPPED · issues unknown · No selected skills changed; evaluation did not run. Report

Commit: c66122ec91403006542a5d3a539d965840e0235f · Environment: docker

@chrisknvidia
chrisknvidia merged commit d81315e into main Nov 10, 2026
27 checks passed
@chrisknvidia
chrisknvidia deleted the fix/christopherk/compare-overall-consistency branch November 10, 2026 04:55
rng1995 added a commit that referenced this pull request Nov 11, 2026
…ial-apt

Conflicts:
- CHANGELOG.md: both sides appended a Fixed entry under Unreleased after
  the HTTPie security-grading entry (main: the tier3 compare Overall lift
  entry from #386). Kept both, main's entry first, then this branch's
  OpenCode Node/npm and procps entry.

Auto-merged without conflicts: docs/eval-datasets.mdx,
tier3/commands.py, tier3/harbor/__init__.py (the new OpenCode row sits
next to main's Hermes row in DOCKER_AGENT_IMPORT_PATHS),
tier3/harbor/adapter.py, tier3/harbor/native_agents.py and
tier3/plugin_native.py (the new OpenCode row sits next to main's Hermes
rows in NATIVE_AGENT_IMPORT_PATHS).

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Nov 12, 2026
* fix(tier3): keep the Rich progress frame at a fixed height

The interactive Tier 3 progress table changed height as the plan resolved
and stages arrived: the Provider and Run plan rows appeared later, every
stage added a row, and long details wrapped. Rich also redrew it from its
own refresh thread at 8 Hz. Redraws of a frame whose height changes can
leave repeated or jumbled frames in the terminal.

- Always render the Provider and Run plan rows, with a placeholder until
  the plan resolves.
- Keep each row on one line: the title and every column end in an
  ellipsis instead of wrapping.
- Show the most recently updated stages in a fixed number of rows, at
  least six and at least one per agent, padded with blank rows. The slot
  count never shrinks.
- Create Live with auto_refresh=False, so redraws come only from progress
  events and heartbeats, which hold the reporter lock.
- Reset the plan, rows and slot count on close even when Live never
  started.

A redraw failure on the heartbeat thread used to end the thread with a
traceback and leave the reporter active. The heartbeat loop now catches
it and calls a failure callback; SafeProgressReporter registers its
disable hook there, which closes the reporter and stops the live view
while the run continues. Without a callback the loop stops. A disabled
SafeProgressReporter no longer reports itself active, and start() is a
no-op once it is disabled.

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

* docs(tier3): describe the fixed-height Rich progress view

Explain in the Tier 3 guide how the rich progress view keeps its height,
which stages it shows and what happens when drawing fails, note the
fixed-height table in the CLI reference, and add an Unreleased / Fixed
CHANGELOG entry.

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

* fix(tier3): keep running stages running when the progress view stops

When a redraw failed, SafeProgressReporter turned progress off through the
reporter's close(), which reports every running stage as "failed -
interrupted before completion" and redraws. A one-off write error on the
heartbeat thread therefore left a frame saying the running agents had
failed while the run went on, and progress stayed off.

- PlainProgressReporter and RichProgressReporter get close_after_failure(),
  which stops without marking running stages failed. The Rich reporter keeps
  the last frame and prints one line saying the display stopped and the run
  continues. SafeProgressReporter._disable uses it when the reporter has it.
- The heartbeat thread skips a redraw that fails with BlockingIOError or
  InterruptedError (a write that would block on a terminal another process
  made non-blocking) and draws again on the next heartbeat.
- A heartbeat failure while close() is already stopping the reporter no
  longer calls the failure callback.
- Rich progress lines are printed without Rich's number highlighting.

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

* fix(tier3): stop a plan update that races a heartbeat failure

SafeProgressReporter checked its disabled flag before calling the reporter,
but not atomically with the heartbeat thread's _disable(). A plan update
waiting on the reporter lock while a heartbeat redraw failed could pass the
check after the reporter was closed, and then start a new Live on a
disabled wrapper. That frame stayed on screen, with stdout and stderr
redirected through it, until the run's final close().

- start() holds a wrapper lock while the reporter draws the plan, and
  _disable() sets its flags under the same lock. A failure reported from the
  heartbeat thread waits for the plan update and then stops what it drew.
  The reporter is closed outside the lock, because closing joins the
  heartbeat thread.
- Registering the failure callback is now best effort. A caller-supplied
  reporter whose set_failure_callback raises, or whose attribute lookup
  raises, is wrapped as before instead of failing the evaluation.

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

* fix(tier3): print the full run plan above the fixed Rich progress frame

The fixed-height frame cuts each row with an ellipsis. At 80 columns that hid
most of the Run plan row (concurrency, max agents, timeout, matrix trials,
containers, the scaled agent timeout), every agent's model after the first,
and the second Ctrl+C hint, which only appears in a stopping agent's detail.
On main these rows wrapped and stayed visible.

- The Rich reporter prints the Agents / models, Provider and Run plan lines
  in full above the frame whenever one of them changes. They stay in the
  scrollback; the frame keeps its height.
- The stopping detail is now a runner constant that starts with a short hint,
  "Ctrl+C again skips wait", so the row cut at 80 columns still shows it with
  the longest built-in stage label in the frame.
- close() also clears the record of printed plan lines, so the next run
  prints its plan again.

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

* fix(tier3): list every stage in full in the final Rich progress frame

Live is created with transient=False, so its last frame stays in the
scrollback. That frame kept the six-row recent window, so earlier outcomes
dropped out of the record (for example a failed first agent, or a degraded
Docker images stage). Its details were cut with an ellipsis, and a run that
failed before the plan resolved left "pending / resolving" rows behind, as if
work were still in progress.

- close() updates Live with a final table before stopping it. That table
  lists every stage without padding rows, wraps the Detail column in full,
  and shows unresolved Provider and Run plan rows as "- / not resolved".
- After a drawing failure, Live keeps the last frame it drew instead, since
  drawing the final table could fail the same way.

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

* docs(tier3): describe the plan lines, final frame and drawing failures

Align the CHANGELOG entry, the rich view paragraph in
docs/tier3-live-evaluation.mdx and the --progress row in
docs/cli-reference.mdx with the progress fixes: the full plan printed above
the table, the final table listing every stage in full, the Ctrl+C hint
shown first, a blocked heartbeat write skipped, and what a drawing failure
leaves on screen.

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

* fix(tier3): turn progress off when a heartbeat write would block

A heartbeat redraw that failed with BlockingIOError or InterruptedError
was skipped so that the next heartbeat could draw again. Rich does not
drop a refused frame: it keeps it in the heartbeat thread's buffer and
sends it again, from the start, before the next one. A terminal that
refuses writes for a while therefore gets a backlog that grows by one
frame per heartbeat, and once the backlog is larger than one write can
take, it never drains while the reporter stays active.

Treat these errors like any other drawing failure: call the failure
callback, which stops the live view without marking running stages
failed and says that the run continues. The heartbeat thread then ends,
and its buffer with it.

The test drives a real Rich Live on a terminal that refuses heartbeat
writes once or every time, and checks that progress turns off and the
heartbeat thread ends.

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

* fix(tier3): skip the interrupted marks atomically when a failed display stops

close_after_failure() cleared the running stages under the reporter lock,
released it, and then called close(), which takes the lock again and
marks every still-running stage "failed - interrupted before completion".
An agent update that took the lock in between put its stage back, and
that stage was then drawn as failed in the frame Live leaves on screen.

close() and close_after_failure() now share one _close(after_failure=...)
path that decides under the same lock hold whether to mark the running
stages. After a drawing failure nothing is marked, so a late update is
drawn as running.

The test runs the late update from another thread the first time the
stopping thread releases the reporter lock.

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

* fix(tier3): leave columns to spare around the second Ctrl+C hint

At 80 columns, with Agent Runtime Preflight in the stage window, the
Detail cell is 24 characters wide and "Ctrl+C again skips wait" filled it
with no column to spare. At 79 columns, or on a legacy Windows console,
which uses one column less, the hint was already cut.

The stopping detail now starts with "2nd Ctrl+C skips wait", two
characters shorter, so it still shows at 78 columns. The 80-column test
also renders the frame at 78 columns, so a longer hint fails before it
reaches the edge.

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

* fix(tier3): print colon-delimited plan values above the progress frame as is

The Agents / models, Provider and Run plan lines above the Rich progress
frame are printed in full so that values the frame cuts stay readable.
They went through console.print with markup and highlighting off but
emoji replacement on, so a model ID such as "ollama:llama:3.1-8b" was
printed as "ollama", a llama emoji and "3.1-8b". The table cells are Text
objects and were already verbatim.

Print the lines with emoji=False too.

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

* fix(tier3): keep the final progress frame's rows on one line in a narrow terminal

The final Rich frame, which stays in the scrollback, folded its Detail
column so that each detail is shown in full. Stage, State and Elapsed do
not wrap, so in a 60-column terminal they left the Detail column 4
characters wide and every detail folded into a stack of 4-character
pieces: the emulated full run left a 252-line table, against 134 lines
on main.

Rich gives a ratio column whatever width the other columns leave and
ignores its min_width, so the final frame is now drawn at render time:
it wraps its details only when the width it is drawn at leaves the
Detail column at least 20 columns wide, and otherwise keeps each row on
one line as while running. The emulated 60-column run now leaves 35
lines; at 80 columns and wider nothing changes.

The test renders the final frame at 76 columns, where the Detail column
is exactly 20 wide, and at 75 and 60 columns.

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

* docs(changelog): move the progress view entry away from open PRs' insert points

The entry sat at the end of Unreleased > Fixed, where open PRs #367 and
#386 also add their entries, so each of them conflicted with this
branch. It now sits in the middle of the same Fixed list, which no open
PR changes. The text is unchanged.

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

* fix(tier3): show the cursor again when the terminal refused a failed display's stop

A terminal that refuses a heartbeat redraw (a write that would block)
usually refuses the stop that follows a few microseconds later on the
same thread. Rich then loses the queued show-cursor control with that
thread's buffer, the stop notice is skipped, and close() finds no Live
to stop, so the cursor stayed hidden after the run.

close_after_failure() now records when Live's stop or the notice under
the last frame was refused, with the thread it ran on. The run's final
close() then shows the cursor with Console.show_cursor(True) and prints
"...; the run went on without it." A notice that was refused on the
closing thread itself is not printed again: Rich still holds it for
that thread and sends it with the cursor write.

The refused-write test gains a terminal that refuses every thread's
writes until the heartbeat thread has ended, a case that refuses only
the notice, and the cursor and single-notice checks after close(). A
new test covers the same refusals on the caller's thread.

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

* fix(tier3): finish a refused progress stop without replaying its frames

Two gaps in how the run's close() finished a stop the terminal refused
after a drawing failure:

- The heartbeat thread recorded a refused stop, or a refused notice, in
  a second lock hold after the one that stopped Live, and wrote the
  notice outside the lock. A run-end close() that took the lock in
  between found no Live to stop and no record, so the cursor stayed
  hidden, and the record then reached the next run's close(), which
  printed the late notice in a healthy run. The stop, the notice and
  the record now share one lock hold, so close() either stops Live
  itself or finds the record. start() of a new run also drops a record
  left by a run that was never closed.
- close() showed the cursor through the same Rich console, which first
  sent everything that console held for the closing thread from refused
  writes: the refused frame and Live's stop, each led by cursor-up and
  erase-line controls sized to the frame on screen when drawing failed.
  Lines printed since then, such as logged warnings, were erased and
  overwritten. close() now drops that held output first, shows the
  cursor and ends the frame's last line when the stop was refused, and
  prints the late notice whenever the notice did not reach the
  terminal, so a refused notice is no longer sent as the on-time "the
  run continues" line at the end of the run.

Tests: the caller-thread refusal cases now print warnings before close()
and check that close() writes no cursor-up or erase-line control and
ends with the late notice. A new test closes the run from another
thread while the heartbeat thread's refused stop is in progress, and
another starts a reporter again without close() after a refused stop.
The stop-notice check also requires the notice on a line of its own.

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

* fix(tier3): show the cursor when Live's own stop of a refused first frame was refused

Rich's Live.start() stops Live itself when its first frame fails, then
raises. When the terminal refused that stop as well, the write that shows
the cursor again stayed in the caller's Rich buffer. The stop that follows
the drawing failure then had nothing left to do and raised nothing, so the
record said the stop went through, and close() dropped the held write
without showing the cursor.

close() now also shows the cursor when the refused output it drops holds
that write. No frame reached the terminal then, so it ends no line.

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

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
skillevaluator — c66122ec Deployed Nov 10, 2026 by chrisknvidia via skills / paid-tiers (2) #55
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.

2 participants