Skip to content

fix(report): an execution with no scores is the worst one, not the best - #21

Merged
lopadova merged 1 commit into
mainfrom
claude/review-round-1
Aug 25, 2026
Merged

lopadova merged 1 commit into
mainfrom
claude/review-round-1

Conversation

@lopadova

Copy link
Copy Markdown
Contributor

Work item

Branch or work item: claude/review-round-1 — two Codex findings on the merged report-UI work.

Summary

An errored execution (no scores at all) was ranking as the best candidate for a row and hiding the failure, and the precision panel read fields only from the top level while single-run reports nest them under precision.run.

Changes

Files/subsystems changed: resources/js/utils/reportBlocks.ts, resources/js/components/report/PrecisionPanel.tsx, resources/js/i18n/messages.ts, resources/js/components/report/reportPanels.test.tsx.

reportBlocks.ts — unscored ranks last

Picking the best execution per row by mean score returned positive infinity when an execution had no scores. An execution with no scores is an errored one, and it is the most interesting thing that can have happened to a row — ranking it best hid it behind a sibling that happened to score. It now sorts last (Number.NEGATIVE_INFINITY), so the failure is what the reader sees.

This is the same "absent is not zero" shape already handled correctly elsewhere in the same file — applied inconsistently here.

PrecisionPanel.tsx — nested block + three-state resolvability

  • resolution and target_resolvable were read from the top level only, but the report writes both nested under precision.run for a single-run report: the panel silently rendered nothing. It now falls back to the nested block.
  • target_resolvable is read as three-state. Absent means unknown, not "not resolvable" — a missing field was rendering the assertive "target not reachable" copy on reports that never computed it.

UI/UX changes

New text_target_unknown string (en + it): a neutral line when resolvability was not computed, replacing a wrong assertion.

Documentation changes

None — no documented behaviour changes; the panel now renders on report shapes where it previously rendered nothing.

Test gate

  • Local gates run for changed scope
  • Backend/package tests — not applicable, frontend-only change
  • UI tests — 29 vitest tests (26 → 29, three regressions added: nested precision block, unknown resolvability, unscored-execution ranking)
  • tsc --noEmit clean
  • Playwright scenarios — no new user flow; panel copy and ordering only
  • CI checks green for PR — pending on this push
  • GitHub Copilot Code Review requested

Stability impact

  • @api classes/methods/constants changed? No
  • Contract/README updated if needed: not needed — the report contract is unchanged; this reads a field it already emits.

Security / privacy impact

  • Token/secret handling reviewed — untouched
  • Redaction rules preserved — untouched
  • No plaintext secrets in logs/docs/UI

Risk / rollback

  • Risk: Low. Both changes surface information that was previously hidden or misstated.
  • Mitigation: covered by three regression tests pinning the exact shapes.
  • Rollback: revert the merge commit; no data or contract migration involved.

Generated by Claude Code

Two Codex findings on the merged UI work, both real.

- reportBlocks picked the best execution per row by mean score and returned
  positive infinity for an execution with no scores at all. An execution with
  no scores is an *errored* one, and it is the most interesting thing that can
  have happened to a row — ranking it as the best candidate hid it behind a
  sibling that happened to score. It now sorts last (negative infinity), so the
  failure is what the reader sees. This is the same "absent is not zero" shape
  I had already avoided elsewhere in this file, applied inconsistently here.

- PrecisionPanel read `precision.resolution` and `precision.target_resolvable`
  from the top level only, but the report writes both nested under
  `precision.run` for a single-run report; the panel silently rendered nothing.
  It now falls back to the nested block. `target_resolvable` is also read as
  three-state: absent is unknown, not "not resolvable" — a missing field was
  rendering the assertive "target not reachable" copy on reports that never
  computed it. New `text_target_unknown` string in both en and it.

Three regression tests, 26 -> 29. tsc --noEmit clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ4u82zdoa8naYm75kppMC
@lopadova
lopadova merged commit 28f20d8 into main Aug 25, 2026
2 checks passed
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