Skip to content

cDAC review instructions: require doc updates for contract/data-descriptor changes#130532

Open
max-charlamb wants to merge 2 commits into
dotnet:mainfrom
max-charlamb:cdac-review-doc-instructions
Open

cDAC review instructions: require doc updates for contract/data-descriptor changes#130532
max-charlamb wants to merge 2 commits into
dotnet:mainfrom
max-charlamb:cdac-review-doc-instructions

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Improves the cDAC Copilot PR-review instructions so reviews consistently flag missing doc updates for contract and data-descriptor changes.

Motivation

Copilot PR reviews on cDAC changes have repeatedly missed cases where docs/design/datacontracts/<Name>.md should have been updated alongside the code. The doc under docs/design/datacontracts/ is the authoritative spec of each contract (1:1 with Abstractions/Contracts/I<Name>.cs) and it drifts silently when reviewers don't check it.

Change

Two edits to .github/instructions/cdac.instructions.md:

  1. Broaden applyTo so these instructions load for PRs that touch:

    • src/native/managed/cdac/** (existing)
    • docs/design/datacontracts/** (new)
    • src/coreclr/**/datadescriptor/** (new -- catches all three datadescriptor dirs: vm/, gc/, nativeaot/Runtime/)
  2. Add a "Documentation updates" section with a short list of change patterns that MUST have a matching doc update:

    • Abstractions/Contracts/I<Name>.cs -- add/remove/rename methods, new exposed types/enums
    • Contracts/Contracts/<Name>_<N>.cs -- new version file, or semantic change to an existing version's algorithm (pure refactors excluded)
    • New contract entirely -- new docs/design/datacontracts/<Name>.md
    • src/coreclr/**/datadescriptor/** -- consuming contract's doc must reflect the change
    • New Contracts/Data/<Type>.cs or new Target.ReadGlobal* -- doc must document it

    With an explicit exclusion list (pure refactors, test-only, restored-behavior bug fixes, Legacy/**, build/CI).

Kept the section deliberately short (~12 lines) -- shorter instruction blocks have produced better reviewer behavior than longer ones.

Note

This PR was drafted with assistance from GitHub Copilot.

…iptor changes

Copilot PR reviews for cDAC changes have repeatedly missed cases where
docs/design/datacontracts/<Name>.md needed to be updated alongside the code.
Add an explicit "Documentation updates" section listing the code-change
patterns that require a matching doc update, and broaden applyTo so the
instructions load for docs/design/datacontracts/** and every
src/coreclr/**/datadescriptor/** directory (vm, gc, nativeaot/Runtime).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@max-charlamb max-charlamb marked this pull request as ready for review July 10, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the cDAC folder-specific Copilot review instructions so they also apply to cDAC contract specification docs and CoreCLR data-descriptor sources, and adds an explicit checklist to require corresponding docs/design/datacontracts/<Name>.md updates when contract/data-descriptor-related code changes.

Changes:

  • Expanded the applyTo scope to include docs/design/datacontracts/** and src/coreclr/**/datadescriptor/** in addition to src/native/managed/cdac/**.
  • Added a short “Documentation updates” section enumerating contract/data-descriptor change patterns that must be accompanied by doc updates, with explicit exclusions.

- **`Contracts/Contracts/<Name>_<N>.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<Name>.cs` + `<Name>_1.cs`) — needs a new `docs/design/datacontracts/<Name>.md`.
- **`src/coreclr/**/datadescriptor/**`** — every consuming contract's doc must reflect added/removed/renamed types, fields, or globals.
- **New `Contracts/Data/<Type>.cs`** or new `Target.ReadGlobal*` in a contract impl — the consuming contract's doc must document it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might trigger extraneously when the doc is in a more prose style. I think we already have the changes we want captured in “semantic change to an existing version’s algorithm”.

…or wording

Per review feedback (rcj1): the Data/<Type>.cs + Target.ReadGlobal* rule
was redundant with 'semantic change to an existing version's algorithm'
and risked false positives on contract docs written in prose style
(rather than a strict 'list every data structure' style). Drop it, and
soften the datadescriptor bullet from 'must reflect' to 'may need a
matching update ... check whichever contracts' algorithms are affected'
for the same reason.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 11, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +40 to +44
- **`Abstractions/Contracts/I<Name>.cs`** — added, removed, or renamed methods, or new exposed types/enums.
- **`Contracts/Contracts/<Name>_<N>.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<Name>.cs` + `<Name>_1.cs`) — needs a new `docs/design/datacontracts/<Name>.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants