Skip to content

python io: bare builtin open and I/O module references count again (io contract C1) (#9311) - #9314

Merged
squid-shepherd[bot] merged 4 commits into
mainfrom
churn/9311-20261125T1721Z
Nov 25, 2026
Merged

squid-shepherd[bot] merged 4 commits into
mainfrom
churn/9311-20261125T1721Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #9311

What failed

rosetta-audit on main: python main.py: io expected 3, got 0 (1 of 57 languages; the other 56 pass). Real regression, not a flake: #9308 narrowed python io to open( / module.fn(, but the keyword-rosetta python plant is bare (reader = open, folder = pathlib, plug = socket) and docs/io_rule_contract.md C1 explicitly lets python's bare builtin open fire.

Fix

python.py io: restore bare open and the I/O module names (requests httpx aiohttp boto3 pathlib socket sqlalchemy psycopg2 asyncpg), guarded so the collisions #9308 removed stay out: attribute access (self.socket), a name being assigned / keyworded (socket = s, open=True), strings, import / from lines.

Class sweep

Class: a keyword-family rule narrowed past what the corpus plants / the contract allows. Siblings checked: every other #9308 family (telemetry, sync_locks, thread_sleeps, comprehensions, bitwise_ops, time_date_logic) and embedded_python io pass the full rosetta run (0 regressions, 57 languages). Two test_python_strict.py tests were already stale on main from #9308 (.filter( negative; operator-inside-string positive); updated to the #8863 behaviour.

Evidence

  • rosetta_audit.py --corpus <keyword-rosetta main>: 57 checked, 0 regressions.
  • family_red_cells.py --lang python: 0 red cells.
  • pytest: test_python_strict, test_python_family_validity_8863, test_io_contract_2841 pass.
  • audit_check.py: all clear; ruff format --check clean.
  • Golden masters re-blessed with crucible_check.py --update (12 files, small python drift: airflow fingerprint/cluster floats and net-mitigated io counts from the restored bare io hits).

Cross-repo: none (corpus unchanged; no companion PR).

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

1 similar comment
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push.

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Nov 25, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review November 25, 2026 17:51
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (8f5c201) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 25, 2026 20:00
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Nov 25, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Nov 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot added the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 25, 2026 20:26
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 25, 2026 20:28
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd squid-shepherd Bot removed the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 25, 2026
@squid-shepherd
squid-shepherd Bot merged commit 5acaf4b into main Nov 25, 2026
152 of 187 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/9311-20261125T1721Z branch November 25, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main is red: rosetta-audit

1 participant