fix: keep qualified bundles consistent through sanitization - #351
Merged
Conversation
abrichr
marked this pull request as ready for review
August 9, 2026 19:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
workflow.pyafter a qualified workflow is saved.Why
Qualification updates
workflow.jsonand adds the governed authorization template. The previous save path leftworkflow.pyat its pre-qualification state. The outbound sanitizer then correctly refused the bundle because the human-readable file was not the deterministic rendering of the authoritative workflow.The sanitizer also sent some opaque protocol values to PHI named-entity recognition. False positives could corrupt hashes, step IDs, UUIDs, observer IDs, and relation enums before the reseal check. The fix preserves only the typed machine shapes. It continues to scrub user-derived labels, descriptions, identity text, and target data.
Impact
Qualified bundles now retain one consistent machine and human representation. The sanitizer can retain load-bearing protocol values while it continues to fail closed on user data.
Verification
UV_CACHE_DIR=/tmp/uv-cache-openadapt uv run pytest -q tests/test_sanitized_artifact.py tests/test_qualification_project.py(147 passed)UV_CACHE_DIR=/tmp/uv-cache-openadapt uv run ruff check openadapt_flow/qualification.py openadapt_flow/sanitized_artifact.py tests/test_qualification_project.py tests/test_sanitized_artifact.pygit diff --check