Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions includes/commit-check.toml

This file was deleted.

15 changes: 15 additions & 0 deletions includes/commit-check.toml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[commit]
conventional_commits = false
subject_max_length = 72
subject_min_length = 1
# Reject LLM session URL trailers and promotional "Generated with" lines
message_pattern = '(?ims)(?!.*^(?:[\w-]+-session:\s|\W*generated (?:with|by) \S))'
{%- if llm_contribution_policy == "not-accepted" %}
ai_attribution = "forbid"
{%- else %}
ai_attribution = "disclose"
ai_disclosure_trailers = ["Assisted-by"]
# Assisted-by: values must not be email addresses or URLs
ai_disclosure_pattern = '^(?!.*(@|://)).*\S'
{%- endif %}
{#- vim: set ft=toml: #}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{%- include pathjoin("includes", "commit-check.toml") -%}
{%- include pathjoin("includes", "commit-check.toml.jinja") -%}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{%- include pathjoin("includes", "commit-check.toml") -%}
{%- include pathjoin("includes", "commit-check.toml.jinja") -%}
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,24 @@ LLM-generated code or text, and be able to explain it on request.
{%- elif llm_contribution_policy == "accepted-with-disclosure" -%}
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."
{%- elif llm_contribution_policy == "not-accepted" -%}
You may use LLM tools to help you understand code, run commands, or plan your
work. However, code and text you submit must be authored by you, not generated
by an LLM.

Commits with LLM attribution are rejected. This includes `Assisted-by:` or
`Co-authored-by:` trailers, LLM session URLs, and promotional lines such as
"Generated with [...]".
{%- endif %}
{%- if not enable_docs %}

Expand Down
55 changes: 55 additions & 0 deletions tests/template/__snapshots__/test_commit_check.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# serializer version: 1
# name: test_commit_check_config[private-commit-check.toml-accepted-with-disclosure]
'''
[commit]
conventional_commits = false
subject_max_length = 72
subject_min_length = 1
# Reject LLM session URL trailers and promotional "Generated with" lines
message_pattern = '(?ims)(?!.*^(?:[\w-]+-session:\s|\W*generated (?:with|by) \S))'
ai_attribution = "disclose"
ai_disclosure_trailers = ["Assisted-by"]
# Assisted-by: values must not be email addresses or URLs
ai_disclosure_pattern = '^(?!.*(@|://)).*\S'

'''
# ---
# name: test_commit_check_config[private-commit-check.toml-not-accepted]
'''
[commit]
conventional_commits = false
subject_max_length = 72
subject_min_length = 1
# Reject LLM session URL trailers and promotional "Generated with" lines
message_pattern = '(?ims)(?!.*^(?:[\w-]+-session:\s|\W*generated (?:with|by) \S))'
ai_attribution = "forbid"

'''
# ---
# name: test_commit_check_config[public-.github/commit-check.toml-accepted-with-disclosure]
'''
[commit]
conventional_commits = false
subject_max_length = 72
subject_min_length = 1
# Reject LLM session URL trailers and promotional "Generated with" lines
message_pattern = '(?ims)(?!.*^(?:[\w-]+-session:\s|\W*generated (?:with|by) \S))'
ai_attribution = "disclose"
ai_disclosure_trailers = ["Assisted-by"]
# Assisted-by: values must not be email addresses or URLs
ai_disclosure_pattern = '^(?!.*(@|://)).*\S'

'''
# ---
# name: test_commit_check_config[public-.github/commit-check.toml-not-accepted]
'''
[commit]
conventional_commits = false
subject_max_length = 72
subject_min_length = 1
# Reject LLM session URL trailers and promotional "Generated with" lines
message_pattern = '(?ims)(?!.*^(?:[\w-]+-session:\s|\W*generated (?:with|by) \S))'
ai_attribution = "forbid"

'''
# ---
68 changes: 68 additions & 0 deletions tests/template/__snapshots__/test_contributing.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -221,12 +225,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

## Development documentation

Expand Down Expand Up @@ -350,6 +358,10 @@
work. However, code and text you submit must be authored by you, not generated
by an LLM.

Commits with LLM attribution are rejected. This includes `Assisted-by:` or
`Co-authored-by:` trailers, LLM session URLs, and promotional lines such as
"Generated with [...]".

'''
# ---
# name: test_contributing_features[not-accepted-no_docs]
Expand Down Expand Up @@ -383,6 +395,10 @@
work. However, code and text you submit must be authored by you, not generated
by an LLM.

Commits with LLM attribution are rejected. This includes `Assisted-by:` or
`Co-authored-by:` trailers, LLM session URLs, and promotional lines such as
"Generated with [...]".

## Development documentation

### Prerequisites
Expand Down Expand Up @@ -503,12 +519,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -543,12 +563,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -583,12 +607,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -623,12 +651,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -663,12 +695,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -703,12 +739,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -743,12 +783,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -783,12 +827,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -823,12 +871,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -863,12 +915,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -903,12 +959,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -943,12 +1003,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Expand Down Expand Up @@ -983,12 +1047,16 @@
A contributor is always the author of their contributions.
You must read, review, and understand everything you submit, including
LLM-generated code or text, and be able to explain it on request.
Contributions must be submitted by a person, not autonomously by a bot or
LLM agent.

If a commit contains code or text largely generated by an LLM, add an
`Assisted-by: <tool>:<model>` trailer to its message. This can be done
automatically with `git commit --trailer="Assisted-by: <tool>:<model>"`.

Do not use `Co-authored-by:` for LLM attribution. LLMs are tools, not authors.
Do not include LLM session URLs, or promotional lines such as
"Generated with [...]."

'''
# ---
Loading
Loading