Skip to content

feat: file-level context (Stage 3a) + corpus run 3 (inconclusive) - #18

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

aisona-lab merged 3 commits into
mainfrom
claude/festive-volta-y4wura

Conversation

@aisona-lab

@aisona-lab aisona-lab commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What

Stage 3a reviews each hunk inside its file. Both earlier corpus runs showed most defects can't be seen from a hunk alone (R13 abstained 41%, R14 78%).

  • --context works on lazycoder (API), packet and check. Each hunk is shown in a window of its post-change file, ±120 lines (CONTEXT_RADIUS).
    • Hunk lines are marked * after their number, and only those can be cited. Validation is unchanged; a test shows that a line visible only as context is rejected.
  • Where the context comes from:
    • Diff: the post-change checkout (--context .). If the checkout doesn't hold the hunk at its lines, the command exits 3.
    • Corpus: corpus/seed.context.jsonl (272 KB), built by corpus_cli.py context with anonymous shallow git fetches. Windows for clean hunks come from the merge commit; defective ones come from its first parent. Every window is checked to contain its hunk byte for byte (37/37), and a test keeps the committed sidecar in sync with seed.jsonl.
  • Context is part of block_id. Answers given without context can't be checked as answers given with it.
  • Without --context, prompts and packets are byte-identical to before, so past runs stay comparable. A test pins this.
  • No label leaks. I checked the packet: no SHAs, no rev, no ^1. The sidecar's rev field does reveal the label; this is documented in corpus/README.md, and the field never reaches the packet.

Run 3: pre-registered, then run

Commit c36da29 fixed the protocol and decision rule before the run: adopt at ≥ 6/15, inconclusive at 4–5/15, reject at ≤ 3/15 or a quiet rate under 80%. The first launch hit a usage limit before any answer was written, and I relaunched the same 8 shards unchanged.

run 2 (hunk only) run 3 (with context)
quiet rate 86% 91%
noise per clean hunk 0.14 0.14
hunk recall (gated) 3/15 5/15
rule recall 0/15 1/15
R13 / R14 abstention 41% / 78% 11% / 62%

Verdict: INCONCLUSIVE. --context stays opt-in and is not made the skill default. The next step is a larger corpus.

Reading the findings by hand, 3 of the 8 labelled fixes were described correctly (run 2: 2). That includes urllib3-5255 under R4, the first time the labelled rule itself fired in three runs. The full write-up is in docs/eval-runs/2026-10-23-agent-mode-corpus-run3-context.txt.

Not in this PR

  • Batching per file.
  • Passing --context from the Action.
  • Making it the skill default (the verdict says not yet).
  • Canaries carry no file context, so in context mode they can be told apart from real hunks. This is a documented limit.

Proof

env -u ANTHROPIC_API_KEY uv run pytest -q          # 211 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

🤖 Generated with Claude Code

https://claude.ai/code/session_01WkPsqEJ4QYWRW5eCFBYRPS

--context on review, packet and check shows each hunk in a window of its
post-change file (120 lines each side), hunk lines marked * and only those
citable. For a diff the window comes from the checkout; for the corpus,
from corpus/seed.context.jsonl, built by corpus_cli.py context from the
merge commit (clean) or its first parent (defective) and validated to hold
every hunk verbatim. Context is part of block_id, so answers given without
it cannot be checked as answers given with it. Without --context every
prompt and packet is byte-identical to before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPsqEJ4QYWRW5eCFBYRPS
Same protocol as run 2 with --context. Adopt context as the skill default
only if hunk recall reaches >= 6/15 with quiet rate >= 80%; 4-5/15 is
inconclusive at n=15; <= 3/15 or quiet < 80% rejects it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPsqEJ4QYWRW5eCFBYRPS
…ered rule

Hunk recall 3/15 -> 5/15, quiet rate 86% -> 91%, noise flat at 0.14 per
clean hunk; R13 abstention 41% -> 11%, R14 78% -> 62%. The rule fixed in
c36da29 calls 4-5/15 inconclusive, so --context stays opt-in and is not
made the skill default; the next step is a larger corpus. By hand, 3 of 8
labelled fixes were described (run 2: 2), including the first
labelled-rule hit in three runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WkPsqEJ4QYWRW5eCFBYRPS
@aisona-lab aisona-lab changed the title feat: file-level context (Stage 3a) + pre-registered corpus run 3 feat: file-level context (Stage 3a) + corpus run 3 (inconclusive) Oct 23, 2026
@aisona-lab
aisona-lab marked this pull request as ready for review October 23, 2026 09:59
@aisona-lab
aisona-lab merged commit ee9156a 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