Visitar URL original
Recognize a Conflicted Promotion's Branch Cut From Main in Cleanup and the Prose Gate by ptr727 · Pull Request #4152 · ptr727/ProjectTemplate · GitHub
Skip to content

Recognize a Conflicted Promotion's Branch Cut From Main in Cleanup and the Prose Gate - #4152

Merged
ptr727 merged 10 commits into
developfrom
burndown/promotion-branch-shape
Nov 13, 2026
Merged

ptr727 merged 10 commits into
developfrom
burndown/promotion-branch-shape

Conversation

@ptr727

@ptr727 ptr727 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

A conflicted develop -> main promotion goes through a branch cut from main that merges develop, per the branching-and-release-model reference. Before this change, two hub tools didn't recognize that shape. This change makes both read it from content and ancestry, never from the branch name.

  • pr_review.py cleanup now takes a merged pull request into the default branch, as well as one into develop. For the default branch, GitHub's comparisons must show the merged head in the default branch's history and the head's second parent in develop's. Any other pull request into the default branch is still refused. The REST reads cleanup makes move into the new scripts/pr_cleanup_rest.py, which keeps scripts/pr_cleanup.py under its line ceiling.
  • The prose gate's comment-added stand-down in validate-task.yml still covers a develop-headed promotion on the release model. It now also covers a same-repository head into the default branch where every line in each path the head changes appears in that path at the head's merge base with develop or with the base branch.
  • Docs and skills. scripts/README.md, the pr_cleanup.py docstring, and docs/reusable-workflows.md describe the new shape. merge-and-release step 8 gains a bullet that runs cleanup on a conflicted promotion's pull request. pr-review-conduct and repo-worktree "Listing and Cleanup" route that branch through cleanup instead of leaving it to the sweep or a maintainer delete.
  • Also fixed in files this change touches:

Closes on promotion: #4062

Local-pass findings, fixed

The first local pass raised two introduced findings. The second pass, over the whole branch, raised none.

  • tests/test_pr_review.py's writes guard and tests/test_pr_review_size.py's CEILINGS now name scripts/pr_cleanup_rest.py. The moved REST helper stays held to GET, and the new module has a ceiling of 100 lines.
  • drive-pr step 4 now names the conflicted promotion merged into main that cleanup takes.

Verification

  • tests/test_pr_cleanup.py, tests/test_prose_lint.py, tests/test_pr_review.py, tests/test_workflow_steps.py, and tests/test_pr_review_size.py pass under uv run --no-project --with-requirements tests/requirements.txt.
  • scripts/build_dist.py --check reports the generated skill trees current.
  • scripts/prose_lint.py --diff <merge-base> reports nothing.
  • A recorded local-strict-review pass covers the pushed head.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements

    • Cleanup guidance and checks now support eligible merged promotion pull requests, including conflicted promotions into the default branch.
    • Automated review-comment checks better recognize conflicted promotions and avoid flagging them as ordinary changes when their content comes from the relevant branches.
    • Cleanup checks provide clearer refusals when a pull request is ineligible or its promotion history cannot be verified.
  • Documentation

    • Clarified promotion cleanup steps and where to configure mypy target settings.

ptr727 and others added 8 commits November 13, 2026 01:28
The comment stand-down reads a head that is not develop by its content:
every path it changes matches its merge base with develop or with the
default branch. Cleanup accepts a merge into the default branch where
GitHub reads the merged head in that branch's history and the head's
second parent in develop's. The scripts README no longer claims git
worktree remove refuses untracked changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The promotion reads took pr_cleanup.py past its size ceiling, so the
REST reads and the promotion shape move to a library module beside it.
pr-review-conduct sends a conflicted promotion's branch to the same
cleanup command rather than to the sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file both sides changed and the merge combined now stands down when
every line it holds sits in that file on one side. Cleanup's ancestry
check reads through pr_review.commit_state rather than a second compare
reader. merge-and-release keeps its hand removal to a develop-headed
promotion, and the cleanup contract names its dirty-worktree refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The worker driving this branch died on an API authentication error with
these edits uncommitted. The maintainer chose to keep them (#4150). The
next local review pass judges them with the rest of the branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The type-check step reads a mypy.ini, .mypy.ini, or setup.cfg [mypy] section as well as
[tool.mypy], so a repository whose config lives there declares its target there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cleanup now takes a conflicted promotion's pull request into main, so repo-worktree names it beside
the develop case and no longer says such a branch waits for the sweep or a maintainer delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 13, 2026 15:05
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 839874ac894c91e52c034f26ae852d6848878e05, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds merge-base content checks for promotion pull requests in the prose-gate workflow. It adds ancestry checks for cleanup of promotion pull requests targeting the default branch, and updates related cleanup instructions and mypy configuration guidance.

Changes: Conflicted Promotion Handling

Layer / File(s) Summary
Recognize promotions for prose-gate stand-down
.github/workflows/validate-task.yml, tests/test_prose_lint.py, docs/reusable-workflows.md
The workflow uses the pull request head SHA and compares changed-path content against merge-base files. Tests cover qualifying promotions and cases that must not stand down.
Validate promotion ancestry before cleanup
scripts/pr_cleanup_rest.py, scripts/pr_cleanup.py, tests/test_pr_cleanup.py, tests/test_pr_review.py, tests/test_pr_review_size.py
The cleanup check accepts merged pull requests targeting develop or the default branch. For the default branch, it validates promotion ancestry. Tests cover valid, refused, and unreadable ancestry.
Document promotion cleanup procedures
.agents/skills/*, scripts/README.md
The instructions describe cleanup for conflicted promotions and update the worktree and branch-removal guidance.

Mypy Configuration Guidance

Layer / File(s) Summary
Expand documented mypy configuration locations
docs/reusable-workflows.md
The documentation adds mypy.ini, .mypy.ini, and setup.cfg [mypy] sections as target configuration locations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: Minimal · up to a51b9

The change extends cleanup and the prose gate to recognize conflicted develop-to-main promotions. Both paths refuse when the history or content checks cannot be confirmed. No concrete merge-blocking risk was found in the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes: cleanup now recognizes a conflicted promotion branch cut from main, and the prose gate's stand-down covers the same case. The raw summary and objectives confirm b…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: cleanup now recognizes a conflicted promotion branch cut from main, and the prose gate's stand-down covers the same case. The raw summary and objectives confirm both changes: pr_cleanup.py and pr_cleanup_rest.py accept default-branch promotions with ancestry checks, and validate-task.yml and the prose gate extend the stand-down to same-repository heads into the default branch. The title is long (14 words) but specific and accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 47dee74 and a51b9a2.

Files ignored due to path filters: 12

  • .claude-plugin/fleet-skills/.source-digests/drive-pr is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/.source-digests/merge-and-release is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/.source-digests/pr-review-conduct is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/.source-digests/repo-worktree is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/drive-pr/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/drive-pr/SKILL.md is excluded by !.github/skills/**
  • .github/skills/merge-and-release/SKILL.md is excluded by !.github/skills/**
  • .github/skills/pr-review-conduct/SKILL.md is excluded by !.github/skills/**
  • .github/skills/repo-worktree/SKILL.md is excluded by !.github/skills/**
Files selected for processing: 13

  • .agents/skills/drive-pr/SKILL.md
  • .agents/skills/merge-and-release/SKILL.md
  • .agents/skills/pr-review-conduct/SKILL.md
  • .agents/skills/repo-worktree/SKILL.md
  • .github/workflows/validate-task.yml
  • docs/reusable-workflows.md
  • scripts/README.md
  • scripts/pr_cleanup.py
  • scripts/pr_cleanup_rest.py
  • tests/test_pr_cleanup.py
  • tests/test_pr_review.py
  • tests/test_pr_review_size.py
  • tests/test_prose_lint.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

…t drive-pr's Cleanup Refusal

The REST helper moved out of pr_cleanup.py now sits under the GET-only writes scan and a size
ceiling of its own, and drive-pr names the conflicted promotion cleanup now takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 7db08d714f0e1d1a14c6d817ae70a7a2d548365c, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Changes are still needed because an unvalidated default branch ref can produce incorrect ancestry results and cleanup actions, while the new module is not yet covered by the existing source-contract and size tests.

2 open issues
What changed in this PR

This PR updates cleanup and prose-gate behavior for conflicted promotion branches cut from the default branch and merged with develop. It also extracts REST helpers, expands tests, updates operational documentation, and regenerates skill distributions.

Changes:

  • Recognizes promotion branches through GitHub ancestry and content rather than branch names.
  • Adds workflow and cleanup tests for valid, invalid, and unreadable promotion shapes.
  • Updates cleanup contracts, workflow guidance, skills, and generated distribution digests.
File Description
tests/​test_prose_lint.py Adds workflow harness support and promotion stand-down scenarios.
tests/​test_pr_cleanup.py Adds tests for ancestry-based promotion cleanup decisions.
scripts/​README.md Documents promotion cleanup behavior and updated worktree refusal rules.
scripts/​pr_cleanup.py Allows verified promotions into the default branch through cleanup.
scripts/​pr_cleanup_rest.py Provides REST reads and ancestry validation for promotion detection.
docs/​reusable-workflows.md Documents the expanded prose-gate promotion exemption and mypy configuration sources.
.github/​workflows/​validate-task.yml Detects promotion content and ancestry in the prose gate.
.github/​skills/​repo-worktree/​SKILL.md Routes conflicted promotion cleanup through the cleanup command.
.github/​skills/​pr-review-conduct/​SKILL.md Requires cleanup after conflicted promotion merges.
.github/​skills/​merge-and-release/​SKILL.md Adds conflicted promotion cleanup to release completion.
.claude-plugin/​fleet-skills/​skills/​repo-worktree/​SKILL.md Regenerates the distributed repo-worktree skill.
.claude-plugin/​fleet-skills/​skills/​pr-review-conduct/​SKILL.md Regenerates the distributed review-conduct skill.
.claude-plugin/​fleet-skills/​skills/​merge-and-release/​SKILL.md Regenerates the distributed merge-and-release skill.
.claude-plugin/​fleet-skills/​.source-digests/​repo-worktree Updates the repo-worktree source digest.
.claude-plugin/​fleet-skills/​.source-digests/​pr-review-conduct Updates the review-conduct source digest.
.claude-plugin/​fleet-skills/​.source-digests/​merge-and-release Updates the merge-and-release source digest.
.agents/​skills/​repo-worktree/​SKILL.md Updates the authored repo-worktree cleanup guidance.
.agents/​skills/​pr-review-conduct/​SKILL.md Updates the authored post-merge cleanup guidance.
.agents/​skills/​merge-and-release/​SKILL.md Updates the authored release cleanup procedure.

Review effort: Lite

Comment thread scripts/pr_cleanup_rest.py Resolved
Comment thread scripts/pr_cleanup_rest.py Resolved
…safe Branch in a Compare Path

The promotion cases' setup merge ran without the constructed identity, so on a runner with none
configured the merge never started and the setup commit found nothing to commit. Cleanup's ancestry
read now refuses a branch name that would change the compare path, as its rules read already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head a51b9a2f2683d6e3cf1f0b940fb9f6963ef7caaf, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.75%. Comparing base (b38e084) to head (a51b9a2).
⚠️ Report is 187 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4152      +/-   ##
===========================================
- Coverage    81.60%   76.75%   -4.86%     
===========================================
  Files           26       41      +15     
  Lines         9070    14177    +5107     
===========================================
+ Hits          7402    10882    +3480     
- Misses        1668     3295    +1627     
Flag Coverage Δ
python-3.13 76.75% <100.00%> (-4.86%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 376d69f into develop Nov 13, 2026
13 checks passed
@ptr727
ptr727 deleted the burndown/promotion-branch-shape branch November 13, 2026 16:17
ptr727 added a commit that referenced this pull request Nov 13, 2026
… Rules (#4189)

## Summary

Promotes the backlog-burndown rounds and changes from other hub sessions
from `develop` to `main`.

- Hooks and the prose gate: #4132, #4134, #4136, #4145, #4152, #4184.
The Husky hook reads its path list once and diffs a merge against
`MERGE_HEAD`. Interrupts re-raise their signal, a Markdown code span
reads as quoted data, and the gate picks a commit's diff base and
recognizes a conflicted promotion's branch cut from `main`.
- Procedures and carried rules: #4133, #4139, #4141, #4149, #4166,
#4177, #4179, #4183, #4185. Resync, audit and check-this-repo procedure
gaps, code style and shell interrupt rules, review-loop gaps across four
skills, the context and delegation section of `AGENTS.md`, question
rules in governance, the promotion line in pull request bodies,
closing-keyword behavior on promotion, and the history-rewrite premise.
- Review and cleanup tooling: #4138, #4148, #4154, #4156, #4157, #4163,
#4164, #4168, #4174, #4180. Cleanliness reads, parked handoffs, the
backlog report's JSON output, exact inline script pins, trusted inputs,
env-file includes, the bounded review wait, side-reviewer matching, and
a Copilot billing-failure notice read as a refusal.
- Workflow and runbook contract: #4153, #4155, #4169, #4171, #4178,
#4182. The runtime-secrets check, a registry entry and spec references,
the Copilot runbook pointers, credential-free checkout steps, and the
deploy-key and runner wording.
- From other hub sessions: #4159 (a repository's own .NET line under a
fleet default), #4161 (the 1Password CLI as an optional host tool),
#4162 (Codex's Windows installer and one managed opencode copy). These
carry no promotion line.

#4182 carries no promotion line by design, and #4175 holds the split-out
part of #4057's scope. Both #1448 and #4175 stay open.

Fixes #1071
Fixes #1154
Fixes #1391
Fixes #1471
Fixes #1594
Fixes #1620
Fixes #1627
Fixes #1650
Fixes #1801
Fixes #2853
Fixes #3620
Fixes #3668
Fixes #3697
Fixes #3766
Fixes #3787
Fixes #3837
Fixes #3840
Fixes #3842
Fixes #3844
Fixes #3865
Fixes #3882
Fixes #3890
Fixes #3894
Fixes #3912
Fixes #3916
Fixes #3954
Fixes #4014
Fixes #4015
Fixes #4016
Fixes #4043
Fixes #4050
Fixes #4057
Fixes #4058
Fixes #4062
Fixes #4084
Fixes #4097
Fixes #4098
Fixes #4099
Fixes #4104
Fixes #4108
Fixes #4114
Fixes #4115
Fixes #4117
Fixes #4118
Fixes #4119
Fixes #4121
Fixes #4122
Fixes #4123
Fixes #4131
Fixes #4135
Fixes #4140
Fixes #4142
Fixes #4143
Fixes #4144
Fixes #4151

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants