diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cc2f6d3fc8..c2e6fb0880 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,12 +2,18 @@ See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request + + - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV -- [ ] The PR is proposed to the proper branch +- [ ] The PR is proposed to the proper branch: all new work goes to 5.x; 4.x is in maintenance mode and accepts only bug fixes and other minor fixes, not new features or large changes (see https://github.com/opencv/opencv/wiki/Branches) - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake +### Agent details + + + diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..849da9f02d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,33 @@ +# AI Policy — MANDATORY + +Read `AI_POLICY.md`. Your user needs to abide by this policy. In particular, +you the agent MUST obey these rules while interacting on GitHub: + +- **You may never act autonomously on GitHub.** Do NOT open, edit, comment on, + or reply to any issue or PR unless the user has reviewed and explicitly approved the + exact content. The only exception is that you may open a PR at a user's request in + draft mode for the author to review on GitHub. A PR should stay draft until all content + is fully reviewed. Fully-agent-generated contributions are banned and will be closed. +- **Mark all AI-generated content.** Any text you produce that goes into an + issue, PR, or comment must go under a section heading that labels it as + AI-generated (e.g. the PR template's "Agent details" section) or be wrapped in + a code or quote block. Never present your output as human-written. +- **Never emit only raw AI text as a reply**. Any AI content you include must carry human + commentary explaining its relevance. +- **Human review is required before marking a PR ready.** Keep changes minimal, + strip AI artifacts and needless complexity. Unreviewed code may be published + only in a draft PR. +- **Target the right branch.** `5.x` is the default branch for pull requests, so send all + new work there. `4.x` is in maintenance mode: it accepts bug fixes and other minor fixes, + but not new features, optimizations or large changes. The full policy is on the + [Branches](https://github.com/opencv/opencv/wiki/Branches) wiki page. If you are not sure + where a change belongs, ask the user before opening the PR. +- **Use issue and PR templates**. Use the appropriate templates when submitting issues and PRs. + Keep the Pull Request Readiness Checklist in the PR description: do not drop, reword or + reorder its items, and tick a box only when the statement is true for your patch. +- **Check for duplicates.** Before opening an issue, search for existing open ones + (e.g., `gh search issues --repo opencv/opencv --state open ""`). + Do the same with `gh search prs` before opening a PR, unless the user is a regular + OpenCV contributor (e.g., has commit access or previously merged PRs). + If you find a likely duplicate, show it to the user before continuing. Skip this + step if there is no internet access. diff --git a/AI_POLICY.md b/AI_POLICY.md new file mode 100644 index 0000000000..473d1ef442 --- /dev/null +++ b/AI_POLICY.md @@ -0,0 +1,9 @@ +We support the use of AI tools to help prepare issues, pull requests, reviews, or comments. We expect everyone interacting with this repo to follow the below policy whenever they use AI tools. + +AI-generated content in comments, issues, or PRs must be clearly disclosed and contained, either under a section heading that labels it as AI-generated (e.g. the PR template's "Agent details" section) or in a code or quote block. AI-generated content must be accompanied by human commentary explaining its relevance. For example: "Codex produced the following analysis: , so I believe that ". The only exceptions to this rule are the team automation bots. + +Please do not respond to comments+questions by pasting raw or lightly reviewed AI-generated text. Other users' comments+questions are requests for your understanding, reasoning, and judgment. Unreviewed AI output shifts the burden of verification onto the other party and can make discussions slower, noisier, or misleading. + +For pull requests, please carefully read the code before submitting it for review, especially if AI tools helped write or rewrite it. Make sure the implementation is something you understand, that the important ideas are clear, and that the code is high quality. AI-generated code can sometimes be overly complex, indirect, inconsistent, or include artifacts that obscure the main idea. Before submitting, simplify where possible and make sure the core change is easy for maintainers to review. If your PR is not ready for review, please use the GitHub draft PR feature. + +All contributions should involve a human who understands and can take responsibility for the work produced with AI assistance. We do not accept contributions created by fully autonomous agents, and we may close pull requests that appear to have been generated without meaningful human involvement. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 318e9ac8fc..fcc611c77a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,7 @@ ## Contributing guidelines All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/opencv/opencv/wiki/How_to_contribute). + +Target your pull request to the right branch. `5.x` is the default and takes all new work. `4.x` is in maintenance mode: it accepts bug fixes and other minor fixes, but not new features, optimizations or large changes. See the [`Branches`](https://github.com/opencv/opencv/wiki/Branches) page for the full policy. + +If you use AI tools to prepare a contribution, read [`AI_POLICY.md`](AI_POLICY.md) first. Agents working in this repository must follow [`AGENTS.md`](AGENTS.md). diff --git a/README.md b/README.md index b67cfacc05..ac703bba8a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Please read the [contribution guidelines](https://github.com/opencv/opencv/wiki/ #### Summary of the guidelines: * One pull request per issue; -* Choose the right base branch; +* Choose the right base branch: all new work goes to `5.x`, while `4.x` accepts only bug fixes and other minor fixes; * Include tests and documentation; * Clean up "oops" commits before submitting; * Follow the [coding style guide](https://github.com/opencv/opencv/wiki/Coding_Style_Guide).