fabro/lib/crates/fabro-cli/tests/it/workflow
Bryan Helmkamp ea84d9bc72
refactor(store): flatten EventEnvelope wire shape via serde
Replace the hand-written to_wire_value / from_wire_value helpers
and the wire_event_envelope_from_generated bridge with
#[serde(flatten)] on EventEnvelope.payload. Derived serde now
produces and accepts the wire shape natively:

  { "seq": 42, "id": "...", "event": "...", ... }

instead of the nested { "seq": 42, "payload": { ... } } the
derive would otherwise emit. #[serde(flatten)] composes fine with
the #[serde(transparent)] EventPayload(Value) wrapper, so the
inner payload object is merged into the outer map on both sides.

- fabro-store/src/types.rs: add #[serde(flatten)]; delete the two
  wire helpers (33 lines of Value-map poking); update the
  round-trip test to assert the shape is actually flat.
- fabro-server/src/server.rs: sse_event_from_store serializes
  the envelope directly; api_event_envelope_from_store pipelines
  to_value into from_value.
- fabro-cli/src/server_client.rs: buffer_sse_events parses
  straight into EventEnvelope via serde_json::from_str;
  list_run_events uses the existing convert_type helper in place
  of the deleted wire_event_envelope_from_generated bridge.
- fabro-cli tests: helpers that called from_wire_value now call
  serde_json::from_value.

Drops the shape check that from_wire_value used to perform on
parse (id/ts/run_id/event must exist as strings): that check
extracted run_id from the payload and then validated it against
itself, so it only guaranteed presence, not correctness.
EventPayload::new(value, expected_run_id) still runs the same
check where a caller has a real external run_id to cross-match.

Generated code and the OpenAPI allOf(seq, RunEvent) schema are
untouched; the wire JSON is byte-identical before and after.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:09:00 -04:00
..
fixtures Extract workflow E2E tests into workflow/ directory 2026-03-30 11:41:18 -04:00
agent_linear.rs refactor(cli): route run state through the shared server daemon 2026-04-05 00:15:33 -04:00
command_agent_mixed.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
command_pipeline.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
conditional_branching.rs refactor(cli): route run state through the shared server daemon 2026-04-05 00:15:33 -04:00
dry_run_examples.rs fix(cli): restore green server-backed test checkpoint 2026-04-05 03:41:10 -04:00
full_stack.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
hooks.rs refactor(config): unify machine config as settings.toml 2026-04-05 23:55:28 -04:00
human_gate.rs refactor(cli): route run state through the shared server daemon 2026-04-05 00:15:33 -04:00
mod.rs refactor(store): flatten EventEnvelope wire shape via serde 2026-04-09 12:09:00 -04:00
real_cli.rs refactor(billing): unify the LLM billing domain 2026-04-07 14:33:35 -04:00