Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…anifest provider Covers the delivery step 1 contract: confirmation gating, exit-code precedence, resumable state, duplicate prevention, event stream reconciliation, directive attachment, and the manifest provider. Modules are typed stubs until implemented. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t provider Adds the resumable run engine with duplicate prevention by meta.external_id, event stream reconciliation, and directive attachment; a bun:sqlite state store; a Mux client adapter that never retries asset creation on timeouts or 5xx responses; and the CSV/JSON manifest provider. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Covers JSON and human output, exit codes and next commands for run, plan, status, retry, and export; recipe loading and duration parsing; the mapping export; and the webhook event stream adapter. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds init, plan, run, status, export, and retry. Output follows the migrate contract: newline-delimited JSON events from run, one JSON document from the other commands, and stable error codes with hints and next commands. Run follows the webhook event stream through a new adapter that refreshes credentials and reports reconnects. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checks each ready item's asset status, duration, caption tracks, public playback, and directive runs; records the results for export; re-queues items whose asset was deleted; and reports duplicate assets that share an item's external ID. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Plan now reports item types, skip reasons, total duration and size, expected fidelity, caption languages, configured directives, provider warnings, and a pricing link, without resolving any source URL. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The shared client honors Retry-After, retries 429, 5xx, and network failures with jittered backoff, spaces requests to a rate limit, and maps failures to provider error codes. The Vimeo provider verifies the video_files scope, follows paging.next, filters by processing status, type, folder, and privacy, and prefers the source file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oviders Cloudflare Stream generates downloads on demand and reports pending until they are ready, signs downloads for signed-URL videos, and warns that every item is a rendition. Bunny Stream prefers retained originals, falls back to the highest MP4, signs CDN URLs when token authentication is on, and detects direct-access blocking. Wistia prefers the original file, guards against missing assets, and returns caption text inline with BCP 47 language codes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ing sources Adds a provider registry used by every command and by init, which now lists the credentials each provider needs. Credentials come from the environment, overridden by --credential NAME=value. Captions supplied as text are uploaded to captions.host_bucket and removed once ingested, or saved locally and reported with the command that attaches them. Sources that need preparation are retried within the same run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds a dependency-free SigV4 client covering presigned URLs, ListObjectsV2, and object reads, writes, and deletes, verified against the AWS signature examples. The bucket provider lists media by prefix, extension, and glob, reads JSON and caption sidecars, and presigns each object just in time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ent migrate Uploads caption text to the customer's bucket with a 24-hour presigned URL when the recipe sets captions.host_bucket. Adds the migrate guide to the README and aligns the specification with the provider behavior. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Retry starts a fresh attempt, so a replacement asset completes instead of being reported as a duplicate of the errored one. - A source that fails to resolve, or captions that cannot be stored, error that item instead of stopping the run. Provider and Mux authentication failures stop the run once instead of erroring every item. - External IDs longer than Mux's 128-character limit are hashed and mapped back, and passthrough values over 255 characters are rejected per item before creating an asset. - Runs no longer wait forever on directives that never start a run, on sources that stay pending, or on items outside --ids. - Background reconciles report failures as warnings. - Uploaded captions are cleaned up after ingest finishes and for items that error, and every pending caption gets its own attach command. - verify ignores errored assets and handles hashed external IDs. - Cloudflare paging overlaps by a second so same-time videos are never skipped, and fails instead of looping. Bucket verify reports network failures. Bunny stores poster URLs unsigned and retries a failed CDN host lookup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The wait loop re-read every in-flight item on each state change, so rows read grew with the square of the library (2 million for 2,000 items). Counts now come from indexed SQL queries, --ids is a set, the external ID index reads only IDs, and status uses limited queries. A 10,000-item run reads 20,000 rows. verify stops its duplicate scan at assets created before the migration started. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
engine.ts keeps the public API. A run is now composed of a shared RunContext, AssetCreator (resolve and create), AssetLifecycle (adoption, ready, errored, directive runs, duplicates), CaptionStage (staging and cleanup), and Reconciler (stream events and catch-up), wired together by MigrationRun. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…API settles The Robots Directives API is changing, so v1 no longer attaches directives or tracks directive runs. Removes --directive, --skip-robots, the recipe directives field, the enriching state, and directive checks in plan, verify, and export. A recipe that still lists directives is rejected with a message explaining why. The specification keeps the planned design under Robots enrichment as a fast follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Asset creation is limited to one per second for every token, and other requests to one per second for low-priority tokens. The client now paces creates and reads with token buckets sized to the low-priority limits. Catching up after missed events and verify list assets 100 per request instead of fetching each one, and plan reports the minimum creation time as create_seconds. The docs recommend low-priority tokens for migrations. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… act on Duplicates found by run or verify are saved in the state file and listed by status --json, with a delete command each, and by the mapping export. plan checks recent assets for an earlier migration of the same library and reports PREVIOUS_MIGRATION_FOUND with examples, which run repeats. Nothing is deleted or blocked. run takes a lock on the state file so two runs cannot create the same videos, taking over locks left by exited processes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
mux migrate, which moves a video library from another platform into Mux with one resumable command that is safe for a coding agent to run unattended. The design is inMIGRATE_SPEC.md.Commands
init,plan,run,status,verify,export, andretry.planis free and creates nothing;runrequires--yes. Every command supports--jsonand--agent, and every error carries a stable code, a hint, and anext_command.Exit codes:
0complete,1failed or only errored items remain,2usage or configuration,3confirmation required,4work remains. Re-runningnext_commandon4always makes progress and cannot loop on errors.Sources
Vimeo, Cloudflare Stream, Bunny Stream, Wistia, S3-compatible buckets (with a dependency-free SigV4 client verified against the AWS signature examples), and CSV or JSON manifests for any other platform. All provider HTTP goes through one client that honors
Retry-After, retries 429, 5xx, and network failures with backoff, and maps failures to provider error codes. Credentials come from environment variables, overridable with--credential NAME=value, and are never written to state or output.Safety
meta.external_id({provider}:{source_id}, hashed when longer than 128 characters). Asset creation is never retried on timeouts or 5xx responses, and the SDK's default retries are disabled for it. An interrupted create is adopted from itsvideo.asset.createdevent or from a scan of recent assets on the next run. A second asset is reported asDUPLICATE_ASSET, never deleted.bun:sqlite), written before each network call. Crash-and-resume tests snapshot the database at each transition.mux webhooks listenuses), with reconciliation after reconnects.Captions
Captions passed by URL go straight to Mux. Caption text (Wistia, Cloudflare Stream) is uploaded to
captions.host_bucketand removed after ingest, or saved locally with themux assets tracks createcommand that attaches it.Robots enrichment: on hold
Directive attachment is held until the Robots Directives API settles. A recipe that lists
directivesis rejected with a message explaining why, and the planned design is kept in the spec under Robots enrichment as a fast follow.Testing
1,722 tests pass (2 skipped). Providers are tested against recorded responses shaped after each platform's API docs; no test calls a real API. An end-to-end test runs a Wistia migration through the real engine, state, caption store, status, and export. A separate review pass found 13 issues; each fix has a regression test. State reads stay linear in the library size (a 10,000-item run reads 20,000 rows), and the run engine is split into focused modules under
src/lib/migrate/run/.Not yet run against live provider accounts or a live
run --yes. Before merging, run a pilot withmux migrate run --yes --limit 2 --testagainst a manifest, then each provider. API details the docs did not settle are noted in the provider modules, and are worth checking in that pilot: Cloudflare'safterpaging semantics, Mux ingest of Wistia.binasset URLs, and Bunny libraries with embed token authentication.Open decisions
Companion docs prompt: muxinc/mux.com, branch
docs/prompt-migrate-vimeo.🤖 Generated with Claude Code