fix(swift): capture single-letter imports - #2628
Conversation
Allow Swift dependency capture to retain modules such as a by accepting an empty identifier tail after the initial character. Add regression and adversarial scaling coverage. Refs squid-protocol#2543 Co-authored-by: Codex <noreply@openai.com>
|
The Rosetta failure is the expected result of this fix: Would you prefer that I open the companion The Crucible/tree-sitter/tri-comparison failures occurred before testing because |
|
Thanks for this! Your diagnosis is correct on both counts, and The Crucible / tree-sitter / tri-comparison failures are ours. You're right that The Rosetta failure is real and is the gate working as intended. Your read is exactly right: Nice symmetry worth noting: the corpus is what filed #2543 in the first place. Ledger entry Yes please, go ahead and open the companion
The fix itself looks good — the |
|
Correction to my note above: the coast is already clear — please go ahead now, no need to wait. I said corpus PR #20 was in flight holding So nothing is blocking you: open the corpus PR whenever you like, with Separately, the four Crucible/tree-sitter/tri-comparison failures now have a fix in #2637 — it |
…EF (#2637) GitHub withholds repository variables -- like secrets -- from pull_request runs raised from a fork, so `vars.LANGUAGE_CRUCIBLE_REF` expands to an empty string there and the five corpus-backed workflows ran `git clone --branch ""`, failing with a bare `fatal: Remote branch not found in upstream origin` before any engine code was exercised. #2628 is the first fork PR this repo has seen in a long while, which is why this went unnoticed: it arrived with four red audits that had nothing to do with the contributor's change. Guard the clone instead of falling back to the corpus's `main`: these pins exist to make the audits deterministic, and silently auditing against a different corpus snapshot would trade a confusing failure for an authoritative-looking wrong answer. The guard fails with an explicit `::error::` explaining the fork limitation and pointing at CONTRIBUTING.md. Also document what a fork contributor should expect, and add the `rosetta-audit` cross-language gate (#2557) to the baselines section -- it shipped without a CONTRIBUTING entry, so the cross-repo re-baseline protocol it depends on was undiscoverable from here. Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Description
Swift's
_dependency_capturerequired an initial identifier character followed by one or more[\w.]characters. This made module names at least two characters long, so a valid single-letterimport such as
import awas silently omitted from the dependency DAG.This changes the tail quantifier from
+to*, preserving existing imports while acceptingsingle-letter module names.
Changes
import aas a regression case.importremains invalid.Validation
git diff --check: passedrelevant tests passed
symlink privileges
Core Engine Modification Checklist
the Windows wrapper failed afterward while printing a Unicode timing glyph. Linux CI is
authoritative.
ctags, which was unavailable locally; handledautomatically by CI.
CI is authoritative.
Proof
standards/language_standards/languages/swift.py#L198-L201)
tests/extraction/languages/test_swift.py#L235-L275)
v1.2.0Cross-repo
No companion code change is required. The control-corpus reproducer already exists. Rerun the Swift
corpus ledger after this engine change lands.
Fixes #2543