fix: add strict mode to prevent silent fallback degradation during benchmarking#154
Merged
Conversation
…nchmarking When strict=True, components that previously degraded silently now raise errors instead, ensuring benchmarking/training runs use the intended system configuration (e.g., PII scrubbing active, VLM extraction working). - ScrubMiddleware: raise ImportError if openadapt-privacy missing, re-raise on scrubbing failure - extract_workflow(): raise ValueError on VLM parse failure, re-raise on VLM call failure - generate_transcript(): re-raise on VLM call failure, raise ValueError if parser returns only placeholders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ec2f193 to
77039e4
Compare
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.
Summary
strict: bool = Falseparameter toScrubMiddleware,extract_workflow(), andgenerate_transcript()strict=True, these components raise errors instead of silently falling back to degraded behavior (unscrubbed screenshots, 1:1 transcript-to-step mapping, placeholder entries)Changes
scrub_middleware.py:ScrubMiddleware(adapter, strict=True)raisesImportErrorifopenadapt-privacyis missing, re-raises on scrubbing failureextract.py:extract_workflow(..., strict=True)raisesValueErroron VLM parse failure, re-raises on VLM call failure (instead of falling back to 1:1 mapping)transcript.py:generate_transcript(..., strict=True)re-raises on VLM call failure, raisesValueErrorif parser returns only placeholder entries (instead of silently continuing)Test plan
ScrubMiddleware(adapter, strict=True)raisesImportErrorwhenopenadapt-privacyis not installedScrubMiddleware(adapter, strict=False)still falls back silently (no behavior change for existing callers)extract_workflow(transcript, strict=True)raisesValueErrorwhen VLM response cannot be parsedgenerate_transcript(session, strict=True)raises on VLM call failurestrict=False(default)🤖 Generated with Claude Code