conceptadev / conceptadev/ack

Support Standard Schema (standardschema.dev)

Open
#129 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
63
Forks
3
Avg merge
15h 12m
Merged PRs (30d)
12

Description

## Summary

[Standard Schema](https://standardschema.dev/) is a community spec created by the authors of Zod, Valibot, and ArkType. It defines a minimal common interface that validation libraries expose, so ecosystem tooling (AI/agent frameworks, form libraries, server frameworks, routers) can accept *any* compliant schema library without shipping vendor-specific adapters.

It would be great if Ack supported Standard Schema, positioning it as the Dart-side implementation of the spec. Ack is already the "Zod of Dart", and Zod, Valibot, and ArkType all implement Standard Schema — this would complete the story for cross-ecosystem tooling.

## What the spec defines

A compliant schema exposes a `~standard` property containing:

- `version` — spec version (currently `1`)
- `vendor` — the library name (e.g. `"ack"`)
- `validate` — a function that takes an unknown value and returns either `{ value }` on success or `{ issues }` on failure, where each issue has a `message` and an optional `path`
- `types` — inferred input/output types (TypeScript-specific; in Dart this maps naturally to generics)

There is also a companion spec, **Standard JSON Schema**, which defines a standard `toJsonSchema()` conversion. Ack already has JSON Schema export, so this half is arguably most of the way there already.

## Why this fits Ack

- **LLM tooling focus**: Ack's stated focus is structured data for LLM tools. Agent/AI frameworks are exactly the kind of consumers Standard Schema was designed for — they want to accept "any schema" for tool definitions and structured outputs without coupling to one library.
- **Ecosystem interop**: a shared Dart interface would let form libraries, server frameworks, and codegen tools in the Dart/Flutter ecosystem consume Ack (or any future Dart validator) generically.
- **Precedent**: on the TypeScript side, adoption by the big three validators made the spec the de facto integration point (tRPC, TanStack Form, Hono, etc. all consume it). Dart could follow the same path.

## Proposal

Since the spec is TypeScript-native, "supporting" it in Dart means implementing an equivalent contract rather than the literal TS interface:

1. Define a `StandardSchemaV1` abstract interface in Dart mirroring the spec — `vendor`, `version`, and `validate()` returning a success/failure result with spec-shaped `issues` (message + path segments). This could live in a tiny standalone package (e.g. `standard_schema`) so other Dart validators can implement it too, with Ack as the reference implementation.
2. Have `AckSchema` implement it — mapping `safeParse()` to `validate()` and Ack's error type to the spec's `issues` shape.
3. For the Standard JSON Schema half, expose Ack's existing JSON Schema export through the spec's `toJsonSchema()` shape.

Happy to discuss scope — even just the interface + `AckSchema` conformance (steps 1–2) would unblock generic tooling.

## References

- Spec site: https://standardschema.dev/
- Spec repo: https://github.com/standard-schema/standard-schema

Contributor guide

Open the contributing guide

Research direction

Start by locating AckSchema, its safeParse() implementation, and Ack's existing JSON Schema export. Read how validation results and errors are represented, then compare them with the Standard Schema validate contract. Done means defining the proposed StandardSchemaV1 interface and result shapes, making AckSchema conform to it, and determining whether the existing JSON Schema export can expose the requested toJsonSchema() shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.