ruff_python_spo: callee-name residual detail + the drill's proposer stage - #97
Merged
Merged
Conversation
Two pieces of increment 2, both scoped to what could actually be measured this round. 1. non_literal_assign's detail now carries the callee name for a resolvable call (`field(...)` -> "call:field"), falling back to the generic "call" tag when the callee is itself unresolvable (a call, lambda, subscript - never guessed). Measured payoff on dismech: the 451-row "call" bucket from increment 1 decomposes losslessly into three named LinkML schema factories - call:PermissibleValue 355, call:EnumDefinition 91, call:ConfigDict 5 (355+91+5=451, exact) - which is exactly the kind of drill target increment 1's own histogram predicted without being able to name. 2. New drill.rs: the proposer stage. propose() groups a residual ledger by (reason, detail) for the four reasons dense enough to carry one, and thresholds on support. classify_across_corpora() runs propose() over 2+ labeled corpora and splits candidates into Generic (cleared the bar in EVERY supplied corpus) vs CorpusScoped (some but not all) - an exact, falsifiable rule, not a similarity heuristic. Scope boundary, stated in the module doc and here: this builds grouping + classification ONLY. It does not build a promotion gate that re-runs extraction with a candidate row "active" and checks the coverage delta - that needs a config-consuming extractor (a trie the plain arm reads before deciding a site's classification) that does not exist yet. Claiming this stage ratifies rows would overstate what it measures. Measured, min_support=2, three real corpora (dismech / A2UI SDK / ruff/scripts): 18 candidate rows, ZERO generic. This falsifies my own prediction from the increment-1 handoff that some row would prove cross-corpus generic - worth recording plainly rather than quietly dropping. unresolved_annotation/binop comes closest (96 in dismech, 12 in ruff/scripts) but is silent on the A2UI corpus, so by the exact "fires in ALL supplied corpora" rule it stays CorpusScoped. That is the strict rule working as designed, not a bug: three modest corpora is a small n for "generic," and the alternative (a fuzzy magnitude-similarity threshold) would have manufactured a Generic verdict this data does not support. plain_propose new example: runs classify_across_corpora over N labeled corpora and prints candidates as TOML - data, not Rust, per the earlier design note that the proposer must never write code. Falsifier discipline: every new grouping/threshold/classification site verified by a disable run (mutation asserted present, test observed red, restored, full suite green) - the min_support filter, the Generic/ CorpusScoped split, and the callee-name fallback. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AGVLyRZNEKKBSfBDJfbY3V
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_aba29efd-6479-4211-bcf0-90e524105a81) |
AdaWorldAPI
marked this pull request as ready for review
August 18, 2026 05:54
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Aug 18, 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
Increment 2 of the self-adaptive drill loop (#96), scoped to what could actually be measured this round. Two pieces.
1. Callee-name detail on
non_literal_assignx = <call>()residuals used to carry the generic"call"tag. Now, when the callee resolves to a terminal name,detail = "call:<name>"(field(...)→"call:field"); an unresolvable callee (a call whose own callee is a call, a lambda, a subscript — never guessed) keeps the generic"call"tag.Measured payoff on dismech: the 451-row
callbucket from #96's histogram decomposes losslessly into three named LinkML schema factories:355 + 91 + 5 = 451, exact — this is precisely the drill target #96's own histogram predicted without being able to name.2.
drill.rs— the proposer stagepropose(residuals, min_support)groups a ledger by(reason, detail)for the four reasons dense enough to carry one (curie_constant,non_literal_assign,unresolved_annotation,unresolved_base), thresholded on support.classify_across_corpora(labeled, min_support)runsproposeover 2+ labeled corpora and splits each candidate intoGeneric(cleared the bar in every supplied corpus) vsCorpusScoped(some but not all) — an exact rule, not a similarity heuristic.Scope boundary — stated in the module doc, and stated again here so it isn't overclaimed: this builds grouping + classification only. It does not build a promotion gate that re-runs extraction with a candidate row "active" and checks the coverage delta — that needs a config-consuming extractor (a trie the plain arm reads before deciding a site's classification) that doesn't exist yet. That's the next increment, not this one.
Measured — and it falsifies my own prediction
Ran
plain_proposeatmin_support=2over three real corpora (dismech / A2UI SDK / ruff/scripts):I'd predicted in the #96 handoff that some row would prove cross-corpus generic. It didn't — worth recording plainly rather than dropping quietly. The closest candidate,
unresolved_annotation/binop, fires 96× in dismech and 12× in ruff/scripts but is silent on the A2UI corpus — so under the exact "fires in ALL supplied corpora" rule it staysCorpusScoped. That's the strict rule working as designed: three modest corpora is a small n for "generic," and a fuzzy magnitude-similarity threshold would have manufactured aGenericverdict this data doesn't support.curie_constantrows are, as expected, uniformlyCorpusScopedto dismech.Falsifier discipline
Every new grouping/threshold/classification site verified by a disable run — mutation asserted present, test observed red, restored, full suite green: the
min_supportfilter, theGeneric/CorpusScopedsplit (forced everything toGeneric— both cross-corpus tests failed), and the callee-name fallback (both resolved-and-unresolved cases exercised in one fixture).Test plan
cargo test -p ruff_python_spo— 75/75 (70 pre-existing + 5 new)cargo clippy -p ruff_python_spo --all-targets -- -D warnings— cleancargo fmt+RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p ruff_python_spo— clean (one intra-doc link fixed, same de-link pattern as R2IL intake arm: plan, implementation spec, and ruff_r2il crate (PR 1) #94/ruff_python_spo: residual ledger for the plain arm — silent skips become named, addressed rows #96 — never widen visibility to satisfy a lint)uvx prek run --from-ref main --to-ref HEAD— all hooks pass, tree clean afterplain_proposeoutput reproduced over all three corpora, pasted aboveGenerated by Claude Code