Skip to content

EMRY-002: Event model + MetricRecord in emry-core - #49

Merged
vxfemboy merged 1 commit into
mainfrom
emry-002-event-types
Jun 25, 2026
Merged

vxfemboy merged 1 commit into
mainfrom
emry-002-event-types

Conversation

@vxfemboy

Copy link
Copy Markdown
Member

Closes EMRY-002 (#3).

What

Full event model in emry-core/src/types.rs:

  • Event enum, adjacently tagged {type, data} — all 8 variants roundtrip
  • MetricId(u16) transparent newtype, Severity, AlertRecord, FinishReason
  • MetricRecord wide-row schema for metrics.jsonl (Phase serializes TRAIN for v1 compat)

Verification

  • ./scripts/pre-commit-rust.sh green: fmt, clippy -D warnings, tests, ≥90% coverage (types.rs 99% lines)
  • JSON and msgpack roundtrip tested per variant
  • Finding: adjacently-tagged enums need rmp_serde::Serializer::with_struct_map — flagged for the EMRY-024 wire protocol

No runnable surface yet (pure library); the test suite is the verification.

Add Event enum (adjacently tagged), MetricId, Severity, AlertRecord,
FinishReason, and MetricRecord with serde JSON + msgpack roundtrip tests.
Discovered + documented that the msgpack wire protocol (EMRY-024) must use
Serializer::with_struct_map for adjacently-tagged enums to roundtrip.
@vxfemboy
vxfemboy merged commit 1a32492 into main Jun 25, 2026
3 checks passed
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.

1 participant