Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/scripts/test_agentic_workflow_warning_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def commit(self, message: str) -> str:


class CompiledWarningContractTests(unittest.TestCase):
def assert_noop_detection_gate(self, name: str) -> None:
source, _ = authored(name + ".md")
def assert_noop_detection_gate(self, name: str, source_name: str | None = None) -> None:
source, _ = authored(source_name or name + ".md")
jobs = compiled(name + ".lock.yml")["jobs"]
gate = ("(needs.agent.outputs.output_types != '' && "
"needs.agent.outputs.output_types != 'noop') || "
Expand All @@ -280,8 +280,13 @@ def test_pipeline_triage_detection_skips_noop_only_runs(self) -> None:
def test_resource_lock_detection_skips_noop_only_runs(self) -> None:
self.assert_noop_detection_gate("resource-lock-refactoring")

def assert_detection_security_controls(self, name: str) -> None:
source, _ = authored(name + ".md")
def test_expert_review_detection_skips_noop_only_runs(self) -> None:
for name in ("review.agent", "review-on-open.agent", "review-after-autofix.agent"):
with self.subTest(workflow=name):
self.assert_noop_detection_gate(name, "shared/review-shared.md")

def assert_detection_security_controls(self, name: str, source_name: str | None = None) -> None:
source, _ = authored(source_name or name + ".md")
jobs = compiled(name + ".lock.yml")["jobs"]
detection = source["safe-outputs"]["threat-detection"]
self.assertEqual("detection", detection["model"])
Expand All @@ -304,6 +309,14 @@ def test_pipeline_triage_noop_skip_preserves_detection_security_controls(self) -
def test_resource_lock_noop_skip_preserves_detection_security_controls(self) -> None:
self.assert_detection_security_controls("resource-lock-refactoring")

def test_expert_review_noop_skip_preserves_detection_security_controls(self) -> None:
for name in ("review.agent", "review-on-open.agent", "review-after-autofix.agent"):
with self.subTest(workflow=name):
self.assert_detection_security_controls(name, "shared/review-shared.md")
source, _ = authored(name + ".md")
self.assertIs(False, source["safe-outputs"]["noop"]["report-as-issue"],
"Skipping detection for noop-only output must not publish an issue")

def test_build_publisher_checkouts_have_direct_identity_dependency(self) -> None:
jobs = compiled("build-failure-analysis.lock.yml")["jobs"]
output = jobs["safe_outputs"]
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,28 @@ emits only `noop` without a patch, ResourceLock uses the same eligibility guard
as Pipeline Test Triage. Incomplete reports, other outputs, mixed outputs, and
every patch still require detection.

Expert Code Review hit the same eligibility defect in
[run 42848192058](https://github.com/microsoft/testfx/actions/runs/42848192058),
tracked by [#12320](https://github.com/microsoft/testfx/issues/12320).
Its collector emitted only `noop` with `has_patch=false`, but detection still
started. Unlike the download failures above, threat-detect v0.5.3 installed
successfully and resolved `detection` to `claude-haiku-5.5`. The engine then
timed out after five minutes without recording a verdict or inference usage.
The tracker classified this as `detector_execution_failure` / `agent_failure`,
not a threat finding; the assessment remained incomplete.

The shared expert-review configuration now applies the same no-op exclusion to
the ready-PR, `/review`, and after-autofix workflows. Real reviews, incomplete
reports, mixed outputs such as `noop,submit_pull_request_review`, and every
patch remain eligible. Existing runs
[42886380382](https://github.com/microsoft/testfx/actions/runs/42886380382) and
[42886933282](https://github.com/microsoft/testfx/actions/runs/42886933282)
recorded verdicts for mixed review outputs using the same detector, CLI,
firewall, and resolved model. The guard avoids unnecessary detection; it does
not claim to repair the unproven cause of the engine stall. The failing run also
had a separate unsupported reviewer subagent model error before its no-op;
changing detection eligibility does not repair that delegation.

**What to do.** For workflows where a no-op has no downstream side effects, gate threat detection
on the presence of an actual safe output or patch:

Expand All @@ -699,7 +721,13 @@ skipped conclusion behavior.
The offline `CompiledWarningContractTests.test_pipeline_triage_detection_skips_noop_only_runs`
case checks both the authored guard and the generated job condition.
`test_pipeline_triage_noop_skip_preserves_detection_security_controls` keeps the detector
and safe-output gates intact. On November 5, 2026, the same two retained tests ran against
and safe-output gates intact. The equivalent expert-review cases are
`test_expert_review_detection_skips_noop_only_runs` and
`test_expert_review_noop_skip_preserves_detection_security_controls`; both cover
all three consumers of `shared/review-shared.md`, including the no-op's
non-publishing policy.

On November 5, 2026, the same two retained Pipeline Test Triage tests ran against
an isolated workflow archive of base `88a31ec394abe9f5c5dcf596f0a150ff998d3a0e`: the eligibility
case failed both guard assertions and the security-controls case passed (exit 1).
Both cases passed against the corrected source and regenerated lock (exit 0, no skips).
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/review-after-autofix.agent.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading