Skip to content

Stop treating Python descriptor guards as stable local values - #68

Merged
hyperpolymath merged 7 commits into
mainfrom
codex/adversarial-assurance-20261104
Nov 4, 2026
Merged

hyperpolymath merged 7 commits into
mainfrom
codex/adversarial-assurance-20261104

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Repeated Python attribute reads can invoke a changing descriptor. The read-before-init pruning pass incorrectly assumed those guards were stable and suppressed a real unbound read. Restrict the optimisation to plain names and attach an explicit path-feasibility countercondition to dataflow findings.

The former negative fixture was executed with a property returning None then a value and raised UnboundLocalError. Its exact original source is retained as positive/attribute_guard.py; the corrected negative snapshots the property once. This is a demonstrated label correction, not deletion of a failing specimen. The expanded Rust suite passes 251 tests, with zero ignored. The benchmark harness also respects CARGO_TARGET_DIR.

General correlated-guard and exception limitations remain open (including #47). No source-to-model soundness or universal correctness claim is made. See docs/ASSURANCE-AUDIT-2026-11-04.adoc.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

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: Advanced
  • Run ID: df5bbe52-379c-466d-afc7-79f3864aa9a8

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Read-before-initialisation findings are no longer suppressed by attribute-based guards. Findings clarify that path feasibility is not confirmed and may include a counter-condition.
  • Documentation
    • Added an assurance audit outlining analysis limitations, test coverage, benchmark requirements and open questions.
  • Chores
    • Benchmark scripts now locate the executable using the configured build directory when available.

The read-before-init rule now limits correlated-guard pruning to plain names and describes findings as abstract-CFG results with path-feasibility limits. Tests and fixtures cover attribute guards. The benchmark script uses CARGO_TARGET_DIR when set.

Changes: Read-before-init analysis

Layer / File(s) Summary
Finding semantics and guard filtering
crates/pons-rules/src/t1/read_before_init.rs
The rule describes findings as abstract-CFG reads and includes counter-conditions about possible path infeasibility. Correlated-guard pruning now rejects attribute bases.
Tests, fixtures, and audit
crates/pons-rules/src/t1/read_before_init.rs, fixtures/read-before-init/negative/correlated_guard.py, fixtures/read-before-init/positive/attribute_guard.py, docs/ASSURANCE-AUDIT-2026-11-04.adoc
Tests cover plain-name pruning and attribute guards. The negative fixture snapshots self.name once. The audit records test results and remaining analysis limitations.

Benchmark binary path

Layer / File(s) Summary
Resolve benchmark binary path
benches/pons_bench.sh
The benchmark binary path uses CARGO_TARGET_DIR when set and falls back to target.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · previous review 24365

The change avoids suppressing warnings for repeated attribute reads and preserves the regression example. No actionable merge-blocking risk is identified; merge after normal checks pass.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: preventing descriptor guards from being treated as stable local values.
Description check Passed The description directly explains the descriptor-guard defect, the plain-name restriction, the fixture correction, and the related test and benchmark updates.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
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: Advanced
  • Run ID: 246e6ffb-3ffe-4bd9-b6ca-2c5e6309a72e
Commits

Reviewing files that changed from the base of the PR and between 84f58f9 and 2436550.

Files selected for processing: 5
  • benches/pons_bench.sh
  • crates/pons-rules/src/t1/read_before_init.rs
  • docs/ASSURANCE-AUDIT-2026-11-04.adoc
  • fixtures/read-before-init/negative/correlated_guard.py
  • fixtures/read-before-init/positive/attribute_guard.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 4
  • GitHub Check: CodeRabbit
  • GitHub Check: check
  • GitHub Check: Provenance and coverage
  • GitHub Check: CodeQL Analysis (rust)
Additional context used
Ruff (0.17.0)
fixtures/read-before-init/positive/attribute_guard.py

[error] 6-6: Undefined name MonsterAddName

(F821)

@linear-code
linear-code Bot marked this pull request as ready for review November 4, 2026 10:37
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 4, 2026 14:57
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Completed: Generate docstrings for PR #68 — View commit 719ee65

hyperpolymath added a commit to hyperpolymath/cicd-suite that referenced this pull request Nov 4, 2026
…on (#77)

The custom-tools gate previously omitted strict coverage flags, so
unsupported input could appear successful. It now runs both scanners,
requests strict coverage, bounds each invocation and distinguishes
incomplete execution from finding failures, including signal-derived
exits through 255. Panic assail findings remain report-only; this does
not introduce an undeclared severity policy.

Validation: 183 gate controls, including 144 exit-code pairs and an
actual timeout; a Bash driver passed 73 real scanner/report/parser
controls. The original gate fails strengthened controls. Fixed
ShellCheck findings in the test-directory change and an intentional-glob
directive. The Python driver was replaced after hosted language-policy
rejection, without relaxing the gate.

The audit documents eight strict cross-scans (all partial), test/proof
inventories, performance samples and bounded experiments. Pons passed
251 tests after its separate repair; panic passed 720 with
signing/http/sarif (three ignored). Live Idris results: 41 framework, 56
type-safe, 110 spec and eight pinned ordering-law checks; four benchmark
workloads passed. These are scoped observations, not complete coverage
or universal soundness.

Companion repairs: hyperpolymath/proven-tests-and-benches#103,
hyperpolymath/pons-asinorum#68, hyperpolymath/panic-attack#257. A
Standards owner/lock migration experiment failed consumer integrity and
startup checks and was reverted at the consumers; the audit retains the
evidence. Renaming to proven-cicd, estate consumer migration,
unavailable security dashboards and remaining proof/runtime obligations
are not completed.
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

Copy link
Copy Markdown
Owner Author

Current source 719ee65 passed all seven triggered workflows. Verified the actual Secret-Scan-Floor ruleset (24309663): it requires scan / gitleaks from GitHub Actions app 15368; that exact check is successful on this head. Creusot obligation detection/theatre/verdict checks passed, while cargo creusot prove is skipped: do not count this as newly discharged proofs.

GitHub still reports mergeable=true, mergeable_state=blocked. The active default-branch Require-Signed-Commits ruleset (23852949) requires signatures; all seven PR commits currently report verification.reason=unsigned. Classic branch-protection details return 403 through this connection, so other restrictions cannot be ruled out. No protection was changed or bypassed, and no merge is counted complete.

@hyperpolymath
hyperpolymath merged commit 1aa5434 into main Nov 4, 2026
23 checks passed
@hyperpolymath
hyperpolymath deleted the codex/adversarial-assurance-20261104 branch November 4, 2026 16:58
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.

1 participant