Skip to content

Next-action state machine: commit → push → PR → checks → merge #489

Closed

Description

@currentbits

Parent: #382.

Pure decision for the thread top-bar next-git-action button.

Inputs: dirty working tree, upstream ahead/behind, worktree vs main checkout, PR number/state, CI checks.

Priority:

  1. Uncommitted changes → Commit (opens Changes)
  2. Unpushed commits (ahead, or worktree with no upstream) → Push
  3. No PR → Create PR (git.createPr with the thread title)
  4. Open PR + pending/unknown checks → Watch checks
  5. Open PR + failing checks → Checks failed (opens the PR; not merge)
  6. Open PR + green or no CI → Merge
  7. Merged / nothing to do → hide

Not a diagnosis surface. Procedural guidance only.

Activity

  1. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Round 22 intel: Claude Code background sessions now commit and push before finishing, open a draft PR only when the task calls for one, and follow the git instructions in the repo's CLAUDE.md (commit message format, branch naming, PR conventions). Three details for the state machine: (1) the PR step is conditional on task type, not unconditional: a docs fix or experiment may end at push; (2) the repo's own git conventions are an input to the chain, so CLAUDE.md/AGENTS.md git instructions should be parsed and honored per project; (3) 'background' sessions doing this autonomously means the state machine needs the same gates: draft by default, human promotes.

  2. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Verified done. Pure decision function in src/nextGitAction.ts (suggestNextGitAction) implements the full priority chain: dirty→Commit, unpushed→Push, no PR→Create PR, pending checks→Watch checks, failing→Checks failed, green→Merge, merged/nothing→hidden. 23/23 tests pass in test/nextGitAction.test.ts.

  3. added
    plan:done
    and removed
    plan:doing
    on Aug 18, 2026
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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions