Skip to content

Nim: stop counting try/except/finally as branches (Part of #8863) - #9017

Closed
squid-protocol wants to merge 1 commit into
mainfrom
churn/8926-20261122T1026Z
Closed

squid-protocol wants to merge 1 commit into
mainfrom
churn/8926-20261122T1026Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Nim branch no longer counts try, except or finally: the branch contract's corollary 1 says a handler is not a decision, and safety (same file) already owns all three. Fixes #8926 (part of #8863).

Class / Sibling gaps

Class: exception-handler keywords (try/except/finally) counted in a language's branch rule. In this PR: Nim, the whole keyword set (try, except incl. bare and except X as e, finally), tested nested inside if, in strings/comments, and with safety still counting them. Not in this PR (the issue's other items, other mechanism): Nim boolean and/or (#8905), proc type scored as a closure, standalone ## comment credited as a doc.
Sibling gaps found by a one-line grep of languages/*.py branch rules (multi-line rules not swept): elixir.py (try|rescue|catch), erlang.py (try|catch), julia.py (try|catch|finally), ocaml.py (try). Each needs its own contract decision and golden/rosetta re-bless, so not done here.

Evidence

  • tests/extraction/languages/test_nim_strict.py: 13 passed (new test_handlers_are_not_branches_8926).
  • crucible_check.py --update --yes via golden-lock: no drift in either golden (the crucible Nim files have no handler); no re-bless needed. rosetta:rebless-owed not expected from the crucible, but the rosetta Nim control was not run here.
  • pr_gates --fast 9/9 pass; --ratchets 9 pass, 0 fail, 0 skipped.

Cross-repo

None. Rosetta (keyword-rosetta) Nim counts may move: re-run its sweep after merge.

🤖 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 22, 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 22, 2026 10:43
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 22, 2026 10:46
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot disabled auto-merge November 22, 2026 10:57
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #9017 @ 30ce1a5: 1 failed check(s)

== graph-accuracy-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/45013784134/job/137181818490
repro: python tests/tools/pr_gates.py --fast
errors:
run_gate() { # run_gate <command...>: log per gate, one "FAIL name" line on failure
|| echo "FAIL $name" >> "$RUNNER_TEMP/gaa/failed"
FAIL import-graph-2
##[error]Process completed with exit code 1.
log tail:
| objective-c | 154 | 0 | 0.0% |
| perl | 936 | 0 | 0.0% |
| php | 1722 | 0 | 0.0% |
| pli | 46 | 0 | 0.0% |
| postgresql | 4 | 0 | 0.0% |
| powershell | 89 | 0 | 0.0% |
| python | 4310 | 0 | 0.0% |
| rexx | 115 | 0 | 0.0% |
| ruby | 261 | 0 | 0.0% |
| rust | 2127 | 0 | 0.0% |
| scala | 541 | 0 | 0.0% |
| scheme | 34 | 0 | 0.0% |
| shell | 647 | 0 | 0.0% |
| solidity | 105 | 0 | 0.0% |
| swift | 132 | 0 | 0.0% |
| tcl | 291 | 0 | 0.0% |
| typescript | 8468 | 0 | 0.0% |
| yacc | 1301 | 0 | 0.0% |
| yaml | 19 | 0 | 0.0% |
| zig | 3462 | 0 | 0.0% |
span_anchor_audit: OK -- 51 language(s) measured, none rose beyond tolerance.
##[endgroup]
FAIL import-graph-2
##[error]Process completed with exit code 1.
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/8fc8ce70-1036-494b-89ff-4505fa0eb23d' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@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 22, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

Waiting on an owner decision (asked privately, 2026-11-22). Nothing is needed from contributors; work resumes once it is answered.

@squid-protocol

Copy link
Copy Markdown
Owner Author

Superseded by #8939 (the branch / short_circuit family split), which already removes try/except/finally from Nim's branch rule and gives Nim a short_circuit rule for and/or, with the Nim oracle measured on the Nim stdlib. Same fix, plus the split; two PRs editing the same rule line would only conflict. Closing at the owner's direction; if #8939 does not land, reopen this.

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 shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nim: branch counts try, except and finally (a handler is not a decision)

1 participant