Skip to content

fix(producer): reject impossible distributed durations#1732

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/distributed-infinite-duration-guard
Jun 26, 2026
Merged

fix(producer): reject impossible distributed durations#1732
miguel-heygen merged 1 commit into
mainfrom
fix/distributed-infinite-duration-guard

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Distributed planning now fails fast when a probed composition duration would produce an impossible frame count. Instead of freezing a plan and fanning out chunk work for an unbounded timeline sentinel, plan() raises a typed DISTRIBUTED_DURATION_OUT_OF_RANGE validation error before chunk metadata is written.

Why

A composition can accidentally expose an unbounded runtime timeline as a huge finite duration, for example from an infinite animation loop without an explicit finite root duration. In distributed mode that turns into billions of frames and pushes the failure downstream into chunk workers and orchestration. The producer should reject that deterministic authoring/configuration error at the planning boundary.

How

Added a shared distributed-duration validator with a one-day operational ceiling and wired it immediately after browser probing, before plan freeze and chunk fanout. The typed error code is exported from @hyperframes/producer/distributed so adapters can classify it as terminal while continuing to retry real infrastructure faults.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

Verification run:

  • bun test packages/producer/src/services/render/planValidation.test.ts packages/producer/src/services/distributed/planSizeCap.test.ts packages/producer/src/services/distributed/publicExports.test.ts --timeout 60000
  • bun run format:check
  • bun run --filter @hyperframes/producer typecheck
  • PATH="/tmp/node22-bin:$PATH" bun run lint
  • bun run build:producer

Compound Engineering
GPT--5

@miguel-heygen miguel-heygen merged commit dca5fa9 into main Jun 26, 2026
44 checks passed
@miguel-heygen miguel-heygen deleted the fix/distributed-infinite-duration-guard branch June 26, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant