Repository navigation
Improve docs workflow context and author attribution - #69668
Merged
Merged
Conversation
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]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The attribution step rejects valid CRLF-formatted descriptions that the earlier validator accepts.
Review effort: Balanced
Findings: 1
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}`)) { |
Contributor
|
Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at. |
wtgodbe
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Improve docs workflow context and author attribution
Prepare docs evidence once and preserve author attribution in draft descriptions.
Description
Focuses on
pr-docs-checkand its directly related helpers/tests. The workflow remains manually dispatched and now deterministically excludes unmerged PRs and PRs merged into branches other thanmainbefore 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:
python -B -m unittest discover -s .github\workflows\pr-docs-check -p "test_*.py" -vnode --test .github\workflows\pr-docs-check\test_author_body.cjsgh aw compile pr-docs-check --strict --no-check-updategit --no-pager diff --checkBaseline 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-updatewrapper 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).