Repository navigation
fix(tier3): narrow the behavior evidence gate and correct its accounting - #511
Conversation
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]>
rng1995
left a comment
There was a problem hiding this comment.
Review of the #503 follow-ups.
Scope note, stated plainly: this is a lighter review than the one on #507. I had a five-dimension fleet with adversarial verification running and stopped it on request to finish quickly, so what follows is my own single pass over the diff with the two substantive findings reproduced directly against the branch. It is not the verified multi-agent pass, and I would not claim the same coverage for it — in particular I did not systematically mutate the source to check that each of the five changes has a test that fails when it is reverted.
The headline finding is a real hole in the narrowed gate: an expectation that mixes a checkable token with prose is treated as fully settled by the token, so a case keeps a score whose prose half was never verified. That inverts the defect this PR set out to fix.
The budget and user-request arithmetic read correctly to me, and I confirmed the warning path fires with the numbers the docs quote.
…se half Review follow-up on #511. _expected_behaviors_verified settled an expectation whenever every checkable token it named was observed, so one that also asked for something only the final answer could show was settled by the artifact alone: "writes `report.py` and explains why each column was dropped" lifted the gate although the second half was never checked. That inverts the defect #511 set out to fix -- instead of discarding a score the evidence supports, it kept one the evidence does not. Every clause of an expectation must now name a checkable artifact of its own. Clauses are split on the ordinary joiners (and, then, also, plus, as well as, while, before, after, a semicolon, or a sentence break), never on a bare dot, so an artifact path keeps its extension. A clause naming nothing checkable keeps the gate, exactly as a wholly prose expectation already did. The split is deliberately generous: an unrecognized clause shape reads as prose and keeps the gate, which withholds a score. Lifting the gate wrongly keeps a score the evidence does not support, so the two errors are not symmetric and the ambiguous case belongs on the withholding side. Tests cover the pure-artifact, pure-prose, unobserved-artifact and mixed forms across each joiner, plus the end-to-end path through behavior_evidence_gap. Removing the clause check fails five of them. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]>
…513) * fix(tier1): finish the author and metadata.id review round from #499 #499 was squash-merged while this round of review fixes was still in flight, so these arrive separately from the code they correct. Two of them are live defects in main. The author character guard matched all of Unicode category C, which also covers ZWNJ (U+200C) and ZWJ (U+200D). Persian, Arabic and Devanagari names need those joiners to render, so a legitimate name failed SCHEMA.author_format at HIGH under both bundled profiles, as did a soft hyphen and any code point unassigned in the running interpreter's Unicode data -- which made the verdict depend on the interpreter's version rather than on the value, and made the message untrue of what it rejected. The guard now takes Cc/Cs/Co plus an explicit set of bidirectional marks, embeddings, overrides, isolates and the byte-order mark. The bare-email pattern required a dotted domain, so root@buildhost and jane@example took the plain-attribution path and were reported as "Author has no email address" -- plainly false of a value that is nothing but an address, and the opposite verdict from [email protected] for the same shape. The discriminator is now a word character on each side of the @, which keeps a social handle such as Jane Doe (@JDoe), a bare @JDoe and Platform Team @ Example clean, and also catches a non-ASCII local part that the old pattern's successor would have missed. Collection validation already preserved a passing skill's advisories, but carried the findings unchanged, so nothing said which member produced one. merge_advisories_with_prefix names the skill in the finding's location and in metadata.collection_skill, and never touches passed, so an advisory stays advisory. The per-skill roll-up no longer claims every check passed next to a list of that skill's advisories. A catalog-summary.json entry already carried the member verdict and the severity bump from a duplicate metadata.id, but a catalog validates each skill on its own, so nothing in that skill's output said what caused either. The entry now lists them under catalog_findings. Adds the two tests the review asked for with no behaviour change: a well-formed author outside an author_email_regex domain (the shape_ok=True half of that branch, which nothing covered), and the catalog failure dedup guard asserting "2/2 skills failed validation" rather than "3/2" when a skill carries both its own failure and a shared ID. docs/tier1-validation.mdx described neither the narrowed guard nor the report_verdict / report_scope shape #499 shipped; both are now documented. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]> * fix(tier3): keep the behavior gate for an expectation's unchecked prose half Review follow-up on #511. _expected_behaviors_verified settled an expectation whenever every checkable token it named was observed, so one that also asked for something only the final answer could show was settled by the artifact alone: "writes `report.py` and explains why each column was dropped" lifted the gate although the second half was never checked. That inverts the defect #511 set out to fix -- instead of discarding a score the evidence supports, it kept one the evidence does not. Every clause of an expectation must now name a checkable artifact of its own. Clauses are split on the ordinary joiners (and, then, also, plus, as well as, while, before, after, a semicolon, or a sentence break), never on a bare dot, so an artifact path keeps its extension. A clause naming nothing checkable keeps the gate, exactly as a wholly prose expectation already did. The split is deliberately generous: an unrecognized clause shape reads as prose and keeps the gate, which withholds a score. Lifting the gate wrongly keeps a score the evidence does not support, so the two errors are not symmetric and the ambiguous case belongs on the withholding side. Tests cover the pure-artifact, pure-prose, unobserved-artifact and mixed forms across each joiner, plus the end-to-end path through behavior_evidence_gap. Removing the clause check fails five of them. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]>
Follow-ups to the review of #503, which was squash-merged as
c2f5a020before these fixes landed. The code they correct is already onmain; this PR carries only what the review asked for.The gate was discarding scores the evidence supported
behavior_evidence_gapvoidedbehavior_check— and with it the case's entire overall score — whenever the final-response limit cut the answer, regardless of whether the expected behaviours needed that answer at all. A case whose single expectation is a path the deterministic verified facts already markOBSERVEDlost its score because its summary ran long.The bundle now reports
expected_behaviors_verified, and the gate 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.The user-request allowance was buying a duplicate
Giving the
USER REQUESTsection the whole 8,000-character final-response allowance duplicated the question, sincebuild_conversation_summaryalready opens the compact tool history with it. On a 5,006-character prompt the history fell from 6,181 to 1,961 characters and lost every tool call — the only place a non-file behaviour is observable. It is now capped at 2,000 and never above the final-response limit.incomplete_sectionswas reporting truncated sections as completeFile changes and tool history were compared 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=Truefor the comparison, matching the docstring's premise.The configured budget is now honoured
SKILL_EVAL_BEHAVIOR_CHECK_BUDGETwas silently floored at the final-response limit plus 4,000. An operator pins that value to cap the judge prompt, so raising it past what they asked for defeats the only reason to set it. It is now honoured exactly as set in either direction; 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, and unparseable or non-positive values are not budgets, so they keep the reconciled default.Docs, CHANGELOG and tests
The 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 rather than a reduced one.
Two
final_response_limittests went vacuous when the default rose to 8,000, since a 2,231-character answer fits either way; they are re-pointed at a 4,031-character answer so the per-call and env limits discriminate in both directions. New coverage for the user-request allowance, forincomplete_sectionson the non-required reporting path and on per-entry caps, for the honoured budget and its warning, and for the narrowed gate.🤖 Generated with Claude Code