Skip to content

source-control: triplicated guarded-mutation preamble in babysit scripts wants a reviewed hoist #3449

Description

@kyle-sexton

Context

Found by the repo-wide /code-tidying:batch-simplify sweep (62 groups / 986 files, branch claude/repo-code-tidying-batch-twhddw). Deferred from the sweep as dedicated-PR-shaped work: the consolidation crosses file or contract boundaries a behavior-preserving sweep must not cross.

refresh_pr_branch.py:109-116 + manage_feedback_ledger.py:173-180 + request_review.py:305-312 triplicate the guarded-mutation preamble. Hoisting is a guard-contract shape change that wants explicit review, not a sweep edit.

Proposed work

  • Extract the preamble into a shared helper with the guard contract documented, updating all three call sites in one reviewed PR.

Acceptance criteria

  • Single helper, three call sites, byte-identical guard behavior demonstrated by existing suites.

References

  • plugins/source-control/skills/babysit-prs/scripts/refresh_pr_branch.py:109-116

Filed by the /code-tidying:batch-simplify closeout (Phase 8).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions