Dart Manage Pr

manage an open DART pull request through CI, review, and cleanup

dartsim 1.2k updated 22d ago
Claude CodeGeneric
View source ↗
---
description: manage an open DART pull request through CI, review, and cleanup
agent: build
---

Manage an open DART pull request after explicit maintainer/user approval for
mutations: $ARGUMENTS

## Required Reading

@AGENTS.md
@docs/onboarding/contributing.md
@docs/onboarding/ci-cd.md
@docs/onboarding/ai-tools.md

## Invocation Contract

When the user says `manage <PR>` or `continue managing <PR>` without limiting
the request to status-only, treat that as approval to run the full PR-management
loop to the next terminal state:

- required policy metadata checked and corrected when stale;
- CI monitored until green, failed, or blocked;
- merge conflicts reproduced and resolved locally;
- review comments addressed, pushed, resolved, and re-reviewed when appropriate;
- PR body/testing evidence refreshed when it no longer matches the branch.

This explicit approval covers routine PR-maintenance mutations needed for that
loop: additive fix commits and pushes, PR description/metadata corrections,
resolving already-addressed review threads, rerunning failed CI jobs, and
requesting a fresh AI review after follow-up fixes. It does **not** cover
merging the PR into the target branch, force-pushes, branch deletion, PR
closure, base-branch changes, or human reviewer requests; ask separately for
those.

Do not call the PR managed just because checks are green. Continue until the PR
is mergeable with required checks complete and addressed review threads are
resolved, or until a concrete blocker remains.

## Identify the PR

Use the PR number or URL from `$ARGUMENTS`. If none is provided, infer the PR
from the current branch:

```bash
gh pr view --json number,url,headRefName,baseRefName

Then inspect the full state:

gh pr view <PR_NUMBER> --json number,title,state,isDraft,baseRefName,headRefName,mergeStateStatus,milestone,url,reviewDecision,statusCheckRollup
gh pr checks <PR_NUMBER>

Workflow

  1. Confirm scope and policy:
    • Check that the base branch, milestone, title, and PR template are correct.
    • For bug fixes, verify the required DART 6 LTS + main dual-PR flow.
    • Confirm the PR body's testing/status section matches the current head and does not point reviewers to deleted dev-task evidence as still pending.
    • Confirm the PR body is readable and follows template order: Summary, Motivation / Problem, Changes / Key Changes, optional Before / After, Testing, Breaking Changes, and Related Issues / PRs. Keep Summary first as the skimmable user/downstream outcome; if problem context must lead, fold it into Summary and keep the fuller why in Motivation. Mechanics belong in Changes unless they explain user-visible risk.
    • When the PR has meaningful user-facing API, workflow, behavior, or performance impact, confirm the body has a concise Before / After section that compares the relevant old and new surfaces. For performance claims, ensure the baseline is explicit: CPU path, parent commit, main, or prior implementation, plus workload, metric, and important limitations. Each row should be phrased as a user-visible before/after, with backend details used only as supporting context.
    • For visual PR evidence, ensure transient screenshots, headless renders, GIFs, and videos are hosted as GitHub PR/issue Markdown attachments (https://github.com/user-attachments/assets/...) rather than committed to the branch. If evidence files were committed only for the PR description, remove them and replace the PR body entry with a GitHub attachment URL. If the current tooling cannot upload an attachment, ask a maintainer to upload the local artifact through the PR editor instead of keeping it under docs/assets/.
    • Inspect local state before editing:
      git status --short --branch
      git diff --stat
      git diff --check
      
  2. Monitor CI:
    gh pr checks <PR_NUMBER> --watch --interval 30 --fail-fast
    
    If checks are still queued or running, report the current jobs and keep watching unless the user asked only for status. Also poll mergeability:
    gh pr view <PR_NUMBER> --json mergeStateStatus,headRefOid,isDraft,reviewDecision
    
    If GitHub reports conflicts, fetch the target branch and resolve them before treating green checks as sufficient.
  3. Fix failures:
    • Inspect the newest failed run or job, not an older cancelled run.
    • Use the dart-fix-ci workflow for non-trivial CI debugging.
    • Reproduce locally with the relevant pixi run ... task or focused test.
    • Before committing fixes, run pixi run lint; also run build or tests when code or behavior changed.
    • Commit only intended files. Push only after explicit maintainer/user approval, then continue monitoring the PR.
    • For already-published PRs, prefer additive follow-up commits so reviewers can inspect each update. Amend or force-push only after explicit maintainer/user approval and only when the user explicitly requests it or when there is a clear reason such as removing sensitive content or repairing broken branch history.
    • Before every push, first merge the latest base branch into the PR branch (on every push, not just the first) so each pushed/CI-tested state reflects current main and conflicts surface early:
      git fetch origin <base-branch>
      git merge --no-ff origin/<base-branch>  # never rebase a published PR branch
      # rebuild + retest if the merge touched code
      git push                                 # after explicit approval
      
      The local base merge is a routine pre-push step; the push itself still requires explicit maintainer/user approval. Do not rebase a published PR branch by default because it invalidates existing CI runs and makes PR review/comment history harder to follow. Rebase or force-push only when the maintainer explici

Maintain Dart Manage Pr?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

Dart Manage Pr on getagentictools
[![Dart Manage Pr on getagentictools](https://getagentictools.com/badge/loops/dartsim-dart-manage-pr.svg)](https://getagentictools.com/loops/dartsim-dart-manage-pr?ref=badge)