EMRY-002: Event types + Phase enum #3

Closed
opened 2026-06-24 00:20:37 +00:00 by vxfemboy · 1 comment
vxfemboy commented 2026-06-24 00:20:37 +00:00 (Migrated from github.com)

Event types and Phase

Implement Event, Phase, MetricRecord, RunMeta, EmryEvent per design spec.

Tasks

  • Extend types.rs with full event enum + serde JSON roundtrip
  • Phase serializes as TRAIN string for v1 JSONL compat
  • Unit test: serialize/deserialize sample metric record

Acceptance

  • cargo test -p emry-core types
  • rustdoc on all public types

Depends on: EMRY-001
Estimate: 4h

## Event types and Phase Implement `Event`, `Phase`, `MetricRecord`, `RunMeta`, `EmryEvent` per design spec. ### Tasks - [ ] Extend `types.rs` with full event enum + serde JSON roundtrip - [x] Phase serializes as `TRAIN` string for v1 JSONL compat - [ ] Unit test: serialize/deserialize sample metric record ### Acceptance - [ ] `cargo test -p emry-core types` - [ ] rustdoc on all public types **Depends on:** EMRY-001 **Estimate:** 4h
vxfemboy commented 2026-06-24 22:24:24 +00:00 (Migrated from github.com)

Done in commit 0a7052f on branch emry-002-event-types.

Implemented in emry-core/src/types.rs:

  • Event enum (adjacently tagged {type, data}), all 8 variants roundtrip JSON + msgpack
  • MetricId(u16) newtype (transparent), Severity, AlertRecord, FinishReason
  • MetricRecord wide-row schema for metrics.jsonl (Phase serializes TRAIN for v1 compat)
  • rustdoc on all public types; 99% line coverage on types.rs

Note for EMRY-024: msgpack wire protocol must use Serializer::with_struct_map for the adjacently-tagged Event to roundtrip.

Done in commit 0a7052f on branch emry-002-event-types. Implemented in emry-core/src/types.rs: - Event enum (adjacently tagged {type, data}), all 8 variants roundtrip JSON + msgpack - MetricId(u16) newtype (transparent), Severity, AlertRecord, FinishReason - MetricRecord wide-row schema for metrics.jsonl (Phase serializes TRAIN for v1 compat) - rustdoc on all public types; 99% line coverage on types.rs Note for EMRY-024: msgpack wire protocol must use Serializer::with_struct_map for the adjacently-tagged Event to roundtrip.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
femboy/emry#3
No description provided.