Repository navigation
fix(workflow): avoid prompt tool scanner false positives - #71813
Conversation
Avoid treating parenthesized prose and nested Markdown artifact examples as required tools while preserving explicit invocations and shell tasks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ 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 Code Quality Reviewer completed the code quality review.
|
|
✅ 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.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Commit pushed:
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
🏗️ Design Decision Gate — ADR RequiredThis PR adds 105 new lines under 📄 Draft ADR committed: The draft records the decision to match qualified tool references (
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and check that the implementation matches the decision. ❓ Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors, and your future self, can find the reasoning behind a design. 📋 Michael Nygard ADR Format Reference
All ADRs are stored in
|
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: non-blocking issue
The scanner improvements are generally focused, but the anchored qualified-tool matcher still misclassifies leading or comma-separated prose plurals such as file(s) and workflow(s). I left one inline comment with the regression cases to cover.
Details
- One medium-severity false-positive risk remains in the exact problem area this change is intended to address.
- No blocking correctness, concurrency, or security issue was established from the changed lines.
- The specialist pass completed; its additional fence concern conflicts with the intentional nested-fence behavior covered by the new tests and was not retained.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (confirmed via pr-triage) — requesting changes on a reproducible regression in the new list-separator parsing.
📋 Key Themes & Highlights
Key Themes
- Reintroduced false positive: The new
promptToolListSeparatorloop inpromptQualifiedRequirementsfixes the targetedfile(s)/workflow(s)cases when they trail a single qualified tool, but reintroduces a spurious match when such prose follows a comma/conjunction inside a multi-tool list (e.g."Use github(issue_read), workflow(s) to update."→ incorrectly reports{server: workflow, tool: s}). Verified by direct repro againstpromptToolRequirements. - Minor robustness gap:
markdownFencedetection for the new nested-fence tracking only matches lowercasemarkdown/mdinfo strings; mixed-case fences (```Markdown) won't engage the nested-fence guard. Low risk but worth normalizing and covering with a test.
Positive Highlights
- ✅ Anchoring
promptQualifiedToolto the start oftargetis a clean, well-targeted fix for the original prose false positives (file(s),workflow(s)trailing a single tool reference). - ✅
isClosingCodeFencereuse plus the newnestedFencestate cleanly handles same-length nested fences in Markdown output templates — verified against the Dockerfile/artifact scenarios in the PR description. - ✅ Strong regression test coverage for the original bug reports, including long/tilde fence variants and multi-tool qualified lists.
- ✅ All existing
TestPromptTool*tests still pass; scope is well-contained to the scanner module.
See inline comments for the reproducible regression and the suggested fix/test. Everything else in this PR looks solid — happy to re-review once the list-separator edge case is addressed.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~79 AIC · ⌖ ~16 AIC · ⊞ 10.2K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Targeted checks confirmed scanner regressions that can suppress required-tool warnings and misclassify template content.
2 open issues
What changed in this PR
This PR refines gh-aw’s advisory prompt-tool scanner to reduce false warnings from parenthesized prose and fenced output examples, without changing tool permissions or transport checks.
Changes:
- Restrict qualified MCP tool detection to invocation targets and explicit lists.
- Track full fence delimiters, valid closing fences, and nested Markdown examples.
- Add focused regression tests and document the design trade-offs.
| File | Description |
|---|---|
pkg/workflow/prompt_tool_validation.go |
Refines tool-reference matching and fence-state tracking. |
pkg/workflow/prompt_tool_validation_test.go |
Adds coverage for prose, tool lists, and artifact examples. |
docs/adr/71813-anchor-prompt-tool-scanning-to-invocation-positions.md |
Records the scanner design, alternatives, and limitations. |
Review effort: Max
Stop qualified tool lists at ambiguous plural prose, recognize mixed-case Markdown templates, add regressions, and complete the scanner ADR. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Acknowledged the Ponytail Reviewer completion. This status notice requests no independent code change; the actionable scanner feedback is addressed separately, with focused regression coverage. |
|
Acknowledged the code-quality review completion. I accepted its associated inline finding and fixed leading and comma-separated plural prose with regression tests. |
|
Acknowledged the Test Quality Sentinel completion. The notice itself needs no implementation change; this batch adds regressions for plural-list boundaries and mixed-case Markdown templates. |
|
Acknowledged the generated ADR commit. I reviewed and completed that existing record rather than creating another ADR, and linked it in the PR description. |
|
Accepted the actionable findings associated with the skills-review completion. Both the plural-list regression and mixed-case Markdown handling are fixed and covered by focused tests. |
|
Accepted the ADR follow-up. I completed the existing record, removed verification placeholders without inventing parser experiments or reviewer acceptance, documented the additional plural/casing decisions, and linked the ADR in the PR body; its status remains Draft pending reviewer acceptance. |
|
The theme in the managed review-memory comment is addressed by the plural-prose and list-boundary fix with regressions. I left the managed memory block and workflow metadata unchanged. |
Recognize uppercase conjunctions without changing tool-name casing and track nested examples in all non-executable fences. Add regressions for denied alternatives and the cited workflow templates, and align the ADR. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
No additional change is required by this Ponytail completion notice. The new batch addresses the two separate actionable scanner findings. |
|
The code-quality review notice is already addressed by the plural-prose fix from the previous batch. No duplicate implementation is needed. |
|
This test-analysis completion notice adds no new requested change. The current batch adds focused coverage for uppercase tool alternatives and non-Markdown output templates. |
|
The generated ADR notice remains satisfied by the completed existing record and its PR-body link. No second ADR is needed. |
|
The findings associated with this skills-review notice were fixed in the previous batch. The new fixes preserve the plural boundary and mixed-case template regressions. |
|
This ADR request is already satisfied: the existing record has no verification placeholders and is linked in the PR body. I updated its scanner decision for the current batch without claiming reviewer acceptance. |
|
For this comment: No code change is needed: this is a completion notice or an acknowledgment of that notice, not a new defect report. The actionable scanner findings were handled separately. |
|
For this comment: No code change is needed: this is a completion notice or an acknowledgment of that notice, not a new defect report. The actionable scanner findings were handled separately. |
|
For this comment: No code change is needed: this is a completion notice or an acknowledgment of that notice, not a new defect report. The actionable scanner findings were handled separately. |
|
For this comment: Already addressed: the associated plural-prose and tool-list finding was fixed with regression coverage. This completion notice or acknowledgment adds no new implementation request. |
|
For this comment: Already addressed: the associated plural-prose and tool-list finding was fixed with regression coverage. This completion notice or acknowledgment adds no new implementation request. |
|
For this comment: Already addressed: the associated plural-prose and tool-list finding was fixed with regression coverage. This completion notice or acknowledgment adds no new implementation request. |
|
For this comment: Already addressed: the associated plural-prose and tool-list finding was fixed with regression coverage. This completion notice or acknowledgment adds no new implementation request. |
|
For this comment: No additional change is needed for this test-review notice or its acknowledgment. The reported scanner edge cases already have focused regression coverage. |
|
For this comment: No additional change is needed for this test-review notice or its acknowledgment. The reported scanner edge cases already have focused regression coverage. |
|
For this comment: No additional change is needed for this test-review notice or its acknowledgment. The reported scanner edge cases already have focused regression coverage. |
|
For this comment: No additional change is needed for this test-review notice or its acknowledgment. The reported scanner edge cases already have focused regression coverage. |
|
For this comment: Already satisfied: the generated ADR was completed in place and linked in the PR description. This notice or acknowledgment does not require another ADR or commit. |
|
For this comment: Already satisfied: the generated ADR was completed in place and linked in the PR description. This notice or acknowledgment does not require another ADR or commit. |
|
For this comment: Already satisfied: the generated ADR was completed in place and linked in the PR description. This notice or acknowledgment does not require another ADR or commit. |
|
For this comment: Already satisfied: the generated ADR was completed in place and linked in the PR description. This notice or acknowledgment does not require another ADR or commit. |
|
For this comment: Already addressed: the skills review's plural-list and template-casing findings were fixed and covered by tests. This completion notice or acknowledgment contains no new requested change. |
|
For this comment: Already addressed: the skills review's plural-list and template-casing findings were fixed and covered by tests. This completion notice or acknowledgment contains no new requested change. |
|
For this comment: Already addressed: the skills review's plural-list and template-casing findings were fixed and covered by tests. This completion notice or acknowledgment contains no new requested change. |
|
For this comment: Already addressed: the skills review's plural-list and template-casing findings were fixed and covered by tests. This completion notice or acknowledgment contains no new requested change. |
|
For this comment: Already satisfied: ADR-71813 has no verification placeholders, records the current scanner decisions, and is linked in the PR body. It remains Draft pending reviewer acceptance; no duplicate record or acceptance claim is warranted. |
|
For this comment: Already satisfied: ADR-71813 has no verification placeholders, records the current scanner decisions, and is linked in the PR body. It remains Draft pending reviewer acceptance; no duplicate record or acceptance claim is warranted. |
|
For this comment: Already satisfied: ADR-71813 has no verification placeholders, records the current scanner decisions, and is linked in the PR body. It remains Draft pending reviewer acceptance; no duplicate record or acceptance claim is warranted. |
|
For this comment: Already satisfied: ADR-71813 has no verification placeholders, records the current scanner decisions, and is linked in the PR body. It remains Draft pending reviewer acceptance; no duplicate record or acceptance claim is warranted. |
|
For this comment: Already addressed: plural prose is excluded from qualified-tool lists with regression coverage. The managed review-memory block and workflow metadata remain unchanged. |
|
For this comment: Already addressed: plural prose is excluded from qualified-tool lists with regression coverage. The managed review-memory block and workflow metadata remain unchanged. |
|
For this comment: Already addressed: plural prose is excluded from qualified-tool lists with regression coverage. The managed review-memory block and workflow metadata remain unchanged. |
|
For this comment: Already addressed: plural prose is excluded from qualified-tool lists with regression coverage. The managed review-memory block and workflow metadata remain unchanged. |
|
🎉 This pull request is included in a new release. Release: |

Why
The prompt-tool scanner mistakes parenthesized prose such as
file(s)andworkflow(s)for MCP calls, and scans Dockerfile output examples as shell instructions. This produces six confirmed false-positive warnings across three workflows.Approach
(s)pluralization, including leading and comma-separated prose; explicitmcp__server__sremains supported.Tool permissions and configured transport checks are unchanged. This does not change checkout exemptions, template rendering, or other warning clusters.
ADR: ADR-71813: Anchor Prompt Tool Scanning to Invocation Positions
Validation
go test ./pkg/workflow -run '^TestPromptTool' -count=1passed, including the review regressions and existing shell restriction and native/MCP transport checks.make fmtpassed.make agent-report-progresspassed standard Go lint (zero issues), change-scoped custom lint, schema freshness, and impacted Go tests.--no-emit: all succeeded and all six prompt-tool warnings disappeared; unrelated checkout warnings remain.