This is an automated email from the ASF dual-hosted git repository.

He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git


The following commit(s) were added to refs/heads/main by this push:
     new 0b775569bc docs: add AI licensing rules to AGENTS.md and CLAUDE.md 
(#2993)
0b775569bc is described below

commit 0b775569bc8ed5d20a01adbe2ab5ec616d4b1770
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon May 25 21:27:44 2026 +0800

    docs: add AI licensing rules to AGENTS.md and CLAUDE.md (#2993)
    
    Motivation:
    AI assistants have invented or pasted incorrect license headers when
    creating new files, including putting the Akka-derived header on files
    that contain no Akka code. The licensing rules already live in
    CONTRIBUTING.md but were not reflected in the agent-facing guides.
    
    Modification:
    Add a Licensing Rules section to AGENTS.md that mirrors the rules in
    CONTRIBUTING.md, instructs agents to use `sbt headerCreateAll` rather
    than hand-write headers, and requires PR-level disclosure for copied
    code. Update CLAUDE.md to reference the rules in the PR checklist.
    
    Result:
    Future agent contributions follow the same licensing guidance as human
    contributors, headers are generated by sbt instead of fabricated, and
    copied code provenance is captured in the PR.
    
    Tests:
    - Not run - docs only
    
    References:
    None - aligns AGENTS.md and CLAUDE.md with the licensing rules already
    documented in CONTRIBUTING.md
---
 AGENTS.md | 12 ++++++++++++
 CLAUDE.md |  3 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/AGENTS.md b/AGENTS.md
index 5e2ce1a4dc..906e77de78 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -12,6 +12,18 @@ Follow `CONTRIBUTING.md`. If this file conflicts with 
`CONTRIBUTING.md`, follow
 - Read neighboring code before editing.
 - Preserve existing license and copyright notices.
 - Do not add `@author` tags.
+- Follow the Licensing Rules below for every new file.
+
+## Licensing Rules
+
+- Do not hand-write or invent license headers. Let sbt manage them.
+- For new files, run `sbt headerCreateAll` to add the correct header. Do not 
manually paste header text.
+- Run `sbt +headerCheckAll` to verify all files carry the expected header.
+- Existing files with copyright statements must keep those copyright 
statements intact. Never delete or rewrite an existing copyright notice; only 
add information.
+- New files containing new code must use the standard Apache license header. 
Do not add the special Pekko header that mentions Akka unless you are copying 
code from an existing Akka-derived file.
+- If you copy code from another file in this repository, preserve that file's 
original headers in the new file.
+- If you copy code from an external project, do not commit it silently. Note 
the source in the PR description so maintainers can verify license 
compatibility and update `LICENSE` if needed.
+- `sbt headerCreateAll` does not know the origin of new code; you must still 
record copied-code provenance in the PR.
 
 ## PR Rules
 
diff --git a/CLAUDE.md b/CLAUDE.md
index 4fb394e87c..5c909194c8 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -7,7 +7,8 @@ Before opening or updating a PR, verify:
 - Non-doc-only changes have directional tests.
 - Native `scalafmt` or the sbt scalafmt tasks were run for changed Scala/SBT 
files, or the missing tool is recorded in `Tests`.
 - `sbt javafmtAll` was run with JDK 17 when relevant.
-- `sbt headerCreateAll` was run.
+- `sbt headerCreateAll` was run to add headers for new files. Never hand-write 
or invent license headers; let sbt manage them, and preserve existing copyright 
notices intact.
+- For copied code, the source file or external project is noted in the PR (see 
Licensing Rules in `AGENTS.md`).
 - Binary compatibility is preserved, and the GitHub `Check / Binary 
Compatibility` job passes before merge.
 - `sbt +mimaReportBinaryIssues` was run for public API, binary shape, 
serialization, or MiMa-sensitive internal changes.
 - Commit messages follow the `AGENTS.md` format.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to