diff --git a/.github/instructions/cdac.instructions.md b/.github/instructions/cdac.instructions.md index 8715be06e224c8..5339f3543e7864 100644 --- a/.github/instructions/cdac.instructions.md +++ b/.github/instructions/cdac.instructions.md @@ -1,5 +1,5 @@ --- -applyTo: "src/native/managed/cdac/**" +applyTo: "src/native/managed/cdac/**,docs/design/datacontracts/**,src/coreclr/**/datadescriptor/**" --- # cDAC — Folder-Specific Guidance @@ -32,3 +32,16 @@ When porting `HRESULT`-returning APIs to throw exceptions, the following mapping - `ArgumentException` → for `E_INVALIDARG` - `NullReferenceException` → for `E_POINTER` - `InvalidCastException` → for `E_NOINTERFACE` + +## Documentation updates (ALL branches) + +`docs/design/datacontracts/.md` is the authoritative spec of each contract (1:1 with `Abstractions/Contracts/I.cs`). If the PR changes any of the following without also updating the doc, **MUST** flag it as an error citing the exact doc file: + +- **`Abstractions/Contracts/I.cs`** — added, removed, or renamed methods, or new exposed types/enums. +- **`Contracts/Contracts/_.cs`** — a new version file (needs a new `## Version N` section), or a semantic change to an existing version's algorithm. Pure refactors don't need doc updates. +- **New contract** (new `I.cs` + `_1.cs`) — needs a new `docs/design/datacontracts/.md`. +- **`src/coreclr/**/datadescriptor/**`** — added, removed, or renamed types, fields, or globals may need a matching update in every consuming contract's doc; check whichever contracts' algorithms are affected. + +Do **NOT** require doc updates for pure refactors, test-only changes, bug fixes that restore documented behavior, `Legacy/**` (SOSDacImpl, DacDbi shim), or build/CI changes. + +