Skip to content

Remove the RunResultDocument workaround once Schema.Class annotations survive the JSON Schema lowering #94

Description

Context

src/schema/result.ts carries a workaround, added in the 2026-09-04 regeneration (#93). The published JSON Schema document is generated from RunResultDocument — a Schema.Struct — rather than from the RunResult class, because core drops a Schema.Class's own title/description when it hoists the class into $defs. Both are built from one shared fields object, so nothing is duplicated, but the second export exists only to work around the upstream gap.

Upstream: spencerbeggs/effected#606.

Removal condition

When a Schema.Class's annotations reach its encoded definition — whether fixed in Effect core, carried by StoreDocument.fromSchema, or exposed as a SchemaTarget annotation override:

  • Move the title/description annotations onto RunResult and delete RunResultDocument.
  • Point the SchemaTarget in lib/scripts/generate-schema.ts back at RunResult.
  • Regenerate. Expect a contract change (the root stops being inline and becomes a $ref), so this needs a RESULT_SCHEMA_VERSION bump, not an in-place rewrite — the generator's gate will refuse otherwise, which is the intended behavior.
  • Drop the now-stale note in src/schema/result.ts and the paragraph in docs/04-output-schema.md.
  • Keep the two RunResultDocument assertions in __test__/unit/schema/result.test.ts in spirit: the published document must still carry a root title and a description ending in a documentation URL.

Re-audit this on every @effected/* bump, per B7's rider and the shim register's own re-audit rule.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions