← Back to Pull requests

:book: Rewrite AGENTS.md, drop CLAUDE.md symlink #3919

Merged
tuminoid merged 2 files (239 lines) on Dec 01, 2026 08:04 UTC
View on GitHub
tuminoid tuminoid commented on Nov 26, 2026 14:20 UTC
Author

Claude reads AGENTS.md now. AGENTS.md trimmed to non-inferable facts, adds AI policy, testing, security and tenancy rules, and API, CAPI contract and dependent API invariants.

Diff: 239 lines (+129 / -110) across 2 files Reviewer: adilGhaffarDev Review duration: 6823m
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.42) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 239 lines diff across 2 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.84 · 5 substantive comment(s)
0.84
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
88%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.328
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
18 items
tuminoid tuminoid commented on Nov 26, 2026 14:21 UTC
Author

/override metal3-centos-e2e-integration-test-main
/override metal3-ubuntu-e2e-integration-test-main

metal3-io-bot metal3-io-bot commented on Nov 26, 2026 14:21 UTC
Bot

@tuminoid: Overrode contexts on behalf of tuminoid: metal3-centos-e2e-integration-test-main, metal3-ubuntu-e2e-integration-test-main

<details>

In response to this:

>/override metal3-centos-e2e-integration-test-main
>/override metal3-ubuntu-e2e-integration-test-main

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

</details>

tuminoid tuminoid commented on Nov 30, 2026 07:30 UTC
Author

/copilot-review

metal3-io-bot metal3-io-bot commented on Nov 30, 2026 07:30 UTC
Bot

Copilot code review has been requested by @tuminoid. Please allow a few moments for the review to be added.

Copilot Copilot commented on code on Nov 30, 2026 07:34 UTC
Code Review
AGENTS.md:1
@@ -1,109 +1,129 @@
-# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
-
-Instructions for AI coding agents. For project overview, see [README.md](README.md).
-For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
-
-## Repository Structure
-
-| Directory | Purpose |
-|-----------|---------|
-| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
-| `controllers/` | Reconciliation logic |
-| `baremetal/` | BareMetalHost integration logic |
-| `internal/webhooks/` | Validation/defaulting webhooks |
-| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
-| `hack/` | CI scripts (prefer Make targets locally) |
-| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
-
-## Testing Standards
-
-CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
-Run these locally before submitting PRs:
-
-**Make targets:**
-
-| Command | Purpose |
-|---------|---------|
-| `make test` | Full verification (generate + lint + unit) |
-| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
-| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
-| `make lint` | Go linting via golangci-lint (all modules) |
-| `make verify-boilerplate` | Check license headers |
-| `make modules` | Verify go.mod is tidy |
-
-**Hack scripts** (auto-containerized, match CI exactly):
-
-| Script | Purpose |
-|--------|---------|
-| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
-| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
-| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
-| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
-
-## Code Conventions
-
-- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
-- **Shell**: Use `set -o errexit -o nounset -o pipefail`
-- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
-
-## Key Workflows
-
-### Modifying APIs
-
-1. Edit `api/v1beta1/*_types.go`
-1. Run `make generate`
-1. Update webhooks in `internal/webhooks/` if validation changes
-1. Run `make test`
-
-## E2E Testing
-
-**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
-(validates CAPM3, IPAM, BMO, Ironic).
-
-| Command | Purpose |
-|---------|---------|
-| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
-| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
-
-Key files:
-
-- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
-- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
-- `scripts/ci-e2e.sh` - Main orchestration script
-
-## Code Review Guidelines
-
-When reviewing pull requests:
-
-1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
-1. **Test coverage** - New functionality should have tests
-1. **Consistency** - Match existing patterns in the codebase
-1. **Breaking changes** - Flag API/behavior changes affecting users
-
-Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
-
-## AI Agent Guidelines
-
-### Before Changes
-
-1. Run `make unit` to verify baseline
-1. Check patterns in similar existing files
-
-### When Making Changes
-
-1. Make minimal, surgical edits
-1. Run `make generate` after API changes
-1. Run `make test` before committing
-1. Add tests for new functionality
-
-### Security Requirements
-
-- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
-- No hardcoded credentials
-- Validate all inputs
-
-## Related Documentation
-
-- [API Documentation](docs/api.md)
-- [Release Process](docs/releasing.md)
-- [Metal3 Book](https://book.metal3.io)
+# Cluster API Provider Metal3 (CAPM3)
+
+Cluster API infrastructure provider that turns `BareMetalHost`s managed
+by the Baremetal Operator into Kubernetes cluster nodes.
+Project overview: [README.md](README.md). Contribution rules:
+[CONTRIBUTING.md](CONTRIBUTING.md) and the
+[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
+
+This file holds only what you cannot cheaply infer from the code. Where it
+disagrees with the code or the Makefile, trust those and report the
+mismatch.
+
+## AI-assisted contributions
+
+Metal3 follows the CNCF and
+[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
+
+- AI is a tool. The human who opens a PR is its author and is responsible
+  for every line of it, including licensing and third-party content.
+- Review is a conversation between humans. A PR where an agent or bot
+  answers reviewers will be closed. Agents may draft changes; the
+  contributor reads them, understands them, and replies personally.
+
+- Keep changes surgical. The smallest complete change that solves the
+  stated problem wins. Every added file, function, flag, dependency or
+  test helper must trace to that problem; anything that does not is
+  bloat and gets removed. Prefer reusing existing code over new code.
+  Report unrelated findings instead of fixing them in the same PR.
+
+## Repository map
+
+Five Go modules (root, `api/`, `test/`, `hack/tools/`,
+`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
+four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
+fails on any diff.
+
+- Controllers in `controllers/` are thin; the logic lives in the
+  managers in `baremetal/`, which `controllers/` call through interfaces
+  mocked in `baremetal/mocks/`.
+- Webhooks: `internal/webhooks/v1beta2/`.
+- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
+  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
+  IPAM and ironic-image release branches) clone this repo and run
+  `make test-e2e`. A change there affects their CI too.
+
+## Testing
+
+- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
+  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
+  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
+  and `.github/workflows/`.
+- Conventions are whatever the existing code, tests, and lint configs do.
+  Read neighboring files and `_test.go` files before writing new ones.
+- Before finishing, add or update tests for every behavior change, then
+  run `make test` and the `hack/` checks for the file types you touched.
+  All must pass.
+- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
+  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
+  `make setup-envtest` prints.
+- Never hand-edit generated output (`zz_generated.*.go`, including the
+  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
+  the source and run `make generate`. The `generate` CI job fails on any
+  diff.

Please limit the manifest prohibition to the actual generated files. config/rbac/role_binding.yaml, config/webhook/service.yaml, and the conversion patches under config/crd/patches/ are maintained directly; make generate does not generate replacements for them. Grouping all CRD, RBAC, and webhook manifests under this rule would prevent agents from making necessary deployment or conversion-webhook changes in their source files.

Copilot Copilot commented on code on Nov 30, 2026 07:34 UTC
Code Review
AGENTS.md:1
@@ -1,109 +1,129 @@
-# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
-
-Instructions for AI coding agents. For project overview, see [README.md](README.md).
-For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
-
-## Repository Structure
-
-| Directory | Purpose |
-|-----------|---------|
-| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
-| `controllers/` | Reconciliation logic |
-| `baremetal/` | BareMetalHost integration logic |
-| `internal/webhooks/` | Validation/defaulting webhooks |
-| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
-| `hack/` | CI scripts (prefer Make targets locally) |
-| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
-
-## Testing Standards
-
-CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
-Run these locally before submitting PRs:
-
-**Make targets:**
-
-| Command | Purpose |
-|---------|---------|
-| `make test` | Full verification (generate + lint + unit) |
-| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
-| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
-| `make lint` | Go linting via golangci-lint (all modules) |
-| `make verify-boilerplate` | Check license headers |
-| `make modules` | Verify go.mod is tidy |
-
-**Hack scripts** (auto-containerized, match CI exactly):
-
-| Script | Purpose |
-|--------|---------|
-| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
-| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
-| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
-| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
-
-## Code Conventions
-
-- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
-- **Shell**: Use `set -o errexit -o nounset -o pipefail`
-- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
-
-## Key Workflows
-
-### Modifying APIs
-
-1. Edit `api/v1beta1/*_types.go`
-1. Run `make generate`
-1. Update webhooks in `internal/webhooks/` if validation changes
-1. Run `make test`
-
-## E2E Testing
-
-**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
-(validates CAPM3, IPAM, BMO, Ironic).
-
-| Command | Purpose |
-|---------|---------|
-| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
-| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
-
-Key files:
-
-- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
-- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
-- `scripts/ci-e2e.sh` - Main orchestration script
-
-## Code Review Guidelines
-
-When reviewing pull requests:
-
-1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
-1. **Test coverage** - New functionality should have tests
-1. **Consistency** - Match existing patterns in the codebase
-1. **Breaking changes** - Flag API/behavior changes affecting users
-
-Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
-
-## AI Agent Guidelines
-
-### Before Changes
-
-1. Run `make unit` to verify baseline
-1. Check patterns in similar existing files
-
-### When Making Changes
-
-1. Make minimal, surgical edits
-1. Run `make generate` after API changes
-1. Run `make test` before committing
-1. Add tests for new functionality
-
-### Security Requirements
-
-- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
-- No hardcoded credentials
-- Validate all inputs
-
-## Related Documentation
-
-- [API Documentation](docs/api.md)
-- [Release Process](docs/releasing.md)
-- [Metal3 Book](https://book.metal3.io)
+# Cluster API Provider Metal3 (CAPM3)
+
+Cluster API infrastructure provider that turns `BareMetalHost`s managed
+by the Baremetal Operator into Kubernetes cluster nodes.
+Project overview: [README.md](README.md). Contribution rules:
+[CONTRIBUTING.md](CONTRIBUTING.md) and the
+[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
+
+This file holds only what you cannot cheaply infer from the code. Where it
+disagrees with the code or the Makefile, trust those and report the
+mismatch.
+
+## AI-assisted contributions
+
+Metal3 follows the CNCF and
+[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
+
+- AI is a tool. The human who opens a PR is its author and is responsible
+  for every line of it, including licensing and third-party content.
+- Review is a conversation between humans. A PR where an agent or bot
+  answers reviewers will be closed. Agents may draft changes; the
+  contributor reads them, understands them, and replies personally.
+
+- Keep changes surgical. The smallest complete change that solves the
+  stated problem wins. Every added file, function, flag, dependency or
+  test helper must trace to that problem; anything that does not is
+  bloat and gets removed. Prefer reusing existing code over new code.
+  Report unrelated findings instead of fixing them in the same PR.
+
+## Repository map
+
+Five Go modules (root, `api/`, `test/`, `hack/tools/`,
+`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
+four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
+fails on any diff.
+
+- Controllers in `controllers/` are thin; the logic lives in the
+  managers in `baremetal/`, which `controllers/` call through interfaces
+  mocked in `baremetal/mocks/`.
+- Webhooks: `internal/webhooks/v1beta2/`.
+- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
+  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
+  IPAM and ironic-image release branches) clone this repo and run
+  `make test-e2e`. A change there affects their CI too.
+
+## Testing
+
+- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
+  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
+  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
+  and `.github/workflows/`.
+- Conventions are whatever the existing code, tests, and lint configs do.
+  Read neighboring files and `_test.go` files before writing new ones.
+- Before finishing, add or update tests for every behavior change, then
+  run `make test` and the `hack/` checks for the file types you touched.
+  All must pass.
+- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
+  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
+  `make setup-envtest` prints.
+- Never hand-edit generated output (`zz_generated.*.go`, including the
+  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
+  the source and run `make generate`. The `generate` CI job fails on any
+  diff.
+- Do not touch `releasenotes/` outside a release PR. `make release-notes`
+  generates them from PR titles; only release PRs curate them by hand
+  ([docs/releasing.md](docs/releasing.md)).
+- PR titles start with `:warning:` (breaking), `:sparkles:` (feature),
+  `:bug:` (fix), `:book:` (docs) or `:seedling:` (other). The release
+  notes tool sorts PRs by this prefix.
+- Do not run `make test-e2e`, `make test-clusterclass-e2e`,
+  `scripts/ci-e2e.sh`, `make clean-e2e`, or `hack/ensure-*.sh`,
+  `hack/install-go.sh` and `hack/setup-bml.sh` unless the user asks: they

Please exempt hack/ensure-golangci-lint.sh from this wildcard restriction. On a checkout without the linter binary, the required make test runs make lint, whose prerequisite invokes that script (Makefile:430-431,482). It installs a checksum-verified binary into the repository's tools directory, not privileged host infrastructure. As written, completing the mandatory test command also runs a script this section forbids without explicit permission.

Copilot Copilot commented on code on Nov 30, 2026 07:34 UTC
Code Review
AGENTS.md:1
@@ -1,109 +1,129 @@
-# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
-
-Instructions for AI coding agents. For project overview, see [README.md](README.md).
-For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
-
-## Repository Structure
-
-| Directory | Purpose |
-|-----------|---------|
-| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
-| `controllers/` | Reconciliation logic |
-| `baremetal/` | BareMetalHost integration logic |
-| `internal/webhooks/` | Validation/defaulting webhooks |
-| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
-| `hack/` | CI scripts (prefer Make targets locally) |
-| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
-
-## Testing Standards
-
-CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
-Run these locally before submitting PRs:
-
-**Make targets:**
-
-| Command | Purpose |
-|---------|---------|
-| `make test` | Full verification (generate + lint + unit) |
-| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
-| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
-| `make lint` | Go linting via golangci-lint (all modules) |
-| `make verify-boilerplate` | Check license headers |
-| `make modules` | Verify go.mod is tidy |
-
-**Hack scripts** (auto-containerized, match CI exactly):
-
-| Script | Purpose |
-|--------|---------|
-| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
-| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
-| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
-| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
-
-## Code Conventions
-
-- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
-- **Shell**: Use `set -o errexit -o nounset -o pipefail`
-- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
-
-## Key Workflows
-
-### Modifying APIs
-
-1. Edit `api/v1beta1/*_types.go`
-1. Run `make generate`
-1. Update webhooks in `internal/webhooks/` if validation changes
-1. Run `make test`
-
-## E2E Testing
-
-**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
-(validates CAPM3, IPAM, BMO, Ironic).
-
-| Command | Purpose |
-|---------|---------|
-| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
-| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
-
-Key files:
-
-- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
-- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
-- `scripts/ci-e2e.sh` - Main orchestration script
-
-## Code Review Guidelines
-
-When reviewing pull requests:
-
-1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
-1. **Test coverage** - New functionality should have tests
-1. **Consistency** - Match existing patterns in the codebase
-1. **Breaking changes** - Flag API/behavior changes affecting users
-
-Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
-
-## AI Agent Guidelines
-
-### Before Changes
-
-1. Run `make unit` to verify baseline
-1. Check patterns in similar existing files
-
-### When Making Changes
-
-1. Make minimal, surgical edits
-1. Run `make generate` after API changes
-1. Run `make test` before committing
-1. Add tests for new functionality
-
-### Security Requirements
-
-- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
-- No hardcoded credentials
-- Validate all inputs
-
-## Related Documentation
-
-- [API Documentation](docs/api.md)
-- [Release Process](docs/releasing.md)
-- [Metal3 Book](https://book.metal3.io)
+# Cluster API Provider Metal3 (CAPM3)
+
+Cluster API infrastructure provider that turns `BareMetalHost`s managed
+by the Baremetal Operator into Kubernetes cluster nodes.
+Project overview: [README.md](README.md). Contribution rules:
+[CONTRIBUTING.md](CONTRIBUTING.md) and the
+[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
+
+This file holds only what you cannot cheaply infer from the code. Where it
+disagrees with the code or the Makefile, trust those and report the
+mismatch.
+
+## AI-assisted contributions
+
+Metal3 follows the CNCF and
+[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
+
+- AI is a tool. The human who opens a PR is its author and is responsible
+  for every line of it, including licensing and third-party content.
+- Review is a conversation between humans. A PR where an agent or bot
+  answers reviewers will be closed. Agents may draft changes; the
+  contributor reads them, understands them, and replies personally.
+
+- Keep changes surgical. The smallest complete change that solves the
+  stated problem wins. Every added file, function, flag, dependency or
+  test helper must trace to that problem; anything that does not is
+  bloat and gets removed. Prefer reusing existing code over new code.
+  Report unrelated findings instead of fixing them in the same PR.
+
+## Repository map
+
+Five Go modules (root, `api/`, `test/`, `hack/tools/`,
+`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
+four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
+fails on any diff.
+
+- Controllers in `controllers/` are thin; the logic lives in the
+  managers in `baremetal/`, which `controllers/` call through interfaces
+  mocked in `baremetal/mocks/`.
+- Webhooks: `internal/webhooks/v1beta2/`.
+- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
+  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
+  IPAM and ironic-image release branches) clone this repo and run
+  `make test-e2e`. A change there affects their CI too.
+
+## Testing
+
+- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
+  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
+  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
+  and `.github/workflows/`.
+- Conventions are whatever the existing code, tests, and lint configs do.
+  Read neighboring files and `_test.go` files before writing new ones.
+- Before finishing, add or update tests for every behavior change, then
+  run `make test` and the `hack/` checks for the file types you touched.
+  All must pass.
+- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
+  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
+  `make setup-envtest` prints.
+- Never hand-edit generated output (`zz_generated.*.go`, including the
+  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
+  the source and run `make generate`. The `generate` CI job fails on any
+  diff.
+- Do not touch `releasenotes/` outside a release PR. `make release-notes`
+  generates them from PR titles; only release PRs curate them by hand
+  ([docs/releasing.md](docs/releasing.md)).
+- PR titles start with `:warning:` (breaking), `:sparkles:` (feature),
+  `:bug:` (fix), `:book:` (docs) or `:seedling:` (other). The release
+  notes tool sorts PRs by this prefix.
+- Do not run `make test-e2e`, `make test-clusterclass-e2e`,
+  `scripts/ci-e2e.sh`, `make clean-e2e`, or `hack/ensure-*.sh`,
+  `hack/install-go.sh` and `hack/setup-bml.sh` unless the user asks: they
+  install packages with `sudo`, install Go into `/usr/local/go`, and
+  create libvirt VMs, networks and kind clusters on the host. E2E runs in
+  Jenkins when a reviewer requests it with `/test`.
+
+## Invariants
+
+These apply to writing and to reviewing changes.
+
+- **API versions.** All kinds exist in `v1beta1` (served, conversion
+  spoke) and `v1beta2` (storage version, conversion hub). A field change
+  needs both types, the conversion functions in
+  `api/v1beta1/conversion.go`, and a passing `TestFuzzyConversion`
+  round-trip. Webhooks exist only for `v1beta2`.

Requiring every field change in both API versions would unnecessarily extend the deprecated v1beta1 API for hub-only fields. For example, FailureDomainDataTemplates exists only in v1beta2 and is restored from conversion data in api/v1beta1/conversion.go:148-149. Require checking both versions and preserving round trips rather than always modifying both types.

copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 30, 2026 07:34 UTC
Reviewer

<!-- ccr-overview-v2 -->

🟡 Changes recommended

AGENTS.md imposes overly broad rules that would unnecessarily extend the deprecated API, block edits to hand-maintained manifests, and prohibit a script required by the mandatory test command.

<details open>
<summary><strong>3 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> Limit manifest restrictions to generated files · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> Exempt the linter installer required by make test · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> Check both API versions without requiring hub-only fields in v1beta1 · New

  • </details>

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    This documentation-only PR rewrites CAPM3’s agent guidance around project-specific workflows and invariants rather than a broad repository checklist.

    Changes:

  • Adds AI contribution policy and contributor accountability.

  • Clarifies testing, generated-file workflows, and restrictions on host-changing commands.

  • Documents API compatibility, provider contracts, security, tenancy, and dependency pinning.
  • | File | Description |
    | ---- | ----------- |
    | AGENTS.md | Reorganizes agent guidance around contribution rules, testing workflows, and CAPM3 invariants. |
    </details>

    <sub>Review effort: Balanced</sub>

    tuminoid tuminoid commented on code on Nov 30, 2026 08:09 UTC
    Code Review
    AGENTS.md:1
    @@ -1,109 +1,129 @@
    -# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
    -
    -Instructions for AI coding agents. For project overview, see [README.md](README.md).
    -For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
    -
    -## Repository Structure
    -
    -| Directory | Purpose |
    -|-----------|---------|
    -| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
    -| `controllers/` | Reconciliation logic |
    -| `baremetal/` | BareMetalHost integration logic |
    -| `internal/webhooks/` | Validation/defaulting webhooks |
    -| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
    -| `hack/` | CI scripts (prefer Make targets locally) |
    -| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
    -
    -## Testing Standards
    -
    -CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
    -Run these locally before submitting PRs:
    -
    -**Make targets:**
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test` | Full verification (generate + lint + unit) |
    -| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
    -| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
    -| `make lint` | Go linting via golangci-lint (all modules) |
    -| `make verify-boilerplate` | Check license headers |
    -| `make modules` | Verify go.mod is tidy |
    -
    -**Hack scripts** (auto-containerized, match CI exactly):
    -
    -| Script | Purpose |
    -|--------|---------|
    -| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
    -| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
    -| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
    -| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
    -
    -## Code Conventions
    -
    -- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
    -- **Shell**: Use `set -o errexit -o nounset -o pipefail`
    -- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
    -
    -## Key Workflows
    -
    -### Modifying APIs
    -
    -1. Edit `api/v1beta1/*_types.go`
    -1. Run `make generate`
    -1. Update webhooks in `internal/webhooks/` if validation changes
    -1. Run `make test`
    -
    -## E2E Testing
    -
    -**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
    -(validates CAPM3, IPAM, BMO, Ironic).
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
    -| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
    -
    -Key files:
    -
    -- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
    -- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
    -- `scripts/ci-e2e.sh` - Main orchestration script
    -
    -## Code Review Guidelines
    -
    -When reviewing pull requests:
    -
    -1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
    -1. **Test coverage** - New functionality should have tests
    -1. **Consistency** - Match existing patterns in the codebase
    -1. **Breaking changes** - Flag API/behavior changes affecting users
    -
    -Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
    -
    -## AI Agent Guidelines
    -
    -### Before Changes
    -
    -1. Run `make unit` to verify baseline
    -1. Check patterns in similar existing files
    -
    -### When Making Changes
    -
    -1. Make minimal, surgical edits
    -1. Run `make generate` after API changes
    -1. Run `make test` before committing
    -1. Add tests for new functionality
    -
    -### Security Requirements
    -
    -- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
    -- No hardcoded credentials
    -- Validate all inputs
    -
    -## Related Documentation
    -
    -- [API Documentation](docs/api.md)
    -- [Release Process](docs/releasing.md)
    -- [Metal3 Book](https://book.metal3.io)
    +# Cluster API Provider Metal3 (CAPM3)
    +
    +Cluster API infrastructure provider that turns `BareMetalHost`s managed
    +by the Baremetal Operator into Kubernetes cluster nodes.
    +Project overview: [README.md](README.md). Contribution rules:
    +[CONTRIBUTING.md](CONTRIBUTING.md) and the
    +[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
    +
    +This file holds only what you cannot cheaply infer from the code. Where it
    +disagrees with the code or the Makefile, trust those and report the
    +mismatch.
    +
    +## AI-assisted contributions
    +
    +Metal3 follows the CNCF and
    +[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
    +
    +- AI is a tool. The human who opens a PR is its author and is responsible
    +  for every line of it, including licensing and third-party content.
    +- Review is a conversation between humans. A PR where an agent or bot
    +  answers reviewers will be closed. Agents may draft changes; the
    +  contributor reads them, understands them, and replies personally.
    +
    +- Keep changes surgical. The smallest complete change that solves the
    +  stated problem wins. Every added file, function, flag, dependency or
    +  test helper must trace to that problem; anything that does not is
    +  bloat and gets removed. Prefer reusing existing code over new code.
    +  Report unrelated findings instead of fixing them in the same PR.
    +
    +## Repository map
    +
    +Five Go modules (root, `api/`, `test/`, `hack/tools/`,
    +`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
    +four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
    +fails on any diff.
    +
    +- Controllers in `controllers/` are thin; the logic lives in the
    +  managers in `baremetal/`, which `controllers/` call through interfaces
    +  mocked in `baremetal/mocks/`.
    +- Webhooks: `internal/webhooks/v1beta2/`.
    +- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
    +  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
    +  IPAM and ironic-image release branches) clone this repo and run
    +  `make test-e2e`. A change there affects their CI too.
    +
    +## Testing
    +
    +- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
    +  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
    +  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
    +  and `.github/workflows/`.
    +- Conventions are whatever the existing code, tests, and lint configs do.
    +  Read neighboring files and `_test.go` files before writing new ones.
    +- Before finishing, add or update tests for every behavior change, then
    +  run `make test` and the `hack/` checks for the file types you touched.
    +  All must pass.
    +- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
    +  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
    +  `make setup-envtest` prints.
    +- Never hand-edit generated output (`zz_generated.*.go`, including the
    +  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
    +  the source and run `make generate`. The `generate` CI job fails on any
    +  diff.

    Fixed.

    tuminoid tuminoid commented on code on Nov 30, 2026 08:09 UTC
    Code Review
    AGENTS.md:1
    @@ -1,109 +1,129 @@
    -# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
    -
    -Instructions for AI coding agents. For project overview, see [README.md](README.md).
    -For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
    -
    -## Repository Structure
    -
    -| Directory | Purpose |
    -|-----------|---------|
    -| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
    -| `controllers/` | Reconciliation logic |
    -| `baremetal/` | BareMetalHost integration logic |
    -| `internal/webhooks/` | Validation/defaulting webhooks |
    -| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
    -| `hack/` | CI scripts (prefer Make targets locally) |
    -| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
    -
    -## Testing Standards
    -
    -CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
    -Run these locally before submitting PRs:
    -
    -**Make targets:**
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test` | Full verification (generate + lint + unit) |
    -| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
    -| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
    -| `make lint` | Go linting via golangci-lint (all modules) |
    -| `make verify-boilerplate` | Check license headers |
    -| `make modules` | Verify go.mod is tidy |
    -
    -**Hack scripts** (auto-containerized, match CI exactly):
    -
    -| Script | Purpose |
    -|--------|---------|
    -| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
    -| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
    -| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
    -| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
    -
    -## Code Conventions
    -
    -- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
    -- **Shell**: Use `set -o errexit -o nounset -o pipefail`
    -- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
    -
    -## Key Workflows
    -
    -### Modifying APIs
    -
    -1. Edit `api/v1beta1/*_types.go`
    -1. Run `make generate`
    -1. Update webhooks in `internal/webhooks/` if validation changes
    -1. Run `make test`
    -
    -## E2E Testing
    -
    -**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
    -(validates CAPM3, IPAM, BMO, Ironic).
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
    -| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
    -
    -Key files:
    -
    -- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
    -- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
    -- `scripts/ci-e2e.sh` - Main orchestration script
    -
    -## Code Review Guidelines
    -
    -When reviewing pull requests:
    -
    -1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
    -1. **Test coverage** - New functionality should have tests
    -1. **Consistency** - Match existing patterns in the codebase
    -1. **Breaking changes** - Flag API/behavior changes affecting users
    -
    -Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
    -
    -## AI Agent Guidelines
    -
    -### Before Changes
    -
    -1. Run `make unit` to verify baseline
    -1. Check patterns in similar existing files
    -
    -### When Making Changes
    -
    -1. Make minimal, surgical edits
    -1. Run `make generate` after API changes
    -1. Run `make test` before committing
    -1. Add tests for new functionality
    -
    -### Security Requirements
    -
    -- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
    -- No hardcoded credentials
    -- Validate all inputs
    -
    -## Related Documentation
    -
    -- [API Documentation](docs/api.md)
    -- [Release Process](docs/releasing.md)
    -- [Metal3 Book](https://book.metal3.io)
    +# Cluster API Provider Metal3 (CAPM3)
    +
    +Cluster API infrastructure provider that turns `BareMetalHost`s managed
    +by the Baremetal Operator into Kubernetes cluster nodes.
    +Project overview: [README.md](README.md). Contribution rules:
    +[CONTRIBUTING.md](CONTRIBUTING.md) and the
    +[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
    +
    +This file holds only what you cannot cheaply infer from the code. Where it
    +disagrees with the code or the Makefile, trust those and report the
    +mismatch.
    +
    +## AI-assisted contributions
    +
    +Metal3 follows the CNCF and
    +[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
    +
    +- AI is a tool. The human who opens a PR is its author and is responsible
    +  for every line of it, including licensing and third-party content.
    +- Review is a conversation between humans. A PR where an agent or bot
    +  answers reviewers will be closed. Agents may draft changes; the
    +  contributor reads them, understands them, and replies personally.
    +
    +- Keep changes surgical. The smallest complete change that solves the
    +  stated problem wins. Every added file, function, flag, dependency or
    +  test helper must trace to that problem; anything that does not is
    +  bloat and gets removed. Prefer reusing existing code over new code.
    +  Report unrelated findings instead of fixing them in the same PR.
    +
    +## Repository map
    +
    +Five Go modules (root, `api/`, `test/`, `hack/tools/`,
    +`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
    +four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
    +fails on any diff.
    +
    +- Controllers in `controllers/` are thin; the logic lives in the
    +  managers in `baremetal/`, which `controllers/` call through interfaces
    +  mocked in `baremetal/mocks/`.
    +- Webhooks: `internal/webhooks/v1beta2/`.
    +- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
    +  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
    +  IPAM and ironic-image release branches) clone this repo and run
    +  `make test-e2e`. A change there affects their CI too.
    +
    +## Testing
    +
    +- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
    +  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
    +  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
    +  and `.github/workflows/`.
    +- Conventions are whatever the existing code, tests, and lint configs do.
    +  Read neighboring files and `_test.go` files before writing new ones.
    +- Before finishing, add or update tests for every behavior change, then
    +  run `make test` and the `hack/` checks for the file types you touched.
    +  All must pass.
    +- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
    +  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
    +  `make setup-envtest` prints.
    +- Never hand-edit generated output (`zz_generated.*.go`, including the
    +  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
    +  the source and run `make generate`. The `generate` CI job fails on any
    +  diff.
    +- Do not touch `releasenotes/` outside a release PR. `make release-notes`
    +  generates them from PR titles; only release PRs curate them by hand
    +  ([docs/releasing.md](docs/releasing.md)).
    +- PR titles start with `:warning:` (breaking), `:sparkles:` (feature),
    +  `:bug:` (fix), `:book:` (docs) or `:seedling:` (other). The release
    +  notes tool sorts PRs by this prefix.
    +- Do not run `make test-e2e`, `make test-clusterclass-e2e`,
    +  `scripts/ci-e2e.sh`, `make clean-e2e`, or `hack/ensure-*.sh`,
    +  `hack/install-go.sh` and `hack/setup-bml.sh` unless the user asks: they

    Fixed.

    tuminoid tuminoid commented on code on Nov 30, 2026 08:09 UTC
    Code Review
    AGENTS.md:1
    @@ -1,109 +1,129 @@
    -# Cluster API Provider Metal3 (CAPM3) - AI Agent Instructions
    -
    -Instructions for AI coding agents. For project overview, see [README.md](README.md).
    -For contribution guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
    -
    -## Repository Structure
    -
    -| Directory | Purpose |
    -|-----------|---------|
    -| `api/v1beta1/` | CRD types (Metal3Cluster, Metal3Machine, Metal3Data, etc.) - separate Go module |
    -| `controllers/` | Reconciliation logic |
    -| `baremetal/` | BareMetalHost integration logic |
    -| `internal/webhooks/` | Validation/defaulting webhooks |
    -| `config/` | Kustomize manifests (CRDs, RBAC, webhooks) - auto-generated by `make generate`, rarely edit directly |
    -| `hack/` | CI scripts (prefer Make targets locally) |
    -| `test/e2e/` | E2E test suite (central for Metal3 ecosystem) |
    -
    -## Testing Standards
    -
    -CI is managed by [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml).
    -Run these locally before submitting PRs:
    -
    -**Make targets:**
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test` | Full verification (generate + lint + unit) |
    -| `make generate` | Regenerate code (DeepCopy, CRDs, RBAC, mocks) |
    -| `make unit` | Unit tests (requires envtest - do not use `go test` directly) |
    -| `make lint` | Go linting via golangci-lint (all modules) |
    -| `make verify-boilerplate` | Check license headers |
    -| `make modules` | Verify go.mod is tidy |
    -
    -**Hack scripts** (auto-containerized, match CI exactly):
    -
    -| Script | Purpose |
    -|--------|---------|
    -| `./hack/shellcheck.sh` | Shell script linting (shellcheck) |
    -| `./hack/markdownlint.sh` | Markdown linting (config: `.markdownlint-cli2.yaml`) |
    -| `./hack/yamllint.sh` | YAML linting, including yaml blocks in `*.md` (config: `.yamllint.yaml`) |
    -| `./hack/manifestlint.sh` | Kubernetes manifest validation (kubeconform) |
    -
    -## Code Conventions
    -
    -- **Go**: Linting rules in `.golangci.yaml`, license headers in `hack/boilerplate/`
    -- **Shell**: Use `set -o errexit -o nounset -o pipefail`
    -- **Markdown**: 3-space indent for lists (`.markdownlint-cli2.yaml`)
    -
    -## Key Workflows
    -
    -### Modifying APIs
    -
    -1. Edit `api/v1beta1/*_types.go`
    -1. Run `make generate`
    -1. Update webhooks in `internal/webhooks/` if validation changes
    -1. Run `make test`
    -
    -## E2E Testing
    -
    -**CAPM3 is the central E2E test hub** for the Metal3 ecosystem
    -(validates CAPM3, IPAM, BMO, Ironic).
    -
    -| Command | Purpose |
    -|---------|---------|
    -| `make test-e2e` | Run E2E tests (requires metal3-dev-env) |
    -| `GINKGO_FOCUS="basic" ./scripts/ci-e2e.sh` | Run specific scenario |
    -
    -Key files:
    -
    -- `test/e2e/config/e2e_conf.yaml` - Provider versions and test config
    -- `test/e2e/data/infrastructure-metal3/` - Cluster templates per version
    -- `scripts/ci-e2e.sh` - Main orchestration script
    -
    -## Code Review Guidelines
    -
    -When reviewing pull requests:
    -
    -1. **Security** - Hardcoded secrets, unpinned dependencies, missing input validation
    -1. **Test coverage** - New functionality should have tests
    -1. **Consistency** - Match existing patterns in the codebase
    -1. **Breaking changes** - Flag API/behavior changes affecting users
    -
    -Focus on: `controllers/`, `baremetal/`, `api/`, `internal/webhooks/`.
    -
    -## AI Agent Guidelines
    -
    -### Before Changes
    -
    -1. Run `make unit` to verify baseline
    -1. Check patterns in similar existing files
    -
    -### When Making Changes
    -
    -1. Make minimal, surgical edits
    -1. Run `make generate` after API changes
    -1. Run `make test` before committing
    -1. Add tests for new functionality
    -
    -### Security Requirements
    -
    -- Pin external dependencies by SHA (containers, GitHub Actions, binaries)
    -- No hardcoded credentials
    -- Validate all inputs
    -
    -## Related Documentation
    -
    -- [API Documentation](docs/api.md)
    -- [Release Process](docs/releasing.md)
    -- [Metal3 Book](https://book.metal3.io)
    +# Cluster API Provider Metal3 (CAPM3)
    +
    +Cluster API infrastructure provider that turns `BareMetalHost`s managed
    +by the Baremetal Operator into Kubernetes cluster nodes.
    +Project overview: [README.md](README.md). Contribution rules:
    +[CONTRIBUTING.md](CONTRIBUTING.md) and the
    +[Metal3 community guide](https://github.com/metal3-io/community/blob/main/CONTRIBUTING.md).
    +
    +This file holds only what you cannot cheaply infer from the code. Where it
    +disagrees with the code or the Makefile, trust those and report the
    +mismatch.
    +
    +## AI-assisted contributions
    +
    +Metal3 follows the CNCF and
    +[Linux Foundation generative AI policy](https://www.linuxfoundation.org/legal/generative-ai).
    +
    +- AI is a tool. The human who opens a PR is its author and is responsible
    +  for every line of it, including licensing and third-party content.
    +- Review is a conversation between humans. A PR where an agent or bot
    +  answers reviewers will be closed. Agents may draft changes; the
    +  contributor reads them, understands them, and replies personally.
    +
    +- Keep changes surgical. The smallest complete change that solves the
    +  stated problem wins. Every added file, function, flag, dependency or
    +  test helper must trace to that problem; anything that does not is
    +  bloat and gets removed. Prefer reusing existing code over new code.
    +  Report unrelated findings instead of fixing them in the same PR.
    +
    +## Repository map
    +
    +Five Go modules (root, `api/`, `test/`, `hack/tools/`,
    +`hack/fake-apiserver/`). Root `go test ./...` does not cover the other
    +four. Tidy them with `make modules`, not `go mod tidy`; `hack/gomod.sh`
    +fails on any diff.
    +
    +- Controllers in `controllers/` are thin; the logic lives in the
    +  managers in `baremetal/`, which `controllers/` call through interfaces
    +  mocked in `baremetal/mocks/`.
    +- Webhooks: `internal/webhooks/v1beta2/`.
    +- The E2E suite in `test/e2e/` is shared: Jenkins E2E jobs of other
    +  Metal3 repos (for example `ironic-ipa-downloader`, `project-infra`,
    +  IPAM and ironic-image release branches) clone this repo and run
    +  `make test-e2e`. A change there affects their CI too.
    +
    +## Testing
    +
    +- Targets: `make help` and [docs/testing.md](docs/testing.md). E2E:
    +  [docs/e2e-test.md](docs/e2e-test.md). CI jobs:
    +  [Prow](https://github.com/metal3-io/project-infra/blob/main/prow/config/jobs/metal3-io/cluster-api-provider-metal3.yaml)
    +  and `.github/workflows/`.
    +- Conventions are whatever the existing code, tests, and lint configs do.
    +  Read neighboring files and `_test.go` files before writing new ones.
    +- Before finishing, add or update tests for every behavior change, then
    +  run `make test` and the `hack/` checks for the file types you touched.
    +  All must pass.
    +- `controllers/` and `baremetal/` tests need envtest. `make unit` sets it
    +  up; for a targeted `go test`, export the `KUBEBUILDER_ASSETS` path that
    +  `make setup-envtest` prints.
    +- Never hand-edit generated output (`zz_generated.*.go`, including the
    +  mocks, and the CRD, RBAC and webhook manifests under `config/`). Change
    +  the source and run `make generate`. The `generate` CI job fails on any
    +  diff.
    +- Do not touch `releasenotes/` outside a release PR. `make release-notes`
    +  generates them from PR titles; only release PRs curate them by hand
    +  ([docs/releasing.md](docs/releasing.md)).
    +- PR titles start with `:warning:` (breaking), `:sparkles:` (feature),
    +  `:bug:` (fix), `:book:` (docs) or `:seedling:` (other). The release
    +  notes tool sorts PRs by this prefix.
    +- Do not run `make test-e2e`, `make test-clusterclass-e2e`,
    +  `scripts/ci-e2e.sh`, `make clean-e2e`, or `hack/ensure-*.sh`,
    +  `hack/install-go.sh` and `hack/setup-bml.sh` unless the user asks: they
    +  install packages with `sudo`, install Go into `/usr/local/go`, and
    +  create libvirt VMs, networks and kind clusters on the host. E2E runs in
    +  Jenkins when a reviewer requests it with `/test`.
    +
    +## Invariants
    +
    +These apply to writing and to reviewing changes.
    +
    +- **API versions.** All kinds exist in `v1beta1` (served, conversion
    +  spoke) and `v1beta2` (storage version, conversion hub). A field change
    +  needs both types, the conversion functions in
    +  `api/v1beta1/conversion.go`, and a passing `TestFuzzyConversion`
    +  round-trip. Webhooks exist only for `v1beta2`.

    Fixed.

    tuminoid tuminoid commented on Nov 30, 2026 08:10 UTC
    Author

    /override metal3-centos-e2e-integration-test-main
    /override metal3-ubuntu-e2e-integration-test-main

    metal3-io-bot metal3-io-bot commented on Nov 30, 2026 08:10 UTC
    Bot

    @tuminoid: Overrode contexts on behalf of tuminoid: metal3-centos-e2e-integration-test-main, metal3-ubuntu-e2e-integration-test-main

    <details>

    In response to this:

    >/override metal3-centos-e2e-integration-test-main
    >/override metal3-ubuntu-e2e-integration-test-main

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

    </details>

    smoshiur1237 smoshiur1237 commented on Dec 01, 2026 07:40 UTC
    Reviewer

    /approve

    adilGhaffarDev adilGhaffarDev approved these changes on Dec 01, 2026 08:02 UTC
    Approved Reviewer

    /approve

    metal3-io-bot metal3-io-bot commented on Dec 01, 2026 08:02 UTC
    Bot

    [APPROVALNOTIFIER] This PR is APPROVED

    This pull-request has been approved by: <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/3919#pullrequestreview-6127171444" title="Approved">adilGhaffarDev</a>, <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/3919#pullrequestreview-6126936473" title="Approved">smoshiur1237</a>

    The full list of commands accepted by this bot can be found here.

    The pull request process is described here

    <details >
    Needs approval from an approver in each of these files:

  • ~~OWNERS~~ [adilGhaffarDev,smoshiur1237]
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":[]} -->

    adilGhaffarDev adilGhaffarDev commented on Dec 01, 2026 08:02 UTC
    Reviewer

    /lgtm

    Assignees
    tuminoid tuminoid
    Labels
    risk: low confidence: 88% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88% · Lower = rushed or shallow review
    88%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.1% · Safe to merge
    5.1%