fabro/lib/crates
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
..
fabro-agent feat: embed fabro spa and align interruption semantics 2026-04-08 14:43:44 -04:00
fabro-api fix(api): resolve build spec path at runtime 2026-04-07 23:05:07 -04:00
fabro-checkpoint test(checkpoint): restore RunRecord helper fields 2026-04-07 23:24:36 -04:00
fabro-cli refactor(store): flatten EventEnvelope wire shape via serde 2026-04-09 12:09:00 -04:00
fabro-config feat(artifacts): remove scratch artifact cache staging 2026-04-08 17:42:55 -04:00
fabro-core feat: embed fabro spa and align interruption semantics 2026-04-08 14:43:44 -04:00
fabro-devcontainer refactor(workspace): satisfy clippy all-targets warnings 2026-04-05 14:37:32 -04:00
fabro-github refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
fabro-graphviz Clean up workspace clippy warnings 2026-03-30 11:27:25 -04:00
fabro-hooks refactor(workspace): satisfy clippy all-targets warnings 2026-04-05 14:37:32 -04:00
fabro-interview feat: embed fabro spa and align interruption semantics 2026-04-08 14:43:44 -04:00
fabro-llm feat: embed fabro spa and align interruption semantics 2026-04-08 14:43:44 -04:00
fabro-macros Add twin test mode for OpenAI E2E tests 2026-03-31 20:36:48 -04:00
fabro-mcp Rename fabro-api-types to fabro-api with progenitor client generation 2026-04-03 11:17:27 -07:00
fabro-model fix(clippy): restore workspace lint cleanups after main merge 2026-04-07 18:01:53 -04:00
fabro-oauth refactor(workspace): satisfy clippy all-targets warnings 2026-04-05 14:37:32 -04:00
fabro-proc feat(run): harden server-supervised worker lifecycle 2026-04-07 07:59:35 -04:00
fabro-retro Merge remote-tracking branch 'origin/main' 2026-04-07 15:24:07 -04:00
fabro-sandbox refactor(storage): unify scratch paths and key schema 2026-04-06 10:13:37 -04:00
fabro-server refactor(store): flatten EventEnvelope wire shape via serde 2026-04-09 12:09:00 -04:00
fabro-slack fix(clippy): restore workspace lint cleanups 2026-04-07 20:40:02 -04:00
fabro-spa feat: embed fabro spa and align interruption semantics 2026-04-08 14:43:44 -04:00
fabro-store refactor(store): flatten EventEnvelope wire shape via serde 2026-04-09 12:09:00 -04:00
fabro-telemetry fix(home): migrate all runtime consumers to use Home 2026-04-06 13:36:43 -04:00
fabro-test fix: resolve clippy warnings across workspace 2026-04-08 15:56:51 -04:00
fabro-tracker fix(test): remove hidden HTTP client startup overhead 2026-04-04 21:25:51 -04:00
fabro-types refactor(events): tidy schema v2 plumbing 2026-04-09 11:42:02 -04:00
fabro-util refactor(home): move Home to fabro-util so all crates can share it 2026-04-06 13:08:35 -04:00
fabro-validate Add publish = false to all crates to prevent accidental crates.io publish 2026-03-29 13:47:09 -04:00
fabro-workflow refactor(events): tidy schema v2 plumbing 2026-04-09 11:42:02 -04:00