Skip to content

Improve docs workflow context and author attribution - #69668

Merged
DeagleGross merged 1 commit into
mainfrom
deaglegross-docs-workflow-improvements
Oct 5, 2026
Merged

DeagleGross merged 1 commit into
mainfrom
deaglegross-docs-workflow-improvements

Conversation

@DeagleGross

Copy link
Copy Markdown
Member

Improve docs workflow context and author attribution

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Prepare docs evidence once and preserve author attribution in draft descriptions.

Description

Focuses on pr-docs-check and its directly related helpers/tests. The workflow remains manually dispatched and now deterministically excludes unmerged PRs and PRs merged into branches other than main before patch collection or version resolution. Invalid requests retain the no-op-only contract; valid ineligible requests retain the standard skipped source notification.

Pre-agent preparation reuses one source PR response and paginated changed-file responses to cache compact, full-fidelity authored metadata separately from patches. It supplies reviewable file/line evidence for public API/ref changes, shipped templates, defaults/configuration, diagnostics/analyzers, target frameworks, and explicit user-facing/breaking wording. Signals are candidates, not automatic documentation requirements. The prompt keeps the 60% threshold, existing confidence floors and exemptions, independent conceptual/migration/breaking decisions, additional source/linked-issue access, and the existing issue/review-comment policy. Missing/truncated patches and incomplete file lists remain explicit investigation boundaries.

The cap changes from 100 to 50, with guidance to begin finalizing by invocation 35. Existing deterministic-failure and denied-tool anti-loop rules remain intact.

The trusted notification job obtains the human source author's login directly from GitHub and adds or refreshes a managed attribution block in both newly created and updated draft descriptions. It no longer posts a separate author comment. Existing draft updates are title-only; body replacement is disabled and rejected by preflight so generated descriptions, gh-aw attribution, and human edits outside the managed block are preserved. Source status notifications remain unchanged. No assignees or reviewers are requested.

Docs repository/fork topology, native source-token access, inference-only PAT pool, scoped docs App authentication, trusted draft selection, outcome validation, branch preservation/recreation, annual version policy, optional release-note placement, and the existing restricted-change policy remain intact. No unrelated workflows or gh-aw versions change.

Validation:

Command Result
python -B -m unittest discover -s .github\workflows\pr-docs-check -p "test_*.py" -v Passed: 57 tests, including all existing workflow suites.
node --test .github\workflows\pr-docs-check\test_author_body.cjs Passed: 8 tests, including actual notification-script execution against mocked REST boundaries for created and updated drafts, repeated attribution, bot exclusion, preservation of human edits, and changed-identity rejection.
gh aw compile pr-docs-check --strict --no-check-update Passed with gh-aw v0.89.21, zero warnings; lock regenerated and inspected for both 50-invocation rails and helper/artifact/output wiring.
`actionlint -ignore 'unknown permission scope "copilot-requests"' -ignore 'property "workflow_(repository sha
git --no-pager diff --check Passed.

Baseline verification: existing tests passed before implementation. The turn-cap and body-preservation regression checks failed against the original behavior, and the actual author-notification script tests independently failed for both created and updated drafts when run with WORKFLOW_BASELINE_REF=origin/main; all pass with this change. A read-only execution of the context producer against #68648 cached all 9 changed files, detected template evidence, and found no missing patches.

The integrated gh aw compile pr-docs-check --strict --actionlint --no-check-update wrapper exited nonzero on this Windows host despite reporting zero findings; the native validation above was used instead. No live workflow was dispatched and no existing docs PR was modified. Production drafting behavior, token cost, runtime, and documentation quality still require a separately authorized live run; fixture and REST-boundary tests do not establish those outcomes.

Fixes: N/A (no linked issue was supplied for this workflow change).

Cache source metadata and targeted patches, add deterministic user-facing evidence and main-merge eligibility, and reserve the 50-turn budget for completing outputs. Preserve docs descriptions and add human author attribution through a trusted managed body section.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:38
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners October 5, 2026 15:38

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.

Copilot review overview

🟡 Changes recommended

The attribution step rejects valid CRLF-formatted descriptions that the earlier validator accepts.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Improves the manual documentation workflow by caching source evidence, enforcing eligibility gates, preserving draft descriptions, and attributing source authors.

Changes:

  • Adds deterministic context preparation and signal generation.
  • Preserves existing draft bodies while managing author attribution.
  • Reduces the agent limit to 50 turns and expands validation coverage.
File Description
prepare_context.py Prepares eligibility, metadata, patches, and signals.
author_body.cjs Manages author attribution blocks.
validate_outcome.py Enforces preflight and body-preservation rules.
pr-docs-check.md Updates workflow behavior and guidance.
pr-docs-check.lock.yml Regenerates the compiled workflow.
test_prepare_context.py Tests context and signal preparation.
test_author_body.cjs Tests attribution and workflow integration.
test_validate_outcome.py Tests new outcome constraints.
test_workflow_policy.py Tests workflow policy and turn limits.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

(pr.labels || []).map(label => label.name).sort(),
]);
if (identity(docsPr.data) !== identity(validated) ||
!docsPr.data.body?.split('\n').includes(`Source: ${expectedRepository}#${expectedPrNumber}`)) {
@DeagleGross DeagleGross self-assigned this Oct 5, 2026
@DeagleGross DeagleGross added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 5, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@DeagleGross
DeagleGross merged commit 4ca8a26 into main Oct 5, 2026
21 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-docs-workflow-improvements branch October 5, 2026 18:40
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants