Skip to content

feat: add search space validation step for fail-fast on misconfiguration - #124

Merged
jakub-walaszczyk merged 6 commits into
release/0.11from
feat/add-search-space-validation-0.11
Aug 6, 2026
Merged

feat: add search space validation step for fail-fast on misconfiguration#124
jakub-walaszczyk merged 6 commits into
release/0.11from
feat/add-search-space-validation-0.11

Conversation

@MRGuziX

@MRGuziX MRGuziX commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds validate_model_list() to ai4rag/utils/validators.py as a shared validation function
  • Refactors prepare_search_space_report() to accept optional pre_validated_search_space parameter — when provided, skips redundant OGX validation calls
  • Backward compatible: existing callers without the parameter behave identically

Backport of #122 to release/0.11.

Test plan

  • All 16 unit tests pass (test_search_space_prep.py)
  • Full unit suite passes with no regressions
  • New tests verify: shared validator identity, OGX call skipped, provided search space used, documents still loaded

🤖 Generated with Claude Code

MRGuziX added 3 commits August 6, 2026 11:46
3 files modified:
  1. ai4rag/utils/validators.py — added validate_model_list() function (moved from search_space_preparation.py)
  2. ai4rag/components/optimization/search_space_preparation.py —
    - Imports validate_model_list from shared location + AI4RAGSearchSpace
    - Adds _validate_model_list = validate_model_list alias for backward compat
    - Adds pre_validated_search_space: AI4RAGSearchSpace | None = None parameter to prepare_search_space_report()
    - When provided: skips model validation, payload construction, and prepare_search_space_with_ogx() call
    - When None: existing behavior unchanged
  3. tests/unit/ai4rag/components/optimization/test_search_space_prep.py —
    - Added TestValidateModelListShared (verifies alias identity)
    - Added TestPrepareSearchSpaceReportPreValidated with 3 tests: skips OGX call, uses provided search space, still loads documents

Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
@MRGuziX

MRGuziX commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author
image This will be addressed soon

Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
Comment thread ai4rag/components/optimization/search_space_preparation.py
Comment thread tests/unit/ai4rag/core/hpo/test_gam_opt.py Outdated
MRGuziX added 2 commits August 6, 2026 12:47
Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
Signed-off-by: Tomasz Guzik <tguzik@redhat.com>
@jakub-walaszczyk
jakub-walaszczyk merged commit 91acb12 into release/0.11 Aug 6, 2026
1 check passed
@jakub-walaszczyk
jakub-walaszczyk deleted the feat/add-search-space-validation-0.11 branch August 6, 2026 14:09
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