Skip to content

Swift: a scoped import whose name is declared in several files of the target links each (Part of #3798) - #7005

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
churn/3798-20261029T1212Z
Oct 29, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
churn/3798-20261029T1212Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3798. A Swift scoped import import struct Mod.Name whose name is declared in several files of target Mod (typically extension Name in other files) drew no edge, because _resolve_swift_scoped refused any ambiguous hit. It now draws one edge per declaring file in the target.

Changes

  • network_risk_sensor.py: hit collection split into _swift_scoped_hits (list); _resolve_swift_scoped keeps the single-file contract for other callers; _resolve_edges links every hit through its existing multi-target loop (one edge per file, weight 1.0 each, deduped).
  • Tests: the ambiguous-draws-no-edge test now expects both files; new cases for 3 files, nested-owner in several files, out-of-target decoy, test-target decoy (production vs test importer), undeclared name.
  • docs/import_rule_contract.md: Swift rule text updated.

Class / Sibling gaps

Class: a Swift scoped import whose declaration spans several files of the named target. Handled here: direct name, nested-name owner fallback, file-named-after-type fallback, decoy filters. Golden masters (both legs) unchanged; pr_gates --fast and --ratchets pass.
Sibling gaps (not done): (1) the test-coverage mapper still uses the single-target resolve; (2) Swift namespace_imports aliases stay single-target; (3) SwiftPM targets with a custom path: in Package.swift are not located.

Remaining slices

None for this mechanism.

🤖 Generated with Claude Code

… target links each (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 29, 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 29, 2026 12:30
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 29, 2026 12:31
@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 October 29, 2026 12:49
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #7005 @ a82b563: 1 failed check(s)

== graph-accuracy-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40873789307/job/123449074553
repro: python tests/tools/pr_gates.py --fast
errors:
fail-on-cache-miss: false
run_gate() { # run_gate <command...>: log per gate, one "FAIL name" line on failure
|| echo "FAIL $name" >> "$RUNNER_TEMP/gaa/failed"
2026-10-29 12:45:37,274 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:41:36,842 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:46:07,649 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:48:43,329 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:48:47,130 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:46:10,720 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:47:16,843 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:42,649 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:05,357 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:08,567 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:09,536 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:15,217 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:22,489 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
2026-10-29 12:45:25,854 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:.AssertionError>
2026-10-29 12:45:26,310 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:
.AssertionError>
2026-10-29 12:45:26,311 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:.AssertionError>
2026-10-29 12:45:26,312 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:
.AssertionError>
2026-10-29 12:45:26,312 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:.AssertionError>
2026-10-29 12:45:26,313 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:
.AssertionError>
2026-10-29 12:45:26,314 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:.AssertionError>
2026-10-29 12:45:26,314 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:
.AssertionError>
2026-10-29 12:45:27,067 [INFO] [pyan.analyzer] New edge added for Use from to Name <Node ???:*.AssertionError>
... 82 more
log tail:
| 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-3
##[error]Process completed with exit code 1.
Post job cleanup.
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/9af50748-f81a-4c3f-ac46-f5b3dfa95675' 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 Oct 29, 2026
squid-protocol and others added 2 commits October 29, 2026 08:52
…units (Part of #3798)

Multi-file linking exposed nested types (struct BuildParameters inside an enum) as
declarations: swift-package-manager precision 100 -> 98.0 (15 FP). Back to 100.0.

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

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 29, 2026 13:05
@squid-shepherd squid-shepherd Bot removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 29, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit d9b515b into main Oct 29, 2026
67 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/3798-20261029T1212Z branch October 29, 2026 13:41
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