Public: anyone can read this; the crew can change it.

A fork's "Take updates from <parent>" issue closes itself once its default branch holds the parent tip it was opened for #1492

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A fork's "Take updates from <parent>" issue now closes itself once the parent's tip is an ancestor of the fork's default branch. `tsc --noEmit` is clean. The new test passes, as do `test/check-list.test.ts` and `test/following.test.ts`. I have not run the whole check.

shipped production is serving it deploy bbd5a0b

opened this

A fork's "Take updates from <parent>" issue now closes itself once the parent's tip is an ancestor of the fork's default branch. tsc --noEmit is clean. The new test passes, as do test/check-list.test.ts and test/following.test.ts. I have not run the whole check.

What changed

  • Closing the issue: settleConverge in src/crew/converge.ts reads forkRelation. When it says synced or ahead and a converge issue is open, it cancels any queued run for that issue. It then comments with the parent's tip and the oldest fork commit that holds it, and closes the issue as done.
  • When it runs: settleOnPush checks on every push or landed pull on a fork. settleAll checks every fork on the crew's one-minute tick, which src/crew/dispatch.ts runs whether or not autonomy is on. It needed a new listAllForks in src/core/repos.ts.
  • No run for a contained tip: convergeFork already returns nothing when the fork isn't diverged, so asking again opens nothing and queues nothing.
  • Tests: test/converge-settled.test.ts, listed in GATE in scripts/gate.ts. It diverges a fork on a conflicting file and opens the converge issue. A still-diverged fork keeps the issue open and the run queued. After a by-hand merge commit with the parent as a second parent, the issue closes. The comment names both commits and the run is cancelled, never started.

Left out

  • Running runs: a run already running is not killed. It finds the issue closed and ends on its own.
  • trevato/forge's issue for 979e19e: I couldn't check that it closes after this lands. The tick does it within a minute of the deploy, so please confirm there.
  • src/core/following.ts: not touched.

Try it: bun test test/converge-settled.test.ts.

🤖 Generated with Claude Code

Closes #1482

Approved

Does what the issue asks: a converge issue closes itself (push, merged pull, and a once-a-minute sweep) when the parent tip is already in the fork default branch, cancels the queued run, and the comment names both commits. The test covers the still-diverged, merged-by-hand, and converge-again paths and is in the gate. No new dependency, no input from users reaches git (oids go through isSafeOid). Nothing to see on a phone or without JS; it is background behaviour, so the page/TTY parity does not apply. Next two things: (1) the closing comment is posted with authorId = issue.authorId, so it reads as the person wrote it; post it as the crew/system identity. (2) A run already running for the issue is left to burn tokens; cancel it too, or have the dispatcher re-check the issue state before starting. Also run prettier on holdingCommit: the rev-list args line is over width.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs