Repository navigation
fix(tier3): withhold behavior scores built on cut final answers - #503
Merged
Merged
Conversation
Issue #234 reported that behavior-check evidence dropped grading-relevant text from the middle of a long final answer. PR #259 fixed the false reporting half, so the omission is now recorded, but the judge still scored the shortened evidence and the resulting evidence-loss artifact was graded as a behavior failure. Raise the final-response allowance from 800 to 8,000 characters so an ordinary answer survives, and keep the total behavior budget finite by reconciling it to 12,000 with the existing tool-history headroom. Reserve the user request at the same allowance instead of a fixed 800, ahead of the optional exploration output in the compact tool history. Both SKILL_EVAL_BEHAVIOR_FINAL_RESPONSE_LIMIT and SKILL_EVAL_BEHAVIOR_CHECK_BUDGET still override these. Record completeness beside the existing omission accounting: each behavior evidence section is compared against its complete source, not against another budgeted rendering, so the bundle reports whether the REQUIRED evidence survived rather than only whether something was dropped. The judge gates on it and returns an explicit evaluation error with no behavior score instead of scoring an answer a limit shortened, and refuses a second cut of its own on evidence the accounting already covers. The error reuses the existing judge error path, so a missing behavior score stays missing through declarative check combination, judge-result normalization and the dimension mean rather than becoming a zero. Host and Harbor verifier stay in parity: the template delegates the evidence builder and the new helpers to the shared module and mirrors the judge gate. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
November 13, 2026 12:40
rng1995
commented
Nov 13, 2026
rng1995
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review of the raised behavior-evidence budget, the completeness accounting, and the new judge gate.
9 findings (5 P2, 4 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.
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
added a commit
that referenced
this pull request
Nov 13, 2026
Resolve the CHANGELOG conflict with #503 by putting its entry at the top of Unreleased > Fixed, above the moved #475 entry it merged after. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
added a commit
that referenced
this pull request
Nov 13, 2026
main now carries PR #503 squash-merged as c2f5a02, so both sides added the same behavior-evidence change. Resolved the four source conflicts in favour of this branch, which is that change plus the review fixes; only c2f5a02 touched those files on main, so nothing of it is lost. The CHANGELOG auto-merge left both copies of the entry. Dropped main's original and kept the corrected one in main's position, because correcting that entry — it claimed the env vars still override, and omitted that a gated case has no overall score at all — is one of the review findings. Every released section is byte-identical to main. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
rng1995
added a commit
that referenced
this pull request
Nov 13, 2026
…ing (#511) Follow-ups to the review of PR #503, which merged as c2f5a02 before these landed. The evidence gate voided behavior_check — and with it the case's whole overall score — whenever the final-response limit cut the answer, with no regard for whether the expected behaviors needed that answer. A case whose one expectation is a path the deterministic verified facts already mark OBSERVED lost its score because its summary ran long. The bundle now reports expected_behaviors_verified, and behavior_evidence_gap withholds nothing when every expectation is settled by those facts; an expectation naming nothing checkable still keeps the gate, and an absent flag means "not known", so older and hand-written records keep it too. Giving the USER REQUEST section the whole 8,000-character final-response allowance bought a duplicate: build_conversation_summary already opens the compact tool history with the question. On a 5,006-character prompt the history fell from 6,181 to 1,961 characters and lost every tool call, which is the only place a non-file behavior is observable. Cap it at 2,000, never above the final-response limit. incomplete_sections compared file changes and the tool history against their own per-entry-clipped renderings, so a 4,033-character write whose middle 2,230 characters never reached the judge was reported complete. Both are now rendered with full=True for the comparison, matching the docstring's premise. SKILL_EVAL_BEHAVIOR_CHECK_BUDGET is honoured exactly as set in either direction instead of being silently floored at the final-response limit plus 4,000 — an operator pins it to cap the judge prompt, so raising it past what they asked for defeats the only reason to set it. A value too small to hold the answer beside some tool history is logged as a warning naming both settings. Only the default is still reconciled upwards. Unparseable and non-positive values are not budgets and keep the reconciled default. CHANGELOG and docs now describe what the code does: the raised defaults, the new omitted keys, the user-request cap, and that a gated case has no overall score at all. Tests: the two final_response_limit cases went vacuous when the default rose to 8,000 (a 2,231-character answer fits either way) — re-pointed at a 4,031-character answer so the per-call and env limits discriminate in both directions. Adds coverage for the user-request allowance, for incomplete_sections on the non-required reporting path and on per-entry caps, for the honoured budget and its warning, and for the narrowed gate. Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #234.
PR #259 fixed half of this: the bundle no longer claims
omitted.truncated=falsewhen a long final answer was cut. But it only fixed the reporting. The judge still scored the shortened evidence, so an evidence-loss artifact could still be graded as a behavior failure — which is the half the reporter said mattered: "Raising the limit alone is insufficient."This PR closes the rest.
The final answer now fits.
_DEFAULT_BEHAVIOR_FINAL_RESPONSE_LIMITgoes 800 → 8000, with the total budget reconciled to a still-finite 12000. Both env vars (SKILL_EVAL_BEHAVIOR_FINAL_RESPONSE_LIMIT,SKILL_EVAL_BEHAVIOR_CHECK_BUDGET) keep working. The user request section no longer carries its own hardcoded 800-character cap either, so the request is reserved ahead of optional exploration output rather than competing with it.Completeness is now measured against the complete source, not against another budgeted rendering. The
behavior_checkbundle'somitteddict gainsrequired_complete,required_missingandincomplete_sections, which reach reports through the existing metric-details path.The judge is gated. When required evidence is incomplete,
judge_behavior_checkreturns an evaluation error with no score, before any model call, and also refuses when the judge's own compaction would cut accounted evidence a second time.Verification of the core behaviors
The issue's own reproduction, run against this branch:
truncatedrequired_completeThe withheld score stays
Noneand is not averaged in as zero: with all five other signals at 1.0,overall_score_from_metricsreturnsNonerather than the 0.83 that silently treating it as 0.0 would produce. This reuses the_judge_error→status="error"path from PR #240, which_normalize_required_judge_result,combine_behavior_checkandoverall_score_from_metricsalready fail closed on. Bundles written before this change (norequired_completekey) do not gate, so older artifacts are unaffected.Judgement calls for reviewers
incomplete_sections. Widening or narrowing this is a one-tuple change at_BEHAVIOR_REQUIRED_EVIDENCE, with the rationale in a comment above it.behavior_checkjudge error already flows intoevaluation_status: "failed"andSystemExit(1)in the verifier. That is what the issue asked for — "an explicit evaluation error with no behavior score" — and at an 8,000-character allowance it should be rare, but it is a harder failure mode than before and deserves a deliberate ack before merge.build_behavior_evidencewith nomax_chars. Finite, and necessary to hold the larger answer, but it is a bigger default prompt.test_behavior_bundle_final_answer_split_across_history_and_sectionnow pins the limit to 800 via monkeypatch, because at the 8,000 default the split arithmetic it exercises no longer occurs; it doubles as env-override coverage. Two cap-loss tests moved from 4,028- to 16,028-character answers, and positive counterparts were added asserting the issue's original 4,028-character case now survives intact.Verification
tests/evaluation: 796 passed, 1 skipped.tests/tier3 + tests/reporting + test_llm_judge.py + test_character_facts.py: 14563 passed, 28 failed, 5 skipped, 7 errors. A like-for-like re-run of every failing file against a pristine copy of the same tree produced an identical failure set (diffclean) — zero new failures. 3 of the 28 pass in isolation and match the project's known xdist/load flake pattern; the 7 errors are a pre-existingModuleNotFoundErrorfrom a local Harbor version mismatch.status="error"withscore=None, and aNonebehavior score propagates asNonethrough the overall-score composition rather than as zero.adapter.pystages it into the container; the judge gate is mirrored in the template's own copy, and existing parity tests cover the new code.ruff check src testspassesRelease Impact
CHANGELOG.md🤖 Generated with Claude Code