Skip to contentSkip to conversation

agents: add skills for Fixes tags, stable tags, similar bugs, and commit messages

PATCH Superseded Sasha Levin 9 participants 25 messages Oct 12 – Oct 16

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover agents: add skills for Fixes tags, stable tags, similar bugs, and commit messages

At the Maintainers Summit, Ted asked whether the stable trees have a way to deal with incorrect Fixes tags. Hannes estimated that 15-20% of them are wrong, often because the author ran git blame and took the first commit that touched the line [1]. We use LLM workflows to find the commit that actually introduced a bug, and others asked us to share them.

This series adds them as agent skills under agents/skills/, together with a skill for writing commit messages:

- find-fixes determines the commit for a Fixes tag, following the history past code moves and refactors.

- stable-tag decides whether a fix should go to stable and generates the tag. It follows the criteria AUTOSEL applies in practice, finds the first release with the bug using git tag --contains, and checks that the fix applies there, adding prerequisites or a version floor if needed.

- find-siblings looks for the same bug elsewhere in the tree and verifies each candidate.

- commit-message writes, rewrites, or reviews a commit message or cover letter, and writes the signed tag and email text for a pull request. It follows the P: profiles that get_maintainer.pl reports for the changed files, reads the related list discussions with lei when it is available, and keeps the text short and in the imperative voice.

The skills are read-only and return a result with evidence. The calling workflow writes the commit, creates the tag, and sends the mail. coding-assistants.rst tells agents when to use each skill.

I tested the skills with two different agents on an array of upstream commits and pull requests.

Changes since v1:
- Switch the MAINTAINERS list to [email protected] (Leon, Konstantin).
- Add the stable-tag, find-siblings, and commit-message skills.
- find-fixes: point to the stable-tag skill for stable decisions.

v1: https://lore.kernel.org/r/[email protected]
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/CAHk-=wgXU50=KgZNZc1JDxsSxg9Z+DjG1_2yU-fNXpZtUe4XDw@mail.gmail.com

Sasha Levin (5):
agents: add infrastructure for agent resources
agents: add a skill to determine Fixes tags
agents: add a skill to determine stable tags
agents: add a skill to find other instances of a fixed bug
agents: add a skill to write commit messages

 Documentation/process/coding-assistants.rst   |  79 +++++-
 MAINTAINERS                                   |   6 +
 agents/skills/commit-message/SKILL.md         |  29 +++
 agents/skills/commit-message/guide.rst        | 200 +++++++++++++++
 agents/skills/commit-message/pull-request.rst | 113 +++++++++
 agents/skills/find-fixes/SKILL.md             |  23 ++
 agents/skills/find-fixes/guide.rst            | 178 ++++++++++++++
 agents/skills/find-siblings/SKILL.md          |  22 ++
 agents/skills/find-siblings/guide.rst         | 138 +++++++++++
 agents/skills/stable-tag/SKILL.md             |  25 ++
 agents/skills/stable-tag/guide.rst            | 229 ++++++++++++++++++
 11 files changed, 1039 insertions(+), 3 deletions(-)
 create mode 100644 agents/skills/commit-message/SKILL.md
 create mode 100644 agents/skills/commit-message/guide.rst
 create mode 100644 agents/skills/commit-message/pull-request.rst
 create mode 100644 agents/skills/find-fixes/SKILL.md
 create mode 100644 agents/skills/find-fixes/guide.rst
 create mode 100644 agents/skills/find-siblings/SKILL.md
 create mode 100644 agents/skills/find-siblings/guide.rst
 create mode 100644 agents/skills/stable-tag/SKILL.md
 create mode 100644 agents/skills/stable-tag/guide.rst

base-commit: 3857c2fe5449541e24afc5efdb0f81a8a8f9a3a0 --
2.53.0

#1 lore raw

PATCH v2 1/5 agents: add infrastructure for agent resources

Add agents/ as a home for skills, prompts, and other resources for coding assistants. Describe the skill layout and how to read the procedures in coding-assistants.rst, and add a MAINTAINERS entry covering agents/.

Assisted-by LLM
---
 Documentation/process/coding-assistants.rst | 12 ++++++++++++
 MAINTAINERS                                 |  6 ++++++
 2 files changed, 18 insertions(+)
Documentation/process/coding-assistants.rst +12 -0
index 051f0d819f68e..3288b32e993f5 100644
@@ -19,6 +19,18 @@ For guidelines on content generated by AI coding assistants see:
 
 * Documentation/process/generated-content.rst
 
+Agent resources
+===============
+
+The ``agents/`` directory holds skills, prompts, and other resources for
+coding assistants.
+
+Skills live under ``agents/skills/<name>/``, with a ``SKILL.md`` entry point
+in the `Agent Skills format
+<https://agentskills.io/specification>`_. Read the relevant resource
+directly from its repository path. Links within a skill are relative to
+that skill's directory.
+
 Licensing and Legal Requirements
 ================================
 
MAINTAINERS +6 -0
index f53047aa8d3c1..9e522cda56f1b 100644
@@ -713,6 +713,12 @@ F:	Documentation/filesystems/afs.rst
 F:	fs/afs/
 F:	include/trace/events/afs.h
 
+AGENT RESOURCES
+M:	Sasha Levin <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	agents/
+
 AGPGART DRIVER
 M:	David Airlie <[email protected]>
 L:	[email protected]
Signature · 1 line
2.53.0
#2 lore raw

PATCH v2 2/5 agents: add a skill to determine Fixes tags

In reply to Sasha Levin

Blame and existing Fixes tags can point to code movement instead of the change that introduced a bug. Add a read-only investigation procedure that traces historical behavior and checks candidate commits against their parents before returning a tag with supporting evidence.

Keep the skill entry point and procedure together under agents/skills/find-fixes/. Connect the procedure to the coding-assistant guidance so bug fixes get verified attribution before finalization.

If the origin cannot be established, return no trailer and keep the fix as a draft. Applying the tag and writing the commit message remain outside the skill.

Validated with controlled histories covering moved code, changed preconditions, incorrect tags, shallow history, and reintroduction after a revert, as well as a real kernel fix.

Assisted-by LLM
---
 Documentation/process/coding-assistants.rst |  23 ++-
 agents/skills/find-fixes/SKILL.md           |  23 +++
 agents/skills/find-fixes/guide.rst          | 177 ++++++++++++++++++++
 3 files changed, 220 insertions(+), 3 deletions(-)
 create mode 100644 agents/skills/find-fixes/SKILL.md
 create mode 100644 agents/skills/find-fixes/guide.rst
Documentation/process/coding-assistants.rst +20 -3
index 3288b32e993f5..8d42d3c10f9ce 100644
@@ -70,6 +70,21 @@ Example::
 
   Assisted-by: LLM coccinelle sparse
 
+Determining Fixes tags
+======================
+
+Before finalizing a bug-fix patch or its commit message, an assistant must
+follow agents/skills/find-fixes/guide.rst to determine and verify the
+introducing commit. This also applies to fixes for externally reported
+bugs and to checking an existing Fixes tag during review. The skill entry
+point is agents/skills/find-fixes/SKILL.md.
+
+The skill returns an attribution result only. It does not modify files or
+commit messages, and invoking it does not authorize creating or amending a
+commit. If the origin remains unresolved, report the missing evidence and
+keep the fix as a draft. The calling workflow must hold finalization until
+the attribution is resolved.
+
 Procedure for finding and fixing bugs
 =====================================
 
@@ -93,9 +108,11 @@ these steps:
    re-running a complete analysis; drop any fix that doesn't work and try
    another one. The fix must not add build warnings and must pass the
    checkpatch.pl checks (see submitting-patches.rst).
-6. Commit the working fix with a detailed message describing the problem, the
-   solution and a Fixes tag. Do not add a Signed-off-by tag, and add an
-   Assisted-by tag, as described above.
+6. Determine the Fixes tag as described above. Once attribution is resolved,
+   commit the working fix with a detailed message describing the problem,
+   the solution and the verified Fixes tag. This commit is part of the
+   fix-preparation workflow, not the attribution skill. Do not add a
+   Signed-off-by tag, and add an Assisted-by tag, as described above.
 7. Identify the maintainers and lists using scripts/get_maintainer.pl.
    Documentation/process/security-bugs.rst shows how to do that.
 8. Indicate what could not be done. If the fix could not be built or tested, or
agents/skills/find-fixes/SKILL.md new file +23 -0
new file mode 100644
index 0000000000000..14978976fdd46
@@ -0,0 +1,23 @@
+---
+# SPDX-License-Identifier: GPL-2.0-only
+name: find-fixes
+description: >-
+  Determine the bug-introducing commit and return a verified Fixes tag for
+  a Linux kernel fix. Use when preparing or reviewing bug-fix patches,
+  drafting their commit messages, or checking an existing Fixes tag.
+---
+
+# Determine a Fixes tag
+
+Read and follow [the investigation procedure](guide.rst), relative to this
+skill directory. The canonical path in the kernel repository is
+`agents/skills/find-fixes/guide.rst`. If necessary, locate the
+repository root with `git rev-parse --show-toplevel`.
+
+Perform attribution only. Return the tag and its supporting evidence, or
+an unresolved result explaining the missing evidence. Return no other
+trailers or commit-message draft as part of the skill. Do not change files,
+the index, refs, or commit messages, and do not apply the tag or create a
+commit. An unresolved result must contain no Fixes trailer or placeholder;
+it tells the calling workflow to hold finalization. Applying a determined
+tag belongs to that workflow.
agents/skills/find-fixes/guide.rst new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.53.0
#6 lore raw

PATCH v2 3/5 agents: add a skill to determine stable tags

In reply to Sasha Levin

Whether a fix needs a stable tag, and which releases it should reach, is decided by hand and is often missed or left too broad. Add a read-only procedure that decides whether a change is stable material using the criteria the stable trees apply in practice, finds the first release containing each introducing commit with git tag --contains, checks that the fix applies to the oldest affected release, and returns the stable tag lines with supporting evidence.

Keep the skill entry point and procedure together under agents/skills/stable-tag/. Connect it to the coding-assistant guidance so bug fixes get a stable decision after Fixes attribution and before finalization.

If the decision cannot be made, return no tag and keep the fix as a draft. Applying the tag and writing the commit message remain outside the skill.

Assisted-by LLM
---
 Documentation/process/coding-assistants.rst |  25 ++-
 agents/skills/find-fixes/guide.rst          |   5 +-
 agents/skills/stable-tag/SKILL.md           |  25 +++
 agents/skills/stable-tag/guide.rst          | 228 ++++++++++++++++++++
 4 files changed, 276 insertions(+), 7 deletions(-)
 create mode 100644 agents/skills/stable-tag/SKILL.md
 create mode 100644 agents/skills/stable-tag/guide.rst
Documentation/process/coding-assistants.rst +20 -5
index 8d42d3c10f9ce..0eb8dc91575bf 100644
@@ -85,6 +85,21 @@ commit. If the origin remains unresolved, report the missing evidence and
 keep the fix as a draft. The calling workflow must hold finalization until
 the attribution is resolved.
 
+Determining stable tags
+=======================
+
+Once the Fixes tag is determined, an assistant must follow
+agents/skills/stable-tag/guide.rst to decide whether the fix should be
+backported to stable kernels and to generate the stable tag. This also
+applies to checking an existing stable tag during review. The skill entry
+point is agents/skills/stable-tag/SKILL.md. Tell the skill whether the fix
+addresses an unpublished vulnerability, as described in
+Documentation/process/threat-model.rst.
+
+The skill returns a decision only. It does not modify files or commit
+messages. If the decision remains unresolved, report the missing evidence
+and keep the fix as a draft.
+
 Procedure for finding and fixing bugs
 =====================================
 
@@ -108,11 +123,11 @@ these steps:
    re-running a complete analysis; drop any fix that doesn't work and try
    another one. The fix must not add build warnings and must pass the
    checkpatch.pl checks (see submitting-patches.rst).
-6. Determine the Fixes tag as described above. Once attribution is resolved,
-   commit the working fix with a detailed message describing the problem,
-   the solution and the verified Fixes tag. This commit is part of the
-   fix-preparation workflow, not the attribution skill. Do not add a
-   Signed-off-by tag, and add an Assisted-by tag, as described above.
+6. Determine the Fixes tag and the stable tag as described above. Once both
+   are resolved, commit the working fix with a detailed message describing
+   the problem, the solution, the verified Fixes tag and any stable tag. This
+   commit is part of the fix-preparation workflow, not the skills. Do not add
+   a Signed-off-by tag, and add an Assisted-by tag, as described above.
 7. Identify the maintainers and lists using scripts/get_maintainer.pl.
    Documentation/process/security-bugs.rst shows how to do that.
 8. Indicate what could not be done. If the fix could not be built or tested, or
agents/skills/find-fixes/guide.rst +3 -2
index 7b58c526f3149..c1e66a5d1d29b 100644
@@ -173,5 +173,6 @@ trailer or placeholder. The calling bug-fix workflow must hold finalization
 and surface the unresolved origin instead of fabricating a tag or silently
 treating the investigation as complete.
 
-Determining a Fixes tag does not establish stable eligibility or replace the
-requirements in Documentation/process/stable-kernel-rules.rst.
+Determining a Fixes tag does not establish stable eligibility. Follow
+agents/skills/stable-tag/guide.rst to decide whether the fix needs a stable
+tag.
agents/skills/stable-tag/SKILL.md new file +25 -0
new file mode 100644
index 0000000000000..5fcad4eed6027
@@ -0,0 +1,25 @@
+---
+# SPDX-License-Identifier: GPL-2.0-only
+name: stable-tag
+description: >-
+  Decide whether a Linux kernel fix should be backported to stable kernels
+  and return verified Cc: stable tag lines. Use when preparing or reviewing
+  bug-fix patches, drafting their commit messages, or checking an existing
+  stable tag.
+---
+
+# Determine a stable tag
+
+Read and follow [the decision procedure](guide.rst), relative to this
+skill directory. The canonical path in the kernel repository is
+`agents/skills/stable-tag/guide.rst`. If necessary, locate the
+repository root with `git rev-parse --show-toplevel`.
+
+Perform the stable decision only. Return the tag lines and their supporting
+evidence, a no-tag decision with its reasons, or an unresolved result
+explaining the missing evidence. Return no other trailers or commit-message
+draft as part of the skill. Do not change files, the index, refs, or commit
+messages, do not send mail, and do not apply the tag or create a commit. An
+unresolved result must contain no stable tag or placeholder; it tells the
+calling workflow to hold finalization. Applying the tag belongs to that
+workflow.
agents/skills/stable-tag/guide.rst new file +228 -0

228 lines not on this page · raw message

Signature · 1 line
2.53.0
#9 lore raw

PATCH v2 4/5 agents: add a skill to find other instances of a fixed bug

In reply to Sasha Levin

A bug fixed in one place often exists elsewhere, in copied code, sibling drivers, or other users of the same interface, and reviewers routinely ask whether that was checked. Add a read-only procedure that states the defect as a rule, searches for it through shared interfaces, copied code, the introducing series, Coccinelle patterns and earlier fixes, and verifies each candidate before reporting it.

Keep the skill entry point and procedure together under agents/skills/find-siblings/. Connect it to the coding-assistant guidance so that the bug-fix procedure looks for the same bug elsewhere after a fix is verified. The sites found are reported, not fixed; each needs its own fix, Fixes tag and stable decision.

Assisted-by LLM
---
 Documentation/process/coding-assistants.rst |  16 ++-
 agents/skills/find-siblings/SKILL.md        |  22 ++++
 agents/skills/find-siblings/guide.rst       | 138 ++++++++++++++++++++
 3 files changed, 175 insertions(+), 1 deletion(-)
 create mode 100644 agents/skills/find-siblings/SKILL.md
 create mode 100644 agents/skills/find-siblings/guide.rst
Documentation/process/coding-assistants.rst +15 -1
index 0eb8dc91575bf..004a1e7a20de1 100644
@@ -100,6 +100,19 @@ The skill returns a decision only. It does not modify files or commit
 messages. If the decision remains unresolved, report the missing evidence
 and keep the fix as a draft.
 
+Finding similar bugs
+====================
+
+After fixing a bug, an assistant should follow
+agents/skills/find-siblings/guide.rst to look for the same defect elsewhere
+in the tree. This also applies when a reviewer asks whether other places
+have the same problem. The skill entry point is
+agents/skills/find-siblings/SKILL.md.
+
+The skill reports the sites it finds and verifies. It does not fix them or
+add them to the fix being prepared. Report confirmed sites with the fix, so
+that they can be fixed separately.
+
 Procedure for finding and fixing bugs
 =====================================
 
@@ -122,7 +135,8 @@ these steps:
 5. Build and verify that the fix works either using the reproducer or by
    re-running a complete analysis; drop any fix that doesn't work and try
    another one. The fix must not add build warnings and must pass the
-   checkpatch.pl checks (see submitting-patches.rst).
+   checkpatch.pl checks (see submitting-patches.rst). Then look for the same
+   bug elsewhere, as described above.
 6. Determine the Fixes tag and the stable tag as described above. Once both
    are resolved, commit the working fix with a detailed message describing
    the problem, the solution, the verified Fixes tag and any stable tag. This
agents/skills/find-siblings/SKILL.md new file +22 -0
new file mode 100644
index 0000000000000..f5aeb1744cdc8
@@ -0,0 +1,22 @@
+---
+# SPDX-License-Identifier: GPL-2.0-only
+name: find-siblings
+description: >-
+  Find other places in the Linux kernel tree that have the same defect as a
+  bug being fixed, and verify each candidate. Use after fixing or reviewing
+  a bug fix, or when asked whether the same bug exists elsewhere.
+---
+
+# Find other instances of a bug
+
+Read and follow [the search procedure](guide.rst), relative to this skill
+directory. The canonical path in the kernel repository is
+`agents/skills/find-siblings/guide.rst`. If necessary, locate the
+repository root with `git rev-parse --show-toplevel`.
+
+Perform the search only. Return the verified sites, the candidates ruled
+out and the searches performed, with supporting evidence. Do not fix the
+sites found or add them to the fix being prepared. Do not change files in
+the repository, the index, refs, or commit messages; temporary search
+inputs such as semantic patches belong outside the repository. Fixing the
+sites found belongs to the calling workflow.
agents/skills/find-siblings/guide.rst new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
2.53.0
#15 lore raw

PATCH v2 5/5 agents: add a skill to write commit messages

In reply to Sasha Levin

Assistants are asked to commit a fix with a detailed message, and the find-fixes and stable-tag skills leave their tags for that message, but nothing says how to write it. Messages written by assistants tend to be long, and Linus recently asked that pull request text written with an LLM be less verbose and prefer the imperative voice.

Add a procedure that drafts, rewrites or reviews a commit message or cover letter. It works from the change, the sources the caller provides, the mailing list discussion found with lei, and the results of the find-fixes and stable-tag skills. It follows the maintainer profiles listed in MAINTAINERS instead of restating them, keeps the text short and in the imperative mood, and returns an unresolved result instead of inventing the reason for a change. Add a second procedure that drafts the signed tag and email of a pull request.

Keep the skill entry point and procedures together under agents/skills/commit-message/. Connect them to the coding-assistant guidance so that fixes are committed with a message written this way. The skill returns text only; committing, tagging and sending stay with the calling workflow.

Validated with two agents on recent mainline fixes from the tip, KVM, netdev, media and devicetree trees and on recent pull requests, with the upstream messages withheld. With the skill, the median message body went from 199 to 125 words for one agent and from 115 to 92 for the other, and neither added tags that were not supplied.

Assisted-by LLM
---
 Documentation/process/coding-assistants.rst   |  23 +-
 agents/skills/commit-message/SKILL.md         |  29 +++
 agents/skills/commit-message/guide.rst        | 200 ++++++++++++++++++
 agents/skills/commit-message/pull-request.rst | 113 ++++++++++
 agents/skills/stable-tag/guide.rst            |   3 +-
 5 files changed, 363 insertions(+), 5 deletions(-)
 create mode 100644 agents/skills/commit-message/SKILL.md
 create mode 100644 agents/skills/commit-message/guide.rst
 create mode 100644 agents/skills/commit-message/pull-request.rst
Documentation/process/coding-assistants.rst +19 -4
index 004a1e7a20de1..6b4d55c34fe0b 100644
@@ -113,6 +113,20 @@ The skill reports the sites it finds and verifies. It does not fix them or
 add them to the fix being prepared. Report confirmed sites with the fix, so
 that they can be fixed separately.
 
+Writing commit messages
+=======================
+
+Before committing a change, an assistant should follow
+agents/skills/commit-message/guide.rst to write its commit message. This also
+applies to rewriting or reviewing a commit message and to writing the cover
+letter of a series. For the signed tag and email of a pull request, follow
+agents/skills/commit-message/pull-request.rst. The skill entry point is
+agents/skills/commit-message/SKILL.md.
+
+The skill returns a draft only. It does not create or amend commits, create
+tags, or send mail. If the reason for the change or a Fixes or stable decision
+is unresolved, report what is missing and keep the change as a draft.
+
 Procedure for finding and fixing bugs
 =====================================
 
@@ -138,10 +152,11 @@ these steps:
    checkpatch.pl checks (see submitting-patches.rst). Then look for the same
    bug elsewhere, as described above.
 6. Determine the Fixes tag and the stable tag as described above. Once both
-   are resolved, commit the working fix with a detailed message describing
-   the problem, the solution, the verified Fixes tag and any stable tag. This
-   commit is part of the fix-preparation workflow, not the skills. Do not add
-   a Signed-off-by tag, and add an Assisted-by tag, as described above.
+   are resolved, write the commit message as described above, describing the
+   problem, the solution, the verified Fixes tag and any stable tag, and
+   commit the working fix with it. This commit is part of the fix-preparation
+   workflow, not the skills. Do not add a Signed-off-by tag, and add an
+   Assisted-by tag, as described above.
 7. Identify the maintainers and lists using scripts/get_maintainer.pl.
    Documentation/process/security-bugs.rst shows how to do that.
 8. Indicate what could not be done. If the fix could not be built or tested, or
agents/skills/commit-message/SKILL.md new file +29 -0
new file mode 100644
index 0000000000000..fe295cc7e32f0
@@ -0,0 +1,29 @@
+---
+# SPDX-License-Identifier: GPL-2.0-only
+name: commit-message
+description: >-
+  Write, rewrite or review the commit message for a Linux kernel change or
+  the cover letter for a patch series, and write the signed tag and pull
+  request text for a subsystem pull. Use when committing or preparing
+  patches, when asked to improve or check a commit message, or when
+  preparing a pull request for an upstream maintainer.
+---
+
+# Write a commit message
+
+For a commit message or a cover letter, read and follow [the
+procedure](guide.rst). For the signed tag and email of a pull request,
+read and follow [the pull request procedure](pull-request.rst). Both paths
+are relative to this skill directory. The canonical paths in the kernel
+repository are `agents/skills/commit-message/guide.rst` and
+`agents/skills/commit-message/pull-request.rst`. If necessary, locate the
+repository root with `git rev-parse --show-toplevel`.
+
+Draft the text only. Return it with the source of each statement and tag,
+or an unresolved result explaining what is missing. Do not change files in
+the repository, the index, refs, tags, or commit messages, and do not send
+mail; temporary files, such as a patch for checkpatch, belong outside the
+repository. Never add a Signed-off-by tag. An unresolved result must not
+contain a message with placeholders; it tells the calling workflow to hold
+the commit or pull request. Committing, tagging and sending belong to that
+workflow.
agents/skills/commit-message/guide.rst new file +200 -0

200 lines not on this page · raw message

agents/skills/commit-message/pull-request.rst new file +113 -0

113 lines not on this page · raw message

agents/skills/stable-tag/guide.rst +2 -1
index ad6c0fc14f24b..97aa5cc6559fb 100644
@@ -163,7 +163,8 @@ Return the decision
 -------------------
 
 Return the stable decision to the caller. Drafting a commit message or adding
-other trailers is outside this procedure.
+other trailers is outside this procedure; see
+agents/skills/commit-message/guide.rst.
 
 For a tag, provide:
 
Signature · 1 line
2.53.0
maintainer
#16 lore raw
In reply to Sasha Levin
Quoted 9 lines · Sasha Levin

At the Maintainers Summit, Ted asked whether the stable trees have a way to deal with incorrect Fixes tags. Hannes estimated that 15-20% of them are wrong, often because the author ran git blame and took the first commit that touched the line [1]. We use LLM workflows to find the commit that actually introduced a bug, and others asked us to share them.

This series adds them as agent skills under agents/skills/, together with a skill for writing commit messages:

Time to argue for a more fuchsia shade of mauve without actually getting into the substance of what you're doing...:)

I wonder about the top-level agents/ directory. If we regard this material as documentation, perhaps the "skills" should go there too? As readable text, they might just help to improve human skills as well, assuming we think we still need those. Under Documentation, they could be built into the rendered docs and made more widely available.

Otherwise, if this is primarily a development tool, perhaps under tools/ makes sense?

I lack strong opinions here, but figured I would ask the question.

jon

#17 lore raw
Quoted 21 lines · Jonathan Corbet
Quoted 9 lines · Sasha Levin

At the Maintainers Summit, Ted asked whether the stable trees have a way to deal with incorrect Fixes tags. Hannes estimated that 15-20% of them are wrong, often because the author ran git blame and took the first commit that touched the line [1]. We use LLM workflows to find the commit that actually introduced a bug, and others asked us to share them.

This series adds them as agent skills under agents/skills/, together with a skill for writing commit messages:

Time to argue for a more fuchsia shade of mauve without actually getting into the substance of what you're doing...:)

I wonder about the top-level agents/ directory. If we regard this material as documentation, perhaps the "skills" should go there too? As readable text, they might just help to improve human skills as well, assuming we think we still need those. Under Documentation, they could be built into the rendered docs and made more widely available.

Quoted 4 lines

Otherwise, if this is primarily a development tool, perhaps under tools/ makes sense?

I lack strong opinions here, but figured I would ask the question.

I was expecting this to appear under Documentation/. The agents are designed to read human text, so let's make it at least passingly sensible for humans to read too. :)

Signature · 1 line
Kees Cook
#3 lore raw

Re: [PATCH v2 2/5] agents: add a skill to determine Fixes tags

In reply to Sasha Levin

agents/skills/find-fixes/guide.rst line 46

Quoted 12 lines · Sasha Levin
agents/skills/find-fixes/guide.rst new file +12 -0
+Resolve revisions against the repository being inspected. For example, with
+``fix`` set to the supplied revision::
+
+    git rev-parse --show-toplevel
+    git rev-parse --verify --end-of-options "$fix^{commit}"
+    git show --no-patch --format=fuller "$fix"
+    git rev-list --parents -n 1 "$fix"
+    git show --format= --find-renames "$fix"
+
+Use ``git diff --cached`` and ``git diff`` to inspect staged and unstaged work.
+Read the surrounding code at the pre-fix base with ``git show <base>:<path>``.
+Do not assume the current checkout contains the historical implementation.

I don't really like having "how to use git" in here. Especially not "how to figure out what the staged diff is". That is way off topic.

agents/skills/find-fixes/guide.rst line 69

Quoted 10 lines
agents/skills/find-fixes/guide.rst new file +10 -0
+Useful read-only searches include the following. Here ``base``, ``path``,
+``old_path``, ``new_path``, and ``candidate`` refer to identified revisions or
+paths; replace the example line range and expressions with relevant ones::
+
+    git blame -M -C -L 100,140 "$base" -- "$path"
+    git log --follow -p "$base" -- "$path"
+    git log -p -S 'relevant expression' "$base" -- "$old_path" "$new_path"
+    git log -p -G 'relevant.*pattern' "$base" -- "$old_path" "$new_path"
+    git show --find-renames "$candidate" -- "$old_path" "$new_path"
+    git rev-list --parents -n 1 "$candidate"

For example, using -S and -G here can be *extremely* slow. I think it's best to keep this skill as short as it can possibly be. Adding these "off topic" diversions seems like a token-eating mistake to me.

The overall guidance about how/why and where a short-cut isn't workable all read well, though.

-Kees

Signature · 1 line
Kees Cook
#7 lore raw

Re: [PATCH v2 3/5] agents: add a skill to determine stable tags

In reply to Sasha Levin

agents/skills/stable-tag/guide.rst line 12

Quoted 5 lines · Sasha Levin
agents/skills/stable-tag/guide.rst new file +5 -0
+A stable tag in the sign-off area asks the stable team to backport a commit to
+the stable and longterm trees once it is merged in mainline. The tag syntax is
+described in Documentation/process/stable-kernel-rules.rst. Deciding on a tag
+requires knowing whether the change is stable material, which released kernels
+contain the bug, and whether the fix applies to them.

And I really don't like this redundancy either. The skill should be strictly as short as it can possibly be and then aim at the _existing_ documentation. If agents are getting something wrong after reading Documentation/process/stable-kernel-rules.rst, then we need to add the changes _there_, not in a parallel agent-only file. I would want to see all these skills designed to give the framework needed by the agent to find the _existing_ documentation.

Signature · 1 line
Kees Cook
#10 lore raw

Re: [PATCH v2 4/5] agents: add a skill to find other instances of a fixed bug

In reply to Sasha Levin
Quoted 6 lines · Sasha Levin

A bug fixed in one place often exists elsewhere, in copied code, sibling drivers, or other users of the same interface, and reviewers routinely ask whether that was checked. Add a read-only procedure that states the defect as a rule, searches for it through shared interfaces, copied code, the introducing series, Coccinelle patterns and earlier fixes, and verifies each candidate before reporting it.

Isn't this a basic software engineering skill? I'd expect this to be in any agent's existing model, but okay, there's some Linux-specific aiming in this skill (duplicated drivers, etc).

I'd still prefer that this documentation, which we don't really have anywhere else in the tree that I'm aware of, should be in a human area, with the skill referencing it instead of duplicating it.

Signature · 1 line
Kees Cook
#4 lore raw

Re: [PATCH v2 2/5] agents: add a skill to determine Fixes tags

In reply to Sasha Levin
Quoted 13 lines · Sasha Levin

Blame and existing Fixes tags can point to code movement instead of the change that introduced a bug. Add a read-only investigation procedure that traces historical behavior and checks candidate commits against their parents before returning a tag with supporting evidence.

Keep the skill entry point and procedure together under agents/skills/find-fixes/. Connect the procedure to the coding-assistant guidance so bug fixes get verified attribution before finalization.

If the origin cannot be established, return no trailer and keep the fix as a draft. Applying the tag and writing the commit message remain outside the skill.

Quoted 6 lines

Validated with controlled histories covering moved code, changed preconditions, incorrect tags, shallow history, and reintroduction after a revert, as well as a real kernel fix.

Assisted-by LLM

Current documentation states:

A Fixes: tag indicates that the patch fixes a bug in a previous commit. It is used to make it easy to determine where an issue originated, which can help review a bug fix. This tag also assists the stable kernel team in determining which stable kernel versions should receive your fix. This is the preferred method for indicating a bug fixed by the patch. See :ref:describe_changes for more details.

the second part is easy to miss, so "what about an old bug in commit A commit B exposes" and "what if the bug both in commit A and commit B" are pretty common questions.

Worth answering, maybe, and maybe here: the implication of the "stable kernel team" rule is that the meaning of the tag is actually: "if you have commit A then you need this commit".

Quoted 263 lines
---
 Documentation/process/coding-assistants.rst |  23 ++-
 agents/skills/find-fixes/SKILL.md           |  23 +++
 agents/skills/find-fixes/guide.rst          | 177 ++++++++++++++++++++
 3 files changed, 220 insertions(+), 3 deletions(-)
 create mode 100644 agents/skills/find-fixes/SKILL.md
 create mode 100644 agents/skills/find-fixes/guide.rst
Documentation/process/coding-assistants.rst +20 -3
index 3288b32e993f5..8d42d3c10f9ce 100644
@@ -70,6 +70,21 @@ Example::
 
   Assisted-by: LLM coccinelle sparse
 
+Determining Fixes tags
+======================
+
+Before finalizing a bug-fix patch or its commit message, an assistant must
+follow agents/skills/find-fixes/guide.rst to determine and verify the
+introducing commit. This also applies to fixes for externally reported
+bugs and to checking an existing Fixes tag during review. The skill entry
+point is agents/skills/find-fixes/SKILL.md.
+
+The skill returns an attribution result only. It does not modify files or
+commit messages, and invoking it does not authorize creating or amending a
+commit. If the origin remains unresolved, report the missing evidence and
+keep the fix as a draft. The calling workflow must hold finalization until
+the attribution is resolved.
+
 Procedure for finding and fixing bugs
 =====================================
 
@@ -93,9 +108,11 @@ these steps:
    re-running a complete analysis; drop any fix that doesn't work and try
    another one. The fix must not add build warnings and must pass the
    checkpatch.pl checks (see submitting-patches.rst).
-6. Commit the working fix with a detailed message describing the problem, the
-   solution and a Fixes tag. Do not add a Signed-off-by tag, and add an
-   Assisted-by tag, as described above.
+6. Determine the Fixes tag as described above. Once attribution is resolved,
+   commit the working fix with a detailed message describing the problem,
+   the solution and the verified Fixes tag. This commit is part of the
+   fix-preparation workflow, not the attribution skill. Do not add a
+   Signed-off-by tag, and add an Assisted-by tag, as described above.
 7. Identify the maintainers and lists using scripts/get_maintainer.pl.
    Documentation/process/security-bugs.rst shows how to do that.
 8. Indicate what could not be done. If the fix could not be built or tested, or
agents/skills/find-fixes/SKILL.md new file +23 -0
new file mode 100644
index 0000000000000..14978976fdd46
@@ -0,0 +1,23 @@
+---
+# SPDX-License-Identifier: GPL-2.0-only
+name: find-fixes
+description: >-
+  Determine the bug-introducing commit and return a verified Fixes tag for
+  a Linux kernel fix. Use when preparing or reviewing bug-fix patches,
+  drafting their commit messages, or checking an existing Fixes tag.
+---
+
+# Determine a Fixes tag
+
+Read and follow [the investigation procedure](guide.rst), relative to this
+skill directory. The canonical path in the kernel repository is
+`agents/skills/find-fixes/guide.rst`. If necessary, locate the
+repository root with `git rev-parse --show-toplevel`.
+
+Perform attribution only. Return the tag and its supporting evidence, or
+an unresolved result explaining the missing evidence. Return no other
+trailers or commit-message draft as part of the skill. Do not change files,
+the index, refs, or commit messages, and do not apply the tag or create a
+commit. An unresolved result must contain no Fixes trailer or placeholder;
+it tells the calling workflow to hold finalization. Applying a determined
+tag belongs to that workflow.
agents/skills/find-fixes/guide.rst new file +177 -0
new file mode 100644
index 0000000000000..7b58c526f3149
@@ -0,0 +1,177 @@
+.. SPDX-License-Identifier: GPL-2.0-only
+
+.. _find_fixes:
+
+Finding the commit to name in a Fixes tag
+=========================================
+
+A ``Fixes:`` tag identifies the commit that introduced the bug being fixed.
+Finding that commit requires an explanation of the failure and evidence from
+the history. The last commit touching a line, the oldest matching text, an
+existing tag, and a reproducer's first failure are useful leads; none alone
+establishes the answer.
+
+This procedure applies to bug fixes, including fixes for externally reported
+issues and reviews of proposed Fixes tags. It determines a tag using read-only
+inspection. It does not authorize changing files, applying patches, checking
+out revisions, fetching history, or creating or amending commits. Any additional
+testing or changes require the authority of the surrounding task.
+
+Establish the issue and the history
+-----------------------------------
+
+Record the issue, the proposed fix, and the version being fixed:
+
+* For a commit, resolve its full object ID and inspect its message, diff, and
+  parents. For an ordinary commit, its parent is the pre-fix base. For a merge,
+  identify which parent or combined state the fix addresses.
+* For a patch, identify its base revision. For uncommitted changes, distinguish
+  the staged and unstaged changes and record the base commit. Do not include
+  unrelated work in the analysis. Note relevant untracked files separately.
+* Explain the exact failure: the operation, inputs or interleaving, affected
+  configuration, and invariant that is violated. Identify the functions and
+  callers needed to explain it, not just the lines changed by the fix.
+
+Resolve revisions against the repository being inspected. For example, with
+``fix`` set to the supplied revision::
+
+    git rev-parse --show-toplevel
+    git rev-parse --verify --end-of-options "$fix^{commit}"
+    git show --no-patch --format=fuller "$fix"
+    git rev-list --parents -n 1 "$fix"
+    git show --format= --find-renames "$fix"
+
+Use ``git diff --cached`` and ``git diff`` to inspect staged and unstaged work.
+Read the surrounding code at the pre-fix base with ``git show <base>:<path>``.
+Do not assume the current checkout contains the historical implementation.
+
+If the base or failure mechanism cannot be established, report what is missing
+before selecting an introducer. A broad description such as "a race" is not
+enough to distinguish different bugs in the same function.
+
+Trace candidate introductions
+-----------------------------
+
+Start with the operations responsible for the failure. Inspect their history
+and the history of relevant callers, contracts, guards, and data structures.
+Treat any supplied Fixes tag, blame result, or bisection result as a candidate
+to investigate, rather than as the conclusion.
+
+Useful read-only searches include the following. Here ``base``, ``path``,
+``old_path``, ``new_path``, and ``candidate`` refer to identified revisions or
+paths; replace the example line range and expressions with relevant ones::
+
+    git blame -M -C -L 100,140 "$base" -- "$path"
+    git log --follow -p "$base" -- "$path"
+    git log -p -S 'relevant expression' "$base" -- "$old_path" "$new_path"
+    git log -p -G 'relevant.*pattern' "$base" -- "$old_path" "$new_path"
+    git show --find-renames "$candidate" -- "$old_path" "$new_path"
+    git rev-list --parents -n 1 "$candidate"
+
+Blame and pickaxe narrow the search; they do not prove causality. ``-S`` finds
+changes in occurrence counts, while ``-G`` finds matching changed lines. Follow
+renames, copies, splits, and equivalent older implementations explicitly when
+a search stops at code movement. Inspect complete candidate changes and their
+context, including relevant files outside the fix's diff.
+
+Search all relevant ancestry, not just first-parent history. Choose history
+endpoints from the actual base and repository refs; do not assume a remote
+named ``origin`` or a branch named ``master``. When examining history outside
+the base's ancestry, explain how it relates to the affected tree.
+
+Prove the causal transition
+---------------------------
+
+For each plausible candidate, compare its relevant parent state with the state
+after the commit. Explain the invariant before and after the change, why the
+candidate introduces the defect, and how the proposed fix addresses that same
+defect. Inspect the earlier implementation even if the function or filename
+did not yet exist under its current name.
+
+Distinguish three events:
+
+* Introduction of the code or pattern. This is provenance, and may predate any
+  defect in it.
+* Introduction of the semantic defect. This is the change that makes the
+  implementation violate the applicable contract or invariant.
+* A later trigger, newly reachable path, or change that makes the failure easier
+  to observe. This may expose an existing defect, or may itself introduce the
+  defect by changing the contract or execution context.
+
+Do not select a rename or refactor if it merely carries an existing defect.
+Conversely, do not blame old code that was correct under the earlier contract.
+When a later change exposes a latent defect, identify both commits and explain
+why the older implementation was already defective. The location of the fix
+does not prove that the oldest version of the modified code was wrong. If the
+distinction cannot be justified, keep the result unresolved.
+
+A reproducer that fails after the candidate and succeeds before it provides
+useful evidence when both tests exercise equivalent conditions. Build failures,
+missing features, unsupported configurations, and changes to the test itself
+are not evidence of a good parent. A bisection may locate an activation change
+rather than the semantic origin. Historical source analysis is acceptable when
+it establishes the transition; describe its reasoning and limits without
+claiming tests were run.
+
+Handle discontinuities in history
+---------------------------------
+
+* **Merges:** inspect each relevant parent. A bad merge resolution or the
+  interaction of two branches can introduce a defect absent from either parent;
+  do not assume that the first parent alone explains the transition.
+* **Reverts and reintroductions:** trace whether the defect was removed and
+  subsequently restored. Establish the introduction relevant to the affected
+  lineage instead of automatically choosing the earliest occurrence.
+* **Backports:** distinguish the upstream commit from its downstream copy and
+  inspect any adaptation. For an upstream defect, identify the upstream origin
+  and document its relationship to the affected branch. If the defect exists
+  only because of a backport adaptation, identify that downstream introduction.
+  An upstream SHA need not be an ancestor of a downstream base; verify the
+  correspondence from the changes rather than ancestry or subjects alone.
+* **Multiple causes:** keep independent bugs separate. If a single fix repairs
+  distinct introductions, justify each separately before proposing multiple
+  tags. Do not list competing guesses as multiple Fixes tags.
+* **Incomplete history:** check ``git rev-parse --is-shallow-repository`` and
+  whether the required commits and historical blobs are available. A shallow
+  boundary, missing object, or initial import is not proof of introduction.
+  If the defect predates available history, including pre-Git history, report
+  that limit rather than assigning the first available commit by default.
+
+Existing tags and external reports can suggest candidates, but inspect the
+actual historical changes. Reject alternatives with a concrete reason, such
+as unchanged behavior across a file split or a caller that could not supply
+the problematic input under the earlier contract.
+
+Return a conclusion supported by evidence
+-----------------------------------------
+
+Return the attribution result to the caller. Drafting a commit message or
+adding other trailers is outside this procedure.
+
+For a determined result, provide:
+
+* The issue and fix/base revisions analyzed.
+* The full introducing commit ID and an explanation of the parent-to-candidate
+  transition, citing the relevant historical code or test results.
+* Any distinct activation commit, material rejected candidates, and limitations
+  such as tests not run or history not available.
+* The proposed Fixes tag, rendered from the verified commit's Git metadata.
+
+For example, after resolving ``candidate`` to the selected full commit ID::
+
+    git rev-parse --verify --end-of-options "$candidate^{commit}"
+    git show --no-patch --abbrev=12 --format='Fixes: %h ("%s")' "$candidate"
+
+Git extends the abbreviation if necessary to make it unique in the available
+repository. Preserve the exact subject and keep the tag on one line, as
+described in Documentation/process/submitting-patches.rst. Formatting checks
+such as ``scripts/checkpatch.pl`` do not validate the causal conclusion.
+
+For an unresolved result, provide the candidates, evidence, missing information,
+and the next investigation that could distinguish them. Do not emit a Fixes
+trailer or placeholder. The calling bug-fix workflow must hold finalization
+and surface the unresolved origin instead of fabricating a tag or silently
+treating the investigation as complete.
+
+Determining a Fixes tag does not establish stable eligibility or replace the
+requirements in Documentation/process/stable-kernel-rules.rst.
Signature · 1 line
2.53.0
#11 lore raw

Re: [PATCH v2 4/5] agents: add a skill to find other instances of a fixed bug

In reply to Kees Cook
Quoted 11 lines · Kees Cook
Quoted 6 lines · Sasha Levin

A bug fixed in one place often exists elsewhere, in copied code, sibling drivers, or other users of the same interface, and reviewers routinely ask whether that was checked. Add a read-only procedure that states the defect as a rule, searches for it through shared interfaces, copied code, the introducing series, Coccinelle patterns and earlier fixes, and verifies each candidate before reporting it.

Isn't this a basic software engineering skill? I'd expect this to be in any agent's existing model, but okay, there's some Linux-specific aiming in this skill (duplicated drivers, etc).

This actually comes from a local rig I have to teach it to use tools like Coccinelle for these tasks instead of going on a 10 hour, 50 million token adventure auditing our entire set of drivers in the kernel :)

Quoted 3 lines

I'd still prefer that this documentation, which we don't really have anywhere else in the tree that I'm aware of, should be in a human area, with the skill referencing it instead of duplicating it.

Ack. Let me think about this.

Signature · 2 lines
Thanks,
Sasha
#18 lore raw
In reply to Kees Cook
Quoted 22 lines · Kees Cook
Quoted 21 lines · Jonathan Corbet
Quoted 9 lines · Sasha Levin

At the Maintainers Summit, Ted asked whether the stable trees have a way to deal with incorrect Fixes tags. Hannes estimated that 15-20% of them are wrong, often because the author ran git blame and took the first commit that touched the line [1]. We use LLM workflows to find the commit that actually introduced a bug, and others asked us to share them.

This series adds them as agent skills under agents/skills/, together with a skill for writing commit messages:

Time to argue for a more fuchsia shade of mauve without actually getting into the substance of what you're doing...:)

I wonder about the top-level agents/ directory. If we regard this material as documentation, perhaps the "skills" should go there too? As readable text, they might just help to improve human skills as well, assuming we think we still need those. Under Documentation, they could be built into the rendered docs and made more widely available.

Quoted 8 lines
Quoted 4 lines

Otherwise, if this is primarily a development tool, perhaps under tools/ makes sense?

I lack strong opinions here, but figured I would ask the question.

I was expecting this to appear under Documentation/. The agents are designed to read human text, so let's make it at least passingly sensible for humans to read too. :)

What sucks here is that these prompts aren't very human readable. They are overly verbose, they assume being able to remember a whole bunch of small instructions, and target specific issues that we're observing with these agents.

I get why Documentation/ makes sense (it's not code per-se), but I could also argue similarily for tools/ :)

Either way, I don't really think it matters to me, and will happily move it to Documentation/agents/ unless someone else chimes in with a reason NOT to...

Signature · 2 lines
Thanks,
Sasha
#8 lore raw

Re: [PATCH v2 3/5] agents: add a skill to determine stable tags

In reply to Kees Cook
Quoted 14 lines · Kees Cook

agents/skills/stable-tag/guide.rst line 12

Quoted 5 lines · Sasha Levin
agents/skills/stable-tag/guide.rst new file +5 -0
+A stable tag in the sign-off area asks the stable team to backport a commit to
+the stable and longterm trees once it is merged in mainline. The tag syntax is
+described in Documentation/process/stable-kernel-rules.rst. Deciding on a tag
+requires knowing whether the change is stable material, which released kernels
+contain the bug, and whether the fix applies to them.

And I really don't like this redundancy either. The skill should be strictly as short as it can possibly be and then aim at the _existing_ documentation. If agents are getting something wrong after reading Documentation/process/stable-kernel-rules.rst, then we need to add the changes _there_, not in a parallel agent-only file. I would want to see all these skills designed to give the framework needed by the agent to find the _existing_ documentation.

w.r.t to your comments on verbosity/duplication on a few of the patches: I'll try and reduce it, and will run the local test rig I have for this. I'll see how we can minimize them.

Signature · 2 lines
Thanks,
Sasha
#19 lore raw
In reply to Kees Cook
Quoted 21 lines · Kees Cook
Quoted 20 lines · Jonathan Corbet
Quoted 9 lines · Sasha Levin

At the Maintainers Summit, Ted asked whether the stable trees have a way to deal with incorrect Fixes tags. Hannes estimated that 15-20% of them are wrong, often because the author ran git blame and took the first commit that touched the line [1]. We use LLM workflows to find the commit that actually introduced a bug, and others asked us to share them.

This series adds them as agent skills under agents/skills/, together with a skill for writing commit messages:

Time to argue for a more fuchsia shade of mauve without actually getting into the substance of what you're doing...:)

I wonder about the top-level agents/ directory. If we regard this material as documentation, perhaps the "skills" should go there too? As readable text, they might just help to improve human skills as well, assuming we think we still need those. Under Documentation, they could be built into the rendered docs and made more widely available.

Quoted 8 lines
Quoted 4 lines

Otherwise, if this is primarily a development tool, perhaps under tools/ makes sense?

I lack strong opinions here, but figured I would ask the question.

I was expecting this to appear under Documentation/. The agents are designed to read human text, so let's make it at least passingly sensible for humans to read too. :)

The expectation is that the agents are becoming better in understanding, so more "instructions" can be shared?

If that is not the case, perhaps we need Documentation/translations/simple/, cfr. https://simple.wikipedia? ;-)

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#20 lore raw
Quoted 7 lines · Geert Uytterhoeven
Quoted 3 lines · Kees Cook

I was expecting this to appear under Documentation/. The agents are designed to read human text, so let's make it at least passingly sensible for humans to read too. :)

The expectation is that the agents are becoming better in understanding, so more "instructions" can be shared?

Exactly. And the rate of frontier model improvement has me convinced that there is no need to spend any time writing documentation to be consumed _only_ by the agents. If an agent gets it wrong after reading our existing documentation, ask it what would need to change for it to understand it, and then see if that makes it better for a human too, and send those patches. :)

Signature · 1 line
Kees Cook
#5 lore raw

Re: [PATCH v2 2/5] agents: add a skill to determine Fixes tags

In reply to Michael S. Tsirkin
Quoted 31 lines · Michael S. Tsirkin
Quoted 13 lines · Sasha Levin

Blame and existing Fixes tags can point to code movement instead of the change that introduced a bug. Add a read-only investigation procedure that traces historical behavior and checks candidate commits against their parents before returning a tag with supporting evidence.

Keep the skill entry point and procedure together under agents/skills/find-fixes/. Connect the procedure to the coding-assistant guidance so bug fixes get verified attribution before finalization.

If the origin cannot be established, return no trailer and keep the fix as a draft. Applying the tag and writing the commit message remain outside the skill.

Quoted 6 lines

Validated with controlled histories covering moved code, changed preconditions, incorrect tags, shallow history, and reintroduction after a revert, as well as a real kernel fix.

Assisted-by LLM

Current documentation states:

A Fixes: tag indicates that the patch fixes a bug in a previous commit. It is used to make it easy to determine where an issue originated, which can help review a bug fix. This tag also assists the stable kernel team in determining which stable kernel versions should receive your fix. This is the preferred method for indicating a bug fixed by the patch. See :ref:describe_changes for more details.

Quoted 2 lines

the second part is easy to miss, so "what about an old bug in commit A commit B exposes"

This is pretty common for Makefile cleanups which enable COMPILE_TEST etc. The Fixes tag should point to the commit which introduces the bug and not the one that exposes it. Someone could backport the original patch or expose the bug a different way.

Quoted 3 lines

and "what if the bug both in commit A and commit B" are pretty common questions.

This sentence is missing a verb. I don't understand the question.

Quoted 7 lines

Worth answering, maybe, and maybe here: the implication of the "stable kernel team" rule is that the meaning of the tag is actually: "if you have commit A then you need this commit".

The Fixes tag is useful for stable, but that's not the only point. It also means that if you don't have the commit, then you don't need the fix. It's also useful for training AI for example.

Someone told me that the netdev team was leaving Fixes tags off patches that they didn't want to be backported to stable. But when I looked at it, it was documentation stuff that is really debatable if it deserves a Fixes tag or not. There are some gray areas.

regards,
dan carpenter

#21 lore raw
In reply to Kees Cook
Quoted 6 lines · Kees Cook

Exactly. And the rate of frontier model improvement has me convinced that there is no need to spend any time writing documentation to be consumed _only_ by the agents. If an agent gets it wrong after reading our existing documentation, ask it what would need to change for it to understand it, and then see if that makes it better for a human too, and send those patches. :)

We might not want to assume that everyone has access to frontier models. At the very least some people might want to use things like Gemini Flash instead of Gemini Pro, and there will also be people who wants to use local LLM's. Even if we don't care about usage of more modest LLM's, there is still an economic (and environmental!) reason why we might want to make sure that we promote token-efficient usage. We certainly don't want to assume that LLM's need to read *all* of Documentation for every single prompt.

- Ted

#22 lore raw
Quoted 8 lines · Theodore Tso
Quoted 6 lines · Kees Cook

Exactly. And the rate of frontier model improvement has me convinced that there is no need to spend any time writing documentation to be consumed _only_ by the agents. If an agent gets it wrong after reading our existing documentation, ask it what would need to change for it to understand it, and then see if that makes it better for a human too, and send those patches. :)

Quoted 8 lines

We might not want to assume that everyone has access to frontier models. At the very least some people might want to use things like Gemini Flash instead of Gemini Pro, and there will also be people who wants to use local LLM's. Even if we don't care about usage of more modest LLM's, there is still an economic (and environmental!) reason why we might want to make sure that we promote token-efficient usage. We certainly don't want to assume that LLM's need to read *all* of Documentation for every single prompt.

Agreed, but maintaining the same information twice is work that as of now humans need to do -- and having information for one task in two different places targeting different audiences (humans and LLMs) most likely will lead to small or huge inconsistencies that cause confusion or trouble.

Can't we prevent all of that somehow -- maybe while also improving the docs for humans? Is one of those frontier models maybe now or soon capable of generating and maintaining dedicated skill files for less capable LLMs from documentation written for humans? Or at least pointing out inconsistencies when someone updates one side but not the other?

Ciao, Thorsten

#23 lore raw
Quoted 5 lines · Thorsten Leemhuis

Can't we prevent all of that somehow -- maybe while also improving the docs for humans? Is one of those frontier models maybe now or soon capable of generating and maintaining dedicated skill files for less capable LLMs from documentation written for humans? Or at least pointing out inconsistencies when someone updates one side but not the other?

Every release, we ask, "Treat all of Documentation/ as the correct instructions, and examine all of agents/ to find inconsistencies, redundancies, or conflicts with Documentation/, and correct the agents/ docs. Then do a pass to distil instructions in agents/ down to only what is strictly needed for agents to operate." and commit the results?

Signature · 1 line
Kees Cook
#24 lore raw
In reply to Geert Uytterhoeven
Quoted 5 lines · Geert Uytterhoeven

The expectation is that the agents are becoming better in understanding, so more "instructions" can be shared?

If that is not the case, perhaps we need Documentation/translations/simple/, cfr. https://simple.wikipedia? ;-)

Mostly, yes. v3 shrinks each skill to a short file that points at the existing process documents, and moves the Fixes tag rules agents kept getting wrong into submitting-patches.rst, where humans get them too. What stays in the skills is agent specific, such as not trusting blame and not making up the reason for a change.

So hopefully no simple/ translation needed :)

Signature · 2 lines
Thanks,
Sasha
#12 lore raw

Re: [PATCH v2 4/5] agents: add a skill to find other instances of a fixed bug

In reply to Sasha Levin

agents/skills/find-siblings/guide.rst line 138

Quoted 4 lines · Sasha Levin
agents/skills/find-siblings/guide.rst new file +4 -0
+Each confirmed site is a separate bug. It needs its own fix, and its own Fixes
+tag and stable decision, as described in agents/skills/find-fixes/guide.rst
+and agents/skills/stable-tag/guide.rst. Sites in different drivers or
+subsystems usually get separate patches, possibly in one series.

I don't think it's a right message to send to agents and humans. When the same mistake is made in N places the interface is the problem. It should be fixed in one common place.
This text tells the agent to produce N spot fixes for N maintainers. We already see this issue on bpf list, let's not amplify wrong behavior.

#13 lore raw

Re: [PATCH v2 4/5] agents: add a skill to find other instances of a fixed bug

Quoted 11 lines · Alexei Starovoitov

agents/skills/find-siblings/guide.rst line 138

Quoted 4 lines · Sasha Levin
agents/skills/find-siblings/guide.rst new file +4 -0
+Each confirmed site is a separate bug. It needs its own fix, and its own Fixes
+tag and stable decision, as described in agents/skills/find-fixes/guide.rst
+and agents/skills/stable-tag/guide.rst. Sites in different drivers or
+subsystems usually get separate patches, possibly in one series.

I don't think it's a right message to send to agents and humans. When the same mistake is made in N places the interface is the problem. It should be fixed in one common place.
This text tells the agent to produce N spot fixes for N maintainers. We already see this issue on bpf list, let's not amplify wrong behavior.

What I had in mind was the kind of bug our scripts/coccinelle/ rules look for.

I agree that fixing the interface is better, but do we want to push all these agents there?

So I think it should be a balance. When the skill finds the same defect in several places, it should also ask whether the interface invites the mistake, and if so report that the fix belongs there instead of handing back a list for N maintainers

What do you think?

Signature · 2 lines
Thanks,
Sasha
#14 lore raw

Re: [PATCH v2 4/5] agents: add a skill to find other instances of a fixed bug

Quoted 1 line · Sasha Levin

What I had in mind was the kind of bug our scripts/coccinelle/ rules look for.

For kfree_mismatch.cocci kind, yes. Each site is its own bug. But the other example in the guide is "a missing put when leaving a loop". That's iterators/for_each_child.cocci. It was fixed one driver at a time for years until for_each_child_of_node_scoped() made the put automatic.

Quoted 2 lines

I agree that fixing the interface is better, but do we want to push all these agents there?

To report it, yes. The skill is read-only anyway. Whether to change the interface is for the human to decide.

Quoted 4 lines

So I think it should be a balance. When the skill finds the same defect in several places, it should also ask whether the interface invites the mistake, and if so report that the fix belongs there instead of handing back a list for N maintainers

Makes sense to me.