harden datastream evaluation against rules engine failures (SCH-7057) - #103
Merged
bpapillon merged 4 commits intoSep 5, 2026
Merged
Conversation
The generated models keep explicitly-set None values even with exclude_none=True, and partial_company sets every unset optional entitlement field to None when it merges a partial update. WASM v0.7.0 rejects an explicit null for warning_tiers, so from a company's first partial update every check against it returned an error code and the caller saw the flag default (schematichq 1.3.4, 2026-09-04).
_evaluate_flag returned the flag default with reason RULES_ENGINE_ERROR, so an engine failure was indistinguishable from a real verdict and never reached the API fallback the client already has. Raise RulesEngineError instead, and log the fallback at WARNING so an abandoned datastream evaluation is visible without DEBUG logging.
E2E previously ran only by hand from schematic-api. WASM bump PRs are opened by a bot and merged on unit tests alone, which is how 1.3.4 shipped a WASM that failed every datastream check for entitled companies. Run the suite on PRs that touch the WASM version, the datastream client, or the test app.
SchematicHQ/actions is private and this repo is public, so the reusable workflow cannot be called from here (GitHub: 'workflow was not found'). E2E runs from schematic-api's sdk_e2e.yml instead.
schematic-bot
approved these changes
Sep 5, 2026
bpapillon
deleted the
bpapillon/sch-7057-fix-datastream-wasm-failures-in-python-sdk
branch
September 5, 2026 05:32
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.
Fixes the 1.3.4 regression reported by Syrto on 2026-09-04 (SCH-7057). Engine-side fix: SchematicHQ/schematic-api#8063. Supersedes #102, which GitHub closed when the branch was renamed to the Linear branch name.
WASM v0.7.0 added
warning_tierswithout the null-tolerant deserializer, and this SDK sends"warning_tiers": nullfor any company that has been through a partial-update merge, because the generated models keep explicitly-setNonevalues when dumped. Every check against such a company returned an error code, which_evaluate_flagturned into the flag default withreason="RULES_ENGINE_ERROR". Callers could not tell that from a real denial.Nonevalues from the envelope before it reaches the WASM, so the envelope shape no longer depends on how the models were built. Regression test runs the real partial-merge path against the bundled WASM._evaluate_flagnow raisesRulesEngineError(exported fromschematic.datastream) instead of returning the default, socheck_flag/check_flagsfall back to the REST API the way they already do for other datastream failures.sdk_e2e.yml; see SchematicHQ/schematic-api#8063.WASM_VERSIONstays at 0.7.1 until 0.7.2 is released; the Python-side stripping makes the SDK safe on either.