Skip to content

feat(cli): full failure count on per-task console lines; preserve param ids - #962

Merged
xdotli merged 3 commits into
mainfrom
feat/failure-count-suffix
Aug 9, 2026
Merged

feat(cli): full failure count on per-task console lines; preserve param ids#962
xdotli merged 3 commits into
mainfrom
feat/failure-count-suffix

Conversation

@xdotli

@xdotli xdotli commented Aug 9, 2026

Copy link
Copy Markdown
Member

Dogfood follow-up to #959: on a real run (skillsbench dialogue-parser, reward 0.667) the CTRF held 2 failed / 4 passed tests, but the console line named only the first failure — a user stopping at the console under-counts what's broken.

What changed

  • Count suffix: when the CTRF reports >1 failed test, the line appends (+N more failure(s); P/T checks passed). Dogfood case, verified against the actual run's ctrf.json:
    ✗ dialogue-parser: reward 0.667 — test_graph_logic failed: Unreachable nodes found: ['End']... (+1 more failure; 4/6 checks passed)
    T counts all entries (skips count against the denominator, not as passes — the least-misleading option; documented at the counting site).
  • Typed truncation seam: new FailureLine(body, suffix) — the body takes the full 100-char budget, the ~40-char suffix deliberately rides past it (reserving budget for the suffix would truncate away the test name itself; consistent with feat(cli): failure reasons from verifier artifacts (CTRF / test-stdout) #959's untruncated pointer precedent, documented at both the constant and the render site).
  • Param ids preserved: benchflow's ::-split now splits only before the first [, fixing a latent mangling of ids containing :: (test_foo[a::b] previously displayed as b]). Investigation finding, verified against the installed plugin source: pytest-json-ctrf itself strips the parametrize id at generation time (nodeid.split('[')[0], as of 0.5.x), so ids are unrecoverable for that producer — no heuristic recovery added; spec-conformant producers now display intact.

Review

Structural review before opening: APPROVE-WITH-MINORS — the FailureLine seam, the rejected-alternative arithmetic, and the revert-kill test matrix (all end-to-end through _report_eval_result) validated; the three minors were docstring/comment accuracy on the truncation contract, all applied. Includes a clean merge of main (#960's mean-reward line renders directly above the failure block; both verified intact).

Gates: ruff format/check, ty; test_cli_live_progress 34 passed; -k "cli" 369 passed.

xdotli added 3 commits August 9, 2026 10:38
…am ids

The per-failed-task console line mined from a verifier CTRF report named
only the first failed test — a run with 2 failed / 4 passed checks read as
a single failure (observed on skillsbench dialogue-parser, reward 0.667).
When the report holds more than one failed test, the line now carries a
compact roll-up suffix: ' (+N more failure(s); P/T checks passed)', counted
from the same test list the first-failure pick uses.

Evidence is now a typed FailureLine(body, suffix) NamedTuple end-to-end:
the 100-char budget truncates only the free-text body, then the suffix is
appended whole, so a long assertion can never swallow the count signal
(worst case ~40 chars past the budget). The stdout-tail tier never sets a
suffix — its pytest summary line already carries the counts.

Test names also keep their parametrize id: the node-id segment split now
only touches the text before the first '[', so names like test_foo[a::b]
no longer collapse to 'b]' and ids survive whenever the report carries
them. (pytest-json-ctrf <= 0.5.3 strips ids at generation time via
nodeid.split('[')[0] — unrecoverable report-side — but other CTRF
producers keep full names.)
- FailureLine docstring states the implemented policy: body gets the full
  line budget, suffix is appended past it (not a reserved-suffix budget).
- _FAILURE_LINE_LIMIT comment notes the deliberate ~40-char overrun for
  suffixed lines.
- Record the T-denominator decision at the counting site (skips count
  against the denominator, not as passes).
- Soften the pytest-json-ctrf version claim to 'as of 0.5.x'.
@xdotli
xdotli temporarily deployed to pypi-internal-preview August 9, 2026 17:48 — with GitHub Actions Inactive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fb8827fda

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

assert "(+" not in out


def test_ctrf_multi_failure_appends_count_suffix(tmp_path):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add guarded-change docstrings to the regression tests

The newly added regression cases beginning here use comments instead of docstrings and do not identify the PR or commit they protect. Add a docstring naming 45a547f or the associated PR to each new regression test so future maintainers can trace why these cases must remain.

AGENTS.md reference: AGENTS.md:L17-L17

Useful? React with 👍 / 👎.

@xdotli
xdotli merged commit e365c11 into main Aug 9, 2026
10 checks passed
@xdotli
xdotli deleted the feat/failure-count-suffix branch August 9, 2026 17:56
@xdotli xdotli mentioned this pull request Aug 9, 2026
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