[RFC PATCH] checkpatch: teach checkpatch about the Assisted-by: tag for AI-assisted patches

Thomas Hellström posted 1 patch 1 month, 1 week ago
scripts/checkpatch.pl | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
[RFC PATCH] checkpatch: teach checkpatch about the Assisted-by: tag for AI-assisted patches
Posted by Thomas Hellström 1 month, 1 week ago
Documentation/process/coding-assistants.rst mandates the use of an
uses an "Agent:Model" notation rather than a name-and-email-address
pair, for example:

  Assisted-by: GitHub Copilot:claude-sonnet-4.6

checkpatch.pl currently emits false-positive errors and warnings for
this tag:

  WARNING: Non-standard signature: Assisted-by:
  ERROR: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6'

Teach checkpatch about the tag:

- Add Assisted-by: to the $signature_tags regex so it is no longer
  flagged as a non-standard signature.
- Add Assisted-by: to the standard_signature_tags list in
  find_standard_signature() so that near-miss typos (e.g.
  'Assited-by:') suggest the correct spelling.
- Skip the email-address validation for Assisted-by: tags and instead
  validate that the value contains at least one colon separating the
  agent name from the model identifier.  Emit a BAD_SIGN_OFF warning
  if the notation does not conform.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: linux-kernel@vger.kernel.org
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 scripts/checkpatch.pl | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e56374662ff7..dd3327e8fa55 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -641,6 +641,7 @@ our $signature_tags = qr{(?xi:
 	Reviewed-by:|
 	Reported-by:|
 	Suggested-by:|
+	Assisted-by:|
 	To:|
 	Cc:
 )};
@@ -737,7 +738,7 @@ sub find_standard_signature {
 	my ($sign_off) = @_;
 	my @standard_signature_tags = (
 		'Signed-off-by:', 'Co-developed-by:', 'Acked-by:', 'Tested-by:',
-		'Reviewed-by:', 'Reported-by:', 'Suggested-by:'
+		'Reviewed-by:', 'Reported-by:', 'Suggested-by:', 'Assisted-by:'
 	);
 	foreach my $signature (@standard_signature_tags) {
 		return $signature if (get_edit_distance($sign_off, $signature) <= 2);
@@ -3107,7 +3108,15 @@ sub process {
 
 			my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
 			my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment));
-			if ($suggested_email eq "") {
+			# Assisted-by: uses "Agent:Model" notation without an email
+			# address, as mandated by Documentation/process/coding-assistants.rst.
+			# Skip email validation for this tag.
+			if ($sign_off =~ /^Assisted-by:$/i) {
+				if ($email !~ /\S+:\S+/) {
+					WARN("BAD_SIGN_OFF",
+					     "Assisted-by: should use 'Agent:Model' notation (e.g. 'GitHub Copilot:claude-sonnet-4.6')\n" . $herecurr);
+				}
+			} elsif ($suggested_email eq "") {
 				ERROR("BAD_SIGN_OFF",
 				      "Unrecognized email address: '$email'\n" . $herecurr);
 			} else {
-- 
2.53.0

Re: [RFC PATCH] checkpatch: teach checkpatch about the Assisted-by: tag for AI-assisted patches
Posted by Niranjana Vishwanathapura 1 month ago
On Mon, Mar 02, 2026 at 03:36:59PM +0100, Thomas Hellström wrote:
>Documentation/process/coding-assistants.rst mandates the use of an
>uses an "Agent:Model" notation rather than a name-and-email-address
>pair, for example:
>
>  Assisted-by: GitHub Copilot:claude-sonnet-4.6

Do we need the Agent to be specified along with the model given the
agents tend to me more custom built (or private) and model tend to be
more generic? Not sure if my assumption is entirely true though.

Niranjana

>
>checkpatch.pl currently emits false-positive errors and warnings for
>this tag:
>
>  WARNING: Non-standard signature: Assisted-by:
>  ERROR: Unrecognized email address: 'GitHub Copilot:claude-sonnet-4.6'
>
>Teach checkpatch about the tag:
>
>- Add Assisted-by: to the $signature_tags regex so it is no longer
>  flagged as a non-standard signature.
>- Add Assisted-by: to the standard_signature_tags list in
>  find_standard_signature() so that near-miss typos (e.g.
>  'Assited-by:') suggest the correct spelling.
>- Skip the email-address validation for Assisted-by: tags and instead
>  validate that the value contains at least one colon separating the
>  agent name from the model identifier.  Emit a BAD_SIGN_OFF warning
>  if the notation does not conform.
>
>Cc: Andy Whitcroft <apw@canonical.com>
>Cc: Joe Perches <joe@perches.com>
>Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
>Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
>Cc: linux-kernel@vger.kernel.org
>Assisted-by: GitHub Copilot:claude-sonnet-4.6
>Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>---
> scripts/checkpatch.pl | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
>diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>index e56374662ff7..dd3327e8fa55 100755
>--- a/scripts/checkpatch.pl
>+++ b/scripts/checkpatch.pl
>@@ -641,6 +641,7 @@ our $signature_tags = qr{(?xi:
> 	Reviewed-by:|
> 	Reported-by:|
> 	Suggested-by:|
>+	Assisted-by:|
> 	To:|
> 	Cc:
> )};
>@@ -737,7 +738,7 @@ sub find_standard_signature {
> 	my ($sign_off) = @_;
> 	my @standard_signature_tags = (
> 		'Signed-off-by:', 'Co-developed-by:', 'Acked-by:', 'Tested-by:',
>-		'Reviewed-by:', 'Reported-by:', 'Suggested-by:'
>+		'Reviewed-by:', 'Reported-by:', 'Suggested-by:', 'Assisted-by:'
> 	);
> 	foreach my $signature (@standard_signature_tags) {
> 		return $signature if (get_edit_distance($sign_off, $signature) <= 2);
>@@ -3107,7 +3108,15 @@ sub process {
>
> 			my ($email_name, $name_comment, $email_address, $comment) = parse_email($email);
> 			my $suggested_email = format_email(($email_name, $name_comment, $email_address, $comment));
>-			if ($suggested_email eq "") {
>+			# Assisted-by: uses "Agent:Model" notation without an email
>+			# address, as mandated by Documentation/process/coding-assistants.rst.
>+			# Skip email validation for this tag.
>+			if ($sign_off =~ /^Assisted-by:$/i) {
>+				if ($email !~ /\S+:\S+/) {
>+					WARN("BAD_SIGN_OFF",
>+					     "Assisted-by: should use 'Agent:Model' notation (e.g. 'GitHub Copilot:claude-sonnet-4.6')\n" . $herecurr);
>+				}
>+			} elsif ($suggested_email eq "") {
> 				ERROR("BAD_SIGN_OFF",
> 				      "Unrecognized email address: '$email'\n" . $herecurr);
> 			} else {
>-- 
>2.53.0
>
Re: [RFC PATCH] checkpatch: teach checkpatch about the Assisted-by: tag for AI-assisted patches
Posted by Thomas Hellström 1 month ago
On Tue, 2026-03-03 at 12:36 -0800, Niranjana Vishwanathapura wrote:
> On Mon, Mar 02, 2026 at 03:36:59PM +0100, Thomas Hellström wrote:
> > Documentation/process/coding-assistants.rst mandates the use of an
> > uses an "Agent:Model" notation rather than a name-and-email-address
> > pair, for example:
> > 
> >  Assisted-by: GitHub Copilot:claude-sonnet-4.6
> 
> Do we need the Agent to be specified along with the model given the
> agents tend to me more custom built (or private) and model tend to be
> more generic? Not sure if my assumption is entirely true though.


Basically this is following
https://kernel.org/doc/html//next/process/coding-assistants.html

and this patch only ensures *something* is present for
AGENT_NAME:MODEL_VERSION

Not sure whether checkpatch should allow an empty agent, like
:claude-sonnet-4.6 in this case or whether one should add
<internal>:claude-sonnet-4.6. I think the latter is the most
transparent of the two...

/Thomas


> 
> Niranjana
> 
> > 
> > checkpatch.pl currently emits false-positive errors and warnings
> > for
> > this tag:
> > 
> >  WARNING: Non-standard signature: Assisted-by:
> >  ERROR: Unrecognized email address: 'GitHub Copilot:claude-sonnet-
> > 4.6'
> > 
> > Teach checkpatch about the tag:
> > 
> > - Add Assisted-by: to the $signature_tags regex so it is no longer
> >  flagged as a non-standard signature.
> > - Add Assisted-by: to the standard_signature_tags list in
> >  find_standard_signature() so that near-miss typos (e.g.
> >  'Assited-by:') suggest the correct spelling.
> > - Skip the email-address validation for Assisted-by: tags and
> > instead
> >  validate that the value contains at least one colon separating the
> >  agent name from the model identifier.  Emit a BAD_SIGN_OFF warning
> >  if the notation does not conform.
> > 
> > Cc: Andy Whitcroft <apw@canonical.com>
> > Cc: Joe Perches <joe@perches.com>
> > Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
> > Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> > Cc: linux-kernel@vger.kernel.org
> > Assisted-by: GitHub Copilot:claude-sonnet-4.6
> > Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> > ---
> > scripts/checkpatch.pl | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index e56374662ff7..dd3327e8fa55 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -641,6 +641,7 @@ our $signature_tags = qr{(?xi:
> > 	Reviewed-by:|
> > 	Reported-by:|
> > 	Suggested-by:|
> > +	Assisted-by:|
> > 	To:|
> > 	Cc:
> > )};
> > @@ -737,7 +738,7 @@ sub find_standard_signature {
> > 	my ($sign_off) = @_;
> > 	my @standard_signature_tags = (
> > 		'Signed-off-by:', 'Co-developed-by:', 'Acked-by:',
> > 'Tested-by:',
> > -		'Reviewed-by:', 'Reported-by:', 'Suggested-by:'
> > +		'Reviewed-by:', 'Reported-by:', 'Suggested-by:',
> > 'Assisted-by:'
> > 	);
> > 	foreach my $signature (@standard_signature_tags) {
> > 		return $signature if (get_edit_distance($sign_off,
> > $signature) <= 2);
> > @@ -3107,7 +3108,15 @@ sub process {
> > 
> > 			my ($email_name, $name_comment,
> > $email_address, $comment) = parse_email($email);
> > 			my $suggested_email =
> > format_email(($email_name, $name_comment, $email_address,
> > $comment));
> > -			if ($suggested_email eq "") {
> > +			# Assisted-by: uses "Agent:Model" notation
> > without an email
> > +			# address, as mandated by
> > Documentation/process/coding-assistants.rst.
> > +			# Skip email validation for this tag.
> > +			if ($sign_off =~ /^Assisted-by:$/i) {
> > +				if ($email !~ /\S+:\S+/) {
> > +					WARN("BAD_SIGN_OFF",
> > +					     "Assisted-by: should
> > use 'Agent:Model' notation (e.g. 'GitHub Copilot:claude-sonnet-
> > 4.6')\n" . $herecurr);
> > +				}
> > +			} elsif ($suggested_email eq "") {
> > 				ERROR("BAD_SIGN_OFF",
> > 				      "Unrecognized email address:
> > '$email'\n" . $herecurr);
> > 			} else {
> > -- 
> > 2.53.0
> > 
Re: [RFC PATCH] checkpatch: teach checkpatch about the Assisted-by: tag for AI-assisted patches
Posted by Joe Perches 1 month ago
On Wed, 2026-03-04 at 19:01 +0100, Thomas Hellström wrote:
> On Tue, 2026-03-03 at 12:36 -0800, Niranjana Vishwanathapura wrote:
> On Mon, Mar 02, 2026 at 03:36:59PM +0100, Thomas Hellström wrote:
> Documentation/process/coding-assistants.rst mandates the use of an
> > > uses an "Agent:Model" notation rather than a name-and-email-address
> > > pair, for example:
> > > 
>  Assisted-by: GitHub Copilot:claude-sonnet-4.6
> > 
> > Do we need the Agent to be specified along with the model given the
> > agents tend to me more custom built (or private) and model tend to be
> > more generic? Not sure if my assumption is entirely true though.
> 
> Basically this is following
> https://kernel.org/doc/html//next/process/coding-assistants.html
> 
> and this patch only ensures *something* is present for
> AGENT_NAME:MODEL_VERSION
> 
> Not sure whether checkpatch should allow an empty agent, like
> :claude-sonnet-4.6 in this case or whether one should add
> <internal>:claude-sonnet-4.6. I think the latter is the most
> transparent of the two...

Dunno know neither.  These are the current uses in -next.
Perhaps unnamed is useful, but actual transparency would
require an actual tool/agent name too.

HEAD is now at fc7b1a72c6cd5 Add linux-next specific files for 20260304
$ git log -100000 --grep="Assisted-by:" | grep "Assisted-by:"
    Assisted-by: unnamed:deepseek-v3.2 coccinelle
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: gkh_clanker_2000
    Assisted-by: gkh_clanker_2000
    Assisted-by: Gemini-CLI:Google Gemini 3
    Assisted-by: Gemini-CLI:Google Gemini 3
    Assisted-by: Gemini-CLI:Google Gemini 3
    Assisted-by: claude-opus-4-6-v1
    Assisted-by: Claude:claude-opus-4-5
    Assisted-by: claude-opus-4-5-20251101
    Assisted-by: claude-opus-4-5-20251101
    Assisted-by: Google Gemini
    Assisted-by: Daniel Borkmann <dborkmann@redhat.com>

Perhaps \S:\S validation, but the content will eventually get out of hand.