Skip to content

fix: pass accessible tables to validator node, and reduce verify checklist node's reasoning #11

Merged
akshatdubeysf merged 1 commit intomainfrom
issues-fix
Mar 30, 2026
Merged

fix: pass accessible tables to validator node, and reduce verify checklist node's reasoning #11
akshatdubeysf merged 1 commit intomainfrom
issues-fix

Conversation

@sf-sahil-jassal
Copy link
Copy Markdown
Contributor

Description

This pull request introduces several improvements and refactors to the database query validation nodes, focusing on enhancing semantic validation accuracy, permission handling, and test coverage. The most significant changes include integrating table search and permission filtering into the SemanticValidatorNode, updating unit tests to cover these behaviors, and making minor adjustments to checklist verification and configuration.

Semantic Validator Enhancements:

  • The SemanticValidatorNode now uses the TableSearchService to dynamically retrieve accessible tables based on the user's prompt and filters them by permissions using the PermissionHelper. This ensures that only tables the user can access are considered during validation. [1] [2] [3] [4]

Testing Improvements:

  • Unit tests for SemanticValidatorNode have been updated and expanded to mock the TableSearchService and verify that accessible tables are correctly passed to the LLM prompt, ensuring missing tables can be flagged. [1] [2] [3]

Checklist Verification Adjustments:

  • The checklist verification node now checks the correct configuration flag (verifyChecklistNode.enabled) and clarifies prompt instructions to require only the result tag in responses, with no explanation or analysis. [1] [2] [3]

Configuration and Dependency Updates:

  • Added a new optional enabled property to the verifyChecklistNode configuration for finer control.
  • Added @loopback/sequelize as a dependency in package.json.

Code Organization:

  • Reordered exports in models/index.ts for consistency.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

@akshatdubeysf
Copy link
Copy Markdown
Collaborator

tests

@akshatdubeysf
Copy link
Copy Markdown
Collaborator

and why is sequelize added as dep?

@sf-sahil-jassal
Copy link
Copy Markdown
Contributor Author

and why is sequelize added as dep?

removed sir

@sf-sahil-jassal
Copy link
Copy Markdown
Contributor Author

tests

fixed sir

…utput

pass all tables to semantic-validator node

issues-fix
@sonarqubecloud
Copy link
Copy Markdown

SonarQube reviewer guide

Summary: Bump to version 2.0.0 with dependency cleanup and semantic validator enhancement to support table search functionality.

Review Focus:

  • The semantic validator node now integrates TableSearchService to dynamically fetch accessible tables instead of relying solely on schema. Pay close attention to the _filterByPermissions() method logic and how tableSearchService.getTables() is invoked with the user prompt.
  • Dependency removals (MongoDB, AWS crypto utilities, Smithy protocol packages) are significant—verify these aren't used elsewhere in the codebase.
  • Minor test additions and prompt instruction refinements in verify-checklist node.

Start review at: src/components/db-query/nodes/semantic-validator.node.ts. This is the core logic change where table discovery now happens dynamically via service injection rather than static schema inspection, fundamentally changing how the LLM validates queries against available tables.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@akshatdubeysf akshatdubeysf merged commit 112781f into main Mar 30, 2026
3 checks passed
@yeshamavani
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants