Repository navigation
[Safe Outputs Conformance] WTD-002: Accept current threat-caution delegation in conformance checker - #75841
Conversation
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ 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: 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.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: 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.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: 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.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
elifmatches the bare namegetDetectionWarningBlocks. A handler that only imports it still passes. I probed this and got PASS. Matching the call sitegetDetectionWarningBlocks(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 1fires first.
Positive Highlights
- ✅ The stale
getThreatWarningPresentationreference is correctly replaced with the realgetDetectionWarningBlocks→threat_detection_caution.mdchain. I verified that chain exists. - ✅ The real-repo run now reports WTD-002 as PASS with zero HIGH findings.
- ✅ Both scripts pass
bash -nandshellcheck --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 |
There was a problem hiding this comment.
[/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; thenThe 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 |
There was a problem hiding this comment.
[/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 |
There was a problem hiding this comment.
[/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.
There was a problem hiding this comment.
🟡 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
getDetectionWarningBlocksand 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 && |
|
🎉 This pull request is included in a new release. Release: |

Summary
The daily conformance run reports one HIGH finding, WTD-002. The
push_to_pull_request_branchhandler is compliant: its threat-warning fallback already renders the WTD1 caution and the WTD1a engine-error annotation. The checker was stale. It looked forgetThreatWarningPresentation()inthreat_detection_warning.cjs, a function that no longer exists, so it failed a compliant handler. This PR fixes the checker, not the handler.Finding
push_to_pull_request_branch)scripts/check-safe-outputs-conformance.sh(check_wtd_convertible_fallback)Evidence
Why the handler conforms
actions/setup/js/push_to_pull_request_branch.cjstakes the review path whengetEffectiveDetectionConclusion(...)returns"warning". It builds the body withgetDetectionWarningBlocks()and opens the review PR withpulls.create.actions/setup/js/messages_run_status.cjsgetDetectionWarningBlocks()selects the template by reason.threat_detectedrendersactions/setup/md/threat_detection_caution.md, which containsagentic threat detectedand thegh-aw-threat-detectedmarker. Tooling failures renderthreat_detection_engine_error.md(WTD1a).actions/setup/js/push_to_pull_request_branch.test.cjsalready asserts the CAUTION label, the threat label, and the marker on the warning path, and the engine-error warning foragent_failureandparse_error. I did not run this node test here, so this bullet is existing coverage, not a result from this run.Implementation
getDetectionWarningBlocks→messages_run_status.cjs→threat_detection_caution.mdcontaining the label) in place of the nonexistent function name.scripts/check-safe-outputs-conformance_test.sh. It asserts PASS for a compliant chain and HIGH when the caution template loses the label.Validation
bash scripts/check-safe-outputs-conformance.shbash scripts/check-safe-outputs-conformance_test.shbash -non both scriptsshellcheck --severity=erroron both scriptsNot completed:
make agent-report-progressdid not finish in this sandbox. Itsmake buildstep failed because the Go 1.27.3 toolchain could not be downloaded (TLS certificate error). This diff changes no Go code, somake fmtandtest-unitdo not apply, but the full gate is unverified.Not addressed
actions/setup/js/model_attribution.cjsthrowsErrors 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.References:
scripts/check-safe-outputs-conformance.shdocs/src/content/docs/specs/safe-outputs-specification.md🤖 Generated with [Claude Code]((claude.com/redacted)