Skip to content

fix(python): a recorded public or module container needs a test that reads it (#16010) - #16563

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-wsi85f
Nov 30, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-wsi85f

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • fix(python): a recorded private container needs a test that reads it (#16010) #16107 handled self._name.append(..). The same edit on a public attribute (self.seen.append(n + 1)) or on a module-level name in a top-level function (LOG.append(n + 1), _REGISTRY.add(..)) still read exposed when the only strong test pinned the owner's own return value. Both shapes now go through the same reader gate and read weakly_exposed, naming the functions that read the container.
  • Code outside the file can read a public attribute or a module name, so these shapes need extra evidence first. The gate fails open, keeping the existing verdict, when:
    • another production file imports the module, a name from it, or *;
    • any test, related or not, names the container or a reader, or imports the module, the container, a reader or *;
    • a conftest that declares a fixture or hook sits above any test;
    • module-level code names the owner or a reader (registration decorators, import-time calls);
    • a method of the class hands self on;
    • the file is a package __init__;
    • a related test uses a name it imports from any module other than the owner's, pytest or unittest (a helper module, or production code reaching the module through sys.modules);
    • any test imports from a module under a test directory;
    • another production file's plain import names a parent package of the owner's module (import src);
    • a module name is not seeded exactly once by an unindented fresh empty collection.
  • globals joins the dynamic-access spellings. The private self._name path is unchanged apart from that spelling.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Spec: RIPR-SPEC-0238 (Python oracle and reach rules)
Governing issue or accepted claim: #16010 (remainder after #16107)
Acceptance delta (one sentence): a public or module-level recorded container whose only test pins the owner result no longer earns exposed credit when nothing outside the file can read it.

Candidate Relationships

Candidate branch: claude/project-thread-wsi85f
Stack parent or prerequisite PR: #16107 (merged).
Proposed replacement of PR: none.

Scope

  • Python classifier gate for public self containers and module-level containers mutated in place.

Scope Classification

  • One production behavior

Production delta:

  • crates/ripr/src/analysis/language/python/self_container_reader.rs (generalized to a Recorded container kind, with wide_container_is_unobserved for public and module names) and its call in python/classify.rs, which now passes all_tests and a ChangedRecord.

Evidence/support delta:

  • Four new adapter tests in self_container_reader_tests.rs. The old "public keeps the verdict" control moved into the new positive test.
  • Fixtures python_public_container_record_unread_no_exposed_credit and python_module_container_record_unread_no_exposed_credit, with goldens and honesty corpus cases.
  • SPEC-0238 text, changelog and traceability.
  • Inventory pin in gap_decision_ledger.rs moves from 36 to 38 direct-aligned cards.

Single acceptance criterion:

  • Both fixtures read weakly_exposed and name the readers. Every hidden-read control keeps exposed.

Non-goals:

  • A method of a class recording into a module name, and nested-function owners, keep the existing verdict.
  • A reader reached through importlib or a file RIPR did not read is not seen.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo fmt --check                                   # 6294fe8e: ok
cargo clippy -p ripr --all-targets -- -D warnings   # 6294fe8e: exit 0 (run directly; precommit selected no lint subjects)
cargo xtask goldens check                           # clean tree: 0 drift
cargo xtask check-evidence-promotion-honesty        # pass, both new cases at expected class
cargo xtask verdict-corpus check-all                # 4 corpora checked
cargo xtask check-spec-format                       # pass
cargo xtask precommit                               # 6294fe8e: exit 0

Results, failures and skipped proof:

  • Lab repos with the debug binary.
    • Positive cases read weakly_exposed: public self.seen (chained and local receiver), module LOG, and module _REGISTRY.
    • 22 controls keep exposed: a test reading the attribute or LOG; another test calling a reader; another production file importing the module; an import-time call; a conftest fixture (autouse and plain); a test importing LOG or the module; a method returning self; the owner calling a reader; a module re-seed; an aliased seed.
    • With wide_container_is_unobserved disabled, 8 of those controls flip to weakly_exposed, so those checks carry the verdict.
  • Four shapes were already weakly_exposed on main through the bound-receiver alignment path, so this PR does not move them: a receiver from a factory, a classmethod or a dict, and a test-file subclass.
  • Review 6101677539 found three false-gap shapes (test helper module, import src, sys.modules). 6294fe8 repairs them; all six reproductions keep exposed and are now adapter test cases.
  • Real-commit replay (rerun on 6294fe8): 78 commits from attrs, boltons, click, jinja, peewee, rich, sqlparse, tomlkit and tornado that rewrite a container mutation, 1,443 findings. The main and candidate binaries agree on every verdict.
  • Not established locally: the four new unit tests compile (cargo clippy --all-targets) but have not executed, because the ripr lib test binary does not link in this container. Hosted CI is their first run, and they will be confirmed by name in the shard logs.

Claim Boundary

May claim: a public self container or a module-level container recorded into, with no reader outside the file and no test naming it or a reader, needs a test that reads it for exposed. Must not claim: mutation outcomes, or reads through files RIPR did not read.

Rollback

Revert the squash commit. The gate is additive and only downgrades exposed to weakly_exposed.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0238
  • Tests: self_container_reader_tests.rs, both new fixtures
  • Code: python/self_container_reader.rs, python/classify.rs
  • Golden outputs: fixture expected/
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.

https://claude.ai/code/session_01SvmPmphDz9csy269eJ23Wo


Generated by Claude Code

…reads it (#16010)

#16107 covered a rewritten `self._name.append(..)`. The same edit on a
public attribute (`self.seen.append(n + 1)`) or on a module-level name in a
top-level function (`LOG.append(n + 1)`) still read `exposed` from a test
that only pins the owner's own result.

Both shapes now go through the same reader gate. Code outside the file can
read a public attribute or a module name, so the gate reports the gap only
when nothing outside the file can be shown to read it:

- no other production file imports the module, a name from it, or `*`;
- no test anywhere, related or not, names the container or a reader, or
  imports the module, the container, a reader or `*`;
- no conftest that declares a fixture or hook sits above any test;
- no module-level code names the owner or a reader (registration
  decorators, import-time calls);
- no method of the class hands `self` on, and the file is not a package
  `__init__`.

A module name must also be seeded once at module level by a fresh empty
collection and named nowhere else outside a function. `globals` joins the
dynamic-access spellings. Any condition that fails keeps the existing
verdict.

Adds four adapter tests, the fixtures
`python_public_container_record_unread_no_exposed_credit` and
`python_module_container_record_unread_no_exposed_credit` with honesty
cases, SPEC-0238 text, changelog and traceability. The repair-card
inventory pin moves to 38 direct-aligned cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmphDz9csy269eJ23Wo
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 137 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 03ab5a93-644a-4632-9e1c-ab51814c4e65
Commits

Reviewing files that changed from the base of the PR and between 97ac119 and b52347c.

Files selected for processing: 27

  • .ripr/traceability.d/16010-python-public-module-container.toml
  • changelog.d/16010-python-public-module-container.md
  • crates/ripr/src/analysis/language/python/classify.rs
  • crates/ripr/src/analysis/language/python/self_container_reader.rs
  • crates/ripr/src/analysis/language/python/self_container_reader_tests.rs
  • crates/ripr/src/output/gap_decision_ledger.rs
  • docs/specs/RIPR-SPEC-0238-python-oracle-and-reach-rules.md
  • fixtures/evidence-promotion-honesty-corpus/cases/16010-python-module-container-record-unread.json
  • fixtures/evidence-promotion-honesty-corpus/cases/16010-python-public-container-record-unread.json
  • fixtures/python_module_container_record_unread_no_exposed_credit/SPEC.md
  • fixtures/python_module_container_record_unread_no_exposed_credit/diff.patch
  • fixtures/python_module_container_record_unread_no_exposed_credit/expected/CHANGELOG.md
  • fixtures/python_module_container_record_unread_no_exposed_credit/expected/check.json
  • fixtures/python_module_container_record_unread_no_exposed_credit/expected/human-full.txt
  • fixtures/python_module_container_record_unread_no_exposed_credit/expected/human.txt
  • fixtures/python_module_container_record_unread_no_exposed_credit/input/ripr.toml
  • fixtures/python_module_container_record_unread_no_exposed_credit/input/src/lib.py
  • fixtures/python_module_container_record_unread_no_exposed_credit/input/tests/test_lib.py
  • fixtures/python_public_container_record_unread_no_exposed_credit/SPEC.md
  • fixtures/python_public_container_record_unread_no_exposed_credit/diff.patch
  • fixtures/python_public_container_record_unread_no_exposed_credit/expected/CHANGELOG.md
  • fixtures/python_public_container_record_unread_no_exposed_credit/expected/check.json
  • fixtures/python_public_container_record_unread_no_exposed_credit/expected/human-full.txt
  • fixtures/python_public_container_record_unread_no_exposed_credit/expected/human.txt
  • fixtures/python_public_container_record_unread_no_exposed_credit/input/ripr.toml
  • fixtures/python_public_container_record_unread_no_exposed_credit/input/src/lib.py
  • fixtures/python_public_container_record_unread_no_exposed_credit/input/tests/test_lib.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review of ec8be81. No marker on this head: three shapes report the gap while a passing test reads the container.

Method: built ripr at this head and ran ripr check --base HEAD~1 --committed --format json on two-commit repositories whose only change is append(n) to append(n + 1), with the two new fixtures' src/lib.py (the total function removed). Every test below passes under pytest and fails if the recorded value is wrong. "Gap" means the finding is weakly_exposed and carries no related test reads ... or calls a function that reads it.

1. A test-support module that is not a test file reads the container (module name). Gap reported.

# tests/helpers.py
from src.lib import LOG

def recorded():
    return list(LOG)

# tests/test_lib.py
from src.lib import tick
from tests.helpers import recorded

def test_tick():
    assert tick(1, 2) == 3
    assert recorded() == [3]

tests/helpers.py has no test, so it is not in all_tests, and its import is not among the owners imports that wide_container_is_unobserved reads. The test's own imports name neither the module nor the container.

2. The same through a public attribute. Gap reported.

# tests/helpers.py
from src.lib import Clock
CLOCK = Clock(1)

def recorded():
    return list(CLOCK.seen)

# tests/test_lib.py
from src.lib import Clock
from tests.helpers import recorded, CLOCK

def test_tick():
    assert Clock(1).tick(2) == 3
    assert CLOCK.tick(2) == 3
    assert recorded() == [3]

3. Another production file reaches the module without importing it by name. Gap reported for both.

# src/extra.py
import src
def recorded():
    return list(src.lib.LOG)
# src/extra.py
import sys
def recorded():
    return list(sys.modules["src.lib"].LOG)

with the test calling tick(1, 2) and then assert recorded() == [3]. The first is the more ordinary one: names_module compares the last segment of the import, and import src has none that equals the stem.

What the three share: the related test calls a function the gate cannot place. For self._name the stated assumption is that only the file reads it. For a wide container the module comment says importers can read it, so a call in a related test to a name that is neither a builtin, nor an assertion, nor defined in the owner's file is a possible reader. Declining on that (or on any import in the test file from a module other than the owner's) closes 1, 2 and 3 together without a list of import spellings. Reading helper files' imports would close 1 and 2 only.

Shapes tried that held (verdict stays exposed, or the gate declines): a plain local handed to a function; a test that names the container; a helper in the test file with a function-local import; import src in the test with src.lib.dump(). Tuple unpacking, a walrus binding, a chained assignment, a module-level instance in the test file and a test-file subclass are all weakly_exposed with strong_oracle_observes_different_sink and no gap text, so this gate is not what speaks there; I did not look at whether that older verdict is right.

Controls: both fixtures' own tests give the gap; adding assert c.seen == [3] gives exposed.

Not reviewed: hosted results, the fixture goldens beyond the two inputs, the ledger change in output/gap_decision_ledger.rs.


Generated by Claude Code

…ough another module (#16010)

Review of #16563 found three shapes where the public or module container
gate reported the gap although a passing test reads the container:

- a helper module beside the tests (tests/helpers.py) imports the
  container or an instance and the related test calls its function;
- another production module reaches the owner's module through a plain
  package import (import src; src.lib.LOG);
- another production module reaches it by string (sys.modules[...]) and
  the related test calls that function.

For a public or module container the gate now also declines when a related
test uses any name it imports from a module other than the owner's, pytest
or unittest; when any test imports from a module under a test directory;
and when another production file's plain import names a parent package of
the owner's module. The module-level registration check moves to the
caller so the helper keeps a short argument list. Adds the reproductions as
adapter test cases and updates SPEC-0238, the module doc and the changelog.

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

Copy link
Copy Markdown
Member Author

Re review 6101677539: all three shapes were real, and 6294fe8 repairs them. For a public or module container, the gate now also declines when:

  • a related test uses any name it imports from a module other than the owner's, pytest or unittest. This closes the helper-module and sys.modules cases.
  • any test imports from a module under a test directory.
  • another production file's plain import names a parent package of the owner's module (import src).

The six reproductions (both helper-module variants, import src, sys.modules, an unrelated test using the helper, and a bare from helpers import) read exposed on the built head and are now cases in module_container_hidden_reads_keep_the_oracle_verdict and public_attribute_hidden_reads_keep_the_oracle_verdict. The fixtures still read weakly_exposed, and the replay of 78 real commits moves no verdict.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

Independent source review of 6294fe8, by a session that did not write it. It follows my findings record 6101677539 on ec8be81.

Scope: self_container_reader.rs at this head in full for ec8be81, plus the delta from ec8be81 to this head (the three added conditions for a public or module container, module_forms, the moved module-code check). Built ripr at this head and ran ripr check --base HEAD~1 --committed --format json on two-commit repositories. Every test in them succeeds under pytest. Not part of this record: hosted results, the lib unit tests (they do not link in my container), fixture goldens, the ledger change.

The three shapes from 6101677539 now read exposed: a tests/helpers.py reader for the module name, the same for a public attribute, and another production file reaching the module through import src or sys.modules.

Second round, all exposed with no gap text:

  • a helper in the test file that calls a helper imported from another production file;
  • import src.extra used as src.extra.recorded();
  • another production file whose reader imports the container inside the function;
  • a module-level instance in the test file read by a test-file helper, by a test-file subclass, by tearDown, by teardown_function, and by a decorator around the test;
  • teardown_function reading the module container through a function-local import, and through a helper from another production file;
  • a second test in the file reading it through sys.modules or a function-local import src.lib.

Controls: the two fixtures' own shape still gives the gap for both kinds; a test that names the container gives exposed; an unrelated helper and test added to the test file leave the gap in place, so the gate is still reachable with other functions in the file.

Read, not run: module_forms takes every path suffix, so a shorter import root (pkg.lib for src/pkg/lib.py) counts as the owner's module; the foreign-name condition looks at related oracle tests only and at names the body mentions, which the test-directory and module-import conditions over all tests back up.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 29, 2026 07:20
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions

Copy link
Copy Markdown
Contributor

merge-ready was requested, but this PR conflicts with main (head 6294fe8e), so GitHub creates no test-merge ref and no qualification run can start.

  1. Merge main into the branch and resolve the conflicts.
  2. Remove and re-apply merge-ready to request admission and qualification only.
  3. After qualification is green, enqueue the PR through the native queue route; re-applying the label does not enqueue it.

…-wsi85f

# Conflicts:
#	crates/ripr/src/output/gap_decision_ledger.rs

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

Independent source review of 1fc4f42, by a session that did not write it. This head is the merge of 6294fe8 (my record 6101885613) with main at 4fba199.

Checked on the merge:

  • The PR's change against main at this head equals its change against the old merge base at 6294fe8, added and removed line for added and removed line, with one difference: the corpus pin in output/gap_decision_ledger.rs goes from main's (37, 37, 51, 2) to (39, 37, 51, 2), where it went from (36, ...) to (38, ...) before. Main's #15970 added one direct-aligned card and this PR adds two, so 39 is the sum. Both comments are kept.
  • Main also moved classify.rs (the guarded-arm gap now covers the side-effect and error-path families), which is the family a recorded append belongs to. Built ripr at this head and reran all twenty of my cases on the combined tree: the fixture shapes and the unrelated-helper control give the gap, and every reproduction from both rounds reads exposed, the same as on 6294fe8.

Not part of this record: hosted results on this head, the lib unit tests including the pin test itself (they do not link in my container), fixture goldens.


Generated by Claude Code

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 8 potential issues.

Devin Review

Fail open when the owner reaches a call into another module (a lazy
import there may read the container), when a def header default or a
module-level instance names the owner, class or a reader, when either
recorded argument divides or subscripts, and when the old side iterates
its argument. Test-helper imports now match a tests/test segment or a
directory that holds a test, not the first component of any test path,
so a test inside the production package no longer vetoes the gate.

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review note for 1fc4f428a5b852fba539280d105f178ae9e53e56: the current head is not merge-ready even if the hosted qualification Result goes green.

I checked the automated findings against the implementation rather than treating green CI as clearance. The five bug findings have concrete source-level bases:

  • collect_imports_from_statements(file, &module.body) only records module-level imports, while wide_container_is_unobserved relies on other.imports; function-local production imports can therefore be missed.
  • the iterator-consumption guard is conditional on consumes_argument(new_line, ...), so an extend(..) -> append(..) edit never applies the guard to the removed consuming call.
  • module_code_names_them only considers lines outside every function, while default-argument expressions execute at import time.
  • test_roots is built from the first path component rather than the actual test directory, so nested/colocated layouts can misclassify helper imports.
  • has_inert_argument permits division and other potentially raising operators because it only excludes calls, :=, await and yield.

The two test-oracle flags also look material: the parent-package control is masked by the foreign-use veto, and the sibling-reader control calls dump without importing it. Those controls cannot currently discriminate removal of the behavior they purport to pin.

I am not marking this REVIEW_READY; these need repair or a source-backed refutation before merge convergence. Green qualification is necessary evidence here, not sufficient landing authorization.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review of 3b90320. No marker on this head: one shape still reports the gap while the test's pinned result is the container.

Built ripr at this head. My earlier cases keep their verdicts (fixture shapes and the unrelated-helper control give the gap; the helper-module, import src, lazy-import and named-container cases read exposed).

The owner returns what a parameter it calls returns. Gap reported (weakly_exposed, no related test reads LOG or calls a function that reads it); the test succeeds under pytest and stops succeeding if the recorded value is wrong.

# src/lib.py
LOG = []

def tick(hours, n, sink):
    LOG.append(n + 1)        # the change: was LOG.append(n)
    return sink()

# tests/test_lib.py
from src.lib import tick

def snapshot():
    from src.lib import LOG
    return list(LOG)

def test_tick():
    assert tick(1, 2, snapshot) == [3]

The new call-out condition looks for import statements and imported names in the functions the owner reaches. A callable handed in as an argument is neither, so the owner's result can carry the container without the owner naming it twice. The test passes snapshot uncalled, which is not a local binding and not a helper call in the test body, and the import of LOG sits inside the helper, so none of the test-side conditions sees it.

The condition that would cover it sits on the owner, not on the test: for a public or module container, an owner that calls one of its own parameters (or a method on one) can return state the gate cannot list. The same owner with int passed as sink also reports the gap today, and that case would go quiet under such a rule, which matches how the other owner-side conditions already trade.

Not looked at on this head beyond the delta to self_container_reader.rs and the cases above: the new unit tests' results (the lib test binary does not link in my container), hosted results, the seven Devin repairs one by one.


Generated by Claude Code

A callable or object the caller passes in (return sink()) can return the
container, so for a public or module container the gate keeps the
existing verdict when any function the owner reaches calls, indexes or
reads an attribute of a non-self parameter.

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

Copy link
Copy Markdown
Member Author

Review 6102125110 (owner returns a parameter it calls): repaired in 342290a. For a public or module container, the gate now keeps the existing verdict when any function the owner reaches calls, indexes or reads an attribute of a parameter other than self/cls. Your reproduction is the new owner-calls-parameter case in module_container_hidden_reads_keep_the_oracle_verdict. In the lab it reads exposed on 342290a, and all 46 earlier lab cases keep their verdicts, positives included. clippy -p ripr, goldens and precommit pass locally.


Generated by Claude Code

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Coordination note (evidence-only reviewer): this branch is now conflicted with main (mergeable=CONFLICTING at sweep time; main is at 5ba252eede). Any review markers on this PR were scoped to their exact heads and stay valid only as evidence for those trees. A rebase/restack restarts review: push the rebased head (my push watch picks it up) and the native-Windows evidence lane will re-run at the new head before a fresh marker posts. No action needed from me in the meantime; no defect is asserted — this is a landing-order state, not a code finding.

Inventory pin: main's 38 direct cards plus this PR's two fixtures = 40.

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

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY for head b52347c

Independent native-Windows review of fix(python): a recorded public or module container needs a test that reads it (#16010) (PR #16563) at b52347c (merge of current main into the branch).

Source review (verified against source)

Delta (PR vs merge-base 5ba252e: 29 files, +1803/−129): language/python/self_container_reader.rs + its _tests.rs, the language/python/classify.rs hook, the output/gap_decision_ledger.rs expectation, two evidence-promotion corpus cards, two full fixture workspaces, spec doc, traceability card, changelog. (Main has since relocated these modules out of analysis/classify/; the delta shape is unchanged from the prior reviewed head.)

  • The reader gate generalizes from private self._name containers to public and module-level NAME.append(..) records, so a rewritten module container is likewise observed only by a test that reads the container or calls a reader of it — closing the gap where a module-level record could be rewritten with no observing test and still no gap surfaced.

  • The hook passes a ChangedRecord struct (text, old text, line) and all_tests instead of just the current line: reader listing can look across the test surface rather than only same-file tests, which is what makes the module-container case decidable at all.

  • The fail posture is preserved and stated: "shapes whose readers cannot all be listed fail open" — an undecidable record keeps the old (more permissive) behavior rather than inventing a gap claim, matching the repo's unknown-is-valid rule.

  • A reader that calls, indexes, or attribute-reads a parameter (excluding self/cls) fails open via uses_as_object — name(..), name.x, name[..] runs caller-chosen code, so crediting it as a container read would fabricate an observer. Word-boundary checks (sinking does not match sink; nothing after .) keep the match honest.

  • The ledger expectation moves with a comment naming the new corpus card — explained drift, not silent re-blessing; the two new corpus cards pin both the public and module variants as no-exposed-credit controls.

  • The two added proptest-regressions files copy seeds to post-relocation paths, matching the seed-carry contract the batches require.

  • Native proof (native Windows, worktree wt-16563 at head b52347c): cargo test -p ripr --lib language::python (exit 0); cargo test -p ripr --lib gap_decision_ledger (exit 0); cargo xtask goldens check (exit 0 apart from the known pre-existing python_parent_collected_test_shadow native-Windows fixture drift); cargo xtask check-evidence-promotion-honesty (exit 0).

Scope and non-goals

  • Reviewed and proven at this head only; a later push restarts review. Re-reviewed at b52347c after the main merge; conclusions carried from 342290a and re-verified against the relocated paths.
  • Part of the #16010 recorded-container family with #16107 (private container) — same gate, wider record shapes.
  • Merge mechanics belong to the writer; this review is evidence only.

Copy link
Copy Markdown
Member Author

Author note on review 6105064035 (REVIEW_READY on b52347c). Its delta description differs from this head in two places. git diff --stat origin/main...b52347c9 shows 27 files (+1789/−129) and no proptest-regressions files. The module paths are still analysis/language/python/. The load-bearing evidence matches this head: the native cargo test -p ripr --lib language::python and gap_decision_ledger runs (exit 0), and the base-copy admission script exits 0 for this head. I requested qualification with merge-ready. The hosted shard logs still have to show the new self_container_reader_tests by name before enqueue.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 60cf7e8 Nov 30, 2026
20 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-wsi85f branch November 30, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants