WORK-498
ID:WORK-498Status:draft

refrakt plan migrate pr-attrs — git backfill of PR references

Backfill the pr attribute on legacy done work / fixed bug items from git merge-commit history, so plan status rollups are rich from day one rather than skeletal (only ~2 of 177 items carry a PR today).

Priority:mediumComplexity:complexMilestone:v0.28.0Source:SPEC-049

Criteria completion

Criteria completion: 0 of 6 (0%) checked; tracking started on Jul 9, no incremental history yet0%25%50%75%100%Jul 9Jul 11

Tracking started Jul 9 — check back for trends.

Acceptance Criteria

  • refrakt plan migrate pr-attrs (CLI + MCP) walks git history, dry-run by default with --apply / --git
  • For each done work / fixed bug lacking pr, finds the status-flip commit, walks forward to the first reachable merge commit, and captures Merge pull request #NNN (repo slug from origin)
  • Writes resolved pr="<org>/<repo>#<num>" back to the work item file on --apply
  • Emits a report: resolved, skipped (multiple plausible merge commits), unresolved (direct-to-main / lost history) — unresolved items are listed, not modified
  • Modeled on the existing migrate filenames command structure
  • Tests cover resolution, the skip-on-ambiguity path, and the report shape (against a fixture repo or mocked git)

Dependencies

  • WORK-496 — the pr attribute this backfills

References

  • SPEC-049 — spec (Migration, Open Questions: migration false positives)