Skip to content

Fix agentic review publication and PR input contracts - #12190

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/agentic-workflow-reliability
Nov 3, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/agentic-workflow-reliability

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Pull request

Summary

Agentic test reviews can complete analysis and threat detection but fail before publication with Report nodes cannot appear in scalar fields, as in run 41640057298. Five inspected runs share this failure. The expert reviewer also cannot read unapproved PR diffs under its default public-repository integrity policy.

  • Consume {history_link} directly as the pinned runtime's complete optional inline fragment in all 32 affected footer templates, and regenerate their locks.
  • Let the three expert-review workflows read unapproved public PR data while disabling shell access and preserving read-only tools, existing credentials, detection, visibility filtering, and publication limits.
  • Resolve centralized /review PR identity through a supported environment binding and require a terminal incomplete result when the diff is unavailable.
  • Add offline regressions using the unchanged shipping runtime and wire them into the existing action-pin check.

Design and decision record

This is a runtime-contract repair, not a new feature. The maintained workflow rationale and regression evidence records the failures and chosen approach; the expert-review input contract explains two non-obvious compiler constraints.

The imported prompt rejects direct fromJSON(...), so the fallback is resolved in frontmatter env.REVIEW_PR_NUMBER. Setting only min-integrity: none changes the repository-scope default to all, so allowed-repos: public is explicit. Neither disabling footers nor upgrading/patching the upstream renderer is necessary. All 29 non-expert generated locks change only the intended footer values and frontmatter hashes. Action/container pins and dependency manifests are unchanged.

Demonstration

The composed regression supplies the authored footer to the real PR-review buffer, renderer, and size-fitting path. Without the fix it throws before createReview; with the fix it produces the exact advisory review body, attribution, credit suffix, and reviewed commit. Separate cases preserve inline comment path/line associations and suppress publication for staged or empty output.

A text reproduction is clearer than a screenshot for this failure. No live workflow or test review was dispatched. Hosted MCP/model behavior, publication permissions, and GitHub UI rendering remain unverified; captured publishing payloads are not visual proof.

Validation and regression proof

Tested source: d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6; committed from the 68 files whose working-file hashes matched the final validated manifest before commit. Baseline: d9e38dc463365dc12f714db14815b46dedb0ed15, extracted into an isolated archive with the final regression tests retained.

Toolchain: released gh-aw v1.0.1; unchanged setup scripts at 221ba4f4319de6b8e809d1a15528b3ae6a818aa5; Node.js v24.22.1; ShellCheck v0.11.0. $ghAw denotes the verified released compiler, $actions the pinned setup scripts, $module its firewall_blocked_domains.cjs, and $baseline the isolated archive's .github\workflows directory.

Exact command Result
& $ghAw compile --strict --no-check-update --shellcheck Exit 0; 37 inputs; zero warnings; 2,103 lint resources.
& $ghAw compile review-on-open.agent review.agent review-after-autofix.agent --strict --no-check-update --shellcheck Exit 0; final public-scoped expert consumers; zero warnings; 186 lint resources.
python .github\scripts\check_action_pins.py Exit 0; 2,759 references across 58 files.
python .github\scripts\test_gh_aw_runtime_contracts.py --actions-dir $actions -v Exit 0; 13/13 methods pass, including all 33 authored footer templates with and without history.
python .github\scripts\test_agentic_workflow_warning_contracts.py -v Exit 0; 25/25 pass.
python .github\scripts\test_build_failure_analysis_checkout.py -v Exit 0; 6/6 pass.
python .github\scripts\test_gh_aw_firewall_footer.py --module-path $module -v Exit 0; 7/7 pass.
python -m unittest discover -s .github\workflows\tests -p test_test_value_evidence.py -v Exit 0; 26/26 pass.

Total: 77 passing methods, no skips. Raw local logs are retained in the session; the committed README contains reproducible commands and the evidence summary. A single read-only safety reviewer passed all ten properties for the final executable changes. No .NET products or packages changed, so .NET build/pack/acceptance runs were not required. Hosted validation and release-branch/backport work are not claimed.

Test-value evidence

Contract / exact test Without fix Corrected source
Footer publication: GhAwRuntimeContractTests.test_authored_test_review_footer_publishes_complete_advisory_review Executed: the actual renderer throws the observed scalar-field exception before any API request. Executed: passes exact composed payload, commit/event, attribution, credits, and diagnostic-isolation assertions.
PR-read policy: GhAwRuntimeContractTests.test_public_review_resolver_honors_explicit_public_only_policy Executed: actual minimum integrity is approved, not none. Executed: none with repository visibility still public.
Command identity / incomplete reporting: test_centralized_review_number_is_delivered_to_each_compiled_prompt and test_required_diff_failure_has_terminal_incomplete_prompt_delivery Static source/compiled contracts; no live model proof. Both checks pass; live command/model behavior remains unverified.

Paired commands used the same final tests, assertions, runtime, and selection:

$cases = @(
  'GhAwRuntimeContractTests.test_authored_test_review_footer_publishes_complete_advisory_review'
  'GhAwRuntimeContractTests.test_public_review_resolver_honors_explicit_public_only_policy'
)
python .github\scripts\test_gh_aw_runtime_contracts.py --actions-dir $actions --workflow-root $baseline @cases -v
# Exit 1: two executed tests, two intended behavioral failures, no skips.
python .github\scripts\test_gh_aw_runtime_contracts.py --actions-dir $actions @cases -v
# Exit 0: the same two tests pass, no skips.

Consume typed history-link fragments directly in custom footers and regenerate the affected workflows. Restore public-only unapproved PR reads for expert review with shell access disabled, resolve centralized command identity, and emit terminal incomplete results for unavailable diffs. Add pinned-runtime regression coverage and document red/green evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 19:27
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Nov 3, 2026

@github-actions github-actions Bot 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

The change is mechanical and consistent, and I found no blocking issues. Coverage was limited: the 742KB diff file was not readable in this run, so I reviewed the PR metadata and the non-lock source files from the local checkout of the head commit. I did not hand-review the 30+ regenerated *.lock.yml files.

Reviewer actions

  • Recommended: confirm on a live run that a public PR with an unapproved author can be read through min-integrity: none and that bash: false is actually applied in the generated lock files of review.agent, review-on-open.agent and review-after-autofix.agent. Done when: a dispatched review completes, or report_incomplete fires, as intended. The PR itself says no live dispatch was done.
  • Recommended: check that REVIEW_PR_NUMBER resolves to a PR number when the /review command is triggered from an issue_comment on a plain issue, or has no PR context. Done when: that path ends in a terminal report_incomplete rather than reviewing the wrong number.

Change classification

  • Agentic workflow footer templates: {history_link} is now consumed directly, with the · [◷](...) wrapper removed, in about 32 workflow sources and their locks.
  • Expert-review workflow input contract in shared/review-shared.md: bash: false, min-integrity: none, allowed-repos: public, REVIEW_PR_NUMBER, and a terminal incomplete path when the diff is unavailable.
  • New offline test .github/scripts/test_gh_aw_runtime_contracts.py, wired into check-action-pins.yml, plus a README section.

Confidence at a glance

🟡 Build, dependencies & scripts
  • No dependency versions, action pins or containers changed, according to the PR description. I did not verify this, and check_action_pins.py is the authoritative guard.
  • The new test is added to both paths triggers and to a CI step, so it will run.
  • Footer edits in the .md sources are one-line and uniform, as sampled.
🟡 Security / agentic workflow policy
  • Reading unapproved public PR content with min-integrity: none raises the prompt-injection exposure. The mitigations are visible in the diff: bash: false, allowed-repos: public, an explicit instruction to treat the diff as untrusted data, and safe-output limits. Maintainers should explicitly accept this trade-off. Confirm that credentials in the job cannot be reached through the remaining tools.
  • fromJSON(...) inside the frontmatter env expression falls back to item_number. This is acceptable given the README rationale, but it should be covered by the compiled-prompt regression test, which the PR claims it is.
🟢 Test-value evidence
  • The PR provides paired red/green evidence (2 tests fail on the baseline and pass with the fix). Two of the three contracts are static checks only. Hosted behavior remains unverified, and the PR states this.

Specialists for MSTest/MTP product code were not applicable: no .NET product, public API, localization or test-project files changed.

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 3, 2026

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.

🔵 Needs a closer look

The relaxed public-PR trust boundary and background-review lifecycle require maintainer validation because offline fixtures cannot establish hosted enforcement or live completion and publication.

No open issues 🎉

What changed in this PR

This PR repairs publication and PR-input handling in TestFx’s agentic workflows without changing shipped .NET products. It corrects footer composition and lets expert reviews consume unapproved public PR data while retaining restricted tooling.

Changes:

  • Insert {history_link} directly as an optional inline fragment and update generated workflow locks.
  • Resolve centralized /review PR identity through an environment binding, disable shell access, and require an incomplete result when the diff is unavailable.
  • Wire runtime-contract regressions into CI and document the rationale and validation limits.

Test-value evidence: For revision d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6, the PR reports two targeted regressions failing against the baseline and passing with the fix, plus 77 passing test methods overall. These results were not independently rerun; hosted model behavior, publication permissions, and GitHub UI rendering remain unverified.

File Description
.github/​workflows/​weekly-issue-activity.md Corrects the weekly summary footer.
.github/​workflows/​weekly-issue-activity.lock.yml Updates compiled weekly summary footers.
.github/​workflows/​unskip-closed-tests.lock.yml Updates compiled unskip workflow footers.
.github/​workflows/​unskip-closed-tests-shared.md Corrects the shared unskip footer.
.github/​workflows/​test-reviewer.agent.md Corrects the command-triggered test-review footer.
.github/​workflows/​test-reviewer.agent.lock.yml Updates compiled command test-review footers.
.github/​workflows/​test-reviewer-on-pr.agent.md Corrects the automatic test-review footer.
.github/​workflows/​test-reviewer-on-pr.agent.lock.yml Updates compiled automatic test-review footers.
.github/​workflows/​test-improver.md Corrects the test-improver footer.
.github/​workflows/​test-improver.lock.yml Updates compiled test-improver footers.
.github/​workflows/​sub-issue-closer.md Corrects the sub-issue closure footer.
.github/​workflows/​sub-issue-closer.lock.yml Updates compiled sub-issue closure footers.
.github/​workflows/​shared/​test-reviewer-shared.md Corrects the shared test-review footer.
.github/​workflows/​shared/​review-shared.md Updates PR identity, read policy, shell restrictions, and incomplete reporting.
.github/​workflows/​shared/​parallel-safety-audit-shared.md Corrects the shared parallel-safety footer.
.github/​workflows/​shared/​msbuild-review-shared.md Corrects the shared MSBuild-review footer.
.github/​workflows/​shared/​address-review-shared.md Corrects the shared review-response footer.
.github/​workflows/​resource-lock-refactoring.md Removes the invalid history-link wrapper.
.github/​workflows/​resource-lock-refactoring.lock.yml Updates compiled resource-lock footers.
.github/​workflows/​repository-quality-improver.md Corrects the repository-quality footer.
.github/​workflows/​repository-quality-improver.lock.yml Updates compiled repository-quality footers.
.github/​workflows/​README.md Documents runtime contracts, regression evidence, and validation limits.
.github/​workflows/​pr-fix.md Corrects the PR-fix footer.
.github/​workflows/​pr-fix.lock.yml Updates compiled PR-fix footers.
.github/​workflows/​perf-improver.md Corrects the performance-improver footer.
.github/​workflows/​perf-improver.lock.yml Updates compiled performance-improver footers.
.github/​workflows/​parallel-safety-audit-command.md Corrects the command-triggered audit footer.
.github/​workflows/​parallel-safety-audit-command.lock.yml Updates compiled command audit footers.
.github/​workflows/​mutation-test-improver.md Corrects the mutation-test footer.
.github/​workflows/​mutation-test-improver.lock.yml Updates compiled mutation-test footers.
.github/​workflows/​msbuild-quality-review.lock.yml Updates compiled MSBuild-review footers.
.github/​workflows/​markdown-linter.md Corrects the Markdown-linter footer.
.github/​workflows/​markdown-linter.lock.yml Updates compiled Markdown-linter footers.
.github/​workflows/​malicious-code-scan.md Corrects the code-scan footer.
.github/​workflows/​malicious-code-scan.lock.yml Updates compiled code-scan footers.
.github/​workflows/​link-checker.md Corrects the link-checker footer.
.github/​workflows/​link-checker.lock.yml Updates compiled link-checker footers.
.github/​workflows/​glossary-maintainer.md Corrects the glossary-maintainer footer.
.github/​workflows/​glossary-maintainer.lock.yml Updates compiled glossary-maintainer footers.
.github/​workflows/​efficiency-improver.md Corrects the efficiency-improver footer.
.github/​workflows/​efficiency-improver.lock.yml Updates compiled efficiency-improver footers.
.github/​workflows/​duplicate-code-detector.md Corrects the duplicate-code report footer.
.github/​workflows/​duplicate-code-detector.lock.yml Updates compiled duplicate-code footers.
.github/​workflows/​dependabot-pr-bundler.md Corrects the dependency PR-bundler footer.
.github/​workflows/​dependabot-pr-bundler.lock.yml Updates compiled PR-bundler footers.
.github/​workflows/​dependabot-issue-bundler.md Corrects the dependency issue-bundler footer.
.github/​workflows/​dependabot-issue-bundler.lock.yml Updates compiled issue-bundler footers.
.github/​workflows/​daily-file-diet.md Corrects the file-diet footer.
.github/​workflows/​daily-file-diet.lock.yml Updates compiled file-diet footers.
.github/​workflows/​code-simplifier.md Corrects the code-simplifier footer.
.github/​workflows/​code-simplifier.lock.yml Updates compiled code-simplifier footers.
.github/​workflows/​check-action-pins.yml Adds runtime-contract test triggers and execution.
.github/​workflows/​build-failure-analysis.md Corrects the automatic build-analysis footer.
.github/​workflows/​build-failure-analysis.lock.yml Updates compiled automatic build-analysis footers.
.github/​workflows/​build-failure-analysis-command.md Corrects the command-triggered build-analysis footer.
.github/​workflows/​build-failure-analysis-command.lock.yml Updates compiled command build-analysis footers.
.github/​workflows/​autofix.agent.md Corrects the autofix footer.
.github/​workflows/​autofix.agent.lock.yml Updates compiled autofix footers.
.github/​workflows/​adhoc-qa.md Corrects the ad hoc QA footer.
.github/​workflows/​adhoc-qa.lock.yml Updates compiled ad hoc QA footers.
.github/​workflows/​address-review.agent.md Corrects the automatic review-response footer.
.github/​workflows/​address-review.agent.lock.yml Updates compiled review-response footers.
.github/​workflows/​add-tests.md Corrects the test-generation footer.
.github/​workflows/​add-tests.lock.yml Updates compiled test-generation footers.

Review effort: Balanced

@github-actions github-actions Bot 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.

🧪 Test quality review — PR #12190

Compared merge base d9e38dc463365dc12f714db14815b46dedb0ed15 with head d7abbfa6a0a5f792df9f849f9eb98c1c0c7440c6. Evidence applies to this head, not every intermediate commit.

Test-value evidence

  • The diff changes only agentic workflow sources (.md), regenerated .lock.yml files, .github/workflows/README.md, check-action-pins.yml, and .github/scripts/test_gh_aw_runtime_contracts.py. It has no C# test or product-source changes.
  • Contract: gh-aw workflow runtime/compile output. The existing Python contract script is the only related test. It was not run in this read-only review, so there is no executed before/after evidence. Status: unverified / not executed.
  • Lock-file changes are generated output and are not applicable for regression tests. python .github/scripts/check_action_pins.py and the CI pin audit remain the guard for unintended uses: changes.
  • The Python script appears in the changed-file inventory but not the changed test ranges, because the pre-step only tracks C# tests. I did not assess its modified cases, so that group is unassessed.

🧵 Parallel safety

NOT_APPLICABLE: no changed tests or parallelization configuration were in scope.

Per-test assessment

No changed C# test methods, so there is nothing to grade (Not applicable).

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto · ~24 AIC · ⌖ ~1 AIC · ⊞ 8K

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 3, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 3, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 3, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit d3ce600 into main Nov 3, 2026
34 of 36 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/agentic-workflow-reliability branch November 3, 2026 21:08
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the state/needs-review Awaiting review from the team. label Nov 3, 2026
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