ci: derive the duplicate-source scan from Package.swift — it covered 4 of ~10 dirs - #445
Merged
Merged
Conversation
…4 of ~10 dirs
A QA build failed today with the exact error this guard exists to prevent:
'LocalSessionServer 2.swift' — invalid redeclaration of 'LocalSessionServer'
The guard DID catch that one (HelperSwift/Sources was on its hardcoded list) —
but the list had gone stale, and six more duplicates were sitting unseen in
HelperSwift/Tests. Enumerating every Package.swift shows the four literal paths
covered 4 of ~10 compiled directories; HelperSwift/Tests, SensorProbe/Tests,
both MachineRootHelper dirs and CLI Pulse Bar/codexbar were all unscanned.
SwiftPM compiles Tests/ exactly as it compiles Sources/.
A hardcoded allowlist of build inputs is the same trap as the QA bundle-id
allowlist and the UserDefaults migration prefixes: adding a package silently
drops it out of coverage and nothing says so. The list is now discovered from
Package.swift locations, so a new package is covered the day it lands. An empty
discovery result now FAILS rather than silently passing, since "scanned
nothing" and "found nothing" would otherwise be the same green tick.
before: 1 of 7 duplicates reported
after: 7 of 7
FORENSICS ON THE SPECIMEN, since the origin has been "unknown" for weeks
* `LocalSessionServer 2.swift` birth AND mtime 2026-07-23; the original was
recreated 2026-08-03. The duplicate is the OLDER file.
* NOT byte-identical: 58,580 vs 59,716 bytes.
* `diff` is one-directional — 20 lines exist only in the original, ZERO exist
only in the duplicate. It carries no unique work, so deleting loses nothing.
(Checked before removing, as the guard's own message instructs.)
* No xattrs at all — no com.apple.fileprovider, no provenance. Combined with
the correction in #444 (Desktop & Documents sync is OFF, ~/Documents is a
plain directory), iCloud remains unsupported as the cause.
* Absent from all four .claude/worktrees, so a parallel worktree is not the
source either.
Origin still unidentified. Two theories are now positively excluded rather than
merely doubted, which is progress the next investigation does not have to redo.
All 7 quarantined to a backup before deletion. HelperSwift: 719 tests, 0
failures afterwards. The QA build that started this now succeeds.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caught in the act
A QA build failed today with the exact error this guard exists to prevent:
The guard did catch that one —
HelperSwift/Sourceswas on its hardcoded list. But the list had gone stale, and six more duplicates were sitting unseen inHelperSwift/Tests.Enumerating every
Package.swiftshows the four literal paths covered 4 of ~10 compiled directories. Unscanned:HelperSwift/Tests,SensorProbe/Tests, bothMachineRootHelperdirs, andCLI Pulse Bar/codexbar. SwiftPM compilesTests/exactly as it compilesSources/.A hardcoded allowlist of build inputs is the same trap as the QA bundle-id allowlist and the UserDefaults migration prefixes — adding a package silently drops it out of coverage and nothing says so. The list is now discovered from
Package.swiftlocations, so a new package is covered the day it lands.An empty discovery result now fails rather than silently passing: "scanned nothing" and "found nothing" would otherwise be the same green tick.
Forensics, since the origin has been "unknown" for weeks
diffdirectionfileprovider, noprovenance.claude/worktrees?So it carries no unique work — deleting loses nothing, which I checked before removing, as the guard's own message instructs.
Two theories are now positively excluded rather than merely doubted:
fileproviderxattr on the specimen, and per fix: the codesign detritus was never iCloud — correcting my own attribution #444 Desktop & Documents sync is off and~/Documentsis a plain directory.Origin still unidentified. But that's two fewer dead ends for the next investigation.
Verification
swift test --package-path HelperSwift→ 719 tests, 0 failures afterwards.🤖 Generated with Claude Code