Skip to content

Studio map: Accept opens a draft PR, follows it, and recovers when it closes #765

Done

Description

@danielrispler

Parent

#753

What to build

Accept's second way out opens a draft PR with the map and writes nothing to the checkout; the map shows from plotkeeper's copy until the PR merges. A PR closed unmerged leaves the map on show with a way forward. #753, "Accepting" ("Open a draft PR", "Following the PR") and user stories 26-30.

Acceptance criteria

  • Open a draft PR reuses Back a law's draft-PR flow: a detached temporary worktree in the data folder, branch first-map/<id>, the user's git identity, a push to origin, gh pr create --draft; nothing is written to the checkout.
  • The accepted map is kept as first-map/<project>.pending.json with the PR's number and branch, read by ticket 4's third step.
  • The button is muted with a reason when gh is missing or gh auth status fails.
  • The server asks gh pr view <number> --json state,mergedAt for the pending PR, under the map fetch's cooldown and in-flight guard: MERGED deletes the pending file; CLOSED keeps it, and the head says "Map not in the repo" with Write to <path>, Open a draft PR and Discard; OPEN changes nothing; any error, timeout or unreadable answer changes nothing.
  • The promotion PR gets no Map diff or Ratify items, and its brief takes the existing quiet path; no code overrides it.
  • Tests with a stub gh and git remote: the flow writes nothing to the checkout; each lookup answer above; from CLOSED, each of the three actions works.
  • Snap fixtures: "Map waiting on PR #N" and "Map not in the repo" with its actions.
  • docs/studio/behaviour/map.md describes the PR path.

Reading

Touches

  • Files: server/src/map_draft.rs, server/src/back_a_law.rs, server/src/map.rs, ui/map-draft.ts, ui/map.ts, scripts/snap/fixtures-map.ts, docs/studio/behaviour/map.md
  • Session: auto mode
  • Route: strong · effort high — a persisted pending map, gh lookups whose errors must not delete it, and the push across a trust boundary

Activity

  1. added
    ready-for-agent
    on Nov 27, 2026
  2. danielrispler commented on Nov 28, 2026

    @danielrispler
    OwnerAuthor

    Resolved in PR #776 (squash e6034bf on main), spec #753. Built on the integration branch as 9179325: Accept opens a draft PR, follows it, and recovers when it closes; e727296 finds an earlier PR when pressed again.

    Route outcome: strong·high claude/opus → pass | 22m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions