Skip to content

Swift: a bare module import draws no file edge (22 FP -> 0) (Part of #3798) - #6631

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/3798-20261025T1105Z
Oct 25, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/3798-20261025T1105Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3798

Swift import Foundation named a module (a SwiftPM target, no file of its own, import contract C7), but the engine's name index linked it to any file with that stem: 22 false edges in apple/swift-argument-parser, all to Sources/ArgumentParser/Utilities/Foundation.swift. _resolve_target now draws no edge for a Swift bare single-segment token. A scoped import struct Mod.Name (dotted token) still resolves.

Measured (graph comparison, swift): engine edges 22 -> 0, FP 22 -> 0. Swift is now unscored (n = 0 resolvable imports on this repo; precision n/a), so the language needs a second Swift repo that uses scoped imports before it can be quoted.

Class / Sibling gaps

Class: a module/namespace import with no file of its own resolved to a same-stem file by the name index. Swift is fixed here, with a test over bare, @testable/@_exported-style module names, scoped imports, and a non-Swift control.
Sibling gaps:

  • C# using Ns; -> same-stem Ns.cs (118 FP, precision 17.5%): needs a C7 ruling first (tokens are dotted, so the guard differs); no burned estate needs it (scope: sweep).
  • Swift second repo with scoped imports (to give the language a measurable n): scope sweep, no burned estate.

Facts checked: golden masters (crucible_check.py) PASS both legs; pr_gates --fast 7/7; --ratchets 9/9. The Go baseline entry moved 122 -> 121 edges (FP 1 -> 0) when regenerated after merging main; not caused by this change (Swift-only guard). The graph ledger regenerate also picked up C# shapes from xunit (#6627).

Files: network_risk_sensor.py, new test, import_rule_contract.md (3 hand-written); baseline, chart SVG, ledger regenerated.

🤖 Generated with Claude Code

…rgument-parser) (Part of #3798)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@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 25, 2026
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 25, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 25, 2026 11:20
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 25, 2026 11:22
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@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
squid-shepherd Bot merged commit 6976404 into main Oct 25, 2026
110 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/3798-20261025T1105Z branch October 25, 2026 12:10
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