Host Compliance
22-H defines a compliant Corvid replay host as one that can:
- record host-originated events into the shared JSONL trace via
corvid_record_host_event(...) - respect the typed return status from that call
- replay a recorded trace by loading the embedded library and executing
corvid_call_agent(...)withCORVID_REPLAY_TRACE_PATHset - reproduce the recorded result across host languages for the Corvid-controlled execution surface
Shared Trace Rules
- Host events live in the same trace stream as runtime events.
- The event shape is the normal
TraceEventenvelope withkind: "host_event". - Only the cdylib writes the trace file. Hosts submit events through the C ABI; they do not append sidecar files.
corvid_record_host_event
Signature:
CorvidHostEventStatus corvid_record_host_event( const char* name, const char* payload_json, size_t payload_len);Required status handling:
CORVID_HOST_EVENT_OK: event was recordedCORVID_HOST_EVENT_BAD_JSON: host supplied malformed JSON and must not assume the event was recordedCORVID_HOST_EVENT_TRACE_DISABLED: recording is off; hosts may skip further payload work on that pathCORVID_HOST_EVENT_RUNTIME_ERROR: writer-side failure such as filesystem error
A compliant host must not silently discard the status return. The compliance tests include a malformed JSON call and fail hosts that treat it as fire-and-forget.
Replay Rules
- Replay uses the embedded binary plus the recorded trace; it does not require source recompilation.
- Hosts set
CORVID_REPLAY_TRACE_PATHto the recorded trace and then dispatch the recorded top-level agent throughcorvid_call_agent(...). - For deterministic replay of the Corvid-controlled surface, hosts also set
CORVID_DETERMINISTIC_SEEDfrom trace metadata.
Corvid v1 of this guarantee is intentionally scoped:
- covered: Corvid-controlled RNG, trace-seeded timestamps/run identity, recorded call substitution
- not claimed: adapter-internal retry jitter, opaque SDK scheduling, or other non-Corvid-controlled internals
Capsule Manifest
A replay capsule bundles:
- the cdylib
- the embedded descriptor as JSON
- the JSONL trace
- a manifest carrying content hashes plus:
runtime_versioncompiler_versiontrace_schema_versiondescriptor_abi_versiondeterministic_seed
Replay should warn on version mismatch and fail only on actual schema or ABI incompatibility.
Reference Compliance Tests
crates/corvid-host-compliance-tests provides the executable reference:
- record in C via
examples/cdylib_catalog_demo/host_c/capsule_host.c - replay in Python via
examples/cdylib_catalog_demo/host_py/replay_host.py
Passing that suite demonstrates cross-language replay compatibility for the current Corvid C ABI.*** End Patch