Add precompute contract fixtures - #13
Draft
leoromanovsky wants to merge 7 commits into
Draft
Conversation
leoromanovsky
changed the base branch from
main
to
leo.romanovsky/date-window-assignment-reasons
June 10, 2026 18:03
Base automatically changed from
leo.romanovsky/date-window-assignment-reasons
to
main
June 12, 2026 12:42
…pute-contract-fixtures
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.
Motivation
FFE consumers need one shared fixture suite that covers the precompute API response contract, not only SDK-style single-flag evaluation. The precompute response can be produced by multiple implementations, including edge evaluation and SDK-side precompute paths, and those implementations should converge on the same request and response bodies instead of carrying local copies.
Changes
This PR adds canonical precompute contract fixtures under
precompute-cases/. Each case includes the JSON:API precompute request shape and the expected full precompute response. The fixture set covers assignment reasons, allocation metadata, created-at handling, value serialization, empty targeting keys, regex targeting, JSON values, and deprecated-but-present response fields.The repository README now documents how downstream consumers should load
precompute-cases/*.json: initialize an evaluator fromufc-config.json, call the precompute API withrequest, and compare the full response toexpectedResponse.Decisions
These fixtures live in
precompute-cases/rather than the older SDK-orientedprecomputed/shape because the contract here is the API response itself. SDKs can still layer typed-evaluation and event-emission assertions on top, but precompute producers should first prove that they emit the same JSON:API response for the same UFC config and request.The temporal allocation cases use
DEFAULTfor active date-window-only allocations.startAtandendAtare scheduling metadata, not targeting rules, so they precludeSTATICwithout implyingTARGETING_MATCH.Validation
Fixture validation is performed downstream in dd-source by pinning a merged
maincommit from this repository and running the Rust evaluator/precompute contract tests against these cases. The JSON fixture in this PR also parses cleanly withpython3 -m json.tool.