Skip to content

Add public API governance instructions - #68168

Open
PureWeen wants to merge 1 commit into
mainfrom
pureween-public-api-instructions
Open

Add public API governance instructions#68168
PureWeen wants to merge 1 commit into
mainfrom
pureween-public-api-instructions

Conversation

@PureWeen

@PureWeen PureWeen commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • teach coding agents to recognize new or changed public/protected API surface and require api-approved before implementation
  • point agents to the ASP.NET Core API review workflow and distinguish PublicAPI.Unshipped.txt compatibility tracking from API approval
  • add a variant-neutral Vally eval and A/B experiment for new members, shipped interface changes, and shipped default changes

Evaluation

A controlled local Vally comparison used the same analogous unapproved Blazor event API stimulus with claude-opus-4.6 as both agent and judge:

Variant Result Score
Existing instructions 0/3 passed 66.7%
Updated instructions 3/3 passed 100%

The baseline agents recognized the broad API gate but consistently omitted the PublicAPI.Unshipped.txt distinction and re-review requirement. Updated agents included the complete governance response and stopped before implementation.

Validation

  • vally lint --eval-spec eng/instructions-evals/copilot-instructions/eval.vally.yaml
  • parsed eng/instructions-evals/instructions-vs-baseline.experiment.yaml as YAML
  • git diff --check

Limitation

The locally installed Vally 0.5.0 does not expose the experiment command used by the repository's existing experiment schema. The checked-in eval remains variant-neutral, and the experiment overlays .github/copilot-instructions.md only for the current variant. With Vally 0.5.0, the same A/B can be reproduced as two plain eval runs from an isolated empty directory.

Teach coding agents to stop before implementing unapproved public API changes and preserve the behavior with a Vally A/B evaluation harness.

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

Copilot-Session: c6e15e01-fdd2-4645-8e63-a64375d7ea15
@PureWeen
PureWeen marked this pull request as ready for review August 5, 2026 16:44
@PureWeen
PureWeen requested review from a team and wtgodbe as code owners August 5, 2026 16:44
Copilot AI review requested due to automatic review settings August 5, 2026 16:44

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

This PR strengthens repository-wide coding-agent governance around public/protected API changes by adding explicit guidance to stop implementation unless the linked issue is api-approved, and by adding Vally eval/experiment definitions to measure that behavior via an instructions-off vs instructions-on A/B.

Changes:

  • Add a “Public API Changes” governance section to .github/copilot-instructions.md that requires api-approved before implementing public/protected API changes and clarifies PublicAPI.Unshipped.txt semantics.
  • Add a variant-neutral Vally eval spec that prompts for three representative unapproved API-change categories and grades for correct “stop and drive API review” behavior.
  • Add an experiment YAML that injects the instructions overlay only for the current variant, keeping the eval itself variant-neutral.
Show a summary per file
File Description
eng/instructions-evals/instructions-vs-baseline.experiment.yaml Defines the baseline vs current experiment by varying /environment/files to toggle the repo instructions overlay.
eng/instructions-evals/copilot-instructions/eval.vally.yaml Adds the variant-neutral eval spec with shared graders/rubric across three governance stimuli.
.github/copilot-instructions.md Adds explicit public API governance instructions (api-approved gate, API review workflow, and Unshipped vs approval distinction).

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants