Skip to content

BAD CODE™: preserve directive definitions in schema IR #772

Description

@flyingrobots

Evidence

The Profunctor Page block-contract integration in flyingrobots/profunctor-optics-website#53 lowers a directive-authored GraphQL schema through wesley-core 0.3.0-alpha.1. Wesley L1 preserves directive usages but omits the directive definitions that declare argument types, defaults, locations, and repeatability. The consumer therefore has to run a second reference GraphQL schema-validation pass before it can trust the digest-bound Wesley evidence.

Risk

A Wesley IR consumer can observe directive values without being able to prove from that IR that the directives were declared or used lawfully. This splits schema integrity across two parsers and invites validator/lowerer drift.

Acceptance

  • Preserve directive definitions in a versioned schema IR, or expose a validated lowering API whose result binds reference-equivalent SDL validation to the lowered evidence.
  • Cover unknown directives, invalid locations, wrong argument types, omitted defaults, and repeatable directives.
  • Keep canonical ordering and hashing deterministic.
  • Document the compatibility/version boundary for existing L1 consumers.

This is valid integrity debt, not on the current website critical path; leave it unscheduled until Wesley roadmap triage.

Activity

  1. added
    status: non-blockingThis issue is not a blocker for a release.
    work:integrityRemoves lies, drift, flake, or trust debt
    triage:bad-codeDebt intake that still needs scheduling, closure, or a repo move
    legend:SOURCESource/schema/docs truth work
    on Jul 28, 2026
  2. coderabbitai commented on Jul 28, 2026

    @coderabbitai
    🔗 Related PRs

    #513 - expand parity fixture coverage [merged]
    #686 - docs: add plain Wesley onboarding path [merged]
    #687 - docs: publish assurance capability matrix [merged]
    #693 - fix(core): reject duplicate nonrepeatable directives [merged]
    #769 - Remove Weslaw from Wesley [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. added
    legend:SPECSpecification/design work
    v0.3.0Scheduled work for the v0.3.0 release.
    work:enablerCreates capability needed for a later product slice
    on Jul 28, 2026
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

    legend:SOURCESource/schema/docs truth worklegend:SPECSpecification/design workpkg:wesley-corestatus: non-blockingThis issue is not a blocker for a release.triage:bad-codeDebt intake that still needs scheduling, closure, or a repo movev0.3.0Scheduled work for the v0.3.0 release.work:enablerCreates capability needed for a later product slicework:integrityRemoves lies, drift, flake, or trust debt

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions