Add Validation for AI generated component after editing task.

Created on 13 August 2025, about 1 month ago

Overview

XB AI: Validate AI generated Components before adding to XB 📌 Allow AI to validate changes before publishing Active adds validation after creating component/page. It would be good to add validation after we edit the components as well.

Proposed resolution

User interface changes

📌 Task
Status

Active

Version

1.0

Component

AI

Created by

🇮🇳India utkarsh_33

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @utkarsh_33
  • Pipeline finished with Failed
    27 days ago
    Total: 899s
    #575290
  • Pipeline finished with Failed
    26 days ago
    Total: 1134s
    #576073
  • Pipeline finished with Failed
    26 days ago
    Total: 788s
    #576134
  • Pipeline finished with Failed
    26 days ago
    Total: 1117s
    #576140
  • Pipeline finished with Running
    26 days ago
    #576172
  • 🇮🇳India utkarsh_33

    I made the following changes in PropsSchema.json :-

    {
        "name": "Image with example value",
        "type": "object",
        "$ref": "json-schema-definitions://experience_builder.module/image",
        "example": {
          "width": "1200",
          "height": "900",
          "alt": "Example image placeholder"
        },
        "id": "4ea2a14d-7828-467c-a505-063f006f1ebf",
        "derivedType": "image"
      },
    

    use this image prop instead of the existing image prop to feed the wrong example to the AI about the prop structure so that it produces wrong props.

    Now on any already existing component use a prompt which says

    Add a image prop to the component

    .
    Adding a debugger on line $violations = JavaScriptComponent::createFromClientSide($output)->getTypedData()->validate(); in

    EditComponentJs

    then you can see validation errors. After proceeding further with the validation errors you can see the correct props structure being generated by AI and no errors occur after that and a valid structure is generated.

    Marking this NR for an initial round of review.

  • Pipeline finished with Failed
    26 days ago
    Total: 1094s
    #576175
  • Pipeline finished with Failed
    26 days ago
    #576313
  • 🇮🇳India narendraR Jaipur, India

    Tested it manually as suggested in #3 📌 Add Validation for AI generated component after editing task. Active and it is working as expected. Moving it to NW for one minor change and one explaination.

  • Pipeline finished with Success
    24 days ago
    Total: 1208s
    #577936
  • Pipeline finished with Failed
    24 days ago
    Total: 1104s
    #578005
  • 🇮🇳India utkarsh_33

    This is ready for review.

  • Pipeline finished with Success
    24 days ago
    Total: 744s
    #578113
  • 🇮🇳India narendraR Jaipur, India

    Tested it couple of times and it is creating new component once and unable to determine the selected component. See attached SS.

  • 🇮🇳India utkarsh_33

    Modified the prompt and tested it manually. It works as expected. Marking it NR again.

  • Pipeline finished with Canceled
    20 days ago
    Total: 671s
    #580803
  • Pipeline finished with Success
    20 days ago
    Total: 5829s
    #580812
  • 🇮🇳India narendraR Jaipur, India

    Tested manually and it is working as expected. Validation errors are logged and proper structure is generated. Moving it to RTBC.

  • Pipeline finished with Canceled
    20 days ago
    Total: 1073s
    #581313
  • Pipeline finished with Failed
    20 days ago
    Total: 503s
    #581334
  • First commit to issue fork.
  • Pipeline finished with Skipped
    20 days ago
    #581339
  • Pipeline finished with Skipped
    20 days ago
    #581341
  • 🇳🇱Netherlands balintbrews Amsterdam, NL
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024