Skip to content

Conversation

@EspenAlbert
Copy link
Owner

@EspenAlbert EspenAlbert commented Feb 12, 2026

Summary

  • Embed source commit timestamp as <!-- path-sync: sha=... ts=... --> HTML comment in PR body to track which source state was synced
  • Skip PR body overwrite when existing PR was already synced from an equal or newer source commit
  • Close stale PRs when path-sync copy or dep-update finds zero changes (source and destination already in sync)

Changes

File What
models.py SYNC_METADATA_PATTERN, SyncMetadata, parse_sync_metadata(). Updated DEFAULT_BODY_TEMPLATE with metadata comment. Added src_commit_ts param to format_body
git_ops.py get_commit_timestamp(), get_pr_body(), has_open_pr(), close_pr()
cmd_copy.py Thread commit_ts through call chain. Pre-check in _push_and_pr to skip body update. Close stale PR in _sync_destination at total == 0
cmd_dep_update.py Close stale PRs for NO_CHANGES results in _update_and_validate
models_test.py Tests for parse_sync_metadata and format_body metadata roundtrip

Design decisions

  • Source commit timestamp (src_repo.head.commit.committed_datetime) rather than destination sync commit, because the destination commit is always created during the run and would defeat comparison
  • HTML comment <!-- path-sync: ... --> is invisible in rendered markdown, backward-compatible (missing comment = always overwrite)
  • Keep remote branch on close: next sync reuses the same branch name, no orphan risk

@EspenAlbert EspenAlbert changed the title feat: Check PR description for SDLC commit before overwriting feat(copy): skip PR body overwrite when already synced from newer commit Feb 12, 2026
@EspenAlbert EspenAlbert marked this pull request as ready for review February 12, 2026 20:10
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.

1 participant