package server import ( "testing" "git.a-wan.net/alan/pipelines/internal/protocol" ) func TestTurnDiffDropsTheHarnessHomeInsideTheFolder(t *testing.T) { changes := &protocol.StageFileChanges{Status: "complete", Files: []protocol.FileChange{ {Path: ".claude-profile/.claude.json"}, {Path: ".claude-profile/projects/x/1.jsonl"}, {Path: ".claude-profile-notes.md"}, {Path: "src/app.py"}, }} got := withoutHarnessState(changes, "/w/caplens", []string{"/w/caplens/.claude-profile", "/home/me/.claude"}) if len(got.Files) != 2 || got.Files[0].Path != ".claude-profile-notes.md" || got.Files[1].Path != "src/app.py" { t.Fatalf("files = %+v", got.Files) } if len(changes.Files) != 4 { t.Fatalf("input changed: %+v", changes.Files) } if same := withoutHarnessState(changes, "/w/caplens", []string{"/home/me/.claude"}); same != changes { t.Fatal("no harness dir inside the folder should keep the changes as they are") } }