Skip to content

Lock down contributions - #1674

Merged
hynek merged 1 commit into
mainfrom
lock-down
Nov 27, 2026
Merged

hynek merged 1 commit into
mainfrom
lock-down

Conversation

@hynek

@hynek hynek commented Nov 27, 2026

Copy link
Copy Markdown
Member

Currently we have 42 open pull requests, 99% of them are utter trash; 100% of them are AI slop. It's extremely demoralizing to have this constant influx of unhelpful crap and the only other alternative for me is to stop maintaining it wholesale.

After all the work I've put into making my projects approachable and easy to contribute, this makes me profoundly sad.

@hynek
hynek merged commit af29c2a into main Nov 27, 2026
18 checks passed
@hynek
hynek deleted the lock-down branch November 27, 2026 09:40
@webknjaz

Copy link
Copy Markdown
Member

I've been trying to do some prompt injection via agents md to deter automatic spammers if you'd be interested in some prior art (or we could talk whenever we meet next time?)

@sirosen and I also worked through a policy for pip-tools and started adopting it in aio-libs. It's meant to be in the contributing file, though. But yeah, it's more permissive.. You seem to want ai;dr -> close which is more than fair.

I also like using https://github.com/apps/agentscanapp/installations/new (https://agentscan.tools) which labels PRs allowing me to tell whether something is likely to be slop sooner.

As for the issue/PR templates, I've started asking motivation and maintenance burden questions in the aiohttp projects (like "would you be able to maintain this for 5 years, eh?"), and there's required checkboxes to click now, which is great in general.
However, none of this actually works for agents because they don't load these files unless they're forced to. The only remedy is AGENTS.md telling them to read the templates and always follow them, deferring to the human at all times, never doing stuff automatically. And hoping that it works, because the probabilistic nature of the thing means that it might not bother looking at the template anyway. But it would help.

@hynek

hynek commented Nov 27, 2026 •

Copy link
Copy Markdown
Member Author

You seem to want ai;dr -> close which is more than fair.

I want to be clear that this is not necessarily what I want. My AI policy was always on the liberal side, but the thing is that clanker clout chasers don't follow even that. They just DDoS projects in the hope something sticks and the amount that stuck doesn't justify the stress and mental load that it takes to separate the slop from the valuable.

I mean I still haven't closed them all because I want to go through them first, figure out what they're trying to achieve, and maybe fix it myself.

I don't give a shit what tools people use as long as I can't tell they're using it. Apparently that's a too high of a bar.

@stevepiercy

Copy link
Copy Markdown

They just DDoS projects in the hope something sticks

I feel this. One abuser in our project created 12 PRs in a few hours. Without us even reviewing their PRs, they put on their profile page the following:

Active contributor to production Python engines, distributed systems, and developer tooling:

and they listed our project as the first of many. A bad faith actor in the worst way.

We're also using https://github.com/MatteoGabriele/agentscan-action and https://github.com/marketplace/actions/anti-slop, and we're developing a tool that could help us handle the flood of AI slop. The key feature is that new contributors who submit a PR must give a PR review to, and request a PR review from, colleagues before a maintainer even looks at it, as well as satisfy automatically enforced criteria from the aforementioned GitHub apps.

Our primary objective is to work with people to develop a community around our project.

@richlv

richlv commented Nov 27, 2026

Copy link
Copy Markdown

must give a PR review to, and request a PR review from, colleagues

Not to derail this too much, so perhaps there's a documentation page I could read about such an approach? Is this some internal project, or who are the colleagues if it is a public one?

@stevepiercy

Copy link
Copy Markdown

@richlv I don't want to disclose it publicly yet. The system is in alpha, and the FOSS project is public on GitHub. You can reach me privately via https://fosstodon.org/@stevepiercy to discuss outside this thread.

A slightly different approach by FastAPI goes even farther to close issues, and instead use discussions. See https://github.com/fastapi/fastapi/discussions/new?category=questions.

@tomaarsen

Copy link
Copy Markdown

I totally understand your frustration. I'm facing a similar floodwave as well, also without a good solution yet. For context, here is the (smoothed) daily number of PRs opened on one of my projects over the years.

image

Where I used to have one PR to review every 1 or 2 days, I'm now looking at 5-6 per day. I last worked on my next feature ~8 days ago, it's just been full-time PR reviewing. I'm open to suggestions!
For now I've added a "Report how you found this?" mandatory question to the CONTRIBUTORS.md, and I could start using that to filter out PRs that were opened because of "AI code analysis", so I can focus on users that actually use the software and encountered an issue that they'd like to patch. But I'm wary that users would just pretend like they found the issue through some legitimate way.

  • Tom Aarsen

@sirosen

sirosen commented Nov 27, 2026

Copy link
Copy Markdown

@sirosen and I also worked through a policy for pip-tools and started adopting it in aio-libs. It's meant to be in the contributing file, though. But yeah, it's more permissive..

FWIW, even though we have a permissive policy, I close almost all of the slop we are sent without hesitation, on the grounds that "don't let it talk for you" is something I care about. And I'd like to make the policy stricter and explicitly ban karma farming.


Over in marshmallow, we originally adopted a version of the attrs AI policy, but we've started to require issue assignment and auto-close PRs. pydantic is doing them same (we copied their workflow), and the overall feeling is that this is an alternative version of the decision to close open contributions entirely.

I'm a bit bummed out about all of this. I cut my teeth in open source work here on GitHub, sending patches to random projects. But our first priority has to be to protect maintainers.

For what it's worth, I think a lot of us see this policy change as unfortunate but necessary for the larger projects. I feel like the world of open source is getting smaller, not larger, but we're still in this together. ❤️

@davilima6

davilima6 commented Nov 27, 2026 •

Copy link
Copy Markdown

@hynek, did you try adding an open format AGENTS.md to the repo to define the pit of success for them? I'm afraid Cursor, Claude and Codex all ignore .github/AI_POLICY.md, .github/CONTRIBUTING.md, and .github/PULL_REQUEST_TEMPLATE.md unless pointed at them, e.g. by a custom system or user prompt. OTOH All of them read root AGENTS.md natively. As a second step you cab consider embedding a couple skills, maybe authoring a public-api-surface one.

Below is a draft. Grab whatever is useful, also happy to send as PR if you want to try it out. I'm sure it contains mistakes and that it can be shaped and re-shaped as a live document, still I hope it's enough to demo the idea.

AGENTS.md

# Repository Guidelines

Guidance for coding agents working in `python-attrs/attrs`.

## Boundaries and Scope

- Never open pull requests, open issues, post comments, trigger bot reviewers, or submit reviews on GitHub.
- Never draft pull request descriptions, issue bodies, or review comments, and never add `Co-authored-by:` trailers, badges, or check the AI policy box on a human's behalf.
- Pull requests are restricted to project collaborators; for non-collaborators, help build a minimal reproducer or root-cause analysis instead of a PR.
- Before writing code for an issue, check open and closed PRs so you do not duplicate active work or repeat a rejected approach, and stop if the issue carries `AI flypaper`, `Thinking`, `On Hold`, `Waiting`, or `Waiting for Mypy`, or lacks design agreement.
- Prefer the smallest diff that fixes the root cause across all edge cases (deletion beats addition; no unsolicited micro-optimizations, speculative helpers/flags, or drive-by refactors) while completing every required surface (100% coverage, stubs, typing tests, docs).
- Before editing, grep all callers and extend existing helpers and `tests/test_*.py` modules rather than creating new wrappers or standalone test files for a single fix.

## Verification Commands (`uv`)

- Sync environment: `uv sync --python=$(cat .python-version-default)`
- Fast tests: `uv run pytest` (if `tests/test_packaging.py` fails, run `git fetch --tags`)
- Lint, format, test-docstring check (`interrogate`), spellcheck: `uv run --only-group tox tox run -f lint`
- Static type checkers (`pyright`, `ty`, `pyrefly`): `uv run --only-group tox tox run -f typing`
- Mypy & stub tests: `uv run --only-group tox tox run -e $(cat .python-version-default)-mypy`
- Docs, doctests, Towncrier preview: `uv run --only-group tox tox run -e docs-build,docs-doctests,changelog`
- Full CI matrix (100% statement + branch coverage on 3.10 and 3.14): `uv run tox`
- Hot-path benchmarks (`_make.py`, `_funcs.py`): `uv run --group benchmark pytest --codspeed benchmarks/test_benchmarks.py`

## Architecture and Conventions Not Caught by Ruff

- Work on a feature branch, never `main`.
- `src/attr/` implements the library and classic API; `src/attrs/` re-exports the modern API.
- Public API or signature changes must update both `src/attr/*.pyi` and `src/attrs/*.pyi` (Ruff ignores `.pyi` files), add static checks in `typing_tests/baseline.py` (or `typing_tests/mypy.py`), and manually update `docs/api.rst` (plus `docs/examples.md` for new features).
- Generic `# type: ignore` is disabled; use `# pyright: ignore[rule]`, `# pyrefly: ignore[rule]`, or `# ty: ignore[rule]` only for confirmed upstream checker bugs.
- Avoid `TYPE_CHECKING` blocks where Sphinx autodoc imports symbols.
- Preserve `_ClassBuilder` invariants in `src/attr/_make.py`: `_frozen_setattrs` immutability, `__slots__` rebuilds (tuple, single-string, dict, and name-mangled forms), `these=` class-body semantics, MRO ordering, and `Attribute.__setstate__` pickle compatibility.
- In `tests/`, write Yoda assertions (`assert expected == actual`) preceded by a blank line, include docstrings on every test, and add new features to `tests/strategies.py`.
- Write `.md`, `.rst`, and `changelog.d/*.md` with semantic newlines (one sentence per line) and two blank lines before section headers.
- Derive `versionadded` / `versionchanged` / `deprecated` CalVer numbers from the latest release in `CHANGELOG.md`.
- Name Towncrier fragments `changelog.d/<pr#>.(change|deprecation|breaking).md` after the PR number once a PR exists, never the issue number.

## Where to Look

- Authorship, copyright, and bot rules: [`.github/AI_POLICY.md`](.github/AI_POLICY.md)
- PEP 257 / Napoleon docstrings, semantic newlines, and Towncrier markup: [`.github/CONTRIBUTING.md`](.github/CONTRIBUTING.md)
- Public API and release checklist: [`.github/PULL_REQUEST_TEMPLATE.md`](.github/PULL_REQUEST_TEMPLATE.md)
- Static typing test setup (type-checked only, never executed): [`typing_tests/README.md`](typing_tests/README.md)

</details>

@brunoborges

Copy link
Copy Markdown

There are several new features regarding Pull Request policies.

Check this one out: https://github.blog/changelog/2026-10-28-pull-request-limits-exempt-contributors-by-age-or-history/

@sirosen

sirosen commented Nov 27, 2026

Copy link
Copy Markdown

While I take the above suggestions to be in good faith, I do not think they are helpful.

I don't want an AGENTS.md in any of my repos. It sends absolutely the wrong message to contributors. Hynek may or may not agree, but we should presume that the fact that attrs does not have an AGENTS.md today is an intentional choice, not an oversight.

This is a (merged!) PR on the attrs project. attrs is closing down open contributions. I don't think this is the right time or place to be pitching speculative alternatives.

@harshverma27

Copy link
Copy Markdown

@hynek I'm sorry man, I feel you.
Losing years worth hard-work to AI will definitely feel bad. I would suggest you to move attrs to GitLab and limit the account creation there. Many orgs do this already and GitLab can also get very restrictive against AI.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants