Skip to content

Restrict Unsolicited Comments on Public Repositories Through the Repo Configuration Script #4329

Description

@ptr727

Problem

Public fleet repositories have started receiving unsolicited comments on issues and pull requests from what look like advertising bots. Nothing in the fleet's repository configuration limits who can interact with a public repository. repo-config/configure.sh applies settings, rulesets, labels, security toggles, and the project link, but sets no interaction policy. So every public repository is open to comments, issues, and pull requests from any account.

Public repositories fall into two groups that need different policies:

  • Public for reference only. The hub is public so other repositories' agents can fetch it, not to invite outside participation. Only collaborators should be able to comment, open issues, or open pull requests.
  • Public products with a user community. PlexCleaner is the example. Anyone should still be able to open an issue and comment on one. Comments on the maintainer's own pull requests should be limited where GitHub allows it.

Proposal

Encode the interaction policy in repo-config/configure.sh, apply it on apply, and assert it on check, so the audit catches a repository that drifted or lapsed.

  1. Declare the policy per repository in registry/repos.json. Add a field, for example publicInteraction, with two values: collaborators (the reference-only group) and community (the product group). Default to collaborators when the field is absent, so a new public repository starts locked down rather than open. The field has no effect on a private repository, and visibility is read live, as cmd_apply already does for has_discussions.
  2. collaborators repositories. Set the repository interaction limit to collaborators_only (PUT /repos/{owner}/{repo}/interaction-limits). This blocks non-collaborators from commenting, opening issues, and opening pull requests. Also decide whether discussions stay enabled on these repositories. Today every public repository gets has_discussions: true, and a reference-only repository gains nothing from it.
  3. community repositories. Leave issues open to everyone. For pull requests, there is no repository setting that limits comments on one pull request while leaving issues open. The candidate mechanism is locking the pull request's conversation (PUT /repos/{owner}/{repo}/issues/{number}/lock), which restricts comments to collaborators. That is per pull request rather than a setting, so it belongs in the pull request opening path (for example a pull_request_target workflow, or the step that opens a pull request in drive-pr and scripts/pr_review.py) rather than in configure.sh. A softer, repository-wide alternative is the existing_users limit, which only blocks accounts younger than 24 hours. Pick one per the open questions below.
  4. check asserts the policy. check_settings (or a new check_interaction) reads GET /repos/{owner}/{repo}/interaction-limits and fails when the limit is missing or wrong for the declared policy.

Constraints to Design Around

  • Interaction limits expire. The longest expiry is six_months, and GitHub then removes the limit silently. A one-time apply therefore leaves every repository open again after six months. check should fail, or at least warn, when the remaining time is under a threshold (for example 30 days), so the audit prompts a re-apply before the lapse rather than after spam arrives. Also consider whether a scheduled re-apply is worth what it would need, since it needs an admin-scoped token on every repository.
  • An account-wide limit is too blunt. PUT /user/interaction-limits applies one limit to every public repository the account owns. It cannot express the two groups, so it is not the mechanism here.
  • The review bots must keep working. The fleet's review loop depends on Copilot, CodeRabbit, and Qodo commenting on pull requests, plus Dependabot opening them. Verify, before rollout, that neither collaborators_only nor a locked pull request conversation blocks any of these from commenting, reviewing, or opening a pull request. A limit that silently silences a reviewer turns into a false green in the review gate, which is worse than spam.
  • Verify the current API surface first. GitHub has been adding pull request access settings. Check whether a durable repository setting now exists that restricts pull request creation or comments to collaborators without expiring. If one does, prefer it over the expiring interaction limit.

Open Questions for the Maintainer

  1. For community repositories, lock each of the maintainer's pull requests on open, apply existing_users repository-wide, or both?
  2. Should collaborators repositories also turn discussions off?
  3. Which public repositories besides PlexCleaner are community? Everything not listed defaults to collaborators.

Acceptance

  • registry/repos.json declares the policy, with the schema in spec/ updated to match.
  • configure.sh apply sets it, skipping private repositories, and configure.sh check asserts it, including the expiry threshold.
  • repo-config/README.md documents the policy and the expiry behavior.
  • Each review bot is confirmed still able to comment on a pull request in a collaborators repository, with the evidence recorded on the pull request.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    decision
    on Nov 20, 2026
  2. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answers (2026-11-22), recorded at a session close:

    1. Community repositories: use the repository-wide existing_users interaction limit. Do not lock pull requests on open. The limit expires after at most six months, so check warns before it lapses, per the constraints above.
    2. Collaborator-only repositories: turn Discussions off.
    3. Community repositories: PlexCleaner and NxWitness. Every other public repository defaults to collaborators.

    Before rollout, the fix still owes the issue's own check that neither limit stops Copilot, CodeRabbit, Qodo or Dependabot. The decision label comes off, and the issue stays open as the work.

  3. removed
    decision
    on Nov 22, 2026
  4. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-22): the branch merged as #4349 and was cleaned up, so this claim holds no files.

    Backlog burndown claim (round 4, group 3, 2026-11-22): branch burndown/r4-interaction-limits, issues #4329.

    Predicted files: repo-config/configure.sh, registry/repos.json, registry/repos.schema.json, spec/validate.py, repo-config/README.md, docs/repo-config.md, and a new tests/test_configure_*.py. Generated trees .github/skills/ and .claude-plugin/ follow any .agents/skills/ edit.

    Grown set granted (2026-11-22): spec/audit.py, tests/test_configure_project.py, tests/test_configure_settings_live.py, README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions