You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(contracts): predefined expectations no longer emitted after availableExpectations rename #309
Injector contracts built with pyoaev no longer pre-fill Detection / Prevention (and other) expectations when a user creates an atomic testing or an inject. The expectations picker is empty of defaults, even though every injector declares them.
Root cause
Commit 3ca50c3 (feat(contracts): adding the new availableExpectations field, #306) renamed the ContractExpectations.predefinedExpectations field to availableExpectations and added a per-expectation expectation_is_predefined flag.
However, the OpenAEV platform pre-fills expectations from a field-level predefinedExpectations array on the expectation contract field (see InjectorContractContentUtils / ContractExpectations on the platform, and the frontend InjectContentForm which reads both predefinedExpectations for the defaults and availableExpectations for the "add expectation" picker). The per-expectation expectation_is_predefined flag is not consumed by the platform.
So after #306, pyoaev emits only availableExpectations and never predefinedExpectations, which means nothing is pre-filled. The flag became dead weight.
This is currently only on the unreleased main (not in 2.260717.0), so it would ship as a regression on the next release and break predefined expectations for all Python injectors.
Fix
Restore predefinedExpectations on ContractExpectations (alongside availableExpectations) and auto-derive it from the expectations flagged expectation_is_predefined=True when no explicit list is passed. This keeps the ergonomic single-list API and makes predefined expectations work end-to-end on the platform again.
Scope
pyoaev/contracts/contract_config.py: ContractExpectations emits both arrays.
Activity
fix(contracts): use None sentinel for predefinedExpectations override (…
fix(contracts): emit predefinedExpectations from availableExpectations (