Repository navigation
fix(gcp-cloud-run): the BeginFrame contract image resolves the engine's core import - #5785
Conversation
…'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
left a comment
There was a problem hiding this comment.
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/isDistributedFpsinto a standalonedistributedFps.tslets the engine import@hyperframes/core/distributed-fpswithout pulling core's root entry and its unbuilt./generated/runtime-inline. That matches how the engine already importsaudio-fxandaudio-gain. - The subpath is declared consistently in
exports(bun/node/import/types),publishConfig.exportsandpackage-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
Edit accuracy: accurate 271 (base branch 271), smooth 199 of thoseThe gate passes. Quarantined, measured but not gated (0) |
8e3caf5 to
9982279
Compare
jrusso1020
left a comment
There was a problem hiding this comment.
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-fpssubpath, declared inexports,publishConfig.exportsandpackage-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
What changed
The GCP Cloud Run image's
beginframe-contractstage (theGCP BeginFrame image contractCI job) failed on main withCannot 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 theparsersandenginesources before running the engine'sbuildChromeArgs.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:@hyperframes/core/distributed-fps(declared inpackage.jsonexports,publishConfig.exportsandpackage-subpaths.json, liketelemetry-redaction). The core root still re-exports it, so no public import changes.@hyperframes/core/audio-fx,audio-gainand the other light core modules.packages/core/next topackages/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."docker build --target beginframe-contract -f packages/gcp-cloud-run/Dockerfile .on a linux/amd64 host (Docker 24):buildChromeArgsand the BeginFrame probe against the pinned headless shell.error: Cannot find module '@hyperframes/core' from '/app/packages/engine/src/config.ts'(the CI failure).tsc --noEmitclean in core, engine, producer and cli;parseFps.test.ts25 passed, engineconfig.test.ts113 passed.What I did NOT exercise
runtimeimage target and a Cloud Run deploy.