mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-31 02:45:40 +00:00
refactor(producer): share plan execution builder (#2906)
## What Refactor distributed planning around one shared local execution-plan builder: - `buildLocalExecutionPlan()` now owns compile/probe/extract/audio/freeze. - Legacy `plan()` remains a deprecated v1 transport wrapper. - Plan v2 calls the shared builder directly and publishes through the existing manifest/CAS contract. - Add neutral `createPlanV2FromExecutionPlan()`, `publishPlanV2FromExecutionPlan()`, `getPlanV2ExecutionPlanHash()`, and `PLAN_PROTOCOL_V1` names. - Retain deprecated v1-named exports and wire aliases. - Recommend explicit Plan v2 opt-in for new producer, Lambda, and Cloud Run integrations. ## Why Plan v2 previously looked like it invoked a v1 planner even though v1 and v2 share the same frozen local execution representation. This removes that migration-era coupling while preserving the public minor-version compatibility contract. ## How The shared builder returns neutral internal execution-plan fields. The v1 wrapper maps those fields back to the existing `PlanResult`; the v2 publisher consumes them directly. Compatibility is intentional and covered by exact shape tests: - omitted `planProtocol` still serializes/selects `"v1"`; - v1 layouts, descriptor-less decoding, event unions, workflow branches, and exports remain; - the v1 descriptor JSON is byte-identical and `CURRENT_PLAN_PROTOCOL` is an identity-preserving alias; - v2 manifest bytes, key order, hash framing, and `sourcePlanV1Hash` wire key remain unchanged; - no enumerable neutral hash field was added to manifests or returned result objects; - v1/v2 result objects, cloud event payloads, and SDK handle key sets remain unchanged. ## Test plan - Focused Plan v1/v2/protocol/export/size compatibility: 141 passed - `@hyperframes/core`: 1,419 passed - `@hyperframes/producer` unit lane: 990 passed - `@hyperframes/aws-lambda`: 140 passed - `@hyperframes/gcp-cloud-run`: 101 passed - Producer, Lambda, and Cloud Run typechecks - Repository-wide lint, format check, workspace/package-subpath checks - Full workspace build - `git diff --check` - [x] Unit tests added/updated - [ ] Manual testing performed - [x] Documentation updated (if applicable)
This commit is contained in:
@@ -75,7 +75,7 @@ aws stepfunctions start-execution \
|
||||
"ProjectS3Uri": "s3://${RENDER_BUCKET}/projects/my-project.tar.gz",
|
||||
"PlanOutputS3Prefix": "s3://${RENDER_BUCKET}/renders/$(date +%s)/",
|
||||
"OutputS3Uri": "s3://${RENDER_BUCKET}/output.mp4",
|
||||
"PlanProtocol": "v1",
|
||||
"PlanProtocol": "v2",
|
||||
"Config": {
|
||||
"fps": 30,
|
||||
"width": 1920,
|
||||
@@ -92,7 +92,8 @@ EOF
|
||||
|
||||
The Step Functions execution kicks off Plan, fans out RenderChunk via
|
||||
the Map state, and finally Assemble. Final mp4 lands at `OutputS3Uri`.
|
||||
`PlanProtocol` may be `"v1"` or `"v2"`; absent defaults to v1. V2 uses
|
||||
Plan v2 is recommended for new integrations. `PlanProtocol` may be `"v1"` or
|
||||
`"v2"`; absent still defaults to v1 for backwards compatibility. V2 uses
|
||||
separate manifest and content-addressed artifact locators throughout the
|
||||
workflow and never places a v2 object in `PlanS3Uri`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user