Skip to content

fix: gate on hunk-level recall, fixed before Stage 3a - #14

Merged
aisona-lab merged 1 commit into
mainfrom
claude/festive-volta-y4wura
Oct 23, 2026
Merged

aisona-lab merged 1 commit into
mainfrom
claude/festive-volta-y4wura

Conversation

@aisona-lab

Copy link
Copy Markdown
Owner

What

The fail-on gate now reads hunk recall instead of rule recall. Hunk recall is the share of in-scope defective hunks that draw at least one finding, under any rule. Rule recall is still printed, but it no longer gates anything.

Why

In run 2 (#13), the reviewer described two labelled defects correctly but under rules other than the label: R2/R13/R16 for an R7 label, and R7/R13 for an R4 label. The rules overlap, so rule recall partly measures which name the reviewer picked rather than whether it saw the defect.

Pre-registration

  • This decision comes after runs 1–2, and it changes neither outcome. Re-scored with this code, hunk recall is 1/15 for run 1 and 3/15 for run 2, both under the 50% floor.
  • It is committed now so that Stage 3a is scored against it, not fitted to it.
  • The amendment is in docs/hardening-plan.md.

Known weakness: a finding about a different problem in the same hunk still counts (1 of 3 in run 2). unlabelled is printed so a human can check.

Proof

env -u ANTHROPIC_API_KEY uv run pytest -q          # 173 passed
env -u ANTHROPIC_API_KEY uv run python scripts/corpus_cli.py prove corpus/seed.jsonl   # OFFLINE_PROVE: PASS
ruff check . && black --check . && mypy src        # clean

New tests:

  • A defect found under a different rule counts toward hunk recall but not rule recall, and the gate reads it.
  • A defect whose labelled rule is outside the preset is excluded from hunk recall.

Generated by Claude Code

A defective hunk counts as caught when it draws at least one finding under
any rule. Run 2 showed the reviewer describing labelled defects under
overlapping rules (R13 for an R4 label, R2/R13/R16 for R7), so rule recall
measured naming as much as detection. Decided after runs 1-2 and changes
neither outcome (1/15, 3/15 < 50%); committed now so Stage 3a is scored
against it. Rule recall stays in the output, ungated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPsqEJ4QYWRW5eCFBYRPS
@aisona-lab
aisona-lab marked this pull request as ready for review October 23, 2026 08:18
@aisona-lab
aisona-lab merged commit be4130a into main Oct 23, 2026
3 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