Skip to content

refactor: validate external adapter boundaries with zod#20

Open
kastriotkastrati wants to merge 1 commit into
mainfrom
refactor/typed-adapter-boundaries
Open

refactor: validate external adapter boundaries with zod#20
kastriotkastrati wants to merge 1 commit into
mainfrom
refactor/typed-adapter-boundaries

Conversation

@kastriotkastrati

Copy link
Copy Markdown
Contributor

No description provided.

Parse and validate LLM, Slack, and GitHub adapter responses at the door
with zod, so downstream code consumes typed values instead of narrowing
`unknown` with `as`.

- github: lenient looseObject schemas for GraphQL nodes (graphql-schema.ts);
  ghGraphQL/ghRest take a schema and return Result<z.infer<S>>; normalize,
  discover-links, adapter, and auth consume typed nodes — drops the
  Record<string, unknown> threading and the boundary casts.
- slack: schemas for Web API replies in adapter.ts + identity.ts.
- llm: workersAiResponseSchema in extractText.

Parse failure -> Result.Err (or undefined where a Platform port demands it).
Schemas declare only consumed fields + passthrough, tolerant of upstream
additions.
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.

1 participant