Skip to content

ci: derive the duplicate-source scan from Package.swift — it covered 4 of ~10 dirs - #445

Merged
JasonYeYuhe merged 1 commit into
mainfrom
duplicate-sources-widen-scope
Aug 18, 2026
Merged

ci: derive the duplicate-source scan from Package.swift — it covered 4 of ~10 dirs#445
JasonYeYuhe merged 1 commit into
mainfrom
duplicate-sources-widen-scope

Conversation

@JasonYeYuhe

Copy link
Copy Markdown
Collaborator

Caught in the act

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. Unscanned: HelperSwift/Tests, SensorProbe/Tests, both MachineRootHelper dirs, and CLI Pulse Bar/codexbar. SwiftPM compiles Tests/ exactly as it compiles Sources/.

before:  1 of 7 duplicates reported
after:   7 of 7

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: "scanned nothing" and "found nothing" would otherwise be the same green tick.

Forensics, since the origin has been "unknown" for weeks

fact value
duplicate birth & mtime 2026-07-23 — older than the original (2026-08-03)
byte-identical? No — 58,580 vs 59,716
diff direction 20 lines only in the original, zero only in the duplicate
xattrs none — no fileprovider, no provenance
present in .claude/worktrees? absent from all four

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:

Origin still unidentified. But that's two fewer dead ends for the next investigation.

Verification

  • All 7 quarantined to a backup before deletion.
  • swift test --package-path HelperSwift719 tests, 0 failures afterwards.
  • The QA build that started this now succeeds.
  • Guard re-run on the cleaned tree → exit 0.

🤖 Generated with Claude Code

…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>
Copilot AI lite review requested due to automatic review settings August 18, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JasonYeYuhe
JasonYeYuhe merged commit 66d0ee5 into main Aug 18, 2026
3 checks passed
@JasonYeYuhe
JasonYeYuhe deleted the duplicate-sources-widen-scope branch August 18, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants