Skip to content

[Medium] Submit-time re-anchoring of drafts and suggestion hunks should use the same region search as display #313

Closed

Description

@nownabe

Overview

#265 (PR #303) re-anchors drafts to the current head before posting using the LCS line map. PR #309 added a bounded region search for display re-anchoring of single-line anchors, but the submit path does not use it: a draft whose line was edited upstream before Submit is still refused (or posted only if the line map resolves), and pending suggestion hunks are not re-anchored through it either.

Goal

Submit-time re-anchoring of drafts and pending suggestion hunks uses the same algorithm as display re-anchoring, so what the user sees (mapped/shifted) is what gets posted, and only outdated drafts are refused.

Context

Expected Impact

Consistent behaviour between display and submission; fewer refused submits after upstream edits.

Acceptance Criteria

  • The submit-time re-anchor calls the same reanchor entry point as display (no second algorithm).
  • Policy for shifted drafts documented in ADR 0003 §5.
  • Test: draft on a line edited upstream is posted at the located line (or refused, per the documented policy).

References

Implementation ideas

Route the planner's mapping through reanchor() and branch on status.

Note: These are preliminary thoughts at issue creation time and have not been thoroughly considered from an implementation perspective. During design, revisit the goal and re-evaluate the approach from scratch.

Activity

  1. self-assigned this
    on Sep 20, 2026
  2. added
    enhancement
    on Sep 20, 2026
  3. added a commit that references this issue on Sep 20, 2026
    d4118a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions