Skip to content

Add support for LintQ as validator - #2

Merged
GiulioZizzo merged 2 commits into
IBM:mainfrom
gretadolcetti:main
Oct 20, 2026
Merged

GiulioZizzo merged 2 commits into
IBM:mainfrom
gretadolcetti:main

Conversation

@gretadolcetti

Copy link
Copy Markdown
Contributor

This pull request introduces a new LintQ-based validation workflow for Qiskit code generation, integrating correctness and linting checks into the Mellea orchestration pipeline. It adds a new ValidatorLintQ class, and provides a runnable example and documentation.

LintQ Validation Integration

  • Added ValidatorLintQ in src/codehelm/validator/validator_lintq.py, which wraps a correctness validator (defaulting to ValidatorExec) and runs LintQ only if the code passes the tests. It writes per-sample results and a summary, and includes a helper to run LintQ via CodeQL.
  • Created a runnable example in examples/mellea_lintq/ with a README.md, config.yaml, and run.py to demonstrate end-to-end usage of the new validator with Qiskit HumanEval and Ollama.

Orchestration

  • Updated src/codehelm/orchestration/mellea.py to support the new validator and repair strategy.

Execution Validator Improvements

  • Improved ValidatorExec in src/codehelm/validator/validator_exec.py to better handle timeouts on non-main threads (such as those used by Mellea), ensuring a more robust timeout behavior.

Testing

  • Added 9 tests (offline and online) in tests/test_lintq.py.

Suggested pipeline to test the PR

  • Follow examples/mellea_lintq/README.md to clone and install codeql and LintQ, install the model, export LINTQ_DIR and then run python examples/mellea_lintq/run.py from the source dir.
  • After exporting LINTQ_DIR, MODEL_ID and API_BASE (to test litellm) run pytest tests/test_lintq.py.

@GiulioZizzo

Copy link
Copy Markdown
Member

Hi Greta - thanks for the PR. Looks good to me!

@GiulioZizzo
GiulioZizzo merged commit ed19f17 into IBM:main Oct 20, 2026
1 check passed
gretadolcetti added a commit to gretadolcetti/gretadolcetti.github.io that referenced this pull request Oct 28, 2026
- Projects: test-suite validation for the Qiskit IVR example in Mellea (generative-computing/mellea#1716) and the LintQ validator for CodeHelm (IBM/codehelm#2)
- Theme toggle next to the contact icons; the choice is saved and applied before first paint, otherwise the site follows the system theme

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants