PDX-518: fix(mcp): read UiWithScreen target from uri attribute#230
Merged
Conversation
RCA: UI-SCREEN-TARGET-001 read the screen target only from element #text, but real Provar IDE test cases store it in the uri= attribute of <value class="uiTarget" uri="..."/>, so the rule never fired on IDE-authored test cases. Fix: validateUiWithScreenTarget now reads via the attribute-aware getUiWithScreenTargetUri reader (uri= first, #text fallback) and the dead #text-only getUiWithScreenTarget helper is deleted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Quality Orchestrator🟢 LOW · 🧪 Tests to Run · Running 1 of 57 tests
▶ Run commandnpx vitest run \
unit/mcp/bestPracticesEngine.test.ts⚡ quality-orchestrator · |
RCA: Activating the attribute reader exposed VALID_SF_UI_PARAMS as incomplete — real CPQ/Billing IDE targets like sf:ui:target?page=SBQQ__sb&pageObject=pageobjects.EditQuote carry no whitelisted key, so UI-SCREEN-TARGET-001 false-fired on 6/133 (4.5%) corpus files once it could see uri= targets. Fix: Corpus-surveyed the real sf:ui:target param keys and added every legitimate one (page, pageObject, flexiPage, flexiPath, recordType, listView, quickAction, relatedList, noOverride); re-scan now reports 0/133 false positives while foo=bar still fires. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UI-SCREEN-TARGET-001(validateUiWithScreenTargetinsrc/mcp/tools/bestPracticesEngine.ts) read the UiWithScreen screen target only from the element#text. Real Provar IDE test cases store the target in theuri=attribute of<value class="uiTarget" uri="sf:ui:target?object=...&action=..."/>, not in#text. As a result the rule effectively never fired on IDE-authored test cases — it only saw a target on hand-authored#textXML.The fix switches the rule to the attribute-aware reader
getUiWithScreenTargetUri(added by PDX-516), which reads theuri=attribute first and falls back to#textfor hand-authored XML. The now-unused#text-onlygetUiWithScreenTargethelper (its only caller was this rule) is deleted, consolidating to a single reader.Jira
https://provartesting.atlassian.net/browse/PDX-518
Changes
src/mcp/tools/bestPracticesEngine.tsvalidateUiWithScreenTargetnow reads the target viagetUiWithScreenTargetUri(call)(attribute-aware:uri=first,#textfallback) instead of the#text-onlygetUiWithScreenTarget(call).getUiWithScreenTargethelper — confirmed it had no other callers.test/unit/mcp/bestPracticesEngine.test.ts<value class="uiTarget" uri="..."/>attribute form: a VALID sf target (object/action) does NOT fire; an sf target with no recognised params FIRES; a page-object target with a badpageIdprefix FIRES.#text-form tests remain green (the fallback still works).Verification
objectandactionare both inVALID_SF_UI_PARAMS, so a valid real target (sf:ui:target?object=Opportunity&action=New&noOverride=true) produces NO violation.OpportunityCreationByClaude.testcase, which carriesuri=-attribute targets (...?object=Opportunity&action=ObjectHome,...&action=New&noOverride=true,...&action=View&...): 0 UI-SCREEN-TARGET-001 violations — the rule now SEES the attribute targets and does NOT over-fire on valid ones.test/fixtures/*.testcasestarted firing UI-SCREEN-TARGET-001 from enabling the attribute reader.Test plan
yarn compile— cleannode_modules/.bin/nyc node_modules/.bin/mocha "test/**/*.test.ts"— 1510 passing, 1 pendingnode scripts/mcp-smoke.cjs— 30 deterministic tools PASS; only the knownprovar_automation_*/provar_testrun_*env-timeout flakes vary between runs (smoke spawns the globally-installed package, not this build)yarn lint— cleanCustomer-facing validator-behaviour note
This makes a previously-dormant rule actually fire on IDE-authored test cases.
UI-SCREEN-TARGET-001now validates theuri=attribute targets that the Provar IDE writes, where before it only validated hand-authored#texttargets. Valid IDE targets are unaffected (no new false positives — verified against a real Opportunity creation test case), but malformed IDE-authored targets that were previously invisible to the rule will now be flagged. Flagging this so the Provar team can update external docs (docs/provar-mcp-public-docs.md,docs/university-of-provar-mcp-course.md) if needed. No internaldocs/mcp.mdchange was required — that file does not describe this rule's target-reading internals.🤖 Generated with Claude Code