fix: stop /codegen RECORD false-rejecting SHAFT-compliant work - #5409
Merged
Conversation
Start the /codegen RECORD false-reject and locator-policy alignment work.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 29 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Closes #5408. Reject native Selenium only in extracted Java fences and codeBlocks, not RECORD transcripts that quote the banned xpath factory. Align AutoBot prompts, MCP guidance, pick-locator snippets, and locator/page-object playbooks on the three-tier SHAFT locator builder.
Address Codex review of #5408: parse [data-testid]/[data-qa] pick-locator expressions, reject unlabeled and preamble Java that actually calls driver.get/findElement, and still ignore RECORD playbook prohibitions.
Treat driver.findElement/ChromeDriver the same as the xpath factory: reject executable calls, keep playbook sentences that say avoid/never/do not.
This was referenced Aug 26, 2026
Contributor
Author
7 tasks
MohabMohie
marked this pull request as ready for review
August 26, 2026 17:02
MohabMohie
marked this pull request as draft
August 26, 2026 17:07
MohabMohie
marked this pull request as ready for review
August 26, 2026 17:09
3 tasks
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.
Related to #5408.
Closes #5410.
Closes #5416.
Closes #5419.
Closes #5412.
Summary
IntelliJ
/codegenRECORD transcripts that dumped locator-design guidance were shown as Generated code rejected. This PR:driver.get,findElement,ChromeDriver,SHAFT.GUI.Locator.xpath(), not playbook never/avoid/do-not sentences.[data-testid]/[data-qa]pick-locator selectors instead of stuffing the whole selector intodata-testid.Not in this PR: #5411 (quote/CSS-escape safety), #5415 (live IDE replay), #5417 (merge babysit).
Checks
py -3 scripts/ci/validate_agent_setup.py --skip-external— validpython3 -m unittest tests.scripts.test_shaft_skills_content tests.scripts.test_shaft_skill_quality— OKmvn -pl shaft-capture,shaft-mcp -Dtest=GeneratedCodeGuardrailsTest,LocatorPolicyTest,LocatorRankerTest,PickedLocatorSnippetBuilderTest,TestAutomationServiceTest,CaptureGeneratorTest,CaptureServiceApiToolsTest— BUILD SUCCESSAssistantMarkdownTest,AssistantCodegenWorkflowCoordinatorTest, targetedShaftPanelSetupTest,ShaftAssistantPanelToolCardTest— BUILD SUCCESSgpt-5.6-solmedium: two rounds; remaining P2 filed as Make pick-locator snippets quote-safe and CSS-escape-safe #5411Continuation
Draft until CI is green and owner authorizes merge (#5417). Full spec on #5408.