Skip to content

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

Merged
ptr727 merged 6 commits into
developfrom
burndown/r4-interaction-limits
Nov 22, 2026
Merged

ptr727 merged 6 commits into
developfrom
burndown/r4-interaction-limits

Conversation

@ptr727

@ptr727 ptr727 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Public fleet repositories had no interaction policy, so any account could comment, open issues, or open pull requests. This change declares a policy per repository in the registry. repo-config/configure.sh applies it and checks it, following the maintainer's recorded answer on the issue.

  • Registry. A new publicInteraction field takes collaborators, the default when the field is absent, or community. PlexCleaner and NxWitness are community. registry/repos.schema.json declares the field, and spec/validate.py refuses any other value, a declared null included.
  • configure.sh resolution. The policy is read from the registry before any write, and an unknown value stops the run, a declared null included. collaborators maps to GitHub's collaborators_only interaction limit with Discussions off. community maps to existing_users, which blocks only accounts younger than 24 hours, with Discussions on.
  • configure.sh apply. The pre-flight reads the visibility. On a public repository it also reads any live limit. A limit set on the owning account or organization stops the run with nothing written, since GitHub then refuses a repository limit. After the settings PATCH, apply sets the limit with the longest expiry, six_months, so a re-apply is the renewal. A private repository gets no limit and no limit read, since GitHub answers that read with a 405 error. That behavior was read live.
  • configure.sh check. A new check_interaction group fails on a missing, wrong, account-wide, or unreadable limit. It tests the origin first, since apply cannot replace a limit the owning account set, so that failure names where to remove it. It prints a WARN line without failing once fewer than 30 days remain. The days left are computed by the Python interpreter configure.sh already resolves, since a native Windows jq cannot run fromdateiso8601. check_settings now expects Discussions on only for a public community repository.
  • Audit. spec/audit.py's general-settings check expects the same Discussions value, so the audit and check agree. The file stays under its line ceiling at 2995 lines.
  • Docs. repo-config/README.md gains a "Public Interaction" section covering both groups and the expiry. docs/repo-config.md names the field and the new apply and check behavior. The hub README.md no longer points to Discussions. It says that only collaborators can raise an issue on this reference-only repository.
  • Tests. A new tests/test_configure_interaction.py, which reuses lift and run_bash from tests/test_configure_archived.py, holds 33 offline cases with gh stubbed. It covers the resolution, the apply write, the pre-flight, the check, the Discussions expectation in both check_settings and the audit, and the call-site wiring. tests/test_configure_project.py and tests/test_configure_settings_live.py stub the new group and set the variable it reads. tests/test_configure_project.py now hands its lifted script to bash as a file, since Git Bash cuts a -c argument short at about 8 KiB and cmd_apply lifted whole is now longer than that.

Closes on promotion: #4329

Not Done, Owed Before Rollout

  • The live apply on each repository. No apply or interaction-limit write ran against any live repository in this change. The maintainer runs repo-config/configure.sh apply owner/repo per repository after this merges.
  • The review-bot check the issue requires. Before rollout, confirm with evidence recorded on a pull request that neither limit stops Copilot, CodeRabbit, Qodo, or Dependabot from commenting, reviewing, or opening a pull request. That means collaborators_only on a collaborators repository and existing_users on a community one. A limit that silences a reviewer would read as a false green in the review gate.
  • The README check per collaborators repository. Before applying to a public collaborators repository, remove any link its README carries to its Discussions page, since apply turns Discussions off there. The hub's own README is updated here.

Not Done, Possible Later Backstop

GitHub now has two settings that never expire, both of which restrict creation rather than comments. One is the "Collaborators only" option for pull request creation (changelog, 2026-02-13). The other restricts issue creation to collaborators (changelog, 2026-06-29). Neither limits comments, so the interaction limit remains the only control for the comment spam the issue is about. Either could later be added for collaborators repositories as a backstop that does not lapse. This change adds neither.

Local Review Findings

  • Declined: AUDIT.md section 6 lists what configure.sh check covers without naming the interaction limit. Its list already says check covers "the derived settings", which are the settings the script computes rather than reads from settings.json. The interaction limit is one of those, derived from the registry's publicInteraction like has_discussions. Each FAIL and WARN line it prints names the limit and the fix.
  • Declined, belongs to other repositories: a public collaborators repository whose own README links to its Discussions page would carry a dead link after its first apply, and no audit check finds one. That fix lands in each such repository, outside this one, so it goes to the maintainer. repo-config/README.md "Public Interaction" now names the per-repository README check as owed before a limit is first applied.

Open Introduced Findings, Edit Budget Spent

The third local pass raised two findings after the two edit rounds were spent, so each is listed here with its class and its outcome.

  • introduced, rollout gating (repo-config/configure.sh apply_interaction, repo-config/README.md "Public Interaction"). Once this reaches main, a routine apply writes the limit with nothing enforcing the owed bot check first. check also fails on every public repository until one is applied, which points an auditor at apply. Outcome: declined. This pull request merges into develop only, and apply runs from a hub checkout at main. The promotion to main is the maintainer's own step, and this body and the README name the bot check as owed before rollout. Promote only after that check is recorded, or gate apply behind an opt-in in a follow-up if the maintainer prefers.

  • introduced, consolidation (tests/test_configure_interaction.py HELPERS and JQR). The helper lifts repeat ones tests/test_configure_settings_live.py and tests/test_configure_project.py define, and JQR is lifted twice in this file. Outcome: declined. The shared module these would move to, tests/test_configure_archived.py, is outside this change, and the copies change no behavior.

  • Declined, outside this change: tests/test_configure_project.py keeps its own run_bash, now file-based, beside the -c one tests/test_configure_archived.py shares with other test files. Moving the file-based run into the shared copy would edit a file this change does not hold. The largest script this change sends through the shared copy is about 3.7 KiB, measured across the cases that call it.

Dropped findings

  • tests/test_configure_environments.py, tests/test_configure_settings_live.py, tests/test_configure_ruleset_id.py, and tests/test_configure_project.py each carry their own copy of lift. This is a consolidation finding on lines this change did not touch.

Verification

  • shellcheck and shfmt -d on repo-config/configure.sh are clean.
  • ruff format, ruff check, and the pre-commit mypy run are clean.
  • spec/validate.py passes. A fake registry carrying everyone and null reports both values.
  • The prose gate, diff-scoped with comments allowed, reports nothing.
  • python -m unittest discover -s tests passes in full.

🤖 Generated with Claude Code

ptr727 and others added 4 commits November 22, 2026 14:20
… Configuration Script

Declare each repository's public interaction policy in the registry as
publicInteraction, collaborators by default or community. configure.sh
apply sets GitHub's collaborators_only or existing_users interaction limit
for six months on a public repository and turns Discussions off on a
collaborators one. check asserts the limit and its origin, and warns once
fewer than 30 days remain. The pre-flight reads the visibility and any
account-wide limit before the first write, and a private repository is
never read or limited, since GitHub refuses both there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
spec/audit.py now expects Discussions on only for a public community
repository, matching configure.sh. The two configure tests that lift
cmd_apply, cmd_check, and check_settings stub the new group and set the
variable it reads. The hub README no longer points to Discussions and
says only collaborators can raise an issue on a reference-only hub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Helper

check_interaction now tests the live limit's origin before its value. A
limit the owning account or organization set is one apply refuses to
replace, so the check names where to remove it rather than a re-apply.
The new test module imports lift and run_bash from
test_configure_archived.py, as test_configure_model.py already does,
rather than adding another copy. The hub README ties its collaborators
statement to the declared policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
interaction_limits now does the read and the shape test that the
pre-flight and check_interaction each did on their own. The expiry no
longer carries a regex guard over a value jq can only print as an
integer. repo-config/README.md names the two checks owed before a limit
is first applied: the review bots and Dependabot still working, and no
collaborators repository's README linking to Discussions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 22, 2026
Copilot AI lite review requested due to automatic review settings November 22, 2026 22:45
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e84c7a1 and ae5bf58.

Files selected for processing: 11

  • README.md
  • docs/repo-config.md
  • registry/repos.json
  • registry/repos.schema.json
  • repo-config/README.md
  • repo-config/configure.sh
  • spec/audit.py
  • spec/validate.py
  • tests/test_configure_interaction.py
  • tests/test_configure_project.py
  • tests/test_configure_settings_live.py
  • 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

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head d0d56a8cf90583e67fbab52f743e4808e86741fc, the content this pull request carries at that commit against develop, and it recorded 2 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

An active moderate issue remains because configure.sh apply accepts an explicitly declared null publicInteraction instead of rejecting the invalid registry value as the validator does.

1 open issue
What changed in this PR

This pull request adds registry-driven public interaction policies to repository configuration, applying and checking GitHub interaction limits, aligning Discussions settings, and documenting rollout requirements.

Changes:

  • Adds collaborators and community policies with registry validation and repository-specific entries.
  • Integrates interaction-limit resolution, application, expiry warnings, origin checks, and policy-dependent Discussions settings.
  • Adds offline tests and updates audit and configuration documentation.
  • Requires a fix so declared publicInteraction: null values are rejected instead of defaulting to collaborators.
File Description
tests/​test_configure_settings_live.py Supplies the policy-derived Discussions setting required by live configuration tests.
tests/​test_configure_project.py Stubs interaction-limit functions and verifies check-group wiring.
tests/​test_configure_interaction.py Adds offline coverage for policy resolution, application, pre-flight checks, validation, auditing, and wiring.
spec/​validate.py Validates allowed interaction-policy values, including rejecting declared null values.
spec/​audit.py Aligns audited Discussions expectations with each repository's interaction policy.
repo-config/​README.md Documents public interaction policies, expiry behavior, checks, and rollout prerequisites.
repo-config/​configure.sh Resolves, applies, pre-flights, and checks repository interaction limits and policy-dependent settings.
registry/​repos.schema.json Declares the publicInteraction registry property and its allowed values.
registry/​repos.json Marks PlexCleaner and NxWitness as community-policy repositories.
README.md Describes the hub as reference-only with collaborator-restricted participation.
docs/​repo-config.md Documents registry-driven interaction configuration and validation behavior.

Review effort: Lite

Comment thread repo-config/configure.sh Resolved
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.54%. Comparing base (01d88d6) to head (ae5bf58).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
spec/validate.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4349      +/-   ##
===========================================
- Coverage    79.55%   79.54%   -0.01%     
===========================================
  Files           45       45              
  Lines        15923    15926       +3     
===========================================
+ Hits         12667    12669       +2     
- Misses        3256     3257       +1     
Flag Coverage Δ
python-3.13 79.54% <75.00%> (-0.01%) ⬇️

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 and others added 2 commits November 22, 2026 15:06
A native Windows jq cannot run fromdateiso8601, so check_interaction now
reads the days left through the Python interpreter configure.sh already
resolves. A registry entry declaring publicInteraction as null now stops
the run, rather than jq's alternative operator reading it as the
collaborators default. tests/test_configure_project.py hands its lifted
script to bash as a file, since Git Bash cuts a -c argument short at
about 8 KiB and cmd_apply lifted whole is now longer than that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Boundary

A native Windows Python ends a printed line with a carriage return, which
the integer comparison then refuses, so the 30-day warning could never
fire there. The days are now written with no newline. The day-count test
cases pass a half day, so a dropped second or the run's own lag never
crosses a day boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

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 715beff into develop Nov 22, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/r4-interaction-limits branch November 22, 2026 23:32
ptr727 added a commit that referenced this pull request Nov 23, 2026
…laceholders (#4358)

## Summary

Fixes the five previously-missed Copilot findings on promotion PR #4356
(review key `fb86dd4d035b`), plus two local-pass findings. All five
Copilot findings are wrong-behavior defects that the paste-safe quoting
in #4353 and #4357 introduced. Each quoted a placeholder whole although
its documented value opens `~`, or although it stands for several
arguments.

The fix applies `GOVERNANCE.md` "Copy-and-Run Commands" as written.
Where the value opens `~`, the quotes wrap the placeholder alone and the
tilde sits outside them. Where the value is a command and its arguments,
it replaces the quotes, and the text now says so.

Copilot findings from #4356:

- `.agents/skills/drive-pr/SKILL.md:127` and the cleanup invocation at
`:186`. `--checkout "<base-clone>"` becomes `--checkout
~/repos/"<Repo>"`, and the prose names `~/repos/<Repo>` as the primary
clone.
- `.agents/skills/repo-worktree/SKILL.md:256` and the sweep command at
`:286`. The same change. The class sweep also fixed the standalone-clone
fence at `:144`, `git -C "<base-clone>" remote get-url origin`, which
predates #4353 and had the same defect.
- `.agents/skills/resync-a-repo/SKILL.md:52`. The same change, with the
prose naming `~/repos/<Repo>` as that repository's primary clone.
- `.agents/skills/session-handoff/SKILL.md:220` and `:224`.
`"<worktrees>"` and `"<clone>"` become
`~/repos/worktrees/ProjectTemplate-hub-"<unique>"`, the fleet worktree
directory `repo-worktree` names. The class sweep also fixed the same
`"<clone>"` read in step 4 at `:300`.
- `AGENTS.md:55`, "Bound every probe". `setsid --wait timeout "<n>"
"<probe>"` now says that the probe's command and its own arguments
replace the quotes, so each stays a word of its own.

Local-pass findings:

- `AUDIT.md` section 6. The list of what `configure.sh check` covers now
names a public repository's interaction limit, the `check_interaction`
group #4349 added.
- `.github/actions/repo-gate/repo_gate.py`, the `check_workflow_inputs`
docstring. Its overlong lines are rewrapped to the 100-column limit,
words unchanged.

Closes on promotion: none

## Pre-existing findings, not filed

The same `"<base-clone>"` form, with a documented `~/repos/<Repo>`
value, sits in files this pull request does not touch. The local pass
raised them as one root cause, and they are reported to the orchestrator
rather than edited here. Each is a `pre-existing` correctness defect, a
literal tilde reaching `cleanup --checkout`:

- `.agents/skills/backlog-burndown/SKILL.md:469`
- `.agents/skills/merge-and-release/SKILL.md:226` and `:244`
- `.agents/skills/pr-review-conduct/SKILL.md:402`
- `.agents/skills/audit-a-repo/SKILL.md:48`, as `"<hub-base-clone>"`

## Verification

- `python3 scripts/prose_lint.py <each edited Markdown file> --check
paste-safe` passes.
- `python3 scripts/prose_lint.py . --diff "$(git merge-base
origin/develop HEAD)"` passes.
- `uv run --no-project --script scripts/build_dist.py --check` reports
the generated trees current.
- The `OPERATIONS.md` "Local Verification" block (ruff, ruff format,
mypy, the unittest suites, `repo_gate.py`, and the prose runs) was run
in full.
- In bash, `~/repos/"X"` and
`~/repos/worktrees/ProjectTemplate-hub-"abc"` both expand the tilde.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
ptr727 added a commit that referenced this pull request Nov 23, 2026
…afe Commands, and Workflow Input Check (#4368)

Promotes the eleven pull requests that landed on develop since the last
promotion.

- #4348: Say where a reviewer's clean pass leaves its record.
`pr-review-conduct` "Silence is not evidence" now states that a clean
pass can leave an empty-bodied review or, for CodeRabbit, only a summary
comment line.
- #4351: Count a CodeRabbit clean pass its summary alone records.
`side_answered` and `side_rounds` read the summary comment, so `wait`
stops re-requesting a head CodeRabbit already passed.
- #4346: Detect and report a one-off rather than correct it by code, and
let a rollback carry a `Reopens on promotion:` line (operational
repositories). `add-host-tool` now reports a shadowing copy instead of
removing it.
- #4349: Declare a `publicInteraction` policy per repository in the
registry and apply and check it from `repo-config/configure.sh` (GitHub
interaction limit, Discussions off by default).
- #4352: The PowerShell install stops on a refusal, a tool with no
Microsoft feed fails alone while the run continues, and an unmanaged
`gh` or `op` in install mode says `--upgrade` moves it.
- #4353: Copy-and-run commands in Markdown are paste-safe, with a new
"Copy-and-Run Commands" rule, a generated include in
`comment-and-doc-style`, and a default `paste-safe` prose gate rule.
- #4350: Register every Claude Code hook the host-safety kit installs in
exec form on all platforms, and rewrite shell-form registrations. This
edits the agent's own guard.
- #4354: A new repo-gate check, `workflow-inputs`, compares each
reusable-workflow call's `with:` keys against the callee at the caller's
pin.
- #4357: Quote the remaining paste-safe commands in the repo-config docs
and update the stale PowerShell feed comment, the fix for the
promotion's own lint failure and Copilot thread.
- #4358: Keep the tilde outside the quotes in the base-clone
placeholders and keep the probe executable and arguments as separate
tokens, the fix for the five Copilot findings on this promotion, plus
the AUDIT.md interaction-check coverage and the repo-gate docstring
wrap.
- #4359: Keep the tilde outside the quotes in the remaining base-clone
placeholders, the sibling sweep of the same defect.

## Owed by the maintainer before rollout

From #4349:

- Run the live `repo-config/configure.sh apply` on each repository.
Until it runs, `configure.sh check` and the audit flag the public
repositories.
- Confirm that Copilot, CodeRabbit, Qodo and Dependabot still work under
the interaction limit.
- Update other repositories' README links to Discussions, since
Discussions go off by default.

From #4353: it changed carried text, so a fleet resync is owed.

## Local-pass findings

Class and disposition for the four findings the recorded local pass
raised on the earlier head:

- `host-setup/linux/install-tools.sh` removal code
(`powershell_remove_non_apt`, `remove_unowned_command`,
`op_remove_download`, docker and shadow removals) against the one-off
rule, class `introduced`: tracked by #4347, not this pull request.
- `Reopens on promotion:` exists for operational repositories only,
class `introduced`: declined under the maintainer's answer on #4175,
which places the rule in "Operational Repositories".
- `AUDIT.md` does not list the interaction-limit check, class
`introduced`: fixed in #4358.
- `repo_gate.py` `check_workflow_inputs` docstring lines over the line
length, class `introduced`: fixed in #4358.

Fixes #4170
Fixes #4175
Fixes #4329
Fixes #4172
Fixes #4124
Fixes #2596
Fixes #4040
Fixes #2822
Fixes #3896

Supersedes #4356 because of the `.github/workflows/validate-task.yml`
Dependabot conflict (the `astral-sh/setup-uv` pin bump on main beside
the `if:` condition #4354 changed on develop), resolved from develop's
side as a strict superset of main's. The merged tree equals develop's.
This also carries #4365, #4366 and #4367, the fixes for findings raised
on #4356; none of them closes an issue.

## Findings on this promotion's head

Local pass over the whole `main` diff (four findings) and the Copilot
round (two threads):

- `configure.sh` `publicInteraction` lookup matches the registry name
exactly while apply's guard matches case-insensitively, class
`introduced` (#4349): declined with evidence. A name differing only in
letter case makes `spec/resolve_description.py` exit 1 at `configure.sh`
line 331, before `cmd_apply` or any `gh api --method` call, so no limit
is written on the wrong value. Checked by running the lookup on sample
JSON, and no write is reachable.
- The ungrammatical `hook the host keeps of its own` phrase (Copilot
thread), class `introduced` (#4350): fixed in #4369 into develop.
- Copilot's README Discussions thread: declined with evidence, the
canonical-link list names a link when present and does not require it,
and #4349 turned Discussions off.
- `Reopens on promotion:` scoped to operational repositories, class
`introduced`: declined under the maintainer's answer on #4175, which
places the rule in "Operational Repositories".
- `add-host-tool` detect-and-report against the installer's removal
code, class `introduced` (#4352 and #4346): tracked by #4347, not this
pull request.
- The interaction-limit precondition is not enforced by `apply`: tracked
by #4364.

🤖 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

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants