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
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,18 @@ body:
attributes:
label: Package manager of the affected project
placeholder: npm 11, pnpm 10, Yarn 1, Yarn 4, Bun
- type: dropdown
id: ai-use
attributes:
label: AI use
description: Required, for everyone. Say whether AI tools helped write this issue.
options:
- No AI tool was used
- AI tools were used
validations:
required: true
- type: textarea
id: ai-tools
attributes:
label: AI tools used
description: If AI tools were used, name each one and what it did, for example "ChatGPT summarised the error log".
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@ body:
- 'Hardening and release candidate'
- 'After 1.0.0'
- 'Not on the roadmap yet'
- type: dropdown
id: ai-use
attributes:
label: AI use
description: Required, for everyone. Say whether AI tools helped write this issue.
options:
- No AI tool was used
- AI tools were used
validations:
required: true
- type: textarea
id: ai-tools
attributes:
label: AI tools used
description: If AI tools were used, name each one and what it did, for example "ChatGPT summarised the error log".
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ body:
label: Dev Workspace CLI version
description: The output of `dws --version`.
placeholder: 0.6.0
- type: dropdown
id: ai-use
attributes:
label: AI use
description: Required, for everyone. Say whether AI tools helped write this issue.
options:
- No AI tool was used
- AI tools were used
validations:
required: true
- type: textarea
id: ai-tools
attributes:
label: AI tools used
description: If AI tools were used, name each one and what it did, for example "ChatGPT summarised the error log".
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

<!-- What this pull request changes, and why. Link the issue it closes: "Closes #12". -->

## AI use

<!-- Required, for everyone. Tick exactly one box: the "AI disclosure" check fails until you do. -->

- [ ] No AI tool was used
- [ ] AI tools were used, as described here:

<!-- If AI tools were used, name each one and what it did, for example: "Claude Code wrote the first draft of the tests; I reviewed and changed them." -->

## Checklist

- [ ] The title follows Conventional Commits (`feat:`, `fix:`, `docs:`, …) and is lowercase
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/ai-disclosure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: AI disclosure

# Every pull request says whether AI tools were used, the maintainer's
# included. The "AI use" section of the pull request template has two boxes:
# "No AI tool was used", or "AI tools were used" with each tool and what it
# did written under it. This check fails until exactly one box is ticked, and
# the main ruleset requires it. Editing the description runs it again.
#
# It reads the description from the event, through an environment variable,
# and needs no token and no checkout. Dependabot pull requests are exempt.
on:
pull_request:
types: [opened, edited, reopened, synchronize]

permissions: {}

# Only the latest description matters.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: AI disclosure
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Check the AI use section
env:
BODY: ${{ github.event.pull_request.body }}
AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
if [ "$AUTHOR" = 'dependabot[bot]' ]; then
echo 'Dependabot pull request: no disclosure needed.'
exit 0
fi

node - <<'JS'
const body = (process.env.BODY ?? '').replace(/<!--[\s\S]*?-->/g, '')
const fail = (message) => {
console.log(`::error::${message}`)
process.exit(1)
}

const section = body.match(/^##[ \t]+AI use[ \t]*$([\s\S]*?)(?=^##[ \t]|(?![\s\S]))/im)
if (!section) {
fail('The description has no "## AI use" section. Copy it from the pull request template and tick one box.')
}

const box = /^[ \t]*[-*][ \t]+\[([ xX])\][ \t]+(.*)$/
const lines = section[1].split(/\r?\n/)
const ticked = lines.map((line) => line.match(box)).filter((m) => m && m[1] !== ' ')
const none = ticked.some((m) => /^no ai tool/i.test(m[2]))
const used = ticked.some((m) => /^ai tools were used/i.test(m[2]))

if (none === used) {
fail('In the "AI use" section, tick exactly one box: "No AI tool was used" or "AI tools were used".')
}

if (used) {
// The description can follow the box on its line, or the lines under it.
const details = lines
.map((line) => {
const m = line.match(box)
return m ? (/^ai tools were used/i.test(m[2]) ? m[2].replace(/^[^:]*:?/, '') : '') : line
})
.join(' ')
.replace(/\s+/g, ' ')
.trim()
if (details.length < 20) {
fail('"AI tools were used" is ticked: under it, name each tool and what it did.')
}
}

console.log(none ? 'Disclosed: no AI tool was used.' : 'Disclosed: AI tools were used, and how.')
JS
12 changes: 11 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Every change is made on a short-lived branch and reaches `main` through a pull r

1. Create a branch named after the change: `feat/project-search`, `fix/ctrl-c`, `docs/readme`, …
2. Commit and push as often as needed. Nothing is released from a branch.
3. Open a pull request. CI runs the test matrix (Windows, macOS and Linux with Node.js 22, 24 and 26), and a check verifies that the title follows [Conventional Commits](https://www.conventionalcommits.org/). Pull requests that change `.github/` are also audited by [zizmor](https://docs.zizmor.sh/). A final **CI passed** job succeeds only when every test and coverage job has passed. It and the title check are the checks that must pass before a pull request can be merged, so changing the test matrix never requires changing the repository rules.
3. Open a pull request. CI runs the test matrix (Windows, macOS and Linux with Node.js 22, 24 and 26), and a check verifies that the title follows [Conventional Commits](https://www.conventionalcommits.org/). Pull requests that change `.github/` are also audited by [zizmor](https://docs.zizmor.sh/). A final **CI passed** job succeeds only when every test and coverage job has passed. It, the title check and the **AI disclosure** check (see [AI use](#ai-use)) are the checks that must pass before a pull request can be merged, so changing the test matrix never requires changing the repository rules.
4. The maintainer reviews it. A pull request needs the maintainer's approval, given after its last push, and every review conversation resolved. A new push dismisses an earlier approval. The first workflow run of a first-time contributor also waits for the maintainer's approval.
5. The maintainer squash-merges it. The pull request title becomes the only commit on `main`.

Expand All @@ -102,6 +102,16 @@ Keep the summary lowercase and in the imperative: `feat: add project search`, no

**Do not mark changes as breaking before 1.0.0.** A `!` after the type (`feat!:`) or a `BREAKING CHANGE:` footer makes a major release, which would publish 1.0.0 early. Until then, describe incompatible changes in the pull request and release them as `feat:`.

### AI use

AI tools are allowed, but their use is never hidden. The rule is the same for the maintainer and for contributors.

- **Pull requests:** fill in the **AI use** section of the [pull request template](.github/PULL_REQUEST_TEMPLATE.md). Tick **No AI tool was used**, or tick **AI tools were used** and name each tool and what it did under it, for example "Claude Code wrote the first draft of the tests; I reviewed and changed them". The **AI disclosure** check fails until exactly one box is ticked, and a pull request cannot be merged without it. Editing the description runs the check again. Dependabot pull requests are exempt.
- **Issues:** every issue form asks the same question.
- **Comments and reviews:** say so when an AI tool wrote or drafted what you post. No check can verify this, so it relies on you.

You are responsible for everything you submit, whoever or whatever wrote it: read it, test it, and be ready to explain it.

### Labels and reviews

Issues are opened from a form (bug, feature or question), which adds its kind label and `needs-triage`. The maintainer removes `needs-triage` once the issue is reviewed, and adds `good first issue` or `help wanted` when it is ready to pick up. Pull requests start from the [pull request template](.github/PULL_REQUEST_TEMPLATE.md), whose checklist lists what to check before asking for review.
Expand Down
Loading