Skip to content

fix: stop /codegen RECORD false-rejecting SHAFT-compliant work - #5409

Merged
MohabMohie merged 7 commits into
mainfrom
ChaosEngine/codegen-shaft-syntax-gate
Aug 26, 2026
Merged

fix: stop /codegen RECORD false-rejecting SHAFT-compliant work#5409
MohabMohie merged 7 commits into
mainfrom
ChaosEngine/codegen-shaft-syntax-gate

Conversation

@MohabMohie

@MohabMohie MohabMohie commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Related to #5408.

Closes #5410.
Closes #5416.
Closes #5419.
Closes #5412.

Summary

IntelliJ /codegen RECORD transcripts that dumped locator-design guidance were shown as Generated code rejected. This PR:

  • Rejects native Selenium only on real calls (driver.get, findElement, ChromeDriver, SHAFT.GUI.Locator.xpath(), not playbook never/avoid/do-not sentences.
  • Aligns AutoBot RECORD/GENERATE prompts, MCP guidance, pick-locator snippets, and locator/page-object playbooks on the three-tier SHAFT locator policy.
  • Parses [data-testid] / [data-qa] pick-locator selectors instead of stuffing the whole selector into data-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 — valid
  • python3 -m unittest tests.scripts.test_shaft_skills_content tests.scripts.test_shaft_skill_quality — OK
  • mvn -pl shaft-capture,shaft-mcp -Dtest=GeneratedCodeGuardrailsTest,LocatorPolicyTest,LocatorRankerTest,PickedLocatorSnippetBuilderTest,TestAutomationServiceTest,CaptureGeneratorTest,CaptureServiceApiToolsTest — BUILD SUCCESS
  • Plugin tests on JBR 21: AssistantMarkdownTest, AssistantCodegenWorkflowCoordinatorTest, targeted ShaftPanelSetupTest, ShaftAssistantPanelToolCardTest — BUILD SUCCESS
  • Codex gpt-5.6-sol medium: two rounds; remaining P2 filed as Make pick-locator snippets quote-safe and CSS-escape-safe #5411

Continuation

Draft until CI is green and owner authorizes merge (#5417). Full spec on #5408.

Start the /codegen RECORD false-reject and locator-policy alignment work.
@codacy-production

codacy-production Bot commented Aug 26, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 29 complexity · 0 duplication

Metric Results
Complexity 29
Duplication 0

View in Codacy

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.
@MohabMohie

Copy link
Copy Markdown
Contributor Author

Tracking rewrite: #5408 is now the parent tracker. This PR closes #5410, #5416, #5419, and #5412 only. Remaining children: #5411, #5415, #5417.

@MohabMohie MohabMohie changed the title fix: stop /codegen RECORD false-rejecting SHAFT-compliant work (#5408) fix: stop /codegen RECORD false-rejecting SHAFT-compliant work Aug 26, 2026
@MohabMohie
MohabMohie marked this pull request as ready for review August 26, 2026 17:02
@MohabMohie
MohabMohie marked this pull request as draft August 26, 2026 17:07
@MohabMohie
MohabMohie marked this pull request as ready for review August 26, 2026 17:09
@MohabMohie MohabMohie added the bug Something isn't working label Aug 26, 2026
@MohabMohie MohabMohie added bug Something isn't working and removed bug Something isn't working labels Aug 26, 2026
@MohabMohie
MohabMohie merged commit a07f532 into main Aug 26, 2026
60 of 81 checks passed
@MohabMohie
MohabMohie deleted the ChaosEngine/codegen-shaft-syntax-gate branch August 26, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

1 participant