Repository navigation
Python: Refresh coding standards and Copilot review guidance - #9637
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes affect guidance only, and the remaining documentation corrections are minor and non-blocking.
2 open issues
What changed in this PR
This documentation-only PR establishes a canonical Python coding standard and moves Copilot’s Python review guidance to the repository-root discovery location, addressing #9636. Runtime behavior and public APIs are unchanged.
Changes:
- Consolidates engineering and API-design rules using explicit MUST/SHOULD/MAY levels.
- Replaces duplicated development guidance with links to the canonical standard and task-specific skills.
- Aligns testing practices and sample file-layout guidance.
| File | Description |
|---|---|
python/samples/SAMPLE_GUIDELINES.md |
Updates sample layout, examples, and environment-variable inventory guidance. |
python/samples/AGENTS.md |
Aligns sample layout and inventory instructions. |
python/CODING_STANDARD.md |
Establishes canonical engineering, API, and testing requirements. |
python/AGENTS.md |
Updates descriptions of the standard and development skill. |
python/.github/skills/python-testing/SKILL.md |
Clarifies fixtures, behavior-focused tests, and integration markers. |
python/.github/skills/python-development/SKILL.md |
Replaces duplicated standards with workflow guidance. |
python/.github/instructions/python.instructions.md |
Removes the nested Copilot instruction file. |
.github/instructions/python.instructions.md |
Adds root-level Python review instructions. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 40c0f5704d08
Model: gpt-5.6-sol
Overview
The PR successfully centralizes Python guidance, preserves explicit compatibility and lifecycle guardrails, and moves path-specific review instructions to the supported repository-root location. Two internal contract conflicts remain: automated review is told to report grandfathered violations, and the universal annotation requirement contradicts the deliberately relaxed test/sample typing policy. Both can create systematic false review findings for otherwise compliant changes.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (2 medium) across 2 files. Details are attached to the affected lines below.
Affected areas: .github/instructions/python.instructions.md, python/CODING_STANDARD.md
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Motivation & Context
Python engineering guidance had grown into multiple partially conflicting copies, while the path-specific Copilot instruction lived outside GitHub's documented repository-root discovery location. This made it unclear which rules were authoritative and reduced the likelihood that Copilot code review would apply them consistently.
This change establishes one canonical standard, separates durable engineering rules from task-specific workflow guidance, and wires Python review instructions into the supported root
.github/instructionslocation.Description & Review Guide
python/CODING_STANDARD.mdaround explicit MUST/SHOULD/MAY levels; adds guidance for import-light APIs,TypedDictextensibility, typing suppressions, Protocols and inheritance, compatibility, async/resource ownership, exceptions, documentation, performance, and behavior-focused testing. Moves the Python path-specific Copilot instruction to.github/instructions/python.instructions.md, simplifies thepython-developmentskill to reference the canonical standard, and aligns testing and sample guidance.Related Issue
Fixes #9636
AI Assistance
AI assistance details: Documentation restructuring, standards synthesis, Copilot instruction wiring, repository audit, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.