Skip to content

[Safe Outputs Conformance] WTD-002: Accept current threat-caution delegation in conformance checker - #75841

Merged
pelikhan merged 1 commit into
mainfrom
fix/conformance-wtd-002-caution-chain-0e69c1a7b965e191
Nov 8, 2026
Merged

pelikhan merged 1 commit into
mainfrom
fix/conformance-wtd-002-caution-chain-0e69c1a7b965e191

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The daily conformance run reports one HIGH finding, WTD-002. The push_to_pull_request_branch handler is compliant: its threat-warning fallback already renders the WTD1 caution and the WTD1a engine-error annotation. The checker was stale. It looked for getThreatWarningPresentation() in threat_detection_warning.cjs, a function that no longer exists, so it failed a compliant handler. This PR fixes the checker, not the handler.

Finding

  • Check ID: WTD-002 (Convertible fallback for push_to_pull_request_branch)
  • Severity: HIGH
  • Category: Specification (WTD1 / WTD2)
  • Affected file: scripts/check-safe-outputs-conformance.sh (check_wtd_convertible_fallback)

Evidence

Why the handler conforms
  • actions/setup/js/push_to_pull_request_branch.cjs takes the review path when getEffectiveDetectionConclusion(...) returns "warning". It builds the body with getDetectionWarningBlocks() and opens the review PR with pulls.create.
  • actions/setup/js/messages_run_status.cjs getDetectionWarningBlocks() selects the template by reason. threat_detected renders actions/setup/md/threat_detection_caution.md, which contains agentic threat detected and the gh-aw-threat-detected marker. Tooling failures render threat_detection_engine_error.md (WTD1a).
  • actions/setup/js/push_to_pull_request_branch.test.cjs already asserts the CAUTION label, the threat label, and the marker on the warning path, and the engine-error warning for agent_failure and parse_error. I did not run this node test here, so this bullet is existing coverage, not a result from this run.

Implementation

  • WTD-002 accepts the real delegation chain (handler → getDetectionWarningBlocks → messages_run_status.cjs → threat_detection_caution.md containing the label) in place of the nonexistent function name.
  • Added a WTD-002 fixture to scripts/check-safe-outputs-conformance_test.sh. It asserts PASS for a compliant chain and HIGH when the caution template loses the label.
  • Added WTD-002 to the real-repo no-finding guard in the same test script.

Validation

Command Before After
bash scripts/check-safe-outputs-conformance.sh CRITICAL 0, HIGH 1, MEDIUM 32, LOW 1 CRITICAL 0, HIGH 0, MEDIUM 32, LOW 1
bash scripts/check-safe-outputs-conformance_test.sh fails at the USE-001 assertion WTD-002 fixture passes; still fails at the same USE-001 assertion (pre-existing, see below)
bash -n on both scripts n/a OK
shellcheck --severity=error on both scripts clean clean

Not completed: make agent-report-progress did not finish in this sandbox. Its make build step failed because the Go 1.27.3 toolchain could not be downloaded (TLS certificate error). This diff changes no Go code, so make fmt and test-unit do not apply, but the full gate is unverified.

Not addressed

  • USE-001 (LOW): actions/setup/js/model_attribution.cjs throws Errors without an E### or ERR_ code. Fixing it means choosing codes from the E001–E010 catalog for metadata I/O paths, which is not a one-line change. The test script's USE-001 assertion therefore fails on main as well. Left for a separate change.
  • REQ-002 (MEDIUM, 32 types): incomplete spec sections across 32 safe-output types. This is documentation work, not a focused fix.

References:

  • Checker: scripts/check-safe-outputs-conformance.sh
  • Spec: WTD1, WTD1a, and WTD2 in docs/src/content/docs/specs/safe-outputs-specification.md
  • §42451626381

🤖 Generated with [Claude Code]((claude.com/redacted)

Generated by ✅ Daily Safe Outputs Conformance Checker · claude · routed: haiku55 xhigh · ~12 AIC · ⌖ ~2 AIC · ⊞ 4.9K · ◷

  • expires on Nov 8, 2026, 9:50 PM UTC-08:00

@pelikhan
pelikhan marked this pull request as ready for review November 8, 2026 06:06
Copilot AI adaptive review requested due to automatic review settings November 8, 2026 06:06
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~3 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #75841

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K · ◷

Generated by PR Specification Reviewer for #75841

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-08T06:09:00Z
review_event: REQUEST_CHANGES
top_themes: import-only heuristic accepted by conformance checker; regression fixture does not invoke helper
files_reviewed: scripts/check-safe-outputs-conformance.sh, scripts/check-safe-outputs-conformance_test.sh
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

The updated WTD-002 conformance check still accepts an import-only getDetectionWarningBlocks reference, and the added fixture encodes that false-positive case. Please require an actual invocation and make the fixture exercise the warning path (including a negative import-only case).

Static review only; repository code was not executed.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

elif grep -q "getThreatWarningPresentation" "$push_handler" 2>/dev/null; then
local threat_warning_file="actions/setup/js/threat_detection_warning.cjs"
if [ -f "$threat_warning_file" ] && grep -q "agentic threat detected" "$threat_warning_file" 2>/dev/null; then
elif grep -q "getDetectionWarningBlocks" "$push_handler" 2>/dev/null; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checker treats any import or mention of getDetectionWarningBlocks as proof that the fallback emits the caution, so a handler that only imports the helper (or leaves an unused import after removing the call) still passes WTD-002.

💡 Why this matters

The new delegation check should require an actual invocation, e.g. getDetectionWarningBlocks(, and ideally verify it is in the warning/fallback path; otherwise this conformance guard can silently accept a regression that stops publishing the required warning.


printf '> [!CAUTION]\n> threat detected\n' >actions/setup/md/threat_detection_caution.md
check_wtd_convertible_fallback >"$OUTPUT"
if ! grep -q "^HIGH: WTD-002: push_to_pull_request_branch fallback missing 'agentic threat detected' text" "$OUTPUT" || grep -q '^PASS:' "$OUTPUT"; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture imports and exports getDetectionWarningBlocks but never invokes it, so it reproduces the checker's false-positive case instead of exercising the fallback call.

💡 Make the regression test meaningful

Call getDetectionWarningBlocks(...) from the simulated warning path, then add a negative fixture that only imports the helper and assert WTD-002 reports HIGH. That will prevent the conformance test from locking in the import-only heuristic.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd. Requesting changes: the WTD-002 fix passes a handler that never calls the caution path.

📋 Key Themes & Highlights

Key Themes

  • False negative in WTD-002: the elif matches the bare name getDetectionWarningBlocks. A handler that only imports it still passes. I probed this and got PASS. Matching the call site getDetectionWarningBlocks( fixes it.
  • Fixture covers only the pass path: no negative case for the import-only shape, so the gap is untested.
  • Real-repo guard is unreachable: WTD-002 sits in the same loop as USE-001, which still fails on this branch, so the exit 1 fires first.

Positive Highlights

  • ✅ The stale getThreatWarningPresentation reference is correctly replaced with the real getDetectionWarningBlocks → threat_detection_caution.md chain. I verified that chain exists.
  • ✅ The real-repo run now reports WTD-002 as PASS with zero HIGH findings.
  • ✅ Both scripts pass bash -n and shellcheck --severity=error.
  • ✅ The negative fixture (template loses its label → HIGH) is a good addition.

Validation Notes

  • The fixture block passes. The test script still fails at the pre-existing USE-001 assertion, as the PR says.
  • Scope: the diff is 78 lines across two shell scripts. I reviewed it directly.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 5.4K
Comment /matt to run again

elif grep -q "getThreatWarningPresentation" "$push_handler" 2>/dev/null; then
local threat_warning_file="actions/setup/js/threat_detection_warning.cjs"
if [ -f "$threat_warning_file" ] && grep -q "agentic threat detected" "$threat_warning_file" 2>/dev/null; then
elif grep -q "getDetectionWarningBlocks" "$push_handler" 2>/dev/null; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] This elif matches the bare name getDetectionWarningBlocks, so a handler that only imports it still passes WTD-002. I probed this: a file with const { getDetectionWarningBlocks } = require(...) and no call returns PASS. Matching the call site fixes it. In the real handler, the import at line 35 is excluded and the call at line 1605 matches.

💡 Suggested change
elif grep -qE "getDetectionWarningBlocks\(" "$push_handler" 2>/dev/null; then

The caution template and label checks stay as they are. An import-only handler then falls through to HIGH.

@copilot please address this.

cd "$FIXTURE_ROOT"
rm -rf actions
mkdir -p actions/setup/js actions/setup/md
printf 'const { getDetectionWarningBlocks } = require("./messages_run_status.cjs");\nconst conclusion = process.env.GH_AW_DETECTION_CONCLUSION;\nawait githubClient.rest.pulls.create({});\nmodule.exports = { getDetectionWarningBlocks, conclusion };\n' >actions/setup/js/push_to_pull_request_branch.cjs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] The new fixture only covers the passing path. Its handler imports getDetectionWarningBlocks and never calls it, which is the exact shape the checker wrongly accepts. Add a negative case for that shape and assert HIGH. That would have caught the gap above.

💡 Suggested fixture

Write only the import into a fixture handler, run check_wtd_convertible_fallback, and assert the output contains HIGH: WTD-002. It should fail on the current checker and pass once the call-site regex lands.

@copilot please address this.

fi

for finding in TYPE-016 MCE-001 USE-001 USE-003; do
for finding in TYPE-016 MCE-001 USE-001 USE-003 WTD-002; do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] The real-repo WTD-002 guard never runs. USE-001 is in the same loop and is still a LOW finding on this branch, so the exit 1 fires on USE-001 before WTD-002 is checked. The script stays red, and this assertion stays dead until USE-001 is fixed.

💡 Suggested change

Check WTD-002 in its own assertion, outside this loop, so it runs even when USE-001 fails. Leave USE-001 for the separate change the PR already mentions.

@copilot please address this.

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.

🟡 Changes recommended

The conformance checks can falsely pass despite missing warning blocks or removed helper calls because they accept template references elsewhere and unused imports.

1 open issue
What changed in this PR

This PR updates gh-aw’s WTD-002 conformance checker to recognize the current threat-warning delegation path without changing the safe-output handler.

Changes:

  • Replaces the stale helper reference with checks for getDetectionWarningBlocks and its caution template.
  • Adds compliant-chain and missing-label fixtures, plus a real-repository WTD-002 regression guard.
File Description
scripts/​check-safe-outputs-conformance.sh Updates delegation evidence used by WTD-002.
scripts/​check-safe-outputs-conformance_test.sh Adds WTD-002 fixtures and a no-finding guard.

Review effort: Max (auto)

elif grep -q "getDetectionWarningBlocks" "$push_handler" 2>/dev/null; then
local threat_status_file="actions/setup/js/messages_run_status.cjs"
local threat_caution_template="actions/setup/md/threat_detection_caution.md"
if [ -f "$threat_status_file" ] && grep -q "threat_detection_caution.md" "$threat_status_file" 2>/dev/null &&
@pelikhan
pelikhan merged commit 60f2e2b into main Nov 8, 2026
91 checks passed
@pelikhan
pelikhan deleted the fix/conformance-wtd-002-caution-chain-0e69c1a7b965e191 branch November 8, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants