Skip to content

Add typed Python interop contracts #42

@natashaannn

Description

@natashaannn

Add typed Python interop contracts

Objective

Create shared TypeScript interfaces for JSON emitted by Python pipeline steps.


Why this matters

JS/Python boundaries currently rely on implicit shape assumptions.

Typed contracts reduce silent integration failures.


Parallelization metadata

Track

scripts

Depends on

  • none

Safe to run in parallel with

  • pipeline node issues
  • remotion utility issues

Merge risk

  • low

Files in scope

Primary:

  • scripts/types/python-interop.ts

Required implementation

1. Add interfaces for key Python outputs

At minimum include:

  • DiarizationSegment
  • AlignmentResult
  • TranscriberToken

2. Use real current output shapes

Mirror current emitted JSON.

3. Keep additive

No broad script migration yet.


Constraints

  • no runtime validation yet

Handoff contract

Future script migrations should import these instead of inventing local types.


Acceptance criteria

Functional

  • type file compiles cleanly

Integration checks

  • at least one script can import the types

Verification commands

tsc --noEmit

Expected result:

  • zero errors

Explicitly out of scope

  • schema validation
  • Python code changes

Suggested branch

refactor/s6-python-interop

Suggested commit slug

phase-3-step-4-python-interop-types

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions