Skip to content

fix(python): require a crediting assertion for empty-token owners (#7526) - #7561

Merged
EffortlessSteven merged 9 commits into
mainfrom
fix/7526-python-module-credit
Oct 13, 2026
Merged

EffortlessSteven merged 9 commits into
mainfrom
fix/7526-python-module-credit

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

A strong assertion on unrelated y can currently report an empty-token Python owner as exposed, even when changing that owner leaves the test passing. This removes the legacy observation shortcut and lets the existing assertion-level credit branches decide. A real assert f() == 1 retains exposure credit.

Closes #7526.

Scope and authority

  • One production behavior: empty sink tokens alone confer no observation credit.
  • Remove both the module_owner_no_sink_token observing exception and its early return. Direct, alias, bound-method and effect credit remain with their existing owners.
  • Amend the previous normative exception in RIPR-SPEC-0238 and clarify output narration. No schema, identity, relation-scanner or repair-validator redesign.
  • Four independently authored regressions, three new fixture/golden sets and three literal honesty-corpus controls. Existing golden and honesty rows are unchanged.
  • Three literal fixture project-marker registrations in policy/dependency_allowlist.txt, using the existing fixture_input kind and analysis-fixtures owner.
  • Changelog: changelog.d/7526-python-empty-token-observation.md, canonical <!-- section: Fixed --> marker.

Acceptance and observed transitions

Genuine public input Accepted baseline Repaired candidate Runtime control
Discarded f(), unrelated exact assertion exposed / unknown weakly_exposed / orthogonal mutant survives
Valid chained comparison containing lexical <module>(, unrelated exact assertion exposed / unknown weakly_exposed / orthogonal mutant survives
Exact assertion on f() output exposed / unknown exposed / direct mutant rejected
Ordinary module import, unrelated or real assignment assertion conservative conservative unrelated survives; real assertion rejects
Direct, alias, bound-method, effect positives exposed exposed all four mutants rejected

The ordinary module-import premise was refuted: its heuristic relation already withholds strong credit. The public defect is nevertheless confirmed through the two routes above. The lexical comparison route is retained as a negative input; this PR repairs observation credit rather than the relation scanner.

Proof

Exact candidate: ec8daf7632f265476da19aa5bd7d0186df4d3b28; accepted baseline: 90510045c667a465794a76e76d48adb1558b4e2d.

  • Independent genuine Git/Python runtime proof: nine current tests pass; three mutants survive and six are rejected.
  • Unchanged independent public CLI replay: baseline has exactly two false-credit failures; repaired G1 has nine passing cases, 18/18 native CLI commands successful.
  • Independently authored tests-only commit: native test failure, one passing conservative control and three intended semantic failures. Repaired four controls and all 510 Python unit tests pass.
  • cargo xtask goldens check: pass, zero existing drift. Three new goldens only.
  • cargo xtask check-evidence-promotion-honesty: pass at candidate H2.
  • cargo xtask check-fast: pass at H2, 15 gates, no skips; independently checked its actual 569-path selector.
  • Current combined source 381205dda476dca06cc7ff043a3405395115035c (main 6da363f9… plus H2): cargo xtask verdict-corpus check --language python passes, 63 cases, five known false verdicts and zero contradictions. Upstream eval(verdict-corpus): Python spec-example ledger and RIPR-SPEC-0238 example 34 #7546/eval(verdict-corpus): rebless the Python corpus after #6750 #7547 data stays separately attributed.
  • cargo xtask check-dependencies, full cargo xtask precommit and cargo xtask dogfood: pass at published H3. Precommit selected 569 actual paths, matched an independent Git diff, ran workspace/all-target Clippy and skipped no gates.
  • Freshly compiled H3 CLI, unchanged independent v2 driver and original physical fixtures: nine passing cases, 18/18 native CLI commands successful.
  • Current H5/ec8 actual CLI: one new source build, exclusive full-byte capture bac7219d768a23a13b66e1b507b59bfd9bc4bc335abb53672fb69cf44f750e68 (111,754,008 bytes), all nine public controls / 18 native commands pass with unchanged independent driver. Private copies have exact original source/test/diff/Git objects and retain unchanged 126 native Python runtime records; no fresh Python runtime at copied roots is claimed. Full archive/restoration of this tenth original witness is verified.
  • Current required run 38333105710 completed successfully on published ec8 at 2026-10-13 02:17:42 UTC, including the routed-result job. Actual hosted checkout e137c546122167b57ca7f0b767939775cd854f4e has parents main591 + ec8 and tree 82043fec70216412de0a5a0a271b49f68623f36a, identical to ec8. All 14,835 selected nextest tests passed, zero failed, two skipped, across 79 binaries; all four independently authored Python controls and the inventory regression passed. Doctests: two passed, zero failed, one ignored. Required policy, workspace/all-target/all-feature, Clippy, goldens, fixtures, all four corpus checks and PR-evidence gates passed. Actual Python corpus: 63 cases, five known false verdicts, zero contradictions, coverage 37/39 with floor37. Actual Rust corpus: 378 cases, 51 known false verdicts and one known contradiction; TypeScript106/six known false/zero contradictions, Perl36/13 known false/zero contradictions. These are existing explicit corpus labels, not zero-defect claims. Full native log through cleanup is retained; separate docs-only/scratch lanes were structurally skipped.
  • Original compiled861 local honesty, full precommit and dogfood passed at their own source identity. Precommit independently matches 710 actual paths and skips no gates. Actual compiled861 CLI passed all nine public cases / 18 native commands using private copies from verified archive restoration. Run38328365557 on actual previewa50/tree2e3 passed14,807 nextest tests/zero failures/two skipped but failed its required result solely on inherited Rust expected-row drift spec0115-no-test-reaches-owner. Main591 incorporated fix(rust): name the custom assertion macro limit beside a proximity-only weak oracle (#7089) #7548's correction. That complete old native failure remains retained, separately attributed, and is superseded for current qualification by successful run38333105710.
  • The existing repair-card inventory test is corrected only from orthogonal11 to12, with an explanation. All46 old card-bearing finding rows are unchanged. Discarded f adds one packet-ineligible orthogonal card; the module and genuinely observed f cases have no card. The original image reproduces the stale expectation, and the once-built H4 test image passes both the inventory test and all four independent controls; that same original passes the unchanged inventory subsystem on combined data.

H3 hosted qualification failed the stale inventory count. Its required nextest run stopped after8728of14770tests (8727passed/onefailed/twoskipped); all four new semantic controls passed. This is retained negative qualification, not a full-suite pass. A conflict-resolution command later continued after a rejected ID-prefix assertion and committed markers locally. A follow-up corrects only the JSON; no execution selected the bad intermediate head. That unqualified historical object is preserved. The final tree and full corpus equality were independently reviewed before this publication.

H2 local precommit and hosted policy preflight refused exactly three missing fixture project-marker registrations. H3 adds only their literal existing-kind/owner entries, and the failed gate and full precommit now pass. The old Ready run reached terminal failure before Draft conversion, the ordinary push and the fresh H3 Ready trigger.

Original compiled baseline, tests-only negative image, repaired CLI and libtest images are retained with exact build/source identities. The independent Python oracle bytes and production credit repair remain unchanged; G1 execution is not described as an H2/H3 build; H3 CLI execution has its own actual compiler selection and frozen original. An early formatter-handoff overlap was recorded and repaired through serialized artifact selection; it is instrument history, not a semantic red result.

A pre-existing Rust golden drift was reproduced using the original baseline CLI and resolved by the repository-prescribed pinned fixture dependency fetch; no Rust fixture or golden was edited. The candidate's old Python corpus expected-row drift was independently attributed to #7547; current combined corpus proof passes.

Boundaries and integration

Python remains preview. Static exposure does not claim runtime mutation adequacy. Ordinary module missed credit, broader evidence refactoring (#5574/#5488), other Python verdict repairs, Windows/editor/renderer qualification and release publication remain separate.

Branch fix/7526-python-module-credit incorporated maina0b5 to resolve a real shared honesty-corpus conflict, then main591 to incorporate the already-landed correction for an observed Rust corpus prerequisite. The resolution preserves all209 upstream honesty cases and our identical three. Required hosted execution is attributed to actual e137/tree8204 above. Newer main347 contains separately owned Python mock corpus data (65 cases, coverage floor38), Rust module matching, and an equivalent shared reach-table relocation; those additional data counts were not executed by this PR's older63-case hosted proof. Intermediate reviewed main 0e4e630d6bbaf520790d4207032d0afeb489a531 additionally contains Rust oracle-accuracy scoring and four older Rust verdict repairs. Native merge-tree is clean at 8ec258f1a3e40fccb0be17195ef285bc6b6020e6. The Python adapter, all three own fixture trees, ledger, LSP admission, honesty corpus, Cargo/lock, workflow/rust gates, OUTPUT_SCHEMA and dependency allowlist remain byte-identical to ec8. Independent current-main applicability review completed with REVIEW_READY. The immediate main premise advanced to 01e8a4548aedf1096bdac8538ec6230e3fecc706; its TypeScript adapter, Rust pilot ordering, test-only fixture setup and out-of-scope SPEC0252 ledger declaration were independently reviewed in a narrow addendum. All16 selected repair owners remain identical. No execution of either newer prospective tree is claimed. Normal expected-ec8 squash completed at 2026-10-13 02:46:40 UTC as 6bd4e76cce997a216f11d7841d80a14b280f4070, sole parent01e8, actual tree fcca2202cd924a05553097815c7e4e072c976f79, exactly the reviewed clean prospective tree. Native #7526 is closed/completed.

The unqualified conflict-marker ancestor 753c89b99cd0e9532f2b1ba4e8d343b1b08122bf is retained as instrument history; the normal follow-up repairs it in current861. No build or semantic execution selected753.

Rollback: revert the eventual squash commit, including the contract, three fixtures and honesty controls.

Traceability and policy

RIPR-SPEC-0028 and RIPR-SPEC-0238 → independent Python tests and three fixtures → python/sink_alignment.rs → docs/OUTPUT_SCHEMA.md → literal RIPR-SPEC-0108 honesty controls. Traceability mappings are updated. Three fixture-only dependency-surface registrations explain the new project markers. No dependency graph, package boundary, process/network, support-tier or CI behavior changes. CI economics: n/a.

Delivery complete: native issue7526 is closed/completed; exact-head/current-main independent REVIEW_READY, required38333105710success and normal protected expected-head squash are observed. Standalone source bundle passed strict fsck and26 exact clean checkouts. Ten original executables retain full bytes/source identities in four fully restored proof archives; final receipts and ten generated fixture caches are separately restored and verified. All independent consumers released; both owned worktrees/targets, local branch/proof refs and already-auto-deleted remote branch are closed out. Prior custody, common Git, primary checkout, toolchain and other owners remain unchanged. No remaining bounded7526 obligation. Broader issue7382 revision/config policy and separate pytest fixture collection/selector audit remain distinct successors.

@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 Oct 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6f878a09-9a77-4013-8383-3d15415b5b5c
📥 Commits

Reviewing files that changed from the base of the PR and between 591f436 and ec8daf7.

📒 Files selected for processing (46)
  • .ripr/traceability.toml
  • changelog.d/7526-python-empty-token-observation.md
  • crates/ripr/src/analysis/language/python/python_tests.rs
  • crates/ripr/src/analysis/language/python/sink_alignment.rs
  • crates/ripr/src/analysis/language/python/tests.rs
  • crates/ripr/src/output/gap_decision_ledger.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/specs/RIPR-SPEC-0238-python-oracle-and-reach-rules.md
  • fixtures/evidence-promotion-honesty-corpus/corpus.json
  • fixtures/python_empty_sink_module_comparison/SPEC.md
  • fixtures/python_empty_sink_module_comparison/diff.patch
  • fixtures/python_empty_sink_module_comparison/expected/CHANGELOG.md
  • fixtures/python_empty_sink_module_comparison/expected/check.json
  • fixtures/python_empty_sink_module_comparison/expected/human-full.txt
  • fixtures/python_empty_sink_module_comparison/expected/human.txt
  • fixtures/python_empty_sink_module_comparison/input/.gitignore
  • fixtures/python_empty_sink_module_comparison/input/pyproject.toml
  • fixtures/python_empty_sink_module_comparison/input/ripr.toml
  • fixtures/python_empty_sink_module_comparison/input/src/__init__.py
  • fixtures/python_empty_sink_module_comparison/input/src/constants.py
  • fixtures/python_empty_sink_module_comparison/input/tests/test_constants.py
  • fixtures/python_empty_sink_observed_short_function/SPEC.md
  • fixtures/python_empty_sink_observed_short_function/diff.patch
  • fixtures/python_empty_sink_observed_short_function/expected/CHANGELOG.md
  • fixtures/python_empty_sink_observed_short_function/expected/check.json
  • fixtures/python_empty_sink_observed_short_function/expected/human-full.txt
  • fixtures/python_empty_sink_observed_short_function/expected/human.txt
  • fixtures/python_empty_sink_observed_short_function/input/.gitignore
  • fixtures/python_empty_sink_observed_short_function/input/pyproject.toml
  • fixtures/python_empty_sink_observed_short_function/input/ripr.toml
  • fixtures/python_empty_sink_observed_short_function/input/src/__init__.py
  • fixtures/python_empty_sink_observed_short_function/input/src/constants.py
  • fixtures/python_empty_sink_observed_short_function/input/tests/test_constants.py
  • fixtures/python_empty_sink_unrelated_short_function/SPEC.md
  • fixtures/python_empty_sink_unrelated_short_function/diff.patch
  • fixtures/python_empty_sink_unrelated_short_function/expected/CHANGELOG.md
  • fixtures/python_empty_sink_unrelated_short_function/expected/check.json
  • fixtures/python_empty_sink_unrelated_short_function/expected/human-full.txt
  • fixtures/python_empty_sink_unrelated_short_function/expected/human.txt
  • fixtures/python_empty_sink_unrelated_short_function/input/.gitignore
  • fixtures/python_empty_sink_unrelated_short_function/input/pyproject.toml
  • fixtures/python_empty_sink_unrelated_short_function/input/ripr.toml
  • fixtures/python_empty_sink_unrelated_short_function/input/src/__init__.py
  • fixtures/python_empty_sink_unrelated_short_function/input/src/constants.py
  • fixtures/python_empty_sink_unrelated_short_function/input/tests/test_constants.py
  • policy/dependency_allowlist.txt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@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!

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 12, 2026 23:57
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 12, 2026 23:59
@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 github-actions 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.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 13, 2026 00:24
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 00:39
@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!

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 13, 2026 01:32
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 01:38
@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 github-actions 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.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Repair-card inventory constant bumped from 11 to 12 with an inline #7526 comment; explanation explicitly excludes the genuine-output control and module-comparison control as packet-ineligible, leaving the 46 old card-bearing findings untouched. Smallest-complete-fix scope.
  • The inventory tuple test in gap_decision_ledger.rs is bumped from 11 to 12 for orthogonal cards solely because python_empty_sink_unrelated_short_function now contributes one packet-ineligible orthogonal return-value card. This is documented in the test comment but couples two distinct code paths (the sink-alignment change and the ledger's row-counting invariant) — any future unrelated orthogonal card will trip the gate without an explanatory comment. Not a defect, but a fragile coupling to monitor.
  • Strong_oracle_observes_owner_call_through_module branch survives the change because its credit lives above input state in classify_sink_alignment_with_old; no architectural re-plumbing needed. Boundary placement is correct.
  • ripr sensor receipt itself failed (exit code Some(2)) so this diff was never replayed through the project's own native analyzer during this review window; PR description cites prior H3/H4 runs on archived clones, not the current working tree.

Verification questions

  • Confirm sink-alignment observes() now reads three branch tokens only; legacy module_owner_no_sink_token early return and reason are removed.
  • Confirm sPEC-0238 rule 4 reverses the empty-token observing exception and three fixture/golden controls + four Rust tests lock the behavior in both directions.
  • Confirm strong_oracle_observes_owner is now #[cfg(test)] only; not referenced by production code; it was previously a regression helper and remains one.

Parked follow-ups

  • Fixture structure is duplicated across three python_empty_sink_* sets (input/, expected/, SPEC.md, CHANGELOG.md, diff.patch) but each encodes a distinct acceptance row; sharing a single input tree is unsafe because the unrelated-short-function and observed-short-function diverge only by test body, which goldens compare. Acceptable bounded duplication.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@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 exact-head review: REVIEW_READY for published ec8daf7632f265476da19aa5bd7d0186df4d3b28. The separate reviewer verified immutable author red-green/runtime evidence, actual current CLI image bac7219d… / nine public controls / 18 native successful commands, the complete native hosted log on e137/tree8204, all current 37 terminal success/skipped checks, and no unresolved inline threads.

Review5497924818 is triaged: the 11→12 inventory transition is explained by the one new packet-ineligible orthogonal card, with all46 old card-bearing findings preserved; fragility is a nonblocking future suggestion. Its own sensor exit2 is an instrument limitation, separately superseded by the actual H5 native public replay and current required success. Production observes() credits only existing direct/alias/changed-sink branches, both legacy empty-token shortcuts are removed, the helper is test-only, and direct-through-module credit remains. Older-head/quota reviews are not used as current independent approval.

Current-main applicability: main0e4e630d6bbaf520790d4207032d0afeb489a531 produces clean prospective tree8ec258f1a3e40fccb0be17195ef285bc6b6020e6. Bounded Python owners/fixtures/ledger/admission remain identical. New Rust classifier work is outside the Python call path; the shared corpus oracle extension is opt-in and has no labels/table in the Python corpus. The later65-case/floor38 data is separately attributed; no execution of this prospective tree is claimed. Required run38333105710 succeeded including routed Result at02:17:42UTC. Active ruleset18845973 allows normal squash, requires resolved threads, has0approvals and no bypass; classic-protection read is403 for this integration, so ordinary server enforcement remains authoritative. Delivery owner now owns immediate head/main guard, normal expected-head squash, native issue/tree acceptance and recoverable closeout.

@EffortlessSteven
EffortlessSteven merged commit 6bd4e76 into main Oct 13, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python empty-token sink alignment can credit an unrelated strong oracle as exposed

1 participant