Skip to content

Add autopilot-safe close policy for uncalibrated feature-like PRs #218

@Takhoffman

Description

@Takhoffman

Problem

ClawSweeper currently has strong merge-readiness checks: code quality, review findings, bot comments, security status, validation proof, and merge preflight. Those checks answer whether a PR is safe enough to merge, but they do not always answer whether the repository should carry the change.

That leaves a churn failure mode: a non-maintainer PR can be technically clean, low risk, and well-proven while still adding optional product surface, a new config path, a parallel workflow, or a policy choice that has not been accepted by maintainers. If that PR stays open and appears merge-ready, an automated or low-context maintainer pass may merge it because the issue exists and the code looks good.

A related failure mode is that features often arrive disguised as bugfixes. A PR can say it fixes an issue, but the issue may not identify broken existing behavior. It may instead request new behavior, a different default, a new option, or a product judgment. ClawSweeper should not treat "issue exists" as proof that the PR is a bug repair.

Proposal

Add an autopilot-safe close policy for non-maintainer, uncalibrated PRs that are feature-like, product-directional, or bugfix-shaped without a real bug contract.

The policy should use existing ClawSweeper concepts rather than adding new labels or categories:

  • item_category
  • requires_new_feature
  • requires_new_config_option
  • requires_product_decision
  • work_candidate: manual_review
  • existing maintainer/protected-item exemptions
  • existing close actions such as low-signal or unsupported closeout

Suggested rule shape:

If a PR is not maintainer-authored, has no maintainer calibration, and requires a new feature, new config option, or product decision, ClawSweeper should close it instead of leaving it open as mergeable work.

For bugfix-shaped PRs, require an existing expected-behavior anchor before treating the work as a bot-landable bug repair:

A bug classification requires a current behavior contract, such as docs, tests, CLI/API behavior, prior behavior, or an explicit maintainer statement. If the linked issue only requests new behavior or a preference change, route it as feature/product work instead of a bugfix.

Maintainer-authored PRs, maintainer-calibrated PRs, protected-label items, security-sensitive items, and active maintainer discussions should remain exempt and route to manual review.

Autoclose exemption guidance

ClawSweeper should give maintainers an explicit, valid way to prevent autoclose when a PR is feature-like but should stay open for maintainer review.

Use existing labels and commands only:

  • clawsweeper:human-review: maintainer-applied autoclose exemption. ClawSweeper must not close the PR while this label is present.
  • /clawsweeper stop: maintainer command that should apply or preserve the same human-review pause and prevent further close/repair automation until a maintainer asks again.
  • /clawsweeper automerge or /clawsweeper autofix: maintainer explicitly opts the PR into the existing bounded ClawSweeper repair loop, so it should not be closed by the low-signal feature-like policy while that opted-in lane is active.
  • enhancement: useful supporting signal that the PR is feature/product work, but it should not by itself be the autoclose exemption unless the event is verified as maintainer-authored and ClawSweeper records it as maintainer calibration.

Suggested policy:

If `clawsweeper:human-review` is present, ClawSweeper must skip autoclose for this PR and treat the remaining decision as maintainer-owned.

If `/clawsweeper stop` was issued by a maintainer, ClawSweeper must pause close/repair automation and leave the PR open for maintainer handling.

If a maintainer explicitly opts the PR into `/clawsweeper automerge` or `/clawsweeper autofix`, the PR is calibrated for that bounded lane and must not be closed by the uncalibrated churn policy.

Contributor-applied labels or comments must not count as calibration unless GitHub permissions prove they came from a maintainer.

This keeps the close policy aggressive for accidental merge risk while preserving a clear maintainer override path. The important behavior is not just "keep reviewing"; it is "do not autoclose this PR while the maintainer-owned exemption is present."

Author guidance

The close comment should be direct but reversible. It should explain that the implementation may be reasonable, but passing tests and proof do not establish product acceptance. The author should be routed to Discord or another maintainer-owned discussion path for sponsorship. A maintainer can then reopen the PR, request a narrower version, or confirm the direction is accepted.

Example tone:

Thanks for the PR. Closing this because it adds or changes product surface without maintainer-confirmed direction yet. The implementation may be reasonable, but passing tests and proof are not enough for ClawSweeper to keep feature-like work mergeable by default.

If you want to pursue this, please bring the proposal to the maintainer discussion channel and ask for sponsorship. A maintainer can reopen this PR, request a narrower version, or apply `clawsweeper:human-review` to keep it open for maintainer review.

For bugfix-shaped PRs without a bug contract:

Thanks for the PR. Closing this because the linked issue does not establish a broken existing behavior that ClawSweeper can treat as a bug repair. This may still be a useful product change, but it needs maintainer sponsorship before it should remain open as mergeable work.

Acceptance criteria

  • ClawSweeper treats proof of behavior as separate from permission to merge.
  • Non-maintainer PRs that require new feature/config/product direction are closed unless maintainer calibration exists.
  • Bugfix-shaped PRs require an existing expected-behavior contract before ClawSweeper treats them as bot-landable bug repairs.
  • Maintainer-authored and maintainer-calibrated PRs are exempt.
  • clawsweeper:human-review prevents autoclose while present.
  • Maintainer /clawsweeper stop prevents autoclose/repair automation until a maintainer asks again.
  • Maintainer /clawsweeper automerge or /clawsweeper autofix counts as calibration for the bounded repair lane and bypasses the uncalibrated churn close policy.
  • enhancement can support feature classification, but does not bypass autoclose unless verified as maintainer-authored calibration.
  • Contributor-applied labels or comments do not bypass the close policy unless they are verified as maintainer-authored.
  • Closure comments explain how to get the PR reconsidered by a maintainer.
  • The implementation reuses existing fields and close mechanics; it does not require new public labels or categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions