Should we add AI tool Co-authored-by linting to CI?

I recently saw a Claude Co-authored-by in a PR:

While I have nothing against use of AI in development (I am actually in favor of it!), this does violate the (excellent!) nixpkgs Automation/AI policy.

Should we add linting into CI to detect these and issue a PR failure, and if so, where? Do we have any other commit message lints that this check could be added to?

I’d be happy to make this change, I just need a few pointers as to where I would put this.

7 Likes

My guess is that people will be opposed to this for the reason described in the original PR adding the policy:

Since LLM‐based AI tools use Co-authored-by:attribution by default, we think that using a different format will serve as a brown M&M test and assist with triage. A commit that contains such a tool in Co-authored-by: but not Assisted-by: is, by definition, one that did not follow the policy and can be closed, potentially automatically.

I’d expect this to go similarly to previous suggestions about adding an AGENTS.md file to the repo.

3 Likes

It does not have to fail the PR, it could close it outright. Or we could not implement this at all! I was just wondering because it seemed to have gone unnoticed in that PR.

4 Likes

Ah fair point! For some reason my eyes completely glossed over that part.

2 Likes

I think this would fit well in ci/github-script/lint-commits.js.

4 Likes

PR to there in case anyone wants to review:

2 Likes