hermes-agent/tests/gateway/relay
Ben 5feec8b4cf test(gateway): enforce relay contract-doc ⟷ Python conformance
Add an invariant test pinning docs/relay-connector-contract.md to the
Python source of truth so the doc (which the connector repo mirrors by
hand) cannot silently drift:

- CapabilityDescriptor §2 table ⟷ dataclass fields + required/optional
- SessionSource wire keys (to_dict output) ⟷ §3 documented fields
- per-platform discriminator columns exist as real SessionSource fields
- guard that is_bot stays off the wire until deliberately promoted

Writing the test surfaced a real gap: §3 only enumerated 5 discriminators
in its per-platform table while to_dict() emits 12 keys. Seven wire keys
the connector must populate (chat_name, chat_topic, user_id_alt,
chat_id_alt, parent_chat_id, message_id, user_name) were undocumented —
a connector author reading the doc would never know to set them. Added a
complete SessionSource wire-field table to §3. The connector's existing
contract.ts already carries all 12, so no connector change is needed; the
doc was the lagging artifact.
2026-06-17 16:37:45 -07:00
..
__init__.py feat(relay): experimental CapabilityDescriptor schema 2026-06-17 16:37:45 -07:00
stub_connector.py feat(relay): transport protocol + test-only stub connector 2026-06-17 16:37:45 -07:00
test_contract_doc_conformance.py test(gateway): enforce relay contract-doc ⟷ Python conformance 2026-06-17 16:37:45 -07:00
test_descriptor.py feat(relay): experimental CapabilityDescriptor schema 2026-06-17 16:37:45 -07:00
test_descriptor_from_entry.py feat(relay): derive descriptor from PlatformEntry 2026-06-17 16:37:45 -07:00
test_no_stub_leak.py test(relay): assert connector stub never leaks into production paths 2026-06-17 16:37:45 -07:00
test_relay_adapter.py feat(relay): generic RelayAdapter advertising negotiated capabilities 2026-06-17 16:37:45 -07:00
test_relay_interrupt.py feat(relay): route mid-turn /stop over relay interrupt channel 2026-06-17 16:37:45 -07:00
test_relay_registration.py feat(relay): register RelayAdapter through platform registry (flagged off by default) 2026-06-17 16:37:45 -07:00
test_relay_roundtrip.py feat(relay): transport protocol + test-only stub connector 2026-06-17 16:37:45 -07:00