Skip to content

[AI Datamapper] Improve Repair Workflow in AI Data Mapper to Avoid Directory-Wide Diagnostics #2018

@VellummyilumVinoth

Description

@VellummyilumVinoth

Description:
The current repairing workflow in the AI Data Mapper is incomplete and can result in invalid mappings. The main issue is that the workflow runs diagnostics on the entire project directory and sends all code to the LLM for repair, which may introduce hallucinations or unnecessary errors.

Current Workflow (Old Approach):

  1. Generate mappings and update the source code in a temporary directory.
  2. Run project diagnostics.
  3. Apply programmatic fixes such as addMissingImports, removeUnusedImports, addMissingRequiredFields. Run diagnostics again.
  4. Send all diagnostics from the entire directory and code to the LLM for repair. After repair, handle check expression errors programmatically. Then, check project diagnostics again and remove error field mappings or assign default values.

Problem:

  • Running checkProjectDiagnostics for the entire directory is unnecessary.
  • Sending the whole directory to the LLM may introduce hallucinated errors or unintended changes.

Proposed Improved Workflow (New Repair Workflow):

  1. Generate mappings and update the source code in a temporary directory.
  2. Get the DM model for the new mapping function and extract diagnostics for each mapping. Send only these diagnostics along with the DM model to the LLM for repair.
  3. This ensures the LLM has all the necessary context without extra code that may cause hallucinations.
  4. After repair, check diagnostics for the mapping.
  5. If there are errors, remove the faulty mappings, repair them, and ensure the final code is compilable.

Metadata

Metadata

Labels

Area/AIIssues related to general AI features, except AI ArtifactsArea/DataMapperArtifacts: Datamapper and inline data mapperType/Bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions