Repository navigation
docs(python): spec, traceability and changelog for self.attr truthiness swaps (#11890) - #11998
Conversation
…ss swaps (#11890) #11931 landed the compound and self.<attr> truthiness-swap demotion with its tests in truthiness_swap.rs only. This adds the RIPR-SPEC-0028 amendment, the traceability rows for its eight tests and the changelog fragment. The issue repro (self.port and ... -> self.port is not None and ...) re-checked on current main reads weakly_exposed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018waZYroArgiNqfVvpNJa8b
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit details
|
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 2f795c3): REVIEW_INCOMPLETE
Inspected:
- Head
2f795c395bdd84ceb9b278f75ec913eacaa104feagainst basec5fa19fd9051f00a9195b37af9c78e5028b6982f; one commit. Three changed files, all non-production:docs/specs/RIPR-SPEC-0028-python-preview-static-facts.md+17/-0,.ripr/traceability.toml+9/-0,changelog.d/11890-python-self-attr-truthiness-swap.md+2/-0. Read via RESTpulls/11998/files(3 files, well under the 300-file truncation floor). Contribution figures: PR-reported additions=28 deletions=0 across 3 files; the true contribution against the current base tip is the same 28 lines across 3 paths, with 0 lines merely inherited from main - so this is nowhere near the admission action's 3000-line / 160-file refusal. - Read the whole spec file at this head (103077 bytes) and
crates/ripr/src/analysis/language/python/truthiness_swap.rsat this head (55629 bytes), so that the new spec text could be checked against the implementation it documents rather than taken on trust. - Ran the content-based duplicate check against the other five PRs in this batch. #11998 is
OVERLAPwith #11996 on exactly two paths -docs/specs/RIPR-SPEC-0028-python-preview-static-facts.mdand.ripr/traceability.toml- with different bytes on both, andDISJOINTon every other pair. These are not duplicates: #11998 is the documentation and traceability follow-up for #11890 (self.attr truthiness swaps) and #11996 is the production fix for #11889 (a deleted line in a guarded arm). Both are needed; the relationship is an ordering constraint, not a survivor question.
Blocking:
- None. The traceability rows are correct and complete, the spec text matches the implementation I could read, and the changelog fragment is well formed.
Non-blocking:
- The body's evidence claim understates the diff: it says "traceability rows for its eight tests" and "the eight tests are bound to RIPR-SPEC-0028", but
.ripr/traceability.tomlgains nine rows (+9/-0). The nine aresplit_boolean_condition_keeps_top_level_and_or_operands,self_attr_compound_truthiness_swap_with_constructor_literals_is_weakly_exposed,self_attr_compound_truthiness_swap_stays_exposed_on_a_falsy_constructor_argument,self_attr_compound_truthiness_swap_stays_exposed_when_the_attr_is_rewritten,compound_truthiness_swap_stays_exposed_when_two_operands_differ,bare_parameter_compound_truthiness_swap_with_unseparated_calls_is_weakly_exposed,self_attr_compound_truthiness_swap_stays_exposed_on_an_unknown_constructor_keyword,self_attr_compound_truthiness_swap_stays_exposed_when_a_required_constructor_arg_is_missingandself_attr_compound_keyword_constructor_literals_are_weakly_exposed. The charitable reading is that the ninth,split_boolean_condition_keeps_top_level_and_or_operands, is a helper unit test rather than a swap test, so "eight" describes the swap tests and the ninth row is an extra. Either way the sentence as written does not describe the diff, and the traceability claim should be countable by a reader. Correcting "eight" to "nine" (or naming the helper test explicitly) costs nothing. - This PR and #11996 anchor on the same place in the same spec file and both end at
## Metrics, so they will conflict textually, and the merge order changes what this heading means. #11998 inserts### Compound andself.operands (#11890)at spec line 1583, immediately after the## Predicate Swap Amendment (2026-10-30, #9186)body; #11996 inserts## Deleted Guarded Line Amendment (2026-10-31, #11889)at the same anchor. If #11998 lands first and #11996 rebases, #11996's##correctly closes #11998's###and both read as intended. If #11996 lands first, #11998's###becomes a subsection of the deleted-guarded-line amendment, which is not what its prose means - it opens "The same closed allow-list also reads", referring back to #9186's allow-list. The deciding criterion for the order is therefore: land #11996 first and rebase #11998 onto it, or re-anchor this section explicitly..ripr/traceability.tomlalso needs the same treatment; both PRs append to it with different content. - The heading level here is a file-local convention, not a rule the gate enforces, and it should not be "fixed" for the wrong reason.
cargo xtask check-spec-formatonly validates the filename, the# RIPR-SPEC-NNNN:title, aStatus:line and the presence of the eight headings inrequired_spec_headings()(xtask/src/main.rs:22690-22701); it says nothing about amendment headings, anddocs/SPEC_FORMAT.mdnever mentions amendments at all. RIPR-SPEC-0028 does carry four prior amendments, all level 2 with a(YYYY-MM-DD, #issue)title (## Helper Inlining Amendment (2026-10-22, #9636),## Predicate Swap Amendment (2026-10-30, #9186)), and this is the file's second###after### Sink alignment visibility. Nesting it under the #9186 amendment is defensible on the prose, and the gate will pass either way - the point is that the consistency is a human call, and that a level-3 heading under the wrong##is the failure mode worth guarding against.
Efficiency:
- Neutral. There is no source change, no analysis path, no process and no data structure touched. The only effect on any gate is that
check-traceabilitynow resolves nine more test identifiers and the spec is nine lines longer; both are constant-factor bookkeeping on files that are already read in full.
Not run:
- The Rust toolchain on this host is not on
PATH, socargo xtask check-traceability,cargo xtask check-spec-format,cargo xtask check-user-textandcargo xtask precommitcould not be run locally. The body's claim that those three checks pass is therefore unverified here. - There is no hosted Rust evidence on this head at all, and that is a structural gap rather than a red lane. This PR carries no
merge-readylabel, and the Rust qualification workflow triggers only onpull_request: types: [labeled]with that label required by its route job, so no Rust lane was ever requested for this head. The head's check-runs contain noRipr Rust Small Result/Rust gates/ci-resultentry at all - the required check is absent rather than red - and every Rust lane present (Rust-only feature lane,rust-coverage,rust-tests-junit,msrv,future-clippy,ci-result,source-identity) reportsskipped. The only completed checks are GitGuardian Security Checks (success) and CodeRabbit (neutral), with the Python wheel lanes unrelated to this diff. The body's "Hosted CI pending" is accurate for that state. Applying themerge-readylabel is what would produce a required-lane verdict at this head. - I did not re-run the issue repro the body describes (
self.port and self.port != 80toself.port is not None and self.port != 80with portsNoneand8080readingweakly_exposed), so the behavioural claim is read, not observed. What I did verify is that the spec's described allow-list matches the code it documents:inline_constructor_arglist(truthiness_swap.rs:574-607) requires exactly one method call whose receiver closes with)and whose class name ends the prefix as a whole identifier, which is what "every strong related call builds the receiver inline" and "a receiver built elsewhere keeps the existing verdict" describe;exact_init_assign(:556-561) requires the literalself.<attr> = <identifier>shape;line_writes_self_attr(:547-554) is the "nothing else in the class writesself.<attr>" check; andbind_init_param(:637-642) refuses an argument list containing#. I also confirmed each of the nine traced test names resolves to afnthat exists at this head. - The boltons instance the body mentions as not re-run end to end was not re-run here either.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 2f795c395bdd84ceb9b278f75ec913eacaa104fe. Not an approval.
…ld-self-attr-swap-residual
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm the changelog's example wording says a falsy value such as self.port = 0 is unused by the test, which could be read as conflating attribute truthiness with constructor-argument falsiness.
Refuted
- The changed surface contains no production implementation or helper changes, so boundary placement and smallest-complete-fix concerns are limited to documentation consistency.
Parked follow-ups
- The changelog example uses an omitted default as a scalar constructor literal but its named values do not exercise that case.
Evidence gaps
- The late cargo-test sensor was scheduled but had no receipt in the supplied evidence.
- Model proof intent was rejected by deterministic validation.
- The late cargo-test receipt is not available in the supplied evidence packet.
|
Review of record, head 9708106 (main 1493232 merged in, no conflicts). Inspected: the full diff (docs/traceability/changelog only, no source change); the semantic owner Findings: none material. Stimulus/oracle are the pre-existing tests being bound; this PR adds no new behavior. Generated by Claude Code |
Requested by Steven · project thread
Governing issue or accepted claim: #11890
Acceptance delta (one sentence): The compound and
self.<attr>truthiness-swap demotion that #11931 landed gains its missing RIPR-SPEC-0028 amendment, traceability rows for its eight tests and a changelog fragment, closing the residual that issue left open.Before / After
Before: #11931 changed only
truthiness_swap.rs; the behavior had no spec text, no traceability rows and no changelog entry.After: the amendment documents the closed allow-list (matching joining operators, exactly one differing operand,
self.<attr>assigned once in__init__and built inline with scalar constructor literals) and its fail-open cases; the eight tests are bound to RIPR-SPEC-0028.Proof
self.port and self.port != 80toself.port is not None and self.port != 80, tests with portsNoneand8080) on a fresh build of current main: it now readsweakly_exposed(it readexposedbefore fix(python): demote self.attr truthiness swaps in compound conditions #11931).cargo xtask check-traceability,check-spec-format,check-user-text: pass. Hosted CI pending.Known limits
setattrand__dict__writes are not read.Generated by Claude Code