Repository navigation
feat(api): type the 17 operations still publishing {} (#1213) - #1214
Merged
Merged
Conversation
Every 2xx in the internal document now carries a real schema or a
recorded envelope shape: 98 typed, 20 envelope-level, 1 Arrow stream, 0
unconstrained (from 80 / 21 / 1 / 17).
- resolve, blocking-estimate: er-cli's ResolveResult/BlockingEstimate
(and their items) derive ToSchema and are served directly instead of
through serde_json::to_value.
- match-preview: MatchPreviewView/PreviewPairView.
- models: ModelSummary (was model_summary's json!), ModelCompiled and
ModelDetail (flattened summary), and the evaluation as LabelEvaluation/
ConfusionMetrics/CurvePoint/EvaluationCounts under ModelEvaluation.
The existing evaluation tests read the same values via to_value.
- profile: an untagged Profile of ProfileReport | ProfileNotYet, with
typed findings and candidate keys. The 26-field column rows stay Value
because they are redacted per role.
- audit feeds: pg::AuditEntry. connections: SalesforceConnectionItem.
recent imports: read::ImportReceipt. email: EmailAccepted {}.
resources: OrgResources::of.
- internal attempts: WorkOrder, and start/heartbeat/finish serialize the
task through TaskInstanceWire, so these responses no longer echo the
attempt's token_hash. The runner never read those bodies (exec_task.rs).
er-api-spec: the write-path response walk accepts a one-segment turbofish,
Json::<Name>(value) (a POST resolve/compile names its body that way).
Pinned in operations/tests.rs, and mutation-checked by restoring
get_ident.
The api-contract skill's turbofish rule is corrected.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks done
…schema set (#1213) public_operations_are_a_complete_filtered_subset_of_internal passed only ApiDoc's entity schemas to er_api_spec::operations, while add_operations derives against ApiDoc merged with ResponseDoc. attempt_finish is the first handler whose bodies span both (TaskInstanceWire and AttemptRetried), so against the narrower set its envelope looked untyped and the walk reported a mix. document_schemas() is the set the emitted document actually uses; registered_schemas() stays ApiDoc-only for the two entity guards that need exactly that. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GET /v1/internal/attempts/{attempt_id} returned Json(json!(order)),
which the envelope ledger reads as a bare value. It now returns
Json::<WorkOrder>(order), which reads as an unresolved scalar, the same
way a typed GET over a variable always has. The body is unchanged. The
route is internal, called only by the remote runner (exec_task.rs, which
reads it as untyped JSON), and no BFF route or mock fixture reads it:
the one frontend mention is bff-authz-gate.test.ts asserting the BFF
never calls it. Regenerated with the test's own --ignored regenerate.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
marked this pull request as ready for review
November 25, 2026 06:49
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 25, 2026 06:57 — with
GitHub Actions
Inactive
This was referenced Nov 25, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1213
Closes #864
The last #864 batch: the 17 operations still publishing an empty
{}success schema.What
This types the 17 operations that still published an unconstrained
{}success schema. Every 2xx in the internal document now has a real schema or a recorded envelope shape: 98 typed, 20 envelope-level, 1 Arrow, 0 unconstrained (was 80 / 21 / 1 / 17). That meets #864's done-criterion, so this closes #864 too.Covered:
resolve, blocking-estimate, match-preview, models (compile, create, get, evaluation), profile, the two audit feeds, connections, recent imports, email, resources, and the internal attempt endpoints (work order, start, heartbeat, finish).Why
OpenAPI is the customer integration contract (#857).
resolve,models/*,profileandmatch-previeware on the documented workflow.Proof
make check: 1,159 passed, 0 failed.er-server --testsagainst Postgres: 393 passed.tsc --noEmitis clean against the regeneratedschema.d.ts.openapi.json: 0 empty.get_identin the write walk failsregistered_response_types_become_component_references.Risk & rollback
Bodies are value-equal to the old ones, with one deliberate exception. The internal attempt
start,heartbeatandfinishresponses now serialize the task throughTaskInstanceWire, so they no longer echo the attempt'stoken_hash. The runner never read those bodies (exec_task.rschecks the status only).envelopes.jsonchanges one internal line: the work order goes frombaretoscalar. No BFF route reads it.Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-25T07:13:10Zmainis green with this change on it: merge9b5ffc99. The push runsrust45564430875 andfrontend45564430920, plusinfra,devcontainerandmarketing preview, all succeeded.imagesbuilt: run 45564430938, success.deployconverged: run 45565355132 succeeded withDEPLOY_SHA: 9b5ffc99…. Process proof, read 2026-11-25 after SSO was renewed: the live colour in dev (ci/web-api-blue) and prod (app/web-api-green) runser-api@sha256:e935e7e5…. ECR tags that digest8bd3c294(feat(api): self-service API keys — admin minting with a role ceiling, list, show-once UI (#866) #1216's merge), which contains this merge (9b5ffc99) as an ancestor, and both pods logged"er-server listening","addr":"0.0.0.0:8000"at 08:11Z.driftandkindwere already red on schedule before feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202. The nightly golden-50k flake is scale golden (50k) fails deterministically on main since 03792063..ad38be23 (likely the DuckDB 2.0.1 bump) #1206.api-contractskill (the corrected turbofish rule) and memorytyped-responses-864(complete).Specific to this change
Context — plan, discoveries, measurements, files
Plan
er-cli:ResolveResult,ResolveCandidate,BlockingEstimateand its items deriveToSchema(newutoipadependency, from the workspace) and are served directly.MatchPreviewView/PreviewPairView;ModelSummary,ModelCompiled,ModelDetail,ModelEvaluation(LabelEvaluation,ConfusionMetrics,CurvePoint,EvaluationCounts);Profile(an untaggedProfileReport | ProfileNotYet);pg::AuditEntry;SalesforceConnectionItem;read::ImportReceipt;EmailAccepted;OrgResources::of;WorkOrder;AttemptRetried.Json::<Name>(value).api-contractskill's turbofish rule is corrected.response_shape_tests. The existing evaluation tests read the same values viato_value.Discoveries
public_operations_are_a_complete_filtered_subset_of_internalderived operations againstApiDocalone, while the document derives againstApiDocplusResponseDoc.attempt_finishis the first handler whose bodies span both, so the test reported a false mix. It now usesdocument_schemas().#[serde(flatten)]can't be built at theJson(…)call, because the classifier refuses serde attributes there. It is bound to a variable and served by turbofish instead.profile's 26-field column rows stayValue. They are the generated row with value-bearing fields redacted per role, and the reader deliberately avoids restating them.Measurements
Files
rust/crates/er-api-spec/src/operations/{responses.rs,tests.rs},rust/crates/er-cli/{Cargo.toml,src/lib.rs},rust/crates/er-server/src/{lib.rs,read.rs,pg.rs,openapi.rs},frontend/src/lib/api/{openapi.json,openapi.public.json,schema.d.ts,envelopes.json},.claude/skills/api-contract/SKILL.md