Problem
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.
- Unit tests under
test/contracts/.
Problem
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.predefinedExpectationsfield toavailableExpectationsand added a per-expectationexpectation_is_predefinedflag.However, the OpenAEV platform pre-fills expectations from a field-level
predefinedExpectationsarray on the expectation contract field (seeInjectorContractContentUtils/ContractExpectationson the platform, and the frontendInjectContentFormwhich reads bothpredefinedExpectationsfor the defaults andavailableExpectationsfor the "add expectation" picker). The per-expectationexpectation_is_predefinedflag is not consumed by the platform.So after #306, pyoaev emits only
availableExpectationsand neverpredefinedExpectations, 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
predefinedExpectationsonContractExpectations(alongsideavailableExpectations) and auto-derive it from the expectations flaggedexpectation_is_predefined=Truewhen 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:ContractExpectationsemits both arrays.test/contracts/.