Repository navigation
fix(aws-lambda): match the shell to its own pin, ship only hashed files, refuse the shell ZIP in CDK and SAM - #8173
Merged
Merged
Conversation
…es, refuse the shell ZIP in CDK and SAM Review follow-ups to the pinned shell route: - build-zip --source=chrome-headless-shell accepts the folder only when its digest is pinned for this version, not for any pinned build. - It leaves out the files the digest skips (debug.log and chrome_debug.log, which Chrome writes as it runs), so nothing unhashed ships. - The CDK construct throws on chromeSource "chrome-headless-shell" and the SAM template allows only sparticuz, as lambda deploy already refused it: a shell ZIP cannot fit a function. The CHROME_PATH wiring for that ZIP is gone with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 66 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
The shipped build-zip script now checks the shell against its own version's pin and skips the files the digest leaves out. That takes the tarball to 81,378 bytes in CI, over the 80,500 budget's 1% tolerance; main was already within about 200 bytes of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miguel-heygen
approved these changes
Nov 18, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 2cfdf891. All three notes from the #8170 review are closed.
Notes
- Closed.
stageChromeHeadlessShell(_chromeHeadlessShell.ts:36-42) hashes thelinux-${managedChromeVersion("linux")}folder and accepts it only if that digest is inpinned[version]. A digest pinned for another build no longer passes. The test "refuses a folder whose digest is pinned only for another build" pins this, and nothing is staged. - Closed. The copy filter skips the same top-level
CHROME_WRITES_WHILE_RUNNINGnames the digest leaves out (chromeHostCeiling.ts:62,96), so every shipped file is hashed.filesUnderstill refuses a symlink or any non-file, and a linked folder failslstat. The test checks thatdebug.logis not staged. - Closed.
zipChromeSourcethrows forchrome-headless-shellbefore synth (HyperframesRenderStack.ts). The SAMChromeSourceallows onlysparticuz, and the danglingHYPERFRAMES_LAMBDA_CHROME_PATHand its condition are gone. Both are covered in the snapshot test.
Nits
- The CDK
chromeSourceprop type still accepts"chrome-headless-shell", a value that now always throws. Narrowing it to"sparticuz"would catch it at compile time (but would break TypeScript callers that pass it today). - The
@hyperframes/aws-lambdapacked budget goes to 82,000 against 81,378 measured, about 0.8% headroom. The file's own rule sets a budget 5% above measured (about 85,400), so the next small change will trip it again. - The digest is computed before the copy, so a file swapped between the two would ship unhashed. This only runs on the build machine, so the risk is low.
Not run: the tests (read against the old code, each new one would fail there).
Verdict: APPROVE
Reasoning: Each note is fixed in the code and pinned by a test that fails without it. What remains are typing and budget nits with no unverified binary path.
2 of 4 tasks
Merged
mvanhorn
pushed a commit
to mvanhorn/hyperframes
that referenced
this pull request
Nov 18, 2026
…eygen-com#8176) heygen-com#8173 set the budget to 82,000 against 81,378 bytes measured, about 0.8% over. The budget file's own rule is 5% above measured, so the next small change would trip it again: ceil(81,378 × 1.05) = 85,447. Co-authored-by: Claude Opus 5.5 <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.
What
Three review follow-ups to #8170:
build-zip --source=chrome-headless-shellaccepts the cached shell only when its digest is pinned for that same version. Before, a digest pinned for any build was accepted.debug.logandchrome_debug.loginto the ZIP. These are the files the digest leaves out, because Chrome writes them while it runs.chromeSource: "chrome-headless-shell", and the SAM template allows onlysparticuz.hyperframes lambda deployalready refused it. TheCHROME_PATHwiring for that ZIP and the unusedBUNDLED_SHELL_PATHexport are removed.Why
PINNED_SHELL_DIGESTSis keyed by version. Flattening it let a folder of one pinned build pass as another version.CHROME_PATHat a file that is not there.Related work
Follows #8170 and #8155.
How
scripts/_chromeHeadlessShell.tstakes the digests as a version-keyed record and checkspinned[version]. It copies with acpSyncfilter that skipsCHROME_WRITES_WHILE_RUNNING, which@hyperframes/engine/chrome-host-ceilingnow exports. That is the same list its digest skips.scripts/package-size-budgets.json: the@hyperframes/aws-lambdapacked budget goes from 80,500 to 82,000 bytes. The shippedscripts/_chromeHeadlessShell.tsnow does the per-version pin check and the copy filter, which takes the tarball to 81,378 bytes in CI. That is over the old budget's 1% tolerance, and main was already within about 200 bytes of it.HyperframesRenderStackrefuses the value inzipChromeSource(), before any resource is built.examples/aws-lambda/template.yamlnarrowsAllowedValuesand drops the condition that setCHROME_PATH. The READMEs say the same.Test plan
build-ziprefuses a folder whose digest is pinned only for another version.build-zipdoes not stagedebug.log.chrome-headless-shellZIP.@hyperframes/aws-lambda: 279 pass. The 2 failures are theffmpeg image fetchcurl tests, which also fail onmainon this host. Typecheck is clean.🤖 Generated with Claude Code