Skip to content

feat(api): OpenAPI component schemas for the 15 wire:[json] entities (#762) - #900

Merged
athvin merged 2 commits into
mainfrom
issue/762-openapi-schemas
Nov 8, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/762-openapi-schemas

Conversation

@athvin

@athvin athvin commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #762

🚧 Claimed by an agent session — 2026-11-08T19:43Z, session 01a1b892-4cde-7a53-bb3e-9ed2e764acdc on Mac.
The claim is this open draft PR: closing it releases the ticket.

What

Register all 15 wire: [json] entities that had no component schema — candidate_key, column_profile, entity_link, ingest_batch, matching_model, metric_snapshot, metric_snapshot_source, pair_label, profile_finding, profile_run, record_quality, s3_ingest_cursor, tag, tagging, webhook_delivery — in ApiDoc, and empty JSON_WIRE_WITHOUT_SCHEMA (the gate stays; the backlog goes to zero). Regenerate openapi.json and schema.d.ts.

Why

Undocumented wire shapes are invisible to three gates: schema.d.ts generation, the er-openapi-check breaking-change diff, and any consumer reading the document. Every one of the 15 is in fact served as JSON today (evidence in Context), so the right move is registration, not dropping wire: [json].

Proof

Work in progress — claim commit only.

Risk & rollback

Additive only: new component schemas, no path or handler change, no behavior change. er-openapi-check reports additions as compatible. git revert is the rollback.

Post-merge ledger

Closed by: the post-merge watch on 6844d956 and its successor 7cfeafc8

  • main is green with this change on it — 6844d956's own rust
    push run was concurrency-cancelled when fda2fb65 landed behind it, so the
    proof is the successor 7cfeafc8 (has 6844d956 as an ancestor): rust
    success, frontend success, infra success, devcontainer success — and
    6844d956's own frontend/infra/devcontainer/images were green
    before the cancel:
  • images built — success on 6844d956 (er-server's openapi.rs is
    in the api image):
  • deploy converged — success on 6844d956 itself, and again on the
    successor 7cfeafc8; the helm upgrade completed and the new colour rolled
    out (same proof shape as fix(schema): a NOT NULL column with a declared default is additive (#904) #905's REVISION-162 deploy):
  • the push-only surface no pull request can pre-test — deploy green on
    6844d956 and 7cfeafc8; drift latest success; kind nightly latest
    success:
  • the board card reached Done through the automation and 15 entities declare wire: [json] with no OpenAPI component schema — an in-code backlog with no ticket #762 is
    closed (verified on the board, not by hand):
  • follow-ups are open for everything deferred here — numbers: none
    owed beyond what the issue already tracked; the projection-vs-entity
    caveat is recorded in this body's Context for the future per-path
    operations work, which has no ticket yet and needs none until paths are
    added to the document:
  • what was learned is written down — the projection caveat lives in
    this body's Discoveries; JSON_WIRE_WITHOUT_SCHEMA's doc comment records
    that the list emptied here and why de-wiring was rejected for all 15:

Specific to this change

Context — plan, discoveries, measurements, files

Plan

  1. openapi.rs: add the 15 generated structs to ApiDoc's components(schemas(...)); empty JSON_WIRE_WITHOUT_SCHEMA (keep the constant + both guard tests — the must-not-grow gate is the thing that stops this regressing).
  2. Regenerate: cargo run -q -p er-server --bin er-openapi > ../frontend/src/lib/api/openapi.json, then cd frontend && corepack pnpm gen:api.
  3. Verify: cargo test -p er-server openapi (snapshot + both gap guards), the frontend drift check (git diff --exit-code -- src/lib/api/schema.d.ts after gen), make check.

Discoveries — why all 15 register, none drop wire: [json]

Every entity on the list has a live read path in er-server whose rows are served as JSON:

  • Profiling four (profile_run, column_profile, profile_finding, record_quality) — read.rs serves them through the profile/explain and quality endpoints; VALUE_BEARING_COLUMN_FIELDS exists precisely because these rows reach viewers redacted.
  • pair_label — review/labeling path (16 refs in lib.rs).
  • tag / tagging — the tag service merged in feat(tags): reserved system tags, per-tag permission, tags in export (#805) #875 (taggings_index, per-subject reads).
  • entity_link, matching_model — link/model surfaces in lib.rs.
  • ingest_batch, metric_snapshot, metric_snapshot_source, candidate_key — read.rs: ingest activity feed, metrics endpoint, per-run source metrics, and the profile explain endpoint's blocking-key candidates.
  • webhook_delivery — the webhook delivery log (pg.rs/webhook.rs).
  • s3_ingest_cursor — the S3 sources endpoint hand-maps cursor rows into its JSON (lib.rs:7760); the entity's columns ARE the wire shape.

Discoveries — the projection caveat

The registered component is the entity struct; several endpoints serve a projection instead:

  • candidate_key, metric_snapshot, metric_snapshot_source reads return generated row types (ForRunRow, RecentRow, ByRunRow) — subsets.
  • The S3 sources endpoint hand-maps S3IngestCursor rows into a custom object (lib.rs:7760); the profile endpoints redact value-bearing column_profile fields for viewers (VALUE_BEARING_COLUMN_FIELDS).

No contradiction results while openapi.json carries "paths": {} — the components are a vocabulary, not an operation contract. When per-path docs arrive, an operation serving a projection must reference a projection schema, not the entity component. Noted here so the operations ticket starts from it.

Files

  • rust/crates/er-server/src/openapi.rs — registrations + emptied backlog.
  • frontend/src/lib/api/openapi.json, frontend/src/lib/api/schema.d.ts — regenerated.

@athvin
athvin force-pushed the issue/762-openapi-schemas branch from 75954af to 001e3f6 Compare November 8, 2026 20:49
@athvin
athvin merged commit 6844d95 into main Nov 8, 2026
43 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.

15 entities declare wire: [json] with no OpenAPI component schema — an in-code backlog with no ticket

2 participants