Skip to content

feat(client): add PrimitiveType and ContractElement.argumentType (#334) - #333

Merged
Seb-MIGUEL merged 1 commit into
mainfrom
feat/add-argument-type-primitive
Aug 4, 2026
Merged

feat(client): add PrimitiveType and ContractElement.argumentType (#334)#333
Seb-MIGUEL merged 1 commit into
mainfrom
feat/add-argument-type-primitive

Conversation

@Seb-MIGUEL

@Seb-MIGUEL Seb-MIGUEL commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Mirrors io.openaev.database.model.PrimitiveType label-for-label in pyoaev/contracts/contract_config.py, so injector contracts built with this client can declare a semantic/chaining type for their arguments.
  • Exposes ContractElement.argumentType: Optional[PrimitiveType], matching the platform's own argumentType field name (io.openaev.database.model.ContractElement, added in openaev#7124) so a contract pushed from this client needs no translation on the other end.
  • Defaults to None on every element. On the platform side, argumentType has exactly one consumer today: StepAutoLinkService (chaining auto-link), which simply skips auto-linking a field when its argumentType is 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 the INJECT_CHAINING preview feature).

Verified the label set against the current io.openaev.database.model.PrimitiveType enum (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 passing
  • Full test/contracts/ suite — 16/16 passing, no regressions
  • black --check / isort --check-only — clean

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.
Copilot AI lite review requested due to automatic review settings August 4, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) in pyoaev/contracts/contract_config.py.
  • Adds ContractElement.argumentType: Optional[PrimitiveType] defaulting to None.
  • Adds tests covering enum wire labels and argumentType JSON 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"
@Seb-MIGUEL
Seb-MIGUEL requested a review from savacano28 August 4, 2026 14:17
@Seb-MIGUEL Seb-MIGUEL self-assigned this Aug 4, 2026
@Seb-MIGUEL Seb-MIGUEL changed the title feat(client): add PrimitiveType and ContractElement.argumentType feat(client): add PrimitiveType and ContractElement.argumentType (#334) Aug 4, 2026
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.

feat(client): expose PrimitiveType and ContractElement.argumentType in the Python client

5 participants