feat(engine): add container-compatible browser mode - #2
Draft
cwhy wants to merge 6 commits into
Draft
Conversation
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.
Summary
container-compatibleChromium launch mode for non-root Linux containers whose outer runtime rejects Chromium's nested namespace sandbox--site-per-processand preventIsolateOrigins/site-per-processfrom being added to--disable-featurescompletedstatusPage.captureScreenshotdeterministic under explicit frame seeking by adding only--disable-gpu-compositingand--disable-partial-raster; hardware capture and BeginFrame retain their existing paths@hyperframes/cli/browser-profileentry that delegates to the engine's authoritativebuildChromeArgs, so an external harness can attest the same launch profile without copying flagslegacy-unsafe) and opt-instrictbehavior unchangedSecurity boundary
This mode is intentionally not equivalent to
strictmode. Chromium's process sandbox is disabled, so the container or VM must be treated as the primary process-isolation boundary. The intended downstream canary is non-root, ephemeral, credential-free during untrusted rendering, service-only, and separately verifies deterministic frame output and its platform HTTP egress policy.This change does not claim that DNS or raw-socket isolation is proven. It avoids the additional, unnecessary weakening in
legacy-unsafe, which also disables site isolation.Why this mode exists
The strict Chromium sandbox fails to initialize in the target managed-container runtime because the runtime does not permit Chromium's nested namespace setup. Existing
legacy-unsafelaunches there, but also disables site isolation. This mode isolates the minimum compatibility delta so downstream callers do not need to choose the broader legacy profile.The checkpoint protocol is canary-only and inert unless both absolute status and acknowledgement paths are supplied. Each checkpoint maps the exact page target and main frame to a live CDP renderer PID, writes an ordered status document, and blocks until the outer harness acknowledges that exact sequence/target/PID tuple. Any failed, malformed, concurrent, or unacknowledged checkpoint permanently poisons the tracker. Generic cleanup may emit
completedonly after an acknowledged checkpoint, and concurrent cleanup callers share one in-flight close operation. Both status protocols now share a tested atomic mode-0600 writer.The screenshot flags address a separate reproducibility failure found with seekable GSAP pages: Chromium could report the requested DOM/transform state while
Page.captureScreenshotreused stale compositor or partial-raster output. Disabling GPU compositing and partial raster only for the software screenshot profile made repeated, shuffled, fresh-browser, and multi-worker captures converge.--run-all-compositor-stages-before-drawremains BeginFrame-only because adding it to screenshots did not fix this failure and would broaden the behavior change.The public browser-profile entry is intentionally narrow. It bundles the engine implementation into the CLI artifact and exports only
buildChromeArgs; downstream code resolves that reviewed artifact from its pinned image and checks the effective spawned argv. This prevents a second, drifting list of Chromium flags.Validation
npm pack→ install → application-rootrequire.resolve()→ ESM import verifies the bundled browser-profile export and exact flag setThe downstream Creative renderer remains a canary until an exact pinned-image native parity run and route-free hosted probe pass on this final commit. This draft does not activate any product routing.