feat(response): response-schema linking — generic/annotation/OpenAPI (5.5)#38
Merged
officialCodeWork merged 1 commit intoJul 15, 2026
Merged
Conversation
…(5.5)
DataSourceNode gains an optional ResponseType { name, fields, source }
(one level of fields); lineage-graph and context-bundle schemas
regenerated, drift gates green.
New response.ts parser module:
- responseFromCall: recovers the type from a call's generic argument
(axios.get<User[]>, useQuery<T>) or, failing that, the annotation on
the nearest enclosing typed variable whose initializer holds the call
(const data: Invoice[] = await fetch(...).then(r => r.json())). Stops at
function boundaries; reads property signatures only (methods skipped).
- loadOpenApi / linkOpenApiResponses: post-pass filling untyped sources
from an OpenAPI 3 JSON spec, matching `${METHOD} ${endpoint}` with
{id}->:id normalization and $ref resolution.
Exposed via the `openapi` scan option and CLI `scan --openapi`. Bundle
lineage dataSources carry responseType; `trace` prints it.
New f4-typed-responses fixture + GoldenResponse / `responses` check kind
covering all three sources. 5 parser unit tests incl. bundle-level.
eval 265/0/0, gate OK.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
TRACKER step 5.5 — Response-schema linking (failure mode F4). Data sources now carry the shape they return, recovered from three sources.
DataSourceNode.responseType?: ResponseType { name, fields: {name,type}[], source }— one level of fields. Lineage-graph + context-bundle JSON schemas regenerated; both drift gates green.response.ts):responseFromCall— a call's generic argument (axios.get<User[]>,useQuery<T>), else the annotation on the nearest enclosing typed variable whose initializer holds the call (const data: Invoice[] = await fetch(…).then(r => r.json())). Stops at function boundaries; reads property signatures only (methods skipped).loadOpenApi/linkOpenApiResponses— a post-pass that fills sources the code left untyped from an OpenAPI 3 JSON spec, matching${METHOD} ${endpoint}with{id}→:idnormalization and$refresolution.openapiscan option + CLIscan --openapi <file>; bundle lineagedataSourcescarryresponseType;traceprints it (→ User[] { id: number, … } (generic)).Accept
f4-typed-responsesfixture exercises all three:/api/users→User[](generic),/api/invoices→Invoice[](annotation),/api/orders→Order[](OpenAPI). NewGoldenResponsetype +responsescheck kind; a control asserts/api/ordersstays untyped when no spec is supplied.Verification
response.test.tswith 5 tests, core 46, agent-sdk 14, vision 3)🤖 Generated with Claude Code