Skip to content

feat: render a stack overview block in each PR description #12

Description

@amustafa

Summary

On sr submit, render a marker-delimited stack overview into each pushed PR's description (not a comment), so reviewers see where the PR sits in the stack.

Placement — why the description, not a comment

The block goes in the PR body, delimited by <!-- stackr:stack --> … <!-- /stackr:stack -->. Rationale: a PR comment is owned by the identity that posted it, so on a collaborative stack a second person's sr submit couldn't edit the first person's comment (author-restricted) → failed upsert or duplicate comments. The PR description is editable by the author and anyone with write access, so whoever submits can rewrite the block via gh pr edit --body.

Ownership

Machine-owned: the marked region is fully regenerated on every refresh; content outside the markers (the author's real description) is always preserved. In-marker human edits are not preserved by design.

Content

Vertical list, top→down, current PR marked, trunk at the base; each entry links its PR (number + title). Forked upstack shown as an indented tree. No live CI status (goes stale; not stackr's data).

### Stack
- #103 Add C tests
- **#102 Add B API ◀ this PR**
- #101 Add A models
- `main`

Trigger / scope

  • Runs as part of sr submit, rewriting the block on the PRs submit actually pushes (downstack always; upstack when included). PRs elsewhere self-heal on their next submit.
  • Opt-out via config / --no-stack-comment (name TBD).

Acceptance criteria

  • sr submit inserts the marked block into a PR body that lacks it, preserving existing description text.
  • Re-submitting regenerates the block in place (no duplicates), preserving surrounding body.
  • A different collaborator's sr submit updates the same block (write-access edit path).
  • Block correctly marks the current PR and orders the stack; forked upstack renders as a tree.
  • Opt-out flag/config suppresses all body edits.

Design settled via a grill-me session. Related: sr land (companion issue) consumes these same PRs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions