test: derive sentinel-sweep exclusions from the signature (#938) - #955
Conversation
…mpt#938) Selection was the only rule, so wrote(cur, want) sat outside because its first parameter is not called got. That is the right answer for a cursor and would also have been the answer for a comparison whose first parameter was left. Exclusion is now a positive match on the kind of the left operand, and inputs == selected + excluded fails when a method matches neither rule.
commandprompt#938) The unused-parameter arm walks every def in the corpus. A pass-body probe looked like a helper that ignored got/want/name.
|
pytest-guards failed at Head is |
|
Reviewed at This closes a gap I raised, so to be clear about interest: I have none in this one beyond wanting it right. Your claims, re-derived rather than readRed-first reproduced by deleting The acceptance test is the right shape
And the no-shell-twin call is right. The subject is Residual worth recording: the map can still capture a real comparison silentlyThe exclusion is keyed on the first parameter's name, so a genuine comparison whose left operand happens to be named like an excluded kind is excluded without becoming residue. Verified with your own
I do not think this blocks. The hole went from "every name that is not And I checked the obvious strengthening before suggesting it, because it does not work. "First parameter is an excluded kind but second is
Latent fragility, one line
GateCHANGELOG and TESTS.md are both present, so it carries its docs. I will post a formal approve once the two suites jobs are green — I do not approve into a pending rollup, and I will re-check the head has not moved first. One disclosure, because it nearly made me wrong about youMy first full-corpus run on your branch showed 10 failures in Flagging it in case you see the same thing locally: |
OffgridwithJD
left a comment
There was a problem hiding this comment.
Approving at 0fe198e0 on full green CI (13 of 13), the same head I reviewed and ran everything against.
Summary of the review above, for the merge record:
- Every number in the body re-derived rather than read:
public=18, selected=10, excluded=8, residue=0, and the red-first claim reproduced by deletingcurfrom the map, which reddens both the partition arm (17 == 18) and the residue arm (1 == 0). - The acceptance test is what makes this a mechanism.
test_a_caller_supplied_value_not_named_got_fails_the_partitionproves the discriminating property on a throwawayProbeclass rather than asserting it in a comment or mutating the realExpect. - No shell twin, correctly. The subject is
Expectinpgc_vacuity.py; a shell part inspecting that module is the coupling selftest 350 and 360 were cut down to remove. - Gate on the tree: 13 file-local arms, 315 corpus (main's 312 plus your 3), 217 driver-free, CHANGELOG and TESTS.md both present.
Two things I flagged that are not blockers and should not hold the merge:
- A recorded residual: the map keys on the first parameter's name, so a real comparison whose left operand is named like an excluded kind (
plan_matches(plan, want, name)) is excluded without becoming residue. The hole narrowed from "every name that is notgot" to five specific names, and unknown names now fail loudly, so the direction is fail-closed. I checked the obvious strengthening and it misfires onsqlstate(exc, want, name)andwrote(cur, want, name)—wrotebeing the method #938 is about — so recording it beats reaching for that rule. _params()drops the first parameter asself, andgetmembers(cls, isfunction)returns staticmethods as plain functions. There are none onExpecttoday, verified, so nothing is misread now.
The exclusion is a property of the signature rather than a list of method names, a method matching neither rule goes red instead of into a third bucket, and the case that motivated #938 is now classified for its actual reason. That is the shape the issue asked for.
Both entries kept. The only conflict is prose -- this branch is pytest-only, so it adds no ledger rows and moves no census, which is why landing it after commandprompt#953 and commandprompt#955 costs nothing but this resolution. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EbyGSaU93XYQr8aH4NrUiw
Both entries kept. The only conflict is prose -- this branch is pytest-only, so it adds no ledger rows and moves no census, which is why landing it after commandprompt#953 and commandprompt#955 costs nothing but this resolution. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EbyGSaU93XYQr8aH4NrUiw
Fixes #938.
_comparisons()selected on the first two parameter names, sowrote(cur, want, name)sat outside because its first parameter is not calledgot. That is the right answer for a cursor, and it would also have been the answer for a comparison whose first parameter wasleft.Exclusion is now a positive match on the kind of the left operand (
cur,result,plan,exc,reason), not a list of method names. A new method whose first parameter iscuris excluded for the same reasonwroteis.inputs == selected + excludedfails when a method matches neither rule.Red first on the unfixed tree: 18 public methods, 10 selected, 0 excluded. After the map: 18 == 10 + 8. Dropping
curreddens the partition atinputs 18 == selected 10 + excluded 7.No shell twin. The subject is
Expectinpgc_vacuity.py. A shell part that greps or inspects that module is the coupling selftest 350 and 360 deleted; the behaviour is pinned where it can be observed, intest_failed_query_sentinel.py.Made with Cursor