Skip to content

feat(api): typed response structs, batch 8 — runs, entity events (#1198) - #1210

Merged
athvin merged 2 commits into
mainfrom
issue/1198-typed-runs-events
Nov 24, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/1198-typed-runs-events

Conversation

@athvin

@athvin athvin commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Closes #1198

Part of #864 (batch 8 of 10: runs+entity events).

🚧 Claimed by an agent session — 2026-11-24T16:52:13Z, session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac.
The claim is this open draft PR: closing it releases the ticket.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Batch 8 of #864 converts the run ledger and a run's entity-event page to typed structs: RunItem, RunEventItem and RunEventPage. 2 more operations now publish a $ref success schema (72 → 74 of 119).

Why

OpenAPI is the customer integration contract (#857). "Run & monitor" is a documented step.

Proof

  • make check: 1,156 passed, 0 failed.
  • er-server --tests against Postgres: 390 passed.
  • Frontend tsc --noEmit is clean against the regenerated schema.d.ts.
  • envelopes.json is unchanged.

Risk & rollback

Bodies are value-equal to the old ones. auto_merged_pairs is still omitted, not null, when no threshold is readable. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac · 2026-11-24T17:20:06Z

Specific to this change

Context — plan, discoveries, measurements, files

Plan

  • RunItem is the RecentRow destructured exhaustively, plus auto_merged_pairs (skip_serializing_if, which is allowed here because the item is reached through Json::<Vec<…>> and the classifier never parses it).
  • RunEventItem comes through item_from_row!. RunEventPage is the envelope.
  • Value-equality tests in read.rs::typed_detail_tests, with and without a threshold.

Discoveries

Measurements

Files

rust/crates/er-server/src/{read.rs,lib.rs,openapi.rs}, frontend/src/lib/api/{openapi.json,openapi.public.json,schema.d.ts}

The run ledger and a run's entity-event page now return typed structs:
RunItem (the run row plus auto_merged_pairs, absent when no threshold
is readable, exactly as the old map insert omitted it) and RunEventItem
over the generated rows, with exhaustive destructuring From impls, and
the RunEventPage envelope. 2 more operations publish a $ref success
schema (72 -> 74).

Value equality against the rows_to_values builds is pinned in
read.rs typed_detail_tests; envelopes.json is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The marketing preview was removed because this PR is closed or merged.

@athvin
athvin merged commit 9a64466 into main Nov 24, 2026
46 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 24, 2026 17:09 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — be4ed805 Deployed Nov 24, 2026 by athvin via remove closed PR previews #29
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.

#864 batch 8: typed responses for runs+entity events

2 participants