feat(client): add PrimitiveType and ContractElement.argumentType (#334) - #333
Merged
Conversation
Mirrors io.openaev.database.model.PrimitiveType label-for-label and exposes it on ContractElement.argumentType so injectors can declare an input argument's chaining/semantic type (e.g. "username", "host"), matching the platform's own field name so a contract pushed from here needs no translation on the other end. Defaults to None on every element; the platform already normalizes a missing/null/empty argumentType to PrimitiveType.Text (InjectorContractService.normalizeContractContentArgumentType), so this is fully backward compatible: existing contracts and injectors that never set it are unaffected. No feature flag needed per integration team — backward compatibility is the only requirement here.
There was a problem hiding this comment.
Pull request overview
Adds a PrimitiveType enum and exposes an argumentType field on ContractElement to let client-authored injector contracts declare a semantic/chaining type for arguments that matches the platform’s ContractElement.argumentType field.
Changes:
- Introduces
PrimitiveType(string-backed enum) inpyoaev/contracts/contract_config.py. - Adds
ContractElement.argumentType: Optional[PrimitiveType]defaulting toNone. - Adds tests covering enum wire labels and
argumentTypeJSON round-tripping/default behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pyoaev/contracts/contract_config.py | Adds PrimitiveType and the new ContractElement.argumentType field to align client contract payloads with the platform schema. |
| test/contracts/test_primitive_type.py | Verifies PrimitiveType wire labels and guards the full label set against drift. |
| test/contracts/test_contract_element_argument_type.py | Verifies argumentType defaults to None and serializes/deserializes correctly on contract elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Service: str = "service" | ||
| Severity: str = "severity" | ||
| ShareName: str = "share_name" | ||
| SID: str = "sid" |
guzmud
approved these changes
Aug 4, 2026
savacano28
approved these changes
Aug 4, 2026
1 task
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.
Summary
io.openaev.database.model.PrimitiveTypelabel-for-label inpyoaev/contracts/contract_config.py, so injector contracts built with this client can declare a semantic/chaining type for their arguments.ContractElement.argumentType: Optional[PrimitiveType], matching the platform's ownargumentTypefield name (io.openaev.database.model.ContractElement, added in openaev#7124) so a contract pushed from this client needs no translation on the other end.Noneon every element. On the platform side,argumentTypehas exactly one consumer today:StepAutoLinkService(chaining auto-link), which simply skips auto-linking a field when itsargumentTypeis missing/blank — no other code path reads or acts on it. Fully backward compatible: existing contracts/injectors that never set it are unaffected, and even for contracts that do set it, nothing changes outside of chaining (itself gated behind theINJECT_CHAININGpreview feature).Verified the label set against the current
io.openaev.database.model.PrimitiveTypeenum (34 values) — exact match, label-for-label.Fixes #334
Test plan
pytest test/contracts/test_primitive_type.py test/contracts/test_contract_element_argument_type.py— 8/8 passingtest/contracts/suite — 16/16 passing, no regressionsblack --check/isort --check-only— clean