Skip to content

fix(gcp-cloud-run): the BeginFrame contract image resolves the engine's core import - #5785

Merged
miguel-heygen merged 2 commits into
mainfrom
cloudrender/gcp-image-core
Oct 17, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
cloudrender/gcp-image-core

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

The GCP Cloud Run image's beginframe-contract stage (the GCP BeginFrame image contract CI job) failed on main with Cannot find module '@hyperframes/core' from '/app/packages/engine/src/config.ts'. #5756 made the engine config import the distributed fps set from @hyperframes/core, and that stage copies only the parsers and engine sources before running the engine's buildChromeArgs.

Copying core's source into the stage alone is not enough: core's root entry re-exports ./generated/runtime-inline, a build artifact this stage deliberately never builds. So:

  • The fps set moves to its own core module, exported as @hyperframes/core/distributed-fps (declared in package.json exports, publishConfig.exports and package-subpaths.json, like telemetry-redaction). The core root still re-exports it, so no public import changes.
  • The engine config imports the subpath, the same way the engine already imports @hyperframes/core/audio-fx, audio-gain and the other light core modules.
  • The contract stage copies packages/core/ next to packages/parsers/.

What I measured

  • node scripts/package-subpaths.mjs: "Package subpaths verified: 14 public workspaces."
  • check:gcp-cloud-run-dockerfile: "GCP Cloud Run Dockerfile covers 15 workspace manifests."
  • Real docker build --target beginframe-contract -f packages/gcp-cloud-run/Dockerfile . on a linux/amd64 host (Docker 24):
    • this branch: exit 0; the stage runs buildChromeArgs and the BeginFrame probe against the pinned headless shell.
    • main at the same moment: exit 1 at the same step with error: Cannot find module '@hyperframes/core' from '/app/packages/engine/src/config.ts' (the CI failure).
  • tsc --noEmit clean in core, engine, producer and cli; parseFps.test.ts 25 passed, engine config.test.ts 113 passed.

What I did NOT exercise

  • The full runtime image target and a Cloud Run deploy.

…'s core import

The engine config imports the distributed fps set from @hyperframes/core, and the contract stage of the GCP image copies only parsers and engine sources, so the import failed at build time. The set now lives in a small core subpath (@hyperframes/core/distributed-fps) that the engine imports like its other light core imports, and the contract stage copies core like parsers. The core root export is unchanged.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMMENT at 8e3caf5b. The fix is right, but required CI is red at this head, so no approval yet.

Red: Preflight's oxfmt --check . fails on one file, packages/core/package.json (run 39024586249). Every required check that gates on preflight fails along with it: Render on windows-latest, Tests on windows-latest, regression, Format. The only non-additive edit in that file is the publishConfig key reorder. main/types move ahead of exports and access moves to the end, which looks like the formatting oxfmt rejects. Running bun run format (or reverting the reorder, which changes nothing at runtime) should clear it.

The fix itself checks out:

  • Moving DISTRIBUTED_FPS/isDistributedFps into a standalone distributedFps.ts lets the engine import @hyperframes/core/distributed-fps without pulling core's root entry and its unbuilt ./generated/runtime-inline. That matches how the engine already imports audio-fx and audio-gain.
  • The subpath is declared consistently in exports (bun/node/import/types), publishConfig.exports and package-subpaths.json.
  • The core root still re-exports all three names, so no public import breaks.
  • The Dockerfile adds COPY packages/core/ beside parsers/engine in the contract stage.

Once the format fix is pushed and Build, Typecheck, GCP BeginFrame image contract and the rest are green, re-pin me and I'll approve. No live run: I didn't run the docker build myself.

— Rames

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 199 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen force-pushed the cloudrender/gcp-image-core branch from 8e3caf5 to 9982279 Compare October 17, 2026 10:52

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 99822794. The only commit since my 8e3caf5b comment is style(core): format package.json. It moves publishConfig.access back to the top and main/types back to the end, the original order, which is exactly what was tripping oxfmt. The rest of the diff is unchanged from what I reviewed:

  • a standalone @hyperframes/core/distributed-fps subpath, declared in exports, publishConfig.exports and package-subpaths.json;
  • the core root still re-exports it;
  • the engine config imports the subpath;
  • the contract stage copies packages/core/.

Required CI is green at this head, including Preflight/Format and GCP BeginFrame image contract, which is the job this fixes. No live run (I didn't run the docker build myself; CI's contract job did).

— Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit b18b3e9 Oct 17, 2026
79 checks passed
@miguel-heygen
miguel-heygen deleted the cloudrender/gcp-image-core branch October 17, 2026 11:32
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.

2 participants