Skip to content

Schema-as-source-of-truth fan-out codegen: is there a mechanism worth borrowing? #191

Description

@flyingrobots

Source: COOL IDEA™ journal (.claude/cool_ideas.md), 2026-06-28. Speculative and explicitly parked — filed to preserve the open question, not to propose work.

The idea as originally logged

A single schema as source of truth, with generation fanning out to downstream artifacts: Edict source, Rust types, TypeScript types, validators, and golden fixture tests.

The tension that must be resolved first

Edict exists partly because GraphQL was getting unwieldy. So this is explicitly not "lean back on GraphQL." The narrower question is whether there is a mechanism worth borrowing — schema-as-SoT fanning out to generated artifacts including golden fixtures — without re-adopting GraphQL's semantics.

The more interesting inversion: Edict itself becomes the source of truth that fans out, rather than a foreign schema language. The repository already has most of the machinery pointing that way:

  • CDDL documents under docs/abi/ define canonical wire shapes;
  • cargo xtask *-goldens --write regenerates checked artifacts from executable encoders;
  • provider-contract-pack already assembles a self-contained schema document with a verified rule closure;
  • docs/design/schema-as-sot-codegen.md exists as a design note.

Why it is parked

No concrete cost has been paid yet. Revisit if either of these becomes real:

  • fixture authoring becomes expensive enough that hand-writing goldens is a bottleneck;
  • cross-language type drift appears — which requires a second language consuming Edict artifacts, and today there is none.

Ask

None. This is a placeholder for the question so it is not rediscovered from scratch. Close it if the inversion is decided against.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requestedrelease:developer-toolsEditor, grammar, and developer tooling release workrelease:v2-designFuture v2 design work outside the current alpha train

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions