Skip to content

Continue repo.sh ownership reduction for GitHub settings and Project delegation #1563

Description

@codeforester

Goal

Continue the documented basectl repo ownership reduction by separating GitHub repository settings, branch-protection payloads, and Project metadata delegation from local baseline generation where that can be done without changing behavior.

Background

docs/repo-command-ownership.md records that repo.sh has already had repo installer-template and repo agent-guidance extracted into command-owned helpers. The same map names GitHub repository settings, branch-protection payloads, and Project metadata delegation as follow-up candidates. Current repo.sh still combines local baseline writers, GitHub repo creation/configuration, default branch ruleset payloads, Project metadata handoff, PR branch/worktree helpers, clone, checks, and dispatch. The reason to split is ownership clarity around these responsibilities, not raw line count.

Scope

  • Re-read docs/repo-command-ownership.md and confirm the current implementation still matches its responsibility map.
  • Extract one cohesive GitHub settings boundary if it is still natural, such as repository labels/settings plus default-branch ruleset payload helpers.
  • Keep shared path, dry-run, Git, and PR worktree primitives in repo.sh unless multiple extracted commands prove a smaller common helper is needed.
  • Keep structured GitHub Project semantics in Python or existing Project engines rather than adding more shell policy.
  • Update the ownership doc to record what moved and what intentionally stayed.

Acceptance Criteria

  • Public basectl repo init, repo configure, repo clone, repo check, repo agent-guidance, and repo installer-template behavior is unchanged.
  • The extracted boundary has a command-specific or responsibility-specific name and tests that match the moved behavior.
  • Existing generated PR and Project metadata flows continue to work.
  • docs/repo-command-ownership.md is current after the change.
  • The PR explains why the split is a natural ownership reduction, not a cosmetic file-size edit.

Validation

  • Focused BATS coverage for repo configure, repo init, generated PR flows, and any moved helper behavior.
  • Relevant GitHub helper tests if Project or ruleset handoff is touched.
  • git diff --check.

Non-Goals

  • Do not rewrite basectl repo in Python in this slice.
  • Do not move generic GitHub shell helpers to base-bash-libs in this issue.
  • Do not split every section of repo.sh.
  • Do not change generated repository baseline files or GitHub Project field semantics.

Project Fields

  • Priority: P3
  • Status: Backlog
  • Size: M
  • Area: Shell
  • Initiative: Contract Hardening

Agent Assignment

Human first. This is refactor work with public behavior preservation and should be reviewed against the ownership map before implementation.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions