Repository navigation
fix(python): withhold a module-object write whose test rebinds the module namespace - #10325
Conversation
…dule namespace (#10289) A related test that reloads the module or replaces its names (assignment, setattr, __setattr__, delattr, importlib.reload) reads a different object than the owner mutates. The weak finding it left behind carried a repair card asserting on the stale imported object, so the finding is now a mocked_module static limit (static_unknown, no card), like patch. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtMtd6sDKNAUbvAJ7jzpmt
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…e honesty corpus (#10289) Review repairs: the new limit fires only for a related test that imports the object from the owner's module, since only such a test can read a stale one. The three honesty entries now also require a mocked_module limitation, so reverting the limit fails them; the fixture SPEC text names the static_unknown module-object finding. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtMtd6sDKNAUbvAJ7jzpmt
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the new route uses assigns_attribute(&object), but the diff does not demonstrate broad coverage of related-test discovery and module-object rebinding variants beyond reload, setattr, dunder-setattr, and renamed-delattr.
- Confirm the textual rebinding detector can over- or under-match dynamic namespace operations.
Refuted
- The fix belongs in fixture output or repair-card generation because the defect is stale-object repair guidance.; refuted because: The changed source branch classifies the probe before card creation and uses the shared static-limit mechanism; fixture reblessings are consequences rather than the behavioral fix.
- The patch may remove useful repair evidence without proving the stale-object scenario.; refuted because: The changed fixtures explicitly exercise module rebinding and the production logic withholds only the affected module-object probe as static_unknown, matching the stated acceptance criterion.
Evidence gaps
- The correctness-critical Rust test proof remains unavailable in the packet because ripr failed and cargo-test is scheduled late.
- Model proof intent was rejected by deterministic validation.
- The changed golden outputs encode static_unknown and remove the stale-object repair card, but their execution provenance is not confirmed in the available receipts.
…-9z5l8r # Conflicts: # crates/ripr/src/analysis/language/python/static_limits.rs
|
Review of record for head 4403386 (base 6657a7a).
Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Verification questions
- Confirm the reblessed check.json files no longer include the test file in source_subject, although related_tests still names it.
Refuted
- The any-over-related-tests behavior invalidates independently established live-read credit and is a blocker in this PR.; refuted because: The path is real, but the seeded review traced and explicitly accepted it as conservative missed credit consistent with existing finding-wide mocked_module semantics; changing per-test credit joining is outside this PR.
- The new limit is overbroad because any rebinding test can suppress a finding.; refuted because: The changed branch requires a ModuleField effect, a rebinding of that object, an oracle-using related test, and an import of the object from the owner module. Remaining textual matching and finding-wide any semantics are explicitly bounded in the claim boundary and prior thread.
- The new limit can suppress an independent live-read sibling test without limitation.; refuted because: This real conservative-credit objection was acknowledged and deliberately deferred in the seeded thread; the current diff retains the same any-related-candidate behavior.
- The current patch must preserve observation credit from an independent live-read sibling test.; refuted because: That behavior does not hold under the documented finding-wide static-limit policy, but it only loses advisory credit and was already traced and accepted in the seeded thread.
Evidence gaps
- The central Rust and golden-test proof claims are not confirmed by evidence available to this lane.
- Focused package proof is still required: the ripr sensor failed and cargo-test had only scheduled-late status, so the changed Rust behavior and fixture inventory are not independently proven in this packet.
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- Finding-wide any semantics can withhold independently earned live-read credit when sibling tests exist; this is an acknowledged conservative limitation rather than a new blocker.
- The limit is finding-wide: one rebinding test can suppress credit supplied by a sibling test that observes the object live.
- The finding-wide any() semantics can downgrade an independently live-read sibling test to static_unknown, but this is a documented conservative missed-credit limitation rather than false evidence.
- The route may withhold credit whenever any related oracle test rebinds the object, even if a sibling test observes the live object; the seeded thread explicitly accepts this as conservative missed credit.
|
Merge log line (status.md write was refused, so it goes here): #10325 merged as 9811f0b on expected head 4403386 after the required Generated by Claude Code |
Summary
importlib.reload,setattr,__setattr__,delattr, attribute assignment) now readsstatic_unknownwith amocked_modulestatic limit, likepatchdoes. Before, fix(python): treat reload, __setattr__ and delattr as dynamic namespace writers #10206 left a weak finding whose Python repair card asserted on the stale imported object (assert response.status_code == 400whereresponsestill points at the old object).static_limits.rs, the shared owner of test-side limits. It fires only when the changed line is aModuleFieldeffect and a related oracle-using test both imports that object from the owner's module and assigns its name. Instance-field and module-constant findings are untouched.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: RIPR-SPEC-0028, RIPR-SPEC-0108 (no behavior text changed; the three fixture SPEC.md files now describe the
static_unknownmodule-object finding)ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #10289 (parent #10184)
Acceptance delta (one sentence): a module-object write whose related test reloads or replaces the module namespace no longer yields a weak finding or a repair card that targets the stale imported object.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-9z5l8r
Stack parent or prerequisite PR (if any): none (#10206 merged)
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a
Scope
static_limits.rs(one new limit),module_field_tests.rs, the repair-card inventory (31 → 28), three fixtures re-blessed, three honesty-corpus entries (expected_class→maximum_classplusmust_emit_limitation: mocked_module), changelog fragment.Scope Classification
Production delta: one static limit for module-object writes under a rebinding test.
Single acceptance criterion: the three dynamic-namespace fixtures' module-object finding is
static_unknownwith no card.Non-goals: receiver-aware precision; module-constant cards (their advice is a boundary input, not an assertion on a stale object).
Support-tier Impact
Policy Impact
Proof
cargo test -p ripr --lib python: 1449 passed on the merged head. The reload,__setattr__, renamed-delattr,patch, assignment andsetattrcases pinstatic_unknown; the live-read credit control staysexposed.cargo xtask goldens check: no drift after the bless. Theroute.pyfinding in each fixture isstatic_unknownand hidden; the unchanged constant finding remains weak.evidence_promotionand 33benchmark_semanticxtask tests.maximum_classalone cannot tellstatic_unknownfrom a regression (it only caps severity), so each entry also requires amocked_modulelimitation; reverting the limit fails them.cargo fmt --checkclean.cargo xtask precommitpolicy checks pass; its lint stage exceeded my local time limit, so hosted CI owns it.Claim Boundary
May claim: the module-object write under a rebinding test is withheld, no stale-object card.
Must not claim: every dynamic rebinding is detected. The match is textual and file-level, as in #10206: an unrelated
setattr,varsorlocalsin a test file that imports the object can also withhold the finding, which loses an advisory but never adds credit.Rollback
Revert the commit.
Spec-Test-Code Traceability
module_field_tests.rs,gap_decision_ledger.rsinventory,fixtures/python_dynamic_namespace_*Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
🤖 Generated with Claude Code
https://claude.ai/code/session_01FtMtd6sDKNAUbvAJ7jzpmt