Skip to content

Python bitwise_ops counts & and |, not type unions (Closes #8861) - #8914

Merged
squid-shepherd[bot] merged 8 commits into
mainfrom
churn/8861-python-bitwise
Nov 22, 2026
Merged

squid-shepherd[bot] merged 8 commits into
mainfrom
churn/8861-python-bitwise

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #8861

What changed

Python bitwise_ops (languages/python.py) now counts the contract's & and | (a & b, a | b, m &= x, m |= x) besides << >> ^ ~, and skips a | None / None | type union. Per the issue's corrections (2026-11-21), the string-literal counting is documented behaviour (#2535, rosetta string decoy) and a decision tracked in #8866, so it is unchanged; a test pins it as such.

Class / Sibling gaps

Class: a bitwise_ops text rule that drops the contract's and/or operators or counts type-union |. Member fixed here: python (tests: one function per case, 8 counted, 5 ignored, 1 pinned string case).
Sibling gaps (none needed by a burned estate): embedded_python already counts &/| but not the | None guard (rare in MicroPython; same regex shape, left to avoid overlap with open PR #8894); string/comment-content counting across yacc, zig, css, perl, php (decision, #8866); generic closing >> counted as a shift in generic-heavy languages (#8866); | in annotations that are not None unions (int | str) still counts, a text rule cannot tell them from a | b.

Evidence

  • Golden masters re-blessed with golden-lock.sh crucible_check.py --update --yes (both legs). scope_check.py --expect python: every drifted file is a .py file (the cpp/NVDA and fortran/wrf labels are corpus directories holding .py files); drift = Bitwise Operations counts up, plus the function archetype / composition rollups they feed.
  • Rule CPU (best of 3, 9.3 MB of this repo's .py): old 0.024 s, new 0.171 s per full-text findall. Whole-scan CPU on rosetta/crucible not separately timed; the rule is a negligible share of a scan.
  • keyword-rosetta not checked out on this box: if its Python bitwise_ops counts move, it needs rosetta:rebless-owed (the tick adds labels).
  • pr_gates --fast 9/9, --ratchets 9 pass / 0 fail.

🤖 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 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 15:05
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 15:19
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot disabled auto-merge November 21, 2026 15:46
@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 21, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (6d48899) 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 21, 2026 15:59
@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 21, 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 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 16:03
@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 21, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 16:30
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 21, 2026 17:02
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #8914 @ 6d48899: 5 failed check(s)

== equivalence-e2e (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/44921714015/job/136900087533
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== full-suite (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/44921713870/job/136900071681
repro: python -m pytest -q tests
log tail:
(log unavailable: gh: HTTP 404)

== full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/44921713870/job/136900071318
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== store the suite's durations (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/44921713870/job/136900071556
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== suite time budget (#5166) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/44921713870/job/136900071555
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)
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 21, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 20:17
@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 21, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 20:17
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@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 21, 2026
@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 disabled auto-merge November 21, 2026 22:23
@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 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (5875839) 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 21, 2026 22:27
@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 21, 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 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 21, 2026 22:35
@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 21, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 21, 2026 22:36
@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 21, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 981e9ec into main Nov 22, 2026
138 of 178 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8861-python-bitwise branch November 22, 2026 00:02
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.

Python: bitwise_ops counts characters inside strings and regexes (precision 0.32)

1 participant