Skip to content

[audit][area:cli] Give the Studio live wire schema one owner (P2) #3340

Description

@ayden94

Context

Runtime produces Studio events while Studio independently defines and validates the same DTO family.

Evidence-backed findings

  • packages/studio/src/contracts.ts:54-87,203 and packages/runtime/src/devtools/contracts.ts:6-45,153 duplicate the wire contract and already disagree about route kind and params.
  • packages/studio/src/contracts.ts:84,395-396 always materializes default kind and params after parsing.
  • packages/studio/dist/contracts.d.ts:67 still declares those fields optional.
  • .changeset/reject-unknown-studio-route-kinds.md:5 and .changeset/issue-2830-react-page-catalog.md:8 do not describe the parsed-output normalization.

Contract impact and affected surfaces

Producer types cannot compile against the validator's exact accepted schema, and parsed output differs from shipped declaration optionality. Runtime production, Studio validation, bridge implementers, declarations, README, and release metadata are affected.

Preserve-contract resolution direction

Establish one machine-consumed wire-contract seam and keep Studio re-export names compatible. Document normalization, align parsed-result types, and avoid narrowing currently exported optionality unless separately versioned.

Why act now

The duplicated schema has already drifted and every future protocol change compounds the mismatch.

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

    area:cliCLI and scaffoldingpriority:p2Medium prioritysource:package-auditCreated from package-level maintainability audittech-debtRefactoring or debt paydown worktype:maintainabilityMaintainability and long-term quality improvementswave:2Execution wave 2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions