Skip to content

Add precompute contract fixtures - #13

Draft
leoromanovsky wants to merge 7 commits into
mainfrom
leo.romanovsky/precompute-contract-fixtures
Draft

Add precompute contract fixtures#13
leoromanovsky wants to merge 7 commits into
mainfrom
leo.romanovsky/precompute-contract-fixtures

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

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 from ufc-config.json, call the precompute API with request, and compare the full response to expectedResponse.

Decisions

These fixtures live in precompute-cases/ rather than the older SDK-oriented precomputed/ 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 DEFAULT for active date-window-only allocations. startAt and endAt are scheduling metadata, not targeting rules, so they preclude STATIC without implying TARGETING_MATCH.

Validation

Fixture validation is performed downstream in dd-source by pinning a merged main commit from this repository and running the Rust evaluator/precompute contract tests against these cases. The JSON fixture in this PR also parses cleanly with python3 -m json.tool.

@leoromanovsky leoromanovsky changed the title Add precompute contract fixtures Add precompute contract fixtures and date-window reasons Jun 10, 2026
@leoromanovsky leoromanovsky changed the title Add precompute contract fixtures and date-window reasons Add precompute contract fixtures Jun 10, 2026
@leoromanovsky
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
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.

1 participant