Skip to content

Commit edff995

Browse files
committed
Register API-406 backend carrier contracts
1 parent 4a1fddb commit edff995

4 files changed

Lines changed: 64 additions & 1 deletion

File tree

changelog.d/200.added.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Added
2+
3+
- Made the API-406 participant lifecycle-event, observation-envelope, and
4+
shared-state record contracts required by the full remote control-plane
5+
backend profile and registered their conformance model validators.

contracts/profiles/backend/full-remote-control-plane.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"evaluation-history-event-stream-v1",
1616
"participant-episode-state-envelope-v1",
1717
"participant-episode-history-event-stream-v1",
18-
"participant-behavior-history-event-stream-v1"
18+
"participant-behavior-history-event-stream-v1",
19+
"participant-lifecycle-event-v1",
20+
"participant-observation-envelope-v1",
21+
"participant-shared-state-record-v1"
1922
]
2023
}

implementations/python/packages/aces_conformance/conformance.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
ParticipantEpisodeStateModel,
3232
ParticipantImplementationManifestModel,
3333
ParticipantImplementationProvenanceModel,
34+
ParticipantLifecycleEventModel,
35+
ParticipantObservationEnvelopeModel,
36+
ParticipantSharedStateRecordModel,
3437
ProvisioningPlanModel,
3538
RuntimeSnapshotEnvelopeModel,
3639
WorkflowExecutionStateModel,
@@ -162,6 +165,9 @@ class BackendConformanceReport:
162165
"workflow-result-envelope-v1": WorkflowExecutionStateModel.model_validate,
163166
"evaluation-result-envelope-v1": EvaluationResultStateModel.model_validate,
164167
"participant-episode-state-envelope-v1": ParticipantEpisodeStateModel.model_validate,
168+
"participant-lifecycle-event-v1": ParticipantLifecycleEventModel.model_validate,
169+
"participant-observation-envelope-v1": ParticipantObservationEnvelopeModel.model_validate,
170+
"participant-shared-state-record-v1": ParticipantSharedStateRecordModel.model_validate,
165171
}
166172

167173

implementations/python/tests/test_runtime_conformance.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
)
2020
from aces.core.runtime.registry import RuntimeTarget
2121

22+
API_406_CARRIER_CONTRACTS = {
23+
"participant-lifecycle-event-v1",
24+
"participant-observation-envelope-v1",
25+
"participant-shared-state-record-v1",
26+
}
27+
2228

2329
def test_fixture_suite_passes_for_orchestration_evaluation_profile():
2430
report = run_fixture_suite(profile=BackendCapabilityProfile.ORCHESTRATION_EVALUATION)
@@ -61,6 +67,46 @@ def test_target_conformance_passes_for_stub_target():
6167
)
6268

6369

70+
def test_full_remote_control_plane_profile_requires_api_406_carriers():
71+
contracts = required_contracts(BackendCapabilityProfile.FULL_REMOTE_CONTROL_PLANE)
72+
73+
assert contracts >= API_406_CARRIER_CONTRACTS
74+
assert {
75+
"runtime-snapshot-v1",
76+
"participant-episode-state-envelope-v1",
77+
"participant-episode-history-event-stream-v1",
78+
"participant-behavior-history-event-stream-v1",
79+
} <= contracts
80+
81+
82+
def test_fixture_suite_validates_api_406_carrier_fixtures(tmp_path: Path):
83+
backend_dir = tmp_path / "backend"
84+
backend_dir.mkdir()
85+
(backend_dir / "provisioning-only.json").write_text(
86+
json.dumps(
87+
{
88+
"schema_version": "backend-profile/v1",
89+
"profile": "provisioning-only",
90+
"required_contracts": sorted(API_406_CARRIER_CONTRACTS),
91+
}
92+
)
93+
+ "\n",
94+
encoding="utf-8",
95+
)
96+
97+
report = run_fixture_suite(
98+
profile=BackendCapabilityProfile.PROVISIONING_ONLY,
99+
profiles_root=backend_dir,
100+
)
101+
102+
assert report.passed is True
103+
assert {case.contract_name for case in report.cases} == API_406_CARRIER_CONTRACTS
104+
assert any(case.valid is False for case in report.cases)
105+
assert all(
106+
diagnostic.code != "conformance.contract-unknown" for case in report.cases for diagnostic in case.diagnostics
107+
)
108+
109+
64110
def test_profile_is_inferred_as_full_when_manifest_declares_participant_runtime():
65111
"""RUN-311 — finding 3: a manifest that declares orchestrator,
66112
evaluator, and participant_runtime must infer the
@@ -701,6 +747,9 @@ def test_target_conformance_fails_when_declared_contracts_do_not_cover_profile_r
701747
"participant-behavior-history-event-stream-v1",
702748
"participant-episode-history-event-stream-v1",
703749
"participant-episode-state-envelope-v1",
750+
"participant-lifecycle-event-v1",
751+
"participant-observation-envelope-v1",
752+
"participant-shared-state-record-v1",
704753
"provisioning-plan-v1",
705754
"runtime-snapshot-v1",
706755
"workflow-history-event-stream-v1",

0 commit comments

Comments
 (0)