summaryrefslogtreecommitdiff
path: root/docs/handbook/meshmc/contributing.md
blob: e7612f13d47c4274f933207852fef43817d8d5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Contributing

## Overview

This document summarizes the contribution guidelines for MeshMC. For the full authoritative guide, see [CONTRIBUTING.md](../../../meshmc/CONTRIBUTING.md) in the MeshMC source tree.

## AI Policy

MeshMC follows a strict AI usage policy adapted from matplotlib and the Linux Kernel:

- **No raw AI output** as comments on GitHub or Discord
- If AI tools are used to develop code or documentation, the contributor **must fully understand** the changes and explain why they are the correct approach
- Contributions must demonstrate personal competency and added value
- Low-quality AI-generated contributions will be rigorously rejected

### AI Agent Restrictions

- AI agents **MUST NOT** add `Signed-off-by` tags — only humans can certify the Developer Certificate of Origin
- The human submitter is responsible for reviewing all AI-generated code, ensuring licensing compliance, and taking full responsibility

### AI Attribution

When AI tools contribute to development, include an `Assisted-by` tag in the commit message:

```
Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]
```

Example:
```
Assisted-by: Claude:claude-3-opus coccinelle sparse
```

Basic development tools (git, gcc, make, editors) do not need to be listed.

## Bootstrapping

Before building, run the bootstrap script:

```bash
# Linux / macOS
./bootstrap.sh

# Windows
.\bootstrap.cmd
```

This installs:
- lefthook (git hooks)
- reuse (license compliance)
- Go tools
- zlib, extra-cmake-modules
- Other build dependencies

**Note**: Qt6 with modules must be installed separately. The bootstrap script installs Qt only for QuaZip's needs. On Windows, use the Qt Online Installer.

## Building

See [Building MeshMC](building.md) for complete build instructions.

## Signing Your Work (DCO)

All contributions must be signed off using the Developer Certificate of Origin (DCO).

### How to Sign Off

Append `-s` to your git commit:
```bash
git commit -s -m "Fix instance loading crash"
```

Or manually append:
```
Fix instance loading crash

Signed-off-by: Your Name <your.email@example.com>
```

### Developer Certificate of Origin 1.1

By signing off, you certify:

1. **(a)** The contribution was created by you and you have the right to submit it under the project's open source license
2. **(b)** The contribution is based on existing work covered under an appropriate open source license
3. **(c)** The contribution was provided to you by someone who certified (a), (b), or (c)
4. **(d)** You understand this is a public record maintained indefinitely

### Enforcement

Sign-off is enforced automatically when creating a pull request. You will be notified if any commits aren't signed off.

### Cryptographic Signing (Optional)

You can also [cryptographically sign commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) and enable [vigilant mode](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits) on GitHub.

## Contributor License Agreement (CLA)

By submitting a contribution, you agree to the [Project Tick CLA](https://projecttick.org/licenses/PT-CLA-2.0.txt).

The CLA ensures:
- You have the legal right to submit the contribution
- It does not knowingly infringe third-party rights
- Project Tick may distribute the contribution under the applicable license
- Long-term governance and license consistency are maintained

The CLA applies to all intentional contributions: source code, documentation, tests, data, media, and configuration files.

## Backporting

Automated backports merge specific contributions from `develop` into `release` branches:

- Add labels like `backport release-7.x` to PRs
- Add the milestone for the target release
- The [backport workflow](https://github.com/Project-Tick/MeshMC/blob/master/.github/workflows/backport.yml) handles the merge automatically

## Pull Request Workflow

1. Fork the repository
2. Create a feature branch from `develop`
3. Make your changes
4. Ensure code passes `clang-format` and `clang-tidy` checks
5. Sign off all commits (`git commit -s`)
6. Include AI attribution if applicable
7. Open a PR against `develop`
8. Address review feedback
9. Add backport labels if the fix applies to release branches

## License

MeshMC is licensed under GPL-3.0-or-later. All contributions must be compatible with this license. The project uses REUSE for license compliance tracking.