feat(contracts): declare expected security platform types on expectations (#313)#314
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the contracts model to let an Expectation declare which security platform types (e.g., EDR/XDR/SIEM) are expected to fulfill it, enabling the OpenAEV platform to scope which connected platforms should be considered for technical expectations.
Changes:
- Added
SecurityPlatformTypeenum andexpectation_expected_security_platform_typesfield to theExpectationdataclass. - Added tests covering default-empty behavior and JSON serialization on both
availableExpectationsand derivedpredefinedExpectations. - Bumped
pyoaev.__version__to2.260720.0.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pyoaev/contracts/contract_config.py |
Introduces SecurityPlatformType and adds the new Expectation field with a default empty list. |
test/contracts/test_contract_expectations.py |
Adds unit tests validating defaulting and serialization for the new field. |
pyoaev/__init__.py |
Version bump to ship the new contract surface area. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ng (#313) The SecurityPlatformType docstring and the Expectation field comment only mentioned detection/prevention while VULNERABILITY is also a technical expectation seeded per security platform.
|
Review-and-fix pass complete:
Note: I cannot approve this PR since I am its author - it needs an approving review from another maintainer to unblock merge. |
|
Dropped the manual version bump in a58b99d - the version is bumped automatically by the release process, so pyoaev/init.py is back to 2.260717.0 and the PR description was updated accordingly. CI is green on the new head. |
…types (#313) The test helper forced expectation_expected_security_platform_types to [] even when omitted, so the default-empty test never covered the dataclass default. The field is now only passed when declared.
|
Second review-and-fix pass complete:
Still pending: an approving review from another maintainer (I cannot approve my own PR). |
Goal
Closes #313.
Add an optional
expectation_expected_security_platform_typesfield and aSecurityPlatformTypeenum (EDR, XDR, SIEM, SOAR, NDR, ISPM, LLM_FIREWALL, AI_GATEWAY) to the contractExpectationdataclass.Why
On OpenAEV, technical expectations (DETECTION / PREVENTION / VULNERABILITY) are pre-seeded with a pending result for every connected security platform, so the target-results view lists all of them. Letting a contract declare which security platform TYPES are expected to fulfil an expectation lets the platform focus the technical results on the relevant platforms only.
Behaviour
availableExpectationsand the derivedpredefinedExpectations.Changes
pyoaev/contracts/contract_config.py:SecurityPlatformTypeenum +expectation_expected_security_platform_typesfield onExpectation.No manual version bump: the version is bumped automatically by the release process.
Test plan
pytest test/contracts/passes (6 tests).black/isortclean.SecurityPlatform.SECURITY_PLATFORM_TYPEin openaev-model and the field name against theexpectation_expected_security_platform_typesJsonProperty on the frameworkExpectationform.This is the blocking library change for the platform + injectors rework.