Skip to content

feat: add preflight config validation for active workflows#27

Merged
lipikaramaswamy merged 7 commits into
mainfrom
lipikaramaswamy/feat/config-validation-model-aliases
Mar 11, 2026
Merged

feat: add preflight config validation for active workflows#27
lipikaramaswamy merged 7 commits into
mainfrom
lipikaramaswamy/feat/config-validation-model-aliases

Conversation

@lipikaramaswamy
Copy link
Copy Markdown
Collaborator

Summary

This PR adds a public Anonymizer.validate_config() method to preflight-check active workflow configuration against the parsed model pool. We reuse the same preflight path in run() and preview() so invalid model selections fail before workflow execution.

We validate only the aliases required for the active config:

  • detection aliases are always validated, as they are required for all workflows
  • substitute alias is checked only when Substitute is selected in replace mode.
  • rewrite aliases are checked only in rewrite mode

We also add InvalidConfigError so public config validation failures surface consistently.

Test Plan

  • uv run pytest tests/interface/test_anonymizer_interface.py tests/engine/test_model_loader.py
  • Optional full suite after unrelated payload work is resolved: uv run --group dev pytest

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring

Testing

  • Extended model-loader and interface tests, and moved shared validation fixtures into tests/conftest.py; all tests pass locally
  • Notebooks run end-to-end

Related Issues

Closes #5

@lipikaramaswamy lipikaramaswamy requested a review from a team as a code owner March 7, 2026 03:04
@lipikaramaswamy lipikaramaswamy changed the title feat: sdd preflight config validation for active workflows feat: add preflight config validation for active workflows Mar 7, 2026
Comment thread src/anonymizer/interface/anonymizer.py
Comment thread src/anonymizer/engine/ndd/model_loader.py Outdated
Copy link
Copy Markdown
Collaborator

@andreatgretel andreatgretel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I left two small nits around config validation, but nothing blocking from my side.

…place config is passed, and expanding the interface to re-export all user-facing interface errors
@lipikaramaswamy lipikaramaswamy merged commit 2df7e37 into main Mar 11, 2026
5 checks passed
@lipikaramaswamy lipikaramaswamy deleted the lipikaramaswamy/feat/config-validation-model-aliases branch March 11, 2026 07:37
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.

feat: add config validation step for model alias references

2 participants