diff --git a/internal/sync/agent_sync.go b/internal/sync/agent_sync.go index ab77e45a9..8ce26957a 100644 --- a/internal/sync/agent_sync.go +++ b/internal/sync/agent_sync.go @@ -325,7 +325,9 @@ func ExtensionOutputStatus(targetDir string, agents []resource.DiscoveredResourc continue } rel := filepath.FromSlash(key) - if copies.owns(rel) && copies.sourceMatches(rel, a.AbsPath) { + // Only a transform records a source fingerprint; a tracked plain + // copy left from before the extension was enabled has none. + if _, converted := copies.m.Sources[key]; converted && copies.owns(rel) && copies.sourceMatches(rel, a.AbsPath) { used[key] = true synced[i] = true break diff --git a/internal/sync/filelink_test.go b/internal/sync/filelink_test.go index 2d3d1f2c4..dc3665dae 100644 --- a/internal/sync/filelink_test.go +++ b/internal/sync/filelink_test.go @@ -415,3 +415,18 @@ func TestExtensionOutputStatus_ReportsOrphanOutputs(t *testing.T) { t.Errorf("orphans = %v, want [tutor.toml]", orphans) } } + +// Refs #415: a plain copy tracked before the extension was enabled has no +// source fingerprint, so it must not pass for a converted output. +func TestExtensionOutputStatus_PlainCopyIsNotConverted(t *testing.T) { + src, tgt, agents := agentFixture(t) + if _, err := SyncAgents(agents, src, tgt, "copy", false, false, ""); err != nil { + t.Fatal(err) + } + + synced, _ := ExtensionOutputStatus(tgt, agents) + + if synced[0] { + t.Error("tracked plain copy tutor.md counted as a converted output") + } +}