Skip to content

Import graph: Swift rule (C7) and swift-argument-parser corpus entry (Part of #3798) - #6486

Merged
squid-protocol merged 2 commits into
mainfrom
churn/3798-20261024T1239Z
Oct 24, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
churn/3798-20261024T1239Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3798, slice 3 (Swift), copying C# PR #6417.

What

  • swift_imports in tests/tools/import_graph_accuracy.py: import contract C7. import Mod (also @testable, @_exported, public import) names a SwiftPM target, so no edge. import struct|class|enum|protocol|typealias|func|var|let Mod.Name resolves to the files of Mod declaring Name (nested name falls back to owner; an extension counts; #if bodies are read). Targets and directories come from Package.swift by bounded pattern (path: else Sources|Tests|Plugins/<Name>).
  • Corpus: apple/swift-argument-parser @ bd10e575. Baseline swift: 170 files, 0 resolvable imports (its only scoped imports are WinSDK.*, external), 22 engine edges, 22 FP, 0 FN. Reported, not gated (MIN_GATED_IMPORTS). Alamofire has no scoped imports either, so no second repo was chased.
  • Test test_swift_resolves_by_target_and_declared_type_never_by_path covers every scoped keyword, module forms, nested fallback, name-vs-file mismatch, custom path:, #if, partial type + extension, external module.
  • Ledger: new swift shapes appended, unvalidated (verdict null); the tool's last_reconciled_at bumps on existing shapes were reverted so the diff is additions only.

Finding for the owner

The engine edges import Foundation to Sources/ArgumentParser/Utilities/Foundation.swift (a same-named file) in 22 places. That is the FP shape, as with C# LinqBridge; left unvalidated in the ledger, not tuned.

Class / Sibling gaps

Class: languages with no import-graph accuracy rule in import_graph_accuracy.py. Swift is covered here (plain module import, all eight scoped keywords, attribute/visibility forms, nested type, custom target path). Sibling gaps: none for Swift. Remaining slices: Groovy, Elixir, Erlang, OCaml, Julia, R, Nim, Fortran, Obj-C++, PowerShell, HCL, and second repos for Go and Perl (blocked on #6403), Shell, Rust, JavaScript.

Gates

import_graph_accuracy.py --ci OK (22 languages); pr_gates --fast 7/7; --ratchets 9/9 (0 skipped); audit_check.py clear; touched tests plus test_source_reads, test_generated_branch pass, and plain pytest from /tmp passes. No engine code changed, so no golden bless. The translator extra was not installed, so det tests were not exercised.

🤖 Generated with Claude Code

…eclared type, C7) and swift-argument-parser corpus entry (Part of #3798)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label 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 15:36
@squid-protocol
squid-protocol enabled auto-merge (squash) October 24, 2026 15:41
@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 shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md 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.

1 similar comment
@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