fix(upstream-triage): distinguish subject hints from patch matches (#569)

* fix(upstream-triage): require patch identity before skipping commits

* fix(upstream-triage): retain subject-only ports as verification hints

* changelog: place the #569 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-21 07:21:40 +02:00
1 parent b67eb9e05a
commit 358d167cff
3 files changed
+70 -4

No files matched your search

+55
View File
@@ -205,6 +205,61 @@ class AlreadyAppliedTests(TriageRepoFixture):
self.assertIn("**1** worth reviewing", result.stdout)
class SubjectCollisionTests(TriageRepoFixture):
def test_different_patch_with_same_subject_requests_verification(self):
self.write("kept.py", "print('upstream fix')\n")
upstream_sha = self.commit("Fix configuration")
self.set_upstream_to_head()
git(self.root, "reset", "--hard", "HEAD~1")
self.write("shared.txt", "fork configuration\n")
fork_sha = self.commit("Fix configuration")
result = self.run_triage()
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("**0** worth reviewing", result.stdout)
self.assertIn(f"subject matches fork commit {fork_sha[:9]}, patch differs: verify", result.stdout)
self.assertNotIn(f"git cherry-pick {upstream_sha}", result.stdout)
self.assertNotIn("already applied (cherry-picked)", result.stdout)
def test_conflict_resolved_personalized_port_has_distinct_verify_reason(self):
profile = ".claude/skills/job-application-assistant/01-candidate-profile.md"
self.write(profile, "Name: template\nGuidance: old\n")
self.commit("Add template profile")
self.write(profile, "Name: template\nGuidance: improved\n")
upstream_sha = self.commit("Improve profile guidance")
self.set_upstream_to_head()
git(self.root, "reset", "--hard", "HEAD~1")
self.write(profile, "Name: personal\nGuidance: old\n")
self.commit("Personalize profile")
picked = subprocess.run(["git", "cherry-pick", upstream_sha], cwd=self.root,
capture_output=True, text=True)
self.assertNotEqual(picked.returncode, 0, "fixture must exercise a real conflict")
self.write(profile, "Name: personal\nGuidance: improved\n")
git(self.root, "add", profile)
git(self.root, "cherry-pick", "--continue")
fork_sha = git(self.root, "rev-parse", "HEAD").strip()
result = self.run_triage()
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("**0** worth reviewing", result.stdout)
self.assertIn(f"subject matches fork commit {fork_sha[:9]}, patch differs: verify", result.stdout)
self.assertNotIn("already applied (cherry-picked)", result.stdout)
def test_same_patch_with_renamed_subject_is_still_already_applied(self):
self.write("kept.py", "print('upstream fix')\n")
upstream_sha = self.commit("Fix configuration")
self.set_upstream_to_head()
git(self.root, "reset", "--hard", "HEAD~1")
self.write("fork_only.txt", "fork\n")
self.commit("Fork configuration")
git(self.root, "cherry-pick", upstream_sha)
git(self.root, "commit", "--amend", "-m", "Port upstream configuration fix")
result = self.run_triage()
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("**0** worth reviewing", result.stdout)
self.assertIn("already applied (cherry-picked)", result.stdout)
class SuggestedCherryPickOrderTests(TriageRepoFixture):
def test_suggested_commands_apply_dependent_changes_in_ancestry_order(self):
self.write("kept.py", "print('first upstream change')\n")