Skip to content

Slicer: a brace type in a zig result type or a swift closure default is no body start (Part of #6432) - #6440

Merged
squid-protocol merged 5 commits into
mainfrom
churn/6432-20261024T0948Z
Oct 24, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
churn/6432-20261024T0948Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #6432. No checklist key on the issue.

In the brace slicer, the first { after a signature was taken as the body start. A zig type brace in the result type (error{..}!T, struct{..}, union(enum){..}, enum(u8){..}, opaque{}) and a swift closure parameter default (cb: () -> Void = {}) ended the unit on the signature line, so the body's calls landed on the previous function.

  • zig: in the shared rust/zig/solidity branch of _slice_by_braces, a depth-0 { after struct|union|enum|opaque|error (or the ) of union(..)/enum(..)) is stepped over as a balanced type brace (_zig_opens_type_brace, gated to zig). Mirrors the existing go branch.
  • swift: a new branch searches for the body brace from the end of the balanced parameter list, falling back to the old anchor.

Class / Sibling gaps

Class: the Mode-B brace slicer reading a non-body { in a signature as the body start. Handled here: zig type braces (all keywords above), swift closure defaults. Go was already handled. Sibling gap: rust const-generic braces in a signature (-> Foo<{ N + 1 }>) reproduce the same truncation; not fixed because a trailing , before { is legal in a where clause, so a cheap look-back rule is unsafe and it needs an angle-depth walk. No burned mainframe estate needs it.

Tests

tests/extraction/languages/test_slice_signature_braces_6432.py (17 cases: each zig type form, multi-line error set, plain/bodyless unchanged, calls land on the right unit, unbalanced-brace bound, swift defaults and protocol requirements). Existing zig/swift strict tests pass.

Golden

Re-blessed via golden-lock.sh crucible_check.py --update --yes. scope_check.py against origin/main: zig 4450 and swift 112 differences, plus repo-wide rollup, PageRank and coordinate shifts that follow from the new edges. The java/groovy call differences it listed came from main's #6424 (merged after my base); none remain in the diff after merging main. A control crucible_check on pristine main passed at similar box load.

Gates: pr_gates --fast 7/7, --ratchets 9/9; tree-wide guards and time ratchet pass.

🤖 Generated with Claude Code

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

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 24, 2026 10:14
@squid-protocol

Copy link
Copy Markdown
Owner Author

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-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 10:17
@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 Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol squid-protocol removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

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-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

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

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol squid-protocol removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 24, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol merged commit c85b448 into main Oct 24, 2026
61 checks passed
@squid-protocol
squid-protocol deleted the churn/6432-20261024T0948Z branch October 24, 2026 11:48
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

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.

1 participant